File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
policy/src/com/android/internal/policy/impl Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -730,14 +730,15 @@ private void cancelPendingScreenshotChordAction() {
730730 public void run () {
731731 // The context isn't read
732732 if (mLongPressOnPowerBehavior < 0 ) {
733- if (FactoryTest .isLongPressOnPowerOffEnabled ()) {
734- mLongPressOnPowerBehavior = LONG_PRESS_POWER_SHUT_OFF_NO_CONFIRM ;
735- } else {
736- mLongPressOnPowerBehavior = mContext .getResources ().getInteger (
737- com .android .internal .R .integer .config_longPressOnPowerBehavior );
738- }
733+ mLongPressOnPowerBehavior = mContext .getResources ().getInteger (
734+ com .android .internal .R .integer .config_longPressOnPowerBehavior );
739735 }
740- switch (mLongPressOnPowerBehavior ) {
736+ int resolvedBehavior = mLongPressOnPowerBehavior ;
737+ if (FactoryTest .isLongPressOnPowerOffEnabled ()) {
738+ resolvedBehavior = LONG_PRESS_POWER_SHUT_OFF_NO_CONFIRM ;
739+ }
740+
741+ switch (resolvedBehavior ) {
741742 case LONG_PRESS_POWER_NOTHING :
742743 break ;
743744 case LONG_PRESS_POWER_GLOBAL_ACTIONS :
@@ -753,8 +754,7 @@ public void run() {
753754 mPowerKeyHandled = true ;
754755 performHapticFeedbackLw (null , HapticFeedbackConstants .LONG_PRESS , false );
755756 sendCloseSystemWindows (SYSTEM_DIALOG_REASON_GLOBAL_ACTIONS );
756- mWindowManagerFuncs .shutdown (
757- mLongPressOnPowerBehavior == LONG_PRESS_POWER_SHUT_OFF );
757+ mWindowManagerFuncs .shutdown (resolvedBehavior == LONG_PRESS_POWER_SHUT_OFF );
758758 break ;
759759 }
760760 }
You can’t perform that action at this time.
0 commit comments