参考文档:
https://blog.csdn.net/weixin_35691921/article/details/124961404
Android: alarm定时很短时,比如500ms,然后执行mPowerManager.forceSuspend()后,系统不会suspend,原因分析:
static int alarmtimer_suspend(struct device *dev)
{
...
/* Find the soonest timer to expire*/
for (i = 0; i < ALARM_NUMTYPE; i++) {
if (ktime_to_ns(min) < 2 * NSEC_PER_SEC) {
pm_wakeup_event(dev, 2 * MSEC_PER_SEC);
return -EBUSY; // 原因是在这里返回了
}
....
}