Dispatch transition cancelled callback at the end of abort

Otherwise the transition listeners can still see the collecting
transition (mCollectingTransition is non-null and STATE_ABORT is
not set yet).

Also skip onAppTransitionCancelledLocked for fixed rotation
transition listener because it was used for legacy frozen display.
Otherwise it will request another unnecessary display change
transition to disturb animation.

Bug: 219063830
Test: adb shell setprop persist.debug.shell_transit 1; reboot
      Launch a landscape app and press home key twice quickly.
      The device should not crash by a ghost startRemoteRotation.
Change-Id: I6f79754ff82c16055869d624e6a0c8ae3a24f076
This commit is contained in:
Riddle Hsu
2022-02-15 23:21:49 +08:00
parent cdd2a77e6b
commit a553340beb
2 changed files with 3 additions and 1 deletions

View File

@@ -6441,6 +6441,8 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
@Override
public void onAppTransitionCancelledLocked(boolean keyguardGoingAway) {
// It is only needed when freezing display in legacy transition.
if (mTransitionController.isShellTransitionsEnabled()) return;
continueUpdateOrientationForDiffOrienLaunchingApp();
}

View File

@@ -550,10 +550,10 @@ class Transition extends Binder implements BLASTSyncEngine.TransactionReadyListe
throw new IllegalStateException("Too late to abort.");
}
ProtoLog.v(ProtoLogGroup.WM_DEBUG_WINDOW_TRANSITIONS, "Aborting Transition: %d", mSyncId);
mController.dispatchLegacyAppTransitionCancelled();
mState = STATE_ABORT;
// Syncengine abort will call through to onTransactionReady()
mSyncEngine.abort(mSyncId);
mController.dispatchLegacyAppTransitionCancelled();
}
void setRemoteTransition(RemoteTransition remoteTransition) {