Extend splash screen exception list to V.
Extend the support of the exception list for V.
Test: atest ActivityRecordTests SplashScreenExceptionListTest
Bug: 231708538
Change-Id: I1e36d2c95d557ca28964c8fabd205c6ef2db4775
diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java
index 2b2100e..d906bc4 100644
--- a/services/core/java/com/android/server/wm/ActivityRecord.java
+++ b/services/core/java/com/android/server/wm/ActivityRecord.java
@@ -2425,7 +2425,7 @@
final int type = getStartingWindowType(newTask, taskSwitch, processRunning,
allowTaskSnapshot, activityCreated, activityAllDrawn, snapshot);
- //TODO(191787740) Remove for T+
+ //TODO(191787740) Remove for V+
final boolean useLegacy = type == STARTING_WINDOW_TYPE_SPLASH_SCREEN
&& mWmService.mStartingSurfaceController.isExceptionApp(packageName, mTargetSdk,
() -> {
diff --git a/services/core/java/com/android/server/wm/SplashScreenExceptionList.java b/services/core/java/com/android/server/wm/SplashScreenExceptionList.java
index b3cd3f0..3fb897b 100644
--- a/services/core/java/com/android/server/wm/SplashScreenExceptionList.java
+++ b/services/core/java/com/android/server/wm/SplashScreenExceptionList.java
@@ -70,7 +70,7 @@
}
/**
- * Returns true if the packageName is in the list and the target sdk is before or including T.
+ * Returns true if the packageName is in the list and the target sdk is before or including V.
*
* @param packageName The package name of the application to check
* @param targetSdk The target sdk of the application
@@ -82,7 +82,7 @@
@SuppressWarnings("AndroidFrameworkCompatChange") // Target sdk check
public boolean isException(@NonNull String packageName, int targetSdk,
@Nullable Supplier<ApplicationInfo> infoSupplier) {
- if (targetSdk > Build.VERSION_CODES.TIRAMISU) {
+ if (targetSdk > Build.VERSION_CODES.UPSIDE_DOWN_CAKE + 1) {
return false;
}
diff --git a/services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java b/services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java
index cb984f8..32f9e906 100644
--- a/services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java
@@ -2783,8 +2783,12 @@
testLegacySplashScreen(Build.VERSION_CODES.S, TYPE_PARAMETER_LEGACY_SPLASH_SCREEN);
testLegacySplashScreen(Build.VERSION_CODES.TIRAMISU,
TYPE_PARAMETER_LEGACY_SPLASH_SCREEN);
- // Above T
- testLegacySplashScreen(Build.VERSION_CODES.TIRAMISU + 1, 0);
+ testLegacySplashScreen(Build.VERSION_CODES.UPSIDE_DOWN_CAKE,
+ TYPE_PARAMETER_LEGACY_SPLASH_SCREEN);
+ testLegacySplashScreen(Build.VERSION_CODES.UPSIDE_DOWN_CAKE + 1,
+ TYPE_PARAMETER_LEGACY_SPLASH_SCREEN);
+ // Above V
+ testLegacySplashScreen(Build.VERSION_CODES.UPSIDE_DOWN_CAKE + 2, 0);
} finally {
try {
DeviceConfig.setProperties(properties);
diff --git a/services/tests/wmtests/src/com/android/server/wm/SplashScreenExceptionListTest.java b/services/tests/wmtests/src/com/android/server/wm/SplashScreenExceptionListTest.java
index 8425844..8bd5473 100644
--- a/services/tests/wmtests/src/com/android/server/wm/SplashScreenExceptionListTest.java
+++ b/services/tests/wmtests/src/com/android/server/wm/SplashScreenExceptionListTest.java
@@ -90,19 +90,23 @@
public void packageFromDeviceConfigIgnored() {
setExceptionListAndWaitForCallback("com.test.nosplashscreen1,com.test.nosplashscreen2");
- // In list, up to T included
+ // In list, up to V included
assertIsException("com.test.nosplashscreen1", VERSION_CODES.R);
assertIsException("com.test.nosplashscreen1", VERSION_CODES.S);
assertIsException("com.test.nosplashscreen1", VERSION_CODES.TIRAMISU);
+ assertIsException("com.test.nosplashscreen1", VERSION_CODES.UPSIDE_DOWN_CAKE);
+ assertIsException("com.test.nosplashscreen1", VERSION_CODES.UPSIDE_DOWN_CAKE + 1);
- // In list, after T
- assertIsNotException("com.test.nosplashscreen2", VERSION_CODES.TIRAMISU + 1);
+ // In list, after V
+ assertIsNotException("com.test.nosplashscreen2", VERSION_CODES.UPSIDE_DOWN_CAKE + 2);
assertIsNotException("com.test.nosplashscreen2", VERSION_CODES.CUR_DEVELOPMENT);
- // Not in list, up to T included
+ // Not in list, up to V included
assertIsNotException("com.test.splashscreen", VERSION_CODES.S);
assertIsNotException("com.test.splashscreen", VERSION_CODES.R);
assertIsNotException("com.test.splashscreen", VERSION_CODES.TIRAMISU);
+ assertIsNotException("com.test.splashscreen", VERSION_CODES.UPSIDE_DOWN_CAKE);
+ assertIsNotException("com.test.splashscreen", VERSION_CODES.UPSIDE_DOWN_CAKE + 1);
}
@Test
@@ -119,15 +123,19 @@
assertIsNotException(packageName, VERSION_CODES.R, activityInfo);
assertIsNotException(packageName, VERSION_CODES.S, activityInfo);
assertIsNotException(packageName, VERSION_CODES.TIRAMISU, activityInfo);
+ assertIsNotException(packageName, VERSION_CODES.UPSIDE_DOWN_CAKE, activityInfo);
+ assertIsNotException(packageName, VERSION_CODES.UPSIDE_DOWN_CAKE + 1, activityInfo);
- // Exception up to T
+ // Exception up to V
metaData.putBoolean("android.splashscreen.exception_opt_out", false);
assertIsException(packageName, VERSION_CODES.R, activityInfo);
assertIsException(packageName, VERSION_CODES.S, activityInfo);
assertIsException(packageName, VERSION_CODES.TIRAMISU, activityInfo);
+ assertIsException(packageName, VERSION_CODES.UPSIDE_DOWN_CAKE, activityInfo);
+ assertIsException(packageName, VERSION_CODES.UPSIDE_DOWN_CAKE + 1, activityInfo);
- // No Exception after T
- assertIsNotException(packageName, VERSION_CODES.TIRAMISU + 1, activityInfo);
+ // No Exception after V
+ assertIsNotException(packageName, VERSION_CODES.UPSIDE_DOWN_CAKE + 2, activityInfo);
assertIsNotException(packageName, VERSION_CODES.CUR_DEVELOPMENT, activityInfo);
// Edge Cases