6

We develop an application which requires several permissions in order to get the user’s location while in the background.

We are having problems requesting the required permissions on Xiaomi devices. It seems that in addition to location permission and white listing the app from battery optimizations, two additional steps are required, specific to Xiaomi devices:

  1. Disabling battery saver:

enter image description here

  1. Enabling auto-start:

enter image description here

The problem is we found no way of automatically requesting permission from the user, and the only way we found is having the user manually go to these screens and change the settings.

We did find shortcuts to take us “half way”.

  1. Going to power settings:

Intent intent = new Intent("miui.intent.action.POWER_HIDE_MODE_APP_LIST").addCategory(Intent.CATEGORY_DEFAULT);

  1. Going to auto start settings:

Intent intent = new Intent("miui.intent.action.OP_AUTO_START").addCategory(Intent.CATEGORY_DEFAULT);

But multiple non intuitive actions are still required from the user.

Our aim:

  1. We would very much like to make the process easier for the user. Optimally, to have a system dialog appear which asks the user for the permissions, instead of having him manually change the settings, much like the whitelisting of normal Android devices:

enter image description here

Is it possible using a Xiaomi specific SDK extension?

  1. If (1) is not possible, at the very least we need a way to know if the user changes these settings or not. Currently we don’t know and cannot inform the user if the application works properly or not!
Rizwan
  • 103
  • 4
  • 24
TalL
  • 1,661
  • 16
  • 16

0 Answers0