-1

I implemented one service which takes location of user for every 3 mins but the problem in xiaomi is default app gets battery saver option because of that it's not updating location.Is there any way to find this and enable??enter image description here

enter image description here

By default it is battery saver option I want it to be No restrictions

Community
  • 1
  • 1

1 Answers1

0

To open list of apps for choosing battery optimization you can use this code sample:

private void openPowerSettings(Context context) {
    Intent intent = new Intent();
    intent.setAction(Settings.ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS);
    context.startActivity(intent);
}
lazy
  • 149
  • 8