Merge "Split LauncherActivityControllerHelper for Go" into ub-launcher3-master
diff --git a/quickstep/res/values/strings.xml b/quickstep/res/values/strings.xml
index 0c741a1..f5e8fa8 100644
--- a/quickstep/res/values/strings.xml
+++ b/quickstep/res/values/strings.xml
@@ -52,7 +52,7 @@
     <string name="task_contents_description_with_remaining_time"><xliff:g id="task_description" example="GMail">%1$s</xliff:g>, <xliff:g id="remaining_time" example="7 minutes left today">%2$s</xliff:g></string>
 
     <!-- Text to show total app usage per day if it is less than 1 minute ("&lt;" is the
-     escaped form of '<'). [CHAR LIMIT=10] -->
+     escaped form of '<'). [CHAR LIMIT=15] -->
     <string name="shorter_duration_less_than_one_minute">&lt; 1 minute</string>
 
     <!-- Annotation shown on an app card in Recents, telling that the app was switched to a
@@ -60,6 +60,6 @@
     <string name="app_in_grayscale">App in grayscale</string>
 
     <!-- Annotation shown on an app card in Recents, telling that the app has a usage limit set by
-    the user, and a given time is left for it today [CHAR LIMIT=20] -->
+    the user, and a given time is left for it today [CHAR LIMIT=22] -->
     <string name="time_left_for_app"><xliff:g id="time" example="7 minutes">%1$s</xliff:g> left today</string>
 </resources>
\ No newline at end of file
diff --git a/quickstep/src/com/android/quickstep/LongSwipeHelper.java b/quickstep/src/com/android/quickstep/LongSwipeHelper.java
index 80d37ae..88dc520 100644
--- a/quickstep/src/com/android/quickstep/LongSwipeHelper.java
+++ b/quickstep/src/com/android/quickstep/LongSwipeHelper.java
@@ -19,6 +19,7 @@
 import static com.android.launcher3.LauncherState.ALL_APPS;
 import static com.android.launcher3.LauncherState.OVERVIEW;
 import static com.android.launcher3.anim.Interpolators.DEACCEL;
+import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE;
 import static com.android.launcher3.config.FeatureFlags.QUICKSTEP_SPRINGS;
 import static com.android.quickstep.WindowTransformSwipeHandler.MAX_SWIPE_DURATION;
 import static com.android.quickstep.WindowTransformSwipeHandler.MIN_OVERSHOOT_DURATION;
@@ -173,5 +174,9 @@
                 0);
 
         callback.run();
+
+        if (ENABLE_QUICKSTEP_LIVE_TILE.get() && toAllApps) {
+            rv.finishRecentsAnimation(true, null);
+        }
     }
 }
diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java
index 5b84d23..20280c1 100644
--- a/quickstep/src/com/android/quickstep/views/RecentsView.java
+++ b/quickstep/src/com/android/quickstep/views/RecentsView.java
@@ -1585,7 +1585,7 @@
         mClipAnimationHelper = clipAnimationHelper;
     }
 
