- Decision
- ADR-232
- Date
- 2026-11-15
- Status
- ProposedProposed (owner, 2026-11-15: all criteria fixed, "arrange it all"; the pad animation with the dim must be as smooth as in an ordinary unlock and the background must not zoom; one module build for all fixes whose causes are known).
frameworks-base/0046to0049ofcredential/duress-unlock-decoy, module-built and pushed;0049is not measured, and the owner's reference (a video of an ordinary unlock, a duress unlock and a return from a second phone) is not made. - Mentions
- ADR-231
1Decision
Corrects the mechanisms of ADR-231 after the measurements of its module builds. The stage window of an authorized switch has a window token of its own (createWindowContext of type TYPE_STATUS_BAR_ADDITIONAL, 0046) and follows the wallpaper zoom: its scale is lerp(min, max, 1 - zoomOut) / min with the window manager's own config_wallpaperMinScale and config_wallpaperMaxScale, fed by NotificationShadeDepthController#onZoomOutChanged (0047).
The keyguard exit of a switch with no app behind it tells the window manager at once that the keyguard is gone, holds the keyguard's views for 500 ms from the going-away (the bouncer to gone transition runs 0.525 s), then fades the root view of the shade out in 250 ms and hides it; a held exit that does not finish (locked again, a new switch, a canceled exit or fade) tells the window manager that the keyguard is shown again and restores the alpha of the shade (0048, 0049).
2Why and evidence
[measured 2026-11-15, lynx 2026111401 with module builds, 30 fps frames of the phone, 3382 layer samples, logcat] (1) The stage layer was "hidden by parent or layer flag" in the layer sample in which the shade layer left, 0.45 to 0.55 s after it was added and before the home had drawn; a transition snapshot: Display layer then held the picture for 0.4 to 0.6 s, the stage picture when it was taken while the stage was up and black when taken after: 0.6 s of black in 3 of 5 duress unlocks.
After 0046 no black frame in 4 unlocks. (2) The stage picture scaled by 1.10 equals the home wallpaper (mean error 7.1 against 1.2); WallpaperController#zoomOutToScale is lerp(min, max, 1 - zoomOut) and SystemUI sends zoomOut from the blur ratio of the shade, so the stage was the wallpaper at full zoom-out. After 0047 the best fit is scale 1.00, normalised error 0.01 to 0.08.
(3) The exit of a switch ended 17 ms after its start ("Keyguard exit without a corresponding app to show"), the shade was gone 0.2 s into the 0.5 s of the bouncer to gone transition, the blur stopped at 66. An ordinary unlock: pre-hide animation 0.2 s, going-away 0.23 to 0.25 s, transition started to finished 0.55 s; the duress pad flight starts 0.07 to 0.12 s later (decoy credential check).
With the hold of 450 ms the decoy home was displayed 1.29 to 1.48 s after the check (1.06 s on average before) because the call that tells the window manager the keyguard is gone sits in onKeyguardExitFinished, and the hide came 37 ms before the transition had finished, so the scrim stayed at 51 to 76 percent of the final brightness and jumped to full.
3Consequences
Rejected, each with its reason: keeping the shade window open until the stage is released (it changes touch and blur of the shade for every later use); a fixed scale of 1.10 (the value is derived from a ratio of one wallpaper, the window manager's resources are the source); the hold of 450 ms with the late window manager call (the home 0.3 s later); a hold of 320 ms (built into a build that was stopped and never reached the phone: it ends before the transition and leaves the scrim at a random brightness); a hide without the fade (the picture jumps from the dimmed to the full brightness in one frame).
[assumption] The stage became hidden with the shade because it shared its token: the layer hierarchy showed it under the shade layer, but whether it was a child or hidden by policy is not proven; the ordinary unlock goes through the same pre-hide and going-away as measured here and its dim returns by the same scrim; the constant of 500 ms stands for the end of the transition, which the mediator cannot observe (no KeyguardTransitionInteractor); a second call to the window manager is skipped once after the early one.
An automated security review of the commits (2026-11-15) named the early call as a possible fail-open desync of the window manager and the keyguard, and the fade as a possible shade left at alpha 0; both are closed by the restore on every path that does not finish.
4Review when
The owner sees black, a flash, a zoom or a slower home on the build of 0049; a video of the ordinary unlock differs from the duress unlock in pad flight or dim; the phone is locked again within 0.8 s of an authorized exit and shows a disagreement of the window manager and the keyguard; the constant of 500 ms hides the shade too early or too late.
Read from docs/governance/decision-log.md, entry ADR-232.