[Android]長按電源鍵(Power Key)的處理

Android4.2代碼位置: \frameworks\base\policy\src\com\android\internal\policy\impl\PhoneWindowManager.javajava

關鍵方法: PhoneWindowManager.java -->interceptKeyBeforeQueueing()android

case KeyEvent.KEYCODE_POWER: //26code

-->interceptPowerKeyDown()orm

-->private final Runnable mPowerLongPress = new Runnable() {it

case LONG_PRESS_POWER_GLOBAL_ACTIONS:
            mPowerKeyHandled = true;
            if (!performHapticFeedbackLw(null, HapticFeedbackConstants.LONG_PRESS, false)) {
                performAuditoryFeedbackForAccessibilityIfNeed();
            }
            sendCloseSystemWindows(SYSTEM_DIALOG_REASON_GLOBAL_ACTIONS);
            showGlobalActionsDialog();
            break;
相關文章
相關標籤/搜索