summaryrefslogtreecommitdiffstats
path: root/core/java/android
diff options
context:
space:
mode:
authorsatok <satok@google.com>2010-11-24 11:06:49 +0900
committersatok <satok@google.com>2010-11-24 12:28:45 +0900
commit2820351489537698ad153c6397edf3270455edc5 (patch)
treeac5bcee60b4ddde371d7b4d0c75881821522d04d /core/java/android
parent07cb89432cf1687ba4f903f56bc1d92979d2cd4a (diff)
downloadframeworks_base-2820351489537698ad153c6397edf3270455edc5.zip
frameworks_base-2820351489537698ad153c6397edf3270455edc5.tar.gz
frameworks_base-2820351489537698ad153c6397edf3270455edc5.tar.bz2
Add an API to set InputMethodAndSubtype
Change-Id: I66f1a4c8e0d98705614f12a737e7efcd0263b72a
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/view/inputmethod/InputMethodManager.java25
1 files changed, 21 insertions, 4 deletions
diff --git a/core/java/android/view/inputmethod/InputMethodManager.java b/core/java/android/view/inputmethod/InputMethodManager.java
index 621a908..9bc1c22 100644
--- a/core/java/android/view/inputmethod/InputMethodManager.java
+++ b/core/java/android/view/inputmethod/InputMethodManager.java
@@ -1278,10 +1278,10 @@ public final class InputMethodManager {
}
}
}
-
+
/**
- * Force switch to a new input method component. This can only be called
- * from the currently active input method, as validated by the given token.
+ * Force switch to a new input method component. This can only be called
+ * from an application or a service which has a token of the currently active input method.
* @param token Supplies the identifying token given to an input method
* when it was started, which allows it to perform this operation on
* itself.
@@ -1294,7 +1294,24 @@ public final class InputMethodManager {
throw new RuntimeException(e);
}
}
-
+
+ /**
+ * Force switch to a new input method and subtype. This can only be called
+ * from an application or a service which has a token of the currently active input method.
+ * @param token Supplies the identifying token given to an input method
+ * when it was started, which allows it to perform this operation on
+ * itself.
+ * @param id The unique identifier for the new input method to be switched to.
+ * @param subtype The new subtype of the new input method to be switched to.
+ */
+ public void setInputMethodAndSubtype(IBinder token, String id, InputMethodSubtype subtype) {
+ try {
+ mService.setInputMethodAndSubtype(token, id, subtype);
+ } catch (RemoteException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
/**
* Close/hide the input method's soft input area, so the user no longer
* sees it or can interact with it. This can only be called