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.
Asked
Active
Viewed 1,003 times
9
-
Yes, please - here too! See also [How to detect STAMINA mode?][1] [1]: http://stackoverflow.com/questions/19624377/how-to-detect-stamina-mode – chksr Nov 05 '14 at 16:33
2 Answers
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.

mldeveloper
- 2,253
- 1
- 13
- 14
-
Yes, it would be good to have. Then I can inform user about adding my app into stamina whitelist. – peter.bartos Jan 29 '15 at 19:16
-
-
@marlin-sony Any updates on that? Is there any unofficial way to detect STAMINA mode? – Feb 16 '17 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 08 '18 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)

mobo
- 405
- 3
- 7
-
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 09 '18 at 15:10