diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2022-03-30 17:44:44 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2022-03-30 17:44:44 +0000 |
commit | dc4dad8ec430c014674a40efe9dfae528ab51700 (patch) | |
tree | cf9d66ae5e63423f5f36d570f00371a685ea4464 /tests | |
parent | aa35c39167a290880363c0f1acf91691a4ab36dd (diff) | |
parent | c8aada443303fa8fe6aa2bbf99efc2e2790e1824 (diff) | |
download | Launcher3-dc4dad8ec430c014674a40efe9dfae528ab51700.tar.gz |
Merge "Moving away from obsolete Display#getRealSize()." into tm-dev
Diffstat (limited to 'tests')
-rw-r--r-- | tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java index 8e0eb7b071..f270cd55e6 100644 --- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java @@ -877,10 +877,9 @@ public final class LauncherInstrumentation { } /** + * @return the Workspace object. * @deprecated use goHome(). * Presses nav bar home button. - * - * @return the Workspace object. */ @Deprecated public Workspace pressHome() { @@ -1653,6 +1652,13 @@ public final class LauncherInstrumentation { Point getRealDisplaySize() { final Point size = new Point(); getContext().getSystemService(WindowManager.class).getDefaultDisplay().getRealSize(size); + final Rect winMetricsHeight = getContext().getSystemService(WindowManager.class) + .getMaximumWindowMetrics() + .getBounds(); + final Point winMetricsSize = new Point(winMetricsHeight.width(), winMetricsHeight.height()); + if (!winMetricsSize.equals(size)) { + fail("Display size mismatch: " + size + " vs " + winMetricsSize); + } return size; } |