What is the definition of asleep for an android device?

前端 未结 2 1955
忘掉有多难
忘掉有多难 2021-01-04 14:02

I\'m using

alarmManager.setInexactRepeating(AlarmManager.ELAPSED_REALTIME, 0, DURATION, broadcast);

To schedule an repeating task that sho

2条回答
  •  迷失自我
    2021-01-04 14:16

    A screen that is off, does not necessarily indicate a sleeping device. Applications can request wake locks that will keep the device awake while the screen is off. If another app has a timer that does not use inexact repeating, then the device will wake up for that as well.

    Depending on the version of Android on your device, you can find a chart of your awake time in Settings - > About Phone -> Battery Use -> Then clicking on the graph up top. More information on wake locks can be found at http://developer.android.com/reference/android/os/PowerManager.html

提交回复
热议问题