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

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

Merge "Fix split-screen visible apps issue when screen is rotated on lockscreen"

parents 2a0a2e01 ccb6ce2d
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1940,7 +1940,8 @@ public final class ActivityStackSupervisor implements DisplayListener {
                // static stacks need to be adjusted so they don't overlap with the docked stack.
                // We get the bounds to use from window manager which has been adjusted for any
                // screen controls and is also the same for all stacks.
                mWindowManager.getStackDockedModeBounds(HOME_STACK_ID, tempRect);
                mWindowManager.getStackDockedModeBounds(
                        HOME_STACK_ID, tempRect, true /* ignoreVisibilityOnKeyguardShowing */);
                for (int i = FIRST_STATIC_STACK_ID; i <= LAST_STATIC_STACK_ID; i++) {
                    if (StackId.isResizeableByDockedStack(i)) {
                        ActivityStack otherStack = getStack(i);
+3 −4
Original line number Diff line number Diff line
@@ -425,7 +425,7 @@ class Task implements DimLayer.DimLayerUser {
    }

    /** Original bounds of the task if applicable, otherwise fullscreen rect. */
    public void getBounds(Rect out) {
    void getBounds(Rect out) {
        if (useCurrentBounds()) {
            // No need to adjust the output bounds if fullscreen or the docked stack is visible
            // since it is already what we want to represent to the rest of the system.
@@ -433,9 +433,8 @@ class Task implements DimLayer.DimLayerUser {
            return;
        }

        // The bounds has been adjusted to accommodate for a docked stack, but the docked stack
        // is not currently visible. Go ahead a represent it as fullscreen to the rest of the
        // system.
        // The bounds has been adjusted to accommodate for a docked stack, but the docked stack is
        // not currently visible. Go ahead a represent it as fullscreen to the rest of the system.
        mStack.getDisplayContent().getLogicalDisplayRect(out);
    }

+13 −4
Original line number Diff line number Diff line
@@ -485,7 +485,7 @@ public class TaskStack implements DimLayer.DimLayerUser {
        }
    }

    void getStackDockedModeBoundsLocked(Rect outBounds) {
    void getStackDockedModeBoundsLocked(Rect outBounds, boolean ignoreVisibilityOnKeyguardShowing) {
        if (!StackId.isResizeableByDockedStack(mStackId) || mDisplayContent == null) {
            outBounds.set(mBounds);
            return;
@@ -497,11 +497,11 @@ public class TaskStack implements DimLayer.DimLayerUser {
            throw new IllegalStateException(
                    "Calling getStackDockedModeBoundsLocked() when there is no docked stack.");
        }
        if (!dockedStack.isVisibleLocked()) {
        if (!dockedStack.isVisibleLocked(ignoreVisibilityOnKeyguardShowing)) {
            // The docked stack is being dismissed, but we caught before it finished being
            // dismissed. In that case we want to treat it as if it is not occupying any space and
            // let others occupy the whole display.
            mDisplayContent.getLogicalDisplayRect(mTmpRect);
            mDisplayContent.getLogicalDisplayRect(outBounds);
            return;
        }

@@ -782,10 +782,19 @@ public class TaskStack implements DimLayer.DimLayerUser {
    }

    boolean isVisibleLocked() {
        return isVisibleLocked(false);
    }

    boolean isVisibleLocked(boolean ignoreVisibilityOnKeyguardShowing) {
        final boolean keyguardOn = mService.mPolicy.isKeyguardShowingOrOccluded();
        if (keyguardOn && !StackId.isAllowedOverLockscreen(mStackId)) {
            return false;
            // The keyguard is showing and the stack shouldn't show on top of the keyguard.
            // We return false for visibility except in cases where the caller wants us to return
            // true for visibility when the keyguard is showing. One example, is if the docked
            // is being resized due to orientation while the keyguard is on.
            return ignoreVisibilityOnKeyguardShowing;
        }

        for (int i = mTasks.size() - 1; i >= 0; i--) {
            Task task = mTasks.get(i);
            for (int j = task.mAppTokens.size() - 1; j >= 0; j--) {
+3 −2
Original line number Diff line number Diff line
@@ -4801,11 +4801,12 @@ public class WindowManagerService extends IWindowManager.Stub
        }
    }

    public void getStackDockedModeBounds(int stackId, Rect bounds) {
    public void getStackDockedModeBounds(
            int stackId, Rect bounds, boolean ignoreVisibilityOnKeyguardShowing) {
        synchronized (mWindowMap) {
            final TaskStack stack = mStackIdToStack.get(stackId);
            if (stack != null) {
                stack.getStackDockedModeBoundsLocked(bounds);
                stack.getStackDockedModeBoundsLocked(bounds, ignoreVisibilityOnKeyguardShowing);
                return;
            }
            bounds.setEmpty();