From: Adrian Roos Date: Mon, 19 Feb 2018 17:06:36 +0000 (+0100) Subject: DisplayCutout: account for cutout in appWidth/appHeight etc. X-Git-Tag: android-x86-9.0-r1~203^2~42^2 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=11c25584b21100260715f0212891f1a10044aac7;p=android-x86%2Fframeworks-base.git DisplayCutout: account for cutout in appWidth/appHeight etc. Makes sure to take into account the area blocked by the cutout when calculating the nonDecor / config / stable insets, widths and heights. Fixes: 72995358 Fixes: 72444324 Test: atest PhoneWindowManagerInsetsTest Test: go/wm-smoke Test: Enter splitscreen, verify that both windows are same size Change-Id: Iff58235b5bdfd0d49df259a91b05e54e3864f41c --- diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java index e77dd7b90d5d..7a5a6c5a9ae8 100644 --- a/services/core/java/com/android/server/policy/PhoneWindowManager.java +++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java @@ -2818,16 +2818,20 @@ public class PhoneWindowManager implements WindowManagerPolicy { @Override public int getNonDecorDisplayWidth(int fullWidth, int fullHeight, int rotation, int uiMode, - int displayId) { + int displayId, DisplayCutout displayCutout) { + int width = fullWidth; // TODO(multi-display): Support navigation bar on secondary displays. if (displayId == DEFAULT_DISPLAY && mHasNavigationBar) { // For a basic navigation bar, when we are in landscape mode we place // the navigation bar to the side. if (mNavigationBarCanMove && fullWidth > fullHeight) { - return fullWidth - getNavigationBarWidth(rotation, uiMode); + width -= getNavigationBarWidth(rotation, uiMode); } } - return fullWidth; + if (displayCutout != null) { + width -= displayCutout.getSafeInsetLeft() + displayCutout.getSafeInsetRight(); + } + return width; } private int getNavigationBarHeight(int rotation, int uiMode) { @@ -2840,35 +2844,46 @@ public class PhoneWindowManager implements WindowManagerPolicy { @Override public int getNonDecorDisplayHeight(int fullWidth, int fullHeight, int rotation, int uiMode, - int displayId) { + int displayId, DisplayCutout displayCutout) { + int height = fullHeight; // TODO(multi-display): Support navigation bar on secondary displays. if (displayId == DEFAULT_DISPLAY && mHasNavigationBar) { // For a basic navigation bar, when we are in portrait mode we place // the navigation bar to the bottom. if (!mNavigationBarCanMove || fullWidth < fullHeight) { - return fullHeight - getNavigationBarHeight(rotation, uiMode); + height -= getNavigationBarHeight(rotation, uiMode); } } - return fullHeight; + if (displayCutout != null) { + height -= displayCutout.getSafeInsetTop() + displayCutout.getSafeInsetBottom(); + } + return height; } @Override public int getConfigDisplayWidth(int fullWidth, int fullHeight, int rotation, int uiMode, - int displayId) { - return getNonDecorDisplayWidth(fullWidth, fullHeight, rotation, uiMode, displayId); + int displayId, DisplayCutout displayCutout) { + return getNonDecorDisplayWidth(fullWidth, fullHeight, rotation, uiMode, displayId, + displayCutout); } @Override public int getConfigDisplayHeight(int fullWidth, int fullHeight, int rotation, int uiMode, - int displayId) { + int displayId, DisplayCutout displayCutout) { // There is a separate status bar at the top of the display. We don't count that as part // of the fixed decor, since it can hide; however, for purposes of configurations, // we do want to exclude it since applications can't generally use that part // of the screen. // TODO(multi-display): Support status bars on secondary displays. if (displayId == DEFAULT_DISPLAY) { - return getNonDecorDisplayHeight(fullWidth, fullHeight, rotation, uiMode, displayId) - - mStatusBarHeight; + int statusBarHeight = mStatusBarHeight; + if (displayCutout != null) { + // If there is a cutout, it may already have accounted for some part of the status + // bar height. + statusBarHeight = Math.max(0, mStatusBarHeight - displayCutout.getSafeInsetTop()); + } + return getNonDecorDisplayHeight(fullWidth, fullHeight, rotation, uiMode, displayId, + displayCutout) - statusBarHeight; } return fullHeight; } @@ -6905,17 +6920,17 @@ public class PhoneWindowManager implements WindowManagerPolicy { @Override public void getStableInsetsLw(int displayRotation, int displayWidth, int displayHeight, - Rect outInsets) { + DisplayCutout displayCutout, Rect outInsets) { outInsets.setEmpty(); // Navigation bar and status bar. - getNonDecorInsetsLw(displayRotation, displayWidth, displayHeight, outInsets); - outInsets.top = mStatusBarHeight; + getNonDecorInsetsLw(displayRotation, displayWidth, displayHeight, displayCutout, outInsets); + outInsets.top = Math.max(outInsets.top, mStatusBarHeight); } @Override public void getNonDecorInsetsLw(int displayRotation, int displayWidth, int displayHeight, - Rect outInsets) { + DisplayCutout displayCutout, Rect outInsets) { outInsets.setEmpty(); // Only navigation bar @@ -6929,6 +6944,13 @@ public class PhoneWindowManager implements WindowManagerPolicy { outInsets.left = getNavigationBarWidth(displayRotation, mUiMode); } } + + if (displayCutout != null) { + outInsets.left += displayCutout.getSafeInsetLeft(); + outInsets.top += displayCutout.getSafeInsetTop(); + outInsets.right += displayCutout.getSafeInsetRight(); + outInsets.bottom += displayCutout.getSafeInsetBottom(); + } } @Override diff --git a/services/core/java/com/android/server/policy/WindowManagerPolicy.java b/services/core/java/com/android/server/policy/WindowManagerPolicy.java index e9c4c5c8138f..dde4bc8f278c 100644 --- a/services/core/java/com/android/server/policy/WindowManagerPolicy.java +++ b/services/core/java/com/android/server/policy/WindowManagerPolicy.java @@ -922,7 +922,7 @@ public interface WindowManagerPolicy extends WindowManagerPolicyConstants { * button bar. */ public int getNonDecorDisplayWidth(int fullWidth, int fullHeight, int rotation, - int uiMode, int displayId); + int uiMode, int displayId, DisplayCutout displayCutout); /** * Return the display height available after excluding any screen @@ -930,25 +930,25 @@ public interface WindowManagerPolicy extends WindowManagerPolicyConstants { * button bar. */ public int getNonDecorDisplayHeight(int fullWidth, int fullHeight, int rotation, - int uiMode, int displayId); + int uiMode, int displayId, DisplayCutout displayCutout); /** * Return the available screen width that we should report for the * configuration. This must be no larger than - * {@link #getNonDecorDisplayWidth(int, int, int, int int, int)}; it may be smaller than - * that to account for more transient decoration like a status bar. + * {@link #getNonDecorDisplayWidth(int, int, int, int, int, DisplayCutout)}; it may be smaller + * than that to account for more transient decoration like a status bar. */ public int getConfigDisplayWidth(int fullWidth, int fullHeight, int rotation, - int uiMode, int displayId); + int uiMode, int displayId, DisplayCutout displayCutout); /** * Return the available screen height that we should report for the * configuration. This must be no larger than - * {@link #getNonDecorDisplayHeight(int, int, int, int, int)}; it may be smaller than - * that to account for more transient decoration like a status bar. + * {@link #getNonDecorDisplayHeight(int, int, int, int, int, DisplayCutout)}; it may be smaller + * than that to account for more transient decoration like a status bar. */ public int getConfigDisplayHeight(int fullWidth, int fullHeight, int rotation, - int uiMode, int displayId); + int uiMode, int displayId, DisplayCutout displayCutout); /** * Return whether the given window can become the Keyguard window. Typically returns true for @@ -1639,10 +1639,11 @@ public interface WindowManagerPolicy extends WindowManagerPolicyConstants { * @param displayRotation the current display rotation * @param displayWidth the current display width * @param displayHeight the current display height + * @param displayCutout the current display cutout * @param outInsets the insets to return */ public void getStableInsetsLw(int displayRotation, int displayWidth, int displayHeight, - Rect outInsets); + DisplayCutout displayCutout, Rect outInsets); /** @@ -1666,10 +1667,11 @@ public interface WindowManagerPolicy extends WindowManagerPolicyConstants { * @param displayRotation the current display rotation * @param displayWidth the current display width * @param displayHeight the current display height + * @param displayCutout the current display cutout * @param outInsets the insets to return */ public void getNonDecorInsetsLw(int displayRotation, int displayWidth, int displayHeight, - Rect outInsets); + DisplayCutout displayCutout, Rect outInsets); /** * @return True if a specified {@param dockSide} is allowed on the current device, or false diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java index 841586ab9fb7..473eeda57fde 100644 --- a/services/core/java/com/android/server/wm/DisplayContent.java +++ b/services/core/java/com/android/server/wm/DisplayContent.java @@ -138,7 +138,6 @@ import android.os.Trace; import android.util.ArraySet; import android.util.DisplayMetrics; import android.util.MutableBoolean; -import android.util.Size; import android.util.Slog; import android.util.proto.ProtoOutputStream; import android.view.Display; @@ -1160,10 +1159,12 @@ class DisplayContent extends WindowContainer implements final int dockSide = getDockSide(outBounds); final int dividerPosition = DockedDividerUtils.calculatePositionForBounds(outBounds, dockSide, dividerSize); - final int displayWidth = mDisplayContent.getDisplayInfo().logicalWidth; - final int displayHeight = mDisplayContent.getDisplayInfo().logicalHeight; + final int displayWidth = displayInfo.logicalWidth; + final int displayHeight = displayInfo.logicalHeight; // Snap the position to a target. final int rotation = displayInfo.rotation; final int orientation = mDisplayContent.getConfiguration().orientation; - mService.mPolicy.getStableInsetsLw(rotation, displayWidth, displayHeight, outBounds); + mService.mPolicy.getStableInsetsLw(rotation, displayWidth, displayHeight, + displayInfo.displayCutout, outBounds); final DividerSnapAlgorithm algorithm = new DividerSnapAlgorithm( mService.mContext.getResources(), displayWidth, displayHeight, dividerSize, orientation == Configuration.ORIENTATION_PORTRAIT, outBounds, @@ -929,7 +930,7 @@ public class TaskStack extends WindowContainer implements // adjusted to occupy whatever screen space the docked stack isn't occupying. final DisplayInfo di = mDisplayContent.getDisplayInfo(); mService.mPolicy.getStableInsetsLw(di.rotation, di.logicalWidth, di.logicalHeight, - mTmpRect2); + di.displayCutout, mTmpRect2); final int position = new DividerSnapAlgorithm(mService.mContext.getResources(), di.logicalWidth, di.logicalHeight, diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index 966f6226caed..ace094408847 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -6873,7 +6873,8 @@ public class WindowManagerService extends IWindowManager.Stub final DisplayContent dc = mRoot.getDisplayContent(displayId); if (dc != null) { final DisplayInfo di = dc.getDisplayInfo(); - mPolicy.getStableInsetsLw(di.rotation, di.logicalWidth, di.logicalHeight, outInsets); + mPolicy.getStableInsetsLw(di.rotation, di.logicalWidth, di.logicalHeight, + di.displayCutout, outInsets); } } diff --git a/services/tests/servicestests/src/com/android/server/policy/PhoneWindowManagerInsetsTest.java b/services/tests/servicestests/src/com/android/server/policy/PhoneWindowManagerInsetsTest.java new file mode 100644 index 000000000000..7e18ce78c9d1 --- /dev/null +++ b/services/tests/servicestests/src/com/android/server/policy/PhoneWindowManagerInsetsTest.java @@ -0,0 +1,185 @@ +/* + * Copyright (C) 2018 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.server.policy; + +import static android.view.Surface.ROTATION_0; +import static android.view.Surface.ROTATION_180; +import static android.view.Surface.ROTATION_270; +import static android.view.Surface.ROTATION_90; + +import static org.hamcrest.Matchers.equalTo; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThat; + +import android.graphics.Rect; +import android.platform.test.annotations.Presubmit; +import android.support.test.filters.SmallTest; +import android.support.test.runner.AndroidJUnit4; +import android.view.Display; +import android.view.DisplayInfo; + +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.ErrorCollector; +import org.junit.runner.RunWith; + +@RunWith(AndroidJUnit4.class) +@SmallTest +@Presubmit +public class PhoneWindowManagerInsetsTest extends PhoneWindowManagerTestBase { + + @Rule + public final ErrorCollector mErrorCollector = new ErrorCollector(); + + @Before + public void setUp() throws Exception { + addStatusBar(); + addNavigationBar(); + } + + @Test + public void portrait() throws Exception { + DisplayInfo di = displayInfoForRotation(ROTATION_0, false /* withCutout */); + + verifyStableInsets(di, 0, STATUS_BAR_HEIGHT, 0, NAV_BAR_HEIGHT); + verifyNonDecorInsets(di, 0, 0, 0, NAV_BAR_HEIGHT); + verifyConsistency(di); + } + + @Test + public void portrait_withCutout() throws Exception { + DisplayInfo di = displayInfoForRotation(ROTATION_0, true /* withCutout */); + + verifyStableInsets(di, 0, STATUS_BAR_HEIGHT, 0, NAV_BAR_HEIGHT); + verifyNonDecorInsets(di, 0, DISPLAY_CUTOUT_HEIGHT, 0, NAV_BAR_HEIGHT); + verifyConsistency(di); + } + + @Test + public void landscape() throws Exception { + DisplayInfo di = displayInfoForRotation(ROTATION_90, false /* withCutout */); + + verifyStableInsets(di, 0, STATUS_BAR_HEIGHT, NAV_BAR_HEIGHT, 0); + verifyNonDecorInsets(di, 0, 0, NAV_BAR_HEIGHT, 0); + verifyConsistency(di); + } + + @Test + public void landscape_withCutout() throws Exception { + DisplayInfo di = displayInfoForRotation(ROTATION_90, true /* withCutout */); + + verifyStableInsets(di, DISPLAY_CUTOUT_HEIGHT, STATUS_BAR_HEIGHT, NAV_BAR_HEIGHT, 0); + verifyNonDecorInsets(di, DISPLAY_CUTOUT_HEIGHT, 0, NAV_BAR_HEIGHT, 0); + verifyConsistency(di); + } + + @Test + public void seascape() throws Exception { + DisplayInfo di = displayInfoForRotation(ROTATION_270, false /* withCutout */); + + verifyStableInsets(di, NAV_BAR_HEIGHT, STATUS_BAR_HEIGHT, 0, 0); + verifyNonDecorInsets(di, NAV_BAR_HEIGHT, 0, 0, 0); + verifyConsistency(di); + } + + @Test + public void seascape_withCutout() throws Exception { + DisplayInfo di = displayInfoForRotation(ROTATION_270, true /* withCutout */); + + verifyStableInsets(di, NAV_BAR_HEIGHT, STATUS_BAR_HEIGHT, DISPLAY_CUTOUT_HEIGHT, 0); + verifyNonDecorInsets(di, NAV_BAR_HEIGHT, 0, DISPLAY_CUTOUT_HEIGHT, 0); + verifyConsistency(di); + } + + @Test + public void upsideDown() throws Exception { + DisplayInfo di = displayInfoForRotation(ROTATION_180, false /* withCutout */); + + verifyStableInsets(di, 0, STATUS_BAR_HEIGHT, 0, NAV_BAR_HEIGHT); + verifyNonDecorInsets(di, 0, 0, 0, NAV_BAR_HEIGHT); + verifyConsistency(di); + } + + @Test + public void upsideDown_withCutout() throws Exception { + DisplayInfo di = displayInfoForRotation(ROTATION_180, true /* withCutout */); + + verifyStableInsets(di, 0, STATUS_BAR_HEIGHT, 0, NAV_BAR_HEIGHT + DISPLAY_CUTOUT_HEIGHT); + verifyNonDecorInsets(di, 0, 0, 0, NAV_BAR_HEIGHT + DISPLAY_CUTOUT_HEIGHT); + verifyConsistency(di); + } + + private void verifyStableInsets(DisplayInfo di, int left, int top, int right, int bottom) { + mErrorCollector.checkThat("stableInsets", getStableInsetsLw(di), equalTo(new Rect( + left, top, right, bottom))); + } + + private void verifyNonDecorInsets(DisplayInfo di, int left, int top, int right, int bottom) { + mErrorCollector.checkThat("nonDecorInsets", getNonDecorInsetsLw(di), equalTo(new Rect( + left, top, right, bottom))); + } + + private void verifyConsistency(DisplayInfo di) { + verifyConsistency("configDisplay", di, getStableInsetsLw(di), + getConfigDisplayWidth(di), getConfigDisplayHeight(di)); + verifyConsistency("nonDecorDisplay", di, getNonDecorInsetsLw(di), + getNonDecorDisplayWidth(di), getNonDecorDisplayHeight(di)); + } + + private void verifyConsistency(String what, DisplayInfo di, Rect insets, int width, + int height) { + mErrorCollector.checkThat(what + ":width", width, + equalTo(di.logicalWidth - insets.left - insets.right)); + mErrorCollector.checkThat(what + ":height", height, + equalTo(di.logicalHeight - insets.top - insets.bottom)); + } + + private Rect getStableInsetsLw(DisplayInfo di) { + Rect result = new Rect(); + mPolicy.getStableInsetsLw(di.rotation, di.logicalWidth, di.logicalHeight, + di.displayCutout, result); + return result; + } + + private Rect getNonDecorInsetsLw(DisplayInfo di) { + Rect result = new Rect(); + mPolicy.getNonDecorInsetsLw(di.rotation, di.logicalWidth, di.logicalHeight, + di.displayCutout, result); + return result; + } + + private int getNonDecorDisplayWidth(DisplayInfo di) { + return mPolicy.getNonDecorDisplayWidth(di.logicalWidth, di.logicalHeight, di.rotation, + 0 /* ui */, Display.DEFAULT_DISPLAY, di.displayCutout); + } + + private int getNonDecorDisplayHeight(DisplayInfo di) { + return mPolicy.getNonDecorDisplayHeight(di.logicalWidth, di.logicalHeight, di.rotation, + 0 /* ui */, Display.DEFAULT_DISPLAY, di.displayCutout); + } + + private int getConfigDisplayWidth(DisplayInfo di) { + return mPolicy.getConfigDisplayWidth(di.logicalWidth, di.logicalHeight, di.rotation, + 0 /* ui */, Display.DEFAULT_DISPLAY, di.displayCutout); + } + + private int getConfigDisplayHeight(DisplayInfo di) { + return mPolicy.getConfigDisplayHeight(di.logicalWidth, di.logicalHeight, di.rotation, + 0 /* ui */, Display.DEFAULT_DISPLAY, di.displayCutout); + } +} \ No newline at end of file diff --git a/services/tests/servicestests/src/com/android/server/policy/PhoneWindowManagerTestBase.java b/services/tests/servicestests/src/com/android/server/policy/PhoneWindowManagerTestBase.java index ad8995325a6a..30ca9caf56de 100644 --- a/services/tests/servicestests/src/com/android/server/policy/PhoneWindowManagerTestBase.java +++ b/services/tests/servicestests/src/com/android/server/policy/PhoneWindowManagerTestBase.java @@ -72,7 +72,6 @@ public class PhoneWindowManagerTestBase { FakeWindowState mNavigationBar; private boolean mHasDisplayCutout; private int mRotation = ROTATION_0; - private final Matrix mTmpMatrix = new Matrix(); @Before public void setUpBase() throws Exception { @@ -97,24 +96,7 @@ public class PhoneWindowManagerTestBase { } private void updateDisplayFrames() { - DisplayInfo info = new DisplayInfo(); - - final boolean flippedDimensions = mRotation == ROTATION_90 || mRotation == ROTATION_270; - info.logicalWidth = flippedDimensions ? DISPLAY_HEIGHT : DISPLAY_WIDTH; - info.logicalHeight = flippedDimensions ? DISPLAY_WIDTH : DISPLAY_HEIGHT; - info.rotation = mRotation; - if (mHasDisplayCutout) { - Path p = new Path(); - p.addRect(DISPLAY_WIDTH / 4, 0, DISPLAY_WIDTH * 3 / 4, DISPLAY_CUTOUT_HEIGHT, - Path.Direction.CCW); - transformPhysicalToLogicalCoordinates( - mRotation, DISPLAY_WIDTH, DISPLAY_HEIGHT, mTmpMatrix); - p.transform(mTmpMatrix); - info.displayCutout = DisplayCutout.fromBounds(p); - } else { - info.displayCutout = null; - } - + DisplayInfo info = displayInfoForRotation(mRotation, mHasDisplayCutout); mFrames = new DisplayFrames(Display.DEFAULT_DISPLAY, info); } @@ -161,6 +143,34 @@ public class PhoneWindowManagerTestBase { assertInsetBy(actual, 0, expectedInsetTop, 0, expectedInsetBottom); } + public static DisplayInfo displayInfoForRotation(int rotation, boolean withDisplayCutout) { + DisplayInfo info = new DisplayInfo(); + + final boolean flippedDimensions = rotation == ROTATION_90 || rotation == ROTATION_270; + info.logicalWidth = flippedDimensions ? DISPLAY_HEIGHT : DISPLAY_WIDTH; + info.logicalHeight = flippedDimensions ? DISPLAY_WIDTH : DISPLAY_HEIGHT; + info.rotation = rotation; + if (withDisplayCutout) { + info.displayCutout = displayCutoutForRotation(rotation) + .computeSafeInsets(info.logicalWidth, info.logicalHeight); + } else { + info.displayCutout = null; + } + return info; + } + + private static DisplayCutout displayCutoutForRotation(int rotation) { + Path p = new Path(); + p.addRect(DISPLAY_WIDTH / 4, 0, DISPLAY_WIDTH * 3 / 4, DISPLAY_CUTOUT_HEIGHT, + Path.Direction.CCW); + + Matrix m = new Matrix(); + transformPhysicalToLogicalCoordinates(rotation, DISPLAY_WIDTH, DISPLAY_HEIGHT, m); + p.transform(m); + + return DisplayCutout.fromBounds(p); + } + static class TestContextWrapper extends ContextWrapper { private final TestableResources mResourceMocker; diff --git a/services/tests/servicestests/src/com/android/server/wm/TestWindowManagerPolicy.java b/services/tests/servicestests/src/com/android/server/wm/TestWindowManagerPolicy.java index 7a559046f7b8..0b99eaa4a570 100644 --- a/services/tests/servicestests/src/com/android/server/wm/TestWindowManagerPolicy.java +++ b/services/tests/servicestests/src/com/android/server/wm/TestWindowManagerPolicy.java @@ -45,6 +45,7 @@ import android.os.Bundle; import android.os.IBinder; import android.os.RemoteException; import android.view.Display; +import android.view.DisplayCutout; import android.view.IWindowManager; import android.view.InputChannel; import android.view.KeyEvent; @@ -169,25 +170,25 @@ class TestWindowManagerPolicy implements WindowManagerPolicy { @Override public int getNonDecorDisplayWidth(int fullWidth, int fullHeight, int rotation, int uiMode, - int displayId) { + int displayId, DisplayCutout displayCutout) { return 0; } @Override public int getNonDecorDisplayHeight(int fullWidth, int fullHeight, int rotation, int uiMode, - int displayId) { + int displayId, DisplayCutout displayCutout) { return 0; } @Override public int getConfigDisplayWidth(int fullWidth, int fullHeight, int rotation, int uiMode, - int displayId) { + int displayId, DisplayCutout displayCutout) { return 0; } @Override public int getConfigDisplayHeight(int fullWidth, int fullHeight, int rotation, int uiMode, - int displayId) { + int displayId, DisplayCutout displayCutout) { return 0; } @@ -589,7 +590,7 @@ class TestWindowManagerPolicy implements WindowManagerPolicy { @Override public void getStableInsetsLw(int displayRotation, int displayWidth, int displayHeight, - Rect outInsets) { + DisplayCutout cutout, Rect outInsets) { } @@ -606,7 +607,7 @@ class TestWindowManagerPolicy implements WindowManagerPolicy { @Override public void getNonDecorInsetsLw(int displayRotation, int displayWidth, int displayHeight, - Rect outInsets) { + DisplayCutout cutout, Rect outInsets) { }