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

Commit 2d8e925f authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Remove unused mPendingBackDropFrame

The related callback methods become no-op
since [1] removed BackdropFrameRenderer.

[1]: I4d9726da9bb3cc8c3c833555ac625a67dd09380d

Bug: 163976519
Flag: EXEMPT remove unused code
Test: ViewRootImplTest
Change-Id: Id1b898da3299560f51f1a4f7d14b60b399a90162
parent e58b13fc
Loading
Loading
Loading
Loading
+0 −9
Original line number Diff line number Diff line
@@ -855,15 +855,6 @@ public class WindowConfiguration implements Parcelable, Comparable<WindowConfigu
                    || mWindowingMode == WINDOWING_MODE_MULTI_WINDOW;
    }

    /**
     * Returns true if the backdrop on the client side should match the frame of the window.
     * Returns false, if the backdrop should be fullscreen.
     * @hide
     */
    public boolean useWindowFrameForBackdrop() {
        return mWindowingMode == WINDOWING_MODE_FREEFORM || mWindowingMode == WINDOWING_MODE_PINNED;
    }

    /**
     * Returns true if windows in this container should be given move animations by default.
     * @hide
+3 −29
Original line number Diff line number Diff line
@@ -872,8 +872,6 @@ public final class ViewRootImpl implements ViewParent,
    private final Rect mLastLayoutFrame;
    Rect mOverrideInsetsFrame;
    final Rect mPendingBackDropFrame = new Rect();
    private int mRelayoutSeq;
    private final Rect mWinFrameInScreen = new Rect();
    private final InsetsState mTempInsets = new InsetsState();
@@ -2376,14 +2374,6 @@ public final class ViewRootImpl implements ViewParent,
            mTmpFrames.attachedFrame.set(attachedFrame);
        }
        if (mDragResizing && mUseMTRenderer) {
            boolean fullscreen = frame.equals(mPendingBackDropFrame);
            for (int i = mWindowCallbacks.size() - 1; i >= 0; i--) {
                mWindowCallbacks.get(i).onWindowSizeIsChanging(mPendingBackDropFrame, fullscreen,
                        mAttachInfo.mVisibleInsets, mAttachInfo.mStableInsets);
            }
        }
        mForceNextWindowRelayout |= forceLayout;
        mSeqId = seqId > mSeqId ? seqId : mSeqId;
        if (NoPreloadHolder.sAlwaysSeqId) {
@@ -4079,12 +4069,7 @@ public final class ViewRootImpl implements ViewParent,
                if (mDragResizing != dragResizing) {
                    if (dragResizing) {
                        final boolean backdropSizeMatchesFrame =
                                mWinFrame.width() == mPendingBackDropFrame.width()
                                        && mWinFrame.height() == mPendingBackDropFrame.height();
                        // TODO: Need cutout?
                        startDragResizing(mPendingBackDropFrame, !backdropSizeMatchesFrame,
                                mAttachInfo.mContentInsets, mAttachInfo.mStableInsets);
                        startDragResizing();
                    } else {
                        // We shouldn't come here, but if we come we should end the resize.
                        endDragResizing();
@@ -9829,15 +9814,6 @@ public final class ViewRootImpl implements ViewParent,
            mLastLayoutFrame.set(frame);
        }
        final WindowConfiguration winConfig = getCompatWindowConfiguration();
        mPendingBackDropFrame.set(mPendingDragResizing && !winConfig.useWindowFrameForBackdrop()
                ? winConfig.getMaxBounds()
                : frame);
        // Surface position is now inherited from parent, and BackdropFrameRenderer uses backdrop
        // frame to position content. Thus, we just keep the size of backdrop frame, and remove the
        // offset to avoid double offset from display origin.
        mPendingBackDropFrame.offsetTo(0, 0);
        mInsetsController.onFrameChanged(mOverrideInsetsFrame != null ?
                mOverrideInsetsFrame : frame);
    }
@@ -12118,14 +12094,12 @@ public final class ViewRootImpl implements ViewParent,
    /**
     * Start a drag resizing which will inform all listeners that a window resize is taking place.
     */
    private void startDragResizing(Rect initialBounds, boolean fullscreen, Rect systemInsets,
            Rect stableInsets) {
    private void startDragResizing() {
        if (!mDragResizing) {
            mDragResizing = true;
            if (mUseMTRenderer) {
                for (int i = mWindowCallbacks.size() - 1; i >= 0; i--) {
                    mWindowCallbacks.get(i).onWindowDragResizeStart(
                            initialBounds, fullscreen, systemInsets, stableInsets);
                    mWindowCallbacks.get(i).onWindowDragResizeStart();
                }
            }
            mFullRedrawNeeded = true;
+1 −24
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@
package android.view;

import android.graphics.RecordingCanvas;
import android.graphics.Rect;

/**
 * These callbacks are used to communicate window configuration changes while the user is performing
@@ -28,32 +27,10 @@ import android.graphics.Rect;
 */
public interface WindowCallbacks {

    /**
     * Called by the system when the window got changed by the user, before the layouter got called.
     * It also gets called when the insets changed, or when the window switched between a fullscreen
     * layout or a non-fullscreen layout. It can be used to perform a "quick and dirty" resize which
     * should never take more then 4ms to complete.
     *
     * <p>At the time the layouting has not happened yet.
     *
     * @param newBounds The new window frame bounds.
     * @param fullscreen Whether the window is currently drawing in fullscreen.
     * @param systemInsets The current visible system insets for the window.
     * @param stableInsets The stable insets for the window.
     */
    void onWindowSizeIsChanging(Rect newBounds, boolean fullscreen, Rect systemInsets,
            Rect stableInsets);

    /**
     * Called when a drag resize starts.
     *
     * @param initialBounds The initial bounds where the window will be.
     * @param fullscreen Whether the window is currently drawing in fullscreen.
     * @param systemInsets The current visible system insets for the window.
     * @param stableInsets The stable insets for the window.
     */
    void onWindowDragResizeStart(Rect initialBounds, boolean fullscreen, Rect systemInsets,
            Rect stableInsets);
    void onWindowDragResizeStart();

    /**
     * Called when a drag resize ends.
+1 −6
Original line number Diff line number Diff line
@@ -2259,12 +2259,7 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind
    }

    @Override
    public void onWindowSizeIsChanging(Rect newBounds, boolean fullscreen, Rect systemInsets,
            Rect stableInsets) {}

    @Override
    public void onWindowDragResizeStart(Rect initialBounds, boolean fullscreen, Rect systemInsets,
            Rect stableInsets) {
    public void onWindowDragResizeStart() {
        if (mWindow.isDestroyed()) {
            // If the owner's window is gone, we should not be able to come here anymore.
            return;