Merge "Extend splash screen exception list to V." into udc-dev am: f80ef93530 am: 2d2896162b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23551701 Change-Id: If6b67fbc962acc69f260847931b6bd8360b89604 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -2425,7 +2425,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
|
||||
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,
|
||||
() -> {
|
||||
|
||||
@@ -70,7 +70,7 @@ class SplashScreenExceptionList {
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 @@ class SplashScreenExceptionList {
|
||||
@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;
|
||||
}
|
||||
|
||||
|
||||
@@ -2784,8 +2784,12 @@ public class ActivityRecordTests extends WindowTestsBase {
|
||||
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);
|
||||
|
||||
@@ -90,19 +90,23 @@ public class SplashScreenExceptionListTest {
|
||||
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 @@ public class SplashScreenExceptionListTest {
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user