Implement ability to fling to QS in empty space

Bug: 16009808
Change-Id: I0af174a4d97202dae767e4ae56f43599dbee4e05
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java
index 5b47749..7d5d99d 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java
@@ -301,6 +301,8 @@
                 mTrackingPointer = -1;
                 trackMovement(event);
                 if ((mTracking && mTouchSlopExceeded)
+                        || Math.abs(x - mInitialTouchX) > mTouchSlop
+                        || Math.abs(y - mInitialTouchY) > mTouchSlop
                         || event.getActionMasked() == MotionEvent.ACTION_CANCEL) {
                     float vel = 0f;
                     float vectorVel = 0f;
@@ -317,6 +319,7 @@
                     boolean expands = onEmptySpaceClick(mInitialTouchX);
                     onTrackingStopped(expands);
                 }
+
                 if (mVelocityTracker != null) {
                     mVelocityTracker.recycle();
                     mVelocityTracker = null;
@@ -447,7 +450,7 @@
      * @param vectorVel the length of the vectorial velocity
      * @return whether a fling should expands the panel; contracts otherwise
      */
-    private boolean flingExpands(float vel, float vectorVel) {
+    protected boolean flingExpands(float vel, float vectorVel) {
         if (Math.abs(vectorVel) < mFlingAnimationUtils.getMinVelocityPxPerSecond()) {
             return getExpandedFraction() > 0.5f;
         } else {