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

Commit 43521764 authored by Robert Carr's avatar Robert Carr
Browse files

Deobfuscate computeFrameLw parameters.

I've always thought this added an extra barrier
to understanding an already confusing method.

Test: Just variable renaming.
Change-Id: If8232b9094c9d3487fa6c4443f5742ce75085772
parent 16a4e3cb
Loading
Loading
Loading
Loading
+27 −26
Original line number Original line Diff line number Diff line
@@ -689,8 +689,9 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
    }
    }


    @Override
    @Override
    public void computeFrameLw(Rect pf, Rect df, Rect of, Rect cf, Rect vf, Rect dcf, Rect sf,
    public void computeFrameLw(Rect parentFrame, Rect displayFrame, Rect overscanFrame,
            Rect osf) {
            Rect contentFrame, Rect visibleFrame, Rect decorFrame, Rect stableFrame,
            Rect outsetFrame) {
        if (mWillReplaceWindow && (mAnimatingExit || !mReplacingRemoveRequested)) {
        if (mWillReplaceWindow && (mAnimatingExit || !mReplacingRemoveRequested)) {
            // This window is being replaced and either already got information that it's being
            // This window is being replaced and either already got information that it's being
            // removed or we are still waiting for some information. Because of this we don't
            // removed or we are still waiting for some information. Because of this we don't
@@ -726,10 +727,10 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
        final int layoutYDiff;
        final int layoutYDiff;
        if (fullscreenTask || layoutInParentFrame()) {
        if (fullscreenTask || layoutInParentFrame()) {
            // We use the parent frame as the containing frame for fullscreen and child windows
            // We use the parent frame as the containing frame for fullscreen and child windows
            mContainingFrame.set(pf);
            mContainingFrame.set(parentFrame);
            mDisplayFrame.set(df);
            mDisplayFrame.set(displayFrame);
            layoutDisplayFrame = df;
            layoutDisplayFrame = displayFrame;
            layoutContainingFrame = pf;
            layoutContainingFrame = parentFrame;
            layoutXDiff = 0;
            layoutXDiff = 0;
            layoutYDiff = 0;
            layoutYDiff = 0;
        } else {
        } else {
@@ -745,15 +746,15 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
            final WindowState imeWin = mService.mInputMethodWindow;
            final WindowState imeWin = mService.mInputMethodWindow;
            // IME is up and obscuring this window. Adjust the window position so it is visible.
            // IME is up and obscuring this window. Adjust the window position so it is visible.
            if (imeWin != null && imeWin.isVisibleNow() && mService.mInputMethodTarget == this) {
            if (imeWin != null && imeWin.isVisibleNow() && mService.mInputMethodTarget == this) {
                    if (windowsAreFloating && mContainingFrame.bottom > cf.bottom) {
                    if (windowsAreFloating && mContainingFrame.bottom > contentFrame.bottom) {
                        // In freeform we want to move the top up directly.
                        // In freeform we want to move the top up directly.
                        // TODO: Investigate why this is cf not pf.
                        // TODO: Investigate why this is contentFrame not parentFrame.
                        mContainingFrame.top -= mContainingFrame.bottom - cf.bottom;
                        mContainingFrame.top -= mContainingFrame.bottom - contentFrame.bottom;
                    } else if (mContainingFrame.bottom > pf.bottom) {
                    } else if (mContainingFrame.bottom > parentFrame.bottom) {
                        // But in docked we want to behave like fullscreen
                        // But in docked we want to behave like fullscreen
                        // and behave as if the task were given smaller bounds
                        // and behave as if the task were given smaller bounds
                        // for the purposes of layout.
                        // for the purposes of layout.
                        mContainingFrame.bottom = pf.bottom;
                        mContainingFrame.bottom = parentFrame.bottom;
                    }
                    }
            }
            }


@@ -762,7 +763,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
                // if it wasn't set already. No need to intersect it with the (visible)
                // if it wasn't set already. No need to intersect it with the (visible)
                // "content frame" since it is allowed to be outside the visible desktop.
                // "content frame" since it is allowed to be outside the visible desktop.
                if (mContainingFrame.isEmpty()) {
                if (mContainingFrame.isEmpty()) {
                    mContainingFrame.set(cf);
                    mContainingFrame.set(contentFrame);
                }
                }
            }
            }
            mDisplayFrame.set(mContainingFrame);
            mDisplayFrame.set(mContainingFrame);
@@ -770,22 +771,22 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
            layoutYDiff = !mInsetFrame.isEmpty() ? mInsetFrame.top - mContainingFrame.top : 0;
            layoutYDiff = !mInsetFrame.isEmpty() ? mInsetFrame.top - mContainingFrame.top : 0;
            layoutContainingFrame = !mInsetFrame.isEmpty() ? mInsetFrame : mContainingFrame;
            layoutContainingFrame = !mInsetFrame.isEmpty() ? mInsetFrame : mContainingFrame;
            mTmpRect.set(0, 0, dc.getDisplayInfo().logicalWidth, dc.getDisplayInfo().logicalHeight);
            mTmpRect.set(0, 0, dc.getDisplayInfo().logicalWidth, dc.getDisplayInfo().logicalHeight);
            subtractInsets(mDisplayFrame, layoutContainingFrame, df, mTmpRect);
            subtractInsets(mDisplayFrame, layoutContainingFrame, displayFrame, mTmpRect);
            if (!layoutInParentFrame()) {
            if (!layoutInParentFrame()) {
                subtractInsets(mContainingFrame, layoutContainingFrame, pf, mTmpRect);
                subtractInsets(mContainingFrame, layoutContainingFrame, parentFrame, mTmpRect);
                subtractInsets(mInsetFrame, layoutContainingFrame, pf, mTmpRect);
                subtractInsets(mInsetFrame, layoutContainingFrame, parentFrame, mTmpRect);
            }
            }
            layoutDisplayFrame = df;
            layoutDisplayFrame = displayFrame;
            layoutDisplayFrame.intersect(layoutContainingFrame);
            layoutDisplayFrame.intersect(layoutContainingFrame);
        }
        }


        final int pw = mContainingFrame.width();
        final int pw = mContainingFrame.width();
        final int ph = mContainingFrame.height();
        final int ph = mContainingFrame.height();


        if (!mParentFrame.equals(pf)) {
        if (!mParentFrame.equals(parentFrame)) {
            //Slog.i(TAG_WM, "Window " + this + " content frame from " + mParentFrame
            //Slog.i(TAG_WM, "Window " + this + " content frame from " + mParentFrame
            //        + " to " + pf);
            //        + " to " + parentFrame);
            mParentFrame.set(pf);
            mParentFrame.set(parentFrame);
            mContentChanged = true;
            mContentChanged = true;
        }
        }
        if (mRequestedWidth != mLastRequestedWidth || mRequestedHeight != mLastRequestedHeight) {
        if (mRequestedWidth != mLastRequestedWidth || mRequestedHeight != mLastRequestedHeight) {
@@ -794,14 +795,14 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
            mContentChanged = true;
            mContentChanged = true;
        }
        }


        mOverscanFrame.set(of);
        mOverscanFrame.set(overscanFrame);
        mContentFrame.set(cf);
        mContentFrame.set(contentFrame);
        mVisibleFrame.set(vf);
        mVisibleFrame.set(visibleFrame);
        mDecorFrame.set(dcf);
        mDecorFrame.set(decorFrame);
        mStableFrame.set(sf);
        mStableFrame.set(stableFrame);
        final boolean hasOutsets = osf != null;
        final boolean hasOutsets = outsetFrame != null;
        if (hasOutsets) {
        if (hasOutsets) {
            mOutsetFrame.set(osf);
            mOutsetFrame.set(outsetFrame);
        }
        }


        final int fw = mFrame.width();
        final int fw = mFrame.width();