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

Commit b8d79481 authored by Wale Ogunwale's avatar Wale Ogunwale Committed by Android (Google) Code Review
Browse files

Merge "Don't relayout app contents when just changing app position"

parents 52848fcc 2cc92f55
Loading
Loading
Loading
Loading
+20 −5
Original line number Diff line number Diff line
@@ -40,6 +40,13 @@ class Task implements DimLayer.DimLayerUser {
     * when no window animation is driving it. */
    private static final int DEFAULT_DIM_DURATION = 200;

    // Return value from {@link setBounds} indicating no change was made to the Task bounds.
    static final int BOUNDS_CHANGE_NONE = 0;
    // Return value from {@link setBounds} indicating the position of the Task bounds changed.
    static final int BOUNDS_CHANGE_POSITION = 1;
    // Return value from {@link setBounds} indicating the size of the Task bounds changed.
    static final int BOUNDS_CHANGE_SIZE = 1 << 1;

    TaskStack mStack;
    final AppTokenList mAppTokens = new AppTokenList();
    final int mTaskId;
@@ -165,7 +172,7 @@ class Task implements DimLayer.DimLayerUser {
    }

    /** Set the task bounds. Passing in null sets the bounds to fullscreen. */
    boolean setBounds(Rect bounds, Configuration config) {
    int setBounds(Rect bounds, Configuration config) {
        if (config == null) {
            config = Configuration.EMPTY;
        }
@@ -190,7 +197,7 @@ class Task implements DimLayer.DimLayerUser {
                    // ensure bounds are entirely within the display rect
                    if (!bounds.intersect(mTmpRect)) {
                        // Can't set bounds outside the containing display...Sorry!
                        return false;
                        return BOUNDS_CHANGE_NONE;
                    }
                }
                mFullscreen = mTmpRect.equals(bounds);
@@ -199,17 +206,25 @@ class Task implements DimLayer.DimLayerUser {

        if (bounds == null) {
            // Can't set to fullscreen if we don't have a display to get bounds from...
            return false;
            return BOUNDS_CHANGE_NONE;
        }
        if (mBounds.equals(bounds) && oldFullscreen == mFullscreen && mRotation == rotation) {
            return false;
            return BOUNDS_CHANGE_NONE;
        }

        int boundsChange = BOUNDS_CHANGE_NONE;
        if (mBounds.left != bounds.left || mBounds.right != bounds.right) {
            boundsChange |= BOUNDS_CHANGE_POSITION;
        }
        if (mBounds.width() != bounds.width() || mBounds.height() != bounds.height()) {
            boundsChange |= BOUNDS_CHANGE_SIZE;
        }

        mBounds.set(bounds);
        mRotation = rotation;
        updateDimLayer();
        mOverrideConfig = mFullscreen ? Configuration.EMPTY : config;
        return true;
        return boundsChange;
    }

    void getBounds(Rect out) {
+6 −2
Original line number Diff line number Diff line
@@ -4638,8 +4638,12 @@ public class WindowManagerService extends IWindowManager.Stub
                throw new IllegalArgumentException("resizeTask: taskId " + taskId
                        + " not found.");
            }
            if (task.setBounds(bounds, configuration)) {
            final int boundsChanged = task.setBounds(bounds, configuration);
            if (boundsChanged != Task.BOUNDS_CHANGE_NONE) {
                if ((boundsChanged & Task.BOUNDS_CHANGE_SIZE) == Task.BOUNDS_CHANGE_SIZE) {
                    task.resizeWindows();
                }

                if (relayout) {
                    task.getDisplayContent().layoutNeeded = true;
                    mWindowPlacerLocked.performSurfacePlacement();