Signed-off-by: wenjinchao <wenjinchao@huawei.com>
Change-Id: I631a47b62ccedd78d35eb2ee88ede3729d386863
This commit is contained in:
wenjinchao 2024-11-19 16:10:31 +08:00
parent 371465bf36
commit 28b2d9c8e8

View File

@ -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;