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

Commit 609edc22 authored by heydabop's avatar heydabop Committed by Abhisek Devkota
Browse files

Add Screen Off option for buttons double-tap/long press (1 of 2)

This is being done primarily to replicate functionality on find7 Color OS.
Would it be better/possible to have this change only effect the find7?

Change-Id: I7e0c21b174b9cdd020c8d27c91c4c72201e228ff
parent 659eb6a6
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -185,6 +185,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
    private static final int KEY_ACTION_IN_APP_SEARCH = 5;
    private static final int KEY_ACTION_LAUNCH_CAMERA = 6;
    private static final int KEY_ACTION_LAST_APP = 7;
    private static final int KEY_ACTION_SLEEP = 8;

    // Masks for checking presence of hardware keys.
    // Must match values in core/res/res/values/config.xml
@@ -1133,6 +1134,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {
            case KEY_ACTION_LAST_APP:
                ActionUtils.switchToLastApp(mContext, mCurrentUserId);
                break;
            case KEY_ACTION_SLEEP:
                mPowerManager.goToSleep(SystemClock.uptimeMillis());
                break;
            default:
                break;
        }
@@ -1423,14 +1427,14 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        mLongPressOnHomeBehavior = mContext.getResources().getInteger(
                com.android.internal.R.integer.config_longPressOnHomeBehavior);
        if (mLongPressOnHomeBehavior < KEY_ACTION_NOTHING ||
                mLongPressOnHomeBehavior > KEY_ACTION_LAUNCH_CAMERA) {
                mLongPressOnHomeBehavior > KEY_ACTION_SLEEP) {
            mLongPressOnHomeBehavior = KEY_ACTION_NOTHING;
        }

        mDoubleTapOnHomeBehavior = mContext.getResources().getInteger(
                com.android.internal.R.integer.config_doubleTapOnHomeBehavior);
        if (mDoubleTapOnHomeBehavior < KEY_ACTION_NOTHING ||
                mDoubleTapOnHomeBehavior > KEY_ACTION_LAUNCH_CAMERA) {
                mDoubleTapOnHomeBehavior > KEY_ACTION_SLEEP) {
            mDoubleTapOnHomeBehavior = KEY_ACTION_NOTHING;
        }