From ac57ddeb4c69396db11bb9c3861d067ee87c7163 Mon Sep 17 00:00:00 2001 From: Chilun Huang Date: Mon, 11 Jul 2022 15:19:16 +0800 Subject: [PATCH] Workaround to return 1/3 of the position Some devices in portrait mode have the same symptoms as b/234322284. Simply return 1/3 of the position like the X axis to solve the problem. Bug: 238202110 Test: atest Launcher3Tests:TaplTestsLauncher3#testAddDeleteShortcutOnHotseat Change-Id: Ic7d3756cfbda6673a62b266c6093745b8311e6ac --- src/com/android/launcher3/testing/TestInformationHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/android/launcher3/testing/TestInformationHandler.java b/src/com/android/launcher3/testing/TestInformationHandler.java index 7f444d6689..0334b969c2 100644 --- a/src/com/android/launcher3/testing/TestInformationHandler.java +++ b/src/com/android/launcher3/testing/TestInformationHandler.java @@ -206,7 +206,7 @@ public class TestInformationHandler implements ResourceBasedOverride { /* spanX= */ 1, /* spanY= */ 1); // TODO(b/234322284): return the real center point. return new Point(cellRect.left + (cellRect.right - cellRect.left) / 3, - cellRect.centerY()); + cellRect.top + (cellRect.bottom - cellRect.top) / 3); }); }