Home » Android » android – Unable to wake up app from background on Xiaomi devices till "Autostart" is enabled manually

android – Unable to wake up app from background on Xiaomi devices till "Autostart" is enabled manually

Posted by: admin May 14, 2020 Leave a comment

Questions:

On Xiaomi’s MI devices, there is a feature of turning off/on “Autostart” in their security app. (In Security App->Permissions->AutoStart)

enter image description here

This means none of the broadcast receivers receive anything while the app is not running. So BOOT_COMPLETED, USER_PRESENT, CONNECTIVITY_CHANGE, etc… do not work. (They work for a while after the app is on foreground, but stop soon). They also stop working after the user swipes the app from Xiaomi’s version of “recent apps”

Even GCM fails to wake it up

For messaging apps, this is a killer.

By default, apps like Whatsapp, Messenger, Flipkart etc… are enabled by default (Even if these apps are not pre-installed).

Most other apps have this disabled by default. eg. Slack is disabled by default.

Is there a way to get on this white-list by default?

How to&Answers: