Android: alarm定时很短时,比如500ms,测试执行mPowerManager.forceSuspend()后,系统不会suspend

参考文档:
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;  // 原因是在这里返回了
	}
	....
}

Android: alarm定时很短时,比如500ms,测试执行mPowerManager.forceSuspend()后,系统不会suspend_第1张图片
Android: alarm定时很短时,比如500ms,测试执行mPowerManager.forceSuspend()后,系统不会suspend_第2张图片

Android: alarm定时很短时,比如500ms,测试执行mPowerManager.forceSuspend()后,系统不会suspend_第3张图片

Android: alarm定时很短时,比如500ms,测试执行mPowerManager.forceSuspend()后,系统不会suspend_第4张图片

Android: alarm定时很短时,比如500ms,测试执行mPowerManager.forceSuspend()后,系统不会suspend_第5张图片

Android: alarm定时很短时,比如500ms,测试执行mPowerManager.forceSuspend()后,系统不会suspend_第6张图片

你可能感兴趣的:(BSP,Android,Framework,android)