aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/LatinIME.java
diff options
context:
space:
mode:
authorsatok <satok@google.com>2011-07-21 14:57:28 +0900
committersatok <satok@google.com>2011-07-21 16:07:00 +0900
commit795a712ecf1847251c2da02351e0812a2b5d4bb9 (patch)
treefeef7c925706601b935926408d41fcc1301f7b3a /java/src/com/android/inputmethod/latin/LatinIME.java
parent850758908552a6abc9b1a395a617a4c7d0c0d218 (diff)
downloadlatinime-795a712ecf1847251c2da02351e0812a2b5d4bb9.tar.gz
latinime-795a712ecf1847251c2da02351e0812a2b5d4bb9.tar.xz
latinime-795a712ecf1847251c2da02351e0812a2b5d4bb9.zip
Guard unused voice functions
Bug: 4985273 Change-Id: I9491b4af24e636cba6362cdde44568d14f7b2b85
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java21
1 files changed, 12 insertions, 9 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 5d8fd3411..e5d2f7578 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -542,12 +542,15 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
TextEntryState.reset();
- // Most such things we decide below in initializeInputAttributesAndGetMode, but we need to
- // know now whether this is a password text field, because we need to know now whether we
- // want to enable the voice button.
- final VoiceProxy voiceIme = mVoiceProxy;
- voiceIme.resetVoiceStates(InputTypeCompatUtils.isPasswordInputType(attribute.inputType)
- || InputTypeCompatUtils.isVisiblePasswordInputType(attribute.inputType));
+ if (attribute != null) {
+ // Most such things we decide below in initializeInputAttributesAndGetMode, but we need
+ // to know now whether this is a password text field, because we need to know now
+ // whether we want to enable the voice button.
+ mVoiceProxy.resetVoiceStates(
+ InputTypeCompatUtils.isPasswordInputType(attribute.inputType)
+ || InputTypeCompatUtils.isVisiblePasswordInputType(
+ attribute.inputType));
+ }
initializeInputAttributes(attribute);
@@ -573,8 +576,8 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
if (mSubtypeSwitcher.isKeyboardMode()) {
switcher.loadKeyboard(attribute,
- mSubtypeSwitcher.isShortcutImeEnabled() && voiceIme.isVoiceButtonEnabled(),
- voiceIme.isVoiceButtonOnPrimary());
+ mSubtypeSwitcher.isShortcutImeEnabled() && mVoiceProxy.isVoiceButtonEnabled(),
+ mVoiceProxy.isVoiceButtonOnPrimary());
switcher.updateShiftState();
}
@@ -592,7 +595,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
// If we just entered a text field, maybe it has some old text that requires correction
mRecorrection.checkRecorrectionOnStart();
- voiceIme.onStartInputView(inputView.getWindowToken());
+ mVoiceProxy.onStartInputView(inputView.getWindowToken());
if (TRACE) Debug.startMethodTracing("/data/trace/latinime");
}