@@ -128,10 +128,10 @@ private static class FixedRotationTransformState {
128128 final Configuration mRotatedOverrideConfiguration ;
129129 final SeamlessRotator mRotator ;
130130 /**
131- * The tokens that share the same transform. Their end time of transform are the same as
132- * {@link #mOwner} .
131+ * The tokens that share the same transform. Their end time of transform are the same. The
132+ * list should at least contain the token who creates this state .
133133 */
134- final ArrayList <WindowToken > mAssociatedTokens = new ArrayList <>(1 );
134+ final ArrayList <WindowToken > mAssociatedTokens = new ArrayList <>(3 );
135135 final ArrayList <WindowContainer <?>> mRotatedContainers = new ArrayList <>(3 );
136136 boolean mIsTransforming = true ;
137137
@@ -531,6 +531,7 @@ void applyFixedRotationTransform(DisplayInfo info, DisplayFrames displayFrames,
531531 mDisplayContent .getConfiguration ().uiMode );
532532 mFixedRotationTransformState = new FixedRotationTransformState (info , displayFrames ,
533533 insetsState , new Configuration (config ), mDisplayContent .getRotation ());
534+ mFixedRotationTransformState .mAssociatedTokens .add (this );
534535 onConfigurationChanged (getParent ().getConfiguration ());
535536 notifyFixedRotationTransform (true /* enabled */ );
536537 }
@@ -578,14 +579,12 @@ void finishFixedRotationTransform(Runnable applyDisplayRotation) {
578579 for (int i = state .mAssociatedTokens .size () - 1 ; i >= 0 ; i --) {
579580 state .mAssociatedTokens .get (i ).cancelFixedRotationTransform ();
580581 }
581- cancelFixedRotationTransform ();
582582 }
583583 // The state is cleared at the end, because it is used to indicate that other windows can
584584 // use seamless rotation when applying rotation to display.
585585 for (int i = state .mAssociatedTokens .size () - 1 ; i >= 0 ; i --) {
586586 state .mAssociatedTokens .get (i ).cleanUpFixedRotationTransformState ();
587587 }
588- cleanUpFixedRotationTransformState ();
589588 }
590589
591590 private void cleanUpFixedRotationTransformState () {
0 commit comments