From 495e8086c1ebb1fe04401eedd0411da64839120b Mon Sep 17 00:00:00 2001 From: zuojiangjiang Date: Tue, 25 Apr 2023 10:42:47 +0800 Subject: [PATCH 1/2] update Signed-off-by: zuojiangjiang --- .../framework/cloud/cloud_info.cpp | 14 ++-- .../framework/include/cloud/cloud_info.h | 2 +- .../service/cloud/cloud_service_impl.cpp | 69 ++----------------- .../service/cloud/cloud_service_impl.h | 5 +- .../service/cloud/cloud_service_stub.cpp | 25 ------- .../service/cloud/cloud_service_stub.h | 2 - .../service/rdb/rdb_service_impl.cpp | 8 +-- .../cloud_data/include/cloud_service_proxy.h | 2 - .../cloud_data/src/cloud_service_proxy.cpp | 23 ------- .../cloud_data/include/cloud_service.h | 4 -- 10 files changed, 20 insertions(+), 134 deletions(-) diff --git a/datamgr_service/services/distributeddataservice/framework/cloud/cloud_info.cpp b/datamgr_service/services/distributeddataservice/framework/cloud/cloud_info.cpp index e8d83c18..be368f11 100644 --- a/datamgr_service/services/distributeddataservice/framework/cloud/cloud_info.cpp +++ b/datamgr_service/services/distributeddataservice/framework/cloud/cloud_info.cpp @@ -92,15 +92,17 @@ bool CloudInfo::IsExist(const std::string &bundleName) const return false; } -void CloudInfo::DelApp(const std::string &bundleName) +void CloudInfo::UpdateApp(const std::vector &appInfos) { - for (auto it = apps.begin(); it != apps.end();) { - if (it->bundleName == bundleName) { - it = apps.erase(it); - break; + auto tmpInfo = appInfos; + for (auto &info : tmpInfo) { + auto app = GetApp(info.bundleName); + if (app.bundleName.empty()) { + continue; } - it++; + info.cloudSwitch = app.cloudSwitch; } + apps = tmpInfo; } CloudInfo::AppInfo &CloudInfo::GetApp(const std::string &bundleName) diff --git a/datamgr_service/services/distributeddataservice/framework/include/cloud/cloud_info.h b/datamgr_service/services/distributeddataservice/framework/include/cloud/cloud_info.h index f87c1d03..c7d2cd17 100644 --- a/datamgr_service/services/distributeddataservice/framework/include/cloud/cloud_info.h +++ b/datamgr_service/services/distributeddataservice/framework/include/cloud/cloud_info.h @@ -40,7 +40,7 @@ public: std::string GetSchemaKey(std::string bundleName) const; bool IsValid() const; bool IsExist(const std::string &bundleName) const; - void DelApp(const std::string &bundleName); + void UpdateApp(const std::vector &appInfos); AppInfo &GetApp(const std::string &bundleName); static std::string GetPrefix(const std::initializer_list &field); diff --git a/datamgr_service/services/distributeddataservice/service/cloud/cloud_service_impl.cpp b/datamgr_service/services/distributeddataservice/service/cloud/cloud_service_impl.cpp index 0cf1ebe7..bc24bd44 100644 --- a/datamgr_service/services/distributeddataservice/service/cloud/cloud_service_impl.cpp +++ b/datamgr_service/services/distributeddataservice/service/cloud/cloud_service_impl.cpp @@ -56,6 +56,7 @@ CloudServiceImpl::CloudServiceImpl() } UpdateCloudInfo(cloudInfo); AddSchema(cloudInfo); + // TODO: Clear Task }); EventCenter::GetInstance().Subscribe(CloudEvent::GET_SCHEMA, [this](const Event &event) { @@ -95,7 +96,7 @@ int32_t CloudServiceImpl::EnableCloud(const std::string &id, const std::map lg(mutex_); CloudInfo cloudInfo; cloudInfo.id = id; - if (GetCloudInfo(cloudInfo) != SUCCESS) { + if (GetCloudInfo(cloudInfo) != SUCCESS && GetServerInfo(cloudInfo) != SUCCESS) { return INVALID_ARGUMENT; } cloudInfo.enableCloud = true; @@ -113,7 +114,7 @@ int32_t CloudServiceImpl::DisableCloud(const std::string &id) std::lock_guard lg(mutex_); CloudInfo cloudInfo; cloudInfo.id = id; - if (GetCloudInfo(cloudInfo) != SUCCESS) { + if (GetCloudInfo(cloudInfo) != SUCCESS && GetServerInfo(cloudInfo) != SUCCESS) { return INVALID_ARGUMENT; } cloudInfo.enableCloud = false; @@ -128,7 +129,7 @@ int32_t CloudServiceImpl::ChangeAppSwitch(const std::string &id, const std::stri std::lock_guard lg(mutex_); CloudInfo cloudInfo; cloudInfo.id = id; - if (GetCloudInfo(cloudInfo) != SUCCESS) { + if (GetCloudInfo(cloudInfo) != SUCCESS && GetServerInfo(cloudInfo) != SUCCESS) { return INVALID_ARGUMENT; } auto &app = cloudInfo.GetApp(bundleName); @@ -147,7 +148,7 @@ int32_t CloudServiceImpl::Clean(const std::string &id, const std::mapGetUserByToken(tokenId); - if (ConfigCloudInfo(storeInfo, cloudInfo) != SUCCESS) { - return ERROR; - } - UpdateSchema(cloudInfo, storeInfo, storeInfo.version); - if (GetStoreSchema(cloudInfo, storeInfo, schema) != SUCCESS) { - return ERROR; - } - return SUCCESS; -} - -int32_t CloudServiceImpl::ConfigCloudInfo(const StoreInfo &storeInfo, CloudInfo &cloudInfo) -{ - if (GetCloudInfo(cloudInfo) != SUCCESS && GetServerInfo(cloudInfo) != SUCCESS) { - ZLOGE("id:%{public}s", Anonymous::Change(cloudInfo.id).c_str()); - return ERROR; - } - if (!cloudInfo.IsExist(storeInfo.bundleName)) { - CloudInfo::AppInfo appInfo; - appInfo.bundleName = storeInfo.bundleName; - appInfo.appId = GetAppId(storeInfo.bundleName); - cloudInfo.apps.emplace_back(appInfo); - } - MetaDataManager::GetInstance().SaveMeta(cloudInfo.GetKey(), cloudInfo, true); - return SUCCESS; -} - int32_t CloudServiceImpl::GetStoreSchema(const CloudInfo &cloudInfo, const StoreInfo &storeInfo, std::string &schema) { if (!cloudInfo.IsExist(storeInfo.bundleName)) { @@ -226,27 +191,6 @@ int32_t CloudServiceImpl::GetStoreSchema(const CloudInfo &cloudInfo, const Store return SUCCESS; } -int32_t CloudServiceImpl::ClearConfig(const std::string &id, const StoreInfo &storeInfo) -{ - if (!CheckAccess(storeInfo.bundleName)) { - ZLOGE("permission denied"); - return ERROR; - } - - CloudInfo cloudInfo; - cloudInfo.id = id; - if (GetCloudInfo(cloudInfo) != SUCCESS) { - ZLOGE("id:%{public}s", Anonymous::Change(cloudInfo.id).c_str()); - return ERROR; - } - if (cloudInfo.IsExist(storeInfo.bundleName)) { - auto keys = cloudInfo.GetSchemaKey(); - MetaDataManager::GetInstance().DelMeta(keys[storeInfo.bundleName], true); - cloudInfo.DelApp(storeInfo.bundleName); - } - return SUCCESS; -} - int32_t CloudServiceImpl::GetCloudInfo(CloudInfo &cloudInfo) { auto tokenId = IPCSkeleton::GetCallingTokenID(); @@ -299,6 +243,7 @@ void CloudServiceImpl::UpdateCloudInfo(CloudInfo &cloudInfo) } oldInfo.totalSpace = cloudInfo.totalSpace; oldInfo.remainSpace = cloudInfo.remainSpace; + oldInfo.UpdateApp(cloudInfo.apps); cloudInfo = oldInfo; MetaDataManager::GetInstance().SaveMeta(oldInfo.GetKey(), oldInfo, true); } diff --git a/datamgr_service/services/distributeddataservice/service/cloud/cloud_service_impl.h b/datamgr_service/services/distributeddataservice/service/cloud/cloud_service_impl.h index 0df774ea..097f2719 100644 --- a/datamgr_service/services/distributeddataservice/service/cloud/cloud_service_impl.h +++ b/datamgr_service/services/distributeddataservice/service/cloud/cloud_service_impl.h @@ -31,8 +31,6 @@ public: int32_t ChangeAppSwitch(const std::string &id, const std::string &bundleName, int32_t appSwitch) override; int32_t Clean(const std::string &id, const std::map &actions) override; int32_t NotifyDataChange(const std::string &id, const std::string &bundleName) override; - int32_t Config(const std::string &id, const StoreInfo &storeInfo, std::string &schema) override; - int32_t ClearConfig(const std::string &id, const StoreInfo &storeInfo) override; private: class Factory { @@ -50,7 +48,6 @@ private: void UpdateCloudInfo(CloudInfo &cloudInfo); void AddSchema(CloudInfo &cloudInfo); void UpdateSchema(CloudInfo &cloudInfo, const StoreInfo &storeInfo, int32_t version); - int32_t ConfigCloudInfo(const StoreInfo &storeInfo, CloudInfo &cloudInfo); int32_t GetStoreSchema(const CloudInfo &cloudInfo, const StoreInfo &storeInfo, std::string &schema); int32_t GetCloudInfo(CloudInfo &cloudInfo); int32_t GetServerInfo(CloudInfo &cloudInfo); @@ -58,7 +55,7 @@ private: std::string GetAppId(const std::string &bundleName); bool CheckAccess(const std::string &bundleName); std::mutex mutex_; - ConcurrentMap clousInfos_; + ConcurrentMap cloudInfos_; }; } // namespace OHOS::DistributedData diff --git a/datamgr_service/services/distributeddataservice/service/cloud/cloud_service_stub.cpp b/datamgr_service/services/distributeddataservice/service/cloud/cloud_service_stub.cpp index ae472364..2ccf869e 100644 --- a/datamgr_service/services/distributeddataservice/service/cloud/cloud_service_stub.cpp +++ b/datamgr_service/services/distributeddataservice/service/cloud/cloud_service_stub.cpp @@ -27,8 +27,6 @@ const CloudServiceStub::Handler CloudServiceStub::HANDLERS[TRANS_BUTT] = { &CloudServiceStub::OnChangeAppSwitch, &CloudServiceStub::OnClean, &CloudServiceStub::OnNotifyDataChange, - &CloudServiceStub::OnConfig, - &CloudServiceStub::OnClearConfig, }; int CloudServiceStub::OnRemoteRequest(uint32_t code, OHOS::MessageParcel &data, OHOS::MessageParcel &reply) @@ -103,27 +101,4 @@ int32_t CloudServiceStub::OnNotifyDataChange(const std::string &id, MessageParce auto result = NotifyDataChange(id, bundleName); return ITypesUtil::Marshal(reply, result) ? ERR_NONE : IPC_STUB_WRITE_PARCEL_ERR; } - -int32_t CloudServiceStub::OnConfig(const std::string &id, MessageParcel &data, MessageParcel &reply) -{ - StoreInfo storeInfo; - if (!ITypesUtil::Unmarshal(data, storeInfo)) { - ZLOGE("Unmarshal id:%{public}s", Anonymous::Change(id).c_str()); - return IPC_STUB_INVALID_DATA_ERR; - } - std::string schema; - auto result = Config(id, storeInfo, schema); - return ITypesUtil::Marshal(reply, result, schema) ? ERR_NONE : IPC_STUB_WRITE_PARCEL_ERR; -} - -int32_t CloudServiceStub::OnClearConfig(const std::string &id, MessageParcel &data, MessageParcel &reply) -{ - StoreInfo storeInfo; - if (!ITypesUtil::Unmarshal(data, storeInfo)) { - ZLOGE("Unmarshal id:%{public}s", Anonymous::Change(id).c_str()); - return IPC_STUB_INVALID_DATA_ERR; - } - auto result = ClearConfig(id, storeInfo); - return ITypesUtil::Marshal(reply, result) ? ERR_NONE : IPC_STUB_WRITE_PARCEL_ERR; -} } // namespace OHOS::CloudData diff --git a/datamgr_service/services/distributeddataservice/service/cloud/cloud_service_stub.h b/datamgr_service/services/distributeddataservice/service/cloud/cloud_service_stub.h index f1f3cd62..4175015d 100644 --- a/datamgr_service/services/distributeddataservice/service/cloud/cloud_service_stub.h +++ b/datamgr_service/services/distributeddataservice/service/cloud/cloud_service_stub.h @@ -31,8 +31,6 @@ private: int32_t OnChangeAppSwitch(const std::string &id, MessageParcel &data, MessageParcel &reply); int32_t OnClean(const std::string &id, MessageParcel &data, MessageParcel &reply); int32_t OnNotifyDataChange(const std::string &id, MessageParcel &data, MessageParcel &reply); - int32_t OnConfig(const std::string &id, MessageParcel &data, MessageParcel &reply); - int32_t OnClearConfig(const std::string &id, MessageParcel &data, MessageParcel &reply); static const Handler HANDLERS[TRANS_BUTT]; }; } // namespace OHOS::CloudData diff --git a/datamgr_service/services/distributeddataservice/service/rdb/rdb_service_impl.cpp b/datamgr_service/services/distributeddataservice/service/rdb/rdb_service_impl.cpp index ccb7f2d0..8f98b6d4 100644 --- a/datamgr_service/services/distributeddataservice/service/rdb/rdb_service_impl.cpp +++ b/datamgr_service/services/distributeddataservice/service/rdb/rdb_service_impl.cpp @@ -471,8 +471,7 @@ int32_t RdbServiceImpl::DestroyRDBTable(const RdbSyncerParam ¶m) int32_t RdbServiceImpl::OnInitialize() { auto tokenId = IPCSkeleton::GetCallingTokenID(); - auto user = AccountDelegate::GetInstance()->GetUserByToken(tokenId); - auto initEvt = std::make_unique(CloudEvent::FEATURE_INIT, user); + auto initEvt = std::make_unique(CloudEvent::FEATURE_INIT, tokenId); EventCenter::GetInstance().PostEvent(std::move(initEvt)); return RDB_OK; } @@ -485,9 +484,8 @@ int32_t RdbServiceImpl::GetSchema(const std::string &bundleName, const std::stri } auto event = std::make_unique(CloudEvent::GET_SCHEMA, IPCSkeleton::GetCallingTokenID(), storeName, bundleName); - EventCenter::GetInstance().PostEvent(move(event)); - - return 0; + EventCenter::GetInstance().PostEvent(std::move(event)); + return RDB_OK; } } // namespace OHOS::DistributedRdb diff --git a/relational_store/frameworks/native/cloud_data/include/cloud_service_proxy.h b/relational_store/frameworks/native/cloud_data/include/cloud_service_proxy.h index 0c6e7844..7dec3bf8 100644 --- a/relational_store/frameworks/native/cloud_data/include/cloud_service_proxy.h +++ b/relational_store/frameworks/native/cloud_data/include/cloud_service_proxy.h @@ -30,8 +30,6 @@ public: int32_t ChangeAppSwitch(const std::string &id, const std::string &bundleName, int32_t appSwitch) override; int32_t Clean(const std::string &id, const std::map &actions) override; int32_t NotifyDataChange(const std::string &id, const std::string &bundleName) override; - int32_t Config(const std::string &id, const StoreInfo &storeInfo, std::string &schema) override; - int32_t ClearConfig(const std::string &id, const StoreInfo &storeInfo) override; private: sptr remote_; diff --git a/relational_store/frameworks/native/cloud_data/src/cloud_service_proxy.cpp b/relational_store/frameworks/native/cloud_data/src/cloud_service_proxy.cpp index 833cb5a3..fd295595 100644 --- a/relational_store/frameworks/native/cloud_data/src/cloud_service_proxy.cpp +++ b/relational_store/frameworks/native/cloud_data/src/cloud_service_proxy.cpp @@ -102,27 +102,4 @@ int32_t CloudServiceProxy::NotifyDataChange(const std::string &id, const std::st } return static_cast(status); } - -int32_t CloudServiceProxy::Config(const std::string &id, const StoreInfo &storeInfo, std::string &schema) -{ - MessageParcel reply; - int32_t status = IPC_SEND(TRANS_CONFIG, reply, id, storeInfo); - if (status != SUCCESS) { - ZLOGE("status:0x%{public}x id:%{public}.6s bundleName:%{public}s, storeId:%{public}s", - status, id.c_str(), storeInfo.bundleName.c_str(), storeInfo.storeId.c_str()); - } - ITypesUtil::Unmarshal(reply, schema); - return static_cast(status); -} - -int32_t CloudServiceProxy::ClearConfig(const std::string &id, const StoreInfo &storeInfo) -{ - MessageParcel reply; - int32_t status = IPC_SEND(TRANS_CLEAR_CONFIG, reply, id, storeInfo); - if (status != SUCCESS) { - ZLOGE("status:0x%{public}x id:%{public}.6s bundleName:%{public}s, storeId:%{public}s", - status, id.c_str(), storeInfo.bundleName.c_str(), storeInfo.storeId.c_str()); - } - return static_cast(status); -} } // namespace OHOS::CloudData \ No newline at end of file diff --git a/relational_store/interfaces/inner_api/cloud_data/include/cloud_service.h b/relational_store/interfaces/inner_api/cloud_data/include/cloud_service.h index 83792cf6..a1b69ce2 100644 --- a/relational_store/interfaces/inner_api/cloud_data/include/cloud_service.h +++ b/relational_store/interfaces/inner_api/cloud_data/include/cloud_service.h @@ -30,8 +30,6 @@ public: TRANS_CHANGE_APP_SWITCH, TRANS_CLEAN, TRANS_NOTIFY_DATA_CHANGE, - TRANS_CONFIG, - TRANS_CLEAR_CONFIG, TRANS_BUTT, }; enum Action : int32_t @@ -69,8 +67,6 @@ public: virtual int32_t ChangeAppSwitch(const std::string &id, const std::string &bundleName, int32_t appSwitch) = 0; virtual int32_t Clean(const std::string &id, const std::map &actions) = 0; virtual int32_t NotifyDataChange(const std::string &id, const std::string &bundleName) = 0; - virtual int32_t Config(const std::string &id, const StoreInfo &storeInfo, std::string &schema) = 0; - virtual int32_t ClearConfig(const std::string &id, const StoreInfo &storeInfo) = 0; static constexpr const char *SERVICE_NAME = "cloud"; }; -- Gitee From d730ec460e4bcf4beaa9c32b469372cf245f6577 Mon Sep 17 00:00:00 2001 From: zuojiangjiang Date: Tue, 25 Apr 2023 11:12:17 +0800 Subject: [PATCH 2/2] update Signed-off-by: zuojiangjiang --- .../service/cloud/cloud_service_impl.cpp | 48 ------------------- .../service/cloud/cloud_service_impl.h | 2 - .../cloud_data/include/cloud_types_util.h | 30 ------------ .../cloud_data/src/cloud_types_util.cpp | 30 ------------ .../cloud_data/include/cloud_service.h | 6 --- 5 files changed, 116 deletions(-) delete mode 100644 relational_store/frameworks/native/cloud_data/include/cloud_types_util.h delete mode 100644 relational_store/frameworks/native/cloud_data/src/cloud_types_util.cpp diff --git a/datamgr_service/services/distributeddataservice/service/cloud/cloud_service_impl.cpp b/datamgr_service/services/distributeddataservice/service/cloud/cloud_service_impl.cpp index bc24bd44..334f7277 100644 --- a/datamgr_service/services/distributeddataservice/service/cloud/cloud_service_impl.cpp +++ b/datamgr_service/services/distributeddataservice/service/cloud/cloud_service_impl.cpp @@ -170,27 +170,6 @@ int32_t CloudServiceImpl::NotifyDataChange(const std::string &id, const std::str return 0; } -int32_t CloudServiceImpl::GetStoreSchema(const CloudInfo &cloudInfo, const StoreInfo &storeInfo, std::string &schema) -{ - if (!cloudInfo.IsExist(storeInfo.bundleName)) { - ZLOGE("no exist bundleName:%{public}s", storeInfo.bundleName.c_str()); - return ERROR; - } - SchemaMeta schemaMeta; - auto keys = cloudInfo.GetSchemaKey(); - if (!MetaDataManager::GetInstance().LoadMeta(keys[storeInfo.bundleName], schemaMeta, true)) { - ZLOGE("schema empty bundleName:%{public}s", storeInfo.bundleName.c_str()); - return ERROR; - } - auto database = schemaMeta.GetDataBase(storeInfo.storeId); - if (database.name.empty()) { - ZLOGE("storeId:%{public}s", storeInfo.storeId.c_str()); - return ERROR; - } - schema = Serializable::Marshall(database); - return SUCCESS; -} - int32_t CloudServiceImpl::GetCloudInfo(CloudInfo &cloudInfo) { auto tokenId = IPCSkeleton::GetCallingTokenID(); @@ -272,31 +251,4 @@ int32_t CloudServiceImpl::GetAppSchema(int32_t user, const std::string &bundleNa schemaMeta = instance->GetAppSchema(user, bundleName); return SUCCESS; } - -void CloudServiceImpl::UpdateSchema(CloudInfo &cloudInfo, const StoreInfo &storeInfo, int32_t version) -{ - SchemaMeta schemaMeta; - auto key = cloudInfo.GetSchemaKey(storeInfo.bundleName); - if (!MetaDataManager::GetInstance().LoadMeta(key, schemaMeta, true)) { - if (GetAppSchema(cloudInfo.user, storeInfo.bundleName, schemaMeta) != SUCCESS) { - ZLOGI("get schema meta fail"); - return; - } - MetaDataManager::GetInstance().SaveMeta(key, schemaMeta, true); - } - if (version <= schemaMeta.version) { - ZLOGI("input ver:%{public}d, meta ver:%{public}d", version, schemaMeta.version); - return; - } - SchemaMeta serverMeta; - if (GetAppSchema(cloudInfo.user, storeInfo.bundleName, serverMeta) != SUCCESS) { - ZLOGI("get schema meta fail"); - return; - } - if (serverMeta.version != version) { - ZLOGI("input ver:%{public}d, server ver:%{public}d", version, serverMeta.version); - return; - } - MetaDataManager::GetInstance().SaveMeta(key, serverMeta, true); -} } // namespace OHOS::CloudData \ No newline at end of file diff --git a/datamgr_service/services/distributeddataservice/service/cloud/cloud_service_impl.h b/datamgr_service/services/distributeddataservice/service/cloud/cloud_service_impl.h index 097f2719..80aa5100 100644 --- a/datamgr_service/services/distributeddataservice/service/cloud/cloud_service_impl.h +++ b/datamgr_service/services/distributeddataservice/service/cloud/cloud_service_impl.h @@ -47,8 +47,6 @@ private: void UpdateCloudInfo(CloudInfo &cloudInfo); void AddSchema(CloudInfo &cloudInfo); - void UpdateSchema(CloudInfo &cloudInfo, const StoreInfo &storeInfo, int32_t version); - int32_t GetStoreSchema(const CloudInfo &cloudInfo, const StoreInfo &storeInfo, std::string &schema); int32_t GetCloudInfo(CloudInfo &cloudInfo); int32_t GetServerInfo(CloudInfo &cloudInfo); int32_t GetAppSchema(int32_t user, const std::string &bundleName, SchemaMeta &schemaMeta); diff --git a/relational_store/frameworks/native/cloud_data/include/cloud_types_util.h b/relational_store/frameworks/native/cloud_data/include/cloud_types_util.h deleted file mode 100644 index 8dbd969d..00000000 --- a/relational_store/frameworks/native/cloud_data/include/cloud_types_util.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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. - */ - -#ifndef OHOS_DISTRIBUTED_DATA_CLOUD_CLOUD_TYPES_UTIL_H -#define OHOS_DISTRIBUTED_DATA_CLOUD_CLOUD_TYPES_UTIL_H - -#include "cloud_service.h" -#include "itypes_util.h" -#include "rdb_visibility.h" - -namespace OHOS::ITypesUtil { -using StoreInfo = CloudData::CloudService::StoreInfo; -template<> -RDB_API_EXPORT bool Marshalling(const StoreInfo &input, MessageParcel &data); -template<> -RDB_API_EXPORT bool Unmarshalling(StoreInfo &output, MessageParcel &data); -} // namespace OHOS::ITypesUtil -#endif // OHOS_DISTRIBUTED_DATA_CLOUD_CLOUD_TYPES_UTIL_H diff --git a/relational_store/frameworks/native/cloud_data/src/cloud_types_util.cpp b/relational_store/frameworks/native/cloud_data/src/cloud_types_util.cpp deleted file mode 100644 index d127971f..00000000 --- a/relational_store/frameworks/native/cloud_data/src/cloud_types_util.cpp +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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 "cloud_types_util.h" - -namespace OHOS::ITypesUtil { -template<> -bool Marshalling(const StoreInfo &input, MessageParcel &data) -{ - return ITypesUtil::Marshal(data, input.bundleName, input.storeId, input.version); -} -template<> -bool Unmarshalling(StoreInfo &output, MessageParcel &data) -{ - return ITypesUtil::Unmarshal(data, output.bundleName, output.storeId, output.version); -} -} // namespace OHOS::ITypesUtil - \ No newline at end of file diff --git a/relational_store/interfaces/inner_api/cloud_data/include/cloud_service.h b/relational_store/interfaces/inner_api/cloud_data/include/cloud_service.h index a1b69ce2..c180cf99 100644 --- a/relational_store/interfaces/inner_api/cloud_data/include/cloud_service.h +++ b/relational_store/interfaces/inner_api/cloud_data/include/cloud_service.h @@ -55,12 +55,6 @@ public: IPC_PARCEL_ERROR }; - struct RDB_API_EXPORT StoreInfo { - std::string bundleName; - std::string storeId; - int32_t version; - }; - virtual ~CloudService() = default; virtual int32_t EnableCloud(const std::string &id, const std::map &switches) = 0; virtual int32_t DisableCloud(const std::string &id) = 0; -- Gitee