在android源碼的shutdownthread.java的shutdown方法中有如下處理
···
*/
? ? public static void shutdown(final Context context, String reason, boolean confirm) {
? ? ? ? mReboot = false;
? ? ? ? mRebootSafeMode = false;
? ? ? ? mReason = reason;
? ? ? ? Log.d(TAG, "!!! Request to shutdown !!!");
? ? ? ? if (mSpew) {
? ? ? ? ? ? StackTraceElement[] stack = new Throwable().getStackTrace();
? ? ? ? ? ? for (StackTraceElement element : stack)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? Log.d(TAG, "? ? |----" + element.toString());
? ? ? ? ? ? }
? ? ? ? }
? ? ? ? if (SystemProperties.getBoolean("ro.monkey", false)) {
? ? ? ? ? ? Log.d(TAG, "Cannot request to shutdown when Monkey is running, returning.");
? ? ? ? ? ? return;
? ? ? ? }
? ? ? ? shutdownInner(context, confirm);
? ? }
···
可以看到如果在跑monkey的話以清,就直接return掉了泡躯。所以就是此處做的處理贮竟,需要自己修改的話可以在這里進行