Repository navigation
Conversation
A restart takes the reverse camera's picture away for about a minute, and on 2026-11-27 a NEMESIS install (no HMG-API) cut off by a shift into reverse left a unit that didn't start. So every restart path, every change to /system and every install or update now reads gear.park first. - hmgapid reboot: refused out of P (75); with no gear reading refused (76) unless --gear-unknown-ok. - Engine: apply and restore that change files (and so may hold system apps), and update-hmgapi, check the gear (Gear): not in P 75, no reading 76 unless --gear-unknown-ok. The apps hold() stops are written down first (state/held.txt) and turned on again by the next start's recover, since pm disable lasts across restarts. - install.sh and uninstall.sh (every route): gear_gate in lib.sh, not in P stops with nothing changed, no reading warns and goes on. They and the USB installer ignore a closed pipe and hang-ups, and each file is synced before its rename. The USB installer's toasts say to stay in P, and its restart waits while the car isn't in P. - boot.sh: the restart after a rollback waits in the background until the car is parked (parked state, or P with the car off); no reading for 10 minutes: no restart, and a notice for the app. - The vehicle service always runs, so every car with a gear point gives the reading. - App: Restart, Apply (when files change), Install and Update HMG-API check the gear first (Park), say to stay in P, and ask the owner when the car gives no reading. Tested off-car only (tools/test-all.sh --fast all pass; the ARM tests could not run on this machine). What shifting into reverse does to a running install on a car is still to check: docs/car-test.md 10b. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t allowed (13) An op the app's uid may not use answers 13 before the root-only check that answers 2, as for every other op. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
stagedIn puts them in mods/ right before an apply plans, and they went back only when the plan was refused. An apply that fails part-way (an exception, the files rolled back or left for recover) left them in mods/, where their code loads at the next boot, on /system files built for the versions before them. Found combining the open PRs: with #433's gear check and #434's in-run rollback there are more such paths; whichever lands after this puts them back there too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…estart-in-park # Conflicts: # CHANGELOG.md
VysseCodes
left a comment
There was a problem hiding this comment.
state/held.txt: #434 adds a fuller version of the held-apps journal (written beforepm disable, released on recover). Please drop that part from this PR and keep it about the gear check.- Description: it names
CatalogActivity/ModUpdatesActivity; the code hasCatalogTab/UpdatesTab. - Merge order: #434 → #430 → #433, so this one rebases last.
More review on the "not in P" case to follow.
|
@Open-HMG/maintainers, input wanted on one design question before this goes in. When the gear reads "not in P", should the owner be able to override? As written, "not in P" has no override (only "no reading" has Options:
Which do you prefer, and why? |
#434 writes down the apps an apply stops before pm disable and turns them on again at recover, more fully than this PR did. Take state/held.txt out of the engine, boot.sh, the tests, the changelog and the car test, so this PR stays about the gear check. The rest of the cut-off-install hardening (ignoring a closed pipe, syncing before each rename) stays. Tested off-car: tools/test-all.sh --fast, 32 ok, 1 skipped (no ImageMagick). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
My vote: 2, plus an explicit override for the rest.
A wrong map reading then costs one extra tap instead of a lockout, and nothing restarts the head unit while driving unless the owner says they're parked. I won't implement it until the maintainers agree. |
…tart with the car in P From AwsomeFox/fix/restart-in-park (Open-HMG#433). # Conflicts: # CLAUDE.md # core/hmgapid/hmgapid.c # core/runtime/java/hmgapi/engine/Engine.java # core/runtime/java/hmgapi/engine/ModRuntime.java
…gear check reads through it) Taken from upstream's integration branch (Open-HMG#440, 6264f2d): Open-HMG#433 runs the vehicle service always, so live-test and safe-test expect it. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…o fix/restart-in-park # Conflicts: # CHANGELOG.md
|
Decision: option 2.
I know the vote was 2 plus an override for the rest. I'd rather not have a "not parked" override at all: if a car's map reads P wrong, the fix is the map, and uninstall is always there in the meantime. Since this is a block with no override, please add it to the exceptions in CLAUDE.md's Recommendations section in this PR. Merge order is unchanged: #434 → #430 → #433. |
The review's decision (option 2): a car whose gear.park reads 0 while parked must never be kept from stock. uninstall.sh (gear_gate ... warn) and engine restore, its first half, now warn out of P and go on. Restarts, applies, installs and updates are still refused out of P with no override; a map that reads P wrong is fixed in the map. The USB uninstall reads the gear before it runs (the uninstall takes hmgapid away). Out of P it uninstalls, doesn't restart, and its toast says to restart once in P. CLAUDE.md's Recommendations now list this as an exception: no override for "not in P", and the way back to stock never refused. Tested off-car: engine-test, install/common/test.sh, the NEMESIS mod and sync tests and check-scripts pass. install/usb/test.sh (its new uninstall-out-of-P case) needs the ARM payload build, so CI runs it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
HMG-API 2.0 refuses installs, updates and restarts unless hmgapid's gear.park reads 1 (Open-HMG#433, no override), and there is no reading from this car yet. The logger now asks for it every 5 s in the background, like the ignition, and notes it under the HMG-API tag at each log's start and whenever it changes: 1, 0, "-" (the car didn't answer), no answer or no reading. gear.park is declared in mod.json; a test checks every reading the script asks for is declared. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
For the "no gear reading" case: #489 gives a reading on cars without a hook map. The gear point is a stock Binder service (
With both, |
A restart takes the reverse camera's picture away for about a minute (Android shows it on these units), and on 2026-11-27 a NEMESIS install (no HMG-API) cut off by a shift into reverse left a unit that didn't start. Every restart path, every change to
/systemand every install or update now readsgear.parkfirst.The rule
uninstall.shandengine restorewarn out of P and go on. The USB uninstall then doesn't restart (a restart is still only in P) and its toast says to restart once in P. Listed as an exception in CLAUDE.md's Recommendations.hmgapid rebootand the engine refuse (exit 76) unless given--gear-unknown-ok; the app passes it only after the owner taps "It's in P: go on". The USB, NEMESIS and adb routes have no one to ask: they warn to stay in P and go on.Where
hmgapid reboot(C,op_reboot/gear_park): every restart.Gear.java):apply/restorewhen files on/systemchange (so also beforehold()), andupdate-hmgapi.install.sh/uninstall.sh:lib.shgear_gate, before anything changes (gear_gate ... warnfor the uninstall). NEMESIS mod package scripts pass--gear-unknown-ok(same policy).boot.sh: the restart after a rollback waits in the background (never holds the boot) for the parked state, or P with the car off (P for two minutes if power can't be read). No reading for 10 minutes: no restart,public/restart-neededfor the app.Park.java): Restart unit, Apply (when system files change), Install, Update HMG-API and both "Restart now" buttons.Robustness to a cut-off install
What reverse does to a running install on a car is not checked yet (
docs/car-test.md10b lists what to look for). Hardened meanwhile:install.sh,uninstall.shand the USBtroubleShooterignore SIGPIPE/HUP/INT/TERM: a closed screen (Engineering Mode, NEMESIS Manager, adb) no longer kills them on their next output line.app_process.Testing
Off-car only.
tools/test-all.sh --fast: 31 ok, 1 skipped (no ImageMagick). New checks inengine-test.sh,install/common/test.sh(gear_gate, boot waits) andcore/hmgapid/test.sh(reboot gate; its fake vehicle service answersgear.parkfrom a file). The hmgapid, zygote, lpatch, install, usb and sdk tests couldn't run on the machine used (no qemu-arm/lld/payload build; the same 6 fail on untouched main there), socore/hmgapid/test.shruns in CI first.hmgapid.ccompiles for ARM with no warnings; the app compiles against android.jar. Not tested on a car.Follow-ups
catalog/app): once this is in main, putUpdatesTab's Update HMG-API (updateHmgApi) and its "Restart now", andCatalogFlow.run(the install fromCatalogTab), throughPark, haveCatalog.runskip--gear-unknown-okas an id (and check the gear before the download), and add acatalog-test.shcase forgear.park 0.release/2.0,gear_gateuseslib.shstock_gear_parkwhen hmgapid's vehicle service doesn't answer yet (first install, early boot), so--gear-unknown-okand "It's in P: go on" are only needed where the car's own service doesn't answer.hmgapid rebootand the engine'sGearget it throughvehicle gear.parkwith no change here.pm disablelasts across restarts): Engine: roll back a failed apply at once, journal held apps, keep file modes #434's held-apps journal, not this PR.apps_hold,Open-HMG/hmgapi-wireless-cp-aa) disable apps and swap/systemfiles without a gear check.🤖 Generated with Claude Code