From 25854407be292a22be712c7800e44411819fa177 Mon Sep 17 00:00:00 2001 From: Taran Singh Date: Wed, 2 Mar 2022 19:49:48 +0000 Subject: [PATCH] Use local coordinates in CAI#EditorBoundsInfo EditorBoundsInfo uses local coordiantes, it was mistakenly set with screen coordinates Test: atest InputMethodServiceTest Bug: 217957587 Change-Id: Iadeaa793d1331b6208e4b19036c45120b0185f64 --- core/java/android/widget/Editor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/java/android/widget/Editor.java b/core/java/android/widget/Editor.java index 3a7a544a334b6..7f8a68dbd0ea4 100644 --- a/core/java/android/widget/Editor.java +++ b/core/java/android/widget/Editor.java @@ -4595,7 +4595,7 @@ public class Editor { if (includeEditorBounds) { final RectF bounds = new RectF(); - mTextView.getBoundsOnScreen(bounds, false /* clipToParent */); + bounds.set(0 /* left */, 0 /* top */, mTextView.getWidth(), mTextView.getHeight()); EditorBoundsInfo.Builder boundsBuilder = new EditorBoundsInfo.Builder(); //TODO(b/210039666): add Handwriting bounds once they're available. builder.setEditorBoundsInfo(