mirror of
https://github.com/openharmony/windowmanager.git
synced 2026-07-19 17:08:11 -04:00
@@ -16,3 +16,11 @@ aafwk_inner_api_path =
|
||||
aafwk_kits_path = "//foundation/ability/ability_runtime/frameworks/kits"
|
||||
aafwk_path = "//foundation/ability/ability_runtime"
|
||||
aafwk_services_path = "//foundation/ability/ability_runtime/services"
|
||||
|
||||
declare_args() {
|
||||
suspend_manager_enable = true
|
||||
if (defined(global_parts_info) &&
|
||||
!defined(global_parts_info.resourceschedule_suspend_manager)) {
|
||||
suspend_manager_enable = false
|
||||
}
|
||||
}
|
||||
@@ -93,6 +93,12 @@ ohos_shared_library("libwm") {
|
||||
"utils_base:utils",
|
||||
]
|
||||
|
||||
defines = []
|
||||
if (suspend_manager_enable) {
|
||||
external_deps += [ "suspend_manager:suspend_manager_client" ]
|
||||
defines += [ "SUSPEND_MANAGER_ENABLE" ]
|
||||
}
|
||||
|
||||
part_name = "window_manager"
|
||||
subsystem_name = "window"
|
||||
}
|
||||
|
||||
@@ -25,6 +25,9 @@
|
||||
#include "window_manager_agent.h"
|
||||
#include "window_manager_hilog.h"
|
||||
#include "wm_common.h"
|
||||
#ifdef SUSPEND_MANAGER_ENABLE
|
||||
#include "suspend_manager_client.h"
|
||||
#endif // SUSPEND_MANAGER_ENABLE
|
||||
|
||||
namespace OHOS {
|
||||
namespace Rosen {
|
||||
@@ -476,6 +479,10 @@ void WindowManager::UpdateFocusChangeInfo(const sptr<FocusChangeInfo>& focusChan
|
||||
WLOGFI("window focus change: %{public}d, id: %{public}u", focused, focusChangeInfo->windowId_);
|
||||
std::lock_guard<std::recursive_mutex> lock(pImpl_->mutex_);
|
||||
if (focused) {
|
||||
#ifdef SUSPEND_MANAGER_ENABLE
|
||||
SuspendManager::SuspendManagerClient::GetInstance().ThawOneApplication(
|
||||
focusChangeInfo->uid_, "", SuspendManager::THAW_BY_FOCUS_CHANGED);
|
||||
#endif // SUSPEND_MANAGER_ENABLE
|
||||
pImpl_->NotifyFocused(focusChangeInfo);
|
||||
} else {
|
||||
pImpl_->NotifyUnfocused(focusChangeInfo);
|
||||
|
||||
Reference in New Issue
Block a user