mirror of
https://gitee.com/openharmony/distributeddatamgr_datamgr_service
synced 2024-11-23 06:50:35 +00:00
fix
Signed-off-by: wenjinchao <wenjinchao@huawei.com> Change-Id: I631a47b62ccedd78d35eb2ee88ede3729d386863
This commit is contained in:
parent
371465bf36
commit
28b2d9c8e8
@ -328,18 +328,19 @@ int32_t UdmfServiceImpl::VerifyUnifiedData(UnifiedData &unifiedData)
|
||||
}
|
||||
std::string localDeviceId = PreProcessUtils::GetLocalDeviceId();
|
||||
std::string sourceDeviceId = unifiedData.GetRuntime()->deviceId;
|
||||
if (localDeviceId != sourceDeviceId) {
|
||||
auto records = unifiedData.GetRecords();
|
||||
for (auto record : records) {
|
||||
if (record != nullptr && PreProcessUtils::IsFileType(record->GetType())) {
|
||||
auto file = static_cast<File *>(record.get());
|
||||
std::string remoteUri = file->GetRemoteUri();
|
||||
if (remoteUri.empty()) {
|
||||
ZLOGE("when cross devices, remote uri is required!");
|
||||
return E_ERROR;
|
||||
}
|
||||
file->SetUri(remoteUri); // cross dev, need dis path.
|
||||
if (localDeviceId == sourceDeviceId) {
|
||||
return E_OK;
|
||||
}
|
||||
auto records = unifiedData.GetRecords();
|
||||
for (auto record : records) {
|
||||
if (record != nullptr && PreProcessUtils::IsFileType(record->GetType())) {
|
||||
auto file = static_cast<File *>(record.get());
|
||||
std::string remoteUri = file->GetRemoteUri();
|
||||
if (remoteUri.empty()) {
|
||||
ZLOGE("when cross devices, remote uri is required!");
|
||||
return E_ERROR;
|
||||
}
|
||||
file->SetUri(remoteUri); // cross dev, need dis path.
|
||||
}
|
||||
}
|
||||
return E_OK;
|
||||
|
Loading…
Reference in New Issue
Block a user