Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Anyone knows where is "start in background" permission in MIUI 11?

I'm not able to start activity in MIUI 11 redmi note 6 pro mobile, I am getting error as:

com.android.server.am.ExtraActivityManagerService: MIUILOG- Permission Denied Activity

I found some solution like turn on "start in background" permission. I can't find something like this with MIUI 11. Literally I have no idea about this issue. Thanks in advance.

like image 271
Muthukumaaran Chandramohan Avatar asked Dec 06 '19 13:12

Muthukumaaran Chandramohan


People also ask

What is autostart in permission?

The Android autostart management is used to ease you in starting your favorite applications on your device through one click. These types of applications make it easy for you to manage resources on your phone. The application allows you to pick one app that'll be launched whenever you reboot your device.

How do I know what apps are running in the background in xiaomi?

Open settings application. Tap on Apps. Go to Manage apps. You will now see a list of applications.

How do I stop xiaomi from killing background apps?

Use QTI Memory Optimization(root) This is a Magisk module that patches some libraries in Android and makes the whole Android run lighter and stop killing the apps as well.


1 Answers

I have a similar problem with starting activity from BroadcastReceiver when application is stopped.

1) You can find your app in the settings and allow permission "start in the background".
2) If you need to allow permission programmatically, try to open application settings

Xiaomi

This code will open applicatin permissions settings in which you should allow "start in the background"

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);


Devices without system wrappers

This code will open the applicatin settings in which you should open permissions and allow "start in the background" permission

Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);

Read more about android settings intents: How to open application permission window in app settings programmatically

And you can also check the code from github to work with permissions in different system wrappers like flyme, miui, oppo etc: https://github.com/zhaozepeng/FloatWindowPermission

Hope this helps you!

If you have other options for resolving this issue, I would appreciate a reply in the comments . . .

like image 164
lincollincol Avatar answered Oct 13 '22 21:10

lincollincol