Home » Android » How to get autostart permission?

How to get autostart permission?

Posted by: admin November 1, 2017 Leave a comment


For the application I write crash stability is quite important. I found that if app doesn’t have autostart permission it does not receive properly onTaskRemoved callback in Service . At least this happens on my Xiaomi smartphone. When I turn this permission on manually callback started to be called.

But!! while I turned this permission on manually I found that there are applications that received this permission without help. I.e. Facebook, AliExpress, Moovit etc.

How did they received this permission? I tried to receive RECEIVE_BOOT_COMPLETED. This doesn’t help. What is the trick?