summaryrefslogtreecommitdiff
path: root/core/java/android/view/View.java
diff options
context:
space:
mode:
authorHaoyu Zhang <haoyuchang@google.com>2022-03-01 11:44:01 -0800
committerHaoyu Zhang <haoyuchang@google.com>2022-03-14 20:23:52 +0000
commit1a458ba0ca70a8c8cbc6d2eff05606164de9e7c5 (patch)
treebef404b82178e14c52ca395b50a6d1cc2cd6a0d7 /core/java/android/view/View.java
parent09e748be5d2520825bab9e3ef289e5133e4ca831 (diff)
Fix: Handwriting only initiate for the first time
Handwriting initiator accidentally changes the View's handwriting area. As a result, it stops working after startHandwriting is called for the View once. This CL fixed the issue by not exposing the internal handwriting area Rect object in the View. Bug: 222117485 Test: manually tested Change-Id: I5cb6231361fbd7566edddb1aebf7b99330c3a8d8 (cherry picked from commit b1ba2dae29761f9b81e2bd652ade3dc92036e718)
Diffstat (limited to 'core/java/android/view/View.java')
-rw-r--r--core/java/android/view/View.java3
1 files changed, 1 insertions, 2 deletions
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index c2229911bf12..0a61f28e73eb 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -12016,7 +12016,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
/**
* Return the handwriting areas set on this view, in its local coordinates.
- * Notice: the caller of this method should not modify the Rect returned.
* @see #setHandwritingArea(Rect)
*
* @hide
@@ -12025,7 +12024,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
public Rect getHandwritingArea() {
final ListenerInfo info = mListenerInfo;
if (info != null) {
- return info.mHandwritingArea;
+ return new Rect(info.mHandwritingArea);
}
return null;
}