- Decision
- ADR-035
- Date
- 2026-08-07
- Status
- SupersededSuperseded by ADR-240. Accepted (qualified)
- Mentions
- ADR-025, ADR-030, ADR-032, ADR-034, ADR-240
- Mentioned by
- ADR-036, ADR-044, ADR-240
1Decision
Port Guardian's REVOKE_BACKGROUND_LOCATION remediation from the emulator baseline to the physical lynx (Pixel 7a) device: build, sign, and flash a Guardian-bearing lynx-cur-userdebug candidate per docs/superpowers/plans/2026-08-06-guardian-lynx-hardware-port.md. In the process, fix two real build/signing-infrastructure defects and one real Guardian detection defect that emulator-only validation could not have surfaced, and leave a second real Guardian detection defect open and documented rather than resolved.
2Why and evidence
Task 1 committed frameworks/base's outstanding boot-identity residual for real (branch aegisos-boot-identity, commit 7d7001f9c4e4), closing one of ADR-025/031's two open reproducibility causes. Task 2 wired GuardianApp into lynx's product config (branch aegisos-guardian-lynx in vendor/adevtool, commit 43b73335).
Task 3's build hit two plan errors caught before they caused wasted work: the plan's literal lunch lynx-userdebug is not a valid combo (the real target, lynx-cur-userdebug, was confirmed via release-config artifacts already on the server from the original physical-device bring-up); and vendor/adevtool's Task 2 commit broke vendor/google_devices/lynx/adevtool-version-check.mk's pin of vendor/adevtool's exact git HEAD (any commit there breaks it, not just content changes) — fixed by hand-patching the pinned hash, justified because that generated file is confirmed not itself git-tracked and the change was purely additive with no blob/firmware implications, avoiding the much heavier adevtool generate-all -d lynx pipeline.
The resulting cold m -j6 build of out-lynx (never built before on platform-primary) took 8h10m32s across 175981 ninja steps, consuming roughly 97G of disk.
Task 4's signing diffed 11 of 12 partitions as different from the last accepted candidate — wider than the plan's own "expect at minimum system/system_ext" assumption, but explained by this candidate's deliberately new BUILD_NUMBER/BUILD_DATETIME propagating into most partitions' embedded build fingerprint, not a reproducibility regression.
Signing itself found two real, previously-undocumented avbtool defects: (1) add_hashtree_footer needs the fec host tool on PATH (out-lynx/host/linux-x86/bin/fec) and, when it is missing, does not fail cleanly — it partially modifies the target image in place before erroring, corrupting it in a way a second signing attempt does not detect or reject, discovered only because the pristine build hash was independently diffed before trusting the signed output; (2) add_hashtree_footer needs an explicit --partition_name — omitting it leaves the descriptor's partition-name field blank for every image signed that way, and make_vbmeta_image silently drops all but the last of multiple same-(blank-)named descriptors when merging --include_descriptors_from_image sources, which in the first signing attempt produced a vbmeta.img with no descriptor for system at all (the partition carrying Guardian) — a security-relevant integrity gap, not a cosmetic one, caught before flashing by inspecting the full avbtool info_image descriptor list rather than trusting a "N/N verified" summary alone.
Both were fixed and the corrected candidate independently AVB-verified 13/13 on two machines with two separate avbtool binaries, matching ADR-030's evidentiary bar.
Task 5 flashed all 11 changed partitions plus vbmeta (pvmfw excluded as confirmed byte-identical) — a deliberate deviation from the plan's literal system/system_ext/vbmeta-only instruction, made necessary by Task 4's wider diff to avoid an AVB hash mismatch against stale on-device content for the other partitions.
Fresh boot evidence: fingerprint google/lynx/lynx:17/CP2A.260705.006/2026080601:userdebug/test-keys, sys.boot_completed=1, zero unexplained crash/ANR/tombstone matches (the two seen mid-Task-6 were independently attributed: the test fixture's own permission-less first launch, and a harmless SystemUI StrictMode diagnostic — neither a regression).
Task 6's real-hardware validation found Guardian's BackgroundLocationWatcher watched only AppOpsManager.OPSTR_FINE_LOCATION; real GNSS-backed fixes on physical hardware note OP_GPS/OP_MONITOR_LOCATION instead (confirmed as genuinely distinct, non-aliased ops by reading AppOpsManager.java directly, not assumed), which the emulator's simulated location provider never exercised because it notes FINE_LOCATION directly — masking this gap through every prior emulator validation including GBL-001..GBL-007 and ADR-034's own residual-3 note about COARSE_LOCATION.
Fixed by adding OPSTR_GPS/OPSTR_MONITOR_LOCATION to the watched-ops array; rebuilt, re-signed, re-flashed, and confirmed live via diagnostic logging that the OS-level startWatchingNoted callback now genuinely fires (observed for a real system IMS-service location request).
A second, distinct defect was found and left open: even with the watched-ops fix, the callback still never fires specifically for the test fixture's own location requests, despite fresh AppOps access records for it confirmed present at the exact expected moments, and despite ruling out (by reading AppOpsService.java directly) four plausible causes — switch-op remapping (scheduleOpNotedIfNeededLocked keys on the raw noted op code, not its switch-op), opRestrictsRead's MANAGE_APPOPS gate (none of the location ops set restrictRead), per-uid watch scoping (startWatchingNoted's watchedUid stays unrestricted whenever WATCH_APPOPS is held, which Guardian's is), and the batched noteOperationsInBatch path (it still funnels through the same dispatch).
The strongest remaining lead, not yet confirmed: AppOpsService.notifyOpChecked() silently swallows any RemoteException raised while delivering the callback across the Binder boundary (catch (RemoteException e) { /* do nothing */ }), which would produce exactly the observed symptom (zero log output, not even the earliest log line inside Guardian's own callback lambda) for a cause outside Guardian's own code.
Confirming this would require temporarily instrumenting frameworks/base itself, a materially larger and more invasive step than the two build/signing and one Guardian-source fixes already made in this entry, and was deliberately not pursued further given the cost/reward tradeoff and this project's stated discipline against unnecessary low-level upstream modification — recorded as a real, well-characterized open finding for a future session rather than pursued to unbounded cost or silently left unexplained.
3Consequences
The physical lynx device now runs a Guardian-bearing candidate at three successive build-log versions in this one session — 1.03 (initial Guardian-lynx candidate, signed but superseded before being trusted further), 1.04 (the OPSTR_GPS/OPSTR_MONITOR_LOCATION fix, confirmed working for the OS-callback layer), and 1.05 (currently flashed; adds temporary diagnostic Log.i instrumentation to BackgroundLocationWatcher/GuardianWatcherService for the still-open second defect).
1.05 is not a clean release candidate — it ships debug logging added purely for this investigation and must not be treated as the terminal state of this work. docs/quality/validation-matrix.md gets real-hardware GBL-0xx rows mirroring GBL-001..GBL-007, each marked against its actual outcome (auto-open detection: not yet demonstrated end-to-end on hardware, pending the open defect above) rather than inherited wholesale from the emulator rows.
docs/devices/support-policy.md's currently-flashed-candidate fields are updated to this build number and fingerprint. Bootloader remains unlocked; this remains not an enforced root of trust, same posture as ADR-030/033.
Separately, and newly discovered while patching the two Guardian source fixes above: the entire vendor/aegisos/guardian source tree on the build server is not git-tracked (git rev-parse --show-toplevel fails inside it, confirmed before either edit) — every prior "merged"/"committed" claim about Guardian's own application source (ADR-032/033/034) refers to it being finalized in review and evidence terms, not to it living under version control on the server; a real source-durability gap against this project's own build discipline, not yet closed.
4Review when
Before this work is picked back up, decide explicitly whether to pursue the frameworks/base instrumentation lead above or find an app-level diagnostic path first; either way, 1.05's debug logging must be removed and the candidate rebuilt/re-signed/re-flashed clean before any claim that Guardian's real-hardware REVOKE_BACKGROUND_LOCATION detection is fully working, and before BLOCK_BACKGROUND_NETWORK/REMOVE_OVERLAY_PERMISSION/FREEZE_APPLICATION are ported to lynx using this entry's build/signing fixes as precedent.
Read from docs/governance/decision-log.md, entry ADR-035.