mirror of
https://github.com/openharmony/windowmanager.git
synced 2026-07-19 17:08:11 -04:00
windowscene前后台切换增加入参
Signed-off-by: chenqinxin <chenqinxin1@huawei.com> Change-Id: If2ac37772fd8a826072159d813538ef1db456afc
This commit is contained in:
@@ -68,8 +68,8 @@ DisplayState DisplayPowerController::GetDisplayState(DisplayId displayId)
|
||||
|
||||
void DisplayPowerController::NotifyDisplayEvent(DisplayEvent event)
|
||||
{
|
||||
WLOGFI("DisplayEvent:%{public}u", event);
|
||||
if (event == DisplayEvent::UNLOCK) {
|
||||
WLOGFI("DisplayEvent UNLOCK");
|
||||
DisplayManagerService::GetInstance().NotifyDisplayStateChange(DisplayStateChangeType::BEFORE_UNLOCK);
|
||||
DisplayManagerAgentController::GetInstance().NotifyDisplayPowerEvent(DisplayPowerEvent::DESKTOP_READY,
|
||||
EventStatus::BEGIN);
|
||||
|
||||
@@ -43,8 +43,8 @@ public:
|
||||
|
||||
const sptr<Window>& GetMainWindow() const;
|
||||
|
||||
WMError GoForeground();
|
||||
WMError GoBackground() const;
|
||||
WMError GoForeground(uint32_t reason = 0);
|
||||
WMError GoBackground(uint32_t reason = 0);
|
||||
|
||||
WMError RequestFocus() const;
|
||||
void UpdateConfiguration(const std::shared_ptr<AppExecFwk::Configuration>& configuration);
|
||||
|
||||
@@ -32,6 +32,7 @@ enum class WindowState : uint32_t {
|
||||
};
|
||||
|
||||
enum class WindowStateChangeReason : uint32_t {
|
||||
NORMAL,
|
||||
KEYGUARD,
|
||||
};
|
||||
}
|
||||
|
||||
+28
-4
@@ -83,20 +83,44 @@ const sptr<Window>& WindowScene::GetMainWindow() const
|
||||
return mainWindow_;
|
||||
}
|
||||
|
||||
WMError WindowScene::GoForeground()
|
||||
WMError WindowScene::GoForeground(uint32_t reason)
|
||||
{
|
||||
WLOGFI("GoForeground reason:%{public}u", reason);
|
||||
if (mainWindow_ == nullptr) {
|
||||
return WMError::WM_ERROR_NULLPTR;
|
||||
}
|
||||
return mainWindow_->Show();
|
||||
auto changeReason = static_cast<WindowStateChangeReason>(reason);
|
||||
switch (changeReason) {
|
||||
case WindowStateChangeReason::NORMAL: {
|
||||
return mainWindow_->Show();
|
||||
}
|
||||
case WindowStateChangeReason::KEYGUARD: {
|
||||
return WMError::WM_OK;
|
||||
}
|
||||
default: {
|
||||
return WMError::WM_ERROR_INVALID_PARAM;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
WMError WindowScene::GoBackground() const
|
||||
WMError WindowScene::GoBackground(uint32_t reason)
|
||||
{
|
||||
WLOGFI("GoBackground reason:%{public}u", reason);
|
||||
if (mainWindow_ == nullptr) {
|
||||
return WMError::WM_ERROR_NULLPTR;
|
||||
}
|
||||
return mainWindow_->Hide();
|
||||
auto changeReason = static_cast<WindowStateChangeReason>(reason);
|
||||
switch (changeReason) {
|
||||
case WindowStateChangeReason::NORMAL: {
|
||||
return mainWindow_->Hide();
|
||||
}
|
||||
case WindowStateChangeReason::KEYGUARD: {
|
||||
return WMError::WM_OK;
|
||||
}
|
||||
default: {
|
||||
return WMError::WM_ERROR_INVALID_PARAM;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
WMError WindowScene::SetSystemBarProperty(WindowType type, const SystemBarProperty& property) const
|
||||
|
||||
Reference in New Issue
Block a user