Clean up stale fixed rotation state

This restores original logic that was not called in new transition
architecture. The fail safe condition is still needed to make
sure the windows won't wait for an outdated orientation switch.

Bug: 289196433
Test: Rapidly switch activities in different orientations. The
      system window should not disappear permanently.
Change-Id: Id1148dbfea349dad6c6057b24509bbc4e66ab1dd
This commit is contained in:
Riddle Hsu
2023-07-06 17:09:59 +00:00
parent c1cfc4a9d2
commit e1fd49b550
2 changed files with 5 additions and 0 deletions

View File

@@ -2751,6 +2751,10 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
void onAppTransitionDone() {
super.onAppTransitionDone();
mWmService.mWindowsChanged = true;
onTransitionFinished();
}
void onTransitionFinished() {
// If the transition finished callback cannot match the token for some reason, make sure the
// rotated state is cleared if it is already invisible.
if (mFixedRotationLaunchingApp != null && !mFixedRotationLaunchingApp.isVisibleRequested()

View File

@@ -1298,6 +1298,7 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
if (asyncRotationController != null && containsChangeFor(dc, mTargets)) {
asyncRotationController.onTransitionFinished();
}
dc.onTransitionFinished();
if (hasParticipatedDisplay && dc.mDisplayRotationCompatPolicy != null) {
final ChangeInfo changeInfo = mChanges.get(dc);
if (changeInfo != null