Check autostart in EMUI

Viewed 68

Is there a solution for EMUI similar to this this https://dontkillmyapp.com/xiaomi ?

Autostart autostart = new Autostart(applicationContext);

State state = autostart.getAutoStartState();

if (state == State.DISABLED) {
    // now we are sure that autostart is disabled
    // ask user to enable it manually in the settings app    
} else if (state == State.ENABLED) {
    // now we are also sure that autostart is enabled
}

Need check autostart for Huawei EMUI, thanks

1 Answers

The following is how to start up auto-start on Huawei devices, you could try to see if it's useful :

Intent intent = new Intent();
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
ComponentName componentName = null;
componentName = ComponentName.unflattenFromString("com.huawei.systemmanager/.startupmgr.ui.StartupNormalAppListActivity");
intent.setComponent(componentName);
context.startActivity(intent);
Related