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.

Dominik Mičuta
  • 357
  • 4
  • 13
  • 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 Answers2

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
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