[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;
相关文章
相关标签/搜索