summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/java/android/view/inputmethod/BaseInputConnection.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/java/android/view/inputmethod/BaseInputConnection.java b/core/java/android/view/inputmethod/BaseInputConnection.java
index 5552952049fc..cccfa78544e8 100644
--- a/core/java/android/view/inputmethod/BaseInputConnection.java
+++ b/core/java/android/view/inputmethod/BaseInputConnection.java
@@ -484,10 +484,10 @@ public class BaseInputConnection implements InputConnection {
final Editable content = getEditable();
if (content == null) return false;
int len = content.length();
- if (start > len || end > len) {
+ if (start > len || end > len || start < 0 || end < 0) {
// If the given selection is out of bounds, just ignore it.
// Most likely the text was changed out from under the IME,
- // the the IME is going to have to update all of its state
+ // and the IME is going to have to update all of its state
// anyway.
return true;
}