1 /*
2 * Copyright (c) 2022-2024 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16 #include "window_impl.h"
17
18 #include "dm_common.h"
19 #include "window_manager_hilog.h"
20 #include "window_helper.h"
21 #include "window_option.h"
22 #include "viewport_config.h"
23 #include "singleton_container.h"
24
25 namespace OHOS {
26 namespace Rosen {
27 namespace {
28 constexpr HiviewDFX::HiLogLabel LABEL = {LOG_CORE, HILOG_DOMAIN_WINDOW, "WindowImpl"};
29 }
30 std::map<std::string, std::pair<uint32_t, sptr<Window>>> WindowImpl::windowMap_;
31 std::map<uint32_t, std::vector<sptr<WindowImpl>>> WindowImpl::subWindowMap_;
32 std::map<uint32_t, std::vector<sptr<IWindowSystemBarEnableListener>>> WindowImpl::systemBarEnableListeners_;
33 std::map<uint32_t, std::vector<sptr<IIgnoreViewSafeAreaListener>>> WindowImpl::ignoreSafeAreaListeners_;
34 std::map<uint32_t, std::vector<sptr<IAvoidAreaChangedListener>>> WindowImpl::avoidAreaChangeListeners_;
35 std::mutex WindowImpl::globalMutex_;
36 static int constructorCnt = 0;
37 static int deConstructorCnt = 0;
WindowImpl(const sptr<WindowOption> & option)38 WindowImpl::WindowImpl(const sptr<WindowOption>& option)
39 {
40 if (option != nullptr) {
41 name_ = option->GetWindowName();
42 } else {
43 name_ = "main_window";
44 }
45 WLOGFI("WindowImpl constructorCnt: %{public}d",
46 ++constructorCnt);
47 }
48
~WindowImpl()49 WindowImpl::~WindowImpl()
50 {
51 WLOGFI("windowName: %{public}s, windowId: %{public}d, deConstructorCnt: %{public}d",
52 GetWindowName().c_str(), GetWindowId(), ++deConstructorCnt);
53 Destroy();
54 }
55
CreateSurfaceNode(const std::string name,const SendRenderDataCallback & callback)56 void WindowImpl::CreateSurfaceNode(const std::string name, const SendRenderDataCallback& callback)
57 {
58 WLOGFI("CreateSurfaceNode");
59 struct RSSurfaceNodeConfig rsSurfaceNodeConfig;
60 rsSurfaceNodeConfig.SurfaceNodeName = name;
61 rsSurfaceNodeConfig.additionalData = reinterpret_cast<void*>(callback);
62 surfaceNode_ = RSSurfaceNode::Create(rsSurfaceNodeConfig);
63 if (surfaceNode_ != nullptr) {
64 vsyncStation_ = std::make_shared<VsyncStation>(surfaceNode_->GetId());
65 }
66 }
67
SetContentInfoCallback(const ContentInfoCallback & callback)68 void WindowImpl::SetContentInfoCallback(const ContentInfoCallback& callback)
69 {
70 contentInfoCallback_ = callback;
71 }
72
Find(const std::string & name)73 sptr<Window> WindowImpl::Find(const std::string& name)
74 {
75 return nullptr;
76 }
77
GetContext() const78 const std::shared_ptr<AbilityRuntime::Context> WindowImpl::GetContext() const
79 {
80 return nullptr;
81 }
82
FindWindowById(uint32_t windowId)83 sptr<Window> WindowImpl::FindWindowById(uint32_t windowId)
84 {
85 std::lock_guard<std::mutex> lock(globalMutex_);
86 if (windowMap_.empty()) {
87 WLOGFE("Please create mainWindow First!");
88 return nullptr;
89 }
90 for (auto iter = windowMap_.begin(); iter != windowMap_.end(); iter++) {
91 if (windowId == iter->second.first) {
92 WLOGI("FindWindow id: %{public}u", windowId);
93 return iter->second.second;
94 }
95 }
96 WLOGFE("Cannot find Window!");
97 return nullptr;
98 }
99
GetTopWindowWithId(uint32_t mainWinId)100 sptr<Window> WindowImpl::GetTopWindowWithId(uint32_t mainWinId)
101 {
102 return FindWindowById(mainWinId);
103 }
104
GetTopWindowWithContext(const std::shared_ptr<AbilityRuntime::Context> & context)105 sptr<Window> WindowImpl::GetTopWindowWithContext(const std::shared_ptr<AbilityRuntime::Context>& context)
106 {
107 return nullptr;
108 }
109
GetSubWindow(uint32_t parentId)110 std::vector<sptr<Window>> WindowImpl::GetSubWindow(uint32_t parentId)
111 {
112 return std::vector<sptr<Window>>();
113 }
114
UpdateConfigurationForAll(const std::shared_ptr<AppExecFwk::Configuration> & configuration)115 void WindowImpl::UpdateConfigurationForAll(const std::shared_ptr<AppExecFwk::Configuration>& configuration)
116 {
117 std::lock_guard<std::mutex> lock(globalMutex_);
118 for (const auto& winPair : windowMap_) {
119 auto window = winPair.second.second;
120 window->UpdateConfiguration(configuration);
121 }
122 }
123
UpdateConfigurationSync(const std::shared_ptr<AppExecFwk::Configuration> & configuration)124 void WindowImpl::UpdateConfigurationSync(const std::shared_ptr<AppExecFwk::Configuration>& configuration)
125 {
126 if (uiContent_ == nullptr) {
127 TLOGE(WmsLogTag::WMS_IMMS, "uiContent is null, winId: %{public}d", GetWindowId());
128 return;
129 }
130 TLOGI(WmsLogTag::WMS_IMMS, "winId: %{public}d", GetWindowId());
131 uiContent_->UpdateConfigurationSyncForAll(configuration);
132 }
133
UpdateConfigurationSyncForAll(const std::shared_ptr<AppExecFwk::Configuration> & configuration)134 void WindowImpl::UpdateConfigurationSyncForAll(const std::shared_ptr<AppExecFwk::Configuration>& configuration)
135 {
136 std::lock_guard<std::mutex> lock(globalMutex_);
137 for (const auto& winPair : windowMap_) {
138 if (auto window = winPair.second.second) {
139 window->UpdateConfigurationSync(configuration);
140 }
141 }
142 }
143
GetSurfaceNode() const144 std::shared_ptr<RSSurfaceNode> WindowImpl::GetSurfaceNode() const
145 {
146 return surfaceNode_;
147 }
148
GetRect() const149 Rect WindowImpl::GetRect() const
150 {
151 return Rect{0, 0, 0, 0};
152 }
153
GetRequestRect() const154 Rect WindowImpl::GetRequestRect() const
155 {
156 return Rect{0, 0, 0, 0};
157 }
158
GetType() const159 WindowType WindowImpl::GetType() const
160 {
161 return WindowType::WINDOW_TYPE_APP_MAIN_WINDOW;
162 }
163
GetMode() const164 WindowMode WindowImpl::GetMode() const
165 {
166 return windowMode_;
167 }
168
GetAlpha() const169 float WindowImpl::GetAlpha() const
170 {
171 return 0.0;
172 }
173
GetWindowState() const174 WindowState WindowImpl::GetWindowState() const
175 {
176 return state_;
177 }
178
SetFocusable(bool isFocusable)179 WMError WindowImpl::SetFocusable(bool isFocusable)
180 {
181 return WMError::WM_OK;
182 }
183
GetFocusable() const184 bool WindowImpl::GetFocusable() const
185 {
186 return false;
187 }
188
SetTouchable(bool isTouchable)189 WMError WindowImpl::SetTouchable(bool isTouchable)
190 {
191 return WMError::WM_OK;
192 }
193
GetTouchable() const194 bool WindowImpl::GetTouchable() const
195 {
196 return false;
197 }
198
GetWindowName() const199 const std::string& WindowImpl::GetWindowName() const
200 {
201 return name_;
202 }
203
GetWindowId() const204 uint32_t WindowImpl::GetWindowId() const
205 {
206 return windowId_;
207 }
208
GetDisplayId() const209 uint64_t WindowImpl::GetDisplayId() const
210 {
211 return DISPLAY_ID_INVALID;
212 }
213
GetWindowFlags() const214 uint32_t WindowImpl::GetWindowFlags() const
215 {
216 return 0;
217 }
218
GetRequestWindowModeSupportType() const219 uint32_t WindowImpl::GetRequestWindowModeSupportType() const
220 {
221 return 0;
222 }
223
IsMainHandlerAvailable() const224 bool WindowImpl::IsMainHandlerAvailable() const
225 {
226 return true;
227 }
228
GetSystemBarPropertyByType(WindowType type) const229 SystemBarProperty WindowImpl::GetSystemBarPropertyByType(WindowType type) const
230 {
231 std::lock_guard<std::mutex> lock(mutex_);
232 auto it = sysBarPropMap_.find(type);
233 if (it == sysBarPropMap_.end()) {
234 return SystemBarProperty(false, 0x0, 0x0);
235 }
236 return it->second;
237 }
238
GetAvoidAreaByType(AvoidAreaType type,AvoidArea & avoidArea)239 WMError WindowImpl::GetAvoidAreaByType(AvoidAreaType type, AvoidArea& avoidArea)
240 {
241 std::lock_guard<std::mutex> lock(mutex_);
242 auto avoidAreaPtr = avoidAreaMap_[type];
243 if (avoidAreaPtr == nullptr) {
244 return WMError::WM_OK;
245 }
246
247 avoidArea = *avoidAreaPtr;
248 return WMError::WM_OK;
249 }
250
SetWindowType(WindowType type)251 WMError WindowImpl::SetWindowType(WindowType type)
252 {
253 return WMError::WM_OK;
254 }
255
SetWindowMode(WindowMode mode)256 WMError WindowImpl::SetWindowMode(WindowMode mode)
257 {
258 windowMode_ = mode;
259 return WMError::WM_OK;
260 }
261
SetAlpha(float alpha)262 WMError WindowImpl::SetAlpha(float alpha)
263 {
264 return WMError::WM_OK;
265 }
266
SetTransform(const Transform & trans)267 WMError WindowImpl::SetTransform(const Transform& trans)
268 {
269 return WMError::WM_OK;
270 }
271
GetTransform() const272 const Transform& WindowImpl::GetTransform() const
273 {
274 return transform_;
275 }
276
AddWindowFlag(WindowFlag flag)277 WMError WindowImpl::AddWindowFlag(WindowFlag flag)
278 {
279 return WMError::WM_OK;
280 }
281
RemoveWindowFlag(WindowFlag flag)282 WMError WindowImpl::RemoveWindowFlag(WindowFlag flag)
283 {
284 return WMError::WM_OK;
285 }
286
SetWindowFlags(uint32_t flags)287 WMError WindowImpl::SetWindowFlags(uint32_t flags)
288 {
289 return WMError::WM_OK;
290 }
291
OnNewWant(const AAFwk::Want & want)292 void WindowImpl::OnNewWant(const AAFwk::Want& want)
293 {
294 return;
295 }
296
NapiSetUIContent(const std::string & contentInfo,napi_env env,napi_value storage,BackupAndRestoreType type,sptr<IRemoteObject> token,AppExecFwk::Ability * ability)297 WMError WindowImpl::NapiSetUIContent(const std::string& contentInfo, napi_env env, napi_value storage,
298 BackupAndRestoreType type, sptr<IRemoteObject> token, AppExecFwk::Ability* ability)
299 {
300 WLOGFD("NapiSetUIContent: %{public}s", contentInfo.c_str());
301 if (uiContent_) {
302 uiContent_->Destroy();
303 }
304 std::unique_ptr<Ace::UIContent> uiContent;
305 if (ability != nullptr) {
306 uiContent = Ace::UIContent::Create(ability);
307 } else {
308 uiContent = Ace::UIContent::Create(context_.get(), reinterpret_cast<NativeEngine*>(env));
309 }
310 if (uiContent == nullptr) {
311 WLOGFE("fail to NapiSetUIContent");
312 return WMError::WM_ERROR_NULLPTR;
313 }
314 if (type != BackupAndRestoreType::NONE) {
315 uiContent->Restore(this, contentInfo, storage, type == BackupAndRestoreType::CONTINUATION ?
316 Ace::ContentInfoType::CONTINUATION : Ace::ContentInfoType::APP_RECOVERY);
317 } else {
318 uiContent->Initialize(this, contentInfo, storage);
319 }
320 uiContent_ = std::move(uiContent);
321 if (uiContent_ == nullptr) {
322 WLOGFE("uiContent_ is NULL");
323 return WMError::WM_ERROR_NULLPTR;
324 }
325 NotifySetIgnoreSafeArea(isIgnoreSafeArea_);
326 UpdateViewportConfig();
327 if (contentInfoCallback_) {
328 contentInfoCallback_(contentInfo);
329 }
330 return WMError::WM_OK;
331 }
332
333
GetUIContent() const334 Ace::UIContent* WindowImpl::GetUIContent() const
335 {
336 WLOGFD("WindowImpl::GetUIContent");
337 return uiContent_.get();
338 }
339
GetContentInfo(BackupAndRestoreType type)340 std::string WindowImpl::GetContentInfo(BackupAndRestoreType type)
341 {
342 return "";
343 }
344
IsSupportWideGamut()345 bool WindowImpl::IsSupportWideGamut()
346 {
347 return true;
348 }
349
SetColorSpace(ColorSpace colorSpace)350 void WindowImpl::SetColorSpace(ColorSpace colorSpace)
351 {
352 return;
353 }
354
GetColorSpace()355 ColorSpace WindowImpl::GetColorSpace()
356 {
357 return ColorSpace::COLOR_SPACE_DEFAULT;
358 }
359
Snapshot()360 std::shared_ptr<Media::PixelMap> WindowImpl::Snapshot()
361 {
362 return nullptr;
363 }
364
DumpInfo(const std::vector<std::string> & params,std::vector<std::string> & info)365 void WindowImpl::DumpInfo(const std::vector<std::string>& params, std::vector<std::string>& info)
366 {
367 return;
368 }
369
SetSystemBarProperty(WindowType type,const SystemBarProperty & property)370 WMError WindowImpl::SetSystemBarProperty(WindowType type, const SystemBarProperty& property)
371 {
372 return SetSpecificBarProperty(type, property);
373 }
374
SetSpecificBarProperty(WindowType type,const SystemBarProperty & property)375 WMError WindowImpl::SetSpecificBarProperty(WindowType type, const SystemBarProperty& property)
376 {
377 WLOGI("Window %{public}u type %{public}u enable:%{public}u, bgColor:%{public}x, Color:%{public}x",
378 GetWindowId(), static_cast<uint32_t>(type), property.enable_,
379 property.backgroundColor_, property.contentColor_);
380
381 if (GetSystemBarPropertyByType(type) == property) {
382 return WMError::WM_OK;
383 }
384 {
385 std::lock_guard<std::mutex> lock(mutex_);
386 sysBarPropMap_[type] = property;
387 }
388 NotifySystemBarChange(type, property);
389 UpdateViewportConfig();
390 return WMError::WM_OK;
391 }
392
UpdateSystemBarProperty(bool status)393 WMError WindowImpl::UpdateSystemBarProperty(bool status)
394 {
395 bool enable = !status;
396 SystemBarProperty statusProperty = GetSystemBarPropertyByType(WindowType::WINDOW_TYPE_STATUS_BAR);
397 if (statusProperty.enable_ != enable) {
398 statusProperty.enable_ = enable;
399 SetSystemBarProperty(WindowType::WINDOW_TYPE_STATUS_BAR, statusProperty);
400 }
401
402 SystemBarProperty naviProperty = GetSystemBarPropertyByType(WindowType::WINDOW_TYPE_NAVIGATION_BAR);
403 if (naviProperty.enable_ != enable) {
404 naviProperty.enable_ = enable;
405 SetSystemBarProperty(WindowType::WINDOW_TYPE_NAVIGATION_BAR, naviProperty);
406 }
407
408 SystemBarProperty naviIndicatorProperty = GetSystemBarPropertyByType(WindowType::WINDOW_TYPE_NAVIGATION_INDICATOR);
409 if (naviIndicatorProperty.enable_ != enable) {
410 naviIndicatorProperty.enable_ = enable;
411 SetSystemBarProperty(WindowType::WINDOW_TYPE_NAVIGATION_INDICATOR, naviIndicatorProperty);
412 }
413
414 return WMError::WM_OK;
415 }
416
SetSystemBarProperties(const std::map<WindowType,SystemBarProperty> & properties,const std::map<WindowType,SystemBarPropertyFlag> & propertyFlags)417 WMError WindowImpl::SetSystemBarProperties(const std::map<WindowType, SystemBarProperty>& properties,
418 const std::map<WindowType, SystemBarPropertyFlag>& propertyFlags)
419 {
420 return WMError::WM_OK;
421 }
422
GetSystemBarProperties(std::map<WindowType,SystemBarProperty> & properties)423 WMError WindowImpl::GetSystemBarProperties(std::map<WindowType, SystemBarProperty>& properties)
424 {
425 return WMError::WM_OK;
426 }
427
SetLayoutFullScreen(bool status)428 WMError WindowImpl::SetLayoutFullScreen(bool status)
429 {
430 isIgnoreSafeArea_ = status;
431 NotifySetIgnoreSafeArea(status);
432 UpdateViewportConfig();
433 return WMError::WM_OK;
434 }
435
SetFullScreen(bool status)436 WMError WindowImpl::SetFullScreen(bool status)
437 {
438 WLOGI("status: %{public}d", status);
439 WMError ret = UpdateSystemBarProperty(status);
440 if (ret != WMError::WM_OK) {
441 WLOGFE("UpdateSystemBarProperty errCode:%{public}d", static_cast<int32_t>(ret));
442 }
443 ret = SetLayoutFullScreen(status);
444 if (ret != WMError::WM_OK) {
445 WLOGFE("SetLayoutFullScreen errCode:%{public}d", static_cast<int32_t>(ret));
446 }
447 return WMError::WM_OK;
448 }
449
Create(uint32_t parentId,const std::shared_ptr<AbilityRuntime::Context> & context)450 WMError WindowImpl::Create(uint32_t parentId, const std::shared_ptr<AbilityRuntime::Context>& context)
451 {
452 WLOGFI("[Client] Window [name:%{public}s] Create", name_.c_str());
453 context_ = context;
454 sptr<Window> self(this);
455 static std::atomic<uint32_t> tempWindowId = 0;
456 uint32_t windowId = tempWindowId++; // for test
457 windowId_ = windowId;
458 std::lock_guard<std::mutex> lock(globalMutex_);
459 windowMap_.insert(std::make_pair(name_, std::pair<uint32_t, sptr<Window>>(windowId, self)));
460 return WMError::WM_OK;
461 }
462
BindDialogTarget(sptr<IRemoteObject> targetToken)463 WMError WindowImpl::BindDialogTarget(sptr<IRemoteObject> targetToken)
464 {
465 return WMError::WM_OK;
466 }
467
SetDialogBackGestureEnabled(bool isEnabled)468 WMError WindowImpl::SetDialogBackGestureEnabled(bool isEnabled)
469 {
470 return WMError::WM_OK;
471 }
472
Destroy()473 WMError WindowImpl::Destroy()
474 {
475 if (uiContent_) {
476 uiContent_->Destroy();
477 }
478 std::lock_guard<std::mutex> lock(globalMutex_);
479 windowMap_.erase(GetWindowName());
480 return WMError::WM_OK;
481 }
482
UpdateSurfaceNodeAfterCustomAnimation(bool isAdd)483 WMError WindowImpl::UpdateSurfaceNodeAfterCustomAnimation(bool isAdd)
484 {
485 return WMError::WM_OK;
486 }
487
Show(uint32_t reason,bool withAnimation,bool withFocus)488 WMError WindowImpl::Show(uint32_t reason, bool withAnimation, bool withFocus)
489 {
490 return WMError::WM_OK;
491 }
492
Hide(uint32_t reason,bool withAnimation,bool isFromInnerkits)493 WMError WindowImpl::Hide(uint32_t reason, bool withAnimation, bool isFromInnerkits)
494 {
495 return WMError::WM_OK;
496 }
497
MoveTo(int32_t x,int32_t y,bool isMoveToGlobal)498 WMError WindowImpl::MoveTo(int32_t x, int32_t y, bool isMoveToGlobal)
499 {
500 return WMError::WM_OK;
501 }
502
Resize(uint32_t width,uint32_t height)503 WMError WindowImpl::Resize(uint32_t width, uint32_t height)
504 {
505 return WMError::WM_OK;
506 }
507
SetWindowGravity(WindowGravity gravity,uint32_t percent)508 WMError WindowImpl::SetWindowGravity(WindowGravity gravity, uint32_t percent)
509 {
510 return WMError::WM_OK;
511 }
512
SetKeepScreenOn(bool keepScreenOn)513 WMError WindowImpl::SetKeepScreenOn(bool keepScreenOn)
514 {
515 return WMError::WM_OK;
516 }
517
IsKeepScreenOn() const518 bool WindowImpl::IsKeepScreenOn() const
519 {
520 return false;
521 }
522
SetTurnScreenOn(bool turnScreenOn)523 WMError WindowImpl::SetTurnScreenOn(bool turnScreenOn)
524 {
525 return WMError::WM_OK;
526 }
527
IsTurnScreenOn() const528 bool WindowImpl::IsTurnScreenOn() const
529 {
530 return false;
531 }
532
SetBackgroundColor(const std::string & color)533 WMError WindowImpl::SetBackgroundColor(const std::string& color)
534 {
535 return WMError::WM_OK;
536 }
537
SetTransparent(bool isTransparent)538 WMError WindowImpl::SetTransparent(bool isTransparent)
539 {
540 return WMError::WM_OK;
541 }
542
IsTransparent() const543 bool WindowImpl::IsTransparent() const
544 {
545 return true;
546 }
547
SetBrightness(float brightness)548 WMError WindowImpl::SetBrightness(float brightness)
549 {
550 return WMError::WM_OK;
551 }
552
GetBrightness() const553 float WindowImpl::GetBrightness() const
554 {
555 return 0.0;
556 }
557
SetCallingWindow(uint32_t windowId)558 WMError WindowImpl::SetCallingWindow(uint32_t windowId)
559 {
560 return WMError::WM_OK;
561 }
562
SetPrivacyMode(bool isPrivacyMode)563 WMError WindowImpl::SetPrivacyMode(bool isPrivacyMode)
564 {
565 return WMError::WM_OK;
566 }
567
IsPrivacyMode() const568 bool WindowImpl::IsPrivacyMode() const
569 {
570 return false;
571 }
572
SetSystemPrivacyMode(bool isSystemPrivacyMode)573 void WindowImpl::SetSystemPrivacyMode(bool isSystemPrivacyMode)
574 {
575 }
576
SetSnapshotSkip(bool isSkip)577 WMError WindowImpl::SetSnapshotSkip(bool isSkip)
578 {
579 return WMError::WM_OK;
580 }
581
DisableAppWindowDecor()582 WMError WindowImpl::DisableAppWindowDecor()
583 {
584 return WMError::WM_OK;
585 }
586
Maximize()587 WMError WindowImpl::Maximize()
588 {
589 return WMError::WM_OK;
590 }
591
Minimize()592 WMError WindowImpl::Minimize()
593 {
594 return WMError::WM_OK;
595 }
596
Recover()597 WMError WindowImpl::Recover()
598 {
599 return WMError::WM_OK;
600 }
601
Close()602 WMError WindowImpl::Close()
603 {
604 return WMError::WM_OK;
605 }
606
StartMove()607 void WindowImpl::StartMove()
608 {
609 return;
610 }
611
RequestFocus() const612 WMError WindowImpl::RequestFocus() const
613 {
614 return WMError::WM_OK;
615 }
616
IsFocused() const617 bool WindowImpl::IsFocused() const
618 {
619 return true;
620 }
621
SetInputEventConsumer(const std::shared_ptr<IInputEventConsumer> & inputEventConsumer)622 void WindowImpl::SetInputEventConsumer(const std::shared_ptr<IInputEventConsumer>& inputEventConsumer)
623 {
624 return;
625 }
626
RegisterLifeCycleListener(const sptr<IWindowLifeCycle> & listener)627 WMError WindowImpl::RegisterLifeCycleListener(const sptr<IWindowLifeCycle>& listener)
628 {
629 return WMError::WM_OK;
630 }
631
RegisterWindowChangeListener(const sptr<IWindowChangeListener> & listener)632 WMError WindowImpl::RegisterWindowChangeListener(const sptr<IWindowChangeListener>& listener)
633 {
634 return WMError::WM_OK;
635 }
636
UnregisterLifeCycleListener(const sptr<IWindowLifeCycle> & listener)637 WMError WindowImpl::UnregisterLifeCycleListener(const sptr<IWindowLifeCycle>& listener)
638 {
639 return WMError::WM_OK;
640 }
641
UnregisterWindowChangeListener(const sptr<IWindowChangeListener> & listener)642 WMError WindowImpl::UnregisterWindowChangeListener(const sptr<IWindowChangeListener>& listener)
643 {
644 return WMError::WM_OK;
645 }
646
RegisterAvoidAreaChangeListener(sptr<IAvoidAreaChangedListener> & listener)647 WMError WindowImpl::RegisterAvoidAreaChangeListener(sptr<IAvoidAreaChangedListener>& listener)
648 {
649 WLOGFD("Start register");
650 std::lock_guard<std::mutex> lock(globalMutex_);
651 WMError ret = RegisterListener(avoidAreaChangeListeners_[GetWindowId()], listener);
652 return ret;
653 }
654
UnregisterAvoidAreaChangeListener(sptr<IAvoidAreaChangedListener> & listener)655 WMError WindowImpl::UnregisterAvoidAreaChangeListener(sptr<IAvoidAreaChangedListener>& listener)
656 {
657 WLOGFD("Start unregister");
658 std::lock_guard<std::mutex> lock(globalMutex_);
659 WMError ret = UnregisterListener(avoidAreaChangeListeners_[GetWindowId()], listener);
660 return ret;
661 }
662
RegisterDragListener(const sptr<IWindowDragListener> & listener)663 WMError WindowImpl::RegisterDragListener(const sptr<IWindowDragListener>& listener)
664 {
665 return WMError::WM_OK;
666 }
667
UnregisterDragListener(const sptr<IWindowDragListener> & listener)668 WMError WindowImpl::UnregisterDragListener(const sptr<IWindowDragListener>& listener)
669 {
670 return WMError::WM_OK;
671 }
672
RegisterDisplayMoveListener(sptr<IDisplayMoveListener> & listener)673 WMError WindowImpl::RegisterDisplayMoveListener(sptr<IDisplayMoveListener>& listener)
674 {
675 return WMError::WM_OK;
676 }
677
UnregisterDisplayMoveListener(sptr<IDisplayMoveListener> & listener)678 WMError WindowImpl::UnregisterDisplayMoveListener(sptr<IDisplayMoveListener>& listener)
679 {
680 return WMError::WM_OK;
681 }
682
RegisterWindowDestroyedListener(const NotifyNativeWinDestroyFunc & func)683 void WindowImpl::RegisterWindowDestroyedListener(const NotifyNativeWinDestroyFunc& func)
684 {
685 return;
686 }
687
RegisterOccupiedAreaChangeListener(const sptr<IOccupiedAreaChangeListener> & listener)688 WMError WindowImpl::RegisterOccupiedAreaChangeListener(const sptr<IOccupiedAreaChangeListener>& listener)
689 {
690 return WMError::WM_OK;
691 }
692
UnregisterOccupiedAreaChangeListener(const sptr<IOccupiedAreaChangeListener> & listener)693 WMError WindowImpl::UnregisterOccupiedAreaChangeListener(const sptr<IOccupiedAreaChangeListener>& listener)
694 {
695 return WMError::WM_OK;
696 }
697
RegisterTouchOutsideListener(const sptr<ITouchOutsideListener> & listener)698 WMError WindowImpl::RegisterTouchOutsideListener(const sptr<ITouchOutsideListener>& listener)
699 {
700 return WMError::WM_OK;
701 }
702
UnregisterTouchOutsideListener(const sptr<ITouchOutsideListener> & listener)703 WMError WindowImpl::UnregisterTouchOutsideListener(const sptr<ITouchOutsideListener>& listener)
704 {
705 return WMError::WM_OK;
706 }
707
RegisterAnimationTransitionController(const sptr<IAnimationTransitionController> & listener)708 WMError WindowImpl::RegisterAnimationTransitionController(const sptr<IAnimationTransitionController>& listener)
709 {
710 return WMError::WM_OK;
711 }
712
RegisterScreenshotListener(const sptr<IScreenshotListener> & listener)713 WMError WindowImpl::RegisterScreenshotListener(const sptr<IScreenshotListener>& listener)
714 {
715 return WMError::WM_OK;
716 }
717
UnregisterScreenshotListener(const sptr<IScreenshotListener> & listener)718 WMError WindowImpl::UnregisterScreenshotListener(const sptr<IScreenshotListener>& listener)
719 {
720 return WMError::WM_OK;
721 }
722
RegisterDialogTargetTouchListener(const sptr<IDialogTargetTouchListener> & listener)723 WMError WindowImpl::RegisterDialogTargetTouchListener(const sptr<IDialogTargetTouchListener>& listener)
724 {
725 return WMError::WM_OK;
726 }
727
UnregisterDialogTargetTouchListener(const sptr<IDialogTargetTouchListener> & listener)728 WMError WindowImpl::UnregisterDialogTargetTouchListener(const sptr<IDialogTargetTouchListener>& listener)
729 {
730 return WMError::WM_OK;
731 }
732
RegisterDialogDeathRecipientListener(const sptr<IDialogDeathRecipientListener> & listener)733 void WindowImpl::RegisterDialogDeathRecipientListener(const sptr<IDialogDeathRecipientListener>& listener)
734 {
735 return;
736 }
737
UnregisterDialogDeathRecipientListener(const sptr<IDialogDeathRecipientListener> & listener)738 void WindowImpl::UnregisterDialogDeathRecipientListener(const sptr<IDialogDeathRecipientListener>& listener)
739 {
740 return;
741 }
742
RegisterSystemBarEnableListener(const sptr<IWindowSystemBarEnableListener> & listener)743 WMError WindowImpl::RegisterSystemBarEnableListener(const sptr<IWindowSystemBarEnableListener>& listener)
744 {
745 WLOGFI("Register");
746 std::lock_guard<std::mutex> lock(globalMutex_);
747 WMError ret = RegisterListener(systemBarEnableListeners_[GetWindowId()], listener);
748 return ret;
749 }
750
UnRegisterSystemBarEnableListener(const sptr<IWindowSystemBarEnableListener> & listener)751 WMError WindowImpl::UnRegisterSystemBarEnableListener(const sptr<IWindowSystemBarEnableListener>& listener)
752 {
753 WLOGFI("UnRegister");
754 std::lock_guard<std::mutex> lock(globalMutex_);
755 WMError ret = UnregisterListener(systemBarEnableListeners_[GetWindowId()], listener);
756 return ret;
757 }
758
RegisterIgnoreViewSafeAreaListener(const sptr<IIgnoreViewSafeAreaListener> & listener)759 WMError WindowImpl::RegisterIgnoreViewSafeAreaListener(const sptr<IIgnoreViewSafeAreaListener>& listener)
760 {
761 WLOGFI("Register");
762 std::lock_guard<std::mutex> lock(globalMutex_);
763 WMError ret = RegisterListener(ignoreSafeAreaListeners_[GetWindowId()], listener);
764 return ret;
765 }
766
UnRegisterIgnoreViewSafeAreaListener(const sptr<IIgnoreViewSafeAreaListener> & listener)767 WMError WindowImpl::UnRegisterIgnoreViewSafeAreaListener(const sptr<IIgnoreViewSafeAreaListener>& listener)
768 {
769 WLOGFI("UnRegister");
770 std::lock_guard<std::mutex> lock(globalMutex_);
771 WMError ret = UnregisterListener(ignoreSafeAreaListeners_[GetWindowId()], listener);
772 return ret;
773 }
774
775 template<typename T>
RegisterListener(std::vector<sptr<T>> & holder,const sptr<T> & listener)776 WMError WindowImpl::RegisterListener(std::vector<sptr<T>>& holder, const sptr<T>& listener)
777 {
778 if (listener == nullptr) {
779 WLOGFE("listener is nullptr");
780 return WMError::WM_ERROR_NULLPTR;
781 }
782 if (std::find(holder.begin(), holder.end(), listener) != holder.end()) {
783 WLOGFE("Listener already registered");
784 return WMError::WM_OK;
785 }
786 holder.emplace_back(listener);
787 return WMError::WM_OK;
788 }
789
790 template<typename T>
UnregisterListener(std::vector<sptr<T>> & holder,const sptr<T> & listener)791 WMError WindowImpl::UnregisterListener(std::vector<sptr<T>>& holder, const sptr<T>& listener)
792 {
793 if (listener == nullptr) {
794 WLOGFE("listener could not be null");
795 return WMError::WM_ERROR_NULLPTR;
796 }
797 holder.erase(std::remove_if(holder.begin(), holder.end(),
798 [listener](sptr<T> registeredListener) {
799 return registeredListener == listener;
800 }), holder.end());
801 return WMError::WM_OK;
802 }
803
SetAceAbilityHandler(const sptr<IAceAbilityHandler> & handler)804 void WindowImpl::SetAceAbilityHandler(const sptr<IAceAbilityHandler>& handler)
805 {
806 return;
807 }
808
SetRequestWindowModeSupportType(uint32_t windowModeSupportType)809 void WindowImpl::SetRequestWindowModeSupportType(uint32_t windowModeSupportType)
810 {
811 return;
812 }
813
ConsumeKeyEvent(const std::shared_ptr<MMI::KeyEvent> & keyEvent)814 void WindowImpl::ConsumeKeyEvent(const std::shared_ptr<MMI::KeyEvent>& keyEvent)
815 {
816 if (uiContent_ == nullptr) {
817 WLOGFE("ConsumeKeyEvent to uiContent failed,uiContent_ is null");
818 return;
819 }
820 uiContent_->ProcessKeyEvent(keyEvent);
821 }
822
ConsumePointerEvent(const std::shared_ptr<MMI::PointerEvent> & pointerEvent)823 void WindowImpl::ConsumePointerEvent(const std::shared_ptr<MMI::PointerEvent>& pointerEvent)
824 {
825 if (uiContent_ == nullptr) {
826 WLOGFE("ConsumePointerEvent to uiContent failed,uiContent_ is null");
827 return;
828 }
829 (void)uiContent_->ProcessPointerEvent(pointerEvent);
830 }
831
832
RequestVsync(const std::shared_ptr<VsyncCallback> & vsyncCallback)833 void WindowImpl::RequestVsync(const std::shared_ptr<VsyncCallback>& vsyncCallback)
834 {
835 if (vsyncStation_ == nullptr) {
836 TLOGE(WmsLogTag::WMS_MAIN, "Receive vsync request failed, vsyncStation is nullptr");
837 return;
838 }
839 vsyncStation_->RequestVsync(vsyncCallback);
840 }
841
GetVSyncPeriod()842 int64_t WindowImpl::GetVSyncPeriod()
843 {
844 return 0;
845 }
846
UpdateConfiguration(const std::shared_ptr<AppExecFwk::Configuration> & configuration)847 void WindowImpl::UpdateConfiguration(const std::shared_ptr<AppExecFwk::Configuration>& configuration)
848 {
849 if (uiContent_ != nullptr) {
850 WLOGFD("notify ace winId:%{public}u", GetWindowId());
851 uiContent_->UpdateConfiguration(configuration);
852 }
853 }
854
UpdateAvoidArea(const sptr<AvoidArea> & avoidArea,AvoidAreaType type)855 void WindowImpl::UpdateAvoidArea(const sptr<AvoidArea>& avoidArea, AvoidAreaType type)
856 {
857 if (!avoidArea) {
858 WLOGFE("invalid avoidArea");
859 return;
860 }
861
862 WLOGFI("type:%{public}d, top:{%{public}d,%{public}d,%{public}d,%{public}d}, "
863 "left:{%{public}d,%{public}d,%{public}d,%{public}d}, right:{%{public}d,%{public}d,%{public}d,%{public}d}, "
864 "bottom:{%{public}d,%{public}d,%{public}d,%{public}d}",
865 type, avoidArea->topRect_.posX_, avoidArea->topRect_.posY_, avoidArea->topRect_.width_,
866 avoidArea->topRect_.height_, avoidArea->leftRect_.posX_, avoidArea->leftRect_.posY_,
867 avoidArea->leftRect_.width_, avoidArea->leftRect_.height_, avoidArea->rightRect_.posX_,
868 avoidArea->rightRect_.posY_, avoidArea->rightRect_.width_, avoidArea->rightRect_.height_,
869 avoidArea->bottomRect_.posX_, avoidArea->bottomRect_.posY_, avoidArea->bottomRect_.width_,
870 avoidArea->bottomRect_.height_);
871
872 {
873 std::lock_guard<std::mutex> lock(mutex_);
874 avoidAreaMap_[type] = avoidArea;
875 }
876 NotifyAvoidAreaChange(avoidArea, type);
877 }
878
NotifySystemBarChange(WindowType type,const SystemBarProperty & property)879 void WindowImpl::NotifySystemBarChange(WindowType type, const SystemBarProperty& property)
880 {
881 auto systemBarEnableListeners = GetListeners<IWindowSystemBarEnableListener>();
882 for (auto& listener : systemBarEnableListeners) {
883 if (listener != nullptr) {
884 WLOGFD("type = %{public}u", type);
885 listener->OnSetSpecificBarProperty(type, property);
886 }
887 }
888 }
889
NotifySetIgnoreSafeArea(bool value)890 void WindowImpl::NotifySetIgnoreSafeArea(bool value)
891 {
892 auto ignoreSafeAreaListeners = GetListeners<IIgnoreViewSafeAreaListener>();
893 for (auto& listener : ignoreSafeAreaListeners) {
894 if (listener != nullptr) {
895 WLOGFD("value = %{public}d", value);
896 listener->SetIgnoreViewSafeArea(value);
897 }
898 }
899 }
900
NotifyAvoidAreaChange(const sptr<AvoidArea> & avoidArea,AvoidAreaType type)901 void WindowImpl::NotifyAvoidAreaChange(const sptr<AvoidArea>& avoidArea, AvoidAreaType type)
902 {
903 auto avoidAreaChangeListeners = GetListeners<IAvoidAreaChangedListener>();
904 for (auto& listener : avoidAreaChangeListeners) {
905 if (listener != nullptr) {
906 WLOGFD("type = %{public}u", type);
907 listener->OnAvoidAreaChanged(*avoidArea, type);
908 }
909 }
910 }
911
NotifyTouchDialogTarget(int32_t posX,int32_t posY)912 void WindowImpl::NotifyTouchDialogTarget(int32_t posX, int32_t posY)
913 {
914 return;
915 }
916
SetNeedRemoveWindowInputChannel(bool needRemoveWindowInputChannel)917 void WindowImpl::SetNeedRemoveWindowInputChannel(bool needRemoveWindowInputChannel)
918 {
919 needRemoveWindowInputChannel_ = needRemoveWindowInputChannel;
920 }
921
IsLayoutFullScreen() const922 bool WindowImpl::IsLayoutFullScreen() const
923 {
924 return isIgnoreSafeArea_;
925 }
926
IsFullScreen() const927 bool WindowImpl::IsFullScreen() const
928 {
929 auto statusProperty = GetSystemBarPropertyByType(WindowType::WINDOW_TYPE_STATUS_BAR);
930 auto naviProperty = GetSystemBarPropertyByType(WindowType::WINDOW_TYPE_NAVIGATION_BAR);
931 return (IsLayoutFullScreen() && !statusProperty.enable_ && !naviProperty.enable_);
932 }
933
SetRequestedOrientation(Orientation orientation)934 void WindowImpl::SetRequestedOrientation(Orientation orientation)
935 {
936 }
937
GetRequestedOrientation()938 Orientation WindowImpl::GetRequestedOrientation()
939 {
940 return Orientation::UNSPECIFIED;
941 }
942
SetTouchHotAreas(const std::vector<Rect> & rects)943 WMError WindowImpl::SetTouchHotAreas(const std::vector<Rect>& rects)
944 {
945 return WMError::WM_OK;
946 }
GetRequestedTouchHotAreas(std::vector<Rect> & rects) const947 void WindowImpl::GetRequestedTouchHotAreas(std::vector<Rect>& rects) const
948 {
949 }
950
SetAPPWindowLabel(const std::string & label)951 WMError WindowImpl::SetAPPWindowLabel(const std::string& label)
952 {
953 if (uiContent_ == nullptr) {
954 WLOGFE("uicontent is empty");
955 return WMError::WM_ERROR_NULLPTR;
956 }
957 uiContent_->SetAppWindowTitle(label);
958 return WMError::WM_OK;
959 }
960
SetAPPWindowIcon(const std::shared_ptr<Media::PixelMap> & icon)961 WMError WindowImpl::SetAPPWindowIcon(const std::shared_ptr<Media::PixelMap>& icon)
962 {
963 if (icon == nullptr) {
964 WLOGFE("window icon is empty");
965 return WMError::WM_ERROR_NULLPTR;
966 }
967 if (uiContent_ == nullptr) {
968 WLOGFE("uicontent is empty");
969 return WMError::WM_ERROR_NULLPTR;
970 }
971 uiContent_->SetAppWindowIcon(icon);
972 return WMError::WM_OK;
973 }
974
SetCornerRadius(float cornerRadius)975 WMError WindowImpl::SetCornerRadius(float cornerRadius)
976 {
977 return WMError::WM_OK;
978 }
979
SetShadowRadius(float radius)980 WMError WindowImpl::SetShadowRadius(float radius)
981 {
982 return WMError::WM_OK;
983 }
984
SetShadowColor(std::string color)985 WMError WindowImpl::SetShadowColor(std::string color)
986 {
987 return WMError::WM_OK;
988 }
989
SetShadowOffsetX(float offsetX)990 WMError WindowImpl::SetShadowOffsetX(float offsetX)
991 {
992 return WMError::WM_OK;
993 }
994
SetShadowOffsetY(float offsetY)995 WMError WindowImpl::SetShadowOffsetY(float offsetY)
996 {
997 return WMError::WM_OK;
998 }
999
SetBlur(float radius)1000 WMError WindowImpl::SetBlur(float radius)
1001 {
1002 return WMError::WM_OK;
1003 }
1004
SetBackdropBlur(float radius)1005 WMError WindowImpl::SetBackdropBlur(float radius)
1006 {
1007 return WMError::WM_OK;
1008 }
1009
SetBackdropBlurStyle(WindowBlurStyle blurStyle)1010 WMError WindowImpl::SetBackdropBlurStyle(WindowBlurStyle blurStyle)
1011 {
1012 return WMError::WM_OK;
1013 }
1014
NotifyMemoryLevel(int32_t level)1015 WMError WindowImpl::NotifyMemoryLevel(int32_t level)
1016 {
1017 return WMError::WM_OK;
1018 }
1019
IsAllowHaveSystemSubWindow()1020 bool WindowImpl::IsAllowHaveSystemSubWindow()
1021 {
1022 return true;
1023 }
1024
1025 /** @note @window.hierarchy */
RaiseToAppTop()1026 WMError WindowImpl::RaiseToAppTop()
1027 {
1028 return WMError::WM_OK;
1029 }
1030
SetAspectRatio(float ratio)1031 WMError WindowImpl::SetAspectRatio(float ratio)
1032 {
1033 return WMError::WM_OK;
1034 }
1035
ResetAspectRatio()1036 WMError WindowImpl::ResetAspectRatio()
1037 {
1038 return WMError::WM_OK;
1039 }
1040
GetKeyboardAnimationConfig()1041 KeyboardAnimationConfig WindowImpl::GetKeyboardAnimationConfig()
1042 {
1043 return keyboardAnimationConfig_;
1044 }
1045
SetNeedDefaultAnimation(bool needDefaultAnimation)1046 void WindowImpl::SetNeedDefaultAnimation(bool needDefaultAnimation)
1047 {
1048 return;
1049 }
1050
SetViewportConfig(const Ace::ViewportConfig & config)1051 void WindowImpl::SetViewportConfig(const Ace::ViewportConfig& config)
1052 {
1053 bool isUpdate = false;
1054 if (width_ != config.Width()) {
1055 width_ = config.Width();
1056 isUpdate = true;
1057 }
1058 if (height_ != config.Height()) {
1059 height_ = config.Height();
1060 isUpdate = true;
1061 }
1062 if (abs(density_ - config.Density()) >= 1e-6) {
1063 density_ = config.Density();
1064 isUpdate = true;
1065 }
1066 if (orientation_ != config.Orientation()) {
1067 orientation_ = config.Orientation();
1068 isUpdate = true;
1069 }
1070 if (isUpdate) {
1071 UpdateViewportConfig();
1072 }
1073 }
1074
UpdateViewportConfig()1075 void WindowImpl::UpdateViewportConfig()
1076 {
1077 Ace::ViewportConfig config;
1078 config.SetSize(width_, height_);
1079 config.SetPosition(0, 0);
1080 config.SetDensity(density_);
1081 config.SetOrientation(orientation_);
1082 if (uiContent_ != nullptr) {
1083 uiContent_->UpdateViewportConfig(config, WindowSizeChangeReason::UNDEFINED);
1084 }
1085 }
1086
SetOrientation(Orientation orientation)1087 void WindowImpl::SetOrientation(Orientation orientation)
1088 {
1089 WLOGFD("SetOrientation : orientation=%{public}d", static_cast<int32_t>(orientation));
1090 if (orientation_ == static_cast<int32_t>(orientation)) {
1091 return;
1092 }
1093 orientation_ = static_cast<int32_t>(orientation);
1094 UpdateViewportConfig();
1095 }
1096
SetSize(int32_t width,int32_t height)1097 void WindowImpl::SetSize(int32_t width, int32_t height)
1098 {
1099 WLOGFD("SetSize : width=%{public}d, height=%{public}d", width, height);
1100 if (width_ == width && height_ == height) {
1101 return;
1102 }
1103 width_ = width;
1104 height_ = height;
1105 UpdateViewportConfig();
1106 }
1107
SetDensity(float density)1108 void WindowImpl::SetDensity(float density)
1109 {
1110 WLOGFD("SetDensity : density=%{public}f", density);
1111 if (abs(density_ - density) <= 0.000001) { // 0.000001: near zero.
1112 return;
1113 }
1114 density_ = density;
1115 UpdateViewportConfig();
1116 }
1117
SetResizeByDragEnabled(bool dragEnabled)1118 WMError WindowImpl::SetResizeByDragEnabled(bool dragEnabled)
1119 {
1120 return WMError::WM_OK;
1121 }
1122
1123 /** @note @window.hierarchy */
SetRaiseByClickEnabled(bool raiseEnabled)1124 WMError WindowImpl::SetRaiseByClickEnabled(bool raiseEnabled)
1125 {
1126 return WMError::WM_OK;
1127 }
1128
1129 /** @note @window.hierarchy */
RaiseAboveTarget(int32_t subWindowId)1130 WMError WindowImpl::RaiseAboveTarget(int32_t subWindowId)
1131 {
1132 return WMError::WM_OK;
1133 }
1134
HideNonSystemFloatingWindows(bool shouldHide)1135 WMError WindowImpl::HideNonSystemFloatingWindows(bool shouldHide)
1136 {
1137 return WMError::WM_OK;
1138 }
1139
RegisterWindowVisibilityChangeListener(const WindowVisibilityListenerSptr & listener)1140 WMError WindowImpl::RegisterWindowVisibilityChangeListener(const WindowVisibilityListenerSptr& listener)
1141 {
1142 return WMError::WM_ERROR_DEVICE_NOT_SUPPORT;
1143 }
1144
UnregisterWindowVisibilityChangeListener(const WindowVisibilityListenerSptr & listener)1145 WMError WindowImpl::UnregisterWindowVisibilityChangeListener(const WindowVisibilityListenerSptr& listener)
1146 {
1147 return WMError::WM_ERROR_DEVICE_NOT_SUPPORT;
1148 }
1149
KeepKeyboardOnFocus(bool keepKeyboardFlag)1150 WmErrorCode WindowImpl::KeepKeyboardOnFocus(bool keepKeyboardFlag)
1151 {
1152 return WmErrorCode::WM_ERROR_DEVICE_NOT_SUPPORT;
1153 }
1154
SetSingleFrameComposerEnabled(bool enable)1155 WMError WindowImpl::SetSingleFrameComposerEnabled(bool enable)
1156 {
1157 return WMError::WM_ERROR_DEVICE_NOT_SUPPORT;
1158 }
1159
SetLandscapeMultiWindow(bool isLandscapeMultiWindow)1160 WMError WindowImpl::SetLandscapeMultiWindow(bool isLandscapeMultiWindow)
1161 {
1162 return WMError::WM_OK;
1163 }
1164
SetUiDvsyncSwitch(bool dvsyncSwitch)1165 void WindowImpl::SetUiDvsyncSwitch(bool dvsyncSwitch)
1166 {
1167 }
1168
SetImmersiveModeEnabledState(bool enable)1169 WMError WindowImpl::SetImmersiveModeEnabledState(bool enable)
1170 {
1171 return WMError::WM_OK;
1172 }
1173
GetImmersiveModeEnabledState() const1174 bool WindowImpl::GetImmersiveModeEnabledState() const
1175 {
1176 return true;
1177 }
1178 } // namespace Rosen
1179 } // namespace OHOS
1180