Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 42c7272d authored by Wei Sheng Shih's avatar Wei Sheng Shih Committed by Automerger Merge Worker
Browse files

Merge "Extend splash screen exception list to V." into udc-dev am: f80ef935...

Merge "Extend splash screen exception list to V." into udc-dev am: f80ef935 am: 2d289616 am: c302d9b4

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23551701



Change-Id: I48951cd3b51e20f31c8b18c058477a27f5fd825e
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 0081bd9d c302d9b4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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,
                    () -> {
+2 −2
Original line number Diff line number Diff line
@@ -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;
        }

+6 −2
Original line number Diff line number Diff line
@@ -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);
+15 −7
Original line number Diff line number Diff line
@@ -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