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
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值