Broadcast Receiver for Ultra Power Saving Mode

1.1k Views Asked by At

Is it possible to have a broadcast receiver when user turns off Ultra Power Saving Mode (Samsung) or Ultra Stamina Mode (Sony) and so with Ultra modes implemented by different device vendors?

I have a alarm manager running which triggers my IntentService after a certain interval, when I turn on Ultra mode on either Sony or Samsung, alarm manager is not available, but when I turn off the ultra mode, I want the action broadcasted so that I can receive it and start my alarm manager as normally we do on Boot_Completed.

I found some info online, such as POWER_SAVE_MODE but it also stated it was only available in lollipop.

Appreciate the help.

Thanks

2

There are 2 best solutions below

0
On

First of all this way only tested on Samsung device with Android 4.4 API 19.

All you have to do is just treating turning off the ultra power saving mode as BOOT_COMPLETED action.

Which means simply you have to make your activity or service (whatever initiating the AlarmManager) start with system boot up so that it start after turning off the ultra power saving mode.

0
On

Ultra Power Saving Mode is not enabled or available in the stock android or does not have any documentations whereas sony tries to kill some apps or some sensors to keep the battery for more time.