Merge "Set sync applier on the transform params for the glued targets" into sc-v2-dev am: 5e49df2bbe am: 616f181857

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/16307006

Change-Id: I0be97fe98b93085d7a1cc5bc145d17045a8c0989
diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java
index c065851..017a3b8 100644
--- a/quickstep/src/com/android/quickstep/views/RecentsView.java
+++ b/quickstep/src/com/android/quickstep/views/RecentsView.java
@@ -4357,15 +4357,22 @@
         RemoteTargetGluer gluer = new RemoteTargetGluer(getContext(), getSizeStrategy());
         mRemoteTargetHandles = gluer.assignTargetsForSplitScreen(recentsAnimationTargets);
         mSplitBoundsConfig = gluer.getStagedSplitBounds();
-        if (mSyncTransactionApplier != null) {
-            // Add release check to the targets from the RemoteTargetGluer and not the targets
-            // passed in because in the event we're in split screen, we use the passed in targets
-            // to create new RemoteAnimationTargets in assignTargetsForSplitScreen(), and the
-            // mSyncTransactionApplier doesn't get transferred over
-            runActionOnRemoteHandles(remoteTargetHandle -> remoteTargetHandle
-                    .getTransformParams().getTargetSet()
-                    .addReleaseCheck(mSyncTransactionApplier));
-        }
+        // Add release check to the targets from the RemoteTargetGluer and not the targets
+        // passed in because in the event we're in split screen, we use the passed in targets
+        // to create new RemoteAnimationTargets in assignTargetsForSplitScreen(), and the
+        // mSyncTransactionApplier doesn't get transferred over
+        runActionOnRemoteHandles(remoteTargetHandle -> {
+            final TransformParams params = remoteTargetHandle.getTransformParams();
+            if (mSyncTransactionApplier != null) {
+                params.setSyncTransactionApplier(mSyncTransactionApplier);
+                params.getTargetSet().addReleaseCheck(mSyncTransactionApplier);
+            }
+
+            TaskViewSimulator tvs = remoteTargetHandle.getTaskViewSimulator();
+            tvs.setOrientationState(mOrientationState);
+            tvs.setDp(mActivity.getDeviceProfile());
+            tvs.recentsViewScale.value = 1;
+        });
 
         TaskView runningTaskView = getRunningTaskView();
         if (runningTaskView instanceof GroupedTaskView) {
@@ -4375,12 +4382,6 @@
             // notified.
             ((GroupedTaskView) runningTaskView).updateSplitBoundsConfig(mSplitBoundsConfig);
         }
-        for (RemoteTargetHandle remoteTargetHandle : mRemoteTargetHandles) {
-            TaskViewSimulator tvs = remoteTargetHandle.getTaskViewSimulator();
-            tvs.setOrientationState(mOrientationState);
-            tvs.setDp(mActivity.getDeviceProfile());
-            tvs.recentsViewScale.value = 1;
-        }
     }
 
     /** Helper to avoid writing some for-loops to iterate over {@link #mRemoteTargetHandles} */