From 6835115c130c3c944ebd1ff19ee3b143e866bb87 Mon Sep 17 00:00:00 2001 From: Vinit Nayak Date: Thu, 9 Sep 2021 16:23:55 -0700 Subject: [PATCH] Explicitly set X and Y values when offsetting split tasks * Race condition where DeviceProfile that gets set on TaskViewSimulator initially has incorrect values (dp.isLandscape is incorrect) * The correct one eventually gets set, but in the meantime we set the split offset assuming in incorrect value in PagedOrientationHandler#setLeashSplitOffset() * Once corrected, we weren't removing the old offset that was set. Now we ensure only either an X or Y offset set. Bug: 199376724 Test: Enter split, rotate device and quickswitch. Both tasks should be visible throughout the gesture Change-Id: I9fa44642ab440a0200c0b0eb9b37574e47b7100d --- .../com/android/quickstep/SwipeUpAnimationLogic.java | 10 +++++----- .../launcher3/touch/PortraitPagedViewHandler.java | 2 ++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/quickstep/src/com/android/quickstep/SwipeUpAnimationLogic.java b/quickstep/src/com/android/quickstep/SwipeUpAnimationLogic.java index 51a491ebf6..ebe46fecab 100644 --- a/quickstep/src/com/android/quickstep/SwipeUpAnimationLogic.java +++ b/quickstep/src/com/android/quickstep/SwipeUpAnimationLogic.java @@ -89,13 +89,13 @@ public abstract class SwipeUpAnimationLogic implements LauncherSplitScreenListener.INSTANCE.getNoCreate() .getRunningSplitTaskIds().length > 1; - TaskViewSimulator primaryTVS = new TaskViewSimulator(context, - gestureState.getActivityInterface()); - primaryTVS.getOrientationState().update( - mDeviceState.getRotationTouchHelper().getCurrentActiveRotation(), - mDeviceState.getRotationTouchHelper().getDisplayRotation()); mTargetGluer = new RemoteTargetGluer(mContext, mGestureState.getActivityInterface()); mRemoteTargetHandles = mTargetGluer.getRemoteTargetHandles(); + runActionOnRemoteHandles(remoteTargetHandle -> + remoteTargetHandle.getTaskViewSimulator().getOrientationState().update( + mDeviceState.getRotationTouchHelper().getCurrentActiveRotation(), + mDeviceState.getRotationTouchHelper().getDisplayRotation() + )); } protected void initTransitionEndpoints(DeviceProfile dp) { diff --git a/src/com/android/launcher3/touch/PortraitPagedViewHandler.java b/src/com/android/launcher3/touch/PortraitPagedViewHandler.java index 064d808756..f1fd439a06 100644 --- a/src/com/android/launcher3/touch/PortraitPagedViewHandler.java +++ b/src/com/android/launcher3/touch/PortraitPagedViewHandler.java @@ -503,9 +503,11 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler { if (dp.isLandscape) { splitOffset.x = splitInfo.leftTopBounds.width() + splitInfo.visualDividerBounds.width(); + splitOffset.y = 0; } else { splitOffset.y = splitInfo.leftTopBounds.height() + splitInfo.visualDividerBounds.height(); + splitOffset.x = 0; } } }