Loading packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialogLite.java +20 −0 Original line number Diff line number Diff line Loading @@ -788,6 +788,11 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene @Override public boolean onLongPress() { // don't actually trigger the reboot if we are running stability // tests via monkey if (ActivityManager.isUserAMonkey()) { return false; } mUiEventLogger.log(GlobalActionsEvent.GA_SHUTDOWN_LONG_PRESS); if (!mUserManager.hasUserRestriction(UserManager.DISALLOW_SAFE_BOOT)) { mWindowManagerFuncs.reboot(true); Loading @@ -808,6 +813,11 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene @Override public void onPress() { // don't actually trigger the shutdown if we are running stability // tests via monkey if (ActivityManager.isUserAMonkey()) { return; } mUiEventLogger.log(GlobalActionsEvent.GA_SHUTDOWN_PRESS); // shutdown by making sure radio and power are handled accordingly. mWindowManagerFuncs.shutdown(); Loading Loading @@ -919,6 +929,11 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene @Override public boolean onLongPress() { // don't actually trigger the reboot if we are running stability // tests via monkey if (ActivityManager.isUserAMonkey()) { return false; } mUiEventLogger.log(GlobalActionsEvent.GA_REBOOT_LONG_PRESS); if (!mUserManager.hasUserRestriction(UserManager.DISALLOW_SAFE_BOOT)) { mWindowManagerFuncs.reboot(true); Loading @@ -939,6 +954,11 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene @Override public void onPress() { // don't actually trigger the reboot if we are running stability // tests via monkey if (ActivityManager.isUserAMonkey()) { return; } mUiEventLogger.log(GlobalActionsEvent.GA_REBOOT_PRESS); mWindowManagerFuncs.reboot(false); } Loading services/core/java/com/android/server/policy/PhoneWindowManager.java +5 −0 Original line number Diff line number Diff line Loading @@ -1247,6 +1247,11 @@ public class PhoneWindowManager implements WindowManagerPolicy { case LONG_PRESS_POWER_SHUT_OFF: case LONG_PRESS_POWER_SHUT_OFF_NO_CONFIRM: mPowerKeyHandled = true; // don't actually trigger the shutdown if we are running stability // tests via monkey if (ActivityManager.isUserAMonkey()) { break; } performHapticFeedback(HapticFeedbackConstants.LONG_PRESS_POWER_BUTTON, false, "Power - Long Press - Shut Off"); sendCloseSystemWindows(SYSTEM_DIALOG_REASON_GLOBAL_ACTIONS); Loading services/core/java/com/android/server/policy/PowerAction.java +11 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ */ package com.android.server.policy; import android.app.ActivityManager; import android.content.Context; import android.os.UserManager; import com.android.internal.globalactions.LongPressAction; Loading @@ -35,6 +36,11 @@ public final class PowerAction extends SinglePressAction implements LongPressAct @Override public boolean onLongPress() { // don't actually trigger the reboot if we are running stability // tests via monkey if (ActivityManager.isUserAMonkey()) { return false; } UserManager um = mContext.getSystemService(UserManager.class); if (!um.hasUserRestriction(UserManager.DISALLOW_SAFE_BOOT)) { mWindowManagerFuncs.rebootSafeMode(true); Loading @@ -55,6 +61,11 @@ public final class PowerAction extends SinglePressAction implements LongPressAct @Override public void onPress() { // don't actually trigger the shutdown if we are running stability // tests via monkey if (ActivityManager.isUserAMonkey()) { return; } // shutdown by making sure radio and power are handled accordingly. mWindowManagerFuncs.shutdown(false /* confirm */); } Loading services/core/java/com/android/server/policy/RestartAction.java +11 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ */ package com.android.server.policy; import android.app.ActivityManager; import android.content.Context; import android.os.UserManager; import com.android.internal.globalactions.LongPressAction; Loading @@ -35,6 +36,11 @@ public final class RestartAction extends SinglePressAction implements LongPressA @Override public boolean onLongPress() { // don't actually trigger the reboot if we are running stability // tests via monkey if (ActivityManager.isUserAMonkey()) { return false; } UserManager um = mContext.getSystemService(UserManager.class); if (!um.hasUserRestriction(UserManager.DISALLOW_SAFE_BOOT)) { mWindowManagerFuncs.rebootSafeMode(true); Loading @@ -55,6 +61,11 @@ public final class RestartAction extends SinglePressAction implements LongPressA @Override public void onPress() { // don't actually trigger the reboot if we are running stability // tests via monkey if (ActivityManager.isUserAMonkey()) { return; } mWindowManagerFuncs.reboot(false /* confirm */); } } Loading
packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialogLite.java +20 −0 Original line number Diff line number Diff line Loading @@ -788,6 +788,11 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene @Override public boolean onLongPress() { // don't actually trigger the reboot if we are running stability // tests via monkey if (ActivityManager.isUserAMonkey()) { return false; } mUiEventLogger.log(GlobalActionsEvent.GA_SHUTDOWN_LONG_PRESS); if (!mUserManager.hasUserRestriction(UserManager.DISALLOW_SAFE_BOOT)) { mWindowManagerFuncs.reboot(true); Loading @@ -808,6 +813,11 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene @Override public void onPress() { // don't actually trigger the shutdown if we are running stability // tests via monkey if (ActivityManager.isUserAMonkey()) { return; } mUiEventLogger.log(GlobalActionsEvent.GA_SHUTDOWN_PRESS); // shutdown by making sure radio and power are handled accordingly. mWindowManagerFuncs.shutdown(); Loading Loading @@ -919,6 +929,11 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene @Override public boolean onLongPress() { // don't actually trigger the reboot if we are running stability // tests via monkey if (ActivityManager.isUserAMonkey()) { return false; } mUiEventLogger.log(GlobalActionsEvent.GA_REBOOT_LONG_PRESS); if (!mUserManager.hasUserRestriction(UserManager.DISALLOW_SAFE_BOOT)) { mWindowManagerFuncs.reboot(true); Loading @@ -939,6 +954,11 @@ public class GlobalActionsDialogLite implements DialogInterface.OnDismissListene @Override public void onPress() { // don't actually trigger the reboot if we are running stability // tests via monkey if (ActivityManager.isUserAMonkey()) { return; } mUiEventLogger.log(GlobalActionsEvent.GA_REBOOT_PRESS); mWindowManagerFuncs.reboot(false); } Loading
services/core/java/com/android/server/policy/PhoneWindowManager.java +5 −0 Original line number Diff line number Diff line Loading @@ -1247,6 +1247,11 @@ public class PhoneWindowManager implements WindowManagerPolicy { case LONG_PRESS_POWER_SHUT_OFF: case LONG_PRESS_POWER_SHUT_OFF_NO_CONFIRM: mPowerKeyHandled = true; // don't actually trigger the shutdown if we are running stability // tests via monkey if (ActivityManager.isUserAMonkey()) { break; } performHapticFeedback(HapticFeedbackConstants.LONG_PRESS_POWER_BUTTON, false, "Power - Long Press - Shut Off"); sendCloseSystemWindows(SYSTEM_DIALOG_REASON_GLOBAL_ACTIONS); Loading
services/core/java/com/android/server/policy/PowerAction.java +11 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ */ package com.android.server.policy; import android.app.ActivityManager; import android.content.Context; import android.os.UserManager; import com.android.internal.globalactions.LongPressAction; Loading @@ -35,6 +36,11 @@ public final class PowerAction extends SinglePressAction implements LongPressAct @Override public boolean onLongPress() { // don't actually trigger the reboot if we are running stability // tests via monkey if (ActivityManager.isUserAMonkey()) { return false; } UserManager um = mContext.getSystemService(UserManager.class); if (!um.hasUserRestriction(UserManager.DISALLOW_SAFE_BOOT)) { mWindowManagerFuncs.rebootSafeMode(true); Loading @@ -55,6 +61,11 @@ public final class PowerAction extends SinglePressAction implements LongPressAct @Override public void onPress() { // don't actually trigger the shutdown if we are running stability // tests via monkey if (ActivityManager.isUserAMonkey()) { return; } // shutdown by making sure radio and power are handled accordingly. mWindowManagerFuncs.shutdown(false /* confirm */); } Loading
services/core/java/com/android/server/policy/RestartAction.java +11 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ */ package com.android.server.policy; import android.app.ActivityManager; import android.content.Context; import android.os.UserManager; import com.android.internal.globalactions.LongPressAction; Loading @@ -35,6 +36,11 @@ public final class RestartAction extends SinglePressAction implements LongPressA @Override public boolean onLongPress() { // don't actually trigger the reboot if we are running stability // tests via monkey if (ActivityManager.isUserAMonkey()) { return false; } UserManager um = mContext.getSystemService(UserManager.class); if (!um.hasUserRestriction(UserManager.DISALLOW_SAFE_BOOT)) { mWindowManagerFuncs.rebootSafeMode(true); Loading @@ -55,6 +61,11 @@ public final class RestartAction extends SinglePressAction implements LongPressA @Override public void onPress() { // don't actually trigger the reboot if we are running stability // tests via monkey if (ActivityManager.isUserAMonkey()) { return; } mWindowManagerFuncs.reboot(false /* confirm */); } }