Skip to content

Inbox mobile contract: the Android addendum (C2) - #1827

Merged
backnotprop merged 2 commits into
mainfrom
docs/mobile-contract-android
Oct 10, 2026
Merged

backnotprop merged 2 commits into
mainfrom
docs/mobile-contract-android

Conversation

@backnotprop

@backnotprop backnotprop commented Oct 10, 2026 •

Copy link
Copy Markdown
Owner

Step C2 of the Android plan. A document change only: it adds section 10, "The Android addendum", to adr/implementation/inbox-mobile.md, so the Android lanes have a written contract to build against, as the iPhone lanes had C1.

What the addendum settles for the Android lanes:

  • Platform: the redemption sends platform: "android" and the device record keeps it. The package is ai.plannotator.app, and the floor is Android 13 (API 33).
  • Push (R3): a new route, PUT .../devices/:dev/fcm, sits beside .../apns. A device holds one push token at a time. hello gains fcm. The FCM HTTP v1 message is data only ({ "e": "<envelope>" }, android.priority: high, collapse_key = the collapse id), so the app draws each notification itself. New push answers: no_fcm_key, fcm_gone and 502 fcm_failed. With neither token the relay answers no_push_token from R3 on; a relay before R3 answers no_apns_token. The Inbox treats both alike (it only logs the reason). The size ladder is unchanged and still measured against the APNs body, which is larger than FCM's data for the same envelope. FCM's UNREGISTERED deletes the token, as Apple's 410 does. The section also covers token refresh (onNewToken, a check at each start, null when notifications are off).
  • Notification (A5): one high-importance "Questions" channel. Every push shows a notification, and the lock screen shows a public version. A question with up to three choices gets one action per choice, each set with setAuthenticationRequired(true). A question with four choices gets one "Answer" action that opens the thread.
  • Surface bridge (S2, A2): the shell serves from https://appassets.androidplatform.net (WebViewAssetLoader's virtual origin), not a custom scheme. The reason: addWebMessageListener origin rules match only http and https, and the * rule would also give the bridge to the agent's opaque frame. The channel is window.plannotatorShell (a JSON string), and the shell takes messages from the main frame only. There is no network, by two means: the CSP on every response, plus setBlockNetworkLoads with shouldInterceptRequest refusing every request off the virtual origin. WebSockets do not pass through interception, so they rest on connect-src 'none' and the blocked loads; the device spike must prove this. The touch window and the link rules carry over.
  • Platform notes: the Keychain becomes the Keystore, the notification service extension becomes FirebaseMessagingService, and SFSafariViewController becomes Custom Tabs. One line covers the other side: it serves assetlinks.json and sends FCM for its own source.

Still pending: the four-choice notification layout. The owner has not ruled yet. The section writes the "Answer" action as the default and notes the alternative, a custom four-button layout.

Checks: gitleaks range scan clean; Semgrep (the pinned CI image, .semgrep.yml) scanned no targets, which is a pass for a doc change.

@backnotprop
backnotprop merged commit 177c340 into main Oct 10, 2026
28 checks passed
@backnotprop
backnotprop deleted the docs/mobile-contract-android branch October 10, 2026 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant