Merge "Use ClientWindowFrames to collect frames computed by WindowLayout" into tm-dev

This commit is contained in:
Tiger Huang
2022-03-15 18:43:37 +00:00
committed by Android (Google) Code Review
6 changed files with 115 additions and 107 deletions

View File

@@ -552,7 +552,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();
@@ -1223,8 +1222,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)) {

View File

@@ -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,

View File

@@ -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

View File

@@ -133,6 +133,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;
@@ -337,9 +338,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();
@@ -1490,8 +1489,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);
}
}
@@ -1534,12 +1533,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)
@@ -1552,7 +1551,7 @@ public class DisplayPolicy {
windowFrames.setContentChanged(true);
}
win.setFrame();
win.setFrames(sTmpClientFrames);
}
WindowState getTopFullscreenOpaqueWindow() {

View File

@@ -1393,13 +1393,13 @@ class WindowState extends WindowContainer<WindowState> 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;

View File

@@ -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);
}
}