!2732 【全局资源调度】添加解冻桩点

Merge pull request !2732 from 廖康康/master
This commit is contained in:
openharmony_ci 2022-08-23 07:49:34 +00:00 committed by Gitee
commit 39eaab1295
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 18 additions and 17 deletions

View File

@ -1018,6 +1018,8 @@ private:
void ReportAbilitStartInfoToRSS(const AppExecFwk::AbilityInfo &abilityInfo);
void ReportEventToSuspendManager(const AppExecFwk::AbilityInfo &abilityInfo);
int CheckCrowdtestForeground(const Want &want, int requestCode, int32_t userId);
int StartAppgallery(int requestCode, int32_t userId, std::string action);

View File

@ -474,14 +474,7 @@ int AbilityManagerService::StartAbilityInner(const Want &want, const sptr<IRemot
return ERR_INVALID_VALUE;
}
HILOG_DEBUG("Start service or extension, name is %{public}s.", abilityInfo.name.c_str());
#ifdef EFFICIENCY_MANAGER_ENABLE
auto bms = AbilityUtil::GetBundleManager();
if (bms) {
SuspendManager::SuspendManagerClient::GetInstance().ThawOneApplication(
bms->GetUidByBundleName(abilityInfo.bundleName, validUserId),
abilityInfo.bundleName, "THAW_BY_START_NOT_PAGE_ABILITY");
}
#endif // EFFICIENCY_MANAGER_ENABLE
ReportEventToSuspendManager(abilityInfo);
return connectManager->StartAbility(abilityRequest);
}
@ -495,14 +488,7 @@ int AbilityManagerService::StartAbilityInner(const Want &want, const sptr<IRemot
return ERR_INVALID_VALUE;
}
ReportAbilitStartInfoToRSS(abilityInfo);
#ifdef EFFICIENCY_MANAGER_ENABLE
auto bms = AbilityUtil::GetBundleManager();
if (bms) {
SuspendManager::SuspendManagerClient::GetInstance().ThawOneApplication(
bms->GetUidByBundleName(abilityInfo.bundleName, validUserId),
abilityInfo.bundleName, "THAW_BY_START_PAGE_ABILITY");
}
#endif // EFFICIENCY_MANAGER_ENABLE
ReportEventToSuspendManager(abilityInfo);
HILOG_DEBUG("Start ability, name is %{public}s.", abilityInfo.name.c_str());
return missionListManager->StartAbility(abilityRequest);
}
@ -903,6 +889,17 @@ void AbilityManagerService::ReportAbilitStartInfoToRSS(const AppExecFwk::Ability
#endif
}
void AbilityManagerService::ReportEventToSuspendManager(const AppExecFwk::AbilityInfo &abilityInfo)
{
#ifdef EFFICIENCY_MANAGER_ENABLE
std::string reason = (abilityInfo.type == AppExecFwk::AbilityType::PAGE) ?
"THAW_BY_START_PAGE_ABILITY" : "THAW_BY_START_NOT_PAGE_ABILITY";
SuspendManager::SuspendManagerClient::GetInstance().ThawOneApplication(
abilityInfo.applicationInfo.uid,
abilityInfo.applicationInfo.bundleName, reason);
#endif // EFFICIENCY_MANAGER_ENABLE
}
int AbilityManagerService::StartExtensionAbility(const Want &want, const sptr<IRemoteObject> &callerToken,
int32_t userId, AppExecFwk::ExtensionAbilityType extensionType)
{
@ -1588,6 +1585,8 @@ int AbilityManagerService::ConnectLocalAbility(const Want &want, const int32_t u
HILOG_ERROR("connectManager is nullptr. userId=%{public}d", validUserId);
return ERR_INVALID_VALUE;
}
ReportEventToSuspendManager(abilityInfo);
return connectManager->ConnectAbilityLocked(abilityRequest, connect, callerToken);
}
@ -3761,7 +3760,7 @@ int AbilityManagerService::StartAbilityByCall(
HILOG_ERROR("currentMissionListManager_ is Null. curentUserId=%{public}d", GetUserId());
return ERR_INVALID_VALUE;
}
ReportEventToSuspendManager(abilityRequest.abilityInfo);
return currentMissionListManager_->ResolveLocked(abilityRequest);
}