Loading core/java/android/app/ActivityOptions.java +1 −1 Original line number Diff line number Diff line Loading @@ -431,7 +431,7 @@ public class ActivityOptions { private boolean mOverrideTaskTransition; private String mSplashScreenThemeResName; @SplashScreen.SplashScreenStyle private int mSplashScreenStyle; private int mSplashScreenStyle = SplashScreen.SPLASH_SCREEN_STYLE_UNDEFINED; private boolean mRemoveWithTaskOrganizer; private boolean mLaunchedFromBubble; private boolean mTransientLaunch; Loading core/java/android/window/SplashScreen.java +6 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,11 @@ import java.util.ArrayList; * <code>Activity.getSplashScreen()</code> to get the SplashScreen.</p> */ public interface SplashScreen { /** * The splash screen style is not defined. * @hide */ int SPLASH_SCREEN_STYLE_UNDEFINED = -1; /** * Force splash screen to be empty. * @hide Loading @@ -55,6 +60,7 @@ public interface SplashScreen { /** @hide */ @IntDef(prefix = { "SPLASH_SCREEN_STYLE_" }, value = { SPLASH_SCREEN_STYLE_UNDEFINED, SPLASH_SCREEN_STYLE_EMPTY, SPLASH_SCREEN_STYLE_ICON }) Loading services/core/java/com/android/server/wm/ActivityRecord.java +11 −7 Original line number Diff line number Diff line Loading @@ -6565,6 +6565,13 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A } else if (optionsStyle == SplashScreen.SPLASH_SCREEN_STYLE_ICON) { return false; } // Choose the default behavior for Launcher and SystemUI when the SplashScreen style is // not specified in the ActivityOptions. if (mLaunchSourceType == LAUNCH_SOURCE_TYPE_HOME) { return false; } else if (mLaunchSourceType == LAUNCH_SOURCE_TYPE_SYSTEMUI) { return true; } } if (sourceRecord == null) { sourceRecord = searchCandidateLaunchingActivity(); Loading @@ -6574,14 +6581,11 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A return sourceRecord.mSplashScreenStyleEmpty; } // If this activity was launched from a system surface, never use an empty splash screen // If this activity was launched from Launcher or System for first start, never use an // empty splash screen. // Need to check sourceRecord before in case this activity is launched from service. if (launchedFromSystemSurface()) { return false; } // Otherwise use empty. return true; return !startActivity || !(mLaunchSourceType == LAUNCH_SOURCE_TYPE_SYSTEM || mLaunchSourceType == LAUNCH_SOURCE_TYPE_HOME); } private int getSplashscreenTheme() { Loading Loading
core/java/android/app/ActivityOptions.java +1 −1 Original line number Diff line number Diff line Loading @@ -431,7 +431,7 @@ public class ActivityOptions { private boolean mOverrideTaskTransition; private String mSplashScreenThemeResName; @SplashScreen.SplashScreenStyle private int mSplashScreenStyle; private int mSplashScreenStyle = SplashScreen.SPLASH_SCREEN_STYLE_UNDEFINED; private boolean mRemoveWithTaskOrganizer; private boolean mLaunchedFromBubble; private boolean mTransientLaunch; Loading
core/java/android/window/SplashScreen.java +6 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,11 @@ import java.util.ArrayList; * <code>Activity.getSplashScreen()</code> to get the SplashScreen.</p> */ public interface SplashScreen { /** * The splash screen style is not defined. * @hide */ int SPLASH_SCREEN_STYLE_UNDEFINED = -1; /** * Force splash screen to be empty. * @hide Loading @@ -55,6 +60,7 @@ public interface SplashScreen { /** @hide */ @IntDef(prefix = { "SPLASH_SCREEN_STYLE_" }, value = { SPLASH_SCREEN_STYLE_UNDEFINED, SPLASH_SCREEN_STYLE_EMPTY, SPLASH_SCREEN_STYLE_ICON }) Loading
services/core/java/com/android/server/wm/ActivityRecord.java +11 −7 Original line number Diff line number Diff line Loading @@ -6565,6 +6565,13 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A } else if (optionsStyle == SplashScreen.SPLASH_SCREEN_STYLE_ICON) { return false; } // Choose the default behavior for Launcher and SystemUI when the SplashScreen style is // not specified in the ActivityOptions. if (mLaunchSourceType == LAUNCH_SOURCE_TYPE_HOME) { return false; } else if (mLaunchSourceType == LAUNCH_SOURCE_TYPE_SYSTEMUI) { return true; } } if (sourceRecord == null) { sourceRecord = searchCandidateLaunchingActivity(); Loading @@ -6574,14 +6581,11 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A return sourceRecord.mSplashScreenStyleEmpty; } // If this activity was launched from a system surface, never use an empty splash screen // If this activity was launched from Launcher or System for first start, never use an // empty splash screen. // Need to check sourceRecord before in case this activity is launched from service. if (launchedFromSystemSurface()) { return false; } // Otherwise use empty. return true; return !startActivity || !(mLaunchSourceType == LAUNCH_SOURCE_TYPE_SYSTEM || mLaunchSourceType == LAUNCH_SOURCE_TYPE_HOME); } private int getSplashscreenTheme() { Loading