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

Commit 22cf5146 authored by Matthew Ng's avatar Matthew Ng
Browse files

Fixes crash on navbar using 3rd party launchers

When using a 3rd party launcher, the touch service
connection from pixel launcher and system ui is
disconnecting causing the nav bar to crash when
tapping it because onTouchIntercept returns true
from a NavigationBarView and handles the
onTouchEvent that does not check for a valid
connection. Check for a valid connection to
launcher service in onTouchEvent and before
proxying data to prevent the crash.

Fixes: 74726495
Test: change to 3rd party launcher press nav bar

Change-Id: I6f7efe78599b0829fd90aa0436463e77ec51f634
parent 2ea93b70
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -200,12 +200,6 @@ public class QuickStepController extends GestureDetector.SimpleOnGestureListener
     */
    @Override
    public boolean onInterceptTouchEvent(MotionEvent event) {
        if (!mNavigationBarView.isQuickScrubEnabled()
                && !mNavigationBarView.isQuickStepSwipeUpEnabled()) {
            mNavigationBarView.getHomeButton().setDelayTouchFeedback(false /* delay */);
            return false;
        }
        mNavigationBarView.requestUnbufferedDispatch(event);
        return handleTouchEvent(event);
    }

@@ -222,6 +216,13 @@ public class QuickStepController extends GestureDetector.SimpleOnGestureListener
    }

    private boolean handleTouchEvent(MotionEvent event) {
        if (!mNavigationBarView.isQuickScrubEnabled()
                && !mNavigationBarView.isQuickStepSwipeUpEnabled()) {
            mNavigationBarView.getHomeButton().setDelayTouchFeedback(false /* delay */);
            return false;
        }
        mNavigationBarView.requestUnbufferedDispatch(event);

        final ButtonDispatcher homeButton = mNavigationBarView.getHomeButton();
        if (mGestureDetector.onTouchEvent(event)) {
            // If the fling has been handled on UP, then skip proxying the UP