How to detect "power save mode" in Android "Xiaomi MIUI" devices?
I use this code to detect "power save mode" in Android 5,6:
PowerManager powerManager = (PowerManager)
getActivity().getSystemService(Context.POWER_SERVICE);
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP
&& powerManager.isPowerSaveMode())
{
//power saving mode
}
But it's not work in "Xiaomi MIUI" devices.