Merge "Ensure RecentsOrientedState.mRecentsRotation is up to date on swipe up" into sc-dev am: 5e13d36cba

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

Change-Id: Ic0210a281d6b0ed7eacfe31288863edda9443af3
This commit is contained in:
Alex Chau
2021-06-01 19:48:34 +00:00
committed by Automerger Merge Worker
2 changed files with 10 additions and 6 deletions
@@ -394,6 +394,9 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
if (mStateCallback.hasStates(STATE_HANDLER_INVALIDATED)) { if (mStateCallback.hasStates(STATE_HANDLER_INVALIDATED)) {
return; return;
} }
// RecentsView never updates the display rotation until swipe-up, force update
// RecentsOrientedState before passing to TaskViewSimulator.
mRecentsView.updateRecentsRotation();
mTaskViewSimulator.setOrientationState(mRecentsView.getPagedViewOrientedState()); mTaskViewSimulator.setOrientationState(mRecentsView.getPagedViewOrientedState());
// If we've already ended the gesture and are going home, don't prepare recents UI, // If we've already ended the gesture and are going home, don't prepare recents UI,
@@ -2641,19 +2641,20 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
if (LIVE_TILE.get() && mEnableDrawingLiveTile && newConfig.orientation != mOrientation) { if (LIVE_TILE.get() && mEnableDrawingLiveTile && newConfig.orientation != mOrientation) {
switchToScreenshot( switchToScreenshot(
() -> finishRecentsAnimation(true /* toRecents */, () -> finishRecentsAnimation(true /* toRecents */,
this::onConfigurationChangedInternal)); this::updateRecentsRotation));
mEnableDrawingLiveTile = false; mEnableDrawingLiveTile = false;
} else { } else {
onConfigurationChangedInternal(); updateRecentsRotation();
} }
mOrientation = newConfig.orientation; mOrientation = newConfig.orientation;
} }
private void onConfigurationChangedInternal() { /**
* Updates {@link RecentsOrientedState}'s cached RecentsView rotation.
*/
public void updateRecentsRotation() {
final int rotation = mActivity.getDisplay().getRotation(); final int rotation = mActivity.getDisplay().getRotation();
if (mOrientationState.setRecentsRotation(rotation)) { mOrientationState.setRecentsRotation(rotation);
updateOrientationHandler();
}
} }
public void setLayoutRotation(int touchRotation, int displayRotation) { public void setLayoutRotation(int touchRotation, int displayRotation) {