OH_ArkUI_DisableDropDataPrefetchOnNode

Function OH_ArkUI_DisableDropDataPrefetchOnNode 

Source
pub unsafe extern "C" fn OH_ArkUI_DisableDropDataPrefetchOnNode(
    node: ArkUI_NodeHandle,
    disabled: bool,
) -> i32
Available on crate features api-12 and api-15 only.
Expand description

Sets whether to disable data prefetch process before the onDrop callback executing. The system will retry to getting data until the max time limit (2.4s for now) reaches, this’s useful for the cross device draging operation, as the system helps to eliminate the communication instability, but it’s redundant for OH_ArkUI_DragEvent_StartDataLoading method, as it will take care the data fetching with asynchronous mechanism, so must set this field to true if using OH_ArkUI_DragEvent_StartDataLoading in onDrop to avoid the data is fetched before onDrop executing unexpectedly.

§Arguments

  • node - Indicates the pointer to a component node.

  • disabled - Indicates whether to disable the data pre-fetch process, true for disable, false for not.

§Returns

  • Returns the result code. Returns [ARKUI_ERROR_CODE_NO_ERROR] if the operation is successful. Returns [ARKUI_ERROR_CODE_PARAM_INVALID] if a parameter error occurs.

Available since API-level: 15