Report bounds instead of size in WindowMetrics

Use case: Jetpack WM will use them to get the location of windows on
screen and compute the display feature positions in window coordinate
space.

Bug: 150908045
Test: atest FrameworksCoreTests:WindowMetricsTest
Test: atest CtsWindowManagerDeviceTestCases:WindowMetricsTests
Change-Id: Ia08950cd5df35971408e8b17bb27d97d29d0ab9b
Exempt-From-Owner-Approval: API change
This commit is contained in:
Andrii Kulian
2020-03-05 19:34:43 -08:00
committed by Charles Chen
parent 8f36aba1fb
commit 0be1d67b68
25 changed files with 84 additions and 94 deletions

View File

@@ -223,7 +223,7 @@ public class TouchUtils {
public static void dragViewToBottom(InstrumentationTestCase test, Activity activity, View v,
int stepCount) {
int screenHeight =
activity.getWindowManager().getCurrentWindowMetrics().getSize().getHeight();
activity.getWindowManager().getCurrentWindowMetrics().getBounds().height();
int[] xy = new int[2];
v.getLocationOnScreen(xy);