diff options
| author | satok <satok@google.com> | 2010-10-06 22:46:32 -0700 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-10-06 22:46:32 -0700 |
| commit | 5847b20c0cd926da2890563fd24a23974b43c674 (patch) | |
| tree | 4459e42381bf79e05fd0c6510457bd7350b39352 /services/java/com/android/server/InputMethodManagerService.java | |
| parent | 7172bdac3145a01dd95d58acb9987b7a0eb374ee (diff) | |
| parent | 47a44916e2fb33cf4751906386d5f5c903b28d8b (diff) | |
Merge "Add InputMethodEnabler for enabling input methods and subtypes"
Diffstat (limited to 'services/java/com/android/server/InputMethodManagerService.java')
| -rw-r--r-- | services/java/com/android/server/InputMethodManagerService.java | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/services/java/com/android/server/InputMethodManagerService.java b/services/java/com/android/server/InputMethodManagerService.java index 9a5423c0c889..dc4194cb1683 100644 --- a/services/java/com/android/server/InputMethodManagerService.java +++ b/services/java/com/android/server/InputMethodManagerService.java @@ -25,6 +25,7 @@ import com.android.internal.view.IInputMethodClient; import com.android.internal.view.IInputMethodManager; import com.android.internal.view.IInputMethodSession; import com.android.internal.view.InputBindResult; +import com.android.internal.view.InputMethodAndSubtypeEnabler; import com.android.server.StatusBarManagerService; @@ -97,6 +98,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_UNBIND_INPUT = 1000; static final int MSG_BIND_INPUT = 1010; @@ -1225,7 +1227,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub synchronized (mMethodMap) { if (mCurClient == null || client == null || mCurClient.client.asBinder() != client.asBinder()) { - Slog.w(TAG, "Ignoring showInputMethodDialogFromClient of uid " + Slog.w(TAG, "Ignoring showInputMethodPickerFromClient of uid " + Binder.getCallingUid() + ": " + client); } @@ -1237,13 +1239,26 @@ public class InputMethodManagerService extends IInputMethodManager.Stub synchronized (mMethodMap) { if (mCurClient == null || client == null || mCurClient.client.asBinder() != client.asBinder()) { - Slog.w(TAG, "Ignoring showInputSubtypeMethodDialogFromClient of: " + client); + Slog.w(TAG, "Ignoring showInputMethodSubtypePickerFromClient of: " + client); } mHandler.sendEmptyMessage(MSG_SHOW_IM_SUBTYPE_PICKER); } } + public void showInputMethodAndSubtypeEnablerFromClient( + IInputMethodClient client, String topId) { + // TODO: Handle topId for setting the top position of the list activity + 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); + } + } + public void setInputMethod(IBinder token, String id) { setInputMethodWithSubtype(token, id, NOT_A_SUBTYPE_ID); } @@ -1336,6 +1351,10 @@ public class InputMethodManagerService extends IInputMethodManager.Stub showInputMethodSubtypeMenu(); return true; + case MSG_SHOW_IM_SUBTYPE_ENABLER: + showInputMethodAndSubtypeEnabler(); + return true; + // --------------------------------------------------------- case MSG_UNBIND_INPUT: @@ -1528,6 +1547,14 @@ public class InputMethodManagerService extends IInputMethodManager.Stub showInputMethodMenuInternal(true); } + private void showInputMethodAndSubtypeEnabler() { + Intent intent = new Intent(); + intent.setClassName("android", InputMethodAndSubtypeEnabler.class.getCanonicalName()); + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK + | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED); + mContext.startActivity(intent); + } + private void showInputMethodMenuInternal(boolean showSubtypes) { if (DEBUG) Slog.v(TAG, "Show switching menu"); |
