- Decision
- ADR-070
- Date
- 2026-08-30
- Status
- SupersededSuperseded by ADR-240. Accepted
- Mentions
- ADR-240
- Mentioned by
- ADR-240
1Decision
Fix the audit's item 13: Guardian's BackgroundLocationWatcher did not scope its AppOpsManager callbacks to its own Android user.
2Why and evidence
Confirmed by reading the real source, not inference: startWatchingNoted/startWatchingActive (vendor/aegisos/guardian, master branch) are registered with no uid/user filter, and onAccess(op, uid, packageName) checked only whether uid was backgrounded, never whether it belonged to the calling process's own user.
Cross-checked the actual data model this feeds (aegisos-services' guardian-core, present locally): GuardianOverviewEntry/GuardianActiveProtectionV1 carry no userId field anywhere, so an ingested cross-user event has no downstream point where it could be filtered back out.
This means on any AegisOS device with two Android users — an AegisOS Duress Unlock decoy session, or any two ordinary secondary users — a Guardian instance running as one user would be notified about, and record into its own Overview, the other user's own background-location activity.
Found incidentally while auditing Duress Unlock's own decoy identity-leak surfaces (this repository's docs/superpowers/specs/2026-08-30-duress-decoy-remaining-leaks-audit.md, item 13), but the defect itself is general to any multi-user pairing, not decoy-specific — it predates and is unrelated to the Duress Unlock feature.
Fixed by comparing UserHandle.getUserHandleForUid(uid) against Process.myUserHandle() before doing anything else with the event, discarding it on a mismatch; both are genuine public, non-@hide SDK APIs, and Process.myUserHandle() matches the pattern GuardianComponents.java already uses elsewhere in this same app.
Authored under the established local-first worktree discipline (fetched file confirmed byte-identical via sha256sum before editing, landed via git am on the real master branch after confirming no build was in flight, patch regenerated fresh from real post-git am branch history) and build-verified (m GuardianApp: Build Succeeded: 21 steps, no diagnostics on the edited file).
3Consequences
Since vendor/aegisos/guardian's app/ is first-party AegisOS source, not a patch against upstream, this fix has no separate patch-package entry — it lives directly in aegisos-platform/guardian/app/src/, which was synced byte-for-byte to the real post-git am file and committed alongside SOURCE.md/README.md updates recording this fix under its own "Fixes since initial integration" section (distinct from the Duress Unlock package, since this is a different feature and branch, master not aegisos-duress-decoy-switch).
Build-verified only; runtime confirmation would need two real Android users, one triggering a genuine background-location access, confirming it does not surface in the other's Guardian Overview — not yet done.
4Review when
Ten of the 21 Duress Unlock audit items are now fixed. Three low-confidence items remain (14, 16, 17), each needing further tracing before a responsible fix/no-fix call — see the audit document for what each still requires. This entry also stands on its own as a genuine Guardian security fix independent of the Duress Unlock audit that surfaced it; any future Guardian security review should be aware this class of "AppOps watched system-wide, ingested without a user field" gap existed and treat it as a pattern to check for elsewhere in Guardian, not assume this one instance was the only one.
Read from docs/governance/decision-log.md, entry ADR-070.