Loading core/java/android/app/ActivityOptions.java +28 −0 Original line number Diff line number Diff line Loading @@ -56,6 +56,7 @@ import android.view.View; import android.view.ViewGroup; import android.view.Window; import android.window.IRemoteTransition; import android.window.SplashScreen; import android.window.WindowContainerToken; import java.lang.annotation.Retention; Loading Loading @@ -327,6 +328,10 @@ public class ActivityOptions { private static final String KEY_LAUNCHED_FROM_BUBBLE = "android.activity.launchTypeBubble"; /** See {@link #setSplashscreenStyle(int)}. */ private static final String KEY_SPLASH_SCREEN_STYLE = "android.activity.splashScreenStyle"; /** See {@link #setTransientLaunch()}. */ private static final String KEY_TRANSIENT_LAUNCH = "android.activity.transientLaunch"; Loading Loading @@ -415,6 +420,8 @@ public class ActivityOptions { private IRemoteTransition mRemoteTransition; private boolean mOverrideTaskTransition; private int mSplashScreenThemeResId; @SplashScreen.SplashScreenStyle private int mSplashScreenStyle; private boolean mRemoveWithTaskOrganizer; private boolean mLaunchedFromBubble; private boolean mTransientLaunch; Loading Loading @@ -1171,6 +1178,7 @@ public class ActivityOptions { mRemoveWithTaskOrganizer = opts.getBoolean(KEY_REMOVE_WITH_TASK_ORGANIZER); mLaunchedFromBubble = opts.getBoolean(KEY_LAUNCHED_FROM_BUBBLE); mTransientLaunch = opts.getBoolean(KEY_TRANSIENT_LAUNCH); mSplashScreenStyle = opts.getInt(KEY_SPLASH_SCREEN_STYLE); } /** Loading Loading @@ -1364,6 +1372,23 @@ public class ActivityOptions { return mSplashScreenThemeResId; } /** * Sets the preferred splash screen style. * @hide */ public void setSplashscreenStyle(@SplashScreen.SplashScreenStyle int style) { mSplashScreenStyle = style; } /** * Gets the preferred splash screen style from caller * @hide */ @SplashScreen.SplashScreenStyle public int getSplashScreenStyle() { return mSplashScreenStyle; } /** * Sets whether the activity is to be launched into LockTask mode. * Loading Loading @@ -1932,6 +1957,9 @@ public class ActivityOptions { if (mTransientLaunch) { b.putBoolean(KEY_TRANSIENT_LAUNCH, mTransientLaunch); } if (mSplashScreenStyle != 0) { b.putInt(KEY_SPLASH_SCREEN_STYLE, mSplashScreenStyle); } return b; } Loading core/java/android/window/SplashScreen.java +19 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package android.window; import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.StyleRes; import android.annotation.SuppressLint; Loading @@ -41,6 +42,24 @@ import java.util.ArrayList; * <code>Activity.getSplashScreen()</code> to get the SplashScreen.</p> */ public interface SplashScreen { /** * Force splash screen to be empty. * @hide */ int SPLASH_SCREEN_STYLE_EMPTY = 0; /** * Force splash screen to show icon. * @hide */ int SPLASH_SCREEN_STYLE_ICON = 1; /** @hide */ @IntDef(prefix = { "SPLASH_SCREEN_STYLE_" }, value = { SPLASH_SCREEN_STYLE_EMPTY, SPLASH_SCREEN_STYLE_ICON }) @interface SplashScreenStyle {} /** * <p>Specifies whether an {@link Activity} wants to handle the splash screen animation on its * own. Normally the splash screen will show on screen before the content of the activity has Loading services/core/java/com/android/server/wm/ActivityRecord.java +9 −0 Original line number Diff line number Diff line Loading @@ -308,6 +308,7 @@ import android.view.WindowManager.TransitionOldType; import android.view.animation.Animation; import android.window.IRemoteTransition; import android.window.SizeConfigurationBuckets; import android.window.SplashScreen; import android.window.SplashScreenView.SplashScreenViewParcelable; import android.window.TaskSnapshot; import android.window.WindowContainerToken; Loading Loading @@ -6182,6 +6183,14 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A } private boolean shouldUseEmptySplashScreen(ActivityRecord sourceRecord) { if (mPendingOptions != null) { final int optionsStyle = mPendingOptions.getSplashScreenStyle(); if (optionsStyle == SplashScreen.SPLASH_SCREEN_STYLE_EMPTY) { return true; } else if (optionsStyle == SplashScreen.SPLASH_SCREEN_STYLE_ICON) { return false; } } if (sourceRecord == null) { sourceRecord = searchCandidateLaunchingActivity(); } Loading Loading
core/java/android/app/ActivityOptions.java +28 −0 Original line number Diff line number Diff line Loading @@ -56,6 +56,7 @@ import android.view.View; import android.view.ViewGroup; import android.view.Window; import android.window.IRemoteTransition; import android.window.SplashScreen; import android.window.WindowContainerToken; import java.lang.annotation.Retention; Loading Loading @@ -327,6 +328,10 @@ public class ActivityOptions { private static final String KEY_LAUNCHED_FROM_BUBBLE = "android.activity.launchTypeBubble"; /** See {@link #setSplashscreenStyle(int)}. */ private static final String KEY_SPLASH_SCREEN_STYLE = "android.activity.splashScreenStyle"; /** See {@link #setTransientLaunch()}. */ private static final String KEY_TRANSIENT_LAUNCH = "android.activity.transientLaunch"; Loading Loading @@ -415,6 +420,8 @@ public class ActivityOptions { private IRemoteTransition mRemoteTransition; private boolean mOverrideTaskTransition; private int mSplashScreenThemeResId; @SplashScreen.SplashScreenStyle private int mSplashScreenStyle; private boolean mRemoveWithTaskOrganizer; private boolean mLaunchedFromBubble; private boolean mTransientLaunch; Loading Loading @@ -1171,6 +1178,7 @@ public class ActivityOptions { mRemoveWithTaskOrganizer = opts.getBoolean(KEY_REMOVE_WITH_TASK_ORGANIZER); mLaunchedFromBubble = opts.getBoolean(KEY_LAUNCHED_FROM_BUBBLE); mTransientLaunch = opts.getBoolean(KEY_TRANSIENT_LAUNCH); mSplashScreenStyle = opts.getInt(KEY_SPLASH_SCREEN_STYLE); } /** Loading Loading @@ -1364,6 +1372,23 @@ public class ActivityOptions { return mSplashScreenThemeResId; } /** * Sets the preferred splash screen style. * @hide */ public void setSplashscreenStyle(@SplashScreen.SplashScreenStyle int style) { mSplashScreenStyle = style; } /** * Gets the preferred splash screen style from caller * @hide */ @SplashScreen.SplashScreenStyle public int getSplashScreenStyle() { return mSplashScreenStyle; } /** * Sets whether the activity is to be launched into LockTask mode. * Loading Loading @@ -1932,6 +1957,9 @@ public class ActivityOptions { if (mTransientLaunch) { b.putBoolean(KEY_TRANSIENT_LAUNCH, mTransientLaunch); } if (mSplashScreenStyle != 0) { b.putInt(KEY_SPLASH_SCREEN_STYLE, mSplashScreenStyle); } return b; } Loading
core/java/android/window/SplashScreen.java +19 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package android.window; import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.StyleRes; import android.annotation.SuppressLint; Loading @@ -41,6 +42,24 @@ import java.util.ArrayList; * <code>Activity.getSplashScreen()</code> to get the SplashScreen.</p> */ public interface SplashScreen { /** * Force splash screen to be empty. * @hide */ int SPLASH_SCREEN_STYLE_EMPTY = 0; /** * Force splash screen to show icon. * @hide */ int SPLASH_SCREEN_STYLE_ICON = 1; /** @hide */ @IntDef(prefix = { "SPLASH_SCREEN_STYLE_" }, value = { SPLASH_SCREEN_STYLE_EMPTY, SPLASH_SCREEN_STYLE_ICON }) @interface SplashScreenStyle {} /** * <p>Specifies whether an {@link Activity} wants to handle the splash screen animation on its * own. Normally the splash screen will show on screen before the content of the activity has Loading
services/core/java/com/android/server/wm/ActivityRecord.java +9 −0 Original line number Diff line number Diff line Loading @@ -308,6 +308,7 @@ import android.view.WindowManager.TransitionOldType; import android.view.animation.Animation; import android.window.IRemoteTransition; import android.window.SizeConfigurationBuckets; import android.window.SplashScreen; import android.window.SplashScreenView.SplashScreenViewParcelable; import android.window.TaskSnapshot; import android.window.WindowContainerToken; Loading Loading @@ -6182,6 +6183,14 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A } private boolean shouldUseEmptySplashScreen(ActivityRecord sourceRecord) { if (mPendingOptions != null) { final int optionsStyle = mPendingOptions.getSplashScreenStyle(); if (optionsStyle == SplashScreen.SPLASH_SCREEN_STYLE_EMPTY) { return true; } else if (optionsStyle == SplashScreen.SPLASH_SCREEN_STYLE_ICON) { return false; } } if (sourceRecord == null) { sourceRecord = searchCandidateLaunchingActivity(); } Loading