[IInputMethodManager]管理输入法(IME)的接口说明

好的,以下是 IInputMethodManager.aidl 接口文件中方法的分类整理与简洁说明,按照你提供的格式风格进行组织:


📋 IInputMethodManager.aidl 方法分类说明

一、输入法客户端管理

方法名参数描述
addClient(in IInputMethodClient client, in IRemoteInputConnection inputmethod, int untrustedDisplayId)client/输入连接/displayId添加一个输入法客户端

二、输入法信息查询

方法名参数描述
getCurrentInputMethodInfoAsUser(int userId)userId获取当前用户使用的输入法信息
getInputMethodList(int userId, int directBootAwareness)userId/boot模式获取所有输入法列表
getEnabledInputMethodList(int userId)userId获取已启用的输入法列表
getEnabledInputMethodSubtypeList(String imiId, boolean allowsImplicitlyEnabledSubtypes, int userId)imeId/是否允许隐式启用/userId获取输入法子类型列表
getLastInputMethodSubtype(int userId)userId获取最后一次使用的子类型
getCurrentInputMethodSubtype(int userId)userId获取当前输入法子类型

三、软键盘显示控制

方法名参数描述
showSoftInput(IInputMethodClient client, IBinder windowToken, ImeTracker.Token statsToken, int flags, int lastClickToolType, ResultReceiver resultReceiver, int reason)client/windowToken/统计令牌/标志位/点击工具类型/回调/原因显示软键盘
hideSoftInput(IInputMethodClient client, IBinder windowToken, ImeTracker.Token statsToken, int flags, ResultReceiver resultReceiver, int reason)client/windowToken/统计令牌/标志位/回调/原因隐藏软键盘

四、输入法启动与焦点处理

方法名参数描述
startInputOrWindowGainedFocus(...)多参数(reason/client/token/editorInfo/inputConnection/用户ID等)窗口获得焦点时启动输入法

五、输入法选择器控制

方法名参数描述
showInputMethodPickerFromClient(IInputMethodClient client, int auxiliarySubtypeMode)client/辅助子类型模式客户端调用显示输入法选择器
showInputMethodPickerFromSystem(int auxiliarySubtypeMode, int displayId)辅助子类型模式/displayId系统调用显示输入法选择器
isInputMethodPickerShownForTest()-测试用途:判断选择器是否显示

六、输入法配置与设置

方法名参数描述
setAdditionalInputMethodSubtypes(String id, InputMethodSubtype[] subtypes, int userId)输入法ID/子类型数组/userId设置额外子类型
setExplicitlyEnabledInputMethodSubtypes(String imeId, int[] subtypeHashCodes, int userId)输入法ID/子类型哈希码数组/userId显式启用指定子类型

七、IME 表面控制(Surface)

方法名参数描述
removeImeSurface()-移除 IME 的 Surface(需系统权限)
removeImeSurfaceFromWindowAsync(IBinder windowToken)windowToken异步移除指定窗口的 IME Surface

八、手写笔支持(Stylus Handwriting)

方法名参数描述
startStylusHandwriting(IInputMethodClient client)client启动手写笔输入会话
prepareStylusHandwritingDelegation(...)client/userId/代理包名/委托者包名准备将手写会话委托给其他编辑器
acceptStylusHandwritingDelegation(...)client/userId/代理包名/委托者包名接受并开始手写委托会话
isStylusHandwritingAvailableAsUser(int userId)userId是否支持手写笔输入
addVirtualStylusIdForTestSession(...)client测试用:添加虚拟手写笔 ID
setStylusWindowIdleTimeoutForTest(...)client/timeout设置测试会话空闲超时时间

九、调试与性能监控

方法名参数描述
startProtoDump(byte[] protoDump, int source, String where)dump数据/来源位置开始 Proto Dump(调试用)
isImeTraceEnabled()-是否启用了 IME 跟踪
startImeTrace()-开始 IME 跟踪
stopImeTrace()-停止 IME 跟踪

十、其他功能

方法名参数描述
reportVirtualDisplayGeometryAsync(...)parentClient/childDisplayId/matrixValues报告虚拟显示几何变换矩阵
reportPerceptibleAsync(IBinder windowToken, boolean perceptible)windowToken/可见性报告窗口是否“感知可见”
getInputMethodWindowVisibleHeight(IInputMethodClient client)client获取输入法窗口可视高度(遗留 API)

十一、系统服务接口

方法名参数描述
getImeTrackerService()-获取 IME 追踪服务实例(用于日志和跟踪)

如需对某一类方法进行更深入解析或生成使用示例,请告诉我类别或方法名。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值