From 5ea546252dd48123e368336bdeb44db21f23894a Mon Sep 17 00:00:00 2001 From: wangyang2022 Date: Thu, 26 Jun 2025 12:23:05 +0000 Subject: [PATCH] =?UTF-8?q?CAPI=E5=B9=B6=E8=A1=8C=E5=8C=96API=20Signed-off?= =?UTF-8?q?-by:=20wangyang2022=20=20Change-Id:=20I?= =?UTF-8?q?1d2d116c8d47f8e0adfa082174a4ac800ace71f3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- arkui/ace_engine/native/libace.ndk.json | 8 ++++++-- arkui/ace_engine/native/native_interface.h | 1 + arkui/ace_engine/native/native_node.h | 17 +++++++++++++++-- arkui/ace_engine/native/native_type.h | 2 +- 4 files changed, 23 insertions(+), 5 deletions(-) diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index b9d1cdc1647..51d609e0e97 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -3292,11 +3292,15 @@ "name": "OH_ArkUI_XComponent_IsInitialized" }, { - "first_introduced": "18", + "first_introduced": "20", "name": "OH_ArkUI_PostAsyncUITask" }, { - "first_introduced": "18", + "first_introduced": "20", "name": "OH_ArkUI_PostUITask" + }, + { + "first_introduced": "20", + "name": "OH_ArkUI_PostUITaskAndWait" } ] \ No newline at end of file diff --git a/arkui/ace_engine/native/native_interface.h b/arkui/ace_engine/native/native_interface.h index 0b91544ff8d..4c340577951 100644 --- a/arkui/ace_engine/native/native_interface.h +++ b/arkui/ace_engine/native/native_interface.h @@ -60,6 +60,7 @@ typedef enum { /** * API related to supported multi thread UI components. * For details, see the struct definition in . + * @since 20 */ ARKUI_MULTI_THREAD_NATIVE_NODE, } ArkUI_NativeAPIVariantKind; diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index 04bdc80e81d..28dd21a8696 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -9229,7 +9229,7 @@ int32_t OH_ArkUI_NodeUtils_GetPositionToParent(ArkUI_NodeHandle node, ArkUI_IntO * @return Returns the result code. * Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. * Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter error occurs. - * @since 18 + * @since 20 */ int32_t OH_ArkUI_PostAsyncUITask(ArkUI_ContextHandle context, void* asyncUITaskData, void (*asyncUITask)(void* asyncUITaskData), void (*onFinish)(void* asyncUITaskData)); @@ -9243,10 +9243,23 @@ int32_t OH_ArkUI_PostAsyncUITask(ArkUI_ContextHandle context, void* asyncUITaskD * @return Returns the result code. * Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. * Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter error occurs. - * @since 18 + * @since 20 */ int32_t OH_ArkUI_PostUITask(ArkUI_ContextHandle context, void* taskData, void (*task)(void* taskData)); +/** + * @brief Post UI task to UI thread and wait until UI task finished. + * + * @param context UIContext pointer of the page where the UI task located. + * @param taskData Parameter of task. + * @param task Function executed by UI thread. + * @return Returns the result code. + * Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + * Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter error occurs. + * @since 20 + */ +int32_t OH_ArkUI_PostUITaskAndWait(ArkUI_ContextHandle context, void* taskData, void (*task)(void* taskData)); + #ifdef __cplusplus }; #endif diff --git a/arkui/ace_engine/native/native_type.h b/arkui/ace_engine/native/native_type.h index 956e3e58172..c5524bafd71 100644 --- a/arkui/ace_engine/native/native_type.h +++ b/arkui/ace_engine/native/native_type.h @@ -2175,7 +2175,7 @@ typedef enum { ARKUI_ERROR_CODE_NODE_NOT_ON_MAIN_TREE = 106203, /** * @error The node is running on invalid thread. - * @since 18 + * @since 20 */ ARKUI_ERROR_CODE_NODE_ON_INVALID_THREAD = 106204, /** -- Gitee