Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xiaomi devices permission to enable apps pop-up windows while running in the background

Xiaomi devices latest update introduced a new permission that prevents my app (custom shortcuts launcher) that works in the background from working untill users enable this permission: ""Display pop-up windows while running in the background"

The question is, how can I show a permission prompt window for this permission, or at least how to redirect users to "other permissions" screen?

like image 750
Mo Dev Avatar asked Dec 20 '19 00:12

Mo Dev


People also ask

What is display pop-up window while running in the background?

Display pop-up windows while running in the background : this one means to allow the app to draw over the system ui while the app is running in the background like services and broadcast.


Video Answer


1 Answers

To redirect users to the "other permissions" screen use this code

        Intent intent = new Intent("miui.intent.action.APP_PERM_EDITOR");
        intent.setClassName("com.miui.securitycenter",
                "com.miui.permcenter.permissions.PermissionsEditorActivity");
        intent.putExtra("extra_pkgname", getPackageName());
        startActivity(intent);

Source

Still looking for a way to tell if this option is check or not prgrammatically...

What's more interesting is, how some apps have managed to have this option checked before any user interaction... maybe there is some secret miui permission?...

like image 99
Zohar Avatar answered Oct 01 '22 14:10

Zohar