mirror of
https://gitee.com/openharmony/distributeddatamgr_datamgr_service
synced 2024-11-23 14:59:46 +00:00
!2232 【RDB端云】退账号场景,开库时注册监听
Merge pull request !2232 from Hollokin/master
This commit is contained in:
commit
b81d8d3266
@ -27,6 +27,7 @@ public:
|
||||
FEATURE_INIT = EVT_CLOUD,
|
||||
GET_SCHEMA,
|
||||
LOCAL_CHANGE,
|
||||
CLEAN_DATA,
|
||||
CLOUD_SYNC,
|
||||
DATA_CHANGE,
|
||||
SET_SEARCHABLE,
|
||||
|
@ -211,6 +211,11 @@ void CloudServiceImpl::DoClean(int32_t user, const SchemaMeta &schemaMeta, int32
|
||||
ZLOGE("store null, storeId:%{public}s", meta.GetStoreAlias().c_str());
|
||||
continue;
|
||||
}
|
||||
DistributedData::StoreInfo storeInfo;
|
||||
storeInfo.bundleName = meta.bundleName;
|
||||
storeInfo.user = atoi(meta.user.c_str());
|
||||
storeInfo.storeName = meta.storeId;
|
||||
EventCenter::GetInstance().PostEvent(std::make_unique<CloudEvent>(CloudEvent::CLEAN_DATA, storeInfo));
|
||||
auto status = store->Clean({}, action, "");
|
||||
if (status != E_OK) {
|
||||
ZLOGW("remove device data status:%{public}d, user:%{public}d, bundleName:%{public}s, "
|
||||
|
@ -99,10 +99,7 @@ void KVDBServiceImpl::Init()
|
||||
auto process = [this](const Event &event) {
|
||||
const auto &evt = static_cast<const CloudEvent &>(event);
|
||||
const auto &storeInfo = evt.GetStoreInfo();
|
||||
StoreMetaData meta;
|
||||
meta.storeId = storeInfo.storeName;
|
||||
meta.bundleName = storeInfo.bundleName;
|
||||
meta.user = std::to_string(storeInfo.user);
|
||||
StoreMetaData meta(storeInfo);
|
||||
meta.deviceId = DMAdapter::GetInstance().GetLocalDevice().uuid;
|
||||
if (!MetaDataManager::GetInstance().LoadMeta(meta.GetKey(), meta, true)) {
|
||||
if (meta.user == "0") {
|
||||
@ -132,6 +129,7 @@ void KVDBServiceImpl::Init()
|
||||
store->RegisterDetailProgressObserver(nullptr);
|
||||
};
|
||||
EventCenter::GetInstance().Subscribe(CloudEvent::CLOUD_SYNC, process);
|
||||
EventCenter::GetInstance().Subscribe(CloudEvent::CLEAN_DATA, process);
|
||||
}
|
||||
|
||||
void KVDBServiceImpl::RegisterKvServiceInfo()
|
||||
|
@ -120,6 +120,7 @@ RdbServiceImpl::RdbServiceImpl()
|
||||
store->RegisterDetailProgressObserver(GetCallbacks(meta.tokenId, storeInfo.storeName));
|
||||
};
|
||||
EventCenter::GetInstance().Subscribe(CloudEvent::CLOUD_SYNC, process);
|
||||
EventCenter::GetInstance().Subscribe(CloudEvent::CLEAN_DATA, process);
|
||||
|
||||
EventCenter::GetInstance().Subscribe(CloudEvent::MAKE_QUERY, [](const Event& event) {
|
||||
auto& evt = static_cast<const MakeQueryEvent&>(event);
|
||||
|
Loading…
Reference in New Issue
Block a user