Commit Graph

25615 Commits

Author SHA1 Message Date
openharmony_ci f709077bc5 !19705 merge sync-storage-manager-idl into master
fix: remove deleted interfaces from IStorageManager.idl in mock files

Created-by: zhonglufu
Commit-by: zhonglufu
Merged-by: openharmony_ci
Description: Remove Volume/Disk/Partition/Encrypt related interfaces that were deleted from IStorageManager.idl in two mock header files:
- test/new_test/mock/upms/uri_permission_mgr/include/istorage_manager.h
- test/unittest/uri_permission_impl_test/mock/include/mock_storage_manager_service.h

Deleted interfaces (35 total):
Volume/Disk: NotifyVolumeCreated, NotifyVolumeMounted, NotifyVolumeStateChanged, NotifyVolumeDamaged, Mount, Unmount, TryToFix, GetAllVolumes, GetVolumeByUuid, GetVolumeById, SetVolumeDescription, Format, NotifyDiskCreated, NotifyDiskDestroyed, GetAllDisks, GetDiskById, Partition, NotifyMtpMounted, NotifyMtpUnmounted, QueryUsbIsInUse
Disk crypt: Encrypt, Decrypt, Unlock, GetCryptProgressById, GetCryptUuidById, BindRecoverKeyToPasswd, UpdateCryptPasswd, ResetCryptPasswd, VerifyCryptPasswd, NotifyEncryptVolumeStateChanged
Partition: GetPartitionTable, CreatePartition, DeletePartition, FormatPartition
Other: IsUsbFuseByType

Relates: https://gitcode.com/openharmony/customization_enterprise_device_management/issues/1531

See merge request: openharmony/ability_ability_runtime!19705
2026-06-29 10:11:46 +08:00
openharmony_ci 143f8bfc8f !19698 merge dot_cli0626 into master
clidot

Created-by: Luobniz21
Commit-by: Luobniz21
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用例
- [x] 已验证
- [ ] 不涉及。如不涉及,请写明理由


See merge request: openharmony/ability_ability_runtime!19698
2026-06-29 10:08:13 +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 746732b358 test: remove CliFunctionDataManager_BatchRegisterFunctions_003/004
Drop the two extra BatchRegisterFunctions failure-path cases that
came in from the upstream cherry-pick. Keep 001/002 which already
cover the happy path.

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

🤖‍ AI[0%] 👌 AI Adopted[0%] 🧑 Human[0%]
2026-06-28 14:32:40 +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 d17ea5f891 fix: complete mock ForRegister + tweak BatchRegister error code
mock_insight_intent_db_cache.{h,cpp} for the thirteenth test lacked
GetAllInsightIntentInfoForRegister (added on the real cache), so test
targets linking the mock hit undefined symbol. Add the mock declaration
and a stub implementation that just delegates to GetAllInsightIntentInfo.

CliFunctionDataManager::BatchRegisterFunctions returns ERR_KVSTORE_ERROR
instead of ERR_INVALID_PARAM when no functions were registered, matching
the rest of the KVStore error reporting.

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

🤖‍ AI[89%] 👌 AI Adopted[89%] 🧑 Human[11%]
Co-authored-by: claude (glm-5.2) <ai@local>
2026-06-28 11:26:07 +08:00
wangzhen 48c0d70ef5 tdd fix
Co-Authored-By: Agent

Signed-off-by: wangzhen <wangzhen416@huawei.com>

🤖‍ AI[100%] 👌 AI Adopted[100%] 🧑 Human[0%]

Change-Id: I0f4faaa05dcc0d27c4d80e84604e2f103db991d4
2026-06-28 11:08:52 +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 4c00532169 fix: add cli_tool config for insight_intent_execute_manager_test
Same as insight_intent_execute_manager_second_test: the test compiles
insight_intent_db_cache.cpp, which now includes function_call_convert.h
(needed by GetAllInsightIntentInfoForRegister) which in turn pulls in
function_info.h from cli_tool_framework/interfaces/function/include.
Add the include path and cli_tool_client dep so function_info.h resolves.

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:55:50 +08:00
RuiChen_01 f730746e0d fix: add cli_tool function include path for second_test
insight_intent_execute_manager_second_test compiles
insight_intent_db_cache.cpp which now includes function_call_convert.h
(needed by GetAllInsightIntentInfoForRegister), which in turn includes
function_info.h from cli_tool_framework/interfaces/function/include.
Add the include path so the test can resolve function_info.h.

