Android长按POWER直接关机

--- a/frameworks/base/services/core/java/com/android/server/policy/PhoneWindowManager.java
+++ b/frameworks/base/services/core/java/com/android/server/policy/PhoneWindowManager.java
@@ -1430,7 +1430,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
             if (!performHapticFeedbackLw(null, HapticFeedbackConstants.LONG_PRESS, false)) {
                 performAuditoryFeedbackForAccessibilityIfNeed();
             }
-            showGlobalActionsInternal();
+            //showGlobalActionsInternal();
+                       tchipShutdown(mContext);
             break;
         case LONG_PRESS_POWER_SHUT_OFF:
         case LONG_PRESS_POWER_SHUT_OFF_NO_CONFIRM:
@@ -1441,6 +1442,26 @@ public class PhoneWindowManager implements WindowManagerPolicy {
             break;
         }
     }
+       
+       private void tchipShutdown(Context context){ // AZ: Directly shutdown when press power key
+               android.util.Log.i("AZ", "tchipShutdown");
+        performHapticFeedbackLw(null, HapticFeedbackConstants.LONG_PRESS, false);
+        sendCloseSystemWindows(SYSTEM_DIALOG_REASON_GLOBAL_ACTIONS);
+        mWindowManagerFuncs.shutdown(false /* confirm */);
+       }

发布了234 篇原创文章 · 获赞 64 · 访问量 95万+

猜你喜欢

转载自blog.csdn.net/zhoumushui/article/details/101216579
今日推荐