From d1e350c7fce4dd16ec17cbbf717a0fe225af6a7d Mon Sep 17 00:00:00 2001 From: Yunfan Chen Date: Tue, 9 Aug 2022 13:38:43 +0900 Subject: Fix display size calculations in large screen (2/3) The fix is taken from AOSP patch aosp/2154236. This will make sure the UI Automator always has the entire display to interact with. Otherwise, in multi-windowing mode or on devices with task bar, it will only be able to interact with the current focused window, the default launch bounds, or the display excluding task bar, depends on the actual scenario. Test: PlatformSenarioTests Bug: 238981445 Bug: 238985243 Bug: 238581838 Bug: 233945217 Change-Id: I9223ef5552ddb081e75de1242670862f2813e56d --- .../library/core-src/com/android/uiautomator/core/UiDevice.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmds/uiautomator/library/core-src/com/android/uiautomator/core/UiDevice.java b/cmds/uiautomator/library/core-src/com/android/uiautomator/core/UiDevice.java index b1b432bf79ab..6fd2bf250e2c 100644 --- a/cmds/uiautomator/library/core-src/com/android/uiautomator/core/UiDevice.java +++ b/cmds/uiautomator/library/core-src/com/android/uiautomator/core/UiDevice.java @@ -380,7 +380,7 @@ public class UiDevice { Tracer.trace(); Display display = getAutomatorBridge().getDefaultDisplay(); Point p = new Point(); - display.getSize(p); + display.getRealSize(p); return p.x; } @@ -394,7 +394,7 @@ public class UiDevice { Tracer.trace(); Display display = getAutomatorBridge().getDefaultDisplay(); Point p = new Point(); - display.getSize(p); + display.getRealSize(p); return p.y; } -- cgit v1.2.3-59-g8ed1b