Merge "Fix potential crash when exit splash screen"

This commit is contained in:
Riddle Hsu
2022-11-10 07:26:08 +00:00
committed by Gerrit Code Review

View File

@@ -429,7 +429,8 @@ public class StartingSurfaceDrawer {
} }
@Override @Override
public @Nullable SplashScreenView get() { @Nullable
public SplashScreenView get() {
synchronized (this) { synchronized (this) {
while (!mIsViewSet) { while (!mIsViewSet) {
try { try {
@@ -690,7 +691,7 @@ public class StartingSurfaceDrawer {
private final TaskSnapshotWindow mTaskSnapshotWindow; private final TaskSnapshotWindow mTaskSnapshotWindow;
private SplashScreenView mContentView; private SplashScreenView mContentView;
private boolean mSetSplashScreen; private boolean mSetSplashScreen;
private @StartingWindowType int mSuggestType; @StartingWindowType private int mSuggestType;
private int mBGColor; private int mBGColor;
private final long mCreateTime; private final long mCreateTime;
private int mSystemBarAppearance; private int mSystemBarAppearance;
@@ -731,7 +732,7 @@ public class StartingSurfaceDrawer {
// Reset the system bar color which set by splash screen, make it align to the app. // Reset the system bar color which set by splash screen, make it align to the app.
private void clearSystemBarColor() { private void clearSystemBarColor() {
if (mDecorView == null) { if (mDecorView == null || !mDecorView.isAttachedToWindow()) {
return; return;
} }
if (mDecorView.getLayoutParams() instanceof WindowManager.LayoutParams) { if (mDecorView.getLayoutParams() instanceof WindowManager.LayoutParams) {