SuperAPI AI 工具集

oh-interfaces-ipc-to-service

通用与其它

查看项目

更新于 10-16 07:28

技能介绍

用途:在 OpenHarmony graphic_2d 仓新增 RSInterface 透传接口,且接口类型为 ToService 时使用。透传通路统一开辟到 rs_screen.cpp/.h 层,并在新增接口实现中留空供用户补充底层调用逻辑。

主要能力与步骤:先向用户询问接口声明,若不符合 C++ 语法需告知并请其提供正确声明;再询问接口采用 @System 鉴权还是 @Foundation 鉴权;参考 rs_interfaces.cpp/.h 中 SetDualScreenState() 与 GetPanelPowerStatus() 的调用链。

Client 侧:在 rs_interfaces.cpp/.h、rs_render_service_client.cpp/.h 新增接口。Service 侧:在 rs_client_to_service_connection.cpp/.h、rs_screen_manager.cpp/.h、rs_screen.cpp/.h 新增接口。IPC:在 rs_iclient_to_service_connection.h 抽象类添加声明;在 rs_client_to_service_connection_proxy.cpp/.h 按形参列表和返回值调用 MessageParcel 与 SendRequest;在 rs_client_to_service_connection_stub.cpp 的 OnRemoteRequest() 添加 case,读取 MessageParcel、调用新增接口并写回结果。

鉴权:新枚举需同步加入 rs_iclient_to_service_connection_ipc_interface_code.h;在 stub 的 descriptorCheckList 中新增该枚举;在 rs_irender_service_connection_ipc_interface_code_access_verifier.cpp 的 IsExclusiveVerificat 中新增 case,按鉴权方式调用 IsSystemCalling 或 IsFoundationCalling。

限制:最后需检查代码是否符合 C++ 17 语法,并与既有风格一致(函数名双驼峰、变量名单驼峰)。资料未提供具体命令、安装方式、收费与平台信息。