-    public void finishRecentsAnimation(boolean toHome, Runnable onFinishComplete) {
+    public void finishRecentsAnimation(boolean toRecents, Runnable onFinishComplete) {
         if (mRecentsAnimationWrapper == null) {
             if (onFinishComplete != null) {
                 onFinishComplete.run();
@@ -1593,10 +1593,11 @@
             return;
         }
 
-        mRecentsAnimationWrapper.finish(toHome, onFinishComplete);
+        mRecentsAnimationWrapper.finish(toRecents, onFinishComplete);
     }
 
-    public void takeScreenshotAndFinishRecentsAnimation(boolean toHome, Runnable onFinishComplete) {
+    public void takeScreenshotAndFinishRecentsAnimation(boolean toRecents,
+            Runnable onFinishComplete) {
         if (mRecentsAnimationWrapper == null || getRunningTaskView() == null) {
             if (onFinishComplete != null) {
                 onFinishComplete.run();
@@ -1631,7 +1632,7 @@
                         }
 
                         detach();
-                        mRecentsAnimationWrapper.finish(toHome, () -> {
+                        mRecentsAnimationWrapper.finish(toRecents, () -> {
                             onFinishComplete.run();
                             mRunningTaskId = -1;
                         });
diff --git a/robolectric_tests/src/com/android/launcher3/model/BaseModelUpdateTaskTestCase.java b/robolectric_tests/src/com/android/launcher3/model/BaseModelUpdateTaskTestCase.java
index 92d065e..ab39274 100644
--- a/robolectric_tests/src/com/android/launcher3/model/BaseModelUpdateTaskTestCase.java
+++ b/robolectric_tests/src/com/android/launcher3/model/BaseModelUpdateTaskTestCase.java
@@ -25,11 +25,9 @@
 import com.android.launcher3.LauncherModel.Callbacks;
 import com.android.launcher3.LauncherModel.ModelUpdateTask;
 import com.android.launcher3.LauncherProvider;
-import com.android.launcher3.icons.BitmapInfo;
 import com.android.launcher3.icons.IconCache;
 import com.android.launcher3.icons.cache.CachingLogic;
 import com.android.launcher3.util.ComponentKey;
-import com.android.launcher3.util.Provider;
 import com.android.launcher3.util.TestLauncherProvider;
 
 import org.junit.Before;
@@ -45,6 +43,7 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.concurrent.Executor;
+import java.util.function.Supplier;
 
 import androidx.annotation.NonNull;
 
@@ -196,7 +195,7 @@
         @Override
         protected <T> CacheEntry cacheLocked(
                 @NonNull ComponentName componentName,
-                UserHandle user, @NonNull Provider<T> infoProvider,
+                UserHandle user, @NonNull Supplier<T> infoProvider,
                 @NonNull CachingLogic<T> cachingLogic,
                 boolean usePackageIcon, boolean useLowResIcon) {
             CacheEntry entry = mCache.get(new ComponentKey(componentName, user));
diff --git a/src/com/android/launcher3/anim/AnimatorPlaybackController.java b/src/com/android/launcher3/anim/AnimatorPlaybackController.java
index cf070c5..2c440bb 100644
--- a/src/com/android/launcher3/anim/AnimatorPlaybackController.java
+++ b/src/com/android/launcher3/anim/AnimatorPlaybackController.java
@@ -236,7 +236,7 @@
 
     private void dispatchOnStartRecursively(Animator animator) {
         List<AnimatorListener> listeners = animator instanceof SpringObjectAnimator
-                ? nonNullList(((SpringObjectAnimator) animator).getSuperListeners())
+                ? nonNullList(((SpringObjectAnimator) animator).getObjectAnimatorListeners())
                 : nonNullList(animator.getListeners());
 
         for (AnimatorListener l : listeners) {
diff --git a/src/com/android/launcher3/anim/SpringObjectAnimator.java b/src/com/android/launcher3/anim/SpringObjectAnimator.java
index 4f45c05..cc70e32 100644
--- a/src/com/android/launcher3/anim/SpringObjectAnimator.java
+++ b/src/com/android/launcher3/anim/SpringObjectAnimator.java
@@ -85,7 +85,7 @@
 
         // We use this listener and track mListeners so that we can sync the animator and spring
         // listeners.
-        super.addListener(new AnimatorListenerAdapter() {
+        mObjectAnimator.addListener(new AnimatorListenerAdapter() {
             @Override
             public void onAnimationStart(Animator animation) {
                 mAnimatorEnded = false;
@@ -157,8 +157,8 @@
         mListeners.add(listener);
     }
 
-    public ArrayList<AnimatorListener> getSuperListeners() {
-        return super.getListeners();
+    public ArrayList<AnimatorListener> getObjectAnimatorListeners() {
+        return mObjectAnimator.getListeners();
     }
 
     @Override