Skip to content

feat(mobile): add Android Live Update mock preview#3802

Draft
juliusmarminge wants to merge 1 commit into
android-dev-pr-3514from
t3code/research-android-live-updates
Draft

feat(mobile): add Android Live Update mock preview#3802
juliusmarminge wants to merge 1 commit into
android-dev-pr-3514from
t3code/research-android-live-updates

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Jul 8, 2026

Copy link
Copy Markdown
Member

Important

This is a stacked draft based on #3579 (android-dev-pr-3514). Review and merge #3579 first. After that lands, this PR should be rebased or retargeted onto main.

Why

Android 16 adds promoted ongoing notifications, the closest Android system surface to the iOS Live Activities currently provided by expo-widgets. This PR establishes the native Android and TypeScript seam and makes it testable with local mock states before we add relay-driven delivery.

Promotion remains controlled by Android. Unsupported devices, or devices where promotion access is disabled, fall back to a normal ongoing notification.

Built in this PR

  • Adds a local Android Expo module for a single agent Live Update notification.
  • Requests POST_NOTIFICATIONS and POST_PROMOTED_NOTIFICATIONS.
  • Builds an ongoing, private, progress-category notification with:
    • setRequestPromotedOngoing(true)
    • short critical text for the system chip
    • stable tag/ID updates
    • up to three agent-status rows
    • content intent back to T3 Code
    • a Stop action and dismiss receiver
  • Exposes promotion support, notification permission, promotion access, active/promotable/promoted state, and promotion settings to TypeScript.
  • Adds two development-only mock states in Settings:
    • 3 agents working
    • 1 agent needs attention
  • Adds controls to end the mock update and open Android's promotion settings.
  • Documents Android Studio, JDK 17, SDK 36, and API 36.1 ARM64 emulator setup.
  • Pins generated Android subprojects to React Native's configured NDK version so clean builds do not retain two multi-gigabyte NDK revisions.

Deliberately not built

  • No relay integration.
  • No FCM registration or remote notification update path.
  • No server or shared-contract changes.
  • No aggregation of real agent/session state into Android snapshots.
  • No background update/reconciliation path for a killed app.
  • No persistence, expiry, stale-state recovery, or multi-environment prioritization policy.
  • No production user-facing controls; the preview UI is Android + __DEV__ only.
  • No physical-device/OEM matrix or Play policy validation yet.
  • No changes to the existing iOS Live Activity implementation.

The future relay integration can call the typed show(snapshot) / cancel() seam added here without changing the native notification contract.

Validation

  • Full ARM64 development APK assembled successfully:
    • NODE_ENV=development APP_VARIANT=development ./gradlew :app:assembleDebug -PreactNativeArchitectures=arm64-v8a --no-parallel --max-workers=2
  • Installed and exercised on a Pixel 9 API 36.1 ARM64 emulator running Android 16.
  • Verified both mock states update the same notification in place.
  • Verified Android reports ONGOING_EVENT|ONLY_ALERT_ONCE|PROMOTED_ONGOING.
  • Verified the Settings status refresh reports an active promoted Live Update.
  • Verified the notification Stop action cancels the update.
  • vp check — passes with 0 errors (30 existing warnings).
  • vp run typecheck — passes.
  • vp run lint:mobile — passes with zero native violations.

Note

Add Android Live Update mock preview to Settings screen in dev builds

  • Adds a new native Android Expo module (T3AgentLiveUpdate) that creates a notification channel and manages an ongoing 'Agent live updates' notification, including support for Android 13+ permission checks and promotable notifications on supported API levels.
  • Adds a JS wrapper in androidLiveUpdate.ts exposing typed functions to show/cancel mock notifications ('working' and 'attention' presets), query status, and open promotion settings.
  • Adds AndroidLiveUpdatePreviewSection.tsx to the Settings screen, visible only on Android in __DEV__ builds, allowing developers to trigger and inspect mock Live Update notifications.
  • Adds a withAndroidUnifiedNdk config plugin that pins all Android subprojects to a single NDK version during prebuild to avoid mixed NDK downloads.
📊 Macroscope summarized 8ce6e93. 12 files reviewed, 0 issues evaluated, 0 issues filtered, 0 comments posted

🗂️ Filtered Issues

No issues evaluated.

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 6f5b04a4-ee30-443d-883d-da0a9caea25e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch t3code/research-android-live-updates

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XL 500-999 changed lines (additions + deletions). labels Jul 8, 2026
@juliusmarminge juliusmarminge force-pushed the t3code/research-android-live-updates branch from 49e4278 to 8ce6e93 Compare July 8, 2026 13:06
.putExtra(Settings.EXTRA_APP_PACKAGE, context.packageName)
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)

try {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium t3agentliveupdate/AgentLiveUpdateManager.kt:105

openPromotionSettings() can still crash with an uncaught ActivityNotFoundException on devices where both ACTION_APP_NOTIFICATION_PROMOTION_SETTINGS and ACTION_APP_NOTIFICATION_SETTINGS have no matching activity. The catch block only guards the first startActivity call, but the fallback startActivity(appNotificationSettingsIntent()) at line 108 runs unguarded. Consider wrapping the fallback call in its own try/catch so a missing activity doesn't crash the app.

🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file @apps/mobile/modules/t3-agent-live-update/android/src/main/java/expo/modules/t3agentliveupdate/AgentLiveUpdateManager.kt around line 105:

`openPromotionSettings()` can still crash with an uncaught `ActivityNotFoundException` on devices where both `ACTION_APP_NOTIFICATION_PROMOTION_SETTINGS` and `ACTION_APP_NOTIFICATION_SETTINGS` have no matching activity. The `catch` block only guards the first `startActivity` call, but the fallback `startActivity(appNotificationSettingsIntent())` at line 108 runs unguarded. Consider wrapping the fallback call in its own try/catch so a missing activity doesn't crash the app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL 500-999 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant