ObliviOS Developer portal Project site

Home / Decisions / ADR-081

Fix two real regressions patch 0033 did not actually cover on physical hardware, plus a third, independently-discovered avatar-color identity leak, and re-validate on a…

Accepted, recorded 6 September 2026.

Decision
ADR-081
Date
2026-09-06
Status
AcceptedAccepted, emulator-validated; physical lynx re-validation still open
Mentions
ADR-074, ADR-080
Mentioned by
ADR-082

1Decision

Fix two real regressions patch 0033 did not actually cover on physical hardware, plus a third, independently-discovered avatar-color identity leak, and re-validate on a fresh emulator boot: frameworks/base patches 0034, 0035, 0036; packages/apps/Settings patch 0010.

2Why and evidence

Task 3 Phase B's real-hardware round (started under ADR-080) found 0033 did not work as claimed: 3 of 6 surfaces (QS footer icon, lockscreen avatar, Settings toggle) still leaked despite 0033's bytecode being dexdump-confirmed present and correct in the flashed services.jar.

Per the owner's explicit direction ("find out why it doesn't work" — not "patch around it"), a superpowers:systematic-debugging root-cause pass, not a guessed re-fix, traced each surface's real source.

Two resolved to genuine, independent code defects, neither a flaw in 0033 itself: (1) UserRepositoryImpl.kt's getSettings() read Settings.Global.USER_SWITCHER_ENABLED directly via globalSettings.getInt(...), never calling the patched UserManager.isUserSwitcherEnabled() at all — a structural bypass, confirmed live on the physical device (am get-current-user=10 captured in the same command block as a uiautomator dump still showing multi_user_switch).

Fixed (0034) by deleting the duplicate computation and delegating to manager.isUserSwitcherEnabled(), the same API 0033 already patches, so there is one source of truth instead of two silently diverging ones.

(2) KeyguardStatusBarView.setUserSwitcherEnabled(boolean) stored the new value into mIsUserSwitcherEnabled but never called updateVisibilities() — the only method that actually applies that field to the real view — so a value change delivered by the controller's async UserManager Binder call (dispatched via mBackgroundExecutor, posted back via mMainExecutor) could be overtaken by an unrelated visibility-triggered updateVisibilities() call still using the stale prior value, with nothing re-invoking it once the real value landed.

Confirmed genuine, pre-existing upstream AOSP code (untouched by any prior AegisOS patch), dormant only because no caller before Duress Unlock ever needed isUserSwitcherEnabled()'s answer to change mid-session. Fixed (0035) by calling updateVisibilities() directly from the setter; its one real call site already dispatches on mMainExecutor, so no thread-safety change was needed.

The Settings toggle was investigated and deliberately not re-fixed: its real code path (UserSettings.java's onResume() → mMainSwitchController.updateState() → UserCapabilities.updateAddUserCapabilities()) already recomputes fresh via the same correct, patched API on every resume, and had already passed with this exact code on the Task 2 emulator round.

A forensic recheck dispatched specifically to explain the physical-hardware discrepancy found the check reused an already-running com.android.settings process for user 10 whose cold-vs-resumed task state could not be confirmed either way, and could not go further because the physical device disconnected from USB mid-session before a decisive dumpsys user/service probe could run — a raw, unverified Binder transaction-code probe was correctly withheld by the dispatched subagent rather than risked against the one live device holding the project's only registered decoy user.

This surface is left open, not forced into a third patch on unconfirmed evidence.

Separately, per the owner's explicit standard that the decoy session must present as the device's only user, not merely pass a fixed per-surface checklist, a fresh-emulator screenshot of Settings ▸ Users surfaced a third, previously-undocumented leak: UserIcons.getDefaultUserIcon() picks a default (no custom photo) avatar color from a fixed 8-entry palette keyed by userId % 8 — the owner (userId 0) got user_icon_1 (red), a test decoy (userId 10) got user_icon_3 (blue), a real, standalone identity tell independent of every list-membership/name leak the getUsersForUiDisplay/isMainForUiDisplay audits already cover, since it fires even when only the decoy's own single avatar is ever shown.

Two independent call sites needed the identical fix: UserSettings.java's assignDefaultPhoto() (persists the color via UserManager#setUserIcon) and SystemUI's UserIconProvider.kt's getUserImage() (computes it in-memory, not persisted).

Both fixed (packages/apps/Settings 0010, frameworks/base 0036) by routing the color-lookup userId — never the icon's real target userId, kept correct for setUserIcon/cache-key purposes — through the existing isMainForUiDisplay() primitive (0031, ADR-074): substitute UserHandle.USER_SYSTEM when the current user displays as main, leaving any ordinary second real user's own distinguishing color untouched.

All four patches were authored under AGENTS.md's local-first discipline in disposable worktrees, landed on the real aegisos-duress-decoy-switch branches with git am (clean, no conflicts, confirmed no build in flight beforehand each time), regenerated fresh via git format-patch from the real post-git am branch history rather than exported from the worktrees' own commits, and independently verified byte-for-byte reproducible (apply-and-diff against the real branch tip, empty diff in every case).

Build verification: m -j6 SystemUI clean for 0034/0035 (21 steps), m -j6 SystemUI Settings clean for 0036/0010 (38 steps), no error or warning referencing any changed file in either run.

Dynamic re-validation ran on a genuinely fresh, -wipe-data emulator boot with all five patches (0033-0036 plus Settings 0010) present, using a newly created, cleanly-named decoy ("Family", not a test-fixture name that leaks its own purpose) registered through the real set-decoy-profile command: QS icon PASS (absent, matching the pristine single-user baseline captured on the same fresh boot before any decoy existed), lockscreen avatar PASS (absent, matching), Settings ▸ Users PASS (single row, "Owner" label, avatar color byte-for-byte matching the pristine owner's own default avatar in a direct screenshot comparison — not inferred from logs).

Owner-regression PASS: switching back to Owner shows both real users (expected and correct — the owner's own management view was never meant to hide the decoy from the owner), the switcher toggle is re-enabled and interactive, and the QS icon correctly reappears; no regression from any of the four new patches. The full screenshot set (pristine baseline, decoy session, owner regression) was sent to the owner directly as evidence, not just described.

3Consequences

This closes the Settings-toggle question as investigated and left open, not resolved — do not describe it as fixed or as a confirmed non-issue until a repeat check with a forced-fresh Settings process (or physical hardware, where interactive taps have already proven more reliable than this project's headless-emulator tooling) settles it either way.

Physical lynx hardware re-validation of this whole four-patch batch has not happened: the device disconnected from USB mid-Phase-B and, as of this entry, has not been reconnected — nothing above should be read as hardware-confirmed, only emulator-confirmed.

A secondary, deliberately out-of-scope observation from the owner-regression screenshots: once a second real user exists, the owner's own Settings ▸ Users view now shows both rows in the same default color (since the "Family" account was itself decoy-registered and so also received the main-user color via this same fix) — this does not weaken the threat model (the owner's own session was never meant to hide the decoy from the owner) but is noted here in case a future session finds it worth a product discussion about whether a genuinely-shared, non-decoy family device should look different from this.

4Review when

Before the next physical lynx build for this feature, reconnect and verify the Pixel 7a's USB state first — do not assume it is still reachable from a prior session. Any future work on UserRepositoryImpl.kt, KeyguardStatusBarView.java, UserSettings.java's photo-assignment path, or UserIconProvider.kt should preserve the isMainForUiDisplay-substitution pattern this entry establishes rather than reintroducing a second, divergent computation of switcher-enabled state or default avatar color.

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