am b9021090: Fix usages of getEnabledInputMethodSubtypeList

* commit 'b902109000bcef184e69daac7dc3906fc969791e':
  Fix usages of getEnabledInputMethodSubtypeList
main
Satoshi Kataoka 2013-05-09 01:23:44 -07:00 committed by Android Git Automerger
commit a8254f73c2
2 changed files with 12 additions and 7 deletions

View File

@ -100,6 +100,12 @@ public final class RichInputMethodManager {
throw new RuntimeException("Input method id for " + packageName + " not found."); throw new RuntimeException("Input method id for " + packageName + " not found.");
} }
public List<InputMethodSubtype> getMyEnabledInputMethodSubtypeList(
boolean allowsImplicitlySelectedSubtypes) {
return mImmWrapper.mImm.getEnabledInputMethodSubtypeList(
mInputMethodInfoOfThisIme, allowsImplicitlySelectedSubtypes);
}
public boolean switchToNextInputMethod(final IBinder token, final boolean onlyCurrentIme) { public boolean switchToNextInputMethod(final IBinder token, final boolean onlyCurrentIme) {
if (mImmWrapper.switchToNextInputMethod(token, onlyCurrentIme)) { if (mImmWrapper.switchToNextInputMethod(token, onlyCurrentIme)) {
return true; return true;
@ -116,8 +122,8 @@ public final class RichInputMethodManager {
final boolean onlyCurrentIme) { final boolean onlyCurrentIme) {
final InputMethodManager imm = mImmWrapper.mImm; final InputMethodManager imm = mImmWrapper.mImm;
final InputMethodSubtype currentSubtype = imm.getCurrentInputMethodSubtype(); final InputMethodSubtype currentSubtype = imm.getCurrentInputMethodSubtype();
final List<InputMethodSubtype> enabledSubtypes = imm.getEnabledInputMethodSubtypeList( final List<InputMethodSubtype> enabledSubtypes = getMyEnabledInputMethodSubtypeList(
mInputMethodInfoOfThisIme, true /* allowsImplicitlySelectedSubtypes */); true /* allowsImplicitlySelectedSubtypes */);
final int currentIndex = getSubtypeIndexInList(currentSubtype, enabledSubtypes); final int currentIndex = getSubtypeIndexInList(currentSubtype, enabledSubtypes);
if (currentIndex == INDEX_NOT_FOUND) { if (currentIndex == INDEX_NOT_FOUND) {
Log.w(TAG, "Can't find current subtype in enabled subtypes: subtype=" Log.w(TAG, "Can't find current subtype in enabled subtypes: subtype="
@ -214,8 +220,8 @@ public final class RichInputMethodManager {
final InputMethodSubtype subtype) { final InputMethodSubtype subtype) {
final boolean subtypeEnabled = checkIfSubtypeBelongsToThisImeAndEnabled(subtype); final boolean subtypeEnabled = checkIfSubtypeBelongsToThisImeAndEnabled(subtype);
final boolean subtypeExplicitlyEnabled = checkIfSubtypeBelongsToList( final boolean subtypeExplicitlyEnabled = checkIfSubtypeBelongsToList(
subtype, mImmWrapper.mImm.getEnabledInputMethodSubtypeList( subtype, getMyEnabledInputMethodSubtypeList(
mInputMethodInfoOfThisIme, false /* allowsImplicitlySelectedSubtypes */)); false /* allowsImplicitlySelectedSubtypes */));
return subtypeEnabled && !subtypeExplicitlyEnabled; return subtypeEnabled && !subtypeExplicitlyEnabled;
} }
@ -312,8 +318,7 @@ public final class RichInputMethodManager {
if (filteredImisCount > 1) { if (filteredImisCount > 1) {
return true; return true;
} }
final List<InputMethodSubtype> subtypes = final List<InputMethodSubtype> subtypes = getMyEnabledInputMethodSubtypeList(true);
mImmWrapper.mImm.getEnabledInputMethodSubtypeList(null, true);
int keyboardCount = 0; int keyboardCount = 0;
// imm.getEnabledInputMethodSubtypeList(null, true) will return the current IME's // imm.getEnabledInputMethodSubtypeList(null, true) will return the current IME's
// both explicitly and implicitly enabled input method subtype. // both explicitly and implicitly enabled input method subtype.

View File

@ -115,7 +115,7 @@ public final class SubtypeSwitcher {
*/ */
public void updateParametersOnStartInputView() { public void updateParametersOnStartInputView() {
final List<InputMethodSubtype> enabledSubtypesOfThisIme = final List<InputMethodSubtype> enabledSubtypesOfThisIme =
mRichImm.getInputMethodManager().getEnabledInputMethodSubtypeList(null, true); mRichImm.getMyEnabledInputMethodSubtypeList(true);
mNeedsToDisplayLanguage.updateEnabledSubtypeCount(enabledSubtypesOfThisIme.size()); mNeedsToDisplayLanguage.updateEnabledSubtypeCount(enabledSubtypesOfThisIme.size());
updateShortcutIME(); updateShortcutIME();
} }