From de43fb6323440ccad71ed09b5723850743794f36 Mon Sep 17 00:00:00 2001 From: Vinit Nayak Date: Mon, 13 Jul 2020 14:31:24 -0700 Subject: [PATCH] Notify TaskViews of updated orientation state There was a race condition between when recent tasks get loaded for overview and when the RecentsOrientationState gets updated based on which orientation was touched. Now notify tasks view every time orientation state updates. Fixes: 160912655 Test: Kill launcher while landscape app is open then swipe up to recents. App in correct location. Change-Id: If2b239f748c000257bd91b14a23d68ba026e3a48 --- .../src/com/android/quickstep/views/RecentsView.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java index 68b89758ef..602ab0bb41 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java @@ -377,7 +377,7 @@ public abstract class RecentsView extends PagedView mOrientationState.setMultiWindowMode(inMultiWindowMode); setLayoutRotation(mOrientationState.getTouchRotation(), mOrientationState.getDisplayRotation()); - rotateAllChildTasks(); + updateChildTaskOrientations(); } if (!inMultiWindowMode && mOverviewStateEnabled) { // TODO: Re-enable layout transitions for addition of the unpinned task @@ -1073,7 +1073,7 @@ public abstract class RecentsView extends PagedView pa.addListener(AnimationSuccessListener.forRunnable(() -> { setLayoutRotation(newRotation, mOrientationState.getDisplayRotation()); mActivity.getDragLayer().recreateControllers(); - rotateAllChildTasks(); + updateChildTaskOrientations(); setRecentsChangedOrientation(false).start(); })); pa.start(); @@ -1094,7 +1094,7 @@ public abstract class RecentsView extends PagedView } - private void rotateAllChildTasks() { + private void updateChildTaskOrientations() { for (int i = 0; i < getTaskViewCount(); i++) { getTaskViewAt(i).setOrientationState(mOrientationState); } @@ -1677,6 +1677,7 @@ public abstract class RecentsView extends PagedView || mOrientationState.getRecentsActivityRotation() != ROTATION_0; mActionsView.updateHiddenFlags(HIDDEN_NON_ZERO_ROTATION, !mOrientationState.canRecentsActivityRotate() && isInLandscape); + updateChildTaskOrientations(); resetPaddingFromTaskSize(); requestLayout(); // Reapply the current page to update page scrolls.