From 45790587c729db89fc366d85ba45bc7081ea7d9c Mon Sep 17 00:00:00 2001 From: Tiger Huang Date: Mon, 14 Mar 2022 22:30:45 +0800 Subject: [PATCH] Use ClientWindowFrames to collect frames computed by WindowLayout This is a step to move the window layout to the client side. ClientWindowFrames is used to carry window frames dispatched from the server to the client for now. Later, the window frames will be computed at the client side, and the frames will be sent to the server side via ClientWindowFrames. Bug: 161810301 Test: presubmit (no behavior change but only code refactors) Change-Id: I83d8cfff2432e09759ef5b3d5f3b21731fc71bff --- core/java/android/view/ViewRootImpl.java | 4 +- core/java/android/view/WindowLayout.java | 19 ++- .../android/window/ClientWindowFrames.java | 36 +++-- .../com/android/server/wm/DisplayPolicy.java | 19 ++- .../com/android/server/wm/WindowState.java | 8 +- .../android/server/wm/WindowLayoutTests.java | 136 +++++++++--------- 6 files changed, 115 insertions(+), 107 deletions(-) diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index bde761e59620b..8370f0bbd6282 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -546,7 +546,6 @@ public final class ViewRootImpl implements ViewParent, private final Rect mVisRect = new Rect(); // used to retrieve visible rect of focused view. private final Rect mTempRect = new Rect(); - private final Rect mTempRect2 = new Rect(); private final WindowLayout mWindowLayout = new WindowLayout(); @@ -1198,8 +1197,7 @@ public final class ViewRootImpl implements ViewParent, displayCutoutSafe, winConfig.getBounds(), winConfig.getWindowingMode(), UNSPECIFIED_LENGTH, UNSPECIFIED_LENGTH, mInsetsController.getRequestedVisibilities(), - getAttachedWindowFrame(), 1f /* compactScale */, - mTmpFrames.displayFrame, mTempRect2, mTmpFrames.frame); + getAttachedWindowFrame(), 1f /* compactScale */, mTmpFrames); setFrame(mTmpFrames.frame); registerBackCallbackOnWindow(); if (!WindowOnBackInvokedDispatcher.isOnBackInvokedCallbackEnabled(mContext)) { diff --git a/core/java/android/view/WindowLayout.java b/core/java/android/view/WindowLayout.java index ad9f21b4fa70d..a3b1313202c25 100644 --- a/core/java/android/view/WindowLayout.java +++ b/core/java/android/view/WindowLayout.java @@ -42,6 +42,7 @@ import android.graphics.Insets; import android.graphics.Point; import android.graphics.Rect; import android.util.Log; +import android.window.ClientWindowFrames; /** * Computes window frames. @@ -56,15 +57,17 @@ public class WindowLayout { private final Rect mTempDisplayCutoutSafeExceptMaybeBarsRect = new Rect(); private final Rect mTempRect = new Rect(); - public boolean computeFrames(WindowManager.LayoutParams attrs, InsetsState state, + public void computeFrames(WindowManager.LayoutParams attrs, InsetsState state, Rect displayCutoutSafe, Rect windowBounds, @WindowingMode int windowingMode, int requestedWidth, int requestedHeight, InsetsVisibilities requestedVisibilities, - Rect attachedWindowFrame, float compatScale, Rect outDisplayFrame, Rect outParentFrame, - Rect outFrame) { + Rect attachedWindowFrame, float compatScale, ClientWindowFrames outFrames) { final int type = attrs.type; final int fl = attrs.flags; final int pfl = attrs.privateFlags; final boolean layoutInScreen = (fl & FLAG_LAYOUT_IN_SCREEN) == FLAG_LAYOUT_IN_SCREEN; + final Rect outDisplayFrame = outFrames.displayFrame; + final Rect outParentFrame = outFrames.parentFrame; + final Rect outFrame = outFrames.frame; // Compute bounds restricted by insets final Insets insets = state.calculateInsets(windowBounds, attrs.getFitInsetsTypes(), @@ -95,7 +98,7 @@ public class WindowLayout { final DisplayCutout cutout = state.getDisplayCutout(); final Rect displayCutoutSafeExceptMaybeBars = mTempDisplayCutoutSafeExceptMaybeBarsRect; displayCutoutSafeExceptMaybeBars.set(displayCutoutSafe); - boolean clippedByDisplayCutout = false; + outFrames.isParentFrameClippedByDisplayCutout = false; if (cutoutMode != LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS && !cutout.isEmpty()) { // Ensure that windows with a non-ALWAYS display cutout mode are laid out in // the cutout safe zone. @@ -158,7 +161,7 @@ public class WindowLayout { if (!attachedInParent && !floatingInScreenWindow) { mTempRect.set(outParentFrame); outParentFrame.intersectUnchecked(displayCutoutSafeExceptMaybeBars); - clippedByDisplayCutout = !mTempRect.equals(outParentFrame); + outFrames.isParentFrameClippedByDisplayCutout = !mTempRect.equals(outParentFrame); } outDisplayFrame.intersectUnchecked(displayCutoutSafeExceptMaybeBars); } @@ -287,9 +290,7 @@ public class WindowLayout { } if (DEBUG) Log.d(TAG, "computeWindowFrames " + attrs.getTitle() - + " outFrame=" + outFrame.toShortString() - + " outParentFrame=" + outParentFrame.toShortString() - + " outDisplayFrame=" + outDisplayFrame.toShortString() + + " outFrames=" + outFrames + " windowBounds=" + windowBounds.toShortString() + " attachedWindowFrame=" + (attachedWindowFrame != null ? attachedWindowFrame.toShortString() @@ -302,8 +303,6 @@ public class WindowLayout { + " attrs=" + attrs + " state=" + state + " requestedVisibilities=" + requestedVisibilities); - - return clippedByDisplayCutout; } public static void computeSurfaceSize(WindowManager.LayoutParams attrs, Rect maxBounds, diff --git a/core/java/android/window/ClientWindowFrames.java b/core/java/android/window/ClientWindowFrames.java index acf9882e6658b..5b915cc22ec50 100644 --- a/core/java/android/window/ClientWindowFrames.java +++ b/core/java/android/window/ClientWindowFrames.java @@ -27,47 +27,55 @@ import android.os.Parcelable; */ public class ClientWindowFrames implements Parcelable { /** The actual window bounds. */ - public final @NonNull Rect frame; + public final @NonNull Rect frame = new Rect(); /** * The container frame that is usually the same as display size. It may exclude the area of * insets if the window layout parameter has specified fit-insets-sides. */ - public final @NonNull Rect displayFrame; + public final @NonNull Rect displayFrame = new Rect(); + + /** + * The frame to be referenced while applying gravity and MATCH_PARENT. + */ + public final @NonNull Rect parentFrame = new Rect(); /** The background area while the window is resizing. */ - public final @NonNull Rect backdropFrame; + public final @NonNull Rect backdropFrame = new Rect(); + + public boolean isParentFrameClippedByDisplayCutout; public ClientWindowFrames() { - frame = new Rect(); - displayFrame = new Rect(); - backdropFrame = new Rect(); } public ClientWindowFrames(ClientWindowFrames other) { - frame = new Rect(other.frame); - displayFrame = new Rect(other.displayFrame); - backdropFrame = new Rect(other.backdropFrame); + frame.set(other.frame); + displayFrame.set(other.displayFrame); + parentFrame.set(other.parentFrame); + backdropFrame.set(other.backdropFrame); + isParentFrameClippedByDisplayCutout = other.isParentFrameClippedByDisplayCutout; } private ClientWindowFrames(Parcel in) { - frame = Rect.CREATOR.createFromParcel(in); - displayFrame = Rect.CREATOR.createFromParcel(in); - backdropFrame = Rect.CREATOR.createFromParcel(in); + readFromParcel(in); } /** Needed for AIDL out parameters. */ public void readFromParcel(Parcel in) { frame.readFromParcel(in); displayFrame.readFromParcel(in); + parentFrame.readFromParcel(in); backdropFrame.readFromParcel(in); + isParentFrameClippedByDisplayCutout = in.readBoolean(); } @Override public void writeToParcel(Parcel dest, int flags) { frame.writeToParcel(dest, flags); displayFrame.writeToParcel(dest, flags); + parentFrame.writeToParcel(dest, flags); backdropFrame.writeToParcel(dest, flags); + dest.writeBoolean(isParentFrameClippedByDisplayCutout); } @Override @@ -75,7 +83,9 @@ public class ClientWindowFrames implements Parcelable { final StringBuilder sb = new StringBuilder(32); return "ClientWindowFrames{frame=" + frame.toShortString(sb) + " display=" + displayFrame.toShortString(sb) - + " backdrop=" + backdropFrame.toShortString(sb) + "}"; + + " parentFrame=" + parentFrame.toShortString(sb) + + " backdrop=" + backdropFrame.toShortString(sb) + + " parentClippedByDisplayCutout=" + isParentFrameClippedByDisplayCutout + "}"; } @Override diff --git a/services/core/java/com/android/server/wm/DisplayPolicy.java b/services/core/java/com/android/server/wm/DisplayPolicy.java index 4148d8b7d8534..95a0b068c55df 100644 --- a/services/core/java/com/android/server/wm/DisplayPolicy.java +++ b/services/core/java/com/android/server/wm/DisplayPolicy.java @@ -136,6 +136,7 @@ import android.view.WindowManager.LayoutParams; import android.view.WindowManagerGlobal; import android.view.WindowManagerPolicyConstants; import android.view.accessibility.AccessibilityManager; +import android.window.ClientWindowFrames; import com.android.internal.R; import com.android.internal.annotations.VisibleForTesting; @@ -340,9 +341,7 @@ public class DisplayPolicy { private static final Rect sTmpRect2 = new Rect(); private static final Rect sTmpLastParentFrame = new Rect(); private static final Rect sTmpDisplayCutoutSafe = new Rect(); - private static final Rect sTmpDisplayFrame = new Rect(); - private static final Rect sTmpParentFrame = new Rect(); - private static final Rect sTmpFrame = new Rect(); + private static final ClientWindowFrames sTmpClientFrames = new ClientWindowFrames(); private final WindowLayout mWindowLayout = new WindowLayout(); @@ -1474,8 +1473,8 @@ public class DisplayPolicy { displayFrames.mUnrestricted, win.getWindowingMode(), UNSPECIFIED_LENGTH, UNSPECIFIED_LENGTH, win.getRequestedVisibilities(), null /* attachedWindowFrame */, win.mGlobalScale, - sTmpDisplayFrame, sTmpParentFrame, sTmpFrame); - controller.computeSimulatedState(win, displayFrames, sTmpFrame); + sTmpClientFrames); + controller.computeSimulatedState(win, displayFrames, sTmpClientFrames.frame); } } @@ -1518,12 +1517,12 @@ public class DisplayPolicy { sTmpLastParentFrame.set(pf); - final boolean clippedByDisplayCutout = mWindowLayout.computeFrames(attrs, - win.getInsetsState(), displayFrames.mDisplayCutoutSafe, + mWindowLayout.computeFrames(attrs, win.getInsetsState(), displayFrames.mDisplayCutoutSafe, win.getBounds(), win.getWindowingMode(), requestedWidth, requestedHeight, win.getRequestedVisibilities(), attachedWindowFrame, win.mGlobalScale, - df, pf, f); - windowFrames.setParentFrameWasClippedByDisplayCutout(clippedByDisplayCutout); + sTmpClientFrames); + windowFrames.setParentFrameWasClippedByDisplayCutout( + sTmpClientFrames.isParentFrameClippedByDisplayCutout); if (DEBUG_LAYOUT) Slog.v(TAG, "Compute frame " + attrs.getTitle() + ": sim=#" + Integer.toHexString(attrs.softInputMode) @@ -1536,7 +1535,7 @@ public class DisplayPolicy { windowFrames.setContentChanged(true); } - win.setFrame(); + win.setFrames(sTmpClientFrames); } WindowState getTopFullscreenOpaqueWindow() { diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java index 3dad2ba40627e..73cb2160975c7 100644 --- a/services/core/java/com/android/server/wm/WindowState.java +++ b/services/core/java/com/android/server/wm/WindowState.java @@ -1393,13 +1393,13 @@ class WindowState extends WindowContainer implements WindowManagerP } // TODO(b/161810301): Make the frame be passed from the client side. - void setFrame() { - // TODO(b/161810301): Set the window frame here. We don't have to do it now because - // DisplayPolicy has already done it for the window. - + void setFrames(ClientWindowFrames clientWindowFrames) { mHaveFrame = true; final WindowFrames windowFrames = mWindowFrames; + windowFrames.mDisplayFrame.set(clientWindowFrames.displayFrame); + windowFrames.mParentFrame.set(clientWindowFrames.parentFrame); + windowFrames.mFrame.set(clientWindowFrames.frame); if (mRequestedWidth != mLastRequestedWidth || mRequestedHeight != mLastRequestedHeight) { mLastRequestedWidth = mRequestedWidth; diff --git a/services/tests/wmtests/src/com/android/server/wm/WindowLayoutTests.java b/services/tests/wmtests/src/com/android/server/wm/WindowLayoutTests.java index 7d2e9bf26b01c..ea18e58fe999a 100644 --- a/services/tests/wmtests/src/com/android/server/wm/WindowLayoutTests.java +++ b/services/tests/wmtests/src/com/android/server/wm/WindowLayoutTests.java @@ -45,6 +45,7 @@ import android.view.InsetsVisibilities; import android.view.WindowInsets; import android.view.WindowLayout; import android.view.WindowManager; +import android.window.ClientWindowFrames; import androidx.test.filters.SmallTest; @@ -71,9 +72,7 @@ public class WindowLayoutTests { private static final Insets WATERFALL_INSETS = Insets.of(6, 0, 12, 0); private final WindowLayout mWindowLayout = new WindowLayout(); - private final Rect mDisplayFrame = new Rect(); - private final Rect mParentFrame = new Rect(); - private final Rect mFrame = new Rect(); + private final ClientWindowFrames mOutFrames = new ClientWindowFrames(); private WindowManager.LayoutParams mAttrs; private InsetsState mState; @@ -108,7 +107,7 @@ public class WindowLayoutTests { private void computeFrames() { mWindowLayout.computeFrames(mAttrs, mState, mDisplayCutoutSafe, mWindowBounds, mWindowingMode, mRequestedWidth, mRequestedHeight, mRequestedVisibilities, - mAttachedWindowFrame, mCompatScale, mDisplayFrame, mParentFrame, mFrame); + mAttachedWindowFrame, mCompatScale, mOutFrames); } private void addDisplayCutout() { @@ -146,9 +145,9 @@ public class WindowLayoutTests { public void defaultParams() { computeFrames(); - assertInsetByTopBottom(STATUS_BAR_HEIGHT, NAVIGATION_BAR_HEIGHT, mDisplayFrame); - assertInsetByTopBottom(STATUS_BAR_HEIGHT, NAVIGATION_BAR_HEIGHT, mParentFrame); - assertInsetByTopBottom(STATUS_BAR_HEIGHT, NAVIGATION_BAR_HEIGHT, mFrame); + assertInsetByTopBottom(STATUS_BAR_HEIGHT, NAVIGATION_BAR_HEIGHT, mOutFrames.displayFrame); + assertInsetByTopBottom(STATUS_BAR_HEIGHT, NAVIGATION_BAR_HEIGHT, mOutFrames.parentFrame); + assertInsetByTopBottom(STATUS_BAR_HEIGHT, NAVIGATION_BAR_HEIGHT, mOutFrames.frame); } @Test @@ -157,9 +156,9 @@ public class WindowLayoutTests { mRequestedHeight = UNSPECIFIED_LENGTH; computeFrames(); - assertInsetByTopBottom(STATUS_BAR_HEIGHT, NAVIGATION_BAR_HEIGHT, mDisplayFrame); - assertInsetByTopBottom(STATUS_BAR_HEIGHT, NAVIGATION_BAR_HEIGHT, mParentFrame); - assertInsetByTopBottom(STATUS_BAR_HEIGHT, NAVIGATION_BAR_HEIGHT, mFrame); + assertInsetByTopBottom(STATUS_BAR_HEIGHT, NAVIGATION_BAR_HEIGHT, mOutFrames.displayFrame); + assertInsetByTopBottom(STATUS_BAR_HEIGHT, NAVIGATION_BAR_HEIGHT, mOutFrames.parentFrame); + assertInsetByTopBottom(STATUS_BAR_HEIGHT, NAVIGATION_BAR_HEIGHT, mOutFrames.frame); } @Test @@ -173,9 +172,9 @@ public class WindowLayoutTests { mAttrs.gravity = Gravity.LEFT | Gravity.TOP; computeFrames(); - assertInsetByTopBottom(STATUS_BAR_HEIGHT, NAVIGATION_BAR_HEIGHT, mDisplayFrame); - assertInsetByTopBottom(STATUS_BAR_HEIGHT, NAVIGATION_BAR_HEIGHT, mParentFrame); - assertRect(0, STATUS_BAR_HEIGHT, width, STATUS_BAR_HEIGHT + height, mFrame); + assertInsetByTopBottom(STATUS_BAR_HEIGHT, NAVIGATION_BAR_HEIGHT, mOutFrames.displayFrame); + assertInsetByTopBottom(STATUS_BAR_HEIGHT, NAVIGATION_BAR_HEIGHT, mOutFrames.parentFrame); + assertRect(0, STATUS_BAR_HEIGHT, width, STATUS_BAR_HEIGHT + height, mOutFrames.frame); } @Test @@ -186,9 +185,12 @@ public class WindowLayoutTests { mRequestedHeight = UNSPECIFIED_LENGTH; computeFrames(); - assertRect(0, top, DISPLAY_WIDTH, DISPLAY_HEIGHT - NAVIGATION_BAR_HEIGHT, mDisplayFrame); - assertRect(0, top, DISPLAY_WIDTH, DISPLAY_HEIGHT - NAVIGATION_BAR_HEIGHT, mParentFrame); - assertRect(0, top, DISPLAY_WIDTH, DISPLAY_HEIGHT - NAVIGATION_BAR_HEIGHT, mFrame); + assertRect(0, top, DISPLAY_WIDTH, DISPLAY_HEIGHT - NAVIGATION_BAR_HEIGHT, + mOutFrames.displayFrame); + assertRect(0, top, DISPLAY_WIDTH, DISPLAY_HEIGHT - NAVIGATION_BAR_HEIGHT, + mOutFrames.parentFrame); + assertRect(0, top, DISPLAY_WIDTH, DISPLAY_HEIGHT - NAVIGATION_BAR_HEIGHT, + mOutFrames.frame); } @Test @@ -196,9 +198,9 @@ public class WindowLayoutTests { mAttrs.setFitInsetsTypes(WindowInsets.Type.statusBars()); computeFrames(); - assertInsetByTopBottom(STATUS_BAR_HEIGHT, 0, mDisplayFrame); - assertInsetByTopBottom(STATUS_BAR_HEIGHT, 0, mParentFrame); - assertInsetByTopBottom(STATUS_BAR_HEIGHT, 0, mFrame); + assertInsetByTopBottom(STATUS_BAR_HEIGHT, 0, mOutFrames.displayFrame); + assertInsetByTopBottom(STATUS_BAR_HEIGHT, 0, mOutFrames.parentFrame); + assertInsetByTopBottom(STATUS_BAR_HEIGHT, 0, mOutFrames.frame); } @Test @@ -206,9 +208,9 @@ public class WindowLayoutTests { mAttrs.setFitInsetsTypes(WindowInsets.Type.navigationBars()); computeFrames(); - assertInsetByTopBottom(0, NAVIGATION_BAR_HEIGHT, mDisplayFrame); - assertInsetByTopBottom(0, NAVIGATION_BAR_HEIGHT, mParentFrame); - assertInsetByTopBottom(0, NAVIGATION_BAR_HEIGHT, mFrame); + assertInsetByTopBottom(0, NAVIGATION_BAR_HEIGHT, mOutFrames.displayFrame); + assertInsetByTopBottom(0, NAVIGATION_BAR_HEIGHT, mOutFrames.parentFrame); + assertInsetByTopBottom(0, NAVIGATION_BAR_HEIGHT, mOutFrames.frame); } @Test @@ -216,9 +218,9 @@ public class WindowLayoutTests { mAttrs.setFitInsetsTypes(0); computeFrames(); - assertInsetByTopBottom(0, 0, mDisplayFrame); - assertInsetByTopBottom(0, 0, mParentFrame); - assertInsetByTopBottom(0, 0, mFrame); + assertInsetByTopBottom(0, 0, mOutFrames.displayFrame); + assertInsetByTopBottom(0, 0, mOutFrames.parentFrame); + assertInsetByTopBottom(0, 0, mOutFrames.frame); } @Test @@ -226,9 +228,9 @@ public class WindowLayoutTests { mAttrs.setFitInsetsSides(WindowInsets.Side.all()); computeFrames(); - assertInsetByTopBottom(STATUS_BAR_HEIGHT, NAVIGATION_BAR_HEIGHT, mDisplayFrame); - assertInsetByTopBottom(STATUS_BAR_HEIGHT, NAVIGATION_BAR_HEIGHT, mParentFrame); - assertInsetByTopBottom(STATUS_BAR_HEIGHT, NAVIGATION_BAR_HEIGHT, mFrame); + assertInsetByTopBottom(STATUS_BAR_HEIGHT, NAVIGATION_BAR_HEIGHT, mOutFrames.displayFrame); + assertInsetByTopBottom(STATUS_BAR_HEIGHT, NAVIGATION_BAR_HEIGHT, mOutFrames.parentFrame); + assertInsetByTopBottom(STATUS_BAR_HEIGHT, NAVIGATION_BAR_HEIGHT, mOutFrames.frame); } @Test @@ -236,9 +238,9 @@ public class WindowLayoutTests { mAttrs.setFitInsetsSides(WindowInsets.Side.TOP); computeFrames(); - assertInsetByTopBottom(STATUS_BAR_HEIGHT, 0, mDisplayFrame); - assertInsetByTopBottom(STATUS_BAR_HEIGHT, 0, mParentFrame); - assertInsetByTopBottom(STATUS_BAR_HEIGHT, 0, mFrame); + assertInsetByTopBottom(STATUS_BAR_HEIGHT, 0, mOutFrames.displayFrame); + assertInsetByTopBottom(STATUS_BAR_HEIGHT, 0, mOutFrames.parentFrame); + assertInsetByTopBottom(STATUS_BAR_HEIGHT, 0, mOutFrames.frame); } @Test @@ -246,9 +248,9 @@ public class WindowLayoutTests { mAttrs.setFitInsetsSides(0); computeFrames(); - assertInsetByTopBottom(0, 0, mDisplayFrame); - assertInsetByTopBottom(0, 0, mParentFrame); - assertInsetByTopBottom(0, 0, mFrame); + assertInsetByTopBottom(0, 0, mOutFrames.displayFrame); + assertInsetByTopBottom(0, 0, mOutFrames.parentFrame); + assertInsetByTopBottom(0, 0, mOutFrames.frame); } @Test @@ -257,9 +259,9 @@ public class WindowLayoutTests { mState.getSource(ITYPE_NAVIGATION_BAR).setVisible(false); computeFrames(); - assertInsetByTopBottom(0, 0, mDisplayFrame); - assertInsetByTopBottom(0, 0, mParentFrame); - assertInsetByTopBottom(0, 0, mFrame); + assertInsetByTopBottom(0, 0, mOutFrames.displayFrame); + assertInsetByTopBottom(0, 0, mOutFrames.parentFrame); + assertInsetByTopBottom(0, 0, mOutFrames.frame); } @Test @@ -269,9 +271,9 @@ public class WindowLayoutTests { mAttrs.setFitInsetsIgnoringVisibility(true); computeFrames(); - assertInsetByTopBottom(STATUS_BAR_HEIGHT, NAVIGATION_BAR_HEIGHT, mDisplayFrame); - assertInsetByTopBottom(STATUS_BAR_HEIGHT, NAVIGATION_BAR_HEIGHT, mParentFrame); - assertInsetByTopBottom(STATUS_BAR_HEIGHT, NAVIGATION_BAR_HEIGHT, mFrame); + assertInsetByTopBottom(STATUS_BAR_HEIGHT, NAVIGATION_BAR_HEIGHT, mOutFrames.displayFrame); + assertInsetByTopBottom(STATUS_BAR_HEIGHT, NAVIGATION_BAR_HEIGHT, mOutFrames.parentFrame); + assertInsetByTopBottom(STATUS_BAR_HEIGHT, NAVIGATION_BAR_HEIGHT, mOutFrames.frame); } @Test @@ -282,9 +284,9 @@ public class WindowLayoutTests { mAttrs.privateFlags |= PRIVATE_FLAG_INSET_PARENT_FRAME_BY_IME; computeFrames(); - assertInsetByTopBottom(STATUS_BAR_HEIGHT, NAVIGATION_BAR_HEIGHT, mDisplayFrame); - assertInsetByTopBottom(STATUS_BAR_HEIGHT, IME_HEIGHT, mParentFrame); - assertInsetByTopBottom(STATUS_BAR_HEIGHT, IME_HEIGHT, mFrame); + assertInsetByTopBottom(STATUS_BAR_HEIGHT, NAVIGATION_BAR_HEIGHT, mOutFrames.displayFrame); + assertInsetByTopBottom(STATUS_BAR_HEIGHT, IME_HEIGHT, mOutFrames.parentFrame); + assertInsetByTopBottom(STATUS_BAR_HEIGHT, IME_HEIGHT, mOutFrames.frame); } @Test @@ -295,11 +297,11 @@ public class WindowLayoutTests { computeFrames(); assertInsetBy(WATERFALL_INSETS.left, DISPLAY_CUTOUT_HEIGHT, WATERFALL_INSETS.right, 0, - mDisplayFrame); + mOutFrames.displayFrame); assertInsetBy(WATERFALL_INSETS.left, DISPLAY_CUTOUT_HEIGHT, WATERFALL_INSETS.right, 0, - mParentFrame); + mOutFrames.parentFrame); assertInsetBy(WATERFALL_INSETS.left, DISPLAY_CUTOUT_HEIGHT, WATERFALL_INSETS.right, 0, - mFrame); + mOutFrames.frame); } @Test @@ -310,11 +312,11 @@ public class WindowLayoutTests { computeFrames(); assertInsetBy(WATERFALL_INSETS.left, STATUS_BAR_HEIGHT, WATERFALL_INSETS.right, 0, - mDisplayFrame); + mOutFrames.displayFrame); assertInsetBy(WATERFALL_INSETS.left, STATUS_BAR_HEIGHT, WATERFALL_INSETS.right, 0, - mParentFrame); + mOutFrames.parentFrame); assertInsetBy(WATERFALL_INSETS.left, STATUS_BAR_HEIGHT, WATERFALL_INSETS.right, 0, - mFrame); + mOutFrames.frame); } @Test @@ -325,9 +327,9 @@ public class WindowLayoutTests { mAttrs.setFitInsetsTypes(0); computeFrames(); - assertInsetBy(WATERFALL_INSETS.left, 0, WATERFALL_INSETS.right, 0, mDisplayFrame); - assertInsetBy(WATERFALL_INSETS.left, 0, WATERFALL_INSETS.right, 0, mParentFrame); - assertInsetBy(WATERFALL_INSETS.left, 0, WATERFALL_INSETS.right, 0, mFrame); + assertInsetBy(WATERFALL_INSETS.left, 0, WATERFALL_INSETS.right, 0, mOutFrames.displayFrame); + assertInsetBy(WATERFALL_INSETS.left, 0, WATERFALL_INSETS.right, 0, mOutFrames.parentFrame); + assertInsetBy(WATERFALL_INSETS.left, 0, WATERFALL_INSETS.right, 0, mOutFrames.frame); } @Test @@ -342,9 +344,9 @@ public class WindowLayoutTests { mAttrs.privateFlags |= PRIVATE_FLAG_LAYOUT_SIZE_EXTENDED_BY_CUTOUT; computeFrames(); - assertRect(0, 0, DISPLAY_WIDTH, DISPLAY_HEIGHT, mDisplayFrame); - assertRect(0, 0, DISPLAY_WIDTH, DISPLAY_HEIGHT, mParentFrame); - assertRect(0, 0, DISPLAY_WIDTH, height + DISPLAY_CUTOUT_HEIGHT, mFrame); + assertRect(0, 0, DISPLAY_WIDTH, DISPLAY_HEIGHT, mOutFrames.displayFrame); + assertRect(0, 0, DISPLAY_WIDTH, DISPLAY_HEIGHT, mOutFrames.parentFrame); + assertRect(0, 0, DISPLAY_WIDTH, height + DISPLAY_CUTOUT_HEIGHT, mOutFrames.frame); } @Test @@ -357,11 +359,11 @@ public class WindowLayoutTests { computeFrames(); assertInsetBy(WATERFALL_INSETS.left, STATUS_BAR_HEIGHT, WATERFALL_INSETS.right, 0, - mDisplayFrame); + mOutFrames.displayFrame); assertInsetBy(WATERFALL_INSETS.left, STATUS_BAR_HEIGHT, WATERFALL_INSETS.right, 0, - mParentFrame); + mOutFrames.parentFrame); assertInsetBy(WATERFALL_INSETS.left, STATUS_BAR_HEIGHT, WATERFALL_INSETS.right, 0, - mFrame); + mOutFrames.frame); } @Test @@ -371,9 +373,9 @@ public class WindowLayoutTests { mAttrs.setFitInsetsTypes(0); computeFrames(); - assertInsetBy(WATERFALL_INSETS.left, 0, WATERFALL_INSETS.right, 0, mDisplayFrame); - assertInsetBy(WATERFALL_INSETS.left, 0, WATERFALL_INSETS.right, 0, mParentFrame); - assertInsetBy(WATERFALL_INSETS.left, 0, WATERFALL_INSETS.right, 0, mFrame); + assertInsetBy(WATERFALL_INSETS.left, 0, WATERFALL_INSETS.right, 0, mOutFrames.displayFrame); + assertInsetBy(WATERFALL_INSETS.left, 0, WATERFALL_INSETS.right, 0, mOutFrames.parentFrame); + assertInsetBy(WATERFALL_INSETS.left, 0, WATERFALL_INSETS.right, 0, mOutFrames.frame); } @Test @@ -384,11 +386,11 @@ public class WindowLayoutTests { computeFrames(); assertInsetBy(WATERFALL_INSETS.left, STATUS_BAR_HEIGHT, WATERFALL_INSETS.right, 0, - mDisplayFrame); + mOutFrames.displayFrame); assertInsetBy(WATERFALL_INSETS.left, STATUS_BAR_HEIGHT, WATERFALL_INSETS.right, 0, - mParentFrame); + mOutFrames.parentFrame); assertInsetBy(WATERFALL_INSETS.left, STATUS_BAR_HEIGHT, WATERFALL_INSETS.right, 0, - mFrame); + mOutFrames.frame); } @Test @@ -398,8 +400,8 @@ public class WindowLayoutTests { mAttrs.setFitInsetsTypes(0); computeFrames(); - assertInsetByTopBottom(0, 0, mDisplayFrame); - assertInsetByTopBottom(0, 0, mParentFrame); - assertInsetByTopBottom(0, 0, mFrame); + assertInsetByTopBottom(0, 0, mOutFrames.displayFrame); + assertInsetByTopBottom(0, 0, mOutFrames.parentFrame); + assertInsetByTopBottom(0, 0, mOutFrames.frame); } }