From bc8161df8dff797aa9972779a68b6a3d603c5848 Mon Sep 17 00:00:00 2001 From: htt1997 Date: Sat, 28 Oct 2023 11:20:54 +0800 Subject: [PATCH 1/2] featur:rdb add SubscribeAutoSyncProgress interface Signed-off-by: htt1997 --- .../include/relational_store.h | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/distributeddatamgr/relational_store/include/relational_store.h b/distributeddatamgr/relational_store/include/relational_store.h index f32c252d818..5611eff9c7a 100644 --- a/distributeddatamgr/relational_store/include/relational_store.h +++ b/distributeddatamgr/relational_store/include/relational_store.h @@ -761,6 +761,28 @@ typedef void (*Rdb_SyncCallback)(Rdb_ProgressDetails *progressDetails); */ int OH_Rdb_CloudSync(OH_Rdb_Store *store, Rdb_SyncMode mode, const char *tables[], uint32_t count, Rdb_SyncCallback *callback); + +/** +* @brief Subscribes to the automatic synchronization progress of an RDB store. +* A callback will be invoked when there is a notification of the automatic synchronization progress. +* +* @param store Indicates the pointer to the target {@Link OH_Rdb_Store} instance. +* @param Indicates the callback invoked to return the automatic synchronization progress. +* @see OH_Rdb_Store. +* @since 11 +*/ +int OH_Rdb_SubscribeAutoSyncProgress(OH_Rdb_Store *store, Rdb_SyncCallback *callback); + +/** +* @brief Unsubscribes from the automatic synchronziation progress of an RDB store. +* +* @param store Indicates the pointer to the target {@Link OH_Rdb_Store} instance. +* @param progress Indicates the callback for the automatic synchornizaiton progress. +* If it is a null pointer, all callbacks for the automatic synchornizaiton progress will be unregistered. +* @see OH_Rdb_Store. +* @since 11 +*/ +int OH_Rdb_UnsubscribeAutoSyncProgress(OH_Rdb_Store *store, Rdb_SyncCallback *callback); #ifdef __cplusplus }; #endif -- Gitee From 66f45322c0fbfcf35a8c66872f76047e8a31a7d0 Mon Sep 17 00:00:00 2001 From: htt1997 Date: Mon, 6 Nov 2023 14:53:52 +0800 Subject: [PATCH 2/2] fix:update description Signed-off-by: htt1997 --- .../relational_store/include/relational_store.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/distributeddatamgr/relational_store/include/relational_store.h b/distributeddatamgr/relational_store/include/relational_store.h index 5611eff9c7a..c75396cc43a 100644 --- a/distributeddatamgr/relational_store/include/relational_store.h +++ b/distributeddatamgr/relational_store/include/relational_store.h @@ -768,7 +768,9 @@ int OH_Rdb_CloudSync(OH_Rdb_Store *store, Rdb_SyncMode mode, const char *tables[ * * @param store Indicates the pointer to the target {@Link OH_Rdb_Store} instance. * @param Indicates the callback invoked to return the automatic synchronization progress. +* @return Returns the status code of the execution. See {@link OH_Rdb_ErrCode}. * @see OH_Rdb_Store. +* @see Rdb_SyncCallback. * @since 11 */ int OH_Rdb_SubscribeAutoSyncProgress(OH_Rdb_Store *store, Rdb_SyncCallback *callback); @@ -779,7 +781,9 @@ int OH_Rdb_SubscribeAutoSyncProgress(OH_Rdb_Store *store, Rdb_SyncCallback *call * @param store Indicates the pointer to the target {@Link OH_Rdb_Store} instance. * @param progress Indicates the callback for the automatic synchornizaiton progress. * If it is a null pointer, all callbacks for the automatic synchornizaiton progress will be unregistered. +* @return Returns the status code of the execution. See {@link OH_Rdb_ErrCode}. * @see OH_Rdb_Store. +* @see Rdb_SyncCallback. * @since 11 */ int OH_Rdb_UnsubscribeAutoSyncProgress(OH_Rdb_Store *store, Rdb_SyncCallback *callback); -- Gitee