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

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

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

parents f33c833c dd11d4d6
Loading
Loading
Loading
Loading
+6 −3
Original line number Original line Diff line number Diff line
@@ -90,12 +90,17 @@ public class TaskStack {
    // stack bounds once the stack is no longer forced to fullscreen.
    // stack bounds once the stack is no longer forced to fullscreen.
    final private Rect mPreForceFullscreenBounds;
    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) {
    TaskStack(WindowManagerService service, int stackId) {
        mService = service;
        mService = service;
        mStackId = stackId;
        mStackId = stackId;
        mOverrideConfig = Configuration.EMPTY;
        mOverrideConfig = Configuration.EMPTY;
        mForceFullscreen = false;
        mForceFullscreen = false;
        mPreForceFullscreenBounds = new Rect();
        mPreForceFullscreenBounds = new Rect();
        mUnderStatusBar = true;
        // TODO: remove bounds from log, they are always 0.
        // TODO: remove bounds from log, they are always 0.
        EventLog.writeEvent(EventLogTags.WM_STACK_CREATED, stackId, mBounds.left, mBounds.top,
        EventLog.writeEvent(EventLogTags.WM_STACK_CREATED, stackId, mBounds.left, mBounds.top,
                mBounds.right, mBounds.bottom);
                mBounds.right, mBounds.bottom);
@@ -110,8 +115,6 @@ public class TaskStack {
    }
    }


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

        final ArrayList<WindowState> resizingWindows = mService.mResizingWindows;
        final ArrayList<WindowState> resizingWindows = mService.mResizingWindows;
        for (int taskNdx = mTasks.size() - 1; taskNdx >= 0; --taskNdx) {
        for (int taskNdx = mTasks.size() - 1; taskNdx >= 0; --taskNdx) {
            final ArrayList<AppWindowToken> activities = mTasks.get(taskNdx).mAppTokens;
            final ArrayList<AppWindowToken> activities = mTasks.get(taskNdx).mAppTokens;
@@ -124,7 +127,6 @@ public class TaskStack {
                                "setBounds: Resizing " + win);
                                "setBounds: Resizing " + win);
                        resizingWindows.add(win);
                        resizingWindows.add(win);
                    }
                    }
                    win.mUnderStatusBar = underStatusBar;
                }
                }
            }
            }
        }
        }
@@ -155,6 +157,7 @@ public class TaskStack {
        mDimLayer.setBounds(bounds);
        mDimLayer.setBounds(bounds);
        mAnimationBackgroundSurface.setBounds(bounds);
        mAnimationBackgroundSurface.setBounds(bounds);
        mBounds.set(bounds);
        mBounds.set(bounds);
        mUnderStatusBar = (mBounds.top == 0);
        updateOverrideConfiguration();
        updateOverrideConfiguration();
        return true;
        return true;
    }
    }
+3 −10
Original line number Original line 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 */
    /** When true this window can be displayed on screens owther than mOwnerUid's */
    private boolean mShowToOwnerOnly;
    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(WindowManagerService service, Session s, IWindow c, WindowToken token,
           WindowState attachedWindow, int appOp, int seq, WindowManager.LayoutParams a,
           WindowState attachedWindow, int appOp, int seq, WindowManager.LayoutParams a,
           int viewVisibility, final DisplayContent displayContent) {
           int viewVisibility, final DisplayContent displayContent) {
@@ -509,8 +505,8 @@ final class WindowState implements WindowManagerPolicy.WindowState {


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


    void getStackBounds(Rect bounds) {
    void getStackBounds(Rect bounds) {
        getStackBounds(getStack(), bounds);
        final TaskStack stack = getStack();
    }

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