reboot system case:factory reset Settings/src/com/android/settings/MasterClear.java sendBroadcast(new Intent("android.intent.action.MASTER_CLEAR"));
-> frameworks/base/services/java/com/android/server/MasterClearReceiver.java RecoverySystem.rebootWipeUserData(context);
-> frameworks/base/core/java/android/os/RecoverySystem.java bootCommand(context, "--wipe_data");
-> PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE); pm.reboot("recovery");
-> frameworks/base/services/java/com/android/server/PowerManagerService.java public void reboot(String reason){ ShutdownThread.reboot(mContext, finalReason, false); }
-> frameworks/base/core/java/com/android/internal/app/ShutdownThread.java rebootOrShutdown(){ Power.reboot(reason); }
-> frameworks/base/core/java/android/os/Power.java rebootNative(reason);
-> frameworks/base/core/jni/anroid_os_Power.cpp __reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, LINUX_REBOOT_CMD_RESTART2, (char*) chars);
-> kernel/kernel/sys.c case LINUX_REBOOT_CMD_RESTART2: kernel_restart(buffer); -> machine_restart(cmd);
-> kernel/arch/arm/kernel/process.c void arm_machine_restart(char mode, const char *cmd){ //set flag and reboot }
Android reboot流程代码分析
原文作者:PowerManagerService
原文地址: http://www.cnblogs.com/faithchiel/articles/2680279.html
本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
原文地址: http://www.cnblogs.com/faithchiel/articles/2680279.html
本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。