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

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

Change-Id: Iaa18663a59725382bda35cae91aec782854b5b89
This commit is contained in:
Alex Chau
2021-06-01 20:24:00 +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)) {
return;
}
// RecentsView never updates the display rotation until swipe-up, force update
// RecentsOrientedState before passing to TaskViewSimulator.
mRecentsView.updateRecentsRotation();
mTaskViewSimulator.setOrientationState(mRecentsView.getPagedViewOrientedState());
// If we've already ended the gesture and are going home, don't prepare recents UI,
@@ -2702,19 +2702,20 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
if (LIVE_TILE.get() && mEnableDrawingLiveTile && newConfig.orientation != mOrientation) {
switchToScreenshot(
() -> finishRecentsAnimation(true /* toRecents */,
this::onConfigurationChangedInternal));
this::updateRecentsRotation));
mEnableDrawingLiveTile = false;
} else {
onConfigurationChangedInternal();
updateRecentsRotation();
}
mOrientation = newConfig.orientation;
}
private void onConfigurationChangedInternal() {
/**
* Updates {@link RecentsOrientedState}'s cached RecentsView rotation.
*/
public void updateRecentsRotation() {
final int rotation = mActivity.getDisplay().getRotation();
if (mOrientationState.setRecentsRotation(rotation)) {
updateOrientationHandler();
}
mOrientationState.setRecentsRotation(rotation);
}
public void setLayoutRotation(int touchRotation, int displayRotation) {