Android / Cannot start app at boot on certain devices (e.g. Xiaomi)

I followed all the guidance found on SO to autostart app at boot time.

In my manifest, I have set the right permission (RECEIVE_BOOT_COMPLETED) and also declared my broadcast receiver: .BootReceiver picking up Android.Intent.Action.BOOT_COMPLETED.

I also launch my service in BootReceiver, this is very straightforward stuff.

The thing is, my app starts at boot time on certain devices (I hope most devices) but not on some of them. I have a Xiaomi phone that gives me the following error at boot time:

"Unable to launch app com..example/10120 for broadcast Intent {act=android.intent.action.BOOT_COMPLETE flg=0x8000010 (has extras) }: process is not permitted to autostart."

I am surprised to see this message, because I can see that the list of permissions includes running at startup.

There must be a way, because Whatsapp for instance is launched at boot time.

Any clue would be highly appreciated.

Category:android Views:1 Time:2018-12-13
Tags: boot android

Related post

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.153 (s). 11 q(s)