diff options
author | 2011-01-25 16:52:06 +0900 | |
---|---|---|
committer | 2011-01-25 17:59:39 +0900 | |
commit | 9313bef894cef4be2f5821be1d812b30f1451894 (patch) | |
tree | 418fe5292385992b8b8d9cba05d52790093e094f /java/src | |
parent | f8ddd13b40f7b104ccf0f4ec1106ed76c9084372 (diff) | |
download | latinime-9313bef894cef4be2f5821be1d812b30f1451894.tar.gz latinime-9313bef894cef4be2f5821be1d812b30f1451894.tar.xz latinime-9313bef894cef4be2f5821be1d812b30f1451894.zip |
Avoid disk writes on UI thread.
Change-Id: I0a498e47afb2c9a5241e2f329c39e266550135a5
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/latin/SubtypeSwitcher.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java b/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java index 7a1ac2e27..c1e14ad18 100644 --- a/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java +++ b/java/src/com/android/inputmethod/latin/SubtypeSwitcher.java @@ -288,11 +288,18 @@ public class SubtypeSwitcher { //////////////////////////// public void switchToShortcutIME() { - IBinder token = mService.getWindow().getWindow().getAttributes().token; + final IBinder token = mService.getWindow().getWindow().getAttributes().token; if (token == null || mShortcutInfo == null) { return; } - mImm.setInputMethodAndSubtype(token, mShortcutInfo.getId(), mShortcutSubtype); + final String imiId = mShortcutInfo.getId(); + final InputMethodSubtype subtype = mShortcutSubtype; + new Thread("SwitchToShortcutIME") { + @Override + public void run() { + mImm.setInputMethodAndSubtype(token, imiId, subtype); + } + }.start(); } public Drawable getShortcutIcon() { |