diff --git a/services/backup_sa/src/module_external/sms_adapter.cpp b/services/backup_sa/src/module_external/sms_adapter.cpp index d37937369e9ea3c26eb5159fa5e28a2d4019442a..81ceb224f40484607092e45b9eb10ae4ce9b9074 100644 --- a/services/backup_sa/src/module_external/sms_adapter.cpp +++ b/services/backup_sa/src/module_external/sms_adapter.cpp @@ -31,6 +31,7 @@ const string MEDIA_LIBRARY_HAP = "com.ohos.medialibrary.medialibrarydata"; const string EXTERNAL_FILE_HAP = "com.ohos.UserFile.ExternalFileManager"; const string MEDIA_TYPE = "media"; const string FILE_TYPE = "file"; +const int64_t ERR_SIZE = -1; } // namespace static sptr GetStorageManager() @@ -64,12 +65,14 @@ int64_t StorageMgrAdapter::GetUserStorageStats(const std::string &bundleName, in auto storageMgr = GetStorageManager(); if (bundleName == MEDIA_LIBRARY_HAP) { if (storageMgr->GetUserStorageStatsByType(userId, bundleStats, MEDIA_TYPE)) { - throw BError(BError::Codes::SA_BROKEN_IPC, "Failed to get user media storage stats"); + HILOGE("Failed to get user media storage stats"); + return ERR_SIZE; } return bundleStats.image_ + bundleStats.video_; } else if (bundleName == EXTERNAL_FILE_HAP) { if (storageMgr->GetUserStorageStatsByType(userId, bundleStats, FILE_TYPE)) { - throw BError(BError::Codes::SA_BROKEN_IPC, "Failed to get user file storage stats"); + HILOGE("Failed to get user file storage stats"); + return ERR_SIZE; } return bundleStats.file_; } diff --git a/services/backup_sa/src/module_ipc/service.cpp b/services/backup_sa/src/module_ipc/service.cpp index 91fd3273bdfc6b83c8c9593b7154fccf39020981..a920813304fc38ad7287bdd30d98c8b167fee814 100644 --- a/services/backup_sa/src/module_ipc/service.cpp +++ b/services/backup_sa/src/module_ipc/service.cpp @@ -1221,7 +1221,7 @@ void Service::ExtConnectFailed(const string &bundleName, ErrCode ret) ReportOnExtConnectFailed(scenario, bundleName, ret); SendEndAppGalleryNotify(bundleName); ClearSessionAndSchedInfo(bundleName); - NoticeClientFinish(bundleName, BError(BError::Codes::EXT_ABILITY_DIED)); + OnAllBundlesFinished(BError(BError::Codes::OK)); return; } catch (const BError &e) { HILOGE("ExtConnectFailed exception, bundleName:%{public}s", bundleName.c_str());