插入解冻桩点

Signed-off-by: houdisheng <houdisheng@huawei.com>
This commit is contained in:
houdisheng 2022-07-08 16:40:40 +08:00
parent 8cf074c0e1
commit 78059c42bc
4 changed files with 35 additions and 0 deletions

View File

@ -51,6 +51,7 @@ declare_args() {
ability_runtime_ces = true
ability_runtime_resource = true
ability_runtime_appspawn = true
suspend_manager = true
if (!defined(global_parts_info) ||
defined(global_parts_info.account_os_account)) {
@ -64,6 +65,11 @@ declare_args() {
background_task_mgr_continuous_task_enable = false
}
if (defined(global_parts_info) &&
!defined(global_parts_info.resourceschedule_suspend_manager)) {
suspend_manager = false
}
if (defined(global_parts_info) &&
!defined(global_parts_info.distributeddatamgr_distributeddataobject)) {
distributed_data_object_enable = false

View File

@ -71,6 +71,9 @@ config("abilityms_config") {
defines += [ "BGTASKMGR_CONTINUOUS_TASK_ENABLE" ]
}
if (suspend_manager) {
defines += [ "SUSPEND_MANAGER_ENABLE" ]
}
cflags = []
if (target_cpu == "arm") {
cflags += [ "-DBINDER_IPC_32BIT" ]
@ -129,6 +132,10 @@ ohos_shared_library("abilityms") {
external_deps += [ "background_task_mgr:bgtaskmgr_innerkits" ]
}
if (suspend_manager) {
external_deps += [ "suspend_manager:suspend_manager_client" ]
}
if (ability_runtime_graphics) {
deps += [
"${ace_engine_path}/interfaces/inner_api/ui_service_manager:ui_service_mgr",

View File

@ -66,6 +66,10 @@
#include "ui_service_mgr_client.h"
#endif
#ifdef SUSPEND_MANAGER_ENABLE
#include "suspend_manager_client.h"
#endif // SUSPEND_MANAGER_ENABLE
using OHOS::AppExecFwk::ElementName;
using OHOS::Security::AccessToken::AccessTokenKit;
@ -475,6 +479,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
auto bms = AbilityUtil::GetBundleManager();
if (bms) {
SuspendManager::SuspendManagerClient::GetInstance().ThawOneApplication(
bms->GetUidByBundleName(abilityInfo.bundleName, validUserId),
abilityInfo.bundleName, "THAW_BY_START_ABILITY");
}
#endif // SUSPEND_MANAGER_ENABLE
HILOG_DEBUG("Start ability, name is %{public}s.", abilityInfo.name.c_str());
return missionListManager->StartAbility(abilityRequest);
}

View File

@ -37,6 +37,10 @@
#include "locale_config.h"
#include "mission_info_mgr.h"
#endif
#ifdef SUSPEND_MANAGER_ENABLE
#include "suspend_manager_client.h"
#endif // SUSPEND_MANAGER_ENABLE
namespace OHOS {
namespace AAFwk {
@ -265,6 +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
std::string bundleName = GetAbilityInfo().bundleName;
int32_t uid = GetUid();
SuspendManager::SuspendManagerClient::GetInstance().ThawOneApplication(
uid, bundleName, "THAW_BY_FOREGROUND_ABILITY");
#endif // SUSPEND_MANAGER_ENABLE
DelayedSingleton<AppScheduler>::GetInstance()->MoveToForeground(token_);
} else {
HILOG_DEBUG("Activate %{public}s", element.c_str());