Merge "Fix errorprone build" into sc-dev
diff --git a/quickstep/res/values/strings.xml b/quickstep/res/values/strings.xml
index 2a06830..eeb9e99 100644
--- a/quickstep/res/values/strings.xml
+++ b/quickstep/res/values/strings.xml
@@ -188,8 +188,8 @@
     <!-- ******* Skip tutorial dialog ******* -->
     <!-- Title for the dialog that allows the user to skip the gesture navigation tutorial. [CHAR_LIMIT=40] -->
     <string name="skip_tutorial_dialog_title">Skip navigation tutorial?</string>
-    <!-- Subtitle for the dialog that allows the user to skip the gesture navigation tutorial. [CHAR_LIMIT=40] -->
-    <string name="skip_tutorial_dialog_subtitle">You can find this later in the Tips app</string>
+    <!-- Subtitle for the dialog that allows the user to skip the gesture navigation tutorial. This directs the user to where they can find the gesture tutorial again. [CHAR_LIMIT=100] -->
+    <string name="skip_tutorial_dialog_subtitle">You can find this later in the <xliff:g id="name">%1$s</xliff:g> app</string>
     <!-- Button text shown on a button on the tutorial skip dialog to return to the tutorial. [CHAR LIMIT=14] -->
     <string name="gesture_tutorial_action_button_label_cancel">Cancel</string>
     <!-- Button text shown on a button on the tutorial skip dialog to exit the tutorial. [CHAR LIMIT=14] -->
diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
index aba2af2..7599234 100644
--- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
+++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java
@@ -621,7 +621,7 @@
         final boolean passed = mCurrentShift.value >= MIN_PROGRESS_FOR_OVERVIEW;
         if (passed != mPassedOverviewThreshold) {
             mPassedOverviewThreshold = passed;
-            if (mDeviceState.isTwoButtonNavMode()) {
+            if (mDeviceState.isTwoButtonNavMode() && !mGestureState.isHandlingAtomicEvent()) {
                 performHapticFeedback();
             }
         }
@@ -854,7 +854,7 @@
 
     private GestureEndTarget calculateEndTarget(PointF velocity, float endVelocity, boolean isFling,
             boolean isCancel) {
-        if (mDeviceState.isButtonNavMode()) {
+        if (mGestureState.isHandlingAtomicEvent()) {
             // Button mode, this is only used to go to recents
             return RECENTS;
         }
@@ -979,7 +979,7 @@
                     mRecentsView.snapToPage(mRecentsView.getNextPage(), (int) MAX_SWIPE_DURATION);
                     isScrolling = true;
                 }
-                if (!mDeviceState.isButtonNavMode() || isScrolling) {
+                if (!mGestureState.isHandlingAtomicEvent() || isScrolling) {
                     duration = Math.max(duration, mRecentsView.getScroller().getDuration());
                 }
             }
diff --git a/quickstep/src/com/android/quickstep/GestureState.java b/quickstep/src/com/android/quickstep/GestureState.java
index ebdc1e6..6ad7f55 100644
--- a/quickstep/src/com/android/quickstep/GestureState.java
+++ b/quickstep/src/com/android/quickstep/GestureState.java
@@ -146,6 +146,8 @@
     /** The time when the swipe up gesture is triggered. */
     private long mSwipeUpStartTimeMs;
 
+    private boolean mHandlingAtomicEvent;
+
     public GestureState(OverviewComponentObserver componentObserver, int gestureId) {
         mHomeIntent = componentObserver.getHomeIntent();
         mOverviewIntent = componentObserver.getOverviewIntent();
@@ -315,6 +317,22 @@
     }
 
     /**
+     * Indicates if the gesture is handling an atomic event like a click and not a
+     * user controlled gesture.
+     */
+    public void setHandlingAtomicEvent(boolean handlingAtomicEvent) {
+        mHandlingAtomicEvent = true;
+    }
+
+    /**
+     * Returns true if the gesture is handling an atomic event like a click and not a
+     * user controlled gesture.
+     */
+    public boolean isHandlingAtomicEvent() {
+        return mHandlingAtomicEvent;
+    }
+
+    /**
      * @return whether the current gesture is still running a recents animation to a state in the
      *         Launcher or Recents activity.
      */
diff --git a/quickstep/src/com/android/quickstep/OverviewCommandHelper.java b/quickstep/src/com/android/quickstep/OverviewCommandHelper.java
index 923d4f1..dbdd75f 100644
--- a/quickstep/src/com/android/quickstep/OverviewCommandHelper.java
+++ b/quickstep/src/com/android/quickstep/OverviewCommandHelper.java
@@ -179,6 +179,7 @@
         }
 
         GestureState gestureState = mService.createGestureState(GestureState.DEFAULT_STATE);
+        gestureState.setHandlingAtomicEvent(true);
         AbsSwipeUpHandler interactionHandler = mService.getSwipeUpHandlerFactory()
                 .newHandler(gestureState, cmd.createTime);
         interactionHandler.setGestureEndCallback(
diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java
index c5deede..0eb2392 100644
--- a/quickstep/src/com/android/quickstep/views/RecentsView.java
+++ b/quickstep/src/com/android/quickstep/views/RecentsView.java
@@ -2024,6 +2024,16 @@
 
         anim.add(ObjectAnimator.ofFloat(taskView, secondaryViewTranslate,
                 verticalFactor * secondaryTaskDimension).setDuration(duration), LINEAR, sp);
+
+        if (LIVE_TILE.get() && taskView.isRunningTask()) {
+            anim.addOnFrameCallback(() -> {
+                mLiveTileTaskViewSimulator.taskSecondaryTranslation.value =
+                        mOrientationHandler.getSecondaryValue(
+                                taskView.getTranslationX(),
+                                taskView.getTranslationY());
+                redrawLiveTile();
+            });
+        }
     }
 
     public PendingAnimation createTaskDismissAnimation(TaskView taskView, boolean animateTaskView,
@@ -2112,16 +2122,6 @@
             anim.addOnFrameCallback(this::updateCurveProperties);
         }
 
-        if (LIVE_TILE.get() && getRunningTaskView() == taskView) {
-            anim.addOnFrameCallback(() -> {
-                mLiveTileTaskViewSimulator.taskSecondaryTranslation.value =
-                        mOrientationHandler.getSecondaryValue(
-                                taskView.getTranslationX(),
-                                taskView.getTranslationY());
-                redrawLiveTile();
-            });
-        }
-
         // Add a tiny bit of translation Z, so that it draws on top of other views
         if (animateTaskView) {
             taskView.setTranslationZ(0.1f);
@@ -2944,7 +2944,7 @@
         }
         mPendingAnimation.addEndListener(isSuccess -> {
             if (isSuccess) {
-                if (LIVE_TILE.get()) {
+                if (LIVE_TILE.get() && tv.isRunningTask()) {
                     finishRecentsAnimation(false /* toRecents */, null);
                     onTaskLaunchAnimationEnd(true /* success */);
                 } else {