暂无描述
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
add codeowners and pull request template Signed-off-by: libing_frank <libing3@huawei.com> | 11 个月前 | |
!9655 merge feat/plugin-display-change-notification into master feat: 添加Plugin显示变更通知和设备控制接口 Created-by: hellohyh001 Commit-by: hellohyh001 Merged-by: openharmony_ci Description: ### 相关的Issue #7437 ### 原因(目的、解决的问题等) Plugin框架(IPluginContext)缺少屏幕变化感知、屏幕信息查询、输入设备查询以及指定输入设备启用/禁用接口。插件在屏幕切换期间需要及时获取屏幕和设备状态,并根据 deviceId 禁用或恢复对应输入设备。 ### 描述(做了什么,变更了什么) - plugin_stage.h: IPluginContext新增DisplayChangeCallback、GetDisplayGroupInfos、GetInputDeviceInfos、RegisterDisplayChangeCallback、UnregisterDisplayChangeCallback、EnableInputDeviceForPlugin、DisableInputDeviceForPlugin - plugin_stage.h: 直接定义PluginDisplayInfo、PluginDisplayGroupInfo;GetInputDeviceInfos直接返回std::vector<std::shared_ptr<InputDevice>>,不新增PluginInputDeviceInfo - multimodal_input_plugin_manager.h/cpp: 实现显示变化回调注册/注销、Plugin注销时自动清理回调、设备查询和设备启用/禁用转发 - input_windows_manager.h/cpp: 新增GetDisplayGroupInfos(),只返回插件所需字段groupId、mainDisplayId、displayId、rsId、mode;UpdateDisplayInfo检测变化后在工作线程直接通知Plugin - input_device_manager.h/cpp: 新增GetInputDeviceInfosForPlugin、EnableInputDeviceForPlugin、DisableInputDeviceForPlugin - BUILD.gn: 新增InputWindowsManagerDisplayChangeTest,移除本需求不再需要的新增ffrt测试依赖 - UT: 补充Plugin显示回调、输入设备查询、设备启用/禁用、显示信息字段查询相关用例 ### 验证结果(新增、改动、可能影响的功能) - 新增: Plugin显示变化回调注册/注销/通知、显示组信息查询、输入设备对象查询、设备启用/禁用 - 改动: UpdateDisplayInfo在感知屏幕变化后直接通知Plugin,不再通过额外ffrt queue异步投递 - 改动: GetDisplayGroupInfos不返回OLD::DisplayInfo/OLD::DisplayGroupInfo,仅返回插件所需字段 - 改动: GetInputDeviceInfos返回InputDevice对象列表,调用方可通过deviceId选择要禁用的输入设备 - 可能影响: Plugin框架接口和显示变化通知路径,不影响非Plugin路径 - 本地执行input目标构建未进入代码编译,环境阻塞: 缺prebuilts/python、缺hvigorw,且Node.js为v20.20.0而构建期望14.21.1 ### 多模输入上库必备 checklist: - [x] 【线程安全】displayCallbacks_使用mutex保护,通知前复制回调列表并释放锁 - [x] 【响应时延】屏幕变化后在工作线程直接回调Plugin,满足屏幕切换期间及时禁用设备诉求 - [x] 【内存泄漏】回调随Plugin注销自动清理(RemoveDisplayCallbacksOf) - [x] 【避免过度设计】未新增display ffrt queue;未新增plugin_info.h;输入设备信息复用InputDevice对象 - [x] 【接口收敛】屏幕查询接口只返回插件必要字段 - [x] 【重用】复用WIN_MGR、INPUT_DEV_MGR已有接口和PostSyncTask语义 - [x] 【返回值】严格检查RET_OK/RET_ERR ### 日志规范自检: - [x] 【规则】高频代码的正常流程中禁止打印日志 - [x] 【规则】在基本不可能发生的点必须要打印日志 - [x] 【规则】事件记录的日志使用 who do what 主谓宾的形式打印 - [x] 【规则】状态变化的日志打印使用 state_name:s1->s2, reason:msg 的形式打印 - [x] 【规则】参数值的日志打印使用 name1=value1, name2=value2… 的形式打印 - [x] 【规则】代码运行成功的日志使用 xxx successful 的形式打印 - [x] 【规则】代码运行失败的日志使用 xxx failed, please xxx 的形式打印 ### 安全编码自检: - [x] 【指针】禁止对指针进行逻辑或位运算,指针解引用时需确认是否存在空指针解引用问题 - [x] 【临时变量】指针变量、表示资源描述符的变量、bool 变量初始化必须赋初值 - [x] 【数组下标】数组下标需要确认是否越界,如果下标来自外部输入,必须校验合法性 - [x] 【内存管理】内存申请前必须对内存大小进行合法性校验 - [x] 【内存管理】内存申请后必须释放 - [x] 【内存管理】内存申请后必须判空,判断内存申请是否成功 - [x] 【内存管理】全局变量释放内存后必须置空 - [x] 【整数运算】整数之间运算时必须严格检查,确保不会出现溢出、反转、除 0 - [x] 【整数运算】禁止对有符号整数进行位操作符运算 - [x] 【循环变量】无符号数作为循环变量需确认是否存在死循环问题 - [x] 【循环变量】循环次数如果受外部数据控制,需要检验其合法性 - [x] 【安全函数】安全函数必须检查返回值,并进行正确处理 - [x] 【安全函数】安全函数目标缓冲区大小入参与目标缓冲区实际大小必须一致 - [x] 【外部输入校验】解析数据后拷贝时需校验源buffer实际缓冲区大小,避免越界读写 - [x] 【外部输入校验】新增外部输入处理需考虑完整校验方案 - [x] 【常见问题】修改单个函数时,如果涉及新增异常返回分支,必须排查是否需要释放内存、fd等资源 - [x] 【常见问题】CHECK_INSTANCE_EXIT_WITH_RETVAL、CHECK_INSTANCE_EXIT_WITH等宏确认无资源漏释放 - [x] 【常见问题】函数返回值需与函数签名相同 - [x] 【常见问题】格式化打印类型需匹配 ### 是否已执行mini system用例 - [ ] 不涉及。新增Plugin框架接口,仍需板侧验证Plugin集成和屏幕切换场景 See merge request: openharmony/multimodalinput_input!9655 | 19 天前 | |
fix: make mmi_tests build for multi-group binding test targets Fix build errors in the newly added test targets so build-target input mmi_tests compiles: - MouseDeviceStateGroupTest: add proxy/include path and ipc:ipc_single dep (mouse_device_state.h -> window_info.h -> iremote_object.h). - mouse_device_state_group_test.cpp / multi_group_binding_test.cpp / multi_group_binding_supplement_test.cpp: add using namespace testing::ext; (TestSize). - MultiGroupBinding{,Supplement}Test: add samgr:samgr_proxy dep (switch_subscriber_handler.h -> system_ability_status_change_stub.h). - event_dump_test.cpp: rename duplicate ParseCommand_014/_015 to _023/_024 (collided with existing cases). - window_manager/test/mock.cpp: drop duplicate GetDeviceGroupId / OnDeviceUnbind (already defined in input_windows_manager.cpp, which InputWindowsManagerEXTest also compiles). - multi_group_binding_supplement_test.cpp: assert pos1 group isolation (was an unused variable -> -Werror). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> 🤖 AI[100%] 🔧 Human Fixed[0%] 🧑 Human[0%] 👌 AI Adopted[100%] Co-authored-by: claude (claude-opus-4-8) <ai@local> Change-Id: I6d7e087081e660e6e568704ca7b3c4d803568687 Signed-off-by: frank_libing <libing3@huawei.com> revert merge request: feat: HID display group device binding (fix mmi_tests build) 0a99650a980cefa519086a8bffe955a6e7f8fe3d This revert merge request !9814 | 2 天前 | |
Add a controller profile Co-Authored-By: Agent Signed-off-by: z-hf <zhanghaifeng45@h-partners.com> | 5 天前 | |
Code variance modification Signed-off-by: duanwenhao <duanwenhao4@huawei.com> Change-Id: I442a20c48a232992b072261bb95edad050c8f636 | 1 年前 | |
update OpenHarmony 2.0 Canary | 5 年前 | |
!9809 merge fix/ace-napi-deps into master fix: add explicit deps for napi:ace_napi public_external_deps downgrade Created-by: athends Commit-by: athends Merged-by: openharmony_ci Description: ### 相关的Issue #7661 ### 原因(目的、解决的问题等) napi:ace_napi 组件将 public_external_deps 降级为 external_deps,node:node_header_notice、libuv:uv、ets_runtime:libark_jsruntime 不再向下游传递。由于 ace_napi 的公开头文件 native_api.h / native_node_api.h 均 include 了 node_api.h,所有依赖 ace_napi 的 target 需显式声明 node:node_header_notice。 ### 描述(做了什么,变更了什么) 1. **node:node_header_notice**(30 个文件)— 所有含 napi:ace_napi 的 external_deps 块中补充 2. **libuv:uv**(4 个文件)— 仅源码直接 #include <uv.h> 的 NAPI target 补充(input_device/input_monitor/input_consumer/infrared_emitter) 3. **bundle.json** — 补充 "node" 到 deps.components 4. **ets_runtime:libark_jsruntime** — 不需要,input 无源文件引用 jsnapi.h / native_engine.h ### 验证结果(新增、改动、可能影响的功能) - 仅修改 BUILD.gn 依赖声明和 bundle.json,不影响运行时行为 - 使用验证脚本逐 external_deps 块检查,确认无遗漏 - 排查了间接传递路径(abilitykit_native 等),input 仓不受影响 ### 多模输入上库必备 checklist: - [x] 【线程安全】不涉及,仅修改 BUILD.gn 依赖声明 - [x] 【内存泄漏】不涉及,仅修改 BUILD.gn 依赖声明 - [x] 【性能】不涉及,仅修改 BUILD.gn 依赖声明 - [x] 【避免深拷贝】不涉及 - [x] 【依赖】新增依赖评审:补充 ace_napi 降级后缺失的显式依赖声明,未引入新功能依赖 - [x] 【重用】不涉及 - [x] 【返回值】不涉及 ### 日志规范自检: - [x] 【规则】不涉及,本次修改不涉及任何日志代码变更 ### 安全编码自检: - [x] 【规则】不涉及,本次修改不涉及任何安全编码相关代码变更 ### 是否已执行mini system用例 - [ ] 已验证 - [x] 不涉及。如不涉及,请写明理由 理由:本次修改仅涉及 BUILD.gn 依赖声明变更,不影响运行时行为 See merge request: openharmony/multimodalinput_input!9809 | 19 小时前 | |
log(mmi): convert remaining CALL_INFO_TRACE function traces to CALL_DEBUG_ENTER CALL_INFO_TRACE emits an Info-level "enter"/"leave" function trace (via InnerFunctionTracer with LOG_INFO), while CALL_DEBUG_ENTER emits the same trace at Debug. Function entry/exit traces are developer diagnostics and should not run at Info in production (the highest-volume ones, e.g. GetProcessName, NotifyBundleName, GetIntervalSinceLastInput, were already migrated). This completes that band by converting every remaining CALL_INFO_TRACE usage to CALL_DEBUG_ENTER, demoting all such traces to Debug. Scope: 505 usage sites across 70 files in service/ (211), intention/ (152), frameworks/ (139), util/ (3). The #define CALL_INFO_TRACE directive in util/common/include/mmi_log.h is preserved (only usages are converted), so the macro still exists for any out-of-tree/test consumer and no redefinition occurs. Safety: the two macros deliberately use distinct tracer variable names (__innerFuncTracer_Debug___ vs ___innerFuncTracer_Info___) so they can coexist. A scope-aware scan (skipping strings/comments) confirmed no scope contains both macros, so renaming cannot create two __innerFuncTracer_Debug___ in one scope. Only the trace-level token is changed; no business logic is touched. TicketNo: (由用户手动关联) Signed-off-by: JustinHu <gchenghu@126.com> Co-Authored-By: Agent | 27 天前 | |
sync from sdk_c Co-Authored-By: Agent Signed-off-by: shangguodong <shangguodong4@h-partners.com> 🤖 AI[100%] 🔧 Human Fixed[0%] 🧑 Human[0%] 👌 AI Adopted[100%] Co-authored-by: claude (glm-5.2) <ai@local> | 2 天前 | |
fix ut Signed-off-by: ninghejuan <ninghejuan@huawei.com> | 2 个月前 | |
hdi interface compatible for multimodalinput Signed-off-by: qianyong325 <qianyong15@h-partners.com> | 7 个月前 | |
!9809 merge fix/ace-napi-deps into master fix: add explicit deps for napi:ace_napi public_external_deps downgrade Created-by: athends Commit-by: athends Merged-by: openharmony_ci Description: ### 相关的Issue #7661 ### 原因(目的、解决的问题等) napi:ace_napi 组件将 public_external_deps 降级为 external_deps,node:node_header_notice、libuv:uv、ets_runtime:libark_jsruntime 不再向下游传递。由于 ace_napi 的公开头文件 native_api.h / native_node_api.h 均 include 了 node_api.h,所有依赖 ace_napi 的 target 需显式声明 node:node_header_notice。 ### 描述(做了什么,变更了什么) 1. **node:node_header_notice**(30 个文件)— 所有含 napi:ace_napi 的 external_deps 块中补充 2. **libuv:uv**(4 个文件)— 仅源码直接 #include <uv.h> 的 NAPI target 补充(input_device/input_monitor/input_consumer/infrared_emitter) 3. **bundle.json** — 补充 "node" 到 deps.components 4. **ets_runtime:libark_jsruntime** — 不需要,input 无源文件引用 jsnapi.h / native_engine.h ### 验证结果(新增、改动、可能影响的功能) - 仅修改 BUILD.gn 依赖声明和 bundle.json,不影响运行时行为 - 使用验证脚本逐 external_deps 块检查,确认无遗漏 - 排查了间接传递路径(abilitykit_native 等),input 仓不受影响 ### 多模输入上库必备 checklist: - [x] 【线程安全】不涉及,仅修改 BUILD.gn 依赖声明 - [x] 【内存泄漏】不涉及,仅修改 BUILD.gn 依赖声明 - [x] 【性能】不涉及,仅修改 BUILD.gn 依赖声明 - [x] 【避免深拷贝】不涉及 - [x] 【依赖】新增依赖评审:补充 ace_napi 降级后缺失的显式依赖声明,未引入新功能依赖 - [x] 【重用】不涉及 - [x] 【返回值】不涉及 ### 日志规范自检: - [x] 【规则】不涉及,本次修改不涉及任何日志代码变更 ### 安全编码自检: - [x] 【规则】不涉及,本次修改不涉及任何安全编码相关代码变更 ### 是否已执行mini system用例 - [ ] 已验证 - [x] 不涉及。如不涉及,请写明理由 理由:本次修改仅涉及 BUILD.gn 依赖声明变更,不影响运行时行为 See merge request: openharmony/multimodalinput_input!9809 | 19 小时前 | |
fix: add explicit deps for napi:ace_napi public_external_deps downgrade ace_napi downgraded public_external_deps to external_deps, breaking transitive propagation of node:node_header_notice and libuv:uv. - Add node:node_header_notice to all targets with napi:ace_napi (30 files) because native_api.h/native_node_api.h include node_api.h - Add libuv:uv to targets whose sources include uv.h (4 files) - Add "node" to bundle.json deps.components - ets_runtime:libark_jsruntime not needed (no source includes jsnapi.h) Fixes #7661 Co-Authored-By: Agent Signed-off-by: athends <huwanyong1@huawei.com> 🤖 AI[100%] 🔧 Human Fixed[0%] 🧑 Human[0%] 👌 AI Adopted[100%] Co-authored-by: opencode (glm-5.2) <ai@local> | 6 天前 | |
!9809 merge fix/ace-napi-deps into master fix: add explicit deps for napi:ace_napi public_external_deps downgrade Created-by: athends Commit-by: athends Merged-by: openharmony_ci Description: ### 相关的Issue #7661 ### 原因(目的、解决的问题等) napi:ace_napi 组件将 public_external_deps 降级为 external_deps,node:node_header_notice、libuv:uv、ets_runtime:libark_jsruntime 不再向下游传递。由于 ace_napi 的公开头文件 native_api.h / native_node_api.h 均 include 了 node_api.h,所有依赖 ace_napi 的 target 需显式声明 node:node_header_notice。 ### 描述(做了什么,变更了什么) 1. **node:node_header_notice**(30 个文件)— 所有含 napi:ace_napi 的 external_deps 块中补充 2. **libuv:uv**(4 个文件)— 仅源码直接 #include <uv.h> 的 NAPI target 补充(input_device/input_monitor/input_consumer/infrared_emitter) 3. **bundle.json** — 补充 "node" 到 deps.components 4. **ets_runtime:libark_jsruntime** — 不需要,input 无源文件引用 jsnapi.h / native_engine.h ### 验证结果(新增、改动、可能影响的功能) - 仅修改 BUILD.gn 依赖声明和 bundle.json,不影响运行时行为 - 使用验证脚本逐 external_deps 块检查,确认无遗漏 - 排查了间接传递路径(abilitykit_native 等),input 仓不受影响 ### 多模输入上库必备 checklist: - [x] 【线程安全】不涉及,仅修改 BUILD.gn 依赖声明 - [x] 【内存泄漏】不涉及,仅修改 BUILD.gn 依赖声明 - [x] 【性能】不涉及,仅修改 BUILD.gn 依赖声明 - [x] 【避免深拷贝】不涉及 - [x] 【依赖】新增依赖评审:补充 ace_napi 降级后缺失的显式依赖声明,未引入新功能依赖 - [x] 【重用】不涉及 - [x] 【返回值】不涉及 ### 日志规范自检: - [x] 【规则】不涉及,本次修改不涉及任何日志代码变更 ### 安全编码自检: - [x] 【规则】不涉及,本次修改不涉及任何安全编码相关代码变更 ### 是否已执行mini system用例 - [ ] 已验证 - [x] 不涉及。如不涉及,请写明理由 理由:本次修改仅涉及 BUILD.gn 依赖声明变更,不影响运行时行为 See merge request: openharmony/multimodalinput_input!9809 | 19 小时前 | |
空指针排查 Signed-off-by: s30055920 <suli28@huawei.com> | 11 个月前 | |
!9809 merge fix/ace-napi-deps into master fix: add explicit deps for napi:ace_napi public_external_deps downgrade Created-by: athends Commit-by: athends Merged-by: openharmony_ci Description: ### 相关的Issue #7661 ### 原因(目的、解决的问题等) napi:ace_napi 组件将 public_external_deps 降级为 external_deps,node:node_header_notice、libuv:uv、ets_runtime:libark_jsruntime 不再向下游传递。由于 ace_napi 的公开头文件 native_api.h / native_node_api.h 均 include 了 node_api.h,所有依赖 ace_napi 的 target 需显式声明 node:node_header_notice。 ### 描述(做了什么,变更了什么) 1. **node:node_header_notice**(30 个文件)— 所有含 napi:ace_napi 的 external_deps 块中补充 2. **libuv:uv**(4 个文件)— 仅源码直接 #include <uv.h> 的 NAPI target 补充(input_device/input_monitor/input_consumer/infrared_emitter) 3. **bundle.json** — 补充 "node" 到 deps.components 4. **ets_runtime:libark_jsruntime** — 不需要,input 无源文件引用 jsnapi.h / native_engine.h ### 验证结果(新增、改动、可能影响的功能) - 仅修改 BUILD.gn 依赖声明和 bundle.json,不影响运行时行为 - 使用验证脚本逐 external_deps 块检查,确认无遗漏 - 排查了间接传递路径(abilitykit_native 等),input 仓不受影响 ### 多模输入上库必备 checklist: - [x] 【线程安全】不涉及,仅修改 BUILD.gn 依赖声明 - [x] 【内存泄漏】不涉及,仅修改 BUILD.gn 依赖声明 - [x] 【性能】不涉及,仅修改 BUILD.gn 依赖声明 - [x] 【避免深拷贝】不涉及 - [x] 【依赖】新增依赖评审:补充 ace_napi 降级后缺失的显式依赖声明,未引入新功能依赖 - [x] 【重用】不涉及 - [x] 【返回值】不涉及 ### 日志规范自检: - [x] 【规则】不涉及,本次修改不涉及任何日志代码变更 ### 安全编码自检: - [x] 【规则】不涉及,本次修改不涉及任何安全编码相关代码变更 ### 是否已执行mini system用例 - [ ] 已验证 - [x] 不涉及。如不涉及,请写明理由 理由:本次修改仅涉及 BUILD.gn 依赖声明变更,不影响运行时行为 See merge request: openharmony/multimodalinput_input!9809 | 19 小时前 | |
Signed-off-by:xueyuanzhao<zhaoxueyuan@huawei.com> Signed-off-by: xueyuanzhao <zhaoxueyuan@huawei.com> Change-Id: Icf835bbe71d243a51538d8de493b6bfddf49d21b | 10 个月前 | |
update OpenHarmony 2.0 Canary | 5 年前 | |
docs: simplify agent knowledge guidance Co-Authored-By: Agent Signed-off-by: frank_libing <libing3@huawei.com> | 2 个月前 | |
fix: make mmi_tests build for multi-group binding test targets Fix build errors in the newly added test targets so build-target input mmi_tests compiles: - MouseDeviceStateGroupTest: add proxy/include path and ipc:ipc_single dep (mouse_device_state.h -> window_info.h -> iremote_object.h). - mouse_device_state_group_test.cpp / multi_group_binding_test.cpp / multi_group_binding_supplement_test.cpp: add using namespace testing::ext; (TestSize). - MultiGroupBinding{,Supplement}Test: add samgr:samgr_proxy dep (switch_subscriber_handler.h -> system_ability_status_change_stub.h). - event_dump_test.cpp: rename duplicate ParseCommand_014/_015 to _023/_024 (collided with existing cases). - window_manager/test/mock.cpp: drop duplicate GetDeviceGroupId / OnDeviceUnbind (already defined in input_windows_manager.cpp, which InputWindowsManagerEXTest also compiles). - multi_group_binding_supplement_test.cpp: assert pos1 group isolation (was an unused variable -> -Werror). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> 🤖 AI[100%] 🔧 Human Fixed[0%] 🧑 Human[0%] 👌 AI Adopted[100%] Co-authored-by: claude (claude-opus-4-8) <ai@local> Change-Id: I6d7e087081e660e6e568704ca7b3c4d803568687 Signed-off-by: frank_libing <libing3@huawei.com> revert merge request: feat: HID display group device binding (fix mmi_tests build) 0a99650a980cefa519086a8bffe955a6e7f8fe3d This revert merge request !9814 | 2 天前 | |
update OpenHarmony 2.0 Canary | 5 年前 | |
fixbug: 修改版权头格式问题 Signed-off-by: longdiye <longdiye@talkweb.com.cn> | 24 天前 | |
Modify fuzz comment filtering Signed-off-by: l30079984 <lengxiaojun@h-partners.com> | 9 个月前 | |
修改注入接口md文件 Signed-off-by: liuwei <liuwei595@huawei.com> Change-Id: Id9e0e4132e132ffc1ef83b4ccae7e7189a69093b | 4 年前 | |
fix: add explicit deps for napi:ace_napi public_external_deps downgrade ace_napi downgraded public_external_deps to external_deps, breaking transitive propagation of node:node_header_notice and libuv:uv. - Add node:node_header_notice to all targets with napi:ace_napi (30 files) because native_api.h/native_node_api.h include node_api.h - Add libuv:uv to targets whose sources include uv.h (4 files) - Add "node" to bundle.json deps.components - ets_runtime:libark_jsruntime not needed (no source includes jsnapi.h) Fixes #7661 Co-Authored-By: Agent Signed-off-by: athends <huwanyong1@huawei.com> 🤖 AI[100%] 🔧 Human Fixed[0%] 🧑 Human[0%] 👌 AI Adopted[100%] Co-authored-by: opencode (glm-5.2) <ai@local> | 6 天前 | |
Signed-off-by:wanghao505<wanghao505@huawei.com> Signed-off-by: wanghao505 <wanghao505@huawei.com> Change-Id: I5988c29808cc358c9b4ad31160dd3d1efe683a93 | 3 年前 | |
Add SuspendStateManager for frozen process input filtering Introduce SuspendStateManager module to filter input events for frozen processes. When a process is frozen by the system, its pointer and key events are dropped, and its cursor style is set to LOADING. The module registers a SuspendStateObserver with the SuspendManager SA when both RSS and SuspendManager SAs are ready. Co-Authored-By: Agent Signed-off-by: Leo_Mei <meizhiyuan1@hisilicon.com> | 12 天前 | |
修复电源键无法挂断电话的问题 Signed-off-by: Ryan <zhufan@harmonytsc.com> | 9 天前 |
多模输入标准系统组件
简介
本组件应用于标准系统之上,为设备提供单指触控输入能力。本组件将触屏输入产生的事件上报到JS UI框架或用户程序框架,JS UI框架根据上报的事件再次封装,对应用提供接口。
目录
/foundation/multimodalinput/input
├── interfaces # 对外接口存放目录
│ └── native # 对外native层接口存放目录
│ └── innerkits # 对系统内部子系统提供native层接口存放目录
├── service # 服务框架代码
├── sa_profile # 服务启动配置文件
├── uinput # 输入事件注入模块
使用
接口说明
多模输入目前提供的接口为事件注入接口,该接口目前仅对系统应用开放。
-
inputEventClient是处理注入事件类。
表 1 inputEventClient的主要接口
使用说明
当前仅提供了BACK按键的事件注入。
当系统应用需要返回上一层时,通过注入接口将BACK键注入到多模服务,多模服务再上传到应用,以实现返回到上一层级目录的效果。使用方式如下所示:
// 引入提供的js接口库
import input from '@ohos.multimodalInput.inputEventClient'
// 调用注入事件接口
var keyEvent = {
isPressed:true, // 按键事件的按键类型:true:down false:up
code:2, // 按键对应的keycode, 例如back键的值为2
keyDownDuration:10, // 按键按下到抬起的时长,单位ms
};
var res = input.injectEvent({
KeyEvent: keyEvent
});
说明: 新增的接口能力需要兼容原有的能力。
设备能力支持
| 设备 | 触摸屏 | 触摸板 | 鼠标 | 键盘 |
|---|---|---|---|---|
| rk3568 | Y | Y | Y | Y |
| hi3516dv300 | Y | N | N | N |
相关仓
多模输入子系统
multimodalinput_input