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

Commit 77b2d1d0 authored by Winson Chung's avatar Winson Chung
Browse files

Disallow back gesture in the bottom gesture area

Test: Manual
Bug: 143285809
Change-Id: I425ad13b0585661469dc37a1510ab36c12fe85f8
parent 30b1ff1b
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -97,6 +97,8 @@ public class EdgeBackGestureHandler implements DisplayListener,

    // The edge width where touch down is allowed
    private int mEdgeWidth;
    // The bottom gesture area height
    private int mBottomGestureHeight;
    // The slop to distinguish between horizontal and vertical motion
    private final float mTouchSlop;
    // Duration after which we consider the event as longpress.
@@ -174,6 +176,8 @@ public class EdgeBackGestureHandler implements DisplayListener,
    public void updateCurrentUserResources(Resources res) {
        mEdgeWidth = res.getDimensionPixelSize(
                com.android.internal.R.dimen.config_backGestureInset);
        mBottomGestureHeight = res.getDimensionPixelSize(
                com.android.internal.R.dimen.navigation_bar_gesture_height);
    }

    /**
@@ -316,6 +320,11 @@ public class EdgeBackGestureHandler implements DisplayListener,
            return false;
        }

        // Disallow if we are in the bottom gesture area
        if (y >= (mDisplaySize.y - mBottomGestureHeight)) {
            return false;
        }

        // Always allow if the user is in a transient sticky immersive state
        if (mIsNavBarShownTransiently) {
            return true;