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

Commit e941ebd6 authored by athurh's avatar athurh Committed by Gerrit Code Review
Browse files

android.policy: Fix launching home when waking the device with the home button

Change-Id: I856147557e99f4deeaa1befdf76646e36b0c5e57
parent 8293e02e
Loading
Loading
Loading
Loading
+10 −5
Original line number Diff line number Diff line
@@ -528,6 +528,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
    private int mPressOnAppSwitchBehavior = -1;
    private int mLongPressOnAppSwitchBehavior = -1;

    private boolean mHomePressed;

    // To identify simulated keypresses, so we can perform
    // the default action for that key
    private boolean mIsVirtualKeypress;
@@ -2108,9 +2110,10 @@ public class PhoneWindowManager implements WindowManagerPolicy {

            // If we have released the home key, and didn't do anything else
            // while it was pressed, then it is time to go home!
            if (!down) {
            if (!down && mHomePressed) {
                final boolean homeWasLongPressed = mHomeLongPressed;
                mHomeLongPressed = false;
                mHomePressed = false;
                if (!homeWasLongPressed) {
                    if (mRecentAppsPreloaded) {
                        cancelPreloadRecentApps();
@@ -2161,10 +2164,12 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                }
            }
            if (down) {
                if (repeatCount == 0) {
                    mHomePressed = true;
                    if (!mRecentAppsPreloaded && mLongPressOnHomeBehavior == KEY_ACTION_APP_SWITCH) {
                        preloadRecentApps();
                    }
                if (longPress) {
                } else if (longPress) {
                    if (!keyguardOn && mLongPressOnHomeBehavior != KEY_ACTION_NOTHING) {
                        performHapticFeedbackLw(null, HapticFeedbackConstants.LONG_PRESS, false);
                        performKeyAction(mLongPressOnHomeBehavior);