Merge "Fix potential crash when exit splash screen" am: 18b88655a4 am: f1ecd46905

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

Change-Id: I9f2c092b874bd071be7e7811a3f06090f6758208
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Riddle Hsu
2022-11-10 13:05:28 +00:00
committed by Automerger Merge Worker

View File

@@ -430,7 +430,8 @@ public class StartingSurfaceDrawer {
} }
@Override @Override
public @Nullable SplashScreenView get() { @Nullable
public SplashScreenView get() {
synchronized (this) { synchronized (this) {
while (!mIsViewSet) { while (!mIsViewSet) {
try { try {
@@ -691,7 +692,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;
@@ -732,7 +733,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) {