- Decision
- ADR-082
- Date
- 2026-09-06
- Status
- AcceptedAccepted, emulator-validated; physical
lynxre-validation still open - Mentions
- ADR-053, ADR-060, ADR-081
- Mentioned by
- ADR-085, ADR-092, ADR-095
1Decision
Exhaustively re-check every remaining avatar-color call site the owner's "100% certainty" demand required, finding and fixing two more instances of ADR-081's bug: frameworks/base patch 0037, packages/apps/Multiuser patch 0003.
2Why and evidence
Rather than re-asserting confidence in ADR-081's fix, every real UserIcons.getDefaultUserIcon/getUserIconColors call site across frameworks/base, packages/apps/Settings, and packages/apps/Multiuser (~15 total) was individually read.
Two more genuine instances of the identical bug were found: SettingsLib's shared Utils#getUserIcon() — used by several real Settings screens (Battery usage, Running services, Storage, About phone) independently of whether the decoy's own Settings ▸ Users row has ever assigned and persisted a default photo first — and the Multiuser home-screen widget's own ImageRepository#getAvatar(), a real, user-installable surface with the identical userManager?.getUserIcon(userId) ?: UserIcons.getDefaultUserIcon(resources, userId, false) fallback race.
Both fixed identically to 0036/Settings-0010: route the color-lookup userId through the existing isMainForUiDisplay() primitive, substituting UserHandle.USER_SYSTEM when the current user displays as main; MANAGE_USERS confirmed already declared in the Multiuser app's own manifest before relying on it, not assumed by association with the sibling fixes' own confirmation for a different app.
Every other remaining call site was read and confirmed not a bug, not merely skipped: ApplicationPackageManager/CrossProfileApps badge/cross-profile-item icons don't apply to a decoy session (no sub-profiles exist under one); CrossProfileApps's own "personal profile" icon already hardcodes UserHandle.USER_SYSTEM, unrelated to any specific real user; UserSwitchingDialog (UserController.showUserSwitchDialog) is structurally unreachable for a decoy switch — traced to source, not assumed from ADR-053's own label: DecoyProfileHelper.freezeAndSwitchToDecoy calls ActivityManagerInternal#switchToUserSilently, whose UserController implementation calls sendStartUserSwitchFgMessage directly and never checks mUserSwitchUiEnabled or calls showUserSwitchDialog at all; EditUserPhotoController's call uses a user-chosen tint color, not a userId-derived one; CreateUserDialogController and EditUserInfoController both use UserHandle.USER_NULL (the neutral-gray placeholder case) for their dialog previews, never a real userId; UserCreator.kt colors a newly created, ordinary second user — correctly distinct from the owner, since this path only ever creates a plain USER_TYPE_FULL_SECONDARY user, never a decoy; UserAdapter.java's (personal/work profile picker) tint is a fixed Material theme color, never userId-derived; and the bouncer's tablet-only user-switcher grid (KeyguardSecurityContainer) is confirmed structurally dormant on lynx via its real gating resource, config_enableBouncerUserSwitcher (false in the base values/config.xml; the only true override belongs to a tangorpro tablet vendor overlay, absent on this device) — verified directly, not inferred from the earlier form-factor comment this project had previously only assumed correct.
A second, independent, already-correct parallel repository was also found and checked rather than assumed safe by name-similarity to its sibling: UserSwitcherRepository.kt (UserSwitcherRepositoryImpl), backing part of the QS footer's status model, already calls the same correct, patched isUserSwitcherEnabled() API and gates its avatar exposure behind that check before ever combining in a possibly-uncorrected bitmap — needed no fix.
A real mistake was caught mid-execution, not silently avoided: git am /tmp/0003-*.patch on the build server expanded a stale glob matching three differently-dated /tmp/0003-*.patch leftovers from earlier sessions and applied the wrong one first (a frameworks/base patch, rejected outright by packages/apps/Multiuser's own tree); caught immediately by the git am failure itself, git am --abort'd cleanly, and re-run against the exact intended filename rather than a glob.
Both new patches were regenerated fresh via git format-patch from the real post-git am branch history and independently verified byte-for-byte reproducible. Build verification: m -j6 SettingsLib Multiuser Settings SystemUI clean (63 steps), no error or warning referencing either changed file.
A second full systemimage build and a second fresh, -wipe-data emulator boot (a new decoy, "Family", created fresh rather than reusing the first round's) re-confirmed the primary, most-visible surfaces (Settings ▸ Users avatar color, QS icon, lockscreen avatar) still clean with the complete seven-patch set (frameworks/base 0033-0037, packages/apps/Settings 0010, packages/apps/Multiuser 0003) — no regression from the two new patches.
3Consequences
The two newest fixes (0037, Multiuser 0003) are source-verified, build-verified, and byte-for-byte reproducible, but not dynamically exercised end-to-end: a fresh emulator has no real battery-usage history to render, so Utils#getUserIcon()'s actual call site inside the Battery-usage app-list UI could not be triggered this round — an environment limitation, not a fix failure, but still a gap between "compiles and reads correctly" and "seen working." Physical lynx hardware re-validation of the complete seven-patch batch has not happened — the device disconnected from USB mid-Phase-B (ADR-081) and remains disconnected as of this entry.
Nothing in this entry should be read as a claim that every conceivable identity-revealing surface on the device has been found — it closes the specific, exhaustively-re-checked class of bug ADR-081 first identified (userId-keyed default avatar color), not the general question of decoy indistinguishability, which this project's own long ADR history (ADR-060 through ADR-081) has already shown tends to surface new instances under renewed scrutiny.
4Review when
Any future avatar-rendering code added to this codebase should call through UserManager.isMainForUiDisplay() before deriving a color from a raw userId, matching the pattern this entry and ADR-081 now establish in five call sites across three repositories. Before the next exhaustive-audit-style pass on this feature, consider whether a real battery-usage/app-usage history can be seeded on the emulator (or deferred to physical hardware, where real usage naturally accumulates) so this specific gap doesn't recur.
Read from docs/governance/decision-log.md, entry ADR-082.