From a3b38ba4134b1a8bbf770410541e102767b4688a Mon Sep 17 00:00:00 2001 From: luqing Date: Fri, 16 May 2025 16:04:32 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A9=BA=E6=8E=A5=E5=8F=A3=E5=AE=9E=E7=8E=B0?= =?UTF-8?q?=20Signed-off-by:=20luqing=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../object/include/object_data_listener.h | 3 +++ .../service/object/src/object_data_listener.cpp | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/services/distributeddataservice/service/object/include/object_data_listener.h b/services/distributeddataservice/service/object/include/object_data_listener.h index 3c1bfdea0..7c3140c7b 100644 --- a/services/distributeddataservice/service/object/include/object_data_listener.h +++ b/services/distributeddataservice/service/object/include/object_data_listener.h @@ -38,6 +38,9 @@ public: const std::string &dstBundleName) override; int32_t OnFinished(const std::string &srcNetworkId, const sptr &assetObj, int32_t result) override; + int32_t OnRecvProgress(const std::string &srcNetworkId, + const sptr &assetObj, + uint64_t totalBytes, uint64_t processBytes) override; }; } // namespace DistributedObject } // namespace OHOS diff --git a/services/distributeddataservice/service/object/src/object_data_listener.cpp b/services/distributeddataservice/service/object/src/object_data_listener.cpp index e7a7a5d0a..8451fa30d 100644 --- a/services/distributeddataservice/service/object/src/object_data_listener.cpp +++ b/services/distributeddataservice/service/object/src/object_data_listener.cpp @@ -71,5 +71,22 @@ int32_t ObjectAssetsRecvListener::OnFinished(const std::string &srcNetworkId, co ObjectStoreManager::GetInstance()->NotifyAssetsReady(objectKey, assetObj->dstBundleName_, srcNetworkId); return OBJECT_SUCCESS; } + + +int32_t ObjectAssetsRecvListener::OnRecvProgress(const std::string &srcNetworkId, const sptr &assetObj, + uint64_t totalBytes, uint64_t processBytes) +{ + if (assetObj == nullptr) { + ZLOGE("OnRecvProgress error! srcNetworkId:%{public}s", + DistributedData::Anonymous::Change(srcNetworkId).c_str()); + return OBJECT_INNER_ERROR; + } + + auto objectKey = assetObj->dstBundleName_ + assetObj->sessionId_; + ZLOGI("OnRecvProgress, srcNetworkId: %{public}s, objectKey:%{public}s, totalBytes: %{public}llu," + "processBytes: %{public}llu.", + DistributedData::Anonymous::Change(srcNetworkId).c_str(), objectKey.c_str(), totalBytes, processBytes); + return OBJECT_SUCCESS; +} } // namespace DistributedObject } // namespace OHOS -- Gitee