- Decision
- ADR-086
- Date
- 2026-09-16
- Status
- AcceptedAccepted, qualified — swipe-elimination hardware-confirmed; return-path grant and delay-removal are built, signed, and flashed but not yet dynamically exercised on hardware
- Part
- Duress Unlock
- Mentions
- ADR-064, ADR-079, ADR-085
- Mentioned by
- ADR-087
1Decision
Land the return-direction single-credential grant (frameworks/base 0073-0074) and eliminate the swipe/pause between the decoy PIN and the decoy's home screen (0075-0078), closing the two open usability gaps ADR-085 carried forward.
2Why and evidence
ReturnToRealUserHelper.maybeRouteToRealUser matched the real owner's credential and called a bare switchToUserSilently(USER_SYSTEM) with no authorization mint at all — unlike the outbound direction, which needed three single-use grants across five sub-cycles (ADR-085) before a single credential entry actually held.
Added UserController#authorizeRealUserSwitchKeyguardSkip(int callerUserId), the return-direction mirror of authorizeDecoySwitchKeyguardSkip: always targets UserHandle.USER_SYSTEM, checks the caller is a genuine decoy-type user (the inverse of the outbound check, same ADR-064-motivated rigor), and mints from the same one-shot, three-grant record every consumeDecoySwitchAuthorizationFor* call site already consumes generically (0073-0074).
Separately, real physical-hardware testing this session found the outbound direction's own single-credential fix still required a manual swipe after the PIN: KeyguardViewMediator#handleUserSwitchComplete's authorized branch correctly skipped the automatic bouncer re-arm but did nothing else, leaving the device on a swipeable lock screen until the user's own next gesture happened to redeem the third (active-dismiss) grant.
Fixed by proactively calling the same dismiss() the unauthorized branch already calls (0075-0076) — confirmed via real adb logcat evidence on a fresh boot (owner's credential never entered that boot, decoy PIN typed into the real bouncer): credential verified, then an automatic keyguardDonePending and LOCKSCREEN→GONE transition with zero swipe, ~2.2s total (down from ~4.8-6.5s including swipe-reaction time).
The owner then reported the automatic dismiss still produced a perceptible pause, distinguishable from a real same-user unlock (owner-confirmed: PIN typed into an already-showing bouncer lands immediately, no delay).
Traced to the new dismiss call reusing the unauthorized branch's existing postDelayed(..., 500) — original, pre-AegisOS AOSP code, there specifically to let a freshly shown bouncer's own async layout listeners settle, which does not apply to a branch that never shows a bouncer at all. Changed to postDelayed(..., 0) (0077-0078), keeping the handler-posted ordering and mDismissToken cancellation tagging.
Both the return-path grant and delay-removal candidates were built (OFFICIAL_BUILD=true, all four gated apps confirmed present), signed with the alpha key (265ade399a0f3ee65003e56daef26a8f4d70e6a4, rollback index 1783209600), 13/13 AVB-verified on two independent machines and avbtool installs each round (fingerprint independently reconfirmed via two different avbtool subcommands each time, per the ADR-079 lesson about a self-consistent-but-wrong-key result), and flashed by the owner — the controller never had or requested access to the alpha private key.
Both builds required a real, repeated rebuild correction: m -j6 systemimage twice left SystemUI.apk at its pre-patch mtime despite a clean log (the same out-lynx Ninja/Soong incremental-staleness class already recorded against this branch, e.g.
0008/0009's own incident), caught by checking the artifact's own mtime and fixed by force-touching the patched sources and invoking m systemextimage systemimage directly; the resulting SystemUI.apk was independently confirmed via dexdump disassembly of handleUserSwitchComplete itself to genuinely carry each change (the new branch structure, then the #int 0 constant replacing #int 500), not assumed from the build log.
A real incident during the first candidate's flash was found and recovered, not silently worked around: the controller's own flash instructions did not separate physical partitions (bootloader fastboot) from logical/dynamic ones (product, system, system_ext, system_dlkm, vendor, vendor_dlkm — require fastbootd), so the owner's first attempt failed six resize-logical-partition commands mid-run and the device booted in a genuinely mixed partition state; independently confirmed non-fatal (ro.boot.verifiedbootstate=orange — AVB is advisory on this unlocked bootloader, not enforced — sys.boot_completed=1, zero crash/ANR/tombstone) and recovered by completing the flash correctly in two stages (physical partitions, then an explicit is-userspace: yes wait before the logical partitions and vbmeta).
3Consequences
The return-path grant (0073-0074) and delay-removal (0077-0078) are compile-verified, bytecode-confirmed present in the built image, and flashed on a device that boots clean — but neither has been exercised through a real decoy→owner return or a real felt-latency PIN-entry trial. Do not describe either as hardware-confirmed; only the swipe-elimination fix (0075-0076) has direct logcat evidence of working as designed.
All six patches exported fresh from the real post-git am branch history into aegisos-platform/credential/duress-unlock-decoy/patches/frameworks-base/0073-0078, with SOURCE.md updated in the same package. The aegisos-duress-decoy-switch branch stays as-is (not merged, PR'd, or discarded), matching every prior stage's precedent.
4Review when
Revisit before treating either usability gap as closed: the return-path grant needs a real physical trial (decoy session, owner's own credential typed into the real bouncer to return, confirming a single entry and no forced re-lock) and the delay-removal needs a real PIN-entry trial confirming the felt latency genuinely reads as immediate rather than merely shorter. Also revisit if a future out-lynx build again silently omits a patched module despite a clean build log — this is now the third recorded instance of this exact staleness class on this branch and may warrant a standing pre-signing check rather than a per-incident rediscovery.
Read from docs/governance/decision-log.md, entry ADR-086.