How to detect STAMINA mode?
Asked Answered
R

2

12

Can you help me, how to programmatically detect STAMINA mode on Sony devices?

I want to notify user that my app will not work properly if STAMINA is ON because it's blocking AlarmManager and device is not waked up when I want.

Renfrew answered 27/10, 2013 at 22:24 Comment(7)
I do not believe that there is a way to detect STAMINA mode.Spiv
Well, for example... app Timely is showing dialog, when STAMINA is on (when starting app). So, there must be a way...Renfrew
@Renfrew Which Timely app are you talking about? I can find several on Google Play.Lenora
Maybe check if there's a system property for it?Banal
see if #25018632 can helpBasal
@Renfrew could you please tell us which Timely app are you talking about as hajons asked? I'd like to contact the creators and ask them how they did it. Thanks!Leandra
@DavidŘíha I meant this app: play.google.com/store/apps/details?id=ch.bitspin.timely I also contacted them and they said me, that they just show dialog for all types of phones at first start of app.Renfrew
L
0

I would like to know this too. I guess a naive way would be to check when the app was actually last awakened by AlarmManager and compare it to when you expected it to run. Keep track of shutdown and boot events to know if the phone was off.

Lenora answered 12/3, 2014 at 12:55 Comment(0)
T
0

One way to handle this would be to check the device model and manufacturer on startup of your app and if its a sony device show your own dialog informing the user that they might experience issues.

See below for how to check the device details:

String deviceName = android.os.Build.MODEL;
String deviceMan = android.os.Build.MANUFACTURER;

if(deviceMan.equals("Sony") {
    showAlert();
}

Maybe you can check online which sony devices have this feature if not all do.

Toehold answered 13/1, 2017 at 14:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.