From c2d7cdfcfc2af74171bdc4854791fb5524a7737c Mon Sep 17 00:00:00 2001 From: chenliming Date: Thu, 10 Jul 2025 14:58:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8B=89=E8=B5=B7=E5=8E=9F=E5=9B=A0=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E5=90=8D=E7=A7=B0=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: chenliming --- services/abilitymgr/src/ability_connect_manager.cpp | 2 +- services/abilitymgr/src/ability_manager_service.cpp | 12 ++++++------ .../abilitymgr/src/mission/mission_list_manager.cpp | 4 ++-- .../src/scene_board/ui_ability_lifecycle_manager.cpp | 4 ++-- test/new_test/mock/want/want.h | 2 +- .../ability_manager_service_twelfth_test.cpp | 2 +- .../ui_ability_lifecycle_manager_test.cpp | 2 +- .../ui_ability_lifecycle_manager_third_test.cpp | 4 ++-- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/services/abilitymgr/src/ability_connect_manager.cpp b/services/abilitymgr/src/ability_connect_manager.cpp index 43d3c1db85f..88aa5e05973 100644 --- a/services/abilitymgr/src/ability_connect_manager.cpp +++ b/services/abilitymgr/src/ability_connect_manager.cpp @@ -195,7 +195,7 @@ int AbilityConnectManager::StartAbilityLocked(const AbilityRequest &abilityReque CHECK_POINTER_AND_RETURN(targetService, ERR_INVALID_VALUE); TAG_LOGI(AAFwkTag::SERVICE_EXT, "startAbility:%{public}s", targetService->GetURI().c_str()); - std::string value = abilityRequest.want.GetStringParam(Want::PARM_LAUNCH_REASON_MESSAGE); + std::string value = abilityRequest.want.GetStringParam(Want::PARAM_LAUNCH_REASON_MESSAGE); if (UIExtensionUtils::IsUIExtension(abilityRequest.abilityInfo.extensionAbilityType) && !value.empty()) { TAG_LOGD(AAFwkTag::ABILITYMGR, "set launchReasonMessage:%{public}s", value.c_str()); targetService->SetLaunchReasonMessage(value); diff --git a/services/abilitymgr/src/ability_manager_service.cpp b/services/abilitymgr/src/ability_manager_service.cpp index deaccc8d8f2..b2f1d154521 100644 --- a/services/abilitymgr/src/ability_manager_service.cpp +++ b/services/abilitymgr/src/ability_manager_service.cpp @@ -8188,12 +8188,12 @@ void AbilityManagerService::RemoveScreenUnlockInterceptor() void AbilityManagerService::RemoveUnauthorizedLaunchReasonMessage(const Want &want, AbilityRequest &abilityRequest, uint32_t callerTokenId) { - std::string value = want.GetStringParam(Want::PARM_LAUNCH_REASON_MESSAGE); + std::string value = want.GetStringParam(Want::PARAM_LAUNCH_REASON_MESSAGE); TAG_LOGD(AAFwkTag::ABILITYMGR, "launchReasonMessage:%{public}s", value.c_str()); if (!AppUtils::GetInstance().IsSystemReasonMessage(value)) { - TAG_LOGE(AAFwkTag::ABILITYMGR, "not in whitelist, remove"); - (const_cast(want)).RemoveParam(Want::PARM_LAUNCH_REASON_MESSAGE); - abilityRequest.want.RemoveParam(Want::PARM_LAUNCH_REASON_MESSAGE); + TAG_LOGE(AAFwkTag::ABILITYMGR, "not allow, remove"); + (const_cast(want)).RemoveParam(Want::PARAM_LAUNCH_REASON_MESSAGE); + abilityRequest.want.RemoveParam(Want::PARAM_LAUNCH_REASON_MESSAGE); return; } if (!PermissionVerification::GetInstance()->VerifyPermissionByTokenId(callerTokenId, @@ -8201,8 +8201,8 @@ void AbilityManagerService::RemoveUnauthorizedLaunchReasonMessage(const Want &wa (!PermissionVerification::GetInstance()->IsSystemAppCall() && !PermissionVerification::GetInstance()->IsSACall())) { TAG_LOGD(AAFwkTag::ABILITYMGR, "verifyPermission failed, remove launch reason message."); - (const_cast(want)).RemoveParam(Want::PARM_LAUNCH_REASON_MESSAGE); - abilityRequest.want.RemoveParam(Want::PARM_LAUNCH_REASON_MESSAGE); + (const_cast(want)).RemoveParam(Want::PARAM_LAUNCH_REASON_MESSAGE); + abilityRequest.want.RemoveParam(Want::PARAM_LAUNCH_REASON_MESSAGE); } } diff --git a/services/abilitymgr/src/mission/mission_list_manager.cpp b/services/abilitymgr/src/mission/mission_list_manager.cpp index ed299adeca0..e9bd5e1f0b1 100644 --- a/services/abilitymgr/src/mission/mission_list_manager.cpp +++ b/services/abilitymgr/src/mission/mission_list_manager.cpp @@ -3368,7 +3368,7 @@ int MissionListManager::CallAbilityLocked(const AbilityRequest &abilityRequest) } #endif // SUPPORT_UPMS - std::string value = abilityRequest.want.GetStringParam(Want::PARM_LAUNCH_REASON_MESSAGE); + std::string value = abilityRequest.want.GetStringParam(Want::PARAM_LAUNCH_REASON_MESSAGE); if (!value.empty()) { TAG_LOGD(AAFwkTag::ABILITYMGR, "set launchReasonMessage:%{public}s", value.c_str()); targetAbilityRecord->SetLaunchReasonMessage(value); @@ -4059,7 +4059,7 @@ bool MissionListManager::UpdateAbilityRecordLaunchReason( return false; } - std::string value = abilityRequest.want.GetStringParam(Want::PARM_LAUNCH_REASON_MESSAGE); + std::string value = abilityRequest.want.GetStringParam(Want::PARAM_LAUNCH_REASON_MESSAGE); if (!value.empty()) { TAG_LOGD(AAFwkTag::ABILITYMGR, "set launchReasonMessage:%{public}s", value.c_str()); abilityRecord->SetLaunchReasonMessage(value); diff --git a/services/abilitymgr/src/scene_board/ui_ability_lifecycle_manager.cpp b/services/abilitymgr/src/scene_board/ui_ability_lifecycle_manager.cpp index 606326e6ede..8e958aa5db3 100644 --- a/services/abilitymgr/src/scene_board/ui_ability_lifecycle_manager.cpp +++ b/services/abilitymgr/src/scene_board/ui_ability_lifecycle_manager.cpp @@ -1195,7 +1195,7 @@ void UIAbilityLifecycleManager::UpdateAbilityRecordLaunchReason( return; } - std::string value = abilityRequest.want.GetStringParam(Want::PARM_LAUNCH_REASON_MESSAGE); + std::string value = abilityRequest.want.GetStringParam(Want::PARAM_LAUNCH_REASON_MESSAGE); if (!value.empty()) { TAG_LOGD(AAFwkTag::ABILITYMGR, "set launchReasonMessage:%{public}s", value.c_str()); abilityRecord->SetLaunchReasonMessage(value); @@ -1372,7 +1372,7 @@ int UIAbilityLifecycleManager::CallAbilityLocked(const AbilityRequest &abilityRe } #endif // SUPPORT_UPMS - std::string value = abilityRequest.want.GetStringParam(Want::PARM_LAUNCH_REASON_MESSAGE); + std::string value = abilityRequest.want.GetStringParam(Want::PARAM_LAUNCH_REASON_MESSAGE); if (!value.empty()) { TAG_LOGD(AAFwkTag::ABILITYMGR, "set launchReasonMessage:%{public}s", value.c_str()); uiAbilityRecord->SetLaunchReasonMessage(value); diff --git a/test/new_test/mock/want/want.h b/test/new_test/mock/want/want.h index d9c233f0774..9530f9d241e 100644 --- a/test/new_test/mock/want/want.h +++ b/test/new_test/mock/want/want.h @@ -186,7 +186,7 @@ public: inline static const std::string PARAM_RESV_START_TIME = ""; inline static const std::string PARAM_ABILITY_RECOVERY_RESTART = ""; inline static const std::string PARAM_ASSERT_FAULT_SESSION_ID = ""; - inline static const std::string PARM_LAUNCH_REASON_MESSAGE = ""; + inline static const std::string PARAM_LAUNCH_REASON_MESSAGE = ""; inline static const std::string PARAM_APP_AUTO_STARTUP_LAUNCH_REASON = ""; inline static const std::string PARAM_APP_CLONE_INDEX_KEY = ""; inline static const std::string APP_INSTANCE_KEY = ""; diff --git a/test/unittest/ability_manager_service_twelfth_test/ability_manager_service_twelfth_test.cpp b/test/unittest/ability_manager_service_twelfth_test/ability_manager_service_twelfth_test.cpp index 4cca6a082fc..cbe19f2b34e 100644 --- a/test/unittest/ability_manager_service_twelfth_test/ability_manager_service_twelfth_test.cpp +++ b/test/unittest/ability_manager_service_twelfth_test/ability_manager_service_twelfth_test.cpp @@ -501,7 +501,7 @@ HWTEST_F(AbilityManagerServiceTwelfthTest, GetUserScreenUnlockCallback_001, Test auto callerTokenId = IPCSkeleton::GetCallingTokenID(); abilityMs_->RemoveUnauthorizedLaunchReasonMessage(want, abilityRequest, callerTokenId); std::string testText = "AbilityManagerServiceTwelfthTest"; - want.SetParam(Want::PARM_LAUNCH_REASON_MESSAGE, testText); + want.SetParam(Want::PARAM_LAUNCH_REASON_MESSAGE, testText); abilityMs_->RemoveUnauthorizedLaunchReasonMessage(want, abilityRequest, callerTokenId); auto ret = abilityMs_->GetUserScreenUnlockCallback(); if (ret) { diff --git a/test/unittest/ui_ability_lifecycle_manager_test/ui_ability_lifecycle_manager_test.cpp b/test/unittest/ui_ability_lifecycle_manager_test/ui_ability_lifecycle_manager_test.cpp index 792100110f7..55a12711530 100644 --- a/test/unittest/ui_ability_lifecycle_manager_test/ui_ability_lifecycle_manager_test.cpp +++ b/test/unittest/ui_ability_lifecycle_manager_test/ui_ability_lifecycle_manager_test.cpp @@ -6138,7 +6138,7 @@ HWTEST_F(UIAbilityLifecycleManagerTest, UpdateAbilityRecordLaunchReason_0001, Te request.abilityInfo.isStageBasedModel = true; request.abilityInfo.type = AppExecFwk::AbilityType::PAGE; std::string launchReasonMsg = "test_launch_reason"; - request.want.SetParam(Want::PARM_LAUNCH_REASON_MESSAGE, launchReasonMsg); + request.want.SetParam(Want::PARAM_LAUNCH_REASON_MESSAGE, launchReasonMsg); auto record = AbilityRecord::CreateAbilityRecord(request); mgr->UpdateAbilityRecordLaunchReason(request, record); EXPECT_NE(record, nullptr); diff --git a/test/unittest/ui_ability_lifecycle_manager_third_test/ui_ability_lifecycle_manager_third_test.cpp b/test/unittest/ui_ability_lifecycle_manager_third_test/ui_ability_lifecycle_manager_third_test.cpp index 2e098b2007c..689d717ec72 100644 --- a/test/unittest/ui_ability_lifecycle_manager_third_test/ui_ability_lifecycle_manager_third_test.cpp +++ b/test/unittest/ui_ability_lifecycle_manager_third_test/ui_ability_lifecycle_manager_third_test.cpp @@ -538,7 +538,7 @@ HWTEST_F(UIAbilityLifecycleManagerThirdTest, UpdateAbilityRecordLaunchReason_005 EXPECT_NE(mgr, nullptr); AbilityRequest abilityRequest; - abilityRequest.want.SetParam(Want::PARM_LAUNCH_REASON_MESSAGE, std::string("HeavenlyMe")); + abilityRequest.want.SetParam(Want::PARAM_LAUNCH_REASON_MESSAGE, std::string("HeavenlyMe")); auto abilityRecord = std::make_shared( abilityRequest.want, abilityRequest.abilityInfo, abilityRequest.appInfo, abilityRequest.requestCode); abilityRecord->lifeCycleStateInfo_.launchParam.launchReasonMessage = "HelloWorld"; @@ -561,7 +561,7 @@ HWTEST_F(UIAbilityLifecycleManagerThirdTest, UpdateAbilityRecordLaunchReason_006 want.SetParam(Want::PARAM_ABILITY_RECOVERY_RESTART, true); AbilityRequest abilityRequest; - abilityRequest.want.SetParam(Want::PARM_LAUNCH_REASON_MESSAGE, std::string("")); + abilityRequest.want.SetParam(Want::PARAM_LAUNCH_REASON_MESSAGE, std::string("")); auto abilityRecord = std::make_shared( abilityRequest.want, abilityRequest.abilityInfo, abilityRequest.appInfo, abilityRequest.requestCode); abilityRecord->lifeCycleStateInfo_.launchParam.launchReasonMessage = "HelloWorld"; -- Gitee