From 8a8c0ed0873575f19955487d9826cd0249725bb8 Mon Sep 17 00:00:00 2001 From: Yunfan Chen Date: Tue, 18 Dec 2018 16:46:32 -0800 Subject: [PATCH] Apply splash screen and transfer starting window to all activities This fixes a CTS failure and lack of splash screen for some activities. When removing the global lock in AppWindowToken in change 1ee84ea, transferStartingWindow and creating splash screen was accidentally wrapped by if(theme != 0) by mistake. The error will prevent simple app from showing splash screen. This patch fixes the error and the function is now aligned with the old AppWindowContainerController#addStartingWindow. Test: atest ActivityMetricsLoggerTests Test: Test app in b/120968158 will show the splash screen with correct log information. Bug: 120968158 Bug: 120779200 Change-Id: I34bf01874eecc3c0402d83d922445cd48ca1b39a --- .../com/android/server/wm/AppWindowToken.java | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/services/core/java/com/android/server/wm/AppWindowToken.java b/services/core/java/com/android/server/wm/AppWindowToken.java index 8d49bf374baf0..d8b2b5200f0c1 100644 --- a/services/core/java/com/android/server/wm/AppWindowToken.java +++ b/services/core/java/com/android/server/wm/AppWindowToken.java @@ -1837,23 +1837,23 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree return false; } } - - if (transferStartingWindow(transferFrom)) { - return true; - } - - // There is no existing starting window, and we don't want to create a splash screen, so - // that's it! - if (type != STARTING_WINDOW_TYPE_SPLASH_SCREEN) { - return false; - } - - if (DEBUG_STARTING_WINDOW) Slog.v(TAG_WM, "Creating SplashScreenStartingData"); - startingData = new SplashScreenStartingData(mWmService, pkg, - theme, compatInfo, nonLocalizedLabel, labelRes, icon, logo, windowFlags, - getMergedOverrideConfiguration()); - scheduleAddStartingWindow(); } + + if (transferStartingWindow(transferFrom)) { + return true; + } + + // There is no existing starting window, and we don't want to create a splash screen, so + // that's it! + if (type != STARTING_WINDOW_TYPE_SPLASH_SCREEN) { + return false; + } + + if (DEBUG_STARTING_WINDOW) Slog.v(TAG_WM, "Creating SplashScreenStartingData"); + startingData = new SplashScreenStartingData(mWmService, pkg, + theme, compatInfo, nonLocalizedLabel, labelRes, icon, logo, windowFlags, + getMergedOverrideConfiguration()); + scheduleAddStartingWindow(); return true; }