diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index 5b65e0b019a008d12484ba05bad038407957dc02..3db06e7d2c2fdbc94bc732b6a577a14375fe814a 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -3339,6 +3339,10 @@ "first_introduced": "20", "name": "OH_ArkUI_EmbeddedComponentOption_SetOnError" }, + { + "first_introduced": "20", + "name": "OH_ArkUI_RunTaskInScope" + }, { "first_introduced": "20", "name": "OH_ArkUI_EmbeddedComponentOption_SetOnTerminated" diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index 1ae255fea769627e27ad59726db8a65b0e2da445..a73e71c42af4ba4e4af2e6090f3ad8d96f5cce49 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -9423,6 +9423,21 @@ ArkUI_ErrorCode OH_ArkUI_AddSupportedUIStates(ArkUI_NodeHandle node, int32_t uiS */ ArkUI_ErrorCode OH_ArkUI_RemoveSupportedUIStates(ArkUI_NodeHandle node, int32_t uiStates); +/** + * @brief Run a custom function inside the UIContext scope. + * + * @param uiContext Indicates the pointer to a UI instance. + * @param userData Indicates the pointer to the custom data. + * @param callback The custom function. + * @return Returns the result code. + * Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + * Returns {@link ARKUI_ERROR_CODE_CAPI_INIT_ERROR} if the CAPI init error. + * Returns {@link ARKUI_ERROR_CODE_UI_CONTEXT_INVALID} if the uiContext is invalid. + * Returns {@link ARKUI_ERROR_CODE_CALLBACK_INVALID} if the callback function is invalid. + * @since 20 + */ +int32_t OH_ArkUI_RunTaskInScope(ArkUI_ContextHandle uiContext, void* userData, void(*callback)(void* userData)); + #ifdef __cplusplus }; #endif