Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2deb9b54 authored by Felix's avatar Felix
Browse files

PhoneWindowManager/KeyEvent: Camera key as WakeKey

As discussed in https://r.android.com/973723



This makes any camera key event wake up the device.
Handling of the camera key apart from waking up the device might follow
in a later commit.

Signed-off-by: default avatarFelix <google@ix5.org>
Change-Id: I44dbc3f9ac465f664b6d740cb6a056b7f6e118fb
parent 867956b5
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1893,12 +1893,13 @@ public class KeyEvent extends InputEvent implements Parcelable {
    public static final boolean isWakeKey(int keyCode) {
        switch (keyCode) {
            case KeyEvent.KEYCODE_BACK:
            case KeyEvent.KEYCODE_CAMERA:
            case KeyEvent.KEYCODE_MENU:
            case KeyEvent.KEYCODE_WAKEUP:
            case KeyEvent.KEYCODE_PAIRING:
            case KeyEvent.KEYCODE_STEM_1:
            case KeyEvent.KEYCODE_STEM_2:
            case KeyEvent.KEYCODE_STEM_3:
            case KeyEvent.KEYCODE_WAKEUP:
                return true;
        }
        return false;
+1 −2
Original line number Diff line number Diff line
@@ -6482,7 +6482,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
            case KeyEvent.KEYCODE_VOLUME_MUTE:
                return mDockMode != Intent.EXTRA_DOCK_STATE_UNDOCKED;

            // ignore media and camera keys
            // ignore media keys
            case KeyEvent.KEYCODE_MUTE:
            case KeyEvent.KEYCODE_HEADSETHOOK:
            case KeyEvent.KEYCODE_MEDIA_PLAY:
@@ -6495,7 +6495,6 @@ public class PhoneWindowManager implements WindowManagerPolicy {
            case KeyEvent.KEYCODE_MEDIA_RECORD:
            case KeyEvent.KEYCODE_MEDIA_FAST_FORWARD:
            case KeyEvent.KEYCODE_MEDIA_AUDIO_TRACK:
            case KeyEvent.KEYCODE_CAMERA:
                return false;
        }
        return true;