!11554 修改意图调用的超时时间

Merge pull request !11554 from 张亚菲/zyfIntent
This commit is contained in:
openharmony_ci 2024-11-11 08:25:05 +00:00 committed by Gitee
commit de4ee4cb95
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 14 additions and 0 deletions

View File

@ -494,6 +494,10 @@ void AbilityRecord::PostForegroundTimeoutTask()
}
int foregroundTimeout =
AmsConfigurationParameter::GetInstance().GetAppStartTimeoutTime() * FOREGROUND_TIMEOUT_MULTIPLE;
if (InsightIntentExecuteParam::IsInsightIntentExecute(GetWant())) {
foregroundTimeout = AmsConfigurationParameter::GetInstance().GetAppStartTimeoutTime() *
INSIGHT_INTENT_TIMEOUT_MULTIPLE;
}
SendEvent(AbilityManagerService::FOREGROUND_HALF_TIMEOUT_MSG, foregroundTimeout / HALF_TIMEOUT);
SendEvent(AbilityManagerService::FOREGROUND_TIMEOUT_MSG, foregroundTimeout);
std::string methodName = "ProcessForegroundAbility";
@ -538,6 +542,10 @@ void AbilityRecord::PostUIExtensionAbilityTimeoutTask(uint32_t messageId)
case AbilityManagerService::FOREGROUND_TIMEOUT_MSG: {
uint32_t timeout = AmsConfigurationParameter::GetInstance().GetAppStartTimeoutTime() *
static_cast<uint32_t>(FOREGROUND_TIMEOUT_MULTIPLE);
if (InsightIntentExecuteParam::IsInsightIntentExecute(GetWant())) {
timeout = AmsConfigurationParameter::GetInstance().GetAppStartTimeoutTime() *
static_cast<uint32_t>(INSIGHT_INTENT_TIMEOUT_MULTIPLE);
}
SendEvent(AbilityManagerService::FOREGROUND_HALF_TIMEOUT_MSG, timeout / HALF_TIMEOUT, recordId_, true);
SendEvent(AbilityManagerService::FOREGROUND_TIMEOUT_MSG, timeout, recordId_, true);
ResSchedUtil::GetInstance().ReportLoadingEventToRss(LoadingStage::FOREGROUND_BEGIN, GetPid(), GetUid(),
@ -1255,6 +1263,10 @@ void AbilityRecord::BackgroundAbility(const Closure &task)
if (handler && task) {
int backgroundTimeout =
AmsConfigurationParameter::GetInstance().GetAppStartTimeoutTime() * BACKGROUND_TIMEOUT_MULTIPLE;
if (InsightIntentExecuteParam::IsInsightIntentExecute(GetWant())) {
backgroundTimeout = AmsConfigurationParameter::GetInstance().GetAppStartTimeoutTime() *
INSIGHT_INTENT_TIMEOUT_MULTIPLE;
}
handler->SubmitTask(task, "background_" + std::to_string(recordId_), backgroundTimeout, false);
if (abilityInfo_.type == AppExecFwk::AbilityType::PAGE) {

View File

@ -29,6 +29,7 @@ constexpr int32_t COLDSTART_TIMEOUT_MULTIPLE = 15000;
constexpr int32_t LOAD_TIMEOUT_MULTIPLE = 15000;
constexpr int32_t FOREGROUND_TIMEOUT_MULTIPLE = 7500;
constexpr int32_t BACKGROUND_TIMEOUT_MULTIPLE = 4500;
constexpr int32_t INSIGHT_INTENT_TIMEOUT_MULTIPLE = 15000;
constexpr int32_t ACTIVE_TIMEOUT_MULTIPLE = 7500;
constexpr int32_t TERMINATE_TIMEOUT_MULTIPLE = 15000;
constexpr int32_t INACTIVE_TIMEOUT_MULTIPLE = 800;
@ -39,6 +40,7 @@ constexpr int32_t COLDSTART_TIMEOUT_MULTIPLE = 10;
constexpr int32_t LOAD_TIMEOUT_MULTIPLE = 10;
constexpr int32_t FOREGROUND_TIMEOUT_MULTIPLE = 5;
constexpr int32_t BACKGROUND_TIMEOUT_MULTIPLE = 3;
constexpr int32_t INSIGHT_INTENT_TIMEOUT_MULTIPLE = 10;
constexpr int32_t ACTIVE_TIMEOUT_MULTIPLE = 5;
constexpr int32_t TERMINATE_TIMEOUT_MULTIPLE = 10;
constexpr int32_t INACTIVE_TIMEOUT_MULTIPLE = 1;