本文将带你了解Android应用开发之android 手机关机流程分析,希望本文对大家学Android有所帮助。
android 手机关机流程分析。rebootOrShutdown -》lowLevelShutdown-》SystemProperties.set("sys.powerctl", xxx);
在init.rc 中on property:sys.powerctl=*powerctl ${sys.powerctl}
kernel-4.4/kernel/reboot.c
SYSCALL_DEFINE4(reboot, int, magic1, int, magic2, unsigned int, cmd, void __user *, arg){
case LINUX_REBOOT_CMD_POWER_OFF:
do_gettimeofday(&start); printk(KERN_ERR " %14s: %lu.%03lu [sec]\n", "Total time", start.tv_sec, (unsigned long) (start.tv_usec/1000)); kernel_power_off();
do_exit(0);
break;
本文由职坐标整理并发布,希望对同学们有所帮助。了解更多详情请关注移动开发之Android频道!