冻结桩点

Signed-off-by: houdisheng <houdisheng@huawei.com>
This commit is contained in:
houdisheng 2022-07-22 09:46:17 +08:00
parent 578b190035
commit b3034bc9f4
11 changed files with 52 additions and 17 deletions

View File

@ -51,7 +51,7 @@ declare_args() {
ability_runtime_ces = true
ability_runtime_resource = true
ability_runtime_appspawn = true
suspend_manager = true
efficiency_manager = true
if (!defined(global_parts_info) ||
defined(global_parts_info.account_os_account)) {
@ -66,8 +66,8 @@ declare_args() {
}
if (defined(global_parts_info) &&
!defined(global_parts_info.resourceschedule_suspend_manager)) {
suspend_manager = false
!defined(global_parts_info.resourceschedule_efficiency_manager)) {
efficiency_manager = false
}
if (defined(global_parts_info) &&

View File

@ -71,8 +71,8 @@ config("abilityms_config") {
defines += [ "BGTASKMGR_CONTINUOUS_TASK_ENABLE" ]
}
if (suspend_manager) {
defines += [ "SUSPEND_MANAGER_ENABLE" ]
if (efficiency_manager) {
defines += [ "EFFICIENCY_MANAGER_ENABLE" ]
}
cflags = []
if (target_cpu == "arm") {
@ -132,8 +132,8 @@ ohos_shared_library("abilityms") {
external_deps += [ "background_task_mgr:bgtaskmgr_innerkits" ]
}
if (suspend_manager) {
external_deps += [ "suspend_manager:suspend_manager_client" ]
if (efficiency_manager) {
external_deps += [ "efficiency_manager:suspend_manager_client" ]
}
if (ability_runtime_graphics) {

View File

@ -66,9 +66,9 @@
#include "ui_service_mgr_client.h"
#endif
#ifdef SUSPEND_MANAGER_ENABLE
#ifdef EFFICIENCY_MANAGER_ENABLE
#include "suspend_manager_client.h"
#endif // SUSPEND_MANAGER_ENABLE
#endif // EFFICIENCY_MANAGER_ENABLE
using OHOS::AppExecFwk::ElementName;
using OHOS::Security::AccessToken::AccessTokenKit;
@ -468,14 +468,14 @@ 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 SUSPEND_MANAGER_ENABLE
#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 // SUSPEND_MANAGER_ENABLE
#endif // EFFICIENCY_MANAGER_ENABLE
return connectManager->StartAbility(abilityRequest);
}
@ -488,14 +488,14 @@ int AbilityManagerService::StartAbilityInner(const Want &want, const sptr<IRemot
HILOG_ERROR("missionListManager is nullptr. userId=%{public}d", validUserId);
return ERR_INVALID_VALUE;
}
#ifdef SUSPEND_MANAGER_ENABLE
#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 // SUSPEND_MANAGER_ENABLE
#endif // EFFICIENCY_MANAGER_ENABLE
HILOG_DEBUG("Start ability, name is %{public}s.", abilityInfo.name.c_str());
return missionListManager->StartAbility(abilityRequest);
}

View File

@ -37,9 +37,9 @@
#include "locale_config.h"
#include "mission_info_mgr.h"
#endif
#ifdef SUSPEND_MANAGER_ENABLE
#ifdef EFFICIENCY_MANAGER_ENABLE
#include "suspend_manager_client.h"
#endif // SUSPEND_MANAGER_ENABLE
#endif // EFFICIENCY_MANAGER_ENABLE
namespace OHOS {
@ -269,12 +269,12 @@ void AbilityRecord::ProcessForegroundAbility(uint32_t sceneFlag)
// background to active state
HILOG_DEBUG("MoveToForeground, %{public}s", element.c_str());
lifeCycleStateInfo_.sceneFlagBak = sceneFlag;
#ifdef SUSPEND_MANAGER_ENABLE
#ifdef EFFICIENCY_MANAGER_ENABLE
std::string bundleName = GetAbilityInfo().bundleName;
int32_t uid = GetUid();
SuspendManager::SuspendManagerClient::GetInstance().ThawOneApplication(
uid, bundleName, "THAW_BY_FOREGROUND_ABILITY");
#endif // SUSPEND_MANAGER_ENABLE
#endif // EFFICIENCY_MANAGER_ENABLE
DelayedSingleton<AppScheduler>::GetInstance()->MoveToForeground(token_);
} else {
HILOG_DEBUG("Activate %{public}s", element.c_str());

View File

@ -89,6 +89,11 @@ ohos_moduletest("AbilityRecordModuleTest") {
deps += [ "//base/account/os_account/frameworks/osaccount/native:os_account_innerkits" ]
}
if (efficiency_manager) {
cflags_cc += [ "-DEFFICIENCY_MANAGER_ENABLE" ]
deps += [ "//foundation/resourceschedule/efficiency_manager/interfaces/innerkits/suspend_manager:suspend_manager_client" ]
}
if (ability_runtime_graphics) {
deps += [
"${ace_engine_path}/interfaces/inner_api/ui_service_manager:ui_service_mgr",

View File

@ -90,6 +90,11 @@ ohos_moduletest("ability_timeout_module_test") {
deps += [ "//base/account/os_account/frameworks/osaccount/native:os_account_innerkits" ]
}
if (efficiency_manager) {
cflags_cc += [ "-DEFFICIENCY_MANAGER_ENABLE" ]
deps += [ "//foundation/resourceschedule/efficiency_manager/interfaces/innerkits/suspend_manager:suspend_manager_client" ]
}
if (ability_runtime_graphics) {
deps += [
"${ace_engine_path}/interfaces/inner_api/ui_service_manager:ui_service_mgr",

View File

@ -67,6 +67,11 @@ ohos_moduletest("specified_ability_service_test") {
deps += [ "//base/account/os_account/frameworks/osaccount/native:os_account_innerkits" ]
}
if (efficiency_manager) {
cflags_cc += [ "-DEFFICIENCY_MANAGER_ENABLE" ]
deps += [ "//foundation/resourceschedule/efficiency_manager/interfaces/innerkits/suspend_manager:suspend_manager_client" ]
}
if (ability_runtime_graphics) {
deps += [
"${ace_engine_path}/interfaces/inner_api/ui_service_manager:ui_service_mgr",

View File

@ -65,6 +65,11 @@ ohos_moduletest("on_new_want_module_test") {
deps += [ "//base/account/os_account/frameworks/osaccount/native:os_account_innerkits" ]
}
if (efficiency_manager) {
cflags_cc += [ "-DEFFICIENCY_MANAGER_ENABLE" ]
deps += [ "//foundation/resourceschedule/efficiency_manager/interfaces/innerkits/suspend_manager:suspend_manager_client" ]
}
if (ability_runtime_graphics) {
deps += [
"${ace_engine_path}/interfaces/inner_api/ui_service_manager:ui_service_mgr",

View File

@ -89,6 +89,11 @@ ohos_moduletest("running_infos_module_test") {
deps += [ "//base/account/os_account/frameworks/osaccount/native:os_account_innerkits" ]
}
if (efficiency_manager) {
cflags_cc += [ "-DEFFICIENCY_MANAGER_ENABLE" ]
deps += [ "//foundation/resourceschedule/efficiency_manager/interfaces/innerkits/suspend_manager:suspend_manager_client" ]
}
if (ability_runtime_graphics) {
deps += [
"${ace_engine_path}/interfaces/inner_api/ui_service_manager:ui_service_mgr",

View File

@ -94,6 +94,11 @@ ohos_moduletest("start_ability_implicit_module_test") {
deps += [ "//base/account/os_account/frameworks/osaccount/native:os_account_innerkits" ]
}
if (efficiency_manager) {
cflags_cc += [ "-DEFFICIENCY_MANAGER_ENABLE" ]
deps += [ "//foundation/resourceschedule/efficiency_manager/interfaces/innerkits/suspend_manager:suspend_manager_client" ]
}
if (ability_runtime_graphics) {
deps += [
"${global_path}/i18n/frameworks/intl:intl_util",

View File

@ -175,6 +175,11 @@ ohos_source_set("abilityms_test_source") {
deps += [ "//base/account/os_account/frameworks/osaccount/native:os_account_innerkits" ]
}
if (efficiency_manager) {
cflags_cc += [ "-DEFFICIENCY_MANAGER_ENABLE" ]
deps += [ "//foundation/resourceschedule/efficiency_manager/interfaces/innerkits/suspend_manager:suspend_manager_client" ]
}
external_deps = [
"ability_base:configuration",
"ability_base:want",