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

Commit e1529828 authored by Winson Chung's avatar Winson Chung Committed by Android (Google) Code Review
Browse files

Merge "Disallow back gesture in the bottom gesture area"

parents 322c2f71 77b2d1d0
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;