/* * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "data_syncer.h" #include #include "dfs_error.h" namespace OHOS { namespace FileManagement { namespace CloudSync { using namespace std; using namespace placeholders; using namespace DriveKit; DataSyncer::DataSyncer(const std::string bundleName, const int32_t userId) : bundleName_(bundleName), userId_(userId) { } DataSyncer::~DataSyncer() { } int32_t DataSyncer::AsyncRun(std::shared_ptr context, void(DataSyncer::*f)(std::shared_ptr)) { return E_OK; } template function DataSyncer::AsyncCallback(RET(T::*f)(ARGS...)) { return nullptr; } int32_t DataSyncer::StartSync(bool forceFlag, SyncTriggerType triggerType) { return E_OK; } int32_t DataSyncer::StopSync(SyncTriggerType triggerType) { return E_OK; } int32_t DataSyncer::StartDownloadFile(const std::string path, const int32_t userId) { return E_OK; } int32_t DataSyncer::StopDownloadFile(const std::string path, const int32_t userId) { return E_OK; } int32_t DataSyncer::RegisterDownloadFileCallback(const int32_t userId, const sptr downloadCallback) { return E_OK; } int32_t DataSyncer::UnregisterDownloadFileCallback(const int32_t userId) { return E_OK; } int32_t DataSyncer::Clean(const int action) { return E_OK; } void DataSyncer::Abort() { } void DataSyncer::Reset() { } void DataSyncer::SetSdkHelper(shared_ptr &sdkHelper) { } int32_t DataSyncer::Pull(shared_ptr handler) { return E_OK; } void DataSyncer::PullRecords(shared_ptr context) { } void DataSyncer::PullDatabaseChanges(shared_ptr context) { } void DataSyncer::DownloadAssets(DownloadContext &ctx) { } int32_t DataSyncer::CleanInner(std::shared_ptr handler, const int action) { return E_OK; } void DataSyncer::ClearCursor() { } void EmptyDownLoadAssetsprogress(std::shared_ptr, DKDownloadAsset, TotalSize, DownloadSize) { return; } int DataSyncer::HandleOnFetchRecords(const std::shared_ptr context, std::shared_ptr database, std::shared_ptr> records, bool checkOrRetry) { return E_OK; } void DataSyncer::OnFetchRecords(const std::shared_ptr context, std::shared_ptr database, std::shared_ptr> records, DKQueryCursor nextCursor, const DKError &err) { } int32_t DataSyncer::DownloadInner(std::shared_ptr handler, const std::string path, const int32_t userId) { return E_OK; } void DataSyncer::OnFetchDatabaseChanges(const std::shared_ptr context, std::shared_ptr database, std::shared_ptr> records, DKQueryCursor nextCursor, bool hasMore, const DKError &err) { } void DataSyncer::PullRecordsWithId(shared_ptr context, const std::vector &records, bool retry) { } void DataSyncer::OnFetchRecordWithId(shared_ptr context, shared_ptr database, DKRecordId recordId, const DKRecord &record, const DKError &error) { } int32_t DataSyncer::Push(shared_ptr handler) { return E_OK; } void DataSyncer::CreateRecords(shared_ptr context) { } void DataSyncer::DeleteRecords(shared_ptr context) { } void DataSyncer::ModifyMdirtyRecords(shared_ptr context) { } void DataSyncer::ModifyFdirtyRecords(shared_ptr context) { } void DataSyncer::OnCreateRecords(shared_ptr context, shared_ptr database, shared_ptr> map, const DKError &err) { } void DataSyncer::OnDeleteRecords(shared_ptr context, shared_ptr database, shared_ptr> map, const DKError &err) { } void DataSyncer::OnModifyMdirtyRecords(shared_ptr context, shared_ptr database, shared_ptr> saveMap, shared_ptr> deleteMap, const DKError &err) { } void DataSyncer::OnModifyFdirtyRecords(shared_ptr context, shared_ptr database, shared_ptr> saveMap, shared_ptr> deleteMap, const DKError &err) { } void DataSyncer::BeginTransaction() { } void DataSyncer::EndTransaction() { } std::string DataSyncer::GetBundleName() const { return bundleName_; } int32_t DataSyncer::GetUserId() const { return userId_; } SyncState DataSyncer::GetSyncState() const { if (bundleName_ == "com.ohos.photos") { return SyncState::SYNC_SUCCEED; } return SyncState::SYNC_FAILED; } int DataSyncer::CompletePull() { return E_OK; } int DataSyncer::CompletePush() { return E_OK; } void DataSyncer::CompleteAll(bool isNeedNotify) { } void DataSyncer::SyncStateChangedNotify(const CloudSyncState state, const ErrorType error) { } } // namespace CloudSync } // namespace FileManagement } // namespace OHOS