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

Commit 20c41861 authored by Winson Chung's avatar Winson Chung Committed by Arne Coucheron
Browse files

Disallow back gesture in the bottom gesture area

Test: Manual
Bug: 143285809
Change-Id: I425ad13b0585661469dc37a1510ab36c12fe85f8
parent 350010d2
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -111,6 +111,8 @@ public class EdgeBackGestureHandler implements DisplayListener, TunerService.Tun

    // 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.
@@ -179,6 +181,8 @@ public class EdgeBackGestureHandler implements DisplayListener, TunerService.Tun
    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);
    }

    /**
@@ -318,6 +322,11 @@ public class EdgeBackGestureHandler implements DisplayListener, TunerService.Tun
            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 (mIsInTransientImmersiveStickyState) {
            return true;