diff options
author | 2011-03-25 12:40:57 -0700 | |
---|---|---|
committer | 2011-03-25 12:56:57 -0700 | |
commit | f1a81f5eb37df4170de2cf6327c860e3d64dc2f8 (patch) | |
tree | 7d5c38e8db9d94de0649fb54d2a3e440d5f00d24 /java/src/com/android/inputmethod/compat/EditorInfoCompatUtils.java | |
parent | e9957752bcaad048746c7a57bbd2c0a59e1918a0 (diff) | |
download | latinime-f1a81f5eb37df4170de2cf6327c860e3d64dc2f8.tar.gz latinime-f1a81f5eb37df4170de2cf6327c860e3d64dc2f8.tar.xz latinime-f1a81f5eb37df4170de2cf6327c860e3d64dc2f8.zip |
Move a debug utility function to EditorInfoCompatUtils
- imeOptionName
Change-Id: I7a7ea9bee410cedc0ef9b3d2aa4df8260d7f6a35
Diffstat (limited to 'java/src/com/android/inputmethod/compat/EditorInfoCompatUtils.java')
-rw-r--r-- | java/src/com/android/inputmethod/compat/EditorInfoCompatUtils.java | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/java/src/com/android/inputmethod/compat/EditorInfoCompatUtils.java b/java/src/com/android/inputmethod/compat/EditorInfoCompatUtils.java index 9d83b5463..f6f4f7a59 100644 --- a/java/src/com/android/inputmethod/compat/EditorInfoCompatUtils.java +++ b/java/src/com/android/inputmethod/compat/EditorInfoCompatUtils.java @@ -56,4 +56,44 @@ public class EditorInfoCompatUtils { return; ic.performEditorAction(OBJ_IME_ACTION_PREVIOUS); } + + public static String imeOptionsName(int imeOptions) { + if (imeOptions == -1) + return null; + final int actionId = imeOptions & EditorInfo.IME_MASK_ACTION; + final String action; + switch (actionId) { + case EditorInfo.IME_ACTION_UNSPECIFIED: + action = "actionUnspecified"; + break; + case EditorInfo.IME_ACTION_NONE: + action = "actionNone"; + break; + case EditorInfo.IME_ACTION_GO: + action = "actionGo"; + break; + case EditorInfo.IME_ACTION_SEARCH: + action = "actionSearch"; + break; + case EditorInfo.IME_ACTION_SEND: + action = "actionSend"; + break; + case EditorInfo.IME_ACTION_DONE: + action = "actionDone"; + break; + default: { + if (OBJ_IME_ACTION_PREVIOUS != null && actionId == OBJ_IME_ACTION_PREVIOUS) { + action = "actionPrevious"; + } else { + action = "actionUnknown(" + actionId + ")"; + } + break; + } + } + if ((imeOptions & EditorInfo.IME_FLAG_NO_ENTER_ACTION) != 0) { + return "flagNoEnterAction|" + action; + } else { + return action; + } + } } |