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

Commit 1ee84ea6 authored by Yunfan Chen's avatar Yunfan Chen
Browse files

Remove AppWindowContainerController and AppWindowContainerListener (39/n)

AppWindowToken and ActivityRecord will hold each other as a member and
call directly into the other. Unnecessary locks are removed.

All AppWindowContainerControllerTests moved to AppWindowTokenTests.
Three of the tests needs other works of the hierarchy which can be added
back later. Commented out with a TODO.

Bug: 80414790
Test: go/wm-smoke
Test: atest ActivityRecordTests
Test: atest AppWindowTokenTests
Test: atest FrameworksServicesTests:AppTransitionTests
Test: atest ActivityStackSupervisorTests
Test: atest ActivityStackTests
Change-Id: Ifa1f692f5c54dbffc3758bd26de124e7d055e0ab
parent 7bde4e9a
Loading
Loading
Loading
Loading
+318 −53

File changed.

Preview size limit exceeded, changes collapsed.

+4 −3
Original line number Diff line number Diff line
@@ -3043,7 +3043,7 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai
                    if (!startIt) {
                        if (DEBUG_ADD_REMOVE) Slog.i(TAG, "Adding activity " + r + " to task "
                                + task, new RuntimeException("here").fillInStackTrace());
                        r.createWindowContainer();
                        r.createAppWindowToken();
                        ActivityOptions.abort(options);
                        return;
                    }
@@ -3073,9 +3073,10 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai
        // TODO: Need to investigate if it is okay for the controller to already be created by the
        // time we get to this point. I think it is, but need to double check.
        // Use test in b/34179495 to trace the call path.
        if (r.getWindowContainerController() == null) {
            r.createWindowContainer();
        if (r.mAppWindowToken == null) {
            r.createAppWindowToken();
        }

        task.setFrontOfTask();

        if (!isHomeOrRecentsStack() || numActivities() > 0) {
+1 −1
Original line number Diff line number Diff line
@@ -3174,7 +3174,7 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D
                "Added restored task=" + task + " to stack=" + stack);
        final ArrayList<ActivityRecord> activities = task.mActivities;
        for (int activityNdx = activities.size() - 1; activityNdx >= 0; --activityNdx) {
            activities.get(activityNdx).createWindowContainer();
            activities.get(activityNdx).createAppWindowToken();
        }
        return true;
    }
+4 −5
Original line number Diff line number Diff line
@@ -305,7 +305,7 @@ public class AppTransitionController {
            AppWindowToken wtoken = openingApps.valueAt(i);
            if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, "Now opening app" + wtoken);

            if (!wtoken.setVisibility(animLp, true, transit, false, voiceInteraction)) {
            if (!wtoken.commitVisibility(animLp, true, transit, false, voiceInteraction)) {
                // This token isn't going to be animating. Add it to the list of tokens to
                // be notified of app transition complete since the notification will not be
                // sent be the app window animator.
@@ -341,7 +341,7 @@ public class AppTransitionController {
            if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, "Now closing app " + wtoken);
            // TODO: Do we need to add to mNoAnimationNotifyOnTransitionFinished like above if not
            //       animating?
            wtoken.setVisibility(animLp, false, transit, false, voiceInteraction);
            wtoken.commitVisibility(animLp, false, transit, false, voiceInteraction);
            wtoken.updateReportedVisibilityLocked();
            // Force the allDrawn flag, because we want to start
            // this guy's animations regardless of whether it's
@@ -350,9 +350,8 @@ public class AppTransitionController {
            wtoken.deferClearAllDrawn = false;
            // Ensure that apps that are mid-starting are also scheduled to have their
            // starting windows removed after the animation is complete
            if (wtoken.startingWindow != null && !wtoken.startingWindow.mAnimatingExit
                    && wtoken.getController() != null) {
                wtoken.getController().removeStartingWindow();
            if (wtoken.startingWindow != null && !wtoken.startingWindow.mAnimatingExit) {
                wtoken.removeStartingWindow();
            }

            if (mDisplayContent.mAppTransition.isNextAppTransitionThumbnailDown()) {
+0 −912

File deleted.

Preview size limit exceeded, changes collapsed.

Loading