diff --git a/frameworks/native/backup_kit_inner/src/b_session_backup.cpp b/frameworks/native/backup_kit_inner/src/b_session_backup.cpp index e3b4d3e93a9f77948fd1ec22e835fb03eec3af43..e89285aba1cdea2b62a31c3813279bf8500a3709 100644 --- a/frameworks/native/backup_kit_inner/src/b_session_backup.cpp +++ b/frameworks/native/backup_kit_inner/src/b_session_backup.cpp @@ -44,6 +44,7 @@ unique_ptr BSessionBackup::Init(Callbacks callbacks) { try { auto backup = make_unique(); + ServiceProxy::InvaildInstance(); auto proxy = ServiceProxy::GetInstance(); if (proxy == nullptr) { HILOGI("Failed to get backup service"); diff --git a/frameworks/native/backup_kit_inner/src/b_session_restore.cpp b/frameworks/native/backup_kit_inner/src/b_session_restore.cpp index f6d917f3caba3a3b16a0615ba9a074006203a172..59a6d67e47a1a621c71357fd77045076943d3d74 100644 --- a/frameworks/native/backup_kit_inner/src/b_session_restore.cpp +++ b/frameworks/native/backup_kit_inner/src/b_session_restore.cpp @@ -44,6 +44,7 @@ unique_ptr BSessionRestore::Init(Callbacks callbacks) { try { auto restore = make_unique(); + ServiceProxy::InvaildInstance(); auto proxy = ServiceProxy::GetInstance(); if (proxy == nullptr) { HILOGI("Failed to get backup service"); diff --git a/frameworks/native/backup_kit_inner/src/b_session_restore_async.cpp b/frameworks/native/backup_kit_inner/src/b_session_restore_async.cpp index 19ba21e7835e7ca9da6b3b84daa22804cba717bd..c25212f5d2189f34823469e5804f00e1bcdd77c9 100644 --- a/frameworks/native/backup_kit_inner/src/b_session_restore_async.cpp +++ b/frameworks/native/backup_kit_inner/src/b_session_restore_async.cpp @@ -139,6 +139,7 @@ void BSessionRestoreAsync::PopBundleInfo() void BSessionRestoreAsync::AppendBundlesImpl(AppendBundleInfo info) { HILOGD("Start"); + ServiceProxy::InvaildInstance(); auto proxy = ServiceProxy::GetInstance(); if (proxy == nullptr) { return OnBundleStarted(BError(BError::Codes::SDK_BROKEN_IPC, "Failed to get backup service").GetCode(), diff --git a/interfaces/kits/js/backup/local_capabilities.cpp b/interfaces/kits/js/backup/local_capabilities.cpp index 9c8ea23e693f730e3b9851f5ed0f70e0bd2bfec4..d3b9e9eb3b5de4c610dcbfc1d6ac5b7e8fa4fdc2 100644 --- a/interfaces/kits/js/backup/local_capabilities.cpp +++ b/interfaces/kits/js/backup/local_capabilities.cpp @@ -35,6 +35,7 @@ napi_value LocalCapabilities::Async(napi_env env, napi_callback_info info) auto fd = make_shared(); auto cbExec = [fd]() -> NError { HILOGI("called LocalCapabilities::Async cbExec"); + ServiceProxy::InvaildInstance(); auto proxy = ServiceProxy::GetInstance(); if (!proxy) { HILOGI("called LocalCapabilities::Async cbExec, failed to get proxy"); diff --git a/services/backup_sa/src/module_ipc/service.cpp b/services/backup_sa/src/module_ipc/service.cpp index 30ec6879063b8c1291e4fec5eafeee94c575c7a4..116dd770756c445c364327b521da047212fb73e4 100644 --- a/services/backup_sa/src/module_ipc/service.cpp +++ b/services/backup_sa/src/module_ipc/service.cpp @@ -116,6 +116,7 @@ UniqueFd Service::GetLocalCapabilities() return move(cachedEntity.GetFd()); } catch (const BError &e) { + HILOGE("GetLocalCapabilities failed, errCode = %{public}d", e.GetCode()); return UniqueFd(-e.GetCode()); } catch (const exception &e) { HILOGI("Catched an unexpected low-level exception %{public}s", e.what());