Trusted Web Activities: short-edges cutout / edge-to-edge support

Chromium issue 566271943 · stacked on CL 8447912 (WebAppShortEdgesCutoutMode standalone parameter) · Pixel 6a, Android 17

What changed

WebAppShortEdgesCutoutMode previously coordinated edge-to-edge and display-cutout handling only for installed webapps and WebAPKs (WebappActivity). Trusted Web Activities launch in CustomTabActivity and were only half-wired: the cutout delegate could see a TWA display mode, but the activity never deferred its window token or installed the inset consumer.

With the change, an eligible TWA behaves like a WebAPK: the window starts fitted, and only a page declaring viewport-fit=cover goes full-bleed under the status bar via DisplayCutoutController. ImmersiveMode TWAs keep their client-supplied cutout mode. Ordinary Custom Tabs are untouched. Fullscreen TWAs are covered by the top-level flag; DefaultMode (standalone) additionally requires the default-off enable_standalone parameter.

Try it yourself

TWAs cannot be launched from a web page, so this sampler ships a minimal launcher app. The site publishes Digital Asset Links for the APK's signing key, so the TWA opens fully verified (no Custom Tab toolbar).

Download launcher APK (~800 KB) Open the probe page in a browser tab

  1. Install the APK (adb install twa-sampler-566271943.apk; it is self-signed, so sideloading warnings are expected). Source: MainActivity.java, AndroidManifest.xml, build notes.
  2. In a Chromium build containing the change, enable the feature, e.g.
    adb shell "echo '_ --enable-features=WebAppShortEdgesCutoutMode:enable_standalone/true' > /data/local/tmp/chrome-command-line"
    and start Chrome twice so the cached flag picks the value up.
  3. Open TWA 566271943 from the launcher and tap Launch standalone TWA or Launch immersive TWA. The probe page shows live innerHeight / safe-area-inset-* metrics and lets you switch viewport-fit between cover, auto, and contain.

The launcher prefers an installed org.chromium.chrome and falls back to Chrome stable/beta/dev/canary.

Result matrix (standalone TWA, viewport-fit=cover)

BuildFlag configinnerHeightsafe-area top/bottomResult
before (parent CL only)flag off8160 / 0fitted
beforeflag on, param off8160 / 0fitted
beforeflag on, param on81651 / 0still fitted - TWA not wired
after (this CL)flag off8160 / 0fitted (unchanged)
afterflag on, param off8160 / 0fitted (opt-in still required)
afterflag on, param on91451 / 48full-bleed edge-to-edge

With the parameter on, switching the page to viewport-fit=auto returns to the fitted 816px layout, and the immersive TWA hides the system bars entirely while reporting the same 51px/48px safe areas.

Before / after screenshots (flag on, enable_standalone on)

Before: standalone TWA stays fitted despite cover
Before: cover page stays fitted at 411 x 816; content below the status bar.
After: standalone TWA draws edge-to-edge
After: cover page draws full-bleed at 411 x 914 with 51px/48px safe areas.
After: switching to auto restores the fitted layout
After: switching the page to auto returns to the fitted 411 x 816 layout.
After: immersive TWA with hidden system bars
After: immersive TWA hides system bars; safe areas still 51px/48px.

Flag off / parameter off (both builds stay fitted)

Before, flag off
Before, flag off: fitted.
After, flag off
After, flag off: fitted (killswitch intact).
Before, param off
Before, flag on / param off: fitted.
After, param off
After, flag on / param off: fitted (standalone stays opt-in).

Environment