且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何检测STAMINA模式?

更新时间:2023-11-30 15:52:46

我想知道这一点。我想一个天真的方法是检查时,应用程序实际上是上次惊醒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.