summaryrefslogtreecommitdiff
path: root/test-runner
diff options
context:
space:
mode:
authorAndrii Kulian <akulian@google.com>2020-01-26 20:59:07 -0800
committerAndrii Kulian <akulian@google.com>2020-01-31 01:15:21 +0000
commite57f2dc246532d54229046d319d7b907b23288b3 (patch)
treedbb2b0b84814f0fffaf7b80f4c94c4820dfbf2bf /test-runner
parentea325634d3c465817c48f31ad2d5b047661128a6 (diff)
Exempt-From-Owner-Approval: Fix usages of WindowManager.getDefaultDisplay() in f/b
Replace the existing usages of now-deprecated API WindowManager.getDefaultDisplay() with WindowMetrics or Context.getDisplay() in frameworks/base. Bug: 128338354 Test: Build, auto test Change-Id: I02d38a022c5e0e6e9d699f03d35b65d6c8126da9
Diffstat (limited to 'test-runner')
-rw-r--r--test-runner/src/android/test/TouchUtils.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/test-runner/src/android/test/TouchUtils.java b/test-runner/src/android/test/TouchUtils.java
index 28dc7b2f900c..bb4e00ba1ef9 100644
--- a/test-runner/src/android/test/TouchUtils.java
+++ b/test-runner/src/android/test/TouchUtils.java
@@ -222,7 +222,8 @@ public class TouchUtils {
*/
public static void dragViewToBottom(InstrumentationTestCase test, Activity activity, View v,
int stepCount) {
- int screenHeight = activity.getWindowManager().getDefaultDisplay().getHeight();
+ int screenHeight =
+ activity.getWindowManager().getCurrentWindowMetrics().getSize().getHeight();
int[] xy = new int[2];
v.getLocationOnScreen(xy);