aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2012-02-01 22:29:26 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2012-02-01 22:29:26 -0800
commita4406722cf8eabed397773e36b36df07d4f5a016 (patch)
tree008c72696829bd51e4c5d23505a149b0a2a755a1 /java/src
parent67ec8e670a7505f67d9fe1b7d5f12b873274c33c (diff)
parent51fd1632f59bd9aaeb5c98ff031f1618e8c31c59 (diff)
downloadlatinime-a4406722cf8eabed397773e36b36df07d4f5a016.tar.gz
latinime-a4406722cf8eabed397773e36b36df07d4f5a016.tar.xz
latinime-a4406722cf8eabed397773e36b36df07d4f5a016.zip
am 51fd1632: Stop throwing an exception in some corner cases.
* commit '51fd1632f59bd9aaeb5c98ff031f1618e8c31c59': Stop throwing an exception in some corner cases.
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java19
1 files changed, 10 insertions, 9 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 19cd16ad2..1bc55a583 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -872,13 +872,11 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
// turn this flag on in succession and both onUpdateSelection() calls arrive after
// the second one - the first call successfully avoids this test, but the second one
// enters. For the moment we rely on candidatesCleared to further reduce the impact.
- if (SPACE_STATE_WEAK == mSpaceState) {
- // Test for no WEAK_SPACE action because there is a race condition that may end up
- // in coming here on a normal key press. We set this to NONE because after
- // a cursor move, we don't want the suggestion strip to swap the space with the
- // newly inserted punctuation.
- mSpaceState = SPACE_STATE_NONE;
- }
+
+ // We set this to NONE because after a cursor move, we don't want the space
+ // state-related special processing to kick in.
+ mSpaceState = SPACE_STATE_NONE;
+
if (((mWordComposer.isComposingWord())
|| mVoiceProxy.isVoiceInputHighlighted())
&& (selectionChanged || candidatesCleared)) {
@@ -2221,9 +2219,12 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
// be needed, but it's there just in case something went wrong.
final CharSequence textBeforeCursor = ic.getTextBeforeCursor(2, 0);
if (!". ".equals(textBeforeCursor)) {
- // We should not have come here if we aren't just after a ". ".
- throw new RuntimeException("Tried to revert double-space combo but we didn't find "
+ // Theoretically we should not be coming here if there isn't ". " before the
+ // cursor, but the application may be changing the text while we are typing, so
+ // anything goes. We should not crash.
+ Log.d(TAG, "Tried to revert double-space combo but we didn't find "
+ "\". \" just before the cursor.");
+ return false;
}
ic.beginBatchEdit();
ic.deleteSurroundingText(2, 0);