9

I want to notify user that my app will not work properly if he has SONY android phone with STAMINE energy profile ON. This profile is blocking AlarmManager and device is not waked up when I want.

1

2 Answers 2

4

Currently, there is no official way to detect if the STAMINA energy profile is selected. However, if there is enough community demand we may be able to open this up.

4
  • Yes, it would be good to have. Then I can inform user about adding my app into stamina whitelist. Jan 29, 2015 at 19:16
  • I would like to have this option too.
    – dragoon
    Mar 31, 2015 at 20:13
  • @marlin-sony Any updates on that? Is there any unofficial way to detect STAMINA mode?
    – tlau
    Feb 16, 2017 at 14:02
  • Note that "STAMINA" mode doesn't trigger the power saving mode listeners that recent Android version uses, which it definitely should...
    – Jake Lee
    Oct 8, 2018 at 11:03
1

You could check it via

Settings.Secure.getInt(contentResolver, "somc.stamina_mode", 0) == 1

Works at least on the Sony Xperia XZ1 Compact (8.0.0)

1
  • Note that this only detects if the mode is enabled, not whether it is currently operating! So if the user has "activate when < 15%", and the device is at 100%, it'll still return true.
    – Jake Lee
    Oct 9, 2018 at 15:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.