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

Commit dd11d4d6 authored by Wale Ogunwale's avatar Wale Ogunwale
Browse files

Fixed issue with resized stack sticking to the top of the screen.

WindowState.mUnderStatusBar wasn't set correctly when the stack was
resized before the window was added to it. Changed to use
TaskStack.mUnderStatusBar instead which will always have the
correct answer.

Bug: 19204013
Change-Id: Ib4660302c6a2aebd47bff354c1efab93a1e1a255
parent ad575295
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -90,12 +90,17 @@ public class TaskStack {
    // stack bounds once the stack is no longer forced to fullscreen.
    final private Rect mPreForceFullscreenBounds;

    // When true this stack is at the top of the screen and should be layed out to extend under
    // the status bar.
    boolean mUnderStatusBar;

    TaskStack(WindowManagerService service, int stackId) {
        mService = service;
        mStackId = stackId;
        mOverrideConfig = Configuration.EMPTY;
        mForceFullscreen = false;
        mPreForceFullscreenBounds = new Rect();
        mUnderStatusBar = true;
        // TODO: remove bounds from log, they are always 0.
        EventLog.writeEvent(EventLogTags.WM_STACK_CREATED, stackId, mBounds.left, mBounds.top,
                mBounds.right, mBounds.bottom);
@@ -110,8 +115,6 @@ public class TaskStack {
    }

    void resizeWindows() {
        final boolean underStatusBar = mBounds.top == 0;

        final ArrayList<WindowState> resizingWindows = mService.mResizingWindows;
        for (int taskNdx = mTasks.size() - 1; taskNdx >= 0; --taskNdx) {
            final ArrayList<AppWindowToken> activities = mTasks.get(taskNdx).mAppTokens;
@@ -124,7 +127,6 @@ public class TaskStack {
                                "setBounds: Resizing " + win);
                        resizingWindows.add(win);
                    }
                    win.mUnderStatusBar = underStatusBar;
                }
            }
        }
@@ -155,6 +157,7 @@ public class TaskStack {
        mDimLayer.setBounds(bounds);
        mAnimationBackgroundSurface.setBounds(bounds);
        mBounds.set(bounds);
        mUnderStatusBar = (mBounds.top == 0);
        updateOverrideConfiguration();
        return true;
    }
+3 −10
Original line number Diff line number Diff line
@@ -342,10 +342,6 @@ final class WindowState implements WindowManagerPolicy.WindowState {
    /** When true this window can be displayed on screens owther than mOwnerUid's */
    private boolean mShowToOwnerOnly;

    /** When true this window is at the top of the screen and should be layed out to extend under
     * the status bar */
    boolean mUnderStatusBar = true;

    WindowState(WindowManagerService service, Session s, IWindow c, WindowToken token,
           WindowState attachedWindow, int appOp, int seq, WindowManager.LayoutParams a,
           int viewVisibility, final DisplayContent displayContent) {
@@ -509,8 +505,8 @@ final class WindowState implements WindowManagerPolicy.WindowState {

        TaskStack stack = mAppToken != null ? getStack() : null;
        if (stack != null && !stack.isFullscreen()) {
            getStackBounds(stack, mContainingFrame);
            if (mUnderStatusBar) {
            stack.getBounds(mContainingFrame);
            if (stack.mUnderStatusBar) {
                mContainingFrame.top = pf.top;
            }
        } else {
@@ -808,10 +804,7 @@ final class WindowState implements WindowManagerPolicy.WindowState {
    }

    void getStackBounds(Rect bounds) {
        getStackBounds(getStack(), bounds);
    }

    private void getStackBounds(TaskStack stack, Rect bounds) {
        final TaskStack stack = getStack();
        if (stack != null) {
            stack.getBounds(bounds);
            return;