Skip null surface when validating transition

If SystemUI is died somehow before finishing a transition, the
validators may run after SystemUI is restarted and a new transition
is finished. Then the validators could contains some outdated state
such as the windows were detached (especially wallpaper is died
with SystemUI). So check if the surface exists to avoid crashing
SystemUI again.

Bug: 287539388
Test: Repeat kill SystemUI when running transition animation.
Change-Id: I756fa0bae8b2d64487bc158b933ed21246d3b506
This commit is contained in:
Riddle Hsu
2023-06-21 22:05:58 +08:00
parent caa08c2cad
commit 45301a4d54

View File

@@ -2665,7 +2665,10 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
mController.mStateValidators.add(() -> {
for (int i = mTargets.size() - 1; i >= 0; --i) {
final ChangeInfo change = mTargets.get(i);
if (!change.mContainer.isVisibleRequested()) continue;
if (!change.mContainer.isVisibleRequested()
|| change.mContainer.mSurfaceControl == null) {
continue;
}
Slog.e(TAG, "Force show for visible " + change.mContainer
+ " which may be hidden by transition unexpectedly");
change.mContainer.getSyncTransaction().show(change.mContainer.mSurfaceControl);