diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index 3a129e8513165a962b3c12d276d8f94fe2992d9a..98728d915777deebe98c8139d9103d47081916a9 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -2847,6 +2847,10 @@ "first_introduced": "18", "name": "OH_ArkUI_PostFrameCallback" }, + { + "first_introduced": "18", + "name": "OH_ArkUI_PostIdleCallback" + }, { "first_introduced": "15", "name": "OH_ArkUI_HostWindowInfo_GetName" diff --git a/arkui/ace_engine/native/native_node_napi.h b/arkui/ace_engine/native/native_node_napi.h index 8070149fa3245b42b6568ca73fe1194cfa10a075..4b03fb9162f6153ea60e4308811bce8d4e927a79 100644 --- a/arkui/ace_engine/native/native_node_napi.h +++ b/arkui/ace_engine/native/native_node_napi.h @@ -374,6 +374,24 @@ ArkUI_ErrorCode OH_ArkUI_GetRouterPageId( int32_t OH_ArkUI_PostFrameCallback(ArkUI_ContextHandle uiContext, void* userData, void (*callback)(uint64_t nanoTimestamp, uint32_t frameCount, void* userData)); +/** + * @brief Register a callback to be executed at the end of the next idle frame.If there is no next frame, will request one automatically. + * + * @param uiContext ArkUI_ContextHandle. + * @param userData Indicates the custom data to be saved. + * @param callback Custom callback function. + * @param nanoTimeLeft The remaining time from the deadline for this frame. + * @param frameCount Frame count. + * @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 18 + */ + int32_t OH_ArkUI_PostIdleCallback(ArkUI_ContextHandle uiContext, void* userData, + void (*callback)(uint64_t nanoTimeLeft, uint32_t frameCount, void* userData)); + #ifdef __cplusplus }; #endif