diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index b9d1cdc1647cc9db61d004af63d80e67a2dcb246..51d609e0e9773feb8e613ddb5609775855c9b7c7 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 0b91544ff8d6bab9ccb26820dc7c3f80e8264b56..4c3405779511912c2b8b668c24e7ba5990028b62 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 04bdc80e81d8b600a3a5efed63cd7ae5be432516..28dd21a86966e5d6a5600316fade108d02a2ea56 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 956e3e581726409fee760e64989d8bebab619741..c5524bafd713e0a8a6ff78940678e69e1a3e0bac 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, /**