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.
How to programmatically detect SONY - Stamina device energy profile is ON
Asked Answered
Yes, please - here too! See also [How to detect STAMINA mode?][1] [1]: https://mcmap.net/q/954176/-how-to-detect-stamina-mode –
Giverin
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.
Yes, it would be good to have. Then I can inform user about adding my app into stamina whitelist. –
Misjudge
I would like to have this option too. –
Freehearted
@marlin-sony Any updates on that? Is there any unofficial way to detect STAMINA mode? –
Kimbra
Note that "STAMINA" mode doesn't trigger the power saving mode listeners that recent Android version uses, which it definitely should... –
Marlenamarlene
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)
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. –
Marlenamarlene
© 2022 - 2024 — McMap. All rights reserved.