Skip to content

waze-on-cluster: Android Auto self-start waits for the cluster display; Android Auto always comes back - #215

Merged
robertnisipeanu merged 2 commits into
mainfrom
aa-recovery-strict-verify
Nov 18, 2026
Merged

robertnisipeanu merged 2 commits into
mainfrom
aa-recovery-strict-verify

Conversation

@robertnisipeanu

@robertnisipeanu robertnisipeanu commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

Android Auto could drop out with the Android Auto patch installed and come back only after a head-unit restart (mgu-store#326). This fixes the cause in the patch, makes the locator check more of each build, keeps Android Auto running whatever happens to aapd, and adds what an aapd failure needs to Save logs.

The patch. The self-start edit makes onNewNavigationStatus() call requestStream(), which calls the cluster display's SetVideoFocus(). Cinemo refuses that call until the phone has set its cluster display up ("Unable to SetVideoFocus() without active player or correct configuration!"); throwOnCinemoError throws and nothing catches it, so aapd aborts (SIGABRT). That happens on a navigation status before the display is ready, after a session ends, or with a phone that offers no cluster display. The guard edit now replaces requestStream's opening test with cluster display ready ([this+0x41], set by onAlternateVideoReady(), cleared by onEndSession()) and not streaming, the same precondition the car's own request has. It is 16 bytes at 0x1d3f53 in aapd 22.39.3; the guard written by earlier releases reads outdated and an install replaces it. The patch record keeps the patch revision (rev, 2).

Checks, no build list. Besides the existing ones, the locator requires: requestStream's test reads its own this; onAlternateVideoReady() sets exactly one byte flag and subscribes to the stream commands; onEndSession() clears that flag, the stream status and the focus mode the test uses; the patched test reads that flag; initAlternateDisplays() and every branch into onNewNavigationStatus() test the gate's kept result. A build of another version patches when its code has this shape; one that does not is refused with the reason and left as it is. Each check alone refuses a changed build in aapd_locate_test.js. aapd_patch.js probe (woc-patch.sh aa-probe) prints every site's offset, bytes and both forms.

Recovery. A crash of the patched aapd restores the original at once (watcher or boot step), before the start, and records why (crash or boot) and the removed patch's rev. aapd is started again after every end the watcher sees (a crash, a SIGKILL patchd did not send, a clean exit), 2, 5, 15 and 30 s after the first ends in a row, then every 60 s, with no limit; a run healthy for 60 s makes the next start quick again. A crash of the run that was up when an install wrote a new patch (it runs the replaced file) is not counted. The patch stays off until its Patch button applies it or an install brings a newer revision; patchd reports recoveredWhy with recovered. Nothing here restarts the head unit. CarPlay's recovery is unchanged.

Save logs adds this boot's journal of aapd and the Android Auto boot step, aapd and the boot step in the kept journal, aapd-probe.txt, and aapd-crashes.txt: of the crash handler's records of aapd's newest 3 crashes only the signal, kernel stack, executable mappings, crash ids and summary (instruction and return addresses), never the environment, open files, memory or the core dump.

The app's Status text for a crash restore is #216.

AI: Claude Code, Claude Opus 5.5 (investigation, implementation, review).

Tested:

  • make test-node suites with aapd 22.39.3, its aapd.conf, carplay 22.28.3 and aapd 23.16.5 (iD8, still refused): all pass. rollback_conf_test.js checks only the releases that read a local conf (their shipped conf sets local_conf; 0.10.10 does not), so it no longer fails on 0.10.10 as it does on main. aapd_locate_test.js: 87 changed builds, 82 refused, 5 located correctly, none wrongly; every check proven.
  • On a test unit with iD7 software and Maps on cluster 0.10.10 installed (no phone session is possible there):
    • reproduced the abort: a requestStream() call before the cluster display is set up ends in terminate called after throwing ... CinemoException and status=6/ABRT; with the new guard the same call logs Ignoring event. Already streaming... and aapd stays up;
    • an install over the 0.10.10 patch writes the new one; a crash of the aapd still running the old file is not counted and the new file starts; a crash of the new patched aapd restores the original in about 0.25 s and starts it 2–5 s later;
    • the stock aapd ended 10 times in one boot (SIGSEGV x7, SIGKILL x2, SIGTERM) came back every time at 2/5/15/30/60 s, with no head-unit restart;
    • three changed aapd builds (a patched-site byte changed, requestStream's object register changed, its test shifted by a byte) refused by install and Patch, files left as they were; the shipped build patched;
    • an install with an older-revision restore applies the patch again; with the same revision it leaves it off and says why;
    • Save logs writes aapd-crashes.txt and aapd-probe.txt as above.
  • Not tested: a phone session (Android Auto with a phone on the cluster), on a real car.

Human review: none before opening.

Screenshots: n/a (nothing on screen changes in this pull request).

🤖 Generated with Claude Code

…y; stricter aapd checks; Android Auto always restarted

requestStream's opening test reads the cluster display's ready flag, so the
self-started request no longer reaches SetVideoFocus before the phone has
set its cluster display up (Cinemo refuses it, aapd aborts on the uncaught
exception). The locator ties the self-start to the session start and end,
the gate's kept flag to the code it turns on, and reads the earlier guard as
outdated. A crash of the patched aapd restores the original at once, aapd
is started again after every end with a growing delay, and the patch stays
off until its Patch button or a newer patch revision applies it. Save logs
adds aapd's journal, the crash handler's record of aapd's crashes and the
patch's site report.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… a local conf

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@robertnisipeanu
robertnisipeanu merged commit a530d9b into main Nov 18, 2026
16 of 18 checks passed
@robertnisipeanu
robertnisipeanu deleted the aa-recovery-strict-verify branch November 18, 2026 14:18
1031527554 added a commit to 1031527554/idrive-apps-ls that referenced this pull request Nov 19, 2026
…6.12); drop Map layout

Upstream removed the plumbing this fork's Map layout stood on: PR robertnisipeanu#214 takes
away the `target` setting, `map_rect`'s part in choosing a target and the
control socket's `start` command, so the cluster map always goes on its own
map slot (or into a hosting app's scene). The fork's Full width and Full
screen cannot exist without it, and the owner uses Central — what upstream
does now — so the feature goes rather than diverge.

`native/waze-on-cluster` and `apps/robertn_waze_cluster` are upstream's trees
again, which removes the app's Map layout row, its locales words, the tool's
`map_layout.h`, the `layout` config key, control command and status field,
`patchd`'s `saveLayout`, and both sides' tests. `MAINTAINING.md` records what
the fork used to carry and why neither feature is here.

Also in this range: Android Auto no longer drops out until a head-unit
restart (the self-start edit waited for the cluster display, robertnisipeanu#215), no local
conf is read any more, an accepted-but-never-completed fetch is recovered,
the upload ceiling is remembered across drives, the arrival-time card is
asked for in the ShowUI URL, and Save logs scrubs secrets, USB serials and
the VIN.
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