Read the `Power Saving Modes` settings on the MIUI devices
Asked Answered
H

0

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?

Honniball answered 10/8, 2018 at 5:39 Comment(2)
I'm not familiar with MIUI, but in vanilla Android you can accomplish that with ((PowerManager) context.getSystemService(Context.POWER_SERVICE)).isPowerSaveMode();Longicorn
in my case I need MIUI settings only, Android settings are fine and out of the scope of this question.Honniball

© 2022 - 2024 — McMap. All rights reserved.