ObliviOS Developer portal Project site

Home / Decisions / ADR-231

Corrects the mechanisms of ADR-230 after the first measurements of its build.

Proposed, recorded 15 November 2026.

Decision
ADR-231
Date
2026-11-15
Status
ProposedProposed (owner, 2026-11-15: the black screens, the card and the blue theme of the first build are not fixed, "work extremely thoroughly"; the owner's yes for the landing, the module build and the push of each fix). The patches 0037 to 0045 are in credential/duress-unlock-decoy of oblivios-platform, module-built and pushed to the phone (no image); the rows of the last build are not run.
Part
Duress Unlock
Mentions
ADR-229, ADR-230
Mentioned by
ADR-230, ADR-232, ADR-233

1Decision

Corrects the mechanisms of ADR-230 after the first measurements of its build.

The decoy's Launcher3 look (themed icons, icon shape, hidden labels) is written through the launcher's own grid_control provider, read from the owner's launcher when the device locks and written to the decoy after its storage is unlocked and before its home starts, which the window manager holds for at most 1.5 s (frameworks-base/0038, 0039, 0040); the lock-time launcher warm start (0021) is removed.

The decoy gets the outgoing user's wallpaper colours in ThemeOverlayController while it has none (0041).

An authorized switch is covered by a SystemUI stage window that draws the wallpaper bitmap itself, full screen, at the layer of the additional status bar (above the status bar, below the shade), and the window manager does not hide the wallpaper layer during the switch (DecoyWallpaperHold, 0042, 0043, 0044); the stage stays until the incoming home has drawn, which the window manager reports by a broadcast to the SystemUI package only (0045).

2Why and evidence

[measured 2026-11-15, lynx 2026111401 plus module builds, 30 fps frames of the phone, 1454 samples of layers.sh, logcat with the protolog groups WM_DEBUG_WALLPAPER and WM_DEBUG_WINDOW_TRANSITIONS] The exit transition of a duress unlock holds only the wallpaper token (OPEN f=0x100, changes: IS_WALLPAPER), that of an ordinary unlock the home task and the task display area (TO_BACK f=0x104), so nothing but the wallpaper layer is on screen and WindowManager decides its fate.

Three defects of that layer, all random: (1) the wallpaper service of the other user is bound at the switch and the layer is gone for 0.10 to 0.16 s while the pad is up (5 of 7 switches in one run), pad over black; (2) the engine's surface of 1006x1506 px is laid out again during the exit and shows for a few frames at its native size, a card over the top 63% (1506 of 2400) with black below, in 1 of 4 unlocks of the first run and for more than 2 s when the wallpaper was held without a cover; (3) after the exit WindowStateAnimator#prepareSurfaceLocked hid the wallpaper because the stage counted as not drawn while SystemUI redrew it after a theme overlay change (Canceling draw ... cancelDueToSync, protolog Hiding wallpaper ... from Window{SwitchStage}), black until the home drew (0.35 s in the protolog, up to 0.7 s seen).

The theme: mCurrentColors of ThemeOverlayController is keyed by user and the decoy never gets an entry (the service has the colours from the copied wallpaper_info.xml and does not report them), so the accent overlay of the decoy is built from no colours (default blue) and is replaced at every switch.

The prefs file of the launcher is owned by the app, mode 660, and system_server has no CAP_DAC_OVERRIDE, so it cannot be edited from there; the provider answers a caller that holds BIND_WALLPAPER (checked as root: both users read and write; the decoy's prefs file then held the three keys).

The snapshot layer of ADR-230 is a child of the display surface at the maximum layer, so no window can be above it; it does not appear at the switch on the fast path.

3Consequences

Rejected, each with its reason: editing the launcher's prefs file from system_server (mode 660, no DAC override); a stage window that only asks for the wallpaper (the first build of this ADR: WindowManager hides the wallpaper when that window counts as not drawn, and the engine layer jitters under it); skipping the wallpaper rebind at the switch or handing the owner's connection to the decoy's wallpaper data (110 uses of WallpaperData.connection in WallpaperManagerService, many with no null check: a null or a shared connection is a system_server crash); detaching the old engine only after the new one has shown (the window manager shows only the newest token, so the gap stays); a stage in a layer below the status bar (types below the shade are hidden by the keyguard policy while it shows, WindowState#canBeHiddenByKeyguard); a captured picture of the wallpaper layer in a window-manager layer (needs the hierarchy, the layer order and an alpha ramp written in system_server; kept as the next step if the drawn bitmap shows a seam at the hand-over); a persisted secure setting as the signal to the stage (refused by the automated security review, 2026-11-15: its presence proves that a duress switch happened, and apps can observe it); two new methods of ActivityManagerInternal for the look gate (framework.jar is not replaced by a module build: NoSuchMethodError, system_server ended at the duress PIN, 2026-11-15 02:37); a splash or a placeholder activity as the app target of the exit (the transition waits for the first draw of a cold launcher, ADR-229).

[assumption] The bitmap that the engine loads (getBitmapAsUser with FLAG_SYSTEM, returnDefault) drawn centre-cropped over black equals the engine's picture closely enough for a hand-over with a fade of 0.2 s; the broadcast reaches the stage before the home's first frame is hidden by it; the decoy's wallpaper equals the owner's (copied files), so the outgoing user's colours are the decoy's.

4Review when

The owner sees black, a card or the wrong colours in a frame read of the last build; the stage shows a seam against the real wallpaper; the home appears later than the ordinary one by more than the fade; a duress switch leaves a trace outside memory; a module build is pushed with a changed class of framework.jar.

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