diff options
author | Satoshi Kataoka <satok@google.com> | 2013-08-07 15:43:29 +0900 |
---|---|---|
committer | Satoshi Kataoka <satok@google.com> | 2013-08-07 17:12:58 +0900 |
commit | e9a6f9713ca48aab9a6c87e0645cb0a0af946a11 (patch) | |
tree | 2908165f61df85e877dbd37c29b1fb3fab2464fb /services/java/com/android/server/InputMethodManagerService.java | |
parent | 32c5eb3bf89938ba2221e67362571628e1efd520 (diff) |
Reduce the transaction fee of getEnabledInputMethodSubtypeList
Bug: 8467480
Change-Id: Ic1fddfe433e097041fcb09d1fd341d77d7d8b13b
Diffstat (limited to 'services/java/com/android/server/InputMethodManagerService.java')
-rw-r--r-- | services/java/com/android/server/InputMethodManagerService.java | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/services/java/com/android/server/InputMethodManagerService.java b/services/java/com/android/server/InputMethodManagerService.java index da584e2012b4..f442f11eb873 100644 --- a/services/java/com/android/server/InputMethodManagerService.java +++ b/services/java/com/android/server/InputMethodManagerService.java @@ -969,19 +969,25 @@ public class InputMethodManagerService extends IInputMethodManager.Stub } /** - * @param imi if null, returns enabled subtypes for the current imi + * @param imiId if null, returns enabled subtypes for the current imi * @return enabled subtypes of the specified imi */ @Override - public List<InputMethodSubtype> getEnabledInputMethodSubtypeList(InputMethodInfo imi, + public List<InputMethodSubtype> getEnabledInputMethodSubtypeList(String imiId, boolean allowsImplicitlySelectedSubtypes) { // TODO: Make this work even for non-current users? if (!calledFromValidUser()) { - return Collections.emptyList(); + return Collections.<InputMethodSubtype>emptyList(); } synchronized (mMethodMap) { - if (imi == null && mCurMethodId != null) { + final InputMethodInfo imi; + if (imiId == null && mCurMethodId != null) { imi = mMethodMap.get(mCurMethodId); + } else { + imi = mMethodMap.get(imiId); + } + if (imi == null) { + return Collections.<InputMethodSubtype>emptyList(); } return mSettings.getEnabledInputMethodSubtypeListLocked( mContext, imi, allowsImplicitlySelectedSubtypes); |