6

The Power Saving Modes settings is different from the regular Android OS Power Saver setting and accessible on MIUI devices only (or rather accessible at least on MIUI devices)

Settings -> Battery & Performance -> Manage apps battery usage

Manage apps battery usage

Power Saving Modes

The issue is that on MIUI devices this option is enabled by default and foreground service with location tracking enabled to continue to work when the app is backgrounded but new locations from GPS provider are not coming.

I want to read the mode setting to provide a user with UX which allows him to be aware that this option is enabled and consider it before backgrounding the app.

Is it possible to read this setting programmatically?

Nick Cardoso
  • 20,807
  • 14
  • 73
  • 124
Mando
  • 11,414
  • 17
  • 86
  • 167
  • 1
    I'm not familiar with MIUI, but in vanilla Android you can accomplish that with ((PowerManager) context.getSystemService(Context.POWER_SERVICE)).isPowerSaveMode(); – nandsito Aug 15 '18 at 00:11
  • in my case I need MIUI settings only, Android settings are fine and out of the scope of this question. – Mando Aug 16 '18 at 22:33

0 Answers0