Merge "Provide default splash screen style for Launcher and SystemUI." into sc-v2-dev am: 611d320a39
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16338744 Change-Id: I238f0b674486f75dce539047b671c0e827289168
This commit is contained in:
@@ -431,7 +431,7 @@ public class ActivityOptions {
|
|||||||
private boolean mOverrideTaskTransition;
|
private boolean mOverrideTaskTransition;
|
||||||
private String mSplashScreenThemeResName;
|
private String mSplashScreenThemeResName;
|
||||||
@SplashScreen.SplashScreenStyle
|
@SplashScreen.SplashScreenStyle
|
||||||
private int mSplashScreenStyle;
|
private int mSplashScreenStyle = SplashScreen.SPLASH_SCREEN_STYLE_UNDEFINED;
|
||||||
private boolean mRemoveWithTaskOrganizer;
|
private boolean mRemoveWithTaskOrganizer;
|
||||||
private boolean mLaunchedFromBubble;
|
private boolean mLaunchedFromBubble;
|
||||||
private boolean mTransientLaunch;
|
private boolean mTransientLaunch;
|
||||||
|
|||||||
@@ -42,6 +42,11 @@ import java.util.ArrayList;
|
|||||||
* <code>Activity.getSplashScreen()</code> to get the SplashScreen.</p>
|
* <code>Activity.getSplashScreen()</code> to get the SplashScreen.</p>
|
||||||
*/
|
*/
|
||||||
public interface SplashScreen {
|
public interface SplashScreen {
|
||||||
|
/**
|
||||||
|
* The splash screen style is not defined.
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
int SPLASH_SCREEN_STYLE_UNDEFINED = -1;
|
||||||
/**
|
/**
|
||||||
* Force splash screen to be empty.
|
* Force splash screen to be empty.
|
||||||
* @hide
|
* @hide
|
||||||
@@ -55,6 +60,7 @@ public interface SplashScreen {
|
|||||||
|
|
||||||
/** @hide */
|
/** @hide */
|
||||||
@IntDef(prefix = { "SPLASH_SCREEN_STYLE_" }, value = {
|
@IntDef(prefix = { "SPLASH_SCREEN_STYLE_" }, value = {
|
||||||
|
SPLASH_SCREEN_STYLE_UNDEFINED,
|
||||||
SPLASH_SCREEN_STYLE_EMPTY,
|
SPLASH_SCREEN_STYLE_EMPTY,
|
||||||
SPLASH_SCREEN_STYLE_ICON
|
SPLASH_SCREEN_STYLE_ICON
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -6573,6 +6573,13 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
|
|||||||
} else if (optionsStyle == SplashScreen.SPLASH_SCREEN_STYLE_ICON) {
|
} else if (optionsStyle == SplashScreen.SPLASH_SCREEN_STYLE_ICON) {
|
||||||
return false;
|
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) {
|
if (sourceRecord == null) {
|
||||||
sourceRecord = searchCandidateLaunchingActivity();
|
sourceRecord = searchCandidateLaunchingActivity();
|
||||||
@@ -6582,14 +6589,11 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
|
|||||||
return sourceRecord.mSplashScreenStyleEmpty;
|
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.
|
// Need to check sourceRecord before in case this activity is launched from service.
|
||||||
if (launchedFromSystemSurface()) {
|
return !startActivity || !(mLaunchSourceType == LAUNCH_SOURCE_TYPE_SYSTEM
|
||||||
return false;
|
|| mLaunchSourceType == LAUNCH_SOURCE_TYPE_HOME);
|
||||||
}
|
|
||||||
|
|
||||||
// Otherwise use empty.
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private int getSplashscreenTheme() {
|
private int getSplashscreenTheme() {
|
||||||
|
|||||||
Reference in New Issue
Block a user