Android is based on Linux,so the base is more or less same as that of Linux Suspend Resume.
There are few additional functionality,most important being Wakelocks and Early Suspend which are added to make the mobiles,PDA more power efficient as they have limited battery.现在让我们从你问的问题开始吧:
一旦按下电源按钮,显然会触发中断,从而启动序列.差异:您应该注意到,只要按下电源按钮,LCD和触摸就会进入睡眠状态.他们是早婚.设备可能正常运行,只需耗电量最大的LCD,触摸就会进入睡眠状态.然后在后台检查Wakelocks,是否有人正在获取,好像有人正在获取然后执行那些待处理的任务.
常见:然后文件系统被同步(RAM – > NAND)并且进程被冻结.然后设备暂停,然后保存cpu状态然后它休眠.序列在Linux和Android中都很常见.
在Android接收event.POWER并确认没有wake_lock存在,Android
通过echo mem触发内核中的挂起流> / SYS /电源/状态:state_store>> pm_suspend>> enter_state>> suspend_prepare>> suspend_devices_and_enter>> dpm_suspend_start>> dpm_suspend>> device_suspend>> __device_suspend —> suspend_enter(在__device_suspend完成后由suspend_device_and_enter调用)
上述序列存在于Linux和Android中.
文件:
suspend.c,(kernel / power /)
wakelock.c,main.c(drivers / base / power).注意:所有特定于SoC的挂起回调(如enter,valid,begin)都存在于arch / arm /<中的pm.c中.夹.