From 3819d15cfbf6a59c899f65a2c23e1de41e49990e Mon Sep 17 00:00:00 2001 From: huaqingsimeng Date: Thu, 26 Oct 2023 16:13:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=87=E4=BB=BD=E6=81=A2=E5=A4=8D=E5=9C=BA?= =?UTF-8?q?=E6=99=AF=E4=B8=AD=E6=9C=8D=E5=8A=A1=E5=87=BA=E7=8E=B029189?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=E5=9C=BA=E6=99=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: huaqingsimeng --- frameworks/native/backup_kit_inner/src/b_session_backup.cpp | 1 + frameworks/native/backup_kit_inner/src/b_session_restore.cpp | 1 + .../native/backup_kit_inner/src/b_session_restore_async.cpp | 1 + interfaces/kits/js/backup/local_capabilities.cpp | 1 + services/backup_sa/src/module_ipc/service.cpp | 1 + 5 files changed, 5 insertions(+) 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 e3b4d3e93..e89285aba 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 f6d917f3c..59a6d67e4 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 19ba21e78..c25212f5d 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 9c8ea23e6..d3b9e9eb3 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 30ec68790..116dd7707 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()); -- Gitee