diff --git a/services/abilitymgr/src/ability_connect_manager.cpp b/services/abilitymgr/src/ability_connect_manager.cpp index 43d3c1db85f150b28da6e80b1fafae12efc501fe..88aa5e05973456b5d34089f39153ad33038ed95a 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 deaccc8d8f22aa992b69f4ced0f170dc3ac2f341..b2f1d154521fa5be21ee74ad3c12e6f5e1d91e17 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 ed299adeca0956473cf0c45f29c1ef686ca967e9..e9bd5e1f0b18ccb37d81a2ce2339cca4cf72e689 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 606326e6edeee5d9814f46b617a7cdfd4519dcb4..8e958aa5db3af1f3d7b6a1fb728258691816a200 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 d9c233f0774de19e27f8ef3fe8dfdf53f572ffa6..9530f9d241ecbec67b09293ed9fba87d357579d4 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 4cca6a082fcb3fff1dc7d3ade67edd9550b5ad8a..cbe19f2b34edd01dba28084a9f895a674331b520 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 792100110f747732c2c1ec466d7e79647ee19228..55a127115303be9699effbaba58948ba1946e7b3 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 2e098b2007ce16f8ac3f3336087585844278ee36..689d717ec72493d4e9d29b72322e49e8b24335fa 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";