Repository navigation
feat(app): Android Auto error states, Stations tab, and a build flag - #17
Draft
perminder-klair wants to merge 1 commit into
Draft
perminder-klair wants to merge 1 commit into
perminder-klair wants to merge 1 commit into
Conversation
A failed car pick now shows the car why (the RNTP patch's MediaBrowserBridge.showError, through setCustomErrorMessage), cleared on the next pick and when audio plays; a cold start with no session fails in 8 s with an error session instead of waiting forever; the root is one browsable Stations tab (active station first, root hints honoured) with an empty state; CarCallers admits Gemini and, in debug builds, Media Controller Test. Android Auto is now off unless SUBWAVE_ANDROID_AUTO=1 at prebuild (plugins/withAndroidAuto.js): unset, the merged manifest declares no car support. eas.json gains production-auto (Play closed testing, submit track alpha) and apk (sideload); docs/RELEASE.md has the plan.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Android Auto, made reviewable and switchable:
MediaBrowserBridge.showErrorcalls ExoPlayer'ssetCustomErrorMessage, which puts the session inSTATE_ERRORwith the message, and Auto shows it in place of Now Playing. The next pick clears it, and so does audio playing.setupPlayerrejects or no token arrives, the car gets an error session (SUB/WAVE couldn't start. When it's safe, open SUB/WAVE on your phone.), and the pending React Native start is reset.CarCallerslets in the Gemini app (guideline VC-1; the package is unconfirmed until logcat on the DHU shows it) and Google's Media Controller Test, in debuggable builds only.plugins/withAndroidAuto.jsdeclares the browse service, the car meta-data and the automotive descriptor only whenSUBWAVE_ANDROID_AUTO=1. Unset, the merged manifest has no Android Auto support at all.eas.jsongainsproduction-auto(Play closed testing) andapk(sideload), andproductionstays without it.Messages, each sending the driver to the phone only "when it's safe" (guideline VI-1):
not-savedERROR_CODE_NOT_SUPPORTEDno-stationERROR_CODE_NOT_SUPPORTEDlockedERROR_CODE_AUTHENTICATION_EXPIREDunreachableERROR_CODE_APP_ERRORSession restart mid-drive, documented rather than rebuilt. Reading RNTP 4.1.2 shows the dead-session case is narrow. Swiping the app away runs
onTaskRemoved, which callsexitProcess(0), so the car rebinds to a fresh process. A JS reload keeps the sameMusicServiceand session, becauseMusicModulenever unbinds andMusicService.setupPlayerreturns early once its player exists.MediaBrowserServiceCompat.setSessionTokenthrows on a second token, so a bound instance can't be repointed. The existing "answer no root until the clients unbind" stays, and TESTING.md says why.The decision this PR doesn't make: Play's TTS policy
Play enforced against the first car listing (#477, 20 Jun 2026): media apps that use a TTS engine to read out content aren't permitted. A browse tree and error states don't answer that; nothing in code does.
docs/RELEASE.md→ Android Auto: closed testing first has the plan:production-autoto Play's closed testing track (alpha). Google's car review is non-blocking there and blocking on open testing and production, while internal testing gets no car review, so internal would never tell us whether the listing passes.production).apkbuild on GitHub Releases and the website, with the Android Auto developer mode → Unknown sources note, and the note that a Play install and the APK can't update each other.Whether to make that second attempt at all is yours to call.
Changes
patch-package, only theMediaBrowserBridge.kthunk changed):showError/clearErrorand aPlayer.Listenerthat clears on play.modules/android-auto:SubwaveBrowseService(tab root, hints, empty state, connect timeout, error session),CarConnectTask.reset,CarStationsactive-first,CarCallers(Gemini, MCT in debug), module functionsshowError/clearError/setupFailed, strings inres/values/subwave_android_auto.xml. The module manifest now declares nothing.src/intents/car-errors.ts(new),car-picks.ts(clear on each pick, show only the latest failure),tune-flow.ts(TuneReplywithreason,station; the Swift bridge still reads onlyok,message),tune.ts(activeStationLocked),car.ts(setup failure →carSetupFailed),service.tswiring.plugins/withAndroidAuto.js(new), inapp.json;eas.jsonprofilesproduction-auto,apkand submitproduction-auto→alpha, draft.Evidence
npm test: 612 pass, 5 skipped, 0 fail (617). New:scripts/android-auto-plugin.test.ts(flag unset,"",0,true,yesand" 1"declare nothing and write no descriptor;1declares the service, the meta-data and the descriptor once, even across two prebuilds; a later flag-off prebuild removes them; the module manifest declares nothing), and inscripts/android-auto.test.ts/intent-tune.test.ts: each error's message and its VI-1 wording, a pick and a prepare clear the last error, only a failed stream asks for the lock, a failing lock check reads as unreachable, an older pick's failure never covers a newer one,CAR_ERROR_KINDSmatches Kotlin'serrorCode, the car-connect task reports a setup failure, andTuneReplyreasons.npm run lint: no errors (the existingonboarding.tsxwarning).npx expo prebuild -p android --clean+./gradlew :app:assembleDebug(JDK 17,/opt/homebrew/opt/openjdk@17; Android Studio's bundled JBR is 25, and TESTING.md says 21+ fails), both flag states: BUILD SUCCESSFUL.app/build/intermediates/merged_manifests/debug/processDebugManifest/AndroidManifest.xml) has noSubwaveBrowseService,gms.car.application,MediaBrowserServiceorautomotive, and the APK has nosubwave_automotive_app_desc.xml.com.google.android.gms.car.applicationmeta-data and theSubwaveBrowseServicewith its intent filter; the APK carriesres/xml/subwave_automotive_app_desc.xml.npx expo-updates fingerprint:generate --platform androidgives the same hash with and without the flag (289eeda…), so oneeas updateonproductionreaches all three Android builds.patch-packagebefore any Gradle build populated RNTP'sbuild/; only theMediaBrowserBridge.kthunk changed.MediaSessionConnector.setCustomErrorMessage(CharSequence, int)was checked in ExoPlayer 2.19.0's bytecode: a custom error sets state 7 (STATE_ERROR) andsetErrorMessage.Merge Danger
Door: two-way in code, one-way at Play review
Flag off, the build declares nothing for the car, so merging changes no listing. The first
production-autoupload to closed testing starts Google's car review; a rejection there doesn't block the track, andproductionstays the flag-off fallback.Blast Radius: every Android listener (native), car users (behaviour)
The patch hunk runs in every Android session: a
Player.Listenerthat only clears an error it set, and a connector reference. With the flag off, nothing binds to browse, so the car-connect task, the timeout and the background-setup bypass never run.TuneReplyadds optional fields that iOS's bridge ignores. Native, so it ships in a new binary, not over the air.Device checks still needed
Nothing here has run on a phone, the Desktop Head Unit or a car (this Mac has no DHU, no emulator image and no device attached). TESTING.md → Testing on a phone with the Desktop Head Unit has the full list:
dumpsys media_sessionstate 7)pm clearforce-stop: plays, or shows couldn't start with acar setup failedline or the 8 s timeoutCarCallersif it isn'tcom.google.android.apps.bard)eas build --profile apk, orassembleReleaseafter a flagged prebuild) for R8 and the reflection keep rules