diff --git a/service/key_command/src/key_command_handler.cpp b/service/key_command/src/key_command_handler.cpp index 1d1c59ca8dc15200e81d778a163487e5c84eecd5..188689cf124c3a4877b386f7636ae428c554a9e3 100644 --- a/service/key_command/src/key_command_handler.cpp +++ b/service/key_command/src/key_command_handler.cpp @@ -2507,6 +2507,7 @@ void KeyCommandHandler::LaunchAbility(const Ability &ability, int64_t delay) DfxHisysevent::ReportApiCallTimes(ApiDurationStatistics::Api::ABILITY_MGR_CLIENT_START_ABILITY, durationMS); #endif // OHOS_BUILD_ENABLE_DFX_RADAR if (err != ERR_OK) { + specialKeys_.clear(); MMI_HILOGE("LaunchAbility failed, bundleName:%{public}s, err:%{public}d", ability.bundleName.c_str(), err); return; } @@ -2520,6 +2521,7 @@ void KeyCommandHandler::LaunchAbility(const Ability &ability, int64_t delay) napData.uid = -1; napData.bundleName = ability.bundleName; int32_t syncState = ACTIVE_EVENT; + specialKeys_.clear(); NapProcess::GetInstance()->AddMmiSubscribedEventData(napData, syncState); NapProcess::GetInstance()->NotifyBundleName(napData, syncState); MMI_HILOGW("End launch ability, bundleName:%{public}s", ability.bundleName.c_str()); @@ -2586,6 +2588,7 @@ void KeyCommandHandler::LaunchAbility(const Ability &ability) } } } + specialKeys_.clear(); MMI_HILOGW("End launch ability, bundleName:%{public}s", ability.bundleName.c_str()); }