ObliviOS Developer portal Project site

Home / Decisions / ADR-080

Add a method-local check to UserManagerService.isUserSwitcherEnabled(@UserIdInt int userId) so the decoy's own current-user view reports the device-wide…

Accepted, recorded 4 September 2026.

Decision
ADR-080
Date
2026-09-04
Status
AcceptedAccepted, compile-verified only
Part
Duress Unlock
Mentions
ADR-066, ADR-075
Mentioned by
ADR-081, ADR-087

1Decision

Add a method-local check to UserManagerService.isUserSwitcherEnabled(@UserIdInt int userId) so the decoy's own current-user view reports the device-wide user-switcher-enabled flag as disabled (frameworks/base patch 0033), closing Task 1 of docs/superpowers/plans/2026-09-03-duress-decoy-user-switcher-visibility.md.

2Why and evidence

Settings.Global.USER_SWITCHER_ENABLED is a device-wide, non-per-user flag AOSP's UserManagerService.dispatchUserAdded() permanently sets to 1 the first time any second user (including a decoy) is ever created, leaking that a decoy exists to at least six real UI surfaces that all trace back to this one method.

Fixed with a nine-line addition (re-verified byte-for-byte against the live build-server source at lines 3443-3457 before editing, matching the plan's quoted block exactly): reads the device's actual current user's UserInfo under mUsersLock via the existing getUserInfoLU/getCurrentUserId(), and returns false immediately if its userType is UserManager.USER_TYPE_FULL_AEGISOS_DECOY, before the existing multiUserSettingOn computation runs.

Deliberately keyed off the actual current user rather than the userId argument passed in, since several real callers (the QS footer icon, the lockscreen avatar) run under SystemUI's cross-process rendering context and do not necessarily pass the current user's own ID — the same ADR-066 failure mode this project has already hit once.

Authored under AGENTS.md's local-first discipline in a disposable worktree (aegisos-platform/.worktrees/decoy-switcher-visibility-task1/, seeded read-only from the real branch HEAD ccc6c058a6f0761b04027c055211bfd68c62e9f1) and landed on the real aegisos-duress-decoy-switch branch with git am --3way (applied cleanly, no conflicts, confirmed no build in flight beforehand via pgrep -fa 'ninja\|soong_ui').

Real post-git am SHA: 544d6e6d4567966cf0d8308e110da4a130b7df6e (differs from the local worktree's own commit SHA 5837f34625f9a833b993e8e7c824f8d31924f841, confirmed via git log on the branch rather than assumed).

A fast m services build (OUT_DIR=out-preflight, sdk_phone64_x86_64-cp2a-userdebug) confirmed clean compilation: ninja: 2m25.96s Build Succeeded: 18 steps, #### build completed successfully (02:33 (mm:ss)) ####, no diagnostics referencing UserManagerService.java, independently re-verified via a fresh SSH call rather than trusted from a background monitor alone.

3Consequences

This is compile-time verification only. No dynamic validation of any of the six identified UI surfaces (the QS footer icon, the lockscreen/keyguard status-bar avatar, both power-menu implementations, and three Settings "Allow multiple users" toggle widgets) or the owner-regression check has been performed yet — that is Task 2 (emulator) and Task 3 (physical lynx), neither started as of this entry. No other method in this file changed; getUserLogoutability()'s own isMainForUiDisplay check (0032, ADR-075) is untouched and independent of this fix.

4Review when

Task 2 (emulator dynamic validation across all six surfaces plus the owner regression check) and Task 3 (physical lynx hardware validation, signed with the alpha key per this plan's own Global Constraints) remain to close this plan; do not describe the decoy's user-switcher visibility as fixed at runtime until at least one of those tasks produces real dynamic evidence.

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