Merge UQ1A.231205.015

Bug: 308969284
Merged-In: I91dd8b4088f02af9dc5e603853d8e26606acc38f
Change-Id: I7f5bca7edd18631b36f2b9213e17554cf769cbc6
diff --git a/quickstep/src/com/android/quickstep/views/TaskView.java b/quickstep/src/com/android/quickstep/views/TaskView.java
index 2a40ccf..39b6c62 100644
--- a/quickstep/src/com/android/quickstep/views/TaskView.java
+++ b/quickstep/src/com/android/quickstep/views/TaskView.java
@@ -1010,6 +1010,17 @@
                     mActivity.getStateManager(), recentsView,
                     recentsView.getDepthController());
             anim.addListener(new AnimatorListenerAdapter() {
+                @Override
+                public void onAnimationStart(Animator animation) {
+                    if (!recentsView.showAsGrid()) {
+                        return;
+                    }
+                    recentsView.runActionOnRemoteHandles(
+                            (Consumer<RemoteTargetHandle>) remoteTargetHandle ->
+                                    remoteTargetHandle
+                                            .getTaskViewSimulator()
+                                            .setDrawsBelowRecents(false));
+                }
 
                 @Override
                 public void onAnimationEnd(Animator animator) {
diff --git a/tests/src/com/android/launcher3/icons/FastBitmapDrawableTest.java b/tests/src/com/android/launcher3/icons/FastBitmapDrawableTest.java
index 038c98b..fbbfb2a 100644
--- a/tests/src/com/android/launcher3/icons/FastBitmapDrawableTest.java
+++ b/tests/src/com/android/launcher3/icons/FastBitmapDrawableTest.java
@@ -31,6 +31,7 @@
 import static org.mockito.Mockito.when;
 
 import android.graphics.Bitmap;
+import android.graphics.drawable.Drawable;
 import android.view.animation.AccelerateInterpolator;
 import android.view.animation.DecelerateInterpolator;
 import android.view.animation.PathInterpolator;
@@ -42,6 +43,8 @@
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
 import org.mockito.Spy;
 
 /**
@@ -56,9 +59,11 @@
     @Spy
     FastBitmapDrawable mFastBitmapDrawable =
             spy(new FastBitmapDrawable(Bitmap.createBitmap(100, 100, Bitmap.Config.ARGB_8888)));
+    @Mock Drawable mBadge;
 
     @Before
     public void setUp() {
+        MockitoAnnotations.initMocks(this);
         FastBitmapDrawable.setFlagHoverEnabled(true);
         when(mFastBitmapDrawable.isVisible()).thenReturn(true);
         mFastBitmapDrawable.mIsPressed = false;
@@ -326,4 +331,15 @@
         assertEquals("End value not correct.", (float) SCALE.get(mFastBitmapDrawable), 1f, EPSILON);
         verify(mFastBitmapDrawable).invalidateSelf();
     }
+
+    @Test
+    public void testUpdateBadgeAlpha() {
+        mFastBitmapDrawable.setBadge(mBadge);
+
+        mFastBitmapDrawable.setAlpha(1);
+        mFastBitmapDrawable.setAlpha(0);
+
+        verify(mBadge).setAlpha(1);
+        verify(mBadge).setAlpha(0);
+    }
 }