android系统ime指令
介绍几种android系统中ime的shell指令:
enable指定的输入法
root@kylin32:/data/anr # ime enable com.iflytek.inputmethod.gionee/.FlyIME
Input method com.iflytek.inputmethod.gionee/.FlyIME: now enabled
列出输入法信息,只显示service名称
root@kylin32:/data/anr # ime list -s
com.android.inputmethod.latin/.LatinIME
com.example.android.softkeyboard/.SoftKeyboard
com.iflytek.inputmethod.gionee/.FlyIME
原理:
mImm.getEnabledInputMethodList(); // list -a
mImm.getInputMethodList(); // list -s
disable指定输入法
root@kylin32:/data/anr # ime disable com.iflytek.inputmethod.gionee/.FlyIME
Input method com.iflytek.inputmethod.gionee/.FlyIME: now disabled
root@kylin32:/data/anr # ime list -s
com.android.inputmethod.latin/.LatinIME
com.example.android.softkeyboard/.SoftKeyboard
原理:
mImm.setInputMethodEnabled(id, state);
选择指定输入法用于输入
root@kylin32:/data/anr # ime set com.android.inputmethod.latin/.LatinIME
Input method com.android.inputmethod.latin/.LatinIME selected
原理:
mImm.setInputMethod(null, id);
列出输入法所有信息
root@kylin32:/data/anr # ime list -a
com.android.inputmethod.latin/.LatinIME:
mId=com.android.inputmethod.latin/.LatinIME mSettingsActivityName=com.android.inputmethod.latin.settings.SettingsActivity
mIsDefaultResId=0x7f070000
Service:
priority=0 preferredOrder=0 match=0x108000 specificIndex=-1 isDefault=false
ServiceInfo:
name=com.android.inputmethod.latin.LatinIME
packageName=com.android.inputmethod.latin
labelRes=0x7f0a0037 nonLocalizedLabel=null icon=0x0 banner=0x0
enabled=true exported=true processName=com.android.inputmethod.latin
permission=android.permission.BIND_INPUT_METHOD
flags=0x0
com.iflytek.inputmethod.gionee/.FlyIME:
mId=com.iflytek.inputmethod.gionee/.FlyIME mSettingsActivityName=com.iflytek.inputmethod.gionee.WizardSettingActivity
mIsDefaultResId=0x0
Service:
priority=0 preferredOrder=0 match=0x108000 specificIndex=-1 isDefault=false
ServiceInfo:
name=com.iflytek.inputmethod.gionee.FlyIME
packageName=com.iflytek.inputmethod.gionee
enabled=true exported=true processName=com.iflytek.inputmethod.gionee
permission=android.permission.BIND_INPUT_METHOD
flags=0x0
com.example.android.softkeyboard/.SoftKeyboard:
mId=com.example.android.softkeyboard/.SoftKeyboard mSettingsActivityName=com.example.android.softkeyboard.ImePreferences
mIsDefaultResId=0x0
Service:
priority=0 preferredOrder=0 match=0x108000 specificIndex=-1 isDefault=false
ServiceInfo:
name=com.example.android.softkeyboard.SoftKeyboard
packageName=com.example.android.softkeyboard
enabled=true exported=true processName=com.example.android.softkeyboard
permission=android.permission.BIND_INPUT_METHOD
flags=0x0