System Alert Window
The following behavior changes apply to
all apps
when they run on Android 11, regardless of
targetSdkVersion
.
To display overlay dialog on other applications or on system screen, you require SYSTEM_ALERT_WINDOW permission. This permission can be enabled from the device setting menu using ACTION_MANAGE_OVERLAY_PERMISSION Intent.
In Android 11:
ACTION_MANAGE_OVERLAY_PERMISSION Intent will take user to common system setting screen, where the user can select which app allows to access system window.
In Android 10 and below:
ACTION_MANAGE_OVERLAY_PERMISSION Intent will take the user to application setting screen, where the user can turn ON system window permission.
Exception:
For a few applications, the system will automatically grant permission using ACTION_MANAGE_OVERLAY_PERMISSION.
E.g. Dialer application, Any app that is capturing the screen via a MediaProjection.