如何检测STAMINA模式?模式、STAMINA

2023-09-06 03:07:01 作者:孤↘独の密мα

您可以帮我,如何通过编程检测STAMINA模式的索尼设备?

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

我要通知用户,我的应用程序将无法正常工作,如果后劲,因为它的阻止AlarmManager和设备没有唤醒时,我想要的。

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.

推荐答案

我想知道这一点。我想一个天真的方法是检查时,应用程序实际上是上次惊醒AlarmManager和比较,当你希望它运行。跟踪的关机和引导事件要知道,如果手机被关闭。

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.