diff --git a/ability/ability_runtime/child_process/libchild_process.ndk.json b/ability/ability_runtime/child_process/libchild_process.ndk.json index 60cf2b93d475ae34e9eea9c1b247b2e625e6643a..f4fa170602536e3b67727e0f5731d2ee5b9dd19f 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 ce59adf740bd17bd4832cc76d0e6ef13fddae81c..ec4d5c561fad7dced2faca1c2f53fdf086ff5c07 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. *