diff options
| author | satok <satok@google.com> | 2010-12-17 01:33:56 -0800 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-12-17 01:33:56 -0800 |
| commit | f7ca8f0e4f143e63ddcd892e344f4c71cca92af8 (patch) | |
| tree | cd465de5e54af0082c5a47f752c5a633f8af53ce /services/java/com/android/server/InputMethodManagerService.java | |
| parent | 540d3d26623f44caaa82a5c973cda818cb11f946 (diff) | |
| parent | 217f548e79ab1ac3dd9e5be8fb6feaa6dcbe4000 (diff) | |
Merge "Change "more" button to call InputMethodConfigure in Settings"
Diffstat (limited to 'services/java/com/android/server/InputMethodManagerService.java')
| -rw-r--r-- | services/java/com/android/server/InputMethodManagerService.java | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/services/java/com/android/server/InputMethodManagerService.java b/services/java/com/android/server/InputMethodManagerService.java index 95200fa9d0be..21c9f7d2f138 100644 --- a/services/java/com/android/server/InputMethodManagerService.java +++ b/services/java/com/android/server/InputMethodManagerService.java @@ -99,6 +99,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub static final int MSG_SHOW_IM_PICKER = 1; static final int MSG_SHOW_IM_SUBTYPE_PICKER = 2; static final int MSG_SHOW_IM_SUBTYPE_ENABLER = 3; + static final int MSG_SHOW_IM_CONFIG = 4; static final int MSG_UNBIND_INPUT = 1000; static final int MSG_BIND_INPUT = 1010; @@ -120,6 +121,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub // If IME doesn't support the system locale, the default subtype will be the first defined one. private static final int DEFAULT_SUBTYPE_ID = 0; + private static final String EXTRA_INPUT_METHOD_ID = "input_method_id"; private static final String SUBTYPE_MODE_KEYBOARD = "keyboard"; private static final String SUBTYPE_MODE_VOICE = "voice"; @@ -1313,14 +1315,13 @@ public class InputMethodManagerService extends IInputMethodManager.Stub } public void showInputMethodAndSubtypeEnablerFromClient( - IInputMethodClient client, String topId) { - // TODO: Handle topId for setting the top position of the list ActivityManagerNative + IInputMethodClient client, String inputMethodId) { synchronized (mMethodMap) { if (mCurClient == null || client == null || mCurClient.client.asBinder() != client.asBinder()) { Slog.w(TAG, "Ignoring showInputMethodAndSubtypeEnablerFromClient of: " + client); } - mHandler.sendEmptyMessage(MSG_SHOW_IM_SUBTYPE_ENABLER); + mHandler.sendEmptyMessage(MSG_SHOW_IM_SUBTYPE_ENABLER, inputMethodId); } } @@ -1428,7 +1429,15 @@ public class InputMethodManagerService extends IInputMethodManager.Stub return true; case MSG_SHOW_IM_SUBTYPE_ENABLER: - showInputMethodAndSubtypeEnabler(); + args = (HandlerCaller.SomeArgs)msg.obj; + try { + showInputMethodAndSubtypeEnabler((String)args.arg1); + } catch (RemoteException e) { + } + return true; + + case MSG_SHOW_IM_CONFIG: + showConfigureInputMethods(); return true; // --------------------------------------------------------- @@ -1624,11 +1633,20 @@ public class InputMethodManagerService extends IInputMethodManager.Stub showInputMethodMenuInternal(true); } - private void showInputMethodAndSubtypeEnabler() { + private void showInputMethodAndSubtypeEnabler(String inputMethodId) { Intent intent = new Intent(Settings.ACTION_INPUT_METHOD_AND_SUBTYPE_ENABLER); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED | Intent.FLAG_ACTIVITY_CLEAR_TOP); + intent.putExtra(EXTRA_INPUT_METHOD_ID, inputMethodId); + mContext.startActivity(intent); + } + + private void showConfigureInputMethods() { + Intent intent = new Intent(Settings.ACTION_INPUT_METHOD_SETTINGS); + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK + | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED + | Intent.FLAG_ACTIVITY_CLEAR_TOP); mContext.startActivity(intent); } @@ -1763,7 +1781,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub mDialogBuilder.setPositiveButton(com.android.internal.R.string.more_item_label, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { - showInputMethodAndSubtypeEnabler(); + showConfigureInputMethods(); } }); } |
