aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/LatinIME.java
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2012-05-21 14:10:50 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2012-05-21 14:10:50 -0700
commit6fbb8c8fc3f7ff1096477e3c8ea15fb295d42637 (patch)
tree2efc8cec077e56181ec8591e33fba09bb760b203 /java/src/com/android/inputmethod/latin/LatinIME.java
parent8dc4386a747428a94ca18d8b7840b04f14444cc0 (diff)
parent628a5745e19d227cdff2370704a4958e2791eb5a (diff)
downloadlatinime-6fbb8c8fc3f7ff1096477e3c8ea15fb295d42637.tar.gz
latinime-6fbb8c8fc3f7ff1096477e3c8ea15fb295d42637.tar.xz
latinime-6fbb8c8fc3f7ff1096477e3c8ea15fb295d42637.zip
am 628a5745: am 75c60bf3: Merge "Change auto caps mode argument to int type" into jb-dev
* commit '628a5745e19d227cdff2370704a4958e2791eb5a': Change auto caps mode argument to int type
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java19
1 files changed, 11 insertions, 8 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index f27968cd4..c5eb2c69d 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -1041,26 +1041,28 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
updateSuggestions();
}
- public boolean getCurrentAutoCapsState() {
- if (!mSettingsValues.mAutoCap) return false;
+ public int getCurrentAutoCapsState() {
+ if (!mSettingsValues.mAutoCap) return Constants.TextUtils.CAP_MODE_OFF;
final EditorInfo ei = getCurrentInputEditorInfo();
- if (ei == null) return false;
+ if (ei == null) return Constants.TextUtils.CAP_MODE_OFF;
final int inputType = ei.inputType;
- if ((inputType & InputType.TYPE_TEXT_FLAG_CAP_CHARACTERS) != 0) return true;
+ if ((inputType & InputType.TYPE_TEXT_FLAG_CAP_CHARACTERS) != 0) {
+ return TextUtils.CAP_MODE_CHARACTERS;
+ }
final boolean noNeedToCheckCapsMode = (inputType & (InputType.TYPE_TEXT_FLAG_CAP_SENTENCES
| InputType.TYPE_TEXT_FLAG_CAP_WORDS)) == 0;
- if (noNeedToCheckCapsMode) return false;
+ if (noNeedToCheckCapsMode) return Constants.TextUtils.CAP_MODE_OFF;
final InputConnection ic = getCurrentInputConnection();
- if (ic == null) return false;
+ if (ic == null) return Constants.TextUtils.CAP_MODE_OFF;
// TODO: This blocking IPC call is heavy. Consider doing this without using IPC calls.
// Note: getCursorCapsMode() returns the current capitalization mode that is any
// combination of CAP_MODE_CHARACTERS, CAP_MODE_WORDS, and CAP_MODE_SENTENCES. 0 means none
// of them.
- return ic.getCursorCapsMode(inputType) != 0;
+ return ic.getCursorCapsMode(inputType);
}
// "ic" may be null
@@ -1531,7 +1533,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
if (ic != null) {
// If it's the first letter, make note of auto-caps state
if (mWordComposer.size() == 1) {
- mWordComposer.setAutoCapitalized(getCurrentAutoCapsState());
+ mWordComposer.setAutoCapitalized(
+ getCurrentAutoCapsState() != Constants.TextUtils.CAP_MODE_OFF);
}
ic.setComposingText(getTextWithUnderline(mWordComposer.getTypedWord()), 1);
}