关于类型AlarmManager.RTC_WAKEUP和AlarmManager.RTC的警报之间的差异 [英] About the difference between the alarms of type of AlarmManager.RTC_WAKEUP and AlarmManager.RTC

查看:2717
本文介绍了关于类型AlarmManager.RTC_WAKEUP和AlarmManager.RTC的警报之间的差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是什么类型的报警器之间的差异 RTC_WAKEUP RTC

What is the difference between the alarms of type of RTC_WAKEUP and RTC?

从的documenatation的 AlarmManager ,似乎 RTC 不可以唤醒如果设备当前处于睡眠状态,不会交付的设备醒来,直到下一次设备。
但我发现,键入 RTC 仍将唤醒设备的报警,所以这是怎么回事?

From the documenatation of the AlarmManager, it seems that alarms of RTC will not wake up the device if the device current is asleep, and will not delivered until the next time the device wakes up. But I found that the alarm of type of RTC will still wake up the device, so what's going on?

我所做的就是把 RTC_WAKEUP 的类型更改为 RTC AlamrManagerService的.java ,功能 setRepeating(),然后设置为3分钟,从现在开始报警,然后检查设备,你会发现它还可以通过报警来唤醒。

What I did is to change the type of RTC_WAKEUP to RTC in the AlamrManagerService.java, function setRepeating(), and then set an alarm of 3 minutes from now on, then check the device, you will find that it still could be waken up by the alarm.

推荐答案

有其他情况的报告<一href=\"http://developer.android.com/reference/android/app/AlarmManager.html#RTC\"><$c$c>AlarmManager.RTC似乎唤醒设备:

THere are other instances reporting AlarmManager.RTC seems to wake up the device:

  • AlarmManager.RTC doing too many updates on wakeup
  • Android AlarmManager RTC doesn't pause while device is sleeping
  • Allowing the phone to sleep while using RTC alarm on Android

每一次,根本原因是一样的:

Each time, the root cause is the same:

东西保持清醒的设备(即使屏幕是黑的)。结果
不要忘了充电设备(连接到电源)没有睡觉。

Something keeps the device awake (even though the screen is black).
Don't forget that a charging device (connected to power) isn't sleeping.

这篇关于关于类型AlarmManager.RTC_WAKEUP和AlarmManager.RTC的警报之间的差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