From 8d58cf3d21d16a703d50175ab121f873b8271c66 Mon Sep 17 00:00:00 2001 From: savior-xzh Date: Fri, 25 Oct 2024 12:43:31 +0800 Subject: [PATCH] add log Signed-off-by: savior-xzh Change-Id: I4b4d5745514bc73871417c1959e8cc63fc121a15 --- .../ability/native/ability_runtime/js_ui_ability.cpp | 10 +++++++--- services/abilitymgr/src/ability_record.cpp | 5 +++-- services/abilitymgr/src/sub_managers_helper.cpp | 2 +- services/appmgr/src/app_mgr_service_inner.cpp | 2 +- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/frameworks/native/ability/native/ability_runtime/js_ui_ability.cpp b/frameworks/native/ability/native/ability_runtime/js_ui_ability.cpp index 33dfabf5c4..3cdf31b5eb 100644 --- a/frameworks/native/ability/native/ability_runtime/js_ui_ability.cpp +++ b/frameworks/native/ability/native/ability_runtime/js_ui_ability.cpp @@ -842,7 +842,7 @@ void JsUIAbility::DoOnForegroundForSceneIsNull(const Want &want) displayId = strtol(strDisplayId.c_str(), nullptr, BASE_DISPLAY_ID_NUM); TAG_LOGD(AAFwkTag::UIABILITY, "displayId: %{public}d", displayId); } else { - TAG_LOGE(AAFwkTag::UIABILITY, "formatRegex: [%{public}s] failed", strDisplayId.c_str()); + TAG_LOGW(AAFwkTag::UIABILITY, "formatRegex: [%{public}s] failed", strDisplayId.c_str()); } } auto option = GetWindowOption(want); @@ -899,8 +899,12 @@ void JsUIAbility::RequestFocus(const Want &want) void JsUIAbility::ContinuationRestore(const Want &want) { TAG_LOGD(AAFwkTag::UIABILITY, "called"); - if (!IsRestoredInContinuation() || scene_ == nullptr) { - TAG_LOGE(AAFwkTag::UIABILITY, "is not in continuation or null scene_"); + if (!IsRestoredInContinuation()) { + TAG_LOGW(AAFwkTag::UIABILITY, "not in continuation"); + return; + } + if (scene_ == nullptr) { + TAG_LOGE(AAFwkTag::UIABILITY, "null scene_"); return; } RestorePageStack(want); diff --git a/services/abilitymgr/src/ability_record.cpp b/services/abilitymgr/src/ability_record.cpp index e837c5bc6e..333cda9c0b 100644 --- a/services/abilitymgr/src/ability_record.cpp +++ b/services/abilitymgr/src/ability_record.cpp @@ -1421,8 +1421,9 @@ void AbilityRecord::SetAbilityStateInner(AbilityState state) } auto missionListWrap = DelayedSingleton::GetInstance()->GetMissionListWrap(); - CHECK_POINTER(missionListWrap); - missionListWrap->SetMissionAbilityState(missionId_, currentState_); + if (missionListWrap != nullptr) { + missionListWrap->SetMissionAbilityState(missionId_, currentState_); + } } #endif // SUPPORT_SCREEN bool AbilityRecord::GetAbilityForegroundingFlag() const diff --git a/services/abilitymgr/src/sub_managers_helper.cpp b/services/abilitymgr/src/sub_managers_helper.cpp index a1c6241ed9..8863444d69 100644 --- a/services/abilitymgr/src/sub_managers_helper.cpp +++ b/services/abilitymgr/src/sub_managers_helper.cpp @@ -474,7 +474,7 @@ bool SubManagersHelper::VerificationAllToken(const sptr &token) return true; } } - TAG_LOGE(AAFwkTag::ABILITYMGR, "fail"); + TAG_LOGE(AAFwkTag::ABILITYMGR, "VerificationAllToken fail"); return false; } diff --git a/services/appmgr/src/app_mgr_service_inner.cpp b/services/appmgr/src/app_mgr_service_inner.cpp index 5c57ddaccf..455fed873d 100644 --- a/services/appmgr/src/app_mgr_service_inner.cpp +++ b/services/appmgr/src/app_mgr_service_inner.cpp @@ -1024,7 +1024,7 @@ void AppMgrServiceInner::AttachApplication(const pid_t pid, const sptr appDeathRecipient = new (std::nothrow) AppDeathRecipient(); + sptr appDeathRecipient = sptr::MakeSptr(); CHECK_POINTER_AND_RETURN_LOG(appDeathRecipient, "Failed to create death recipient."); appDeathRecipient->SetTaskHandler(taskHandler_); appDeathRecipient->SetAppMgrServiceInner(shared_from_this());