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

Commit 60cdb18a authored by Evan Rosky's avatar Evan Rosky Committed by Android (Google) Code Review
Browse files

Merge "Don't send configuration updates to apps that are going-away" into sc-dev

parents 9741311b e3f5afaf
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -6528,7 +6528,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        // Allowing closing {@link ActivityRecord} to participate can lead to an Activity in another
        // task being started in the wrong orientation during the transition.
        if (!getDisplayContent().mClosingApps.contains(this)
                && (isVisible() || getDisplayContent().mOpeningApps.contains(this))) {
                && (isVisibleRequested() || getDisplayContent().mOpeningApps.contains(this))) {
            return mOrientation;
        }

+4 −2
Original line number Diff line number Diff line
@@ -952,7 +952,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
        }

        final ActivityRecord activity = w.mActivityRecord;
        if (activity != null) {
        if (activity != null && activity.isVisibleRequested()) {
            activity.updateLetterboxSurface(w);
            final boolean updateAllDrawn = activity.updateDrawnWindowStates(w);
            if (updateAllDrawn && !mTmpUpdateAllDrawn.contains(activity)) {
@@ -1451,7 +1451,9 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
            }
            config = new Configuration();
            computeScreenConfiguration(config);
        } else if (currentConfig != null) {
        } else if (currentConfig != null
                // If waiting for a remote rotation, don't prematurely update configuration.
                && !mDisplayRotation.isWaitingForRemoteRotation()) {
            // No obvious action we need to take, but if our current state mismatches the
            // activity manager's, update it, disregarding font scale, which should remain set
            // to the value of the previous configuration.
+2 −2
Original line number Diff line number Diff line
@@ -481,12 +481,12 @@ public class DisplayRotation {

        mRotation = rotation;

        mDisplayContent.setLayoutNeeded();

        mService.mWindowsFreezingScreen = WINDOWS_FREEZING_SCREENS_ACTIVE;
        mService.mH.sendNewMessageDelayed(WindowManagerService.H.WINDOW_FREEZE_TIMEOUT,
                mDisplayContent, WINDOW_FREEZE_TIMEOUT_DURATION);

        mDisplayContent.setLayoutNeeded();

        if (shouldRotateSeamlessly(oldRotation, rotation, forceUpdate)) {
            // The screen rotation animation uses a screenshot to freeze the screen while windows
            // resize underneath. When we are rotating seamlessly, we allow the elements to
+9 −3
Original line number Diff line number Diff line
@@ -1721,7 +1721,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP

    @Override
    boolean isVisibleRequested() {
        return isVisible();
        return isVisible() && (mActivityRecord == null || mActivityRecord.isVisibleRequested());
    }

    /**
@@ -2132,7 +2132,8 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
                && !mAnimatingExit
                && (mWindowFrames.mRelFrame.top != mWindowFrames.mLastRelFrame.top
                    || mWindowFrames.mRelFrame.left != mWindowFrames.mLastRelFrame.left)
                && (!mIsChildWindow || !getParentWindow().hasMoved());
                && (!mIsChildWindow || !getParentWindow().hasMoved())
                && !mWmService.mAtmService.getTransitionController().isCollecting();
    }

    boolean isObscuringDisplay() {
@@ -3635,6 +3636,11 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
        if (mActivityRecord != null && mActivityRecord.isRelaunching()) {
            return;
        }
        // If the activity is invisible or going invisible, don't report either since it is going
        // away. This is likely during a transition so we want to preserve the original state.
        if (mActivityRecord != null && !mActivityRecord.isVisibleRequested()) {
            return;
        }

        if (Trace.isTagEnabled(TRACE_TAG_WINDOW_MANAGER)) {
            Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "wm.reportResized_" + getWindowTag());
@@ -5304,7 +5310,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
        updateSurfacePositionNonOrganized();
        // Send information to SufaceFlinger about the priority of the current window.
        updateFrameRateSelectionPriorityIfNeeded();
        updateGlobalScaleIfNeeded();
        if (isVisibleRequested()) updateGlobalScaleIfNeeded();

        mWinAnimator.prepareSurfaceLocked(getSyncTransaction());
        super.prepareSurfaces();
+2 −1
Original line number Diff line number Diff line
@@ -96,6 +96,8 @@ public class ActivityMetricsLaunchObserverTests extends WindowTestsBase {
                .setTask(mTrampolineActivity.getTask())
                .setComponent(createRelative(DEFAULT_COMPONENT_PACKAGE_NAME, "TopActivity"))
                .build();
        // becomes invisible when covered by mTopActivity
        mTrampolineActivity.mVisibleRequested = false;
    }

    @After
@@ -230,7 +232,6 @@ public class ActivityMetricsLaunchObserverTests extends WindowTestsBase {

    @Test
    public void testOnActivityLaunchCancelled_finishedBeforeDrawn() {
        mTopActivity.mVisibleRequested = true;
        doReturn(true).when(mTopActivity).isReportedDrawn();

        // Create an activity with different process that meets process switch.
Loading