Merge "Use dY to determine if taskbar nav threshold is met." into tm-qpr-dev
diff --git a/quickstep/src/com/android/quickstep/inputconsumers/TaskbarStashInputConsumer.java b/quickstep/src/com/android/quickstep/inputconsumers/TaskbarStashInputConsumer.java
index 1630d0f..9982162 100644
--- a/quickstep/src/com/android/quickstep/inputconsumers/TaskbarStashInputConsumer.java
+++ b/quickstep/src/com/android/quickstep/inputconsumers/TaskbarStashInputConsumer.java
@@ -52,7 +52,7 @@
     private final float mUnstashArea;
     private final float mScreenWidth;
 
-    private final int mTaskbarNavThresholdY;
+    private final int mTaskbarNavThreshold;
     private final boolean mIsTaskbarAllAppsOpen;
     private boolean mHasPassedTaskbarNavThreshold;
 
@@ -73,9 +73,7 @@
 
         Resources res = context.getResources();
         mUnstashArea = res.getDimensionPixelSize(R.dimen.taskbar_unstash_input_area);
-        int taskbarNavThreshold = res.getDimensionPixelSize(R.dimen.taskbar_nav_threshold);
-        int screenHeight = taskbarActivityContext.getDeviceProfile().heightPx;
-        mTaskbarNavThresholdY = screenHeight - taskbarNavThreshold;
+        mTaskbarNavThreshold = res.getDimensionPixelSize(R.dimen.taskbar_nav_threshold);
         mIsTaskbarAllAppsOpen =
                 mTaskbarActivityContext != null && mTaskbarActivityContext.isTaskbarAllAppsOpen();
 
@@ -157,7 +155,7 @@
                         if (mIsTransientTaskbar) {
                             float dY = mLastPos.y - mDownPos.y;
                             boolean passedTaskbarNavThreshold = dY < 0
-                                    && mLastPos.y < mTaskbarNavThresholdY;
+                                    && Math.abs(dY) >= mTaskbarNavThreshold;
 
                             if (!mHasPassedTaskbarNavThreshold && passedTaskbarNavThreshold) {
                                 mHasPassedTaskbarNavThreshold = true;
@@ -165,7 +163,7 @@
                             }
 
                             if (dY < 0) {
-                                dY = -OverScroll.dampedScroll(-dY, mTaskbarNavThresholdY);
+                                dY = -OverScroll.dampedScroll(-dY, mTaskbarNavThreshold);
                                 if (mTransitionCallback != null && !mIsTaskbarAllAppsOpen) {
                                     mTransitionCallback.onActionMove(dY);
                                 }