summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author wilsonshih <wilsonshih@google.com> 2024-06-19 10:02:06 +0800
committer wilsonshih <wilsonshih@google.com> 2024-06-20 12:45:34 +0000
commit4ff5010835250ef0509e47d79d51090b3addbc04 (patch)
tree0ef8c1c2d3afad7f6b2d7c526e9cc3936e0011ef
parentc92aa73766e6caadc0abad320950c33313b30a14 (diff)
Do not show splash screen icon in the same task by default.
Adjust the check priority when choose solid color splash screen. Basically lower down the default showing icon condition, and only show splash screen icon if the activity is launching to a new task. App launched from Launcher or SystemUI should always request new task, also since Launcher and SystemUI will specify the launch style, so there should be no difference. Most of time SUW won't launch app to new task, so even it is HOME process, there should not show splash screen icon in the entire setup sequence. Bug: 343204515 Bug: 343203529 Flag: EXEMPT bugfix Test: atest ActivityRecordTests SplashscreenTests Test: try launch activity with FLAG_ACTIVITY_CLEAR_TASK, verify the splash screen should choose solid color. Change-Id: I7230936da1663cea412356d86a745199ac87163d
-rw-r--r--services/core/java/com/android/server/wm/ActivityRecord.java18
1 files changed, 8 insertions, 10 deletions
diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java
index d9dc7ba9ad12..41905d2bf1ef 100644
--- a/services/core/java/com/android/server/wm/ActivityRecord.java
+++ b/services/core/java/com/android/server/wm/ActivityRecord.java
@@ -158,7 +158,6 @@ import static com.android.internal.util.FrameworkStatsLog.APP_COMPAT_STATE_CHANG
import static com.android.internal.util.FrameworkStatsLog.APP_COMPAT_STATE_CHANGED__STATE__LETTERBOXED_FOR_SIZE_COMPAT_MODE;
import static com.android.internal.util.FrameworkStatsLog.APP_COMPAT_STATE_CHANGED__STATE__NOT_LETTERBOXED;
import static com.android.internal.util.FrameworkStatsLog.APP_COMPAT_STATE_CHANGED__STATE__NOT_VISIBLE;
-import static com.android.internal.util.function.pooled.PooledLambda.obtainMessage;
import static com.android.server.policy.WindowManagerPolicy.FINISH_LAYOUT_REDO_ANIM;
import static com.android.server.policy.WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER;
import static com.android.server.wm.ActivityRecord.State.DESTROYED;
@@ -7519,7 +7518,8 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
* use an icon or solid color splash screen will be made by WmShell.
*/
private boolean shouldUseSolidColorSplashScreen(ActivityRecord sourceRecord,
- boolean startActivity, ActivityOptions options, int resolvedTheme) {
+ boolean startActivity, ActivityOptions options, int resolvedTheme,
+ boolean newTask) {
if (sourceRecord == null && !startActivity) {
// Use simple style if this activity is not top activity. This could happen when adding
// a splash screen window to the warm start activity which is re-create because top is
@@ -7542,21 +7542,19 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
// Choose the default behavior when neither the ActivityRecord nor the activity theme have
// specified a splash screen style.
-
- if (mLaunchSourceType == LAUNCH_SOURCE_TYPE_HOME || launchedFromUid == Process.SHELL_UID) {
- return false;
- } else if (mLaunchSourceType == LAUNCH_SOURCE_TYPE_SYSTEMUI) {
+ if (mLaunchSourceType == LAUNCH_SOURCE_TYPE_SYSTEMUI) {
return true;
} else {
// Need to check sourceRecord in case this activity is launched from a service.
if (sourceRecord == null) {
sourceRecord = searchCandidateLaunchingActivity();
}
-
if (sourceRecord != null) {
- return sourceRecord.mSplashScreenStyleSolidColor;
+ return sourceRecord.mSplashScreenStyleSolidColor; // follow previous activity
+ } else if (mLaunchSourceType == LAUNCH_SOURCE_TYPE_HOME
+ || launchedFromUid == Process.SHELL_UID) {
+ return !newTask; // only show icon for new task
}
-
// Use an icon if the activity was launched from System for the first start.
// Otherwise, must use solid color splash screen.
return mLaunchSourceType != LAUNCH_SOURCE_TYPE_SYSTEM || !startActivity;
@@ -7624,7 +7622,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
splashScreenTheme);
mSplashScreenStyleSolidColor = shouldUseSolidColorSplashScreen(sourceRecord, startActivity,
- startOptions, resolvedTheme);
+ startOptions, resolvedTheme, newTask);
final boolean activityCreated =
mState.ordinal() >= STARTED.ordinal() && mState.ordinal() <= STOPPED.ordinal();