From a18586cc1b8427e4d68f1969a1e6f96f0e56ac27 Mon Sep 17 00:00:00 2001 From: wilsonshih Date: Wed, 22 Sep 2021 16:49:33 +0800 Subject: [PATCH] Fix missing check empty style splash screen when task switch. Bug: 200771843 Test: show empty splash screen when launch a trampoline activity from notification. Change-Id: Ib167a3b66a8c4274a96faaa3ff4c2e902e929dab --- .../PhoneStartingWindowTypeAlgorithm.java | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/phone/PhoneStartingWindowTypeAlgorithm.java b/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/phone/PhoneStartingWindowTypeAlgorithm.java index e6d6028b2aba0..bde2b5ff4d607 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/phone/PhoneStartingWindowTypeAlgorithm.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/phone/PhoneStartingWindowTypeAlgorithm.java @@ -71,23 +71,13 @@ public class PhoneStartingWindowTypeAlgorithm implements StartingWindowTypeAlgor + " topIsHome:" + topIsHome); } - final int visibleSplashScreenType = legacySplashScreen - ? STARTING_WINDOW_TYPE_LEGACY_SPLASH_SCREEN - : STARTING_WINDOW_TYPE_SPLASH_SCREEN; - if (!topIsHome) { - if (!processRunning) { + if (!processRunning || newTask || (taskSwitch && !activityCreated)) { return useEmptySplashScreen ? STARTING_WINDOW_TYPE_EMPTY_SPLASH_SCREEN - : visibleSplashScreenType; - } - if (newTask) { - return useEmptySplashScreen - ? STARTING_WINDOW_TYPE_EMPTY_SPLASH_SCREEN - : visibleSplashScreenType; - } - if (taskSwitch && !activityCreated) { - return visibleSplashScreenType; + : legacySplashScreen + ? STARTING_WINDOW_TYPE_LEGACY_SPLASH_SCREEN + : STARTING_WINDOW_TYPE_SPLASH_SCREEN; } } if (taskSwitch && allowTaskSnapshot) {