!703 表数据同步

Merge pull request !703 from torrizo/master
This commit is contained in:
openharmony_ci 2024-10-25 11:23:02 +00:00 committed by Gitee
commit 3f465427dc
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 19 additions and 0 deletions

View File

@ -95,6 +95,7 @@ private:
void NotifyNotOHBaseOnline(const DistributedHardware::DmDeviceInfo deviceInfo);
void E2ESyncDynamicProfile(const DistributedHardware::DmDeviceInfo deviceInfo);
void ClearDataWithPeerLogout(const std::string& peerUdid, const std::string& peerUuid);
void FixDiffProfiles();
bool isAdapterSoLoaded_ = false;
std::mutex isAdapterLoadLock_;
std::mutex dynamicStoreMutex_;

View File

@ -32,6 +32,7 @@ public:
bool isP2p) = 0;
virtual int32_t SyncProfile(const std::string& peerUdid, const std::string& peerNetworkId,
const sptr<IRemoteObject> syncCb, bool isP2p) = 0;
virtual int32_t FixDiffProfiles(const std::vector<std::string>& udidVtr) = 0;
};
using CreateDPSyncAdapterFuncPtr = IDPSyncAdapter *(*)(void);
} // namespace DeviceProfile

View File

@ -978,6 +978,23 @@ void DeviceProfileManager::ClearDataWithPeerLogout(const std::string& peerUdid,
HILOGE("RemoveDeviceData fail, peerUuid=%{public}s", ProfileUtils::GetAnonyString(peerUuid).c_str());
return;
}
FixDiffProfiles();
}
void DeviceProfileManager::FixDiffProfiles()
{
HILOGI("call");
std::lock_guard<std::mutex> lock(isAdapterLoadLock_);
if (dpSyncAdapter_ == nullptr) {
HILOGE("dpSyncAdapter is nullptr!");
return;
}
int32_t ret = dpSyncAdapter_->FixDiffProfiles({});
if (ret!= DP_SUCCESS) {
HILOGE("FixDiffProfiles fail! ret=%{public}d", ret);
return;
}
return;
}
} // namespace DeviceProfile
} // namespace OHOS