Search code examples
androidpermissionsnotificationsandroid-14

Check permission USE_FULL_SCREEN_INTENT always returns GRANTED on Android 14


Not going into much detail (NDA), our app (kotlin + compose) allows users to receive calls that they can accept or decline in the notifications. When the screen is locked and a call is received, a call screen appears like you would see in a regular call. Notifications are very important to the overall functionality of the app so we keep a check if the app has notification permissions like this:

val notificationsPermissionState: PermissionState = rememberPermissionState(
    android.Manifest.permission.POST_NOTIFICATIONS
)

if it has, app shows the home screen, if not, shows a screen explaining and requesting the permissions.

With Android 14 restrictions (link), we also need the USE_FULL_SCREEN_INTENT for the the call screen when the device has its screen locked. Previous Android versions this was auto-granted. On Android 14 it still is (for our app) but the user can revoke this.

Now here's the problem: when we check for this permission, USE_FULL_SCREEN_INTENT, the same way in the code above, it always returns GRANTED, even if the user revoked this before opening the app or during the app usage. It even returns GRANTED if the notification permissions are revoked. The same doesn't happen with POST_NOTIFICATIONS. It does show DECLINED if the user did so. The temporary solution is to use NotificationManager.canUseFullScreenIntent() which actually reports the correct state of the permission. So what's going on? Is it a bug in Android 14? We would prefer to check the same way we do for the other permissions than adding a new validation system just for one edge case.

Thank you.


Solution

  • Per the documentation, USE_FULL_SCREEN_INTENT is a normal permission. You merely request it in the manifest, and it does not use the runtime system (e.g., rememberPermissionState()) — that is only for dangerous permissions.

    when we check for this permission

    Your question does not show code for to this. If you are using something like checkSelfPermission(), that too is for dangerous permissions and will not work reliably for others.

    So what's going on? Is it a bug in Android 14?

    I do not know why USE_FULL_SCREEN_INTENT was set up as a normal permission if it can be revoked. Regardless, though, from an API standpoint, your description lines up with normal behavior, so it is less of a bug IMHO than it is a strange API design.