Co-Authored-By: Agent
Signed-off-by: RuiChen_01 <chenrui193@huawei.com>
2026-06-28 10:32:49 +08:00
RuiChen_01 2f9909cc41 test: add minimal TDD for InsightIntentParamParser and IntentFilterUtil
Five basic happy/sad path cases per interface, no external mocks
required. ParamParser: empty bundleName/intentName/candidates rejected,
all-foreground candidates rejected, single BG UIAbility candidate
produces expected param fields. FilterUtil: empty input no-op, FG
UIAbility and Form dropped by rule 1, BG UIAbility and ServiceExtension
kept.

Co-Authored-By: Agent
Signed-off-by: RuiChen_01 <chenrui193@huawei.com>
2026-06-28 10:32:49 +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
朱菲墨 db029dbbe0 新增批量注册接口/修正权限校验
Signed-off-by: 朱菲墨 <zhufeimo1@huawei.com>

🤖‍ AI[0%] 👌 AI Adopted[0%] 🧑 Human[100%]
2026-06-28 10:32:38 +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
openharmony_ci 39d3599a25 !19688 merge child_debug_0625 into master
子进程不注册pid不进行attach

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

**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!19688
2026-06-27 20:37:06 +08:00
RuiChen_01 d64b087e4c refactor: extract InsightIntentParamParser, add IntentFilterUtil
Move parameter parsing/assembly for ExecuteIntentByFunctionCall out of
AbilityManagerService anonymous helpers into a dedicated
InsightIntentParamParser class with explicit, unit-testable rules.
Expose multi-candidate matcher API (GetMatchedIntentInfos).
Drop SA-only check on ExecuteIntentByFunctionCall entry so function
calling agents can invoke intents directly.

Add IntentFilterUtil for CliTool registration path: callers preprocess
intent lists before RegisterInsightIntentFunctions to (1) drop intents
not bound to background UIAbility or ServiceExtension, (2) pick entry
module first when same intentName spans modules, (3) prefer UIAbility
over ServiceExtension when same module has multiple abilities.

Co-Authored-By: Agent
Signed-off-by: RuiChen_01 <chenrui193@huawei.com>
2026-06-27 20:18:08 +08:00
openharmony_ci f30b0b514f !19473 merge 528tdd into master
add tdd

Created-by: wlh2624_DS
Commit-by: wlh2624_DS
Merged-by: openharmony_ci
Description: **IssueNo**:
https://gitcode.com/openharmony/ability_ability_runtime/issues/15373
**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!19473
2026-06-27 20:04:49 +08:00
DESKTOP-UGVMD4B\DawnComing 455151f902 pc claw支持拉起分身应用
Signed-off-by: lidongrui <lidongrui3@huawei.com>
Co-Authored-By: Agent
2026-06-27 19:48:15 +08:00
wangzhen 9d36100b17 Add context validate
Co-Authored-By: Agent

Signed-off-by: wangzhen <wangzhen416@huawei.com>

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

Change-Id: I982961d569ed14c78f8b83a5c9bd1afc5897335b
2026-06-27 18:58:07 +08:00
wangzhen 1ab611ad6e Code review
Co-Authored-By: Agent

Signed-off-by: wangzhen <wangzhen416@huawei.com>

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

Change-Id: I02cde4a7561cc899be6dda491b088aa224b6a54f
2026-06-27 18:57:29 +08:00
wlh2624_DS f56e72ac04 add tdd
Co-Authored-By: Agent
Signed-off-by: wlh2624_DS <1968860844@qq.com>
2026-06-27 18:55:04 +08:00
openharmony_ci c5bd7432e5 !19707 merge reason_proxy_bug into master
修复字段传递的bug

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

**Description**:

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

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

**TDD Result**:

**XTS Result**:

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


See merge request: openharmony/ability_ability_runtime!19707
2026-06-27 18:19:19 +08:00
hanchen45 70e4cf4635 修复字段传递的bug
Co-Authored-By: Agent

Signed-off-by: hanchen45 <wanghanchen1@huawei.com>

