Loading libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/phone/PhoneStartingWindowTypeAlgorithm.java +20 −13 Original line number Original line Diff line number Diff line Loading @@ -75,17 +75,13 @@ public class PhoneStartingWindowTypeAlgorithm implements StartingWindowTypeAlgor } } if (!topIsHome) { if (!topIsHome) { if (!processRunning if (!processRunning || newTask || (taskSwitch && !activityCreated)) { || newTask return getSplashscreenType(useEmptySplashScreen, legacySplashScreen); || (taskSwitch && (!activityCreated || !activityDrawn))) { return useEmptySplashScreen ? STARTING_WINDOW_TYPE_EMPTY_SPLASH_SCREEN : legacySplashScreen ? STARTING_WINDOW_TYPE_LEGACY_SPLASH_SCREEN : STARTING_WINDOW_TYPE_SPLASH_SCREEN; } } } } if (taskSwitch && allowTaskSnapshot) { if (taskSwitch) { if (allowTaskSnapshot) { if (isSnapshotCompatible(windowInfo)) { if (isSnapshotCompatible(windowInfo)) { return STARTING_WINDOW_TYPE_SNAPSHOT; return STARTING_WINDOW_TYPE_SNAPSHOT; } } Loading @@ -93,9 +89,20 @@ public class PhoneStartingWindowTypeAlgorithm implements StartingWindowTypeAlgor return STARTING_WINDOW_TYPE_EMPTY_SPLASH_SCREEN; return STARTING_WINDOW_TYPE_EMPTY_SPLASH_SCREEN; } } } } if (!activityDrawn && !topIsHome) { return getSplashscreenType(useEmptySplashScreen, legacySplashScreen); } } return STARTING_WINDOW_TYPE_NONE; return STARTING_WINDOW_TYPE_NONE; } } private static int getSplashscreenType(boolean emptySplashScreen, boolean legacySplashScreen) { return emptySplashScreen ? STARTING_WINDOW_TYPE_EMPTY_SPLASH_SCREEN : legacySplashScreen ? STARTING_WINDOW_TYPE_LEGACY_SPLASH_SCREEN : STARTING_WINDOW_TYPE_SPLASH_SCREEN; } /** /** * Returns {@code true} if the task snapshot is compatible with this activity (at least the * Returns {@code true} if the task snapshot is compatible with this activity (at least the Loading services/core/java/com/android/server/wm/ActivityRecord.java +18 −16 Original line number Original line Diff line number Diff line Loading @@ -2131,21 +2131,26 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A private int getStartingWindowType(boolean newTask, boolean taskSwitch, boolean processRunning, private int getStartingWindowType(boolean newTask, boolean taskSwitch, boolean processRunning, boolean allowTaskSnapshot, boolean activityCreated, boolean activityAllDrawn, boolean allowTaskSnapshot, boolean activityCreated, boolean activityAllDrawn, TaskSnapshot snapshot) { TaskSnapshot snapshot) { if ((newTask || !processRunning || (taskSwitch && !activityCreated) final boolean isActivityHome = isActivityTypeHome(); || (taskSwitch && !activityAllDrawn)) && !isActivityTypeHome()) { if ((newTask || !processRunning || (taskSwitch && !activityCreated)) && !isActivityHome) { return STARTING_WINDOW_TYPE_SPLASH_SCREEN; return STARTING_WINDOW_TYPE_SPLASH_SCREEN; } else if (taskSwitch && allowTaskSnapshot) { } if (taskSwitch) { if (allowTaskSnapshot) { if (isSnapshotCompatible(snapshot)) { if (isSnapshotCompatible(snapshot)) { return STARTING_WINDOW_TYPE_SNAPSHOT; return STARTING_WINDOW_TYPE_SNAPSHOT; } } if (!isActivityTypeHome()) { if (!isActivityHome) { return STARTING_WINDOW_TYPE_SPLASH_SCREEN; return STARTING_WINDOW_TYPE_SPLASH_SCREEN; } } return STARTING_WINDOW_TYPE_NONE; } } else { if (!activityAllDrawn && !isActivityHome) { return STARTING_WINDOW_TYPE_NONE; return STARTING_WINDOW_TYPE_SPLASH_SCREEN; } } } } return STARTING_WINDOW_TYPE_NONE; } /** /** * Returns {@code true} if the task snapshot is compatible with this activity (at least the * Returns {@code true} if the task snapshot is compatible with this activity (at least the Loading Loading @@ -6433,14 +6438,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 a system surface for first start, never use an empty // Need to check sourceRecord before in case this activity is launched from service. // splash screen. Need to check sourceRecord before in case this activity is launched from if (launchedFromSystemSurface()) { // service. return false; } // Otherwise use empty. // Otherwise use empty. return true; return !startActivity || !launchedFromSystemSurface(); } } private int getSplashscreenTheme() { private int getSplashscreenTheme() { Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/startingsurface/phone/PhoneStartingWindowTypeAlgorithm.java +20 −13 Original line number Original line Diff line number Diff line Loading @@ -75,17 +75,13 @@ public class PhoneStartingWindowTypeAlgorithm implements StartingWindowTypeAlgor } } if (!topIsHome) { if (!topIsHome) { if (!processRunning if (!processRunning || newTask || (taskSwitch && !activityCreated)) { || newTask return getSplashscreenType(useEmptySplashScreen, legacySplashScreen); || (taskSwitch && (!activityCreated || !activityDrawn))) { return useEmptySplashScreen ? STARTING_WINDOW_TYPE_EMPTY_SPLASH_SCREEN : legacySplashScreen ? STARTING_WINDOW_TYPE_LEGACY_SPLASH_SCREEN : STARTING_WINDOW_TYPE_SPLASH_SCREEN; } } } } if (taskSwitch && allowTaskSnapshot) { if (taskSwitch) { if (allowTaskSnapshot) { if (isSnapshotCompatible(windowInfo)) { if (isSnapshotCompatible(windowInfo)) { return STARTING_WINDOW_TYPE_SNAPSHOT; return STARTING_WINDOW_TYPE_SNAPSHOT; } } Loading @@ -93,9 +89,20 @@ public class PhoneStartingWindowTypeAlgorithm implements StartingWindowTypeAlgor return STARTING_WINDOW_TYPE_EMPTY_SPLASH_SCREEN; return STARTING_WINDOW_TYPE_EMPTY_SPLASH_SCREEN; } } } } if (!activityDrawn && !topIsHome) { return getSplashscreenType(useEmptySplashScreen, legacySplashScreen); } } return STARTING_WINDOW_TYPE_NONE; return STARTING_WINDOW_TYPE_NONE; } } private static int getSplashscreenType(boolean emptySplashScreen, boolean legacySplashScreen) { return emptySplashScreen ? STARTING_WINDOW_TYPE_EMPTY_SPLASH_SCREEN : legacySplashScreen ? STARTING_WINDOW_TYPE_LEGACY_SPLASH_SCREEN : STARTING_WINDOW_TYPE_SPLASH_SCREEN; } /** /** * Returns {@code true} if the task snapshot is compatible with this activity (at least the * Returns {@code true} if the task snapshot is compatible with this activity (at least the Loading
services/core/java/com/android/server/wm/ActivityRecord.java +18 −16 Original line number Original line Diff line number Diff line Loading @@ -2131,21 +2131,26 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A private int getStartingWindowType(boolean newTask, boolean taskSwitch, boolean processRunning, private int getStartingWindowType(boolean newTask, boolean taskSwitch, boolean processRunning, boolean allowTaskSnapshot, boolean activityCreated, boolean activityAllDrawn, boolean allowTaskSnapshot, boolean activityCreated, boolean activityAllDrawn, TaskSnapshot snapshot) { TaskSnapshot snapshot) { if ((newTask || !processRunning || (taskSwitch && !activityCreated) final boolean isActivityHome = isActivityTypeHome(); || (taskSwitch && !activityAllDrawn)) && !isActivityTypeHome()) { if ((newTask || !processRunning || (taskSwitch && !activityCreated)) && !isActivityHome) { return STARTING_WINDOW_TYPE_SPLASH_SCREEN; return STARTING_WINDOW_TYPE_SPLASH_SCREEN; } else if (taskSwitch && allowTaskSnapshot) { } if (taskSwitch) { if (allowTaskSnapshot) { if (isSnapshotCompatible(snapshot)) { if (isSnapshotCompatible(snapshot)) { return STARTING_WINDOW_TYPE_SNAPSHOT; return STARTING_WINDOW_TYPE_SNAPSHOT; } } if (!isActivityTypeHome()) { if (!isActivityHome) { return STARTING_WINDOW_TYPE_SPLASH_SCREEN; return STARTING_WINDOW_TYPE_SPLASH_SCREEN; } } return STARTING_WINDOW_TYPE_NONE; } } else { if (!activityAllDrawn && !isActivityHome) { return STARTING_WINDOW_TYPE_NONE; return STARTING_WINDOW_TYPE_SPLASH_SCREEN; } } } } return STARTING_WINDOW_TYPE_NONE; } /** /** * Returns {@code true} if the task snapshot is compatible with this activity (at least the * Returns {@code true} if the task snapshot is compatible with this activity (at least the Loading Loading @@ -6433,14 +6438,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 a system surface for first start, never use an empty // Need to check sourceRecord before in case this activity is launched from service. // splash screen. Need to check sourceRecord before in case this activity is launched from if (launchedFromSystemSurface()) { // service. return false; } // Otherwise use empty. // Otherwise use empty. return true; return !startActivity || !launchedFromSystemSurface(); } } private int getSplashscreenTheme() { private int getSplashscreenTheme() { Loading