1 year ago

#372097

test-img

Giorgos Konstantakis

Bug with Display Pop-Up window permission in Android 11

I have an app, which asks from the user several permissions, such as the overlay permissions (in xiaomi the “Display pop-up window” permission).

Furthermore, the app requests from the user to become the default dialer of the device.

We check if the “Display pop-up window” permission is granted or not with the above code:

        val property = method.invoke(manager, 24 /*AppOpsManager.OP_SYSTEM_ALERT_WINDOW*/,
               Binder.getCallingUid(), context.applicationContext.packageName) as Int
        return AppOpsManager.MODE_ALLOWED == property

While this is working as expected in the usual cases, there is a major problem, when a user changes the default dialer of his/her device from our dialer app to another dialer app through the app permissions.

For some reason, in the above case, the device takes back the “Display pop-up window” permission that the user has already granted to the app, .

That means, after the change of default dialer, the above code returns false, because the property value is equal to property = AppOpsManager.MODE_DEFAULT

Even worse than that, when our app prompts the user to go and grant again the “Display pop-up window” permission, when the permissions window opens, it shows that the permissions are all set correctly, which is NOT the truth.

If in this screen, the user takes back the “Display pop-up window” permission , and immediately grant it again, then the permission is fixed property = AppOpsManager.MODE_ALLOWED

enter image description here

Also, if the user goes and manually set our app as the default dialer again, the permission is again fixed.

So, we have a problem when the user changes his/her default dialer to another app, because that way we are not able to display our content correctly.

Is there any chance that this is a bug in Android 11 in general (or only in Xiaomi)?

Please could you check that issue? It is really important for my app.

Thank you.

Device Tested: Poco F3, MIUI Global 12.5.8, Android 11

android

android-permissions

android-11

xiaomi

0 Answers

Your Answer

Accepted video resources