summaryrefslogtreecommitdiff
path: root/media/tests
diff options
context:
space:
mode:
authorAndrii Kulian <akulian@google.com>2020-03-05 19:34:43 -0800
committerCharles Chen <charlesccchen@google.com>2020-03-24 17:05:50 +0800
commit0be1d67b681982e20f87359a810ba6c94e438378 (patch)
tree2bbe898836e47012ec269d2f5309f3741ccfe36a /media/tests
parent8f36aba1fbd92561475487a81bea71dc1c85e2f6 (diff)
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
Diffstat (limited to 'media/tests')
-rw-r--r--media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/helpers/CameraTestUtils.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/helpers/CameraTestUtils.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/helpers/CameraTestUtils.java
index 25220951dd7b..daeb731ad457 100644
--- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/helpers/CameraTestUtils.java
+++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/helpers/CameraTestUtils.java
@@ -2210,14 +2210,14 @@ public class CameraTestUtils extends Assert {
}
public static Size getPreviewSizeBound(WindowManager windowManager, Size bound) {
- Size windowSize = windowManager.getCurrentWindowMetrics().getSize();
+ Rect windowBounds = windowManager.getCurrentWindowMetrics().getBounds();
- int width = windowSize.getWidth();
- int height = windowSize.getHeight();
+ int width = windowBounds.width();
+ int height = windowBounds.height();
if (height > width) {
height = width;
- width = windowSize.getHeight();
+ width = windowBounds.height();
}
if (bound.getWidth() <= width &&