Avoid disk writes on UI thread.
Change-Id: I0a498e47afb2c9a5241e2f329c39e266550135a5main
parent
f8ddd13b40
commit
9313bef894
|
@ -288,11 +288,18 @@ public class SubtypeSwitcher {
|
||||||
////////////////////////////
|
////////////////////////////
|
||||||
|
|
||||||
public void switchToShortcutIME() {
|
public void switchToShortcutIME() {
|
||||||
IBinder token = mService.getWindow().getWindow().getAttributes().token;
|
final IBinder token = mService.getWindow().getWindow().getAttributes().token;
|
||||||
if (token == null || mShortcutInfo == null) {
|
if (token == null || mShortcutInfo == null) {
|
||||||
return;
|
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() {
|
public Drawable getShortcutIcon() {
|
||||||
|
|
Loading…
Reference in New Issue