ObliviOS Developer portal Project site

Home / Decisions / ADR-066

Fix UserManagerService#getUsersForUiDisplay to key its decoy special-case off the device's actual current user.

Accepted, recorded 30 August 2026.

Decision
ADR-066
Date
2026-08-30
Status
AcceptedAccepted, urgent (this corrects a Critical gap in what ADR-063 claimed was hardware-verified)
Part
Duress Unlock
Mentions
ADR-060, ADR-061, ADR-063, ADR-065
Mentioned by
ADR-067, ADR-068, ADR-069, ADR-071, ADR-072, ADR-080

1Decision

Fix UserManagerService#getUsersForUiDisplay to key its decoy special-case off the device's actual current user (via the existing getCurrentUserId() helper) instead of UserHandle.getCallingUserId(), after that same UI verification sweep found a real, live, reproducible identity leak on physical lynx hardware.

2Why and evidence

The QS footer's "Select user" dialog (reached by tapping the user icon in the notification shade, distinct from the lock-screen/keyguard switcher) showed the real Owner identity alongside the decoy's own while the decoy session (aegisos-test-decoy, id 10) was genuinely current and unlocked — directly reproduced and screenshotted, not inferred.

Root-caused by tracing the real call chain (UserSwitchDialogDelegate → UserDetailView.Adapter → BaseUserSwitcherAdapter → UserSwitcherController → UserSwitcherInteractor → UserRepositoryImpl → getUsersForUiDisplay) and confirming via dumpsys window that mCurrentFocus=Window{... u0 Select user} while mFocusedApp correctly showed u10 com.android.launcher3 — SystemUI's floating windows render under user 0's Binder/window context regardless of which user is actually foregrounded (independently confirmed the power menu's GlobalActionsDialogLite shares this same u0-owned pattern, though it carries no leak today only because fw.power_user_switcher is inactive on this device).

getUsersForUiDisplay's decoy check therefore never applied to any SystemUI-hosted floating surface, silently defeating the exact protection ADR-060 claimed to have added for "the QS user switcher." By contrast, Settings ▸ Storage was independently confirmed architecturally safe — launching it as user 10 produces a genuine u10_system process and a u10-owned window, so its call to the same API already carried the correct identity, consistent with ADR-063's claim holding for that one specific surface.

Fixed by reusing getCurrentUserId(), an existing, already-used helper in the same class (ActivityManagerInternal-backed), rather than adding a new cross-service call — this repairs the shared primitive itself, covering every present and future caller, not just the one call site the leak was found through.

Authored under the local-first discipline (disposable worktree aegisos-platform/.worktrees/duress-getusersforuidisplay-fix/, fetched UserManagerService.java confirmed byte-identical via sha256sum before editing, landed via git am on the real branch after confirming no build was in flight, real post-am SHA c09efcc32293ea20e09ef4d5545c361060643183), and confirmed by a fast, detached m services build check (Build Succeeded: 333 steps, services.jar freshly rebuilt) with no diagnostics attached to the edited file.

Two lower-priority findings from the same sweep, resolved along the way: the decoy session's screen_off_timeout was still at ADR-063's own flagged, never-reverted 600000ms (a check of the wrong user, --user 0, earlier in this same session had incorrectly reported this as already fine) — corrected to 30000ms; and am force-stop --user 10 com.android.systemui was run mid-investigation to test a caching hypothesis, after which that user's own SystemUI process did not restart on its own — noted for the record, no adverse effect observed on the rest of the session's testing.

3Consequences

frameworks/base patch 0026 exported to aegisos-platform/credential/duress-unlock-decoy/patches/frameworks-base/, SOURCE.md/README.md updated.

This is compile-time verification only. Given this changes system_server identity-filtering logic shared by every Component B call site rather than an isolated app APK, and given ADR-061's own precedent for how a compiles-cleanly change to identity/keyguard-adjacent code produced a real, previously-invisible regression only caught by dynamic testing, this must not be treated as closed until it has actually run — ideally on the emulator first, matching the caution Component A's redesign is held to, before any physical-hardware re-flash.

4Review when

Dynamic re-validation (emulator, then physical hardware) of this fix is the immediate next step, ahead of resuming the rest of the UI verification sweep (lock-screen avatar switcher, com.android.multiuser widget, clipboard overlay, alarm icon, Material You, the Wallet tile from ADR-065) — a leak this direct warrants re-testing the fix itself before continuing to audit surfaces the fix may also affect.

Read from docs/governance/decision-log.md, entry ADR-066.