Commit Graph

11914 Commits

Author SHA1 Message Date
openharmony_ci 62c0d7e65e !19640 merge feature/work into master
fix(skill): release lock before invoking execute-done callback

Created-by: RuiChen_01
Commit-by: RuiChen_01
Merged-by: openharmony_ci
Description: **IssueNo**:

**Description**:

**稳定性自检:**
| 自检项                                                       | 自检结果  |
| ------------------------------------------------------------ | -------- |
| 涉及跨进程调用的相关操作需要抛至主线程或加锁防止并发              |          |
| 成员变量进行赋值或创建需要排查并发                               |          |
| 谨慎在lambda表达式中使用引用捕获                                |          |
| 谨慎在未经拷贝的情况下使用外部传入的string、C字符串               |          |
| map\vector\list\set等stl模板类使用时需要排查并发                |          |
| 谨慎考虑加锁范围                                               |          |
| 在IPC通信中谨慎使用同步通信方式                                 |          |
| 禁止传递this指针至其他模块或线程(特别是eventhandler任务)        |          |
| 禁止将外部传入的裸指针在内部直接构造智能指针                      |          |
| 禁止多个独立创建的智能指针管理同一地址                           |          |
| 禁止在析构函数中抛异步任务                                      |          |
| 禁止js对象在非js线程(例如在IPC线程)创建、使用或销毁             |          |
| 禁止在对外接口中未经判空直接使用外部传入的指针                    |          |
| 禁止接口返回局部变量引用                                        |          |
| 禁止在信号函数中加锁                                            |          |
| 禁止在关键流程(SA启动、应用启动等主流程)执行耗时的操作           |          |
| 禁止将同一个cpp编译在不同的so中                                 |          |

**安全编码自检:**
| 自检项                                                          | 自检结果 |
| -------------------------------------------------------------- | -------- |
| 裸指针避免通过隐式转换构造为sptr                                 |          |
| json对象在取值之前必须先判断类型,避免类型不匹配                   |          |
| 序列化时必须对传入的数组大小进行校验,避免出现超大数组              |          |
| 避免使用未明确位宽的整型,选择使用int8_t、uint8_t等类型            |          |
| 外部传入的路径要做规范化校验,对路径中的.、..、../等特殊字符严格校验 |          |
| 指针变量、表示资源描述符的变量、bool变量必须赋初值                  |          |
| readParcelable获取的对象使用前需要判空                            |          |
| 分配和释放内存的函数需要成对出现                                   |          |
| 申请内存后异常退出前需要及时进行内存释放                            |          |
| 内存申请前必须对内存大小进行合法性校验                              |          |
| 内存分配后必须判断是否成功                                         |          |
| 禁止使用realloc、alloca函数                                       |          |
| 禁止打印文件路径、口令等敏感信息,如有需要,使用private修饰          |          |
| 禁止打印内存地址                                                  |          |
| 整数之间运算时必须严格检查,确保不会出现溢出、反转、除0               |          |
| 禁止对有符号整数进行位操作符运算                                    |          |
| 禁止对指针进行逻辑或位运算                                         |          |
| 循环次数如果收外部数据控制,需要检验其合法性                         |          |
| 禁止使用内存操作类危险函数,需要使用安全函数                         |          |
| 谨慎使用不可重入函数                                               |          |
| 必须检查安全函数的返回值,并进行正确处理                             |          |
| 禁止仅通过TokenType类型判断绕过权限校验                             |          |

**TDD Result**:

**XTS Result**:

### 是否已执行L0用例
- [ ] 已验证
- [ ] 不涉及。如不涉及,请写明理由


See merge request: openharmony/ability_ability_runtime!19640
2026-07-03 11:04:49 +08:00
openharmony_ci beceebe91f !19741 merge master into master
安全告警

Created-by: liuzongze
Commit-by: liuzongze
Merged-by: openharmony_ci
Description: **IssueNo**:
https://gitcode.com/openharmony/ability_ability_runtime/issues/15565
**Description**:

**稳定性自检:**
| 自检项                                                       | 自检结果  |
| ------------------------------------------------------------ | -------- |
| 涉及跨进程调用的相关操作需要抛至主线程或加锁防止并发              |    不涉及      |
| 成员变量进行赋值或创建需要排查并发                               |    不涉及      |
| 谨慎在lambda表达式中使用引用捕获                                |     不涉及     |
| 谨慎在未经拷贝的情况下使用外部传入的string、C字符串               |   不涉及       |
| map\vector\list\set等stl模板类使用时需要排查并发                |     不涉及     |
| 谨慎考虑加锁范围                                               |   不涉及       |
| 在IPC通信中谨慎使用同步通信方式                                 |       不涉及   |
| 禁止传递this指针至其他模块或线程(特别是eventhandler任务)        |    不涉及      |
| 禁止将外部传入的裸指针在内部直接构造智能指针                      |      不涉及    |
| 禁止多个独立创建的智能指针管理同一地址                           |   不涉及       |
| 禁止在析构函数中抛异步任务                                      |     不涉及     |
| 禁止js对象在非js线程(例如在IPC线程)创建、使用或销毁             |     不涉及     |
| 禁止在对外接口中未经判空直接使用外部传入的指针                    |      不涉及    |
| 禁止接口返回局部变量引用                                        |   不涉及       |
| 禁止在信号函数中加锁                                            |     不涉及     |
| 禁止在关键流程(SA启动、应用启动等主流程)执行耗时的操作           |     不涉及     |
| 禁止将同一个cpp编译在不同的so中                                 |    不涉及      |

**安全编码自检:**
| 自检项                                                          | 自检结果 |
| -------------------------------------------------------------- | -------- |
| 裸指针避免通过隐式转换构造为sptr                                 |     不涉及     |
| json对象在取值之前必须先判断类型,避免类型不匹配                   |    不涉及      |
| 序列化时必须对传入的数组大小进行校验,避免出现超大数组              |      不涉及    |
| 避免使用未明确位宽的整型,选择使用int8_t、uint8_t等类型            |     不涉及     |
| 外部传入的路径要做规范化校验,对路径中的.、..、../等特殊字符严格校验 |     不涉及     |
| 指针变量、表示资源描述符的变量、bool变量必须赋初值                  |      不涉及    |
| readParcelable获取的对象使用前需要判空                            |     不涉及     |
| 分配和释放内存的函数需要成对出现                                   |     不涉及     |
| 申请内存后异常退出前需要及时进行内存释放                            |      不涉及    |
| 内存申请前必须对内存大小进行合法性校验                              |       不涉及   |
| 内存分配后必须判断是否成功                                         |     不涉及     |
| 禁止使用realloc、alloca函数                                       |      不涉及    |
| 禁止打印文件路径、口令等敏感信息,如有需要,使用private修饰          |    不涉及      |
| 禁止打印内存地址                                                  |    不涉及      |
| 整数之间运算时必须严格检查,确保不会出现溢出、反转、除0               |    不涉及      |
| 禁止对有符号整数进行位操作符运算                                    |      不涉及    |
| 禁止对指针进行逻辑或位运算                                         |     不涉及     |
| 循环次数如果收外部数据控制,需要检验其合法性                         |       不涉及   |
| 禁止使用内存操作类危险函数,需要使用安全函数                         |     不涉及     |
| 谨慎使用不可重入函数                                               |     不涉及     |
| 必须检查安全函数的返回值,并进行正确处理                             |     不涉及     |
| 禁止仅通过TokenType类型判断绕过权限校验                             |       不涉及   |

