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

Commit 6db6679a authored by Chavi Weingarten's avatar Chavi Weingarten Committed by Android (Google) Code Review
Browse files

Merge changes from topic "fixTurnOnScreen"

* changes:
  Remove TURN_ON_SCREEN from bulkUpdate and set mTurnOnScreen.
  Revert "Revert "Call prepareSurfaces in applySurfacesChangesTransaction""
  Revert "Revert "Revert "Revert "Avoid setting size/position on Transaction if not needed""""
parents 716fe76e 042059d0
Loading
Loading
Loading
Loading
+2 −34
Original line number Diff line number Diff line
@@ -342,9 +342,6 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
            new TaskForResizePointSearchResult();
    private final ApplySurfaceChangesTransactionState mTmpApplySurfaceChangesTransactionState =
            new ApplySurfaceChangesTransactionState();
    private final ScreenshotApplicationState mScreenshotApplicationState =
            new ScreenshotApplicationState();
    private final Transaction mTmpTransaction = new Transaction();

    // True if this display is in the process of being removed. Used to determine if the removal of
    // the display's direct children should be allowed.
@@ -661,10 +658,7 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
            mWallpaperController.updateWallpaperVisibility();
        }

        // Use mTmpTransaction instead of mPendingTransaction because we don't want to commit
        // other changes in mPendingTransaction at this point.
        w.handleWindowMovedIfNeeded(mTmpTransaction);
        SurfaceControl.mergeToGlobalTransaction(mTmpTransaction);
        w.handleWindowMovedIfNeeded(mPendingTransaction);

        final WindowStateAnimator winAnimator = w.mWinAnimator;

@@ -699,33 +693,6 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
                    }
                }
            }
            final TaskStack stack = w.getStack();
            if (!winAnimator.isWaitingForOpening()
                    || (stack != null && stack.isAnimatingBounds())) {
                // Updates the shown frame before we set up the surface. This is needed
                // because the resizing could change the top-left position (in addition to
                // size) of the window. setSurfaceBoundariesLocked uses mShownPosition to
                // position the surface.
                //
                // If an animation is being started, we can't call this method because the
                // animation hasn't processed its initial transformation yet, but in general
                // we do want to update the position if the window is animating. We make an exception
                // for the bounds animating state, where an application may have been waiting
                // for an exit animation to start, but instead enters PiP. We need to ensure
                // we always recompute the top-left in this case.
                winAnimator.computeShownFrameLocked();
            }
            winAnimator.setSurfaceBoundariesLocked(mTmpRecoveringMemory /* recoveringMemory */);

            // Since setSurfaceBoundariesLocked applies the clipping, we need to apply the position
            // to the surface of the window container and also the position of the stack window
            // container as well. Use mTmpTransaction instead of mPendingTransaction to avoid
            // committing any existing changes in there.
            w.updateSurfacePosition(mTmpTransaction);
            if (stack != null) {
                stack.updateSurfaceBounds(mTmpTransaction);
            }
            SurfaceControl.mergeToGlobalTransaction(mTmpTransaction);
        }

        final AppWindowToken atoken = w.mAppToken;
@@ -2845,6 +2812,7 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo

        mTmpRecoveringMemory = recoveringMemory;
        forAllWindows(mApplySurfaceChangesTransaction, true /* traverseTopToBottom */);
        prepareSurfaces();

        mService.mDisplayManagerInternal.setDisplayProperties(mDisplayId,
                mTmpApplySurfaceChangesTransactionState.displayHasContent,
+1 −4
Original line number Diff line number Diff line
@@ -86,7 +86,6 @@ import static com.android.server.wm.WindowManagerService.H.WINDOW_FREEZE_TIMEOUT
import static com.android.server.wm.WindowManagerService.logSurface;
import static com.android.server.wm.WindowSurfacePlacer.SET_FORCE_HIDING_CHANGED;
import static com.android.server.wm.WindowSurfacePlacer.SET_ORIENTATION_CHANGE_COMPLETE;
import static com.android.server.wm.WindowSurfacePlacer.SET_TURN_ON_SCREEN;
import static com.android.server.wm.WindowSurfacePlacer.SET_UPDATE_ROTATION;
import static com.android.server.wm.WindowSurfacePlacer.SET_WALLPAPER_ACTION_PENDING;
import static com.android.server.wm.WindowSurfacePlacer.SET_WALLPAPER_MAY_CHANGE;
@@ -968,9 +967,7 @@ class RootWindowContainer extends WindowContainer<DisplayContent> {
                doRequest = true;
            }
        }
        if ((bulkUpdateParams & SET_TURN_ON_SCREEN) != 0) {
            mService.mTurnOnScreen = true;
        }

        if ((bulkUpdateParams & SET_WALLPAPER_ACTION_PENDING) != 0) {
            mWallpaperActionPending = true;
        }
+9 −1
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@ import static com.android.server.wm.proto.StackProto.WINDOW_CONTAINER;

import android.annotation.CallSuper;
import android.content.res.Configuration;
import android.graphics.Point;
import android.graphics.Rect;
import android.graphics.Region;
import android.os.RemoteException;
@@ -150,6 +151,7 @@ public class TaskStack extends WindowContainer<Task> implements
     * For {@link #prepareSurfaces}.
     */
    final Rect mTmpDimBoundsRect = new Rect();
    private final Point mLastSurfaceSize = new Point();

    TaskStack(WindowManagerService service, int stackId, StackWindowController controller) {
        super(service);
@@ -749,7 +751,13 @@ public class TaskStack extends WindowContainer<Task> implements
        }

        final Rect stackBounds = getBounds();
        transaction.setSize(mSurfaceControl, stackBounds.width(), stackBounds.height());
        final int width = stackBounds.width();
        final int height = stackBounds.height();
        if (width == mLastSurfaceSize.x && height == mLastSurfaceSize.y) {
            return;
        }
        transaction.setSize(mSurfaceControl, width, height);
        mLastSurfaceSize.set(width, height);
    }

    @Override
+0 −3
Original line number Diff line number Diff line
@@ -292,9 +292,6 @@ public class WindowAnimator {
        if ((bulkUpdateParams & WindowSurfacePlacer.SET_ORIENTATION_CHANGE_COMPLETE) != 0) {
            builder.append(" ORIENTATION_CHANGE_COMPLETE");
        }
        if ((bulkUpdateParams & WindowSurfacePlacer.SET_TURN_ON_SCREEN) != 0) {
            builder.append(" TURN_ON_SCREEN");
        }
        return builder.toString();
    }

+6 −0
Original line number Diff line number Diff line
@@ -95,6 +95,7 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
    protected final WindowManagerService mService;

    private final Point mTmpPos = new Point();
    protected final Point mLastSurfacePosition = new Point();

    /** Total number of elements in this subtree, including our own hierarchy element. */
    private int mTreeWeight = 1;
@@ -1179,7 +1180,12 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
        }

        getRelativePosition(mTmpPos);
        if (mTmpPos.equals(mLastSurfacePosition)) {
            return;
        }

        transaction.setPosition(mSurfaceControl, mTmpPos.x, mTmpPos.y);
        mLastSurfacePosition.set(mTmpPos.x, mTmpPos.y);

        for (int i = mChildren.size() - 1; i >= 0; i--) {
            mChildren.get(i).updateSurfacePosition(transaction);
Loading