From ad0642cf258ca9b123f74ca0ae8bf970792908f1 Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Wed, 19 Sep 2012 12:52:06 +0900 Subject: [PATCH] Fix a bug that would persist caps lock state ...with regards to suggestions. It's much simpler to look at whether the word is actually all capitalized or not. Bug: 7113544 Change-Id: Idc0e77b2f812964e650ade0e32b9d4c09228cb74 --- java/src/com/android/inputmethod/latin/WordComposer.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/java/src/com/android/inputmethod/latin/WordComposer.java b/java/src/com/android/inputmethod/latin/WordComposer.java index 7785e3fb9..275ebf305 100644 --- a/java/src/com/android/inputmethod/latin/WordComposer.java +++ b/java/src/com/android/inputmethod/latin/WordComposer.java @@ -265,9 +265,12 @@ public class WordComposer { * @return true if all user typed chars are upper case, false otherwise */ public boolean isAllUpperCase() { - return mCapitalizedMode == CAPS_MODE_AUTO_SHIFT_LOCKED - || mCapitalizedMode == CAPS_MODE_MANUAL_SHIFT_LOCKED - || (mCapsCount > 1) && (mCapsCount == size()); + if (size() <= 1) { + return mCapitalizedMode == CAPS_MODE_AUTO_SHIFT_LOCKED + || mCapitalizedMode == CAPS_MODE_MANUAL_SHIFT_LOCKED; + } else { + return mCapsCount == size(); + } } public boolean wasShiftedNoLock() {