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

Commit bdcf13a1 authored by wilsonshih's avatar wilsonshih
Browse files

Post clean up starting window related data.

When Core request to add another starting window to the same task, shell
will remove previous starting window if any. Also clear related data
so the mStartingData won't be reused to create another starting window.

Bug: 341054451
Test: atest ActivityRecordTests
Change-Id: Ibc507a9cf841d620c3c53a57da4becdd4ef1a491
parent ec19f1f4
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -7642,6 +7642,8 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
            // This could only happen when the window is removed from hierarchy. So do not keep its
            // reference anymore.
            mStartingWindow = null;
            mStartingData = null;
            mStartingSurface = null;
        }
        if (mChildren.size() == 0 && mVisibleSetFromTransferredStartingWindow) {
            // We set the visible state to true for the token from a transferred starting
+13 −0
Original line number Diff line number Diff line
@@ -2745,6 +2745,19 @@ public class ActivityRecordTests extends WindowTestsBase {
        assertNoStartingWindow(activity);
    }

    @Test
    public void testPostCleanupStartingWindow() {
        registerTestStartingWindowOrganizer();
        final ActivityRecord activity = new ActivityBuilder(mAtm).setCreateTask(true).build();
        activity.addStartingWindow(mPackageName, android.R.style.Theme, null, true, true, false,
                true, false, false, false);
        waitUntilHandlersIdle();
        assertHasStartingWindow(activity);
        // Simulate Shell remove starting window actively.
        activity.mStartingWindow.removeImmediately();
        assertNoStartingWindow(activity);
    }

    private void testLegacySplashScreen(int targetSdk, int verifyType) {
        final ActivityRecord activity = new ActivityBuilder(mAtm).setCreateTask(true).build();
        activity.mTargetSdk = targetSdk;