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

Commit 64e4cee4 authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Remove unused frozenBeforeDestroy

Except shell transition doesn't use the state, legacy transition
also relies on checkAppWindowsReadyToShow->stopFreezingScreen
instead of the field.

Bug: 163976519
Test: CtsWindowManagerDeviceActivity
Change-Id: Idf328fbf487807d880d415561f602c53dc1d8aa0
parent c7f210a6
Loading
Loading
Loading
Loading
+1 −24
Original line number Diff line number Diff line
@@ -562,7 +562,6 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
    boolean mClientVisibilityDeferred;// was the visibility change message to client deferred?
    boolean idle;           // has the activity gone idle?
    boolean hasBeenLaunched;// has this activity ever been launched?
    boolean frozenBeforeDestroy;// has been frozen but not yet destroyed.
    boolean immersive;      // immersive mode (don't interrupt if possible)
    boolean forceNewConfig; // force re-create with new config next time
    boolean supportsEnterPipOnTaskSwitch;  // This flag is set by the system to indicate that the
@@ -1201,8 +1200,6 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
                pw.print(" noDisplay="); pw.print(noDisplay);
                pw.print(" immersive="); pw.print(immersive);
                pw.print(" launchMode="); pw.println(launchMode);
        pw.print(prefix); pw.print("frozenBeforeDestroy="); pw.print(frozenBeforeDestroy);
                pw.print(" forceNewConfig="); pw.println(forceNewConfig);
        pw.print(prefix); pw.print("mActivityType=");
                pw.println(activityTypeToString(getActivityType()));
        pw.print(prefix); pw.print("mImeInsetsFrozenUntilStartInput=");
@@ -3848,7 +3845,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        // updated for restoring original orientation of the display.
        if (next == null) {
            mRootWindowContainer.ensureVisibilityAndConfig(next, getDisplayId(),
                    false /* markFrozenIfConfigChanged */, true /* deferResume */);
                    true /* deferResume */);
        }
        if (activityRemoved) {
            mRootWindowContainer.resumeFocusedTasksTopActivities();
@@ -4090,7 +4087,6 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        cleanUpSplashScreen();

        deferRelaunchUntilPaused = false;
        frozenBeforeDestroy = false;

        if (setState) {
            setState(DESTROYED, "cleanUp");
@@ -6276,7 +6272,6 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
    }

    void handleAlreadyVisible() {
        stopFreezingScreenLocked(false);
        try {
            if (returningOptions != null) {
                app.getThread().scheduleOnNewActivityOptions(token, returningOptions.toBundle());
@@ -6710,19 +6705,6 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        stopFreezingScreen(true, true);
    }

    void stopFreezingScreenLocked(boolean force) {
        if (force || frozenBeforeDestroy) {
            frozenBeforeDestroy = false;
            if (getParent() == null) {
                return;
            }
            ProtoLog.v(WM_DEBUG_ORIENTATION,
                        "Clear freezing of %s: visible=%b freezing=%b", token,
                                isVisible(), isFreezingScreen());
            stopFreezingScreen(true, force);
        }
    }

    void stopFreezingScreen(boolean unfreezeSurfaceNow, boolean force) {
        if (!mFreezingScreen) {
            return;
@@ -9569,7 +9551,6 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        if (finishing) {
            ProtoLog.v(WM_DEBUG_CONFIGURATION, "Configuration doesn't matter "
                    + "in finishing %s", this);
            stopFreezingScreenLocked(false);
            return true;
        }

@@ -9660,7 +9641,6 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        // pick that up next time it starts.
        if (!attachedToProcess()) {
            ProtoLog.v(WM_DEBUG_CONFIGURATION, "Configuration doesn't matter not running %s", this);
            stopFreezingScreenLocked(false);
            forceNewConfig = false;
            return true;
        }
@@ -9723,9 +9703,6 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        }
        notifyDisplayCompatPolicyAboutConfigurationChange(
                mLastReportedConfiguration.getMergedConfiguration(), mTmpConfig);

        stopFreezingScreenLocked(false);

        return true;
    }

+1 −2
Original line number Diff line number Diff line
@@ -1548,8 +1548,7 @@ class ActivityStarter {
        final ActivityRecord currentTop = startedActivityRootTask.topRunningActivity();
        if (currentTop != null && currentTop.shouldUpdateConfigForDisplayChanged()) {
            mRootWindowContainer.ensureVisibilityAndConfig(
                    currentTop, currentTop.getDisplayId(),
                    true /* markFrozenIfConfigChanged */, false /* deferResume */);
                    currentTop, currentTop.getDisplayId(), false /* deferResume */);
        }

        if (!mAvoidMoveToFront && mDoResume && mRootWindowContainer
+1 −1
Original line number Diff line number Diff line
@@ -843,7 +843,7 @@ public class ActivityTaskSupervisor implements RecentTasks.Callbacks {
                // We don't want to perform a redundant launch of the same record while ensuring
                // configurations and trying to resume top activity of focused root task.
                mRootWindowContainer.ensureVisibilityAndConfig(r, r.getDisplayId(),
                        false /* markFrozenIfConfigChanged */, true /* deferResume */);
                        true /* deferResume */);
            }

            if (mKeyguardController.checkKeyguardVisibility(r) && r.allowMoveToFront()) {
+0 −1
Original line number Diff line number Diff line
@@ -1695,7 +1695,6 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
            final ActivityRecord activityRecord = (ActivityRecord) requestingContainer;
            final boolean kept = updateDisplayOverrideConfigurationLocked(config, activityRecord,
                    false /* deferResume */, null /* result */);
            activityRecord.frozenBeforeDestroy = true;
            if (!kept) {
                mRootWindowContainer.resumeFocusedTasksTopActivities();
            }
+1 −7
Original line number Diff line number Diff line
@@ -1741,14 +1741,11 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
     * @param starting                  The currently starting activity or {@code null} if there is
     *                                  none.
     * @param displayId                 The id of the display where operation is executed.
     * @param markFrozenIfConfigChanged Whether to set {@link ActivityRecord#frozenBeforeDestroy} to
     *                                  {@code true} if config changed.
     * @param deferResume               Whether to defer resume while updating config.
     * @return 'true' if starting activity was kept or wasn't provided, 'false' if it was relaunched
     * because of configuration update.
     */
    boolean ensureVisibilityAndConfig(ActivityRecord starting, int displayId,
            boolean markFrozenIfConfigChanged, boolean deferResume) {
    boolean ensureVisibilityAndConfig(ActivityRecord starting, int displayId, boolean deferResume) {
        // First ensure visibility without updating the config just yet. We need this to know what
        // activities are affecting configuration now.
        // Passing null here for 'starting' param value, so that visibility of actual starting
@@ -1774,9 +1771,6 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
        if (starting != null) {
            starting.reportDescendantOrientationChangeIfNeeded();
        }
        if (starting != null && markFrozenIfConfigChanged && config != null) {
            starting.frozenBeforeDestroy = true;
        }

        if (displayContent != null) {
            // Update the configuration of the activities on the display.
Loading