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
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickStepController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickStepController.java
index d79f0a1b..19544b1 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickStepController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickStepController.java
@@ -200,12 +200,6 @@
      */
     @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 @@
     }
 
     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