🤖‍ AI[0%] 👌 AI Adopted[0%] 🧑 Human[100%]
2026-06-27 16:58:49 +08:00
openharmony_ci 6eb0138f19 !19702 merge master into master
修复临时变量回收时使用悬空指针问题

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

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

**TDD Result**:
![image.png](https://raw.gitcode.com/user-images/assets/4421702/0f5db45b-7c06-4841-81a2-b107227228fd/image.png 'image.png')
**XTS Result**:
![image.png](https://raw.gitcode.com/user-images/assets/4421702/e6ad862d-75c9-4676-9335-6fa84fc86269/image.png 'image.png')
### 是否已执行L0用例
- [ ] 已验证
- [x] 不涉及。cj代码不涉及


See merge request: openharmony/ability_ability_runtime!19702
2026-06-27 16:53:38 +08:00
zhonglufu 3a1c02eca4 fix: remove deleted interfaces from IStorageManager.idl in mock files
Sync mock files with IStorageManager.idl changes from storage_service PR#2985.
Remove Volume/Disk/Partition/Encrypt related interfaces that were deleted:
- NotifyMtpMounted/Unmounted, NotifyVolumeCreated/Mounted/Damaged/StateChanged
- Mount/Unmount/TryToFix/GetAllVolumes, GetAllDisks/GetDiskById
- NotifyDiskCreated/Destroyed, Partition, GetVolumeByUuid/ById
- SetVolumeDescription, Format, QueryUsbIsInUse, IsUsbFuseByType
- Encrypt/Decrypt/Unlock, GetCryptProgressById/UuidById
- BindRecoverKeyToPasswd/UpdateCryptPasswd/ResetCryptPasswd/VerifyCryptPasswd
- NotifyEncryptVolumeStateChanged
- GetPartitionTable/CreatePartition/DeletePartition/FormatPartition

Relates: https://gitcode.com/openharmony/customization_enterprise_device_management/issues/1531

Signed-off-by: zhonglufu <zhonglufu@h-partners.com>
2026-06-27 15:42:18 +08:00
openharmony_ci 70f5237ab3 !19704 merge log into master
日志整改

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

**Description**: 日志整改

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

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

**TDD Result**: PASS

**XTS Result**: PASS

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


See merge request: openharmony/ability_ability_runtime!19704
2026-06-27 15:17:15 +08:00
openharmony_ci 37bdbc3aa8 !19642 merge feature/new-work into master
fix(skill): restrict skill function lookup to own properties

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!19642
2026-06-27 14:57:14 +08:00
wangzhen cab4e37669 Add invokeFunction
Co-Authored-By: Agent

Signed-off-by: wangzhen <wangzhen416@huawei.com>

🤖‍ AI[90%] 👌 AI Adopted[90%] 🧑 Human[10%]

🤖‍ AI[14%] 👌 AI Adopted[14%] 🧑 Human[86%]

Change-Id: Ibccfb76f8f89b96d51b2afb2020adf0cecc67812
2026-06-27 14:52:05 +08:00
zhangyuhang72 a20625f5b4 日志整改
Signed-off-by: zhangyuhang72 <zhangyuhang72@h-partners.com>

🤖‍ AI[0%] 👌 AI Adopted[0%] 🧑 Human[100%]

Change-Id: I653f97a67e1eb950ac5d614d86c6bc64f07aaeea
2026-06-27 10:32:00 +08:00
ohci1 197d7605ec !18161 merge master into master
fix: 不规范字段inner_api整改为inner_kits

Created-by: xietingwei
Commit-by: xietingwei
Merged-by: ohci1
Description: **IssueNo**:
https://gitcode.com/openharmony/ability_ability_runtime/issues/14332
**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!18161
2026-06-27 09:58:46 +08:00
Luobniz21 ed9f8f3270 clidot
Signed-off-by: Luobniz21 <luoyicong@h-partners.com>

# Please enter the commit message for your changes. Lines starting
# with '#' will be kept; you may remove them yourself if you want to.
# An empty message aborts the commit.
#
# Date:      Fri Jun 26 14:55:51 2026 +0800
#
# On branch dot_cli0626
# Your branch is up to date with 'origin/dot_cli0626'.
#
# Changes to be committed:
#	modified:   cli_tool_framework/services/climgr/BUILD.gn
#	modified:   cli_tool_framework/services/climgr/include/cli_tool_manager_service.h
#	modified:   cli_tool_framework/services/climgr/include/tool_util.h
#	modified:   cli_tool_framework/services/climgr/src/cli_tool_manager_service.cpp
#	modified:   cli_tool_framework/services/climgr/src/process_manager.cpp
#	modified:   cli_tool_framework/services/climgr/src/tool_util.cpp
#	new file:   cli_tool_framework/services/common/BUILD.gn
#	new file:   cli_tool_framework/services/common/include/cli_event_report.h
#	new file:   cli_tool_framework/services/common/src/cli_event_report.cpp
#	modified:   cli_tool_framework/test/unittest/BUILD.gn
#	new file:   cli_tool_framework/test/unittest/cli_event_report_test/BUILD.gn
#	new file:   cli_tool_framework/test/unittest/cli_event_report_test/cli_event_report_test.cpp
#	modified:   cli_tool_framework/test/unittest/cli_tool_mgr_service_test/BUILD.gn
#	modified:   cli_tool_framework/test/unittest/cli_tool_mgr_service_test/cli_tool_mgr_service_test.cpp
#	modified:   cli_tool_framework/test/unittest/cli_tool_mgr_service_test/permission_util_mock.cpp
#	modified:   cli_tool_framework/test/unittest/common_mock/climgr/include/tool_util.h
#	modified:   cli_tool_framework/test/unittest/common_mock/climgr/src/cli_mgr_service_mock.cpp
#	modified:   cli_tool_framework/test/unittest/process_manager_test/BUILD.gn
#	modified:   cli_tool_framework/test/unittest/tool_util_test/tool_util_test.cpp
#	modified:   hisysevent.yaml
#
# Untracked files:
#	.claude/
#	1.diff
#	"CLI\345\267\245\345\205\267\346\211\223\347\202\271\344\274\230\345\214\226\346\200\273\347\273\223.md"
#

# Please enter the commit message for your changes. Lines starting
# with '#' will be kept; you may remove them yourself if you want to.
# An empty message aborts the commit.
#
# Date:      Fri Jun 26 14:55:51 2026 +0800
#
# On branch dot_cli0626
# Your branch is up to date with 'origin/dot_cli0626'.
#
# Changes to be committed:
#	modified:   cli_tool_framework/services/climgr/BUILD.gn
#	modified:   cli_tool_framework/services/climgr/include/cli_tool_manager_service.h
#	modified:   cli_tool_framework/services/climgr/include/tool_util.h
#	modified:   cli_tool_framework/services/climgr/src/cli_tool_manager_service.cpp
#	modified:   cli_tool_framework/services/climgr/src/process_manager.cpp
#	modified:   cli_tool_framework/services/climgr/src/tool_util.cpp
#	new file:   cli_tool_framework/services/common/BUILD.gn
#	new file:   cli_tool_framework/services/common/include/cli_event_report.h
#	new file:   cli_tool_framework/services/common/src/cli_event_report.cpp
#	modified:   cli_tool_framework/test/unittest/BUILD.gn
#	new file:   cli_tool_framework/test/unittest/cli_event_report_test/BUILD.gn
#	new file:   cli_tool_framework/test/unittest/cli_event_report_test/cli_event_report_test.cpp
#	modified:   cli_tool_framework/test/unittest/cli_tool_mgr_service_test/BUILD.gn
#	modified:   cli_tool_framework/test/unittest/cli_tool_mgr_service_test/cli_tool_mgr_service_test.cpp
#	modified:   cli_tool_framework/test/unittest/cli_tool_mgr_service_test/permission_util_mock.cpp
#	modified:   cli_tool_framework/test/unittest/common_mock/climgr/include/tool_util.h
#	modified:   cli_tool_framework/test/unittest/common_mock/climgr/src/cli_mgr_service_mock.cpp
#	modified:   cli_tool_framework/test/unittest/process_manager_test/BUILD.gn
#	modified:   cli_tool_framework/test/unittest/tool_util_test/tool_util_test.cpp
#	modified:   hisysevent.yaml
#
# Untracked files:
#	.claude/
#	1.diff
#	"CLI\345\267\245\345\205\267\346\211\223\347\202\271\344\274\230\345\214\226\346\200\273\347\273\223.md"
#
2026-06-27 09:54:20 +08:00