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

Commit 677adf1e authored by Nick Armstrong-Crews's avatar Nick Armstrong-Crews
Browse files

Handle KEYCODE_SOFT_SLEEP from Ungaze.

Needed for Ungaze to trigger "soft sleep" (respecting wake locks); operates by
sending new KEYCODE_SOFT_SLEEP to PhoneWindowManager, which calls
PowerManagerService's new method setUserInactiveOverride (thereby
causing immediate sleep, modulo wakelocks, upon next iteration of
PowerManagerService's main loop).

BUG: b/23589870
Change-Id: I24a96bd6db8ff28674c907f2898e49c4f6140209
parent 38ae1196
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -35217,6 +35217,7 @@ package android.view {
    field public static final int KEYCODE_SLEEP = 223; // 0xdf
    field public static final int KEYCODE_SOFT_LEFT = 1; // 0x1
    field public static final int KEYCODE_SOFT_RIGHT = 2; // 0x2
    field public static final int KEYCODE_SOFT_SLEEP = 276; // 0x114
    field public static final int KEYCODE_SPACE = 62; // 0x3e
    field public static final int KEYCODE_STAR = 17; // 0x11
    field public static final int KEYCODE_STB_INPUT = 180; // 0xb4
+1 −0
Original line number Diff line number Diff line
@@ -37520,6 +37520,7 @@ package android.view {
    field public static final int KEYCODE_SLEEP = 223; // 0xdf
    field public static final int KEYCODE_SOFT_LEFT = 1; // 0x1
    field public static final int KEYCODE_SOFT_RIGHT = 2; // 0x2
    field public static final int KEYCODE_SOFT_SLEEP = 276; // 0x114
    field public static final int KEYCODE_SPACE = 62; // 0x3e
    field public static final int KEYCODE_STAR = 17; // 0x11
    field public static final int KEYCODE_STB_INPUT = 180; // 0xb4
+6 −0
Original line number Diff line number Diff line
@@ -107,6 +107,12 @@ public abstract class PowerManagerInternal {
     */
    public abstract void setUserActivityTimeoutOverrideFromWindowManager(long timeoutMillis);

    /**
     * Used by the window manager to tell the power manager that the user is no longer actively
     * using the device.
     */
    public abstract void setUserInactiveOverrideFromWindowManager();

    /**
     * Used by device administration to set the maximum screen off timeout.
     *
+3 −1
Original line number Diff line number Diff line
@@ -784,8 +784,10 @@ public class KeyEvent extends InputEvent implements Parcelable {
    /** Key code constant: Step backward media key.
     * Steps media backward, one frame at a time. */
    public static final int KEYCODE_MEDIA_STEP_BACKWARD = 275;
    /** Key code constant: put device to sleep unless a wakelock is held. */
    public static final int KEYCODE_SOFT_SLEEP = 276;

    private static final int LAST_KEYCODE = KEYCODE_MEDIA_STEP_BACKWARD;
    private static final int LAST_KEYCODE = KEYCODE_SOFT_SLEEP;

    // NOTE: If you add a new keycode here you must also add it to:
    //  isSystem()
+1 −0
Original line number Diff line number Diff line
@@ -1814,6 +1814,7 @@ i
        <enum name="KEYCODE_MEDIA_SKIP_BACKWARD" value="273" />
        <enum name="KEYCODE_MEDIA_STEP_FORWARD" value="274" />
        <enum name="KEYCODE_MEDIA_STEP_BACKWARD" value="275" />
        <enum name="KEYCODE_SOFT_SLEEP" value="276" />
    </attr>

    <!-- ***************************************************************** -->
Loading