Finish the recents animation upon home rotation
Fixes: 14613421
Test: presubmit
Change-Id: I4165e6da80aa0272fa4a58046521dbd86518379c
diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java
index 83d15f7..4b37440 100644
--- a/quickstep/src/com/android/quickstep/views/RecentsView.java
+++ b/quickstep/src/com/android/quickstep/views/RecentsView.java
@@ -389,6 +389,8 @@
private final TaskOverlayFactory mTaskOverlayFactory;
+ private int mOrientation;
+
protected boolean mDisallowScrollToClearAll;
private boolean mOverlayEnabled;
protected boolean mFreezeViewVisibility;
@@ -582,6 +584,7 @@
.getDimensionPixelSize(R.dimen.recents_fast_fling_velocity);
mModel = RecentsModel.INSTANCE.get(context);
mIdp = InvariantDeviceProfile.INSTANCE.get(context);
+ mOrientation = getResources().getConfiguration().orientation;
mClearAllButton = (ClearAllButton) LayoutInflater.from(context)
.inflate(R.layout.overview_clear_all_button, this, false);
@@ -2615,6 +2618,18 @@
@Override
protected void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
+ if (LIVE_TILE.get() && mEnableDrawingLiveTile && newConfig.orientation != mOrientation) {
+ switchToScreenshot(
+ () -> finishRecentsAnimation(true /* toRecents */,
+ this::onConfigurationChangedInternal));
+ mEnableDrawingLiveTile = false;
+ } else {
+ onConfigurationChangedInternal();
+ }
+ mOrientation = newConfig.orientation;
+ }
+
+ private void onConfigurationChangedInternal() {
final int rotation = mActivity.getDisplay().getRotation();
if (mOrientationState.setRecentsRotation(rotation)) {
updateOrientationHandler();