Merge "Release the surface control view host when addWindow fail." into tm-dev am: e3ae5cda82

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16939196

Change-Id: Id5fd4a1a9dc930036421a933de18444497e91642
This commit is contained in:
Wei Sheng Shih
2022-03-01 05:36:07 +00:00
committed by Automerger Merge Worker

View File

@@ -364,6 +364,12 @@ public class StartingSurfaceDrawer {
final StartingWindowRecord record = mStartingWindowRecords.get(taskId);
final SplashScreenView contentView = viewSupplier.get();
record.mBGColor = contentView.getInitBackgroundColor();
} else {
// release the icon view host
final SplashScreenView contentView = viewSupplier.get();
if (contentView.getSurfaceHost() != null) {
SplashScreenView.releaseIconHost(contentView.getSurfaceHost());
}
}
} catch (RuntimeException e) {
// don't crash if something else bad happens, for example a