Android 17 bug leaves Toast visible on the lock screen
AOSP 17 has a window-layer regression: text Toasts and system Toasts holding INTERNAL_SYSTEM_WINDOW stay visible over the lock screen. The cause is a change in WindowManagerPolicy.getWindowLayerFromTypeLw, where TYPE_TOAST now returns layer 27 instead of 7 for processes with that permission, and SystemUI, which renders all text Toasts since Android 12, holds it.
- In Android 16 TYPE_TOAST always got layer 7, below the lock screen's layer 17
- Android 17 returns 27 when canAddInternalSystemWindow is true, and 27 > 17
- All text Toasts and custom Toasts from system apps are affected
- Proposed fix: a TYPE_TOAST case in canBeHiddenByKeyguard returning true
Read next
Software