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

Commit 91d382a3 authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

Get rid of some ancient logic around layouting invisible windows

The logic didn't make sense to me, so I tracked it down to a very
old CL Ie8d49fd050442ebbdcf0b805087894e3a2fc4be9. The justification
on the CL and on the bug seem outdated: Whenever a window becomes
visible, we guarantee that we do a layout with it, so any inset or
frame changes will be dispatched to the app, so we don't need to
layout it when they are invisible.

Test: go/wm-smoke
Test: Presubmit + various apps with rotation
Bug: 129389526
Change-Id: I82b5a778aba355b25e2f7aa884b47d98de5b0fc5
parent 4981f15b
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -1102,7 +1102,7 @@ final class ActivityRecord extends ConfigurationContainer {
                    ActivityTaskManagerService.getInputDispatchingTimeoutLocked(this)
                            * 1000000L, fullscreen,
                    (info.flags & FLAG_SHOW_FOR_ALL_USERS) != 0, appInfo.targetSdkVersion,
                    info.screenOrientation, mRotationAnimationHint, info.configChanges,
                    info.screenOrientation, mRotationAnimationHint,
                    mLaunchTaskBehind, isAlwaysFocusable());
            if (DEBUG_TOKEN_MOVEMENT || DEBUG_ADD_REMOVE) {
                Slog.v(TAG, "addAppToken: "
@@ -1151,11 +1151,11 @@ final class ActivityRecord extends ConfigurationContainer {
    AppWindowToken createAppWindow(WindowManagerService service, IApplicationToken token,
            boolean voiceInteraction, DisplayContent dc, long inputDispatchingTimeoutNanos,
            boolean fullscreen, boolean showForAllUsers, int targetSdk, int orientation,
            int rotationAnimationHint, int configChanges, boolean launchTaskBehind,
            int rotationAnimationHint, boolean launchTaskBehind,
            boolean alwaysFocusable) {
        return new AppWindowToken(service, token, mActivityComponent, voiceInteraction, dc,
                inputDispatchingTimeoutNanos, fullscreen, showForAllUsers, targetSdk, orientation,
                rotationAnimationHint, configChanges, launchTaskBehind, alwaysFocusable,
                rotationAnimationHint, launchTaskBehind, alwaysFocusable,
                this);
    }

+1 −3
Original line number Diff line number Diff line
@@ -153,7 +153,6 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree

    /** @see WindowContainer#fillsParent() */
    private boolean mFillsParent;
    boolean layoutConfigChanges;
    boolean mShowForAllUsers;
    int mTargetSdk;

@@ -337,7 +336,7 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
    AppWindowToken(WindowManagerService service, IApplicationToken token,
            ComponentName activityComponent, boolean voiceInteraction, DisplayContent dc,
            long inputDispatchingTimeoutNanos, boolean fullscreen, boolean showForAllUsers,
            int targetSdk, int orientation, int rotationAnimationHint, int configChanges,
            int targetSdk, int orientation, int rotationAnimationHint,
            boolean launchTaskBehind, boolean alwaysFocusable,
            ActivityRecord activityRecord) {
        this(service, token, activityComponent, voiceInteraction, dc, fullscreen);
@@ -348,7 +347,6 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
        mShowForAllUsers = showForAllUsers;
        mTargetSdk = targetSdk;
        mOrientation = orientation;
        layoutConfigChanges = (configChanges & (CONFIG_SCREEN_SIZE | CONFIG_ORIENTATION)) != 0;
        mLaunchTaskBehind = launchTaskBehind;
        mAlwaysFocusable = alwaysFocusable;
        mRotationAnimationHint = rotationAnimationHint;
+25 −33
Original line number Diff line number Diff line
@@ -671,15 +671,8 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
        // If this view is GONE, then skip it -- keep the current frame, and let the caller know
        // so they can ignore it if they want.  (We do the normal layout for INVISIBLE windows,
        // since that means "perform layout as normal, just don't display").
        if (!gone || !w.mHaveFrame || w.mLayoutNeeded
                || ((w.isConfigChanged() || w.setReportResizeHints())
                && !w.isGoneForLayoutLw() &&
                ((w.mAttrs.privateFlags & PRIVATE_FLAG_KEYGUARD) != 0 ||
                        (w.mHasSurface && w.mAppToken != null &&
                                w.mAppToken.layoutConfigChanges)))) {
            if (!w.mLayoutAttached) {
        if ((!gone || !w.mHaveFrame || w.mLayoutNeeded) && !w.mLayoutAttached) {
            if (mTmpInitial) {
                    //Slog.i(TAG, "Window " + this + " clearing mContentChanged - initial");
                w.resetContentChanged();
            }
            if (w.mAttrs.type == TYPE_DREAM) {
@@ -707,7 +700,6 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
                    + " mContainingFrame=" + w.getContainingFrame()
                    + " mDisplayFrame=" + w.getDisplayFrameLw());
        }
        }
    };

    private final Consumer<WindowState> mPerformLayoutAttached = w -> {