AlarmManager 的唤醒类型

AlarmManager 的唤醒类型

AlarmManager.RTC,硬件闹钟,不唤醒手机(也可能是其它设备)休眠;当手机休眠时不发射闹钟。
AlarmManager.RTC_WAKEUP,硬件闹钟,当闹钟发躰时唤醒手机休眠;
AlarmManager.ELAPSED_REALTIME,真实时间流逝闹钟,不唤醒手机休眠;当手机休眠时不发射闹钟。
AlarmManager.ELAPSED_REALTIME_WAKEUP,真实时间流逝闹钟,当闹钟发躰时唤醒手机休眠;

具体源码

xref: /frameworks/base/core/java/android/app/AlarmManager.java

83public class AlarmManager {
84    private static final String TAG = "AlarmManager";
85
86    /**
87     * Alarm time in {@link System#currentTimeMillis System.currentTimeMillis()}
88     * (wall clock time in UTC), which will wake up the device when
89     * it goes off.
90     */
91    public static final int RTC_WAKEUP = 0;
92    /**
93     * Alarm time in {@link System#currentTimeMillis System.currentTimeMillis()}
94     * (wall clock time in UTC).  This alarm does not wake the
95     * device up; if it goes off while the device is asleep, it will not be
96     * delivered until the next time the device wakes up.
97     */
98    public static final int RTC = 1;
99    /**
100     * Alarm time in {@link android.os.SystemClock#elapsedRealtime
101     * SystemClock.elapsedRealtime()} (time since boot, including sleep),
102     * which will wake up the device when it goes off.
103     */
104    public static final int ELAPSED_REALTIME_WAKEUP = 2;
105    /**
106     * Alarm time in {@link android.os.SystemClock#elapsedRealtime
107     * SystemClock.elapsedRealtime()} (time since boot, including sleep).
108     * This alarm does not wake the device up; if it goes off while the device
109     * is asleep, it will not be delivered until the next time the device
110     * wakes up.
111     */
112    public static final int ELAPSED_REALTIME = 3
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

法迪

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值