**TDD Result**:
![image.png](https://raw.gitcode.com/user-images/assets/4421702/2d92ae5f-677f-47f8-8ce2-cdb049da761d/image.png 'image.png')
![image.png](https://raw.gitcode.com/user-images/assets/4421702/1725644c-1578-45b4-8e5f-04d66a1e1597/image.png 'image.png')
**XTS Result**:

### 是否已执行L0用例
- [ ] 已验证
- [x] 不涉及。如不涉及,请写明理由


See merge request: openharmony/ability_ability_runtime!19741
2026-07-02 20:54:43 +08:00
openharmony_ci a0b04075c9 !19740 merge master0701 into master
安全告警修复

Created-by: dsz2025
Commit-by: duansizhao
Merged-by: openharmony_ci
Description: **IssueNo**:

**Description**:

**稳定性自检:**
| 自检项                                                       | 自检结果  |
| ------------------------------------------------------------ | -------- |
| 涉及跨进程调用的相关操作需要抛至主线程或加锁防止并发              |          |
| 成员变量进行赋值或创建需要排查并发                               |          |
| 谨慎在lambda表达式中使用引用捕获                                |          |
| 谨慎在未经拷贝的情况下使用外部传入的string、C字符串               |          |
| map\vector\list\set等stl模板类使用时需要排查并发                |          |
| 谨慎考虑加锁范围                                               |          |
| 在IPC通信中谨慎使用同步通信方式                                 |          |
| 禁止传递this指针至其他模块或线程(特别是eventhandler任务)        |          |
| 禁止将外部传入的裸指针在内部直接构造智能指针                      |          |
| 禁止多个独立创建的智能指针管理同一地址                           |          |
| 禁止在析构函数中抛异步任务                                      |          |
| 禁止js对象在非js线程(例如在IPC线程)创建、使用或销毁             |          |
| 禁止在对外接口中未经判空直接使用外部传入的指针                    |          |
| 禁止接口返回局部变量引用                                        |          |
| 禁止在信号函数中加锁                                            |          |
| 禁止在关键流程(SA启动、应用启动等主流程)执行耗时的操作           |          |
| 禁止将同一个cpp编译在不同的so中                                 |          |

**安全编码自检:**
| 自检项                                                          | 自检结果 |
| -------------------------------------------------------------- | -------- |
| 裸指针避免通过隐式转换构造为sptr                                 |          |
| json对象在取值之前必须先判断类型,避免类型不匹配                   |          |
| 序列化时必须对传入的数组大小进行校验,避免出现超大数组              |          |
| 避免使用未明确位宽的整型,选择使用int8_t、uint8_t等类型            |          |
| 外部传入的路径要做规范化校验,对路径中的.、..、../等特殊字符严格校验 |          |
| 指针变量、表示资源描述符的变量、bool变量必须赋初值                  |          |
| readParcelable获取的对象使用前需要判空                            |          |
| 分配和释放内存的函数需要成对出现                                   |          |
| 申请内存后异常退出前需要及时进行内存释放                            |          |
| 内存申请前必须对内存大小进行合法性校验                              |          |
| 内存分配后必须判断是否成功                                         |          |
| 禁止使用realloc、alloca函数                                       |          |
| 禁止打印文件路径、口令等敏感信息,如有需要,使用private修饰          |          |
| 禁止打印内存地址                                                  |          |
| 整数之间运算时必须严格检查,确保不会出现溢出、反转、除0               |          |
| 禁止对有符号整数进行位操作符运算                                    |          |
| 禁止对指针进行逻辑或位运算                                         |          |
| 循环次数如果收外部数据控制,需要检验其合法性                         |          |
| 禁止使用内存操作类危险函数,需要使用安全函数                         |          |
| 谨慎使用不可重入函数                                               |          |
| 必须检查安全函数的返回值,并进行正确处理                             |          |
| 禁止仅通过TokenType类型判断绕过权限校验                             |          |

**TDD Result**:

**XTS Result**:


![image.png](https://raw.gitcode.com/user-images/assets/4421702/3be70b8d-c9f6-4b51-8409-eb1c43405ea8/image.png 'image.png')
### 是否已执行L0用例
- [ ] 已验证
- [ ] 不涉及。如不涉及,请写明理由


See merge request: openharmony/ability_ability_runtime!19740
2026-07-02 15:54:20 +08:00
liuzongze aaf904deaf 安全告警
Co-Authored-By: Agent
Signed-off-by: liuzongze <liuzongze@h-partners.com>
Change-Id: I88582df056909ebf060f2f945d8a5e1f10edc400
2026-07-02 14:26:32 +08:00
duansizhao 93597d84ec 安全告警修复
Signed-off-by: duansizhao <duansizhao@huawei.com>
Change-Id: Ia35a84a39e0d6f1d2addb32b29f339392ce374c4
2026-07-02 12:43:45 +08:00
openharmony_ci c50bf4b0c4 !19695 merge master0626 into master
代码优化

Created-by: dsz2025
Commit-by: duansizhao
Merged-by: openharmony_ci
Description: **IssueNo**:

**Description**:

**稳定性自检:**
| 自检项                                                       | 自检结果  |
| ------------------------------------------------------------ | -------- |
| 涉及跨进程调用的相关操作需要抛至主线程或加锁防止并发              |          |
| 成员变量进行赋值或创建需要排查并发                               |          |
| 谨慎在lambda表达式中使用引用捕获                                |          |
| 谨慎在未经拷贝的情况下使用外部传入的string、C字符串               |          |
| map\vector\list\set等stl模板类使用时需要排查并发                |          |
| 谨慎考虑加锁范围                                               |          |
| 在IPC通信中谨慎使用同步通信方式                                 |          |
| 禁止传递this指针至其他模块或线程(特别是eventhandler任务)        |          |
| 禁止将外部传入的裸指针在内部直接构造智能指针                      |          |
| 禁止多个独立创建的智能指针管理同一地址                           |          |
| 禁止在析构函数中抛异步任务                                      |          |
| 禁止js对象在非js线程(例如在IPC线程)创建、使用或销毁             |          |
| 禁止在对外接口中未经判空直接使用外部传入的指针                    |          |
| 禁止接口返回局部变量引用                                        |          |
| 禁止在信号函数中加锁                                            |          |
| 禁止在关键流程(SA启动、应用启动等主流程)执行耗时的操作           |          |
| 禁止将同一个cpp编译在不同的so中                                 |          |

**安全编码自检:**
| 自检项                                                          | 自检结果 |
| -------------------------------------------------------------- | -------- |
| 裸指针避免通过隐式转换构造为sptr                                 |          |
| json对象在取值之前必须先判断类型,避免类型不匹配                   |          |
| 序列化时必须对传入的数组大小进行校验,避免出现超大数组              |          |
| 避免使用未明确位宽的整型,选择使用int8_t、uint8_t等类型            |          |
| 外部传入的路径要做规范化校验,对路径中的.、..、../等特殊字符严格校验 |          |
| 指针变量、表示资源描述符的变量、bool变量必须赋初值                  |          |
| readParcelable获取的对象使用前需要判空                            |          |
| 分配和释放内存的函数需要成对出现                                   |          |
| 申请内存后异常退出前需要及时进行内存释放                            |          |
| 内存申请前必须对内存大小进行合法性校验                              |          |
| 内存分配后必须判断是否成功                                         |          |
| 禁止使用realloc、alloca函数                                       |          |
| 禁止打印文件路径、口令等敏感信息,如有需要,使用private修饰          |          |
| 禁止打印内存地址                                                  |          |
| 整数之间运算时必须严格检查,确保不会出现溢出、反转、除0               |          |
| 禁止对有符号整数进行位操作符运算                                    |          |
| 禁止对指针进行逻辑或位运算                                         |          |
| 循环次数如果收外部数据控制,需要检验其合法性                         |          |
| 禁止使用内存操作类危险函数,需要使用安全函数                         |          |
| 谨慎使用不可重入函数                                               |          |
| 必须检查安全函数的返回值,并进行正确处理                             |          |
| 禁止仅通过TokenType类型判断绕过权限校验                             |          |

**TDD Result**:

**XTS Result**:

### 是否已执行L0用例
- [ ] 已验证
- [ ] 不涉及。如不涉及,请写明理由


See merge request: openharmony/ability_ability_runtime!19695
2026-07-02 10:21:24 +08:00
openharmony_ci 63938a7f3c !19723 merge fix/config-moduleName-missing into master
fix: backfill moduleName for Config intents missing the field

Created-by: RuiChen_01
Commit-by: RuiChen_01
Merged-by: openharmony_ci
Description: **IssueNo**:

**Description**:

**稳定性自检:**
| 自检项                                                       | 自检结果  |
| ------------------------------------------------------------ | -------- |
| 涉及跨进程调用的相关操作需要抛至主线程或加锁防止并发              |          |
| 成员变量进行赋值或创建需要排查并发                               |          |
| 谨慎在lambda表达式中使用引用捕获                                |          |
| 谨慎在未经拷贝的情况下使用外部传入的string、C字符串               |          |
| map\vector\list\set等stl模板类使用时需要排查并发                |          |
| 谨慎考虑加锁范围                                               |          |
| 在IPC通信中谨慎使用同步通信方式                                 |          |
| 禁止传递this指针至其他模块或线程(特别是eventhandler任务)        |          |
| 禁止将外部传入的裸指针在内部直接构造智能指针                      |          |
| 禁止多个独立创建的智能指针管理同一地址                           |          |
| 禁止在析构函数中抛异步任务                                      |          |
| 禁止js对象在非js线程(例如在IPC线程)创建、使用或销毁             |          |
| 禁止在对外接口中未经判空直接使用外部传入的指针                    |          |
| 禁止接口返回局部变量引用                                        |          |
| 禁止在信号函数中加锁                                            |          |
| 禁止在关键流程(SA启动、应用启动等主流程)执行耗时的操作           |          |
| 禁止将同一个cpp编译在不同的so中                                 |          |

**安全编码自检:**
| 自检项                                                          | 自检结果 |
| -------------------------------------------------------------- | -------- |
| 裸指针避免通过隐式转换构造为sptr                                 |          |
| json对象在取值之前必须先判断类型,避免类型不匹配                   |          |
| 序列化时必须对传入的数组大小进行校验,避免出现超大数组              |          |
| 避免使用未明确位宽的整型,选择使用int8_t、uint8_t等类型            |          |
| 外部传入的路径要做规范化校验,对路径中的.、..、../等特殊字符严格校验 |          |
| 指针变量、表示资源描述符的变量、bool变量必须赋初值                  |          |
| readParcelable获取的对象使用前需要判空                            |          |
| 分配和释放内存的函数需要成对出现                                   |          |
| 申请内存后异常退出前需要及时进行内存释放                            |          |
| 内存申请前必须对内存大小进行合法性校验                              |          |
| 内存分配后必须判断是否成功                                         |          |
| 禁止使用realloc、alloca函数                                       |          |
| 禁止打印文件路径、口令等敏感信息,如有需要,使用private修饰          |          |
| 禁止打印内存地址                                                  |          |
| 整数之间运算时必须严格检查,确保不会出现溢出、反转、除0               |          |
| 禁止对有符号整数进行位操作符运算                                    |          |
| 禁止对指针进行逻辑或位运算                                         |          |
| 循环次数如果收外部数据控制,需要检验其合法性                         |          |
| 禁止使用内存操作类危险函数,需要使用安全函数                         |          |
| 谨慎使用不可重入函数                                               |          |
| 必须检查安全函数的返回值,并进行正确处理                             |          |
| 禁止仅通过TokenType类型判断绕过权限校验                             |          |

**TDD Result**:

**XTS Result**:

### 是否已执行L0用例
- [ ] 已验证
- [ ] 不涉及。如不涉及,请写明理由


See merge request: openharmony/ability_ability_runtime!19723
2026-07-01 16:35:10 +08:00
RuiChen_01 a54470e8c6 log: remove arithmetic from filter log format strings
Replace "N -> M (dropped N-M)" with "input=N output=M" to avoid
subtraction in TAG_LOGI arguments. Callers can infer dropped count
if needed.

Co-Authored-By: Agent
Signed-off-by: RuiChen_01 <chenrui193@huawei.com>

🤖‍ AI[100%] 👌 AI Adopted[100%] 🧑 Human[0%]
Co-authored-by: claude (glm-5.2) <ai@local>
2026-06-30 18:05:50 +08:00
RuiChen_01 7cb3f1d148 refactor: change Function intent default executeMode to UI_ABILITY_BACKGROUND
Function decorator (@InsightIntentFunctionMethod) previously defaulted
to SERVICE_EXTENSION_ABILITY. Change to UI_ABILITY_BACKGROUND so
Function intents dispatch via StartAbilityByCallWithInsightIntent
(background UIAbility call path) instead of StartExtensionAbility.

Co-Authored-By: Agent
Signed-off-by: RuiChen_01 <chenrui193@huawei.com>

🤖‍ AI[100%] 👌 AI Adopted[100%] 🧑 Human[0%]
Co-authored-by: claude (glm-5.2) <ai@local>
2026-06-30 17:46:46 +08:00
ohci1 b9339e2e5b !19272 merge master into master
3.0.2

Created-by: hlzhangaj
Commit-by: ohci1;hlzhangaj
Merged-by: ohci1
Description: **IssueNo**: https://gitcode.com/openharmony/build/issues/4519

**Description**:

**稳定性自检:**
| 自检项                                                       | 自检结果  |
| ------------------------------------------------------------ | -------- |
| 涉及跨进程调用的相关操作需要抛至主线程或加锁防止并发              |          |
| 成员变量进行赋值或创建需要排查并发                               |          |
| 谨慎在lambda表达式中使用引用捕获                                |          |
| 谨慎在未经拷贝的情况下使用外部传入的string、C字符串               |          |
| map\vector\list\set等stl模板类使用时需要排查并发                |          |
| 谨慎考虑加锁范围                                               |          |
| 在IPC通信中谨慎使用同步通信方式                                 |          |
| 禁止传递this指针至其他模块或线程(特别是eventhandler任务)        |          |
| 禁止将外部传入的裸指针在内部直接构造智能指针                      |          |
| 禁止多个独立创建的智能指针管理同一地址                           |          |
| 禁止在析构函数中抛异步任务                                      |          |
| 禁止js对象在非js线程(例如在IPC线程)创建、使用或销毁             |          |
| 禁止在对外接口中未经判空直接使用外部传入的指针                    |          |
| 禁止接口返回局部变量引用                                        |          |
| 禁止在信号函数中加锁                                            |          |
| 禁止在关键流程(SA启动、应用启动等主流程)执行耗时的操作           |          |
| 禁止将同一个cpp编译在不同的so中                                 |          |

**安全编码自检:**
| 自检项                                                          | 自检结果 |
| -------------------------------------------------------------- | -------- |
| 裸指针避免通过隐式转换构造为sptr                                 |          |
| json对象在取值之前必须先判断类型,避免类型不匹配                   |          |
| 序列化时必须对传入的数组大小进行校验,避免出现超大数组              |          |
| 避免使用未明确位宽的整型,选择使用int8_t、uint8_t等类型            |          |
| 外部传入的路径要做规范化校验,对路径中的.、..、../等特殊字符严格校验 |          |
| 指针变量、表示资源描述符的变量、bool变量必须赋初值                  |          |
| readParcelable获取的对象使用前需要判空                            |          |
| 分配和释放内存的函数需要成对出现                                   |          |
| 申请内存后异常退出前需要及时进行内存释放                            |          |
| 内存申请前必须对内存大小进行合法性校验                              |          |
| 内存分配后必须判断是否成功                                         |          |
| 禁止使用realloc、alloca函数                                       |          |
| 禁止打印文件路径、口令等敏感信息,如有需要,使用private修饰          |          |
| 禁止打印内存地址                                                  |          |
| 整数之间运算时必须严格检查,确保不会出现溢出、反转、除0               |          |
| 禁止对有符号整数进行位操作符运算                                    |          |
| 禁止对指针进行逻辑或位运算                                         |          |
| 循环次数如果收外部数据控制,需要检验其合法性                         |          |
| 禁止使用内存操作类危险函数,需要使用安全函数                         |          |
| 谨慎使用不可重入函数                                               |          |
| 必须检查安全函数的返回值,并进行正确处理                             |          |
| 禁止仅通过TokenType类型判断绕过权限校验                             |          |

**TDD Result**:

**XTS Result**:

### 是否已执行L0用例
- [ ] 已验证
- [ ] 不涉及。如不涉及,请写明理由


See merge request: openharmony/ability_ability_runtime!19272
2026-06-30 17:21:26 +08:00
openharmony_ci 8e6b9d7bab !19708 merge FixAgentDebugTimeOut into master
修复Agent调试超时问题

Created-by: SKY2001
Commit-by: SKY2001
Merged-by: openharmony_ci
Description: **IssueNo**:
https://gitcode.com/openharmony/ability_ability_runtime/issues/15537?ref=&did=4121673#tid-4121673
**Description**:

**稳定性自检:**
| 自检项                                                       | 自检结果  |
| ------------------------------------------------------------ | -------- |
| 涉及跨进程调用的相关操作需要抛至主线程或加锁防止并发              |   yes       |
| 成员变量进行赋值或创建需要排查并发                               |    yes       |
| 谨慎在lambda表达式中使用引用捕获                                |   yes        |
| 谨慎在未经拷贝的情况下使用外部传入的string、C字符串               |   yes        |
| map\vector\list\set等stl模板类使用时需要排查并发                |  yes         |
| 谨慎考虑加锁范围                                               |      yes     |
| 在IPC通信中谨慎使用同步通信方式                                 |      yes     |
| 禁止传递this指针至其他模块或线程(特别是eventhandler任务)        |    yes       |
| 禁止将外部传入的裸指针在内部直接构造智能指针                      |   yes        |
| 禁止多个独立创建的智能指针管理同一地址                           |      yes     |
| 禁止在析构函数中抛异步任务                                      |      yes     |
| 禁止js对象在非js线程(例如在IPC线程)创建、使用或销毁             |       yes    |
| 禁止在对外接口中未经判空直接使用外部传入的指针                    |        yes   |
| 禁止接口返回局部变量引用                                        |        yes   |
| 禁止在信号函数中加锁                                            |      yes     |
| 禁止在关键流程(SA启动、应用启动等主流程)执行耗时的操作           |    yes       |
| 禁止将同一个cpp编译在不同的so中                                 |       yes    |

**安全编码自检:**
| 自检项                                                          | 自检结果 |
| -------------------------------------------------------------- | -------- |
| 裸指针避免通过隐式转换构造为sptr                                 |    yes       |
| json对象在取值之前必须先判断类型,避免类型不匹配                   |      yes     |
| 序列化时必须对传入的数组大小进行校验,避免出现超大数组              |   yes        |
| 避免使用未明确位宽的整型,选择使用int8_t、uint8_t等类型            |     yes      |
| 外部传入的路径要做规范化校验,对路径中的.、..、../等特殊字符严格校验 |    yes       |
| 指针变量、表示资源描述符的变量、bool变量必须赋初值                  |  yes         |
| readParcelable获取的对象使用前需要判空                            |  yes        |
| 分配和释放内存的函数需要成对出现                                   |        yes   |
| 申请内存后异常退出前需要及时进行内存释放                            |    yes       |
| 内存申请前必须对内存大小进行合法性校验                              |     yes      |
| 内存分配后必须判断是否成功                                         |    yes       |
| 禁止使用realloc、alloca函数                                       |       yes    |
| 禁止打印文件路径、口令等敏感信息,如有需要,使用private修饰          |      yes     |
| 禁止打印内存地址                                                  |        yes   |
| 整数之间运算时必须严格检查,确保不会出现溢出、反转、除0               |      yes     |
| 禁止对有符号整数进行位操作符运算                                    |     yes      |
| 禁止对指针进行逻辑或位运算                                         |      yes     |
| 循环次数如果收外部数据控制,需要检验其合法性                         |        yes   |
| 禁止使用内存操作类危险函数,需要使用安全函数                         |      yes     |
| 谨慎使用不可重入函数                                               |      yes     |
| 必须检查安全函数的返回值,并进行正确处理                             |     yes      |
| 禁止仅通过TokenType类型判断绕过权限校验                             |    yes       |

**TDD Result**:
yes 
**XTS Result**:
yes 
### 是否已执行L0用例
- [ ] 已验证
- [ ] 不涉及。如不涉及,请写明理由


See merge request: openharmony/ability_ability_runtime!19708
2026-06-30 14:41:53 +08:00
RuiChen_01 31aa3e9bc6 fix: backfill empty functionNamespace in BatchRegisterInsightIntentFunctions
Config intents from module.json5 may have empty bundleName (developers
omit it, similar to moduleName). ConvertFromConfigIntent sets
functionNamespace = info.bundleName → empty. Old RegisterInsightIntentFunctions
had a fallback using the bundleName parameter, but BatchRegisterInsightIntentFunctions
lacked this. Empty functionNamespace causes FunctionInfo::Validate failure
and KVStore registration silently drops the function.

Add fallback: when functionNamespace is empty and bundleVersionMap has
exactly one entry (single-bundle call from event_mgr), use that entry's
key as the namespace.

Co-Authored-By: Agent
Signed-off-by: RuiChen_01 <chenrui193@huawei.com>

🤖‍ AI[100%] 👌 AI Adopted[100%] 🧑 Human[0%]
Co-authored-by: claude (glm-5.2) <ai@local>
2026-06-30 14:21:20 +08:00
RuiChen_01 a985aaa8f7 log: print input wantParam in ExecuteIntentByFunctionCall
Add wantParam.ToString() to the existing entry log so the full
key-value content of the caller's input is visible for diagnosis.

Co-Authored-By: Agent
Signed-off-by: RuiChen_01 <chenrui193@huawei.com>

🤖‍ AI[100%] 👌 AI Adopted[100%] 🧑 Human[0%]
Co-authored-by: claude (glm-5.2) <ai@local>
2026-06-30 11:52:51 +08:00
RuiChen_01 e9a7f0088b log: print resolved URIs in ResolveUris
Add per-URI INFO log after parsing the options.uris string array,
showing index and value for each. Helps diagnose Link intent
execution failures where uris mismatch or are empty.

Co-Authored-By: Agent
Signed-off-by: RuiChen_01 <chenrui193@huawei.com>

🤖‍ AI[100%] 👌 AI Adopted[100%] 🧑 Human[0%]
Co-authored-by: claude (glm-5.2) <ai@local>
2026-06-30 11:50:25 +08:00
RuiChen_01 78626bd18f refactor: change flags from string to integer type
Schema declared flags as "string" and parser used GetStringParam +
ParseInt to convert, requiring callers to pass "256" instead of 256.
Change to "integer" type and use GetIntParam directly, matching the
underlying Want flags bitmask semantics. Remove now-unused AUTO_BASE
constant.

Co-Authored-By: Agent
Signed-off-by: RuiChen_01 <chenrui193@huawei.com>

🤖‍ AI[100%] 👌 AI Adopted[100%] 🧑 Human[0%]
Co-authored-by: claude (glm-5.2) <ai@local>
2026-06-30 11:49:20 +08:00
RuiChen_01 3cf8faf0e6 perf: use BatchRegisterInsightIntentFunctions on install path
event_mgr previously called RegisterInsightIntentFunctions which loops
RegisterOrUpdateFunction per FunctionInfo (N IPC calls). Switch to
BatchRegisterInsightIntentFunctions for a single IPC via Ashmem shared
memory, consistent with the boot path.

Co-Authored-By: Agent
Signed-off-by: RuiChen_01 <chenrui193@huawei.com>

🤖‍ AI[100%] 👌 AI Adopted[100%] 🧑 Human[0%]
Co-authored-by: claude (glm-5.2) <ai@local>
2026-06-30 10:48:34 +08:00
RuiChen_01 294d6097d0 fix: backfill moduleName before SaveInsightIntentTotalInfo
Config intents from module.json5 may omit moduleName (it's known from
context). Previous backfill ran AFTER SaveInsightIntentTotalInfo, so
RDB stored the original empty moduleName while KVStore registration
got the backfilled value.

At execution time, GetConfigInsightIntentInfoByName reads from RDB
(empty moduleName) → ConvertConfigToGenericInfo copies empty →
FilterGeneric drops the intent → execution fails despite successful
registration.

Move backfill BEFORE SaveInsightIntentTotalInfo so both RDB and
KVStore receive the correct moduleName, keeping registration and
execution consistent.

Co-Authored-By: Agent
Signed-off-by: RuiChen_01 <chenrui193@huawei.com>

🤖‍ AI[0%] 👌 AI Adopted[0%] 🧑 Human[100%]
2026-06-30 09:55:48 +08:00
RuiChen_01 341ba3aa02 perf: use rawdata for BatchRegisterFunctions to avoid boot timeout
Change BatchRegisterFunctions IDL from [in] FunctionInfo[] (Parcel,
1MB Binder limit) to [in] FunctionsRawData (shared memory/Ashmem),
matching the existing GetAllFunctions pattern. This allows a single
IPC to carry all functions regardless of data size, eliminating the
N/50 batch chunking that caused repeated CheckKvStore loops on
simulators without a KVStore and led to boot timeouts.

Client-side CliToolMGRClient keeps accepting vector<FunctionInfo>
and converts to FunctionsRawData internally via FromFunctionInfoVec.
Service-side converts back via ToFunctionInfoVec before processing.
Chunking logic in BatchRegisterInsightIntentFunctions is removed.

Co-Authored-By: Agent
Signed-off-by: RuiChen_01 <chenrui193@huawei.com>

🤖‍ AI[100%] 👌 AI Adopted[100%] 🧑 Human[0%]
Co-authored-by: claude (glm-5.2) <ai@local>
2026-06-29 22:48:09 +08:00
RuiChen_01 e559d510d2 refactor: drop userId and displayId from exposed options schema
These two parameters are system-internal and should not be part of
the function calling contract. Remove them from the registered
options schema so LLM agents don't see them. Parser no longer reads
them from options: userId defaults to INVALID_USER_ID (-1) filled
by CheckAndUpdateParam, displayId defaults to INVALID_DISPLAY_ID
filled by SCB. ResolveUserId/ResolveDisplayId methods and their
constants are deleted.

Co-Authored-By: Agent
Signed-off-by: RuiChen_01 <chenrui193@huawei.com>

🤖‍ AI[100%] 👌 AI Adopted[100%] 🧑 Human[0%]
Co-authored-by: claude (glm-5.2) <ai@local>
2026-06-29 22:33:37 +08:00
RuiChen_01 a01615469e feat: allow Page and Link intents through FilterGeneric
Function calling previously only accepted Function (SE) and Entry
with BG/SE executeMode. Page (front-end UIAbility page navigation)
and Link (OpenLink deep link) were dropped by FilterGeneric.

Page and Link are valid intent types that downstream ExecuteIntentCommon
already supports (StartAbilityWithInsightIntent for Page routing,
IntentOpenLinkInner for Link). Allow them through FilterGeneric so
LLM agents can trigger page navigation and URI-based deep links.

Co-Authored-By: Agent
Signed-off-by: RuiChen_01 <chenrui193@huawei.com>

🤖‍ AI[100%] 👌 AI Adopted[100%] 🧑 Human[0%]
Co-authored-by: claude (glm-5.2) <ai@local>
2026-06-29 22:33:37 +08:00
RuiChen_01 9fd28b14e6 log: add diagnostic logs for intent registration pipeline
Add boundary and error logs across the intent→function registration
flow to make it easier to diagnose intents that reach the RDB but
fail to register in the function KVStore.

FilterConfig/FilterGeneric: log input/output counts and WARN on each
dropped intent with intentName, moduleName, and the reason (empty
fields, not BG/SE). RegisterInsightIntentFunctions: log entry counts
and WARN when convert yields zero functions.

event_mgr: log collected intent counts before filter, after filter,
and bundle name at each boundary.

sys_event_receiver: log GetAllInsightIntentInfoForRegister result
counts (intent/config/bundles) after the boot-time filter pass.

Co-Authored-By: Agent
Signed-off-by: RuiChen_01 <chenrui193@huawei.com>

🤖‍ AI[100%] 👌 AI Adopted[100%] 🧑 Human[0%]
Co-authored-by: claude (glm-5.2) <ai@local>
2026-06-29 22:33:37 +08:00
RuiChen_01 b100aeea8e fix: backfill moduleName for Config intents missing the field
InsightIntentProfile::TransformTo parses moduleName from the config
JSON's optional "moduleName" field. Developers often omit it because
moduleName is known from the module.json5 context. SaveInsightIntentTotalInfo
stores via the external moduleNameLocal parameter, so RDB succeeds, but
downstream ConvertFromConfigIntent and future FilterConfig see an empty
moduleName, causing the intent to either produce an incomplete options
schema or get dropped before reaching the function KVStore.

Backfill moduleNameLocal into each Config intent entry when the JSON
field is absent, ensuring consistent moduleName availability across
registration and execution paths.

Co-Authored-By: Agent
Signed-off-by: RuiChen_01 <chenrui193@huawei.com>

🤖‍ AI[100%] 👌 AI Adopted[100%] 🧑 Human[0%]
Co-authored-by: claude (glm-5.2) <ai@local>
2026-06-29 21:40:36 +08:00
openharmony_ci df32f025fb !19720 merge 29logCut into master
log cut

Created-by: wlh2624_DS
Commit-by: wlh2624_DS
Merged-by: openharmony_ci
Description: **IssueNo**:
https://gitcode.com/openharmony/ability_ability_runtime/issues/15549
**Description**:

**稳定性自检:**
| 自检项                                                       | 自检结果  |
| ------------------------------------------------------------ | -------- |
| 涉及跨进程调用的相关操作需要抛至主线程或加锁防止并发              |          |
| 成员变量进行赋值或创建需要排查并发                               |          |
| 谨慎在lambda表达式中使用引用捕获                                |          |
| 谨慎在未经拷贝的情况下使用外部传入的string、C字符串               |          |
| map\vector\list\set等stl模板类使用时需要排查并发                |          |
| 谨慎考虑加锁范围                                               |          |
| 在IPC通信中谨慎使用同步通信方式                                 |          |
| 禁止传递this指针至其他模块或线程(特别是eventhandler任务)        |          |
| 禁止将外部传入的裸指针在内部直接构造智能指针                      |          |
| 禁止多个独立创建的智能指针管理同一地址                           |          |
| 禁止在析构函数中抛异步任务                                      |          |
| 禁止js对象在非js线程(例如在IPC线程)创建、使用或销毁             |          |
| 禁止在对外接口中未经判空直接使用外部传入的指针                    |          |
| 禁止接口返回局部变量引用                                        |          |
| 禁止在信号函数中加锁                                            |          |
| 禁止在关键流程(SA启动、应用启动等主流程)执行耗时的操作           |          |
| 禁止将同一个cpp编译在不同的so中                                 |          |

**安全编码自检:**
| 自检项                                                          | 自检结果 |
| -------------------------------------------------------------- | -------- |
| 裸指针避免通过隐式转换构造为sptr                                 |          |
| json对象在取值之前必须先判断类型,避免类型不匹配                   |          |
| 序列化时必须对传入的数组大小进行校验,避免出现超大数组              |          |
| 避免使用未明确位宽的整型,选择使用int8_t、uint8_t等类型            |          |
| 外部传入的路径要做规范化校验,对路径中的.、..、../等特殊字符严格校验 |          |
| 指针变量、表示资源描述符的变量、bool变量必须赋初值                  |          |
| readParcelable获取的对象使用前需要判空                            |          |
| 分配和释放内存的函数需要成对出现                                   |          |
| 申请内存后异常退出前需要及时进行内存释放                            |          |
| 内存申请前必须对内存大小进行合法性校验                              |          |
| 内存分配后必须判断是否成功                                         |          |
| 禁止使用realloc、alloca函数                                       |          |
| 禁止打印文件路径、口令等敏感信息,如有需要,使用private修饰          |          |
| 禁止打印内存地址                                                  |          |
| 整数之间运算时必须严格检查,确保不会出现溢出、反转、除0               |          |
| 禁止对有符号整数进行位操作符运算                                    |          |
| 禁止对指针进行逻辑或位运算                                         |          |
| 循环次数如果收外部数据控制,需要检验其合法性                         |          |
| 禁止使用内存操作类危险函数,需要使用安全函数                         |          |
| 谨慎使用不可重入函数                                               |          |
| 必须检查安全函数的返回值,并进行正确处理                             |          |
| 禁止仅通过TokenType类型判断绕过权限校验                             |          |

**TDD Result**:

**XTS Result**:

### 是否已执行L0用例
- [ ] 已验证
- [ ] 不涉及。如不涉及,请写明理由


See merge request: openharmony/ability_ability_runtime!19720
2026-06-29 21:12:45 +08:00
openharmony_ci e715ae8473 !19630 merge supportmultiton into master
fix StartSelfUIAbilityInCurrentProcess

Created-by: zzl12383
Commit-by: zzl12383
Merged-by: openharmony_ci
Description: **IssueNo**:
https://gitcode.com/openharmony/ability_ability_runtime/issues/15488
**Description**:

**稳定性自检:**
| 自检项                                                       | 自检结果  |
| ------------------------------------------------------------ | -------- |
| 涉及跨进程调用的相关操作需要抛至主线程或加锁防止并发              |          |
| 成员变量进行赋值或创建需要排查并发                               |          |
| 谨慎在lambda表达式中使用引用捕获                                |          |
| 谨慎在未经拷贝的情况下使用外部传入的string、C字符串               |          |
| map\vector\list\set等stl模板类使用时需要排查并发                |          |
| 谨慎考虑加锁范围                                               |          |
| 在IPC通信中谨慎使用同步通信方式                                 |          |
| 禁止传递this指针至其他模块或线程(特别是eventhandler任务)        |          |
| 禁止将外部传入的裸指针在内部直接构造智能指针                      |          |
| 禁止多个独立创建的智能指针管理同一地址                           |          |
| 禁止在析构函数中抛异步任务                                      |          |
| 禁止js对象在非js线程(例如在IPC线程)创建、使用或销毁             |          |
| 禁止在对外接口中未经判空直接使用外部传入的指针                    |          |
| 禁止接口返回局部变量引用                                        |          |
| 禁止在信号函数中加锁                                            |          |
| 禁止在关键流程(SA启动、应用启动等主流程)执行耗时的操作           |          |
| 禁止将同一个cpp编译在不同的so中                                 |          |

**安全编码自检:**
| 自检项                                                          | 自检结果 |
| -------------------------------------------------------------- | -------- |
| 裸指针避免通过隐式转换构造为sptr                                 |          |
| json对象在取值之前必须先判断类型,避免类型不匹配                   |          |
| 序列化时必须对传入的数组大小进行校验,避免出现超大数组              |          |
| 避免使用未明确位宽的整型,选择使用int8_t、uint8_t等类型            |          |
| 外部传入的路径要做规范化校验,对路径中的.、..、../等特殊字符严格校验 |          |
| 指针变量、表示资源描述符的变量、bool变量必须赋初值                  |          |
| readParcelable获取的对象使用前需要判空                            |          |
| 分配和释放内存的函数需要成对出现                                   |          |
| 申请内存后异常退出前需要及时进行内存释放                            |          |
| 内存申请前必须对内存大小进行合法性校验                              |          |
| 内存分配后必须判断是否成功                                         |          |
| 禁止使用realloc、alloca函数                                       |          |
| 禁止打印文件路径、口令等敏感信息,如有需要,使用private修饰          |          |
| 禁止打印内存地址                                                  |          |
| 整数之间运算时必须严格检查,确保不会出现溢出、反转、除0               |          |
| 禁止对有符号整数进行位操作符运算                                    |          |
| 禁止对指针进行逻辑或位运算                                         |          |
| 循环次数如果收外部数据控制,需要检验其合法性                         |          |
| 禁止使用内存操作类危险函数,需要使用安全函数                         |          |
| 谨慎使用不可重入函数                                               |          |
| 必须检查安全函数的返回值,并进行正确处理                             |          |
| 禁止仅通过TokenType类型判断绕过权限校验                             |          |

**TDD Result**:

**XTS Result**:

### 是否已执行L0用例
- [ ] 已验证
- [ ] 不涉及。如不涉及,请写明理由


See merge request: openharmony/ability_ability_runtime!19630
2026-06-29 17:26:39 +08:00
wlh2624_DS dfdecbef32 log cut
Co-Authored-By: agent
Signed-off-by: wlh2624_DS <1968860844@qq.com>
2026-06-29 17:15:40 +08:00
SKY2001 7a2accc6ad 修复Agent调试超时问题
Signed-off-by: SKY2001 <songtianyu10@huawei.com>
2026-06-29 14:24:21 +08:00
openharmony_ci f338187077 !19709 merge optimize/insight-intent-cleanup into master
perf: move per-bundle filtering into DbCache GetAllInsightIntentInfoForRegister

Created-by: RuiChen_01
Commit-by: RuiChen_01;朱菲墨
Merged-by: openharmony_ci
Description: **IssueNo**:

**Description**:

**稳定性自检:**
| 自检项                                                       | 自检结果  |
| ------------------------------------------------------------ | -------- |
| 涉及跨进程调用的相关操作需要抛至主线程或加锁防止并发              |          |
| 成员变量进行赋值或创建需要排查并发                               |          |
| 谨慎在lambda表达式中使用引用捕获                                |          |
| 谨慎在未经拷贝的情况下使用外部传入的string、C字符串               |          |
| map\vector\list\set等stl模板类使用时需要排查并发                |          |
| 谨慎考虑加锁范围                                               |          |
| 在IPC通信中谨慎使用同步通信方式                                 |          |
| 禁止传递this指针至其他模块或线程(特别是eventhandler任务)        |          |
| 禁止将外部传入的裸指针在内部直接构造智能指针                      |          |
| 禁止多个独立创建的智能指针管理同一地址                           |          |
| 禁止在析构函数中抛异步任务                                      |          |
| 禁止js对象在非js线程(例如在IPC线程)创建、使用或销毁             |          |
| 禁止在对外接口中未经判空直接使用外部传入的指针                    |          |
| 禁止接口返回局部变量引用                                        |          |
| 禁止在信号函数中加锁                                            |          |
| 禁止在关键流程(SA启动、应用启动等主流程)执行耗时的操作           |          |
| 禁止将同一个cpp编译在不同的so中                                 |          |

**安全编码自检:**
| 自检项                                                          | 自检结果 |
| -------------------------------------------------------------- | -------- |
| 裸指针避免通过隐式转换构造为sptr                                 |          |
| json对象在取值之前必须先判断类型,避免类型不匹配                   |          |
| 序列化时必须对传入的数组大小进行校验,避免出现超大数组              |          |
| 避免使用未明确位宽的整型,选择使用int8_t、uint8_t等类型            |          |
| 外部传入的路径要做规范化校验,对路径中的.、..、../等特殊字符严格校验 |          |
| 指针变量、表示资源描述符的变量、bool变量必须赋初值                  |          |
| readParcelable获取的对象使用前需要判空                            |          |
| 分配和释放内存的函数需要成对出现                                   |          |
| 申请内存后异常退出前需要及时进行内存释放                            |          |
| 内存申请前必须对内存大小进行合法性校验                              |          |
| 内存分配后必须判断是否成功                                         |          |
| 禁止使用realloc、alloca函数                                       |          |
| 禁止打印文件路径、口令等敏感信息,如有需要,使用private修饰          |          |
| 禁止打印内存地址                                                  |          |
| 整数之间运算时必须严格检查,确保不会出现溢出、反转、除0               |          |
| 禁止对有符号整数进行位操作符运算                                    |          |
| 禁止对指针进行逻辑或位运算                                         |          |
| 循环次数如果收外部数据控制,需要检验其合法性                         |          |
| 禁止使用内存操作类危险函数,需要使用安全函数                         |          |
| 谨慎使用不可重入函数                                               |          |
| 必须检查安全函数的返回值,并进行正确处理                             |          |
| 禁止仅通过TokenType类型判断绕过权限校验                             |          |

**TDD Result**:

**XTS Result**:

### 是否已执行L0用例
- [ ] 已验证
- [ ] 不涉及。如不涉及,请写明理由


See merge request: openharmony/ability_ability_runtime!19709
2026-06-28 22:30:18 +08:00
RuiChen_01 6002e53070 fix: add lowercase executeMode aliases to match schema default
Schema default for executeMode is "background" (lowercase), but
ResolveExecuteModeFromOption's MODE_MAP only had enum-full-name keys
("UI_ABILITY_BACKGROUND"). Add lowercase aliases matching both the
schema default and the profile JSON executeMode strings so callers
can pass "background" / "foreground" / "serviceextension" /
"uiextension" directly.

Co-Authored-By: Agent
Signed-off-by: RuiChen_01 <chenrui193@huawei.com>

🤖‍ AI[100%] 👌 AI Adopted[100%] 🧑 Human[0%]
Co-authored-by: claude (glm-5.2) <ai@local>
2026-06-28 20:33:22 +08:00
RuiChen_01 80c8dd62f9 fix: extract IsQualifiedEntry to reduce FilterGeneric nesting depth
Static analysis flags FilterGeneric at depth 5 (function → for → if
Entry → for mode → if mode==). Pull the Entry executeMode check into
IsQualifiedEntry helper so FilterGeneric stays at depth 4.

Co-Authored-By: Agent
Signed-off-by: RuiChen_01 <chenrui193@huawei.com>

🤖‍ AI[100%] 👌 AI Adopted[100%] 🧑 Human[0%]
Co-authored-by: claude (glm-5.2) <ai@local>
2026-06-28 19:28:23 +08:00
RuiChen_01 9777bf8a38 refactor: rename single-letter variables in FilterConfig/FilterGeneric
g → generic, p → item. Sort lambda params a/b left as-is (STL idiom).

Co-Authored-By: Agent
Signed-off-by: RuiChen_01 <chenrui193@huawei.com>

🤖‍ AI[100%] 👌 AI Adopted[100%] 🧑 Human[0%]
Co-authored-by: claude (glm-5.2) <ai@local>
2026-06-28 17:08:09 +08:00
RuiChen_01 76d0f77200 fix: chunk BatchRegisterFunctions to stay under Binder IPC limit
Single Binder IPC has a ~1 MB mmap ceiling; a large FunctionInfo
vector (~2KB per entry due to inputSchema) can exceed the safe
threshold at 100+ entries. Split the vector into batches of 50
(~100KB each) and issue one IPC per batch. successCount is
accumulated across batches; any batch failure aborts early.

Co-Authored-By: Agent
Signed-off-by: RuiChen_01 <chenrui193@huawei.com>

🤖‍ AI[100%] 👌 AI Adopted[100%] 🧑 Human[0%]
Co-authored-by: claude (glm-5.2) <ai@local>
2026-06-28 16:55:19 +08:00
RuiChen_01 332c28c09f refactor: merge Profile path into Generic, drop template Filters
Unify on Generic (ExtractInsightIntentInfo) as the sole data format
for registration. Drop ConvertFromExtractProfile, FilterProfile, the
PrepareForRegister template, and the three ExtractFrom* helpers. Each
remaining Filter (Config/Generic) now inlines rule-1 filtering and
(moduleName, abilityName) sort directly.

event_mgr now converts Profile→Generic via ProfileInfoFormat before
filtering and registering, matching the sys_event_receiver path.
ConvertFromExtractIntentInfo is completed to emit the same full
FunctionInfo (options schema, inputSchema, outputSchema) that the old
Profile path produced, so both registration paths yield identical
KVStore entries.

Net effect: ~50 lines removed, one conversion path, two self-contained
filters, and consistent FunctionInfo output across all callers.

Co-Authored-By: Agent
Signed-off-by: RuiChen_01 <chenrui193@huawei.com>

🤖‍ AI[100%] 👌 AI Adopted[100%] 🧑 Human[0%]
Co-authored-by: claude (glm-5.2) <ai@local>
2026-06-28 16:38:36 +08:00
RuiChen_01 287abddace revert: disable distributed intent support for ExecuteIntentByFunctionCall
Remove deviceId from the registered options schema, drop the
ResolveDeviceId parser step (deviceId stays at its default empty
string), and delete the DispatchDistributedIntent helper plus the
distributed branch in ExecuteIntentByFunctionCall. ignoreAbilityName
no longer considers deviceId. The intent now always dispatches
locally via ExecuteIntentCommon.

Co-Authored-By: Agent
Signed-off-by: RuiChen_01 <chenrui193@huawei.com>

🤖‍ AI[100%] 👌 AI Adopted[100%] 🧑 Human[0%]
Co-authored-by: claude (glm-5.2) <ai@local>
2026-06-28 16:20:51 +08:00
openharmony_ci 9dd4d7b3a4 !19563 merge invokefunction into master
Add invokeFunction

Created-by: zivzhen
Commit-by: wangzhen
Merged-by: openharmony_ci
Description: **IssueNo**:

**Description**:

**稳定性自检:**
| 自检项                                                       | 自检结果  |
| ------------------------------------------------------------ | -------- |
| 涉及跨进程调用的相关操作需要抛至主线程或加锁防止并发              |   ok     |
| 成员变量进行赋值或创建需要排查并发                               |      ok  |
| 谨慎在lambda表达式中使用引用捕获                                |      ok  |
| 谨慎在未经拷贝的情况下使用外部传入的string、C字符串               |  ok      |
| map\vector\list\set等stl模板类使用时需要排查并发                |      ok  |
| 谨慎考虑加锁范围                                               |       ok |
| 在IPC通信中谨慎使用同步通信方式                                 |   ok     |
| 禁止传递this指针至其他模块或线程(特别是eventhandler任务)        |    ok    |
| 禁止将外部传入的裸指针在内部直接构造智能指针                      |     ok   |
| 禁止多个独立创建的智能指针管理同一地址                           |     ok   |
| 禁止在析构函数中抛异步任务                                      |    ok    |
| 禁止js对象在非js线程(例如在IPC线程)创建、使用或销毁             |    ok    |
| 禁止在对外接口中未经判空直接使用外部传入的指针                    |     ok   |
| 禁止接口返回局部变量引用                                        |     ok   |
| 禁止在信号函数中加锁                                            |    ok   |
| 禁止在关键流程(SA启动、应用启动等主流程)执行耗时的操作           |    ok    |
| 禁止将同一个cpp编译在不同的so中                                 |    ok    |

**安全编码自检:**
| 自检项                                                          | 自检结果 |
| -------------------------------------------------------------- | -------- |
| 裸指针避免通过隐式转换构造为sptr                                 |      ok |
| json对象在取值之前必须先判断类型,避免类型不匹配                   |    ok    |
| 序列化时必须对传入的数组大小进行校验,避免出现超大数组              |    ok    |
| 避免使用未明确位宽的整型,选择使用int8_t、uint8_t等类型            |     ok   |
| 外部传入的路径要做规范化校验,对路径中的.、..、../等特殊字符严格校验 |    ok    |
| 指针变量、表示资源描述符的变量、bool变量必须赋初值                  |     ok   |
| readParcelable获取的对象使用前需要判空                            |      ok  |
| 分配和释放内存的函数需要成对出现                                   |    ok    |
| 申请内存后异常退出前需要及时进行内存释放                            |    ok    |
| 内存申请前必须对内存大小进行合法性校验                              |    ok    |
| 内存分配后必须判断是否成功                                         |     ok   |
| 禁止使用realloc、alloca函数                                       |     ok   |
| 禁止打印文件路径、口令等敏感信息,如有需要,使用private修饰          |    ok    |
| 禁止打印内存地址                                                  |     ok   |
| 整数之间运算时必须严格检查,确保不会出现溢出、反转、除0               |    ok    |
| 禁止对有符号整数进行位操作符运算                                    |    ok    |
| 禁止对指针进行逻辑或位运算                                         |     ok   |
| 循环次数如果收外部数据控制,需要检验其合法性                         |    ok    |
| 禁止使用内存操作类危险函数,需要使用安全函数                         |     ok   |
| 谨慎使用不可重入函数                                               |      ok  |
| 必须检查安全函数的返回值,并进行正确处理                             |   ok     |
| 禁止仅通过TokenType类型判断绕过权限校验                             |      ok  |

**TDD Result**:
pass
**XTS Result**:
pass
### 是否已执行L0用例
- [ ] 已验证
- [ ] 不涉及。如不涉及,请写明理由


See merge request: openharmony/ability_ability_runtime!19563
2026-06-28 15:42:52 +08:00
RuiChen_01 2cc8724c78 refactor: extract PrepareFunctionCallParam to keep entry under 50 lines
ExecuteIntentByFunctionCall grew past 50 lines after adding the want
param cleanup. Pull wantParam cleanup + multi-candidate match +
paramParser.Build into PrepareFunctionCallParam so the entry function
stays focused on permission checks, dispatch routing, and common
handoff. Both functions are now under the 50-line cap.

Co-Authored-By: Agent
Signed-off-by: RuiChen_01 <chenrui193@huawei.com>

🤖‍ AI[100%] 👌 AI Adopted[100%] 🧑 Human[0%]
Co-authored-by: claude (glm-5.2) <ai@local>
2026-06-28 12:36:20 +08:00
RuiChen_01 782384d47c fix: remove intent params from input want in ExecuteIntentByFunctionCall
Mirror StartAbility path which calls InsightIntentExecuteParam::
RemoveInsightIntent to strip residual INSIGHT_INTENT_* keys from the
want before downstream dispatch. Build a temporary Want from the input
WantParams, remove the intent params, then feed the cleaned WantParams
to InsightIntentParamParser::Build so downstream StartAbility*/DMS
paths no longer carry the intent execute metadata.

Co-Authored-By: Agent
Signed-off-by: RuiChen_01 <chenrui193@huawei.com>

🤖‍ AI[100%] 👌 AI Adopted[100%] 🧑 Human[0%]
Co-authored-by: claude (unknown) <ai@local>
2026-06-28 11:34:48 +08:00
RuiChen_01 7980c4f92b fix: expose cli_tool function include via abilityms public_configs
Add abilityms_cli_tool_function_include config and attach it as a
public_config on the abilityms target. All test targets that depend
on :abilityms now automatically pick up the cli_tool function include
path, removing the need to patch each test's BUILD.gn when
insight_intent_db_cache.cpp (which transitively includes
function_info.h) is compiled into the test.

Co-Authored-By: Agent
Signed-off-by: RuiChen_01 <chenrui193@huawei.com>

🤖‍ AI[100%] 👌 AI Adopted[100%] 🧑 Human[0%]
Co-authored-by: claude (glm-5.2) <ai@local>
2026-06-28 10:58:53 +08:00
RuiChen_01 8c8e950e5e feat: align ExecuteIntentByFunctionCall userId/deviceId with ExecuteIntent
ResolveUserId now defaults to -1 (INVALID_USER_ID) instead of
callerUserId, so InsightIntentExecuteManager::CheckAndUpdateParam can
fall back to calling-UID-derived userId exactly like the ExecuteIntent
path. options.userId still overrides.

ExecuteIntentByFunctionCall now honors param->deviceId_: when non-empty
the function dispatches via DispatchDistributedIntent (flood attack
check, PERMISSION_EXECUTE_DISTRIBUTED_INTENT, GenerateWant,
dmsClient.StartRemoteIntent, SetRemoteIntentTimeout) instead of falling
through to ExecuteIntentCommon. ignoreAbilityName also becomes true when
deviceId is set, matching ExecuteIntent's existing behavior.

DispatchDistributedIntent is a new private helper so the distributed
dispatch body stays under the 50-line function cap.

Co-Authored-By: Agent
Signed-off-by: RuiChen_01 <chenrui193@huawei.com>

🤖‍ AI[0%] 👌 AI Adopted[0%] 🧑 Human[100%]
2026-06-28 10:32:49 +08:00
RuiChen_01 0f975ae286 refactor: align BatchRegisterFunctions ret type with ErrCode
CliToolMgrClient::BatchRegisterFunctions returns ErrCode (int alias).
Use ErrCode instead of int32_t for the local ret variable so the type
matches the API declaration exactly, in line with the rest of the
CliTool client surface.

Co-Authored-By: Agent
Signed-off-by: RuiChen_01 <chenrui193@huawei.com>

🤖‍ AI[0%] 👌 AI Adopted[0%] 🧑 Human[100%]
2026-06-28 10:32:49 +08:00
openharmony_ci c62dd2ba5d !19690 merge cliClonge-1 into master
pc claw支持拉起分身应用

Created-by: lidongrui
Commit-by: DESKTOP-UGVMD4B\DawnComing
Merged-by: openharmony_ci
Description: 
**IssueNo**:

**Description**:

**稳定性自检:**
| 自检项                                                       | 自检结果  |
| ------------------------------------------------------------ | -------- |
| 涉及跨进程调用的相关操作需要抛至主线程或加锁防止并发              |     √     |
| 成员变量进行赋值或创建需要排查并发                               |    √     |
| 谨慎在lambda表达式中使用引用捕获                                |    √      |
| 谨慎在未经拷贝的情况下使用外部传入的string、C字符串               |    √      |
| map\vector\list\set等stl模板类使用时需要排查并发                |    √      |
| 谨慎考虑加锁范围                                               |    √      |
| 在IPC通信中谨慎使用同步通信方式                                 |    √      |
| 禁止传递this指针至其他模块或线程(特别是eventhandler任务)        |    √      |
| 禁止将外部传入的裸指针在内部直接构造智能指针                      |    √      |
| 禁止多个独立创建的智能指针管理同一地址                           |     √     |
| 禁止在析构函数中抛异步任务                                      |     √     |
| 禁止js对象在非js线程(例如在IPC线程)创建、使用或销毁             |     √     |
| 禁止在对外接口中未经判空直接使用外部传入的指针                    |     √     |
| 禁止接口返回局部变量引用                                        |    √      |
| 禁止在信号函数中加锁                                            |    √      |
| 禁止在关键流程(SA启动、应用启动等主流程)执行耗时的操作           |    √      |
| 禁止将同一个cpp编译在不同的so中                                 |     √     |

**安全编码自检:**
| 自检项                                                          | 自检结果 |
| -------------------------------------------------------------- | -------- |
| 裸指针避免通过隐式转换构造为sptr                                 |     √     |
| json对象在取值之前必须先判断类型,避免类型不匹配                   |    √      |
| 序列化时必须对传入的数组大小进行校验,避免出现超大数组              |     √     |
| 避免使用未明确位宽的整型,选择使用int8_t、uint8_t等类型            |     √     |
| 外部传入的路径要做规范化校验,对路径中的.、..、../等特殊字符严格校验 |     √     |
| 指针变量、表示资源描述符的变量、bool变量必须赋初值                  |    √      |
| readParcelable获取的对象使用前需要判空                            |    √      |
| 分配和释放内存的函数需要成对出现                                   |    √      |
| 申请内存后异常退出前需要及时进行内存释放                            |    √      |
| 内存申请前必须对内存大小进行合法性校验                              |    √      |
| 内存分配后必须判断是否成功                                         |    √      |
| 禁止使用realloc、alloca函数                                       |    √      |
| 禁止打印文件路径、口令等敏感信息,如有需要,使用private修饰          |     √     |
| 禁止打印内存地址                                                  |     √     |
| 整数之间运算时必须严格检查,确保不会出现溢出、反转、除0               |    √      |
| 禁止对有符号整数进行位操作符运算                                    |    √      |
| 禁止对指针进行逻辑或位运算                                         |     √     |
| 循环次数如果收外部数据控制,需要检验其合法性                         |     √     |
| 禁止使用内存操作类危险函数,需要使用安全函数                         |     √     |
| 谨慎使用不可重入函数                                               |     √     |
| 必须检查安全函数的返回值,并进行正确处理                             |     √     |
| 禁止仅通过TokenType类型判断绕过权限校验                             |     √     |

**TDD Result**:

**XTS Result**:

### 是否已执行L0用例
- [ ] 已验证
- [ ] 不涉及。如不涉及,请写明理由


See merge request: openharmony/ability_ability_runtime!19690
2026-06-28 01:07:01 +08:00
RuiChen_01 a2dadab68c refactor: replace single-letter variables in param parser
Rename c/s/rep to candidate/str/matched inside InsightIntentParamParser
helpers and Build. Rename GetAbilityNameFromRep/GetExecuteModeFromRep
to GetAbilityNameFromMatched/GetExecuteModeFromMatched so the helper
names line up with the ParseResult.matchedInfo field they feed.

Co-Authored-By: Agent
Signed-off-by: RuiChen_01 <chenrui193@huawei.com>

🤖‍ AI[100%] 👌 AI Adopted[100%] 🧑 Human[0%]
Co-authored-by: claude (glm-5.2) <ai@local>
2026-06-28 00:09:58 +08:00
RuiChen_01 2d16cefab1 perf: use BatchRegisterFunctions on boot path
sys_event_receiver's RegisterAllFunctions now collects every bundle's
FunctionInfo into one vector and calls CliToolMGRClient::BatchRegisterFunctions
in a single IPC instead of looping RegisterInsightIntentFunctions per
bundle. Cuts N bundle IPCs down to 1 on the boot/shutdown registration
path. New helper BatchRegisterInsightIntentFunctions in function_call_convert
covers convert + version stamping + batch call.

event_mgr path (per-module install) is untouched and still uses
RegisterInsightIntentFunctions. This commit depends on the pending
BatchRegisterFunctions API in cli_tool_framework.

Co-Authored-By: Agent
Signed-off-by: RuiChen_01 <chenrui193@huawei.com>

🤖‍ AI[100%] 👌 AI Adopted[100%] 🧑 Human[0%]
Co-authored-by: claude (glm-5.2) <ai@local>
2026-06-28 00:03:16 +08:00
RuiChen_01 0156b9b49c refactor: rename ParseResult.representative to matchedInfo
The field holds the candidate picked by the executor after rule-1
filtering and sort. 'matchedInfo' describes that purpose more directly
than 'representative' (which read as if the candidate were a spokesperson
for some group). Caller in ExecuteIntentByFunctionCall updated.

Co-Authored-By: Agent
Signed-off-by: RuiChen_01 <chenrui193@huawei.com>

🤖‍ AI[100%] 👌 AI Adopted[100%] 🧑 Human[0%]
Co-authored-by: claude (glm-5.2) <ai@local>
2026-06-27 23:54:13 +08:00
RuiChen_01 ef663d3751 refactor: align executor with registrar via filter+sort+last-wins
IntentParamParser::Build now applies the same rule-1 filter and
(moduleName, abilityName) sort as IntentFilterUtil::FilterGeneric, then
picks the sorted vector's last element as the single representative.
All param fields come from that one representative (moduleName,
abilityName, executeMode, decoratorType), so registration and execution
end up choosing the same candidate for a given (bundleName, intentName).

wantParam.options overridess still apply on top of representative
fields. PickActiveCandidates and per-field Resolve* helpers are removed
since representative selection replaces them. FilterGeneric is reused
rather than duplicating rule-1 logic in the executor.

Co-Authored-By: Agent
Signed-off-by: RuiChen_01 <chenrui193@huawei.com>

🤖‍ AI[100%] 👌 AI Adopted[100%] 🧑 Human[0%]
Co-authored-by: claude (glm-5.2) <ai@local>
2026-06-27 23:50:53 +08:00
RuiChen_01 acad5ee87f refactor: clarify IntentFilterUtil internals naming
Rename FilterCandidate to RegisterSortKey (it is a sort key, not a
selection candidate after rules 2+3 were dropped), give it operator<
so the sort comparator reads naturally. Rename FilterAndSort template
to PrepareForRegister to surface the business intent (data prep for
KVStore registration). Replace the index-sort trick with std::pair
(key, item) pairing for a linear read.

No public API change. IntentFilterUtil::FilterProfile/FilterConfig/
FilterGeneric retain their names.

Co-Authored-By: Agent
Signed-off-by: RuiChen_01 <chenrui193@huawei.com>

🤖‍ AI[100%] 👌 AI Adopted[100%] 🧑 Human[0%]
Co-authored-by: claude (glm-5.2) <ai@local>
2026-06-27 22:52:19 +08:00
RuiChen_01 86b6692497 refactor: split filter responsibility back to data source
Re-introduce GetAllInsightIntentInfoForRegister on DbCache that returns
rule-1 filtered and (moduleName, abilityName) sorted data. sys_event_receiver
now calls this ForRegister variant and gets ready-to-register data.
RegisterInsightIntentFunctions drops its inline IntentFilterUtil call
back to pure convert+register semantics.

event_mgr (whose data comes from profile file parsing, not DbCache)
does explicit IntentFilterUtil.FilterProfile/FilterConfig before
Register, since it cannot use the ForRegister shortcut. Net effect:
each caller filters at its own data source instead of Register doing
all work, and the original GetAllInsightIntentInfo stays untouched.

Co-Authored-By: Agent
Signed-off-by: RuiChen_01 <chenrui193@huawei.com>

🤖‍ AI[100%] 👌 AI Adopted[100%] 🧑 Human[0%]
Co-authored-by: claude (glm-5.2) <ai@local>
2026-06-27 22:38:46 +08:00
RuiChen_01 9d1fd3dd3c refactor: inline filter+sort into RegisterInsightIntentFunctions
Drop GetAllInsightIntentInfoForRegister and ApplyFilterPerBundle from
DbCache; rule 1 filter and (moduleName, abilityName) sort now live
inside RegisterInsightIntentFunctions where they belong as registration
business logic. DbCache reverts to pure CRUD.

Callers simplified: BackupAndScheduleRegister uses raw
GetAllInsightIntentInfo; event_mgr no longer constructs IntentFilterUtil
explicitly. Both paths converge on a single filter point inside
RegisterInsightIntentFunctions, ensuring consistent rule application.

Co-Authored-By: Agent
Signed-off-by: RuiChen_01 <chenrui193@huawei.com>

🤖‍ AI[100%] 👌 AI Adopted[100%] 🧑 Human[0%]
Co-authored-by: claude (glm-5.2) <ai@local>
2026-06-27 22:14:40 +08:00
RuiChen_01 c3dcbf0764 refactor: simplify IntentFilterUtil to filter+sort, register Config first
Drop rules 2+3 (cross-module dedup, same-module multi-ability dedup)
from IntentFilterUtil. Each Filter* now does only rule 1 (drop
non-background-UIAbility / non-ServiceExtension) plus a sort by
(moduleName, abilityName). Sort guarantees deterministic KVStore
last-write-wins ordering for duplicate intentNames.

Adjust RegisterInsightIntentFunctions ConvertFrom* call order to
Config -> Profile/Generic so decorator-based intents overwrite
config-based ones on KVStore collisions.

Co-Authored-By: Agent
Signed-off-by: RuiChen_01 <chenrui193@huawei.com>

🤖‍ AI[100%] 👌 AI Adopted[100%] 🧑 Human[0%]
Co-authored-by: claude (glm-5.2) <ai@local>
2026-06-27 22:06:53 +08:00
RuiChen_01 d33a1cadca refactor: drop entryModule concept from IntentFilterUtil
Simplify rule 2 to "moduleName alphabetical first" without entry
preference. Removes entryModuleNames parameter from IntentFilterUtil
ctor, FilterCandidate.isEntryModule field, CandidateOrdering entry
dimension, DbCache GetAllInsightIntentInfoForRegister signature, and
bundleToEntryModules plumbing in sys_event_receiver/event_mgr. Callers
no longer need to extract entry modules from BundleInfo.

Also rename FilterAndDedup overloads to FilterProfile/FilterConfig/
FilterGeneric for explicit data-source semantics.

Co-Authored-By: Agent
Signed-off-by: RuiChen_01 <chenrui193@huawei.com>

🤖‍ AI[100%] 👌 AI Adopted[100%] 🧑 Human[0%]
Co-authored-by: claude (glm-5.2) <ai@local>
2026-06-27 21:59:12 +08:00
RuiChen_01 847c7216a2 perf: move per-bundle filtering into DbCache GetAllInsightIntentInfoForRegister
Wrap GetAllInsightIntentInfo + per-bundle IntentFilterUtil into a single
DbCache entry. sys_event_receiver's BackupAndScheduleRegister now reads
already-filtered data, removing the FilterAndDedup call from
RegisterAllFunctions. event_mgr still uses IntentFilterUtil directly
(its data comes from profile files, not DbCache).

Co-Authored-By: Agent

🤖‍ AI[100%] 👌 AI Adopted[100%] 🧑 Human[0%]
Co-authored-by: claude (glm-5.2) <ai@local>

Signed-off-by: RuiChen_01 <chenrui193@huawei.com>
2026-06-27 21:10:13 +08:00