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

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

Merge "Fixed bug with task record not updating to fullscreen sometimes"

parents f58f540f b4ec0a31
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -3124,6 +3124,14 @@ public final class ActivityStackSupervisor implements DisplayListener {
        Trace.traceBegin(TRACE_TAG_ACTIVITY_MANAGER, "am.resizeStack_" + stackId);
        mWindowManager.deferSurfaceLayout();
        try {

            if (bounds != null && mWindowManager.isFullscreenBounds(stackId, bounds)) {
                // The bounds passed in corresponds to the fullscreen bounds which we normally
                // represent with null. Go ahead and set it to null so that all tasks configuration
                // can have the right fullscreen state.
                bounds = null;
            }

            ActivityRecord r = stack.topRunningActivityLocked();

            mTmpBounds.clear();
+8 −0
Original line number Diff line number Diff line
@@ -144,6 +144,14 @@ public class TaskStack implements DimLayer.DimLayerUser {
        return true;
    }

    boolean isFullscreenBounds(Rect bounds) {
        if (mDisplayContent == null || bounds == null) {
            return true;
        }
        mDisplayContent.getLogicalDisplayRect(mTmpRect);
        return mTmpRect.equals(bounds);
    }

    private boolean setBounds(Rect bounds) {
        boolean oldFullscreen = mFullscreen;
        int rotation = Surface.ROTATION_0;
+11 −1
Original line number Diff line number Diff line
@@ -459,7 +459,6 @@ public class WindowManagerService extends IWindowManager.Stub
    EmulatorDisplayOverlay mEmulatorDisplayOverlay;

    final float[] mTmpFloats = new float[9];
    final Rect mTmpContentRect = new Rect();

    boolean mDisplayReady;
    boolean mSafeMode;
@@ -4830,6 +4829,17 @@ public class WindowManagerService extends IWindowManager.Stub
        }
    }

    /** Returns true if the input bounds corresponds to the fullscreen bounds the stack is on. */
    public boolean isFullscreenBounds(int stackId, Rect bounds) {
        synchronized (mWindowMap) {
            final TaskStack stack = mStackIdToStack.get(stackId);
            if (stack == null || bounds == null) {
                return true;
            }
            return stack.isFullscreenBounds(bounds);
        }
    }

    /**
     * Re-sizes a stack and its containing tasks.
     * @param stackId Id of stack to resize.
+3 −2
Original line number Diff line number Diff line
@@ -96,6 +96,7 @@ class WindowSurfacePlacer {
    private long mUserActivityTimeout = -1;
    private boolean mUpdateRotation = false;
    private final Rect mTmpStartRect = new Rect();
    private final Rect mTmpContentRect = new Rect();

    // Set to true when the display contains content to show the user.
    // When false, the display manager may choose to mirror or blank the display.
@@ -862,8 +863,8 @@ class WindowSurfacePlacer {
            mService.mScreenRect.set(0, 0, dw, dh);
        }

        mService.mPolicy.getContentRectLw(mService.mTmpContentRect);
        displayContent.resize(mService.mTmpContentRect);
        mService.mPolicy.getContentRectLw(mTmpContentRect);
        displayContent.resize(mTmpContentRect);

        int seq = mService.mLayoutSeq+1;
        if (seq < 0) seq = 0;