How to programmatically detect SONY - Stamina device energy profile is ON
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. 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. 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) 来源: https://stackoverflow.com/questions/18845479/how-to-programmatically-detect-sony-stamina