diff --git a/frameworks/native/cloudsync_kit_inner/src/cloud_sync_common.cpp b/frameworks/native/cloudsync_kit_inner/src/cloud_sync_common.cpp index 275ec97f51720aba189c6a1252121cb8d89d5b28..5dce6df92a2bd62751cd61df41aa05e9479948ee 100644 --- a/frameworks/native/cloudsync_kit_inner/src/cloud_sync_common.cpp +++ b/frameworks/native/cloudsync_kit_inner/src/cloud_sync_common.cpp @@ -648,6 +648,8 @@ bool CleanFileInfoObj::ReadFromParcel(Parcel &parcel) parcel.ReadString(path); parcel.ReadString(fileName); parcel.ReadStringVector(&attachment); + parcel.ReadString(storagePath); + parcel.ReadInt32(fileSourceType); return true; } @@ -659,6 +661,8 @@ bool CleanFileInfoObj::Marshalling(Parcel &parcel) const parcel.WriteString(path); parcel.WriteString(fileName); parcel.WriteStringVector(attachment); + parcel.WriteString(storagePath); + parcel.WriteInt32(fileSourceType); return true; } diff --git a/interfaces/inner_api/native/cloudsync_kit_inner/cloud_sync_common.h b/interfaces/inner_api/native/cloudsync_kit_inner/cloud_sync_common.h index 508b18c679f18a26edc9c7c223cec711bf1b7b09..65a72310ddffe326844edfb1e8c7faed9f50221d 100644 --- a/interfaces/inner_api/native/cloudsync_kit_inner/cloud_sync_common.h +++ b/interfaces/inner_api/native/cloudsync_kit_inner/cloud_sync_common.h @@ -177,11 +177,13 @@ struct AssetInfoObj : public Parcelable { struct CleanFileInfo { std::string cloudId; - int64_t size; - int64_t modifiedTime; + int64_t size{0}; + int64_t modifiedTime{0}; std::string path; std::string fileName; std::vector attachment; + std::string storagePath; + int32_t fileSourceType{0}; }; struct CleanFileInfoObj : public Parcelable { @@ -191,6 +193,8 @@ struct CleanFileInfoObj : public Parcelable { std::string path; std::string fileName; std::vector attachment; + std::string storagePath; + int32_t fileSourceType; bool ReadFromParcel(Parcel &parcel); bool Marshalling(Parcel &parcel) const override; static CleanFileInfoObj *Unmarshalling(Parcel &parcel); @@ -202,7 +206,9 @@ struct CleanFileInfoObj : public Parcelable { modifiedTime(FileInfo.modifiedTime), path(FileInfo.path), fileName(FileInfo.fileName), - attachment(FileInfo.attachment) + attachment(FileInfo.attachment), + storagePath(FileInfo.storagePath), + fileSourceType(FileInfo.fileSourceType) { } }; diff --git a/interfaces/kits/js/cloudfilesync/cloud_file_cache_napi.cpp b/interfaces/kits/js/cloudfilesync/cloud_file_cache_napi.cpp index 4dcdafeaa8e31882d3a420459dfbb694fdb224fc..b3f80f7fd8cd980d6afa5c4859e658950bfa98a9 100644 --- a/interfaces/kits/js/cloudfilesync/cloud_file_cache_napi.cpp +++ b/interfaces/kits/js/cloudfilesync/cloud_file_cache_napi.cpp @@ -44,7 +44,7 @@ int32_t CloudFileCacheCallbackImplNapi::StartDownloadInner(const std::string &ur LOGE("Start single download failed! ret = %{public}d", ret); return ret; } - downloadInfos_[downloadId] = std::make_shared(downloadId); + downloadInfos_[downloadId] = std::make_shared(downloadId, uri); return ret; } diff --git a/interfaces/kits/js/cloudfilesync/cloud_file_napi.cpp b/interfaces/kits/js/cloudfilesync/cloud_file_napi.cpp index 31d7d4e839e4f35e0f22788e35b47476de5b23fd..cd5c1a3edba79a21e8f0830f2d18f9353862f3c8 100644 --- a/interfaces/kits/js/cloudfilesync/cloud_file_napi.cpp +++ b/interfaces/kits/js/cloudfilesync/cloud_file_napi.cpp @@ -40,7 +40,7 @@ int32_t CloudDownloadCallbackImplNapi::StartDownloadInner(const std::string &uri return ret; } - downloadInfos_[downloadId] = std::make_shared(downloadId); + downloadInfos_[downloadId] = std::make_shared(downloadId, uri); return ret; } diff --git a/interfaces/kits/js/cloudfilesync/download_progress_napi.h b/interfaces/kits/js/cloudfilesync/download_progress_napi.h index 3d54400ecfff26f9f98d91324093aa2d41ea8fb7..9aa5c243a89a6febe3787ea74ccbc384e84eb13b 100644 --- a/interfaces/kits/js/cloudfilesync/download_progress_napi.h +++ b/interfaces/kits/js/cloudfilesync/download_progress_napi.h @@ -76,7 +76,8 @@ protected: class SingleProgressNapi : public DlProgressNapi { public: - explicit SingleProgressNapi(int64_t downloadId) : DlProgressNapi(downloadId) {} + SingleProgressNapi(int64_t downloadId, const std::string &uri) + : DlProgressNapi(downloadId), uri_(uri) {} void Update(const DownloadProgressObj &progress) override; napi_value ConvertToValue(napi_env env) override; std::shared_ptr CreateNewObject() override; diff --git a/services/cloudfiledaemon.cfg b/services/cloudfiledaemon.cfg index 036a50c65eda23b5341dc1b316b6a0b5046a0daa..0d99072d0768f815f3a9dc0443e9e0d3b95d9b4e 100644 --- a/services/cloudfiledaemon.cfg +++ b/services/cloudfiledaemon.cfg @@ -3,7 +3,7 @@ "name": "cloudfiledaemon", "path": ["/system/bin/sa_main", "/system/profile/cloudfiledaemon.json"], "uid": "1009", - "gid": ["dfs", "user_data_rw", "ddms", "dfs_share", "readproc"], + "gid": ["dfs", "user_data_rw", "ddms", "media_rw", "dfs_share", "readproc"], "caps": ["CHOWN"], "sandbox": 0, "secon": "u:r:cloudfiledaemon:s0", diff --git a/services/cloudsyncservice/src/ipc/cloud_sync_service.cpp b/services/cloudsyncservice/src/ipc/cloud_sync_service.cpp index a353e07ce3cb12b1f9f1802ad6010c3b74b6988b..b7a09422f1a20b5ab60eab027446e98c912087f3 100644 --- a/services/cloudsyncservice/src/ipc/cloud_sync_service.cpp +++ b/services/cloudsyncservice/src/ipc/cloud_sync_service.cpp @@ -1072,7 +1072,8 @@ int32_t CloudSyncService::BatchCleanFile(const std::vector &fi std::vector cleanFilesInfo; for (const auto &obj : fileInfo) { - CleanFileInfo tmpFileInfo{obj.cloudId, obj.size, obj.modifiedTime, obj.path, obj.fileName, obj.attachment}; + CleanFileInfo tmpFileInfo{obj.cloudId, obj.size, obj.modifiedTime, obj.path, obj.fileName, obj.attachment, + obj.storagePath, obj.fileSourceType}; cleanFilesInfo.emplace_back(tmpFileInfo); } diff --git a/services/distributedfile.cfg b/services/distributedfile.cfg index e59489ab86f73b657693f251cfd513efb43c3461..edbfda351b0125bb8389c3c51f3e169a544fd3b2 100644 --- a/services/distributedfile.cfg +++ b/services/distributedfile.cfg @@ -37,7 +37,7 @@ "name": "cloudfileservice", "path": ["/system/bin/sa_main", "/system/profile/cloudfileservice.json"], "uid": "dfs", - "gid": ["dfs", "user_data_rw", "ddms", "dfs_share"], + "gid": ["dfs", "user_data_rw", "media_rw", "ddms", "dfs_share"], "caps": ["CHOWN"], "sandbox": 0, "jobs" : {