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

This commit is contained in:
Alex Chau
2021-06-01 17:54:41 +00:00
committed by Android (Google) Code Review
2 changed files with 10 additions and 6 deletions

View File

@@ -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,

View File

@@ -2641,19 +2641,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) {