summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Keisuke Kuroyanagi <ksk@google.com> 2015-06-11 17:41:00 +0900
committer Keisuke Kuroyanagi <ksk@google.com> 2015-06-11 17:41:00 +0900
commitf4e347d6aec7f1ff09c23aea8f3378d0b390eac6 (patch)
tree78a4ab38d0a50d13b3baf4ad64070bb87b11c1c1
parent4ba81a0878d058734e9eb2c298d7fc4df7e597ed (diff)
Reset drag accelerator state in Editor#sendOnTextChanged.
This fixes a crash that happened because mStartOffset could point to an invalid offset after changing the text. Bug: 21178876 Change-Id: I2fbb5ea3d6b8c5a97ca7248116b58ead673a8b0a
-rw-r--r--core/java/android/widget/Editor.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/java/android/widget/Editor.java b/core/java/android/widget/Editor.java
index e43237aa56c2..cf6a01887baa 100644
--- a/core/java/android/widget/Editor.java
+++ b/core/java/android/widget/Editor.java
@@ -1162,6 +1162,10 @@ public class Editor {
// We do not hide the span controllers, since they can be added when a new text is
// inserted into the text view (voice IME).
hideCursorControllers();
+ // Reset drag accelerator.
+ if (mSelectionModifierCursorController != null) {
+ mSelectionModifierCursorController.resetTouchOffsets();
+ }
stopTextActionMode();
}