From 800e2d36ec6a97df0fd77eec5baa690597c7fff5 Mon Sep 17 00:00:00 2001 From: zhang_hao_zheng Date: Tue, 26 Aug 2025 15:36:00 +0800 Subject: [PATCH] =?UTF-8?q?uid=E9=9A=94=E7=A6=BB=E9=9C=80=E6=B1=82?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhang_hao_zheng Change-Id: Ib1e9ffbbe64d94018acd6fea08cfc10ad1b2d956 --- .../child_process/libchild_process.ndk.json | 4 ++++ .../child_process/native_child_process.h | 17 ++++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/ability/ability_runtime/child_process/libchild_process.ndk.json b/ability/ability_runtime/child_process/libchild_process.ndk.json index 60cf2b93d47..f4fa1706025 100644 --- a/ability/ability_runtime/child_process/libchild_process.ndk.json +++ b/ability/ability_runtime/child_process/libchild_process.ndk.json @@ -42,5 +42,9 @@ { "first_introduced": "20", "name": "OH_Ability_StartNativeChildProcessWithConfigs" + }, + { + "first_introduced": "21", + "name": "OH_Ability_ChildProcessConfigs_SetIsolationUid" } ] diff --git a/ability/ability_runtime/child_process/native_child_process.h b/ability/ability_runtime/child_process/native_child_process.h index ce59adf740b..ec4d5c561fa 100644 --- a/ability/ability_runtime/child_process/native_child_process.h +++ b/ability/ability_runtime/child_process/native_child_process.h @@ -165,7 +165,6 @@ Ability_NativeChildProcess_ErrCode OH_Ability_DestroyChildProcessConfigs(Ability /** * @brief Sets the isolation mode for the specified child process configs. - * The isolationMode only takes effect in {@link OH_Ability_StartNativeChildProcessWithConfigs}. * * @param configs Pointer to the child process configs object. Must not be nullptr. * @param isolationMode The isolation mode to set. See {@link NativeChildProcess_IsolationMode} for details. @@ -176,6 +175,22 @@ Ability_NativeChildProcess_ErrCode OH_Ability_DestroyChildProcessConfigs(Ability Ability_NativeChildProcess_ErrCode OH_Ability_ChildProcessConfigs_SetIsolationMode( Ability_ChildProcessConfigs* configs, NativeChildProcess_IsolationMode isolationMode); +/** + * @brief Sets the UID isolation flag for the specified child process configs. + * The isolationUid only takes effect when {@link OH_Ability_ChildProcessConfigs_SetIsolationMode} + * is set to {@link NCP_ISOLATION_MODE_ISOLATED}. + * + * @param configs Pointer to the child process configs object. Must not be nullptr. + * @param isolationUid The UID isolation setting to apply. + * - true: uses independent UID + * - false: uses parent process's UID + * @return Returns {@link NCP_NO_ERROR} if the UID isolation flag is set successfully. + * Returns {@link NCP_ERR_INVALID_PARAM} if the input parameters are invalid. + * @since 21 + */ +Ability_NativeChildProcess_ErrCode OH_Ability_ChildProcessConfigs_SetIsolationUid( + Ability_ChildProcessConfigs* configs, bool isolationUid); + /** * @brief Sets the process name for the specified child process configs. * -- Gitee