1 /*
2 * Copyright (c) 2023 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 "common/include/window_session_property.h"
17 #include "window_manager_hilog.h"
18 #include "wm_common.h"
19 #include "window_helper.h"
20
21 namespace OHOS {
22 namespace Rosen {
23 namespace {
24 constexpr uint32_t TOUCH_HOT_AREA_MAX_NUM = 50;
25 constexpr uint32_t MAX_SIZE_PIP_CONTROL_GROUP = 8;
26 constexpr uint32_t MAX_SIZE_PIP_CONTROL = 9;
27 }
28
29 const std::map<uint64_t, HandlWritePropertyFunc> WindowSessionProperty::writeFuncMap_ {
30 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_TURN_SCREEN_ON),
31 &WindowSessionProperty::WriteActionUpdateTurnScreenOn),
32 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_KEEP_SCREEN_ON),
33 &WindowSessionProperty::WriteActionUpdateKeepScreenOn),
34 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_VIEW_KEEP_SCREEN_ON),
35 &WindowSessionProperty::WriteActionUpdateViewKeepScreenOn),
36 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_FOCUSABLE),
37 &WindowSessionProperty::WriteActionUpdateFocusable),
38 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_TOUCHABLE),
39 &WindowSessionProperty::WriteActionUpdateTouchable),
40 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_SET_BRIGHTNESS),
41 &WindowSessionProperty::WriteActionUpdateSetBrightness),
42 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_ORIENTATION),
43 &WindowSessionProperty::WriteActionUpdateOrientation),
44 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_PRIVACY_MODE),
45 &WindowSessionProperty::WriteActionUpdatePrivacyMode),
46 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_SYSTEM_PRIVACY_MODE),
47 &WindowSessionProperty::WriteActionUpdatePrivacyMode),
48 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_SNAPSHOT_SKIP),
49 &WindowSessionProperty::WriteActionUpdateSnapshotSkip),
50 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_MAXIMIZE_STATE),
51 &WindowSessionProperty::WriteActionUpdateMaximizeState),
52 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_OTHER_PROPS),
53 &WindowSessionProperty::WriteActionUpdateSystemBar),
54 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_STATUS_PROPS),
55 &WindowSessionProperty::WriteActionUpdateSystemBar),
56 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_NAVIGATION_PROPS),
57 &WindowSessionProperty::WriteActionUpdateSystemBar),
58 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_NAVIGATION_INDICATOR_PROPS),
59 &WindowSessionProperty::WriteActionUpdateSystemBar),
60 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_FLAGS),
61 &WindowSessionProperty::WriteActionUpdateFlags),
62 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_MODE),
63 &WindowSessionProperty::WriteActionUpdateMode),
64 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_ANIMATION_FLAG),
65 &WindowSessionProperty::WriteActionUpdateAnimationFlag),
66 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_TOUCH_HOT_AREA),
67 &WindowSessionProperty::WriteActionUpdateTouchHotArea),
68 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_KEYBOARD_TOUCH_HOT_AREA),
69 &WindowSessionProperty::WriteActionUpdateKeyboardTouchHotArea),
70 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_DECOR_ENABLE),
71 &WindowSessionProperty::WriteActionUpdateDecorEnable),
72 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_WINDOW_LIMITS),
73 &WindowSessionProperty::WriteActionUpdateWindowLimits),
74 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_DRAGENABLED),
75 &WindowSessionProperty::WriteActionUpdateDragenabled),
76 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_RAISEENABLED),
77 &WindowSessionProperty::WriteActionUpdateRaiseenabled),
78 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_HIDE_NON_SYSTEM_FLOATING_WINDOWS),
79 &WindowSessionProperty::WriteActionUpdateHideNonSystemFloatingWindows),
80 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_TEXTFIELD_AVOID_INFO),
81 &WindowSessionProperty::WriteActionUpdateTextfieldAvoidInfo),
82 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_WINDOW_MASK),
83 &WindowSessionProperty::WriteActionUpdateWindowMask),
84 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_TOPMOST),
85 &WindowSessionProperty::WriteActionUpdateTopmost),
86 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_SUB_WINDOW_Z_LEVEL),
87 &WindowSessionProperty::WriteActionUpdateSubWindowZLevel),
88 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_MODE_SUPPORT_INFO),
89 &WindowSessionProperty::WriteActionUpdateWindowModeSupportType),
90 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_MAIN_WINDOW_TOPMOST),
91 &WindowSessionProperty::WriteActionUpdateMainWindowTopmost),
92 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_AVOID_AREA_OPTION),
93 &WindowSessionProperty::WriteActionUpdateAvoidAreaOption),
94 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_BACKGROUND_ALPHA),
95 &WindowSessionProperty::WriteActionUpdateBackgroundAlpha),
96 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_EXCLUSIVE_HIGHLIGHTED),
97 &WindowSessionProperty::WriteActionUpdateExclusivelyHighlighted),
98 };
99
100 const std::map<uint64_t, HandlReadPropertyFunc> WindowSessionProperty::readFuncMap_ {
101 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_TURN_SCREEN_ON),
102 &WindowSessionProperty::ReadActionUpdateTurnScreenOn),
103 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_KEEP_SCREEN_ON),
104 &WindowSessionProperty::ReadActionUpdateKeepScreenOn),
105 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_VIEW_KEEP_SCREEN_ON),
106 &WindowSessionProperty::ReadActionUpdateViewKeepScreenOn),
107 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_FOCUSABLE),
108 &WindowSessionProperty::ReadActionUpdateFocusable),
109 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_TOUCHABLE),
110 &WindowSessionProperty::ReadActionUpdateTouchable),
111 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_SET_BRIGHTNESS),
112 &WindowSessionProperty::ReadActionUpdateSetBrightness),
113 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_ORIENTATION),
114 &WindowSessionProperty::ReadActionUpdateOrientation),
115 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_PRIVACY_MODE),
116 &WindowSessionProperty::ReadActionUpdatePrivacyMode),
117 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_SYSTEM_PRIVACY_MODE),
118 &WindowSessionProperty::ReadActionUpdatePrivacyMode),
119 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_SNAPSHOT_SKIP),
120 &WindowSessionProperty::ReadActionUpdateSnapshotSkip),
121 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_MAXIMIZE_STATE),
122 &WindowSessionProperty::ReadActionUpdateMaximizeState),
123 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_OTHER_PROPS),
124 &WindowSessionProperty::ReadActionUpdateSystemBar),
125 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_STATUS_PROPS),
126 &WindowSessionProperty::ReadActionUpdateSystemBar),
127 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_NAVIGATION_PROPS),
128 &WindowSessionProperty::ReadActionUpdateSystemBar),
129 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_NAVIGATION_INDICATOR_PROPS),
130 &WindowSessionProperty::ReadActionUpdateSystemBar),
131 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_FLAGS),
132 &WindowSessionProperty::ReadActionUpdateFlags),
133 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_MODE),
134 &WindowSessionProperty::ReadActionUpdateMode),
135 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_ANIMATION_FLAG),
136 &WindowSessionProperty::ReadActionUpdateAnimationFlag),
137 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_TOUCH_HOT_AREA),
138 &WindowSessionProperty::ReadActionUpdateTouchHotArea),
139 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_KEYBOARD_TOUCH_HOT_AREA),
140 &WindowSessionProperty::ReadActionUpdateKeyboardTouchHotArea),
141 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_DECOR_ENABLE),
142 &WindowSessionProperty::ReadActionUpdateDecorEnable),
143 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_WINDOW_LIMITS),
144 &WindowSessionProperty::ReadActionUpdateWindowLimits),
145 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_DRAGENABLED),
146 &WindowSessionProperty::ReadActionUpdateDragenabled),
147 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_RAISEENABLED),
148 &WindowSessionProperty::ReadActionUpdateRaiseenabled),
149 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_HIDE_NON_SYSTEM_FLOATING_WINDOWS),
150 &WindowSessionProperty::ReadActionUpdateHideNonSystemFloatingWindows),
151 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_TEXTFIELD_AVOID_INFO),
152 &WindowSessionProperty::ReadActionUpdateTextfieldAvoidInfo),
153 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_WINDOW_MASK),
154 &WindowSessionProperty::ReadActionUpdateWindowMask),
155 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_TOPMOST),
156 &WindowSessionProperty::ReadActionUpdateTopmost),
157 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_SUB_WINDOW_Z_LEVEL),
158 &WindowSessionProperty::ReadActionUpdateSubWindowZLevel),
159 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_MODE_SUPPORT_INFO),
160 &WindowSessionProperty::ReadActionUpdateWindowModeSupportType),
161 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_MAIN_WINDOW_TOPMOST),
162 &WindowSessionProperty::ReadActionUpdateMainWindowTopmost),
163 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_AVOID_AREA_OPTION),
164 &WindowSessionProperty::ReadActionUpdateAvoidAreaOption),
165 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_BACKGROUND_ALPHA),
166 &WindowSessionProperty::ReadActionUpdateBackgroundAlpha),
167 std::make_pair(static_cast<uint64_t>(WSPropertyChangeAction::ACTION_UPDATE_EXCLUSIVE_HIGHLIGHTED),
168 &WindowSessionProperty::ReadActionUpdateExclusivelyHighlighted),
169 };
170
WindowSessionProperty(const sptr<WindowSessionProperty> & property)171 WindowSessionProperty::WindowSessionProperty(const sptr<WindowSessionProperty>& property)
172 {
173 CopyFrom(property);
174 }
175
SetWindowName(const std::string & name)176 void WindowSessionProperty::SetWindowName(const std::string& name)
177 {
178 windowName_ = name;
179 }
180
SetSessionInfo(const SessionInfo & info)181 void WindowSessionProperty::SetSessionInfo(const SessionInfo& info)
182 {
183 sessionInfo_ = info;
184 }
185
SetWindowRect(const struct Rect & rect)186 void WindowSessionProperty::SetWindowRect(const struct Rect& rect)
187 {
188 std::lock_guard<std::mutex> lock(windowRectMutex_);
189 windowRect_ = rect;
190 }
191
SetRequestRect(const Rect & requestRect)192 void WindowSessionProperty::SetRequestRect(const Rect& requestRect)
193 {
194 std::lock_guard<std::mutex> lock(requestRectMutex_);
195 requestRect_ = requestRect;
196 }
197
SetRectAnimationConfig(const RectAnimationConfig & rectAnimationConfig)198 void WindowSessionProperty::SetRectAnimationConfig(const RectAnimationConfig& rectAnimationConfig)
199 {
200 std::lock_guard<std::mutex> lock(rectAnimationConfigMutex_);
201 rectAnimationConfig_ = rectAnimationConfig;
202 }
203
SetWindowType(WindowType type)204 void WindowSessionProperty::SetWindowType(WindowType type)
205 {
206 type_ = type;
207 }
208
SetFocusable(bool isFocusable)209 void WindowSessionProperty::SetFocusable(bool isFocusable)
210 {
211 focusable_ = isFocusable;
212 }
213
SetFocusableOnShow(bool isFocusableOnShow)214 void WindowSessionProperty::SetFocusableOnShow(bool isFocusableOnShow)
215 {
216 focusableOnShow_ = isFocusableOnShow;
217 }
218
SetTouchable(bool isTouchable)219 void WindowSessionProperty::SetTouchable(bool isTouchable)
220 {
221 touchable_ = isTouchable;
222 }
223
SetDragEnabled(bool dragEnabled)224 void WindowSessionProperty::SetDragEnabled(bool dragEnabled)
225 {
226 dragEnabled_ = dragEnabled;
227 }
228
SetHideNonSystemFloatingWindows(bool hide)229 void WindowSessionProperty::SetHideNonSystemFloatingWindows(bool hide)
230 {
231 hideNonSystemFloatingWindows_ = hide;
232 }
233
SetForceHide(bool hide)234 void WindowSessionProperty::SetForceHide(bool hide)
235 {
236 forceHide_ = hide;
237 }
238
SetRaiseEnabled(bool raiseEnabled)239 void WindowSessionProperty::SetRaiseEnabled(bool raiseEnabled)
240 {
241 raiseEnabled_ = raiseEnabled;
242 }
243
SetRequestedOrientation(Orientation orientation)244 void WindowSessionProperty::SetRequestedOrientation(Orientation orientation)
245 {
246 requestedOrientation_ = orientation;
247 }
248
SetDefaultRequestedOrientation(Orientation orientation)249 void WindowSessionProperty::SetDefaultRequestedOrientation(Orientation orientation)
250 {
251 defaultRequestedOrientation_ = orientation;
252 }
253
SetPrivacyMode(bool isPrivate)254 void WindowSessionProperty::SetPrivacyMode(bool isPrivate)
255 {
256 isPrivacyMode_ = isPrivate;
257 }
258
SetSystemPrivacyMode(bool isSystemPrivate)259 void WindowSessionProperty::SetSystemPrivacyMode(bool isSystemPrivate)
260 {
261 isSystemPrivacyMode_ = isSystemPrivate;
262 }
263
SetSnapshotSkip(bool isSkip)264 void WindowSessionProperty::SetSnapshotSkip(bool isSkip)
265 {
266 isSnapshotSkip_ = isSkip;
267 }
268
SetBrightness(float brightness)269 void WindowSessionProperty::SetBrightness(float brightness)
270 {
271 brightness_ = brightness;
272 }
273
SetSystemCalling(bool isSystemCalling)274 void WindowSessionProperty::SetSystemCalling(bool isSystemCalling)
275 {
276 isSystemCalling_ = isSystemCalling;
277 }
278
SetDisplayId(DisplayId displayId)279 void WindowSessionProperty::SetDisplayId(DisplayId displayId)
280 {
281 displayId_ = displayId;
282 }
283
SetFloatingWindowAppType(bool isAppType)284 void WindowSessionProperty::SetFloatingWindowAppType(bool isAppType)
285 {
286 isFloatingWindowAppType_ = isAppType;
287 }
288
GetWindowName() const289 const std::string& WindowSessionProperty::GetWindowName() const
290 {
291 return windowName_;
292 }
293
GetSessionInfo() const294 const SessionInfo& WindowSessionProperty::GetSessionInfo() const
295 {
296 return sessionInfo_;
297 }
298
EditSessionInfo()299 SessionInfo& WindowSessionProperty::EditSessionInfo()
300 {
301 return sessionInfo_;
302 }
303
GetWindowRect() const304 Rect WindowSessionProperty::GetWindowRect() const
305 {
306 std::lock_guard<std::mutex> lock(windowRectMutex_);
307 return windowRect_;
308 }
309
GetRequestRect() const310 Rect WindowSessionProperty::GetRequestRect() const
311 {
312 std::lock_guard<std::mutex> lock(requestRectMutex_);
313 return requestRect_;
314 }
315
GetRectAnimationConfig() const316 RectAnimationConfig WindowSessionProperty::GetRectAnimationConfig() const
317 {
318 std::lock_guard<std::mutex> lock(rectAnimationConfigMutex_);
319 return rectAnimationConfig_;
320 }
321
GetWindowType() const322 WindowType WindowSessionProperty::GetWindowType() const
323 {
324 return type_;
325 }
326
GetFocusable() const327 bool WindowSessionProperty::GetFocusable() const
328 {
329 return focusable_;
330 }
331
GetFocusableOnShow() const332 bool WindowSessionProperty::GetFocusableOnShow() const
333 {
334 return focusableOnShow_;
335 }
336
GetTouchable() const337 bool WindowSessionProperty::GetTouchable() const
338 {
339 return touchable_;
340 }
341
GetDragEnabled() const342 bool WindowSessionProperty::GetDragEnabled() const
343 {
344 return dragEnabled_;
345 }
346
GetHideNonSystemFloatingWindows() const347 bool WindowSessionProperty::GetHideNonSystemFloatingWindows() const
348 {
349 return hideNonSystemFloatingWindows_;
350 }
351
GetForceHide() const352 bool WindowSessionProperty::GetForceHide() const
353 {
354 return forceHide_;
355 }
356
GetRaiseEnabled() const357 bool WindowSessionProperty::GetRaiseEnabled() const
358 {
359 return raiseEnabled_;
360 }
361
GetRequestedOrientation() const362 Orientation WindowSessionProperty::GetRequestedOrientation() const
363 {
364 return requestedOrientation_;
365 }
366
GetDefaultRequestedOrientation() const367 Orientation WindowSessionProperty::GetDefaultRequestedOrientation() const
368 {
369 return defaultRequestedOrientation_;
370 }
371
GetPrivacyMode() const372 bool WindowSessionProperty::GetPrivacyMode() const
373 {
374 return isPrivacyMode_;
375 }
376
GetSystemPrivacyMode() const377 bool WindowSessionProperty::GetSystemPrivacyMode() const
378 {
379 return isSystemPrivacyMode_;
380 }
381
GetSnapshotSkip() const382 bool WindowSessionProperty::GetSnapshotSkip() const
383 {
384 return isSnapshotSkip_;
385 }
386
GetBrightness() const387 float WindowSessionProperty::GetBrightness() const
388 {
389 return brightness_;
390 }
391
GetSystemCalling() const392 bool WindowSessionProperty::GetSystemCalling() const
393 {
394 return isSystemCalling_;
395 }
396
GetDisplayId() const397 DisplayId WindowSessionProperty::GetDisplayId() const
398 {
399 return displayId_;
400 }
401
SetParentId(int32_t parentId)402 void WindowSessionProperty::SetParentId(int32_t parentId)
403 {
404 parentId_ = parentId;
405 }
406
GetParentId() const407 int32_t WindowSessionProperty::GetParentId() const
408 {
409 return parentId_;
410 }
411
SetWindowFlags(uint32_t flags)412 void WindowSessionProperty::SetWindowFlags(uint32_t flags)
413 {
414 flags_ = flags;
415 }
416
SetTopmost(bool topmost)417 void WindowSessionProperty::SetTopmost(bool topmost)
418 {
419 topmost_ = topmost;
420 }
421
IsTopmost() const422 bool WindowSessionProperty::IsTopmost() const
423 {
424 return topmost_;
425 }
426
SetAvoidAreaOption(uint32_t avoidAreaOption)427 void WindowSessionProperty::SetAvoidAreaOption(uint32_t avoidAreaOption)
428 {
429 avoidAreaOption_ = avoidAreaOption;
430 }
431
GetAvoidAreaOption() const432 uint32_t WindowSessionProperty::GetAvoidAreaOption() const
433 {
434 return avoidAreaOption_;
435 }
436
SetMainWindowTopmost(bool isTopmost)437 void WindowSessionProperty::SetMainWindowTopmost(bool isTopmost)
438 {
439 mainWindowTopmost_ = isTopmost;
440 }
441
IsMainWindowTopmost() const442 bool WindowSessionProperty::IsMainWindowTopmost() const
443 {
444 return mainWindowTopmost_;
445 }
446
SetWindowDelayRaiseEnabled(bool isEnabled)447 void WindowSessionProperty::SetWindowDelayRaiseEnabled(bool isEnabled)
448 {
449 isWindowDelayRaiseEnabled_ = isEnabled;
450 }
451
IsWindowDelayRaiseEnabled() const452 bool WindowSessionProperty::IsWindowDelayRaiseEnabled() const
453 {
454 return isWindowDelayRaiseEnabled_;
455 }
456
AddWindowFlag(WindowFlag flag)457 void WindowSessionProperty::AddWindowFlag(WindowFlag flag)
458 {
459 flags_ |= static_cast<uint32_t>(flag);
460 }
461
GetWindowFlags() const462 uint32_t WindowSessionProperty::GetWindowFlags() const
463 {
464 return flags_;
465 }
466
SetPersistentId(int32_t persistentId)467 void WindowSessionProperty::SetPersistentId(int32_t persistentId)
468 {
469 persistentId_ = persistentId;
470 }
471
GetPersistentId() const472 int32_t WindowSessionProperty::GetPersistentId() const
473 {
474 return persistentId_;
475 }
476
SetParentPersistentId(int32_t persistentId)477 void WindowSessionProperty::SetParentPersistentId(int32_t persistentId)
478 {
479 parentPersistentId_ = persistentId;
480 }
481
GetParentPersistentId() const482 int32_t WindowSessionProperty::GetParentPersistentId() const
483 {
484 return parentPersistentId_;
485 }
486
SetTurnScreenOn(bool turnScreenOn)487 void WindowSessionProperty::SetTurnScreenOn(bool turnScreenOn)
488 {
489 turnScreenOn_ = turnScreenOn;
490 }
491
IsTurnScreenOn() const492 bool WindowSessionProperty::IsTurnScreenOn() const
493 {
494 return turnScreenOn_;
495 }
496
SetKeepScreenOn(bool keepScreenOn)497 void WindowSessionProperty::SetKeepScreenOn(bool keepScreenOn)
498 {
499 keepScreenOn_ = keepScreenOn;
500 }
501
IsKeepScreenOn() const502 bool WindowSessionProperty::IsKeepScreenOn() const
503 {
504 return keepScreenOn_;
505 }
506
SetViewKeepScreenOn(bool keepScreenOn)507 void WindowSessionProperty::SetViewKeepScreenOn(bool keepScreenOn)
508 {
509 viewKeepScreenOn_ = keepScreenOn;
510 }
511
IsViewKeepScreenOn() const512 bool WindowSessionProperty::IsViewKeepScreenOn() const
513 {
514 return viewKeepScreenOn_;
515 }
516
SetAccessTokenId(uint32_t accessTokenId)517 void WindowSessionProperty::SetAccessTokenId(uint32_t accessTokenId)
518 {
519 accessTokenId_ = accessTokenId;
520 }
521
GetAccessTokenId() const522 uint32_t WindowSessionProperty::GetAccessTokenId() const
523 {
524 return accessTokenId_;
525 }
526
SetTokenState(bool hasToken)527 void WindowSessionProperty::SetTokenState(bool hasToken)
528 {
529 tokenState_ = hasToken;
530 }
531
GetTokenState() const532 bool WindowSessionProperty::GetTokenState() const
533 {
534 return tokenState_;
535 }
536
GetMaximizeMode() const537 MaximizeMode WindowSessionProperty::GetMaximizeMode() const
538 {
539 return maximizeMode_;
540 }
541
SetMaximizeMode(MaximizeMode mode)542 void WindowSessionProperty::SetMaximizeMode(MaximizeMode mode)
543 {
544 maximizeMode_ = mode;
545 }
546
SetSystemBarProperty(WindowType type,const SystemBarProperty & property)547 void WindowSessionProperty::SetSystemBarProperty(WindowType type, const SystemBarProperty& property)
548 {
549 if (type == WindowType::WINDOW_TYPE_STATUS_BAR ||
550 type == WindowType::WINDOW_TYPE_NAVIGATION_BAR ||
551 type == WindowType::WINDOW_TYPE_NAVIGATION_INDICATOR) {
552 sysBarPropMap_[type] = property;
553 }
554 }
555
GetSystemBarProperty() const556 std::unordered_map<WindowType, SystemBarProperty> WindowSessionProperty::GetSystemBarProperty() const
557 {
558 return sysBarPropMap_;
559 }
560
SetWindowLimits(const WindowLimits & windowLimits)561 void WindowSessionProperty::SetWindowLimits(const WindowLimits& windowLimits)
562 {
563 limits_ = windowLimits;
564 }
565
GetWindowLimits() const566 WindowLimits WindowSessionProperty::GetWindowLimits() const
567 {
568 return limits_;
569 }
570
SetWindowMode(WindowMode mode)571 void WindowSessionProperty::SetWindowMode(WindowMode mode)
572 {
573 windowMode_ = mode;
574 }
575
GetWindowMode() const576 WindowMode WindowSessionProperty::GetWindowMode() const
577 {
578 return windowMode_;
579 }
580
GetWindowState() const581 WindowState WindowSessionProperty::GetWindowState() const
582 {
583 return windowState_;
584 }
585
SetWindowState(WindowState state)586 void WindowSessionProperty::SetWindowState(WindowState state)
587 {
588 windowState_ = state;
589 }
590
SetKeyboardLayoutParams(const KeyboardLayoutParams & params)591 void WindowSessionProperty::SetKeyboardLayoutParams(const KeyboardLayoutParams& params)
592 {
593 keyboardLayoutParams_.gravity_ = params.gravity_;
594 keyboardLayoutParams_.landscapeAvoidHeight_ = params.landscapeAvoidHeight_;
595 keyboardLayoutParams_.portraitAvoidHeight_ = params.portraitAvoidHeight_;
596 keyboardLayoutParams_.LandscapeKeyboardRect_ = params.LandscapeKeyboardRect_;
597 keyboardLayoutParams_.PortraitKeyboardRect_ = params.PortraitKeyboardRect_;
598 keyboardLayoutParams_.LandscapePanelRect_ = params.LandscapePanelRect_;
599 keyboardLayoutParams_.PortraitPanelRect_ = params.PortraitPanelRect_;
600 }
601
GetKeyboardLayoutParams() const602 KeyboardLayoutParams WindowSessionProperty::GetKeyboardLayoutParams() const
603 {
604 return keyboardLayoutParams_;
605 }
606
SetDecorEnable(bool isDecorEnable)607 void WindowSessionProperty::SetDecorEnable(bool isDecorEnable)
608 {
609 isDecorEnable_ = isDecorEnable;
610 }
611
IsDecorEnable()612 bool WindowSessionProperty::IsDecorEnable()
613 {
614 return isDecorEnable_;
615 }
616
SetWindowModeSupportType(uint32_t windowModeSupportType)617 void WindowSessionProperty::SetWindowModeSupportType(uint32_t windowModeSupportType)
618 {
619 windowModeSupportType_ = windowModeSupportType;
620 }
621
GetWindowModeSupportType() const622 uint32_t WindowSessionProperty::GetWindowModeSupportType() const
623 {
624 return windowModeSupportType_;
625 }
626
SetSupportedWindowModes(const std::vector<AppExecFwk::SupportWindowMode> & supportedWindowModes)627 void WindowSessionProperty::SetSupportedWindowModes(
628 const std::vector<AppExecFwk::SupportWindowMode>& supportedWindowModes)
629 {
630 std::lock_guard<std::mutex> lock(supportWindowModesMutex_);
631 supportedWindowModes_ = supportedWindowModes;
632 }
633
GetSupportedWindowModes(std::vector<AppExecFwk::SupportWindowMode> & supportedWindowModes) const634 void WindowSessionProperty::GetSupportedWindowModes(
635 std::vector<AppExecFwk::SupportWindowMode>& supportedWindowModes) const
636 {
637 std::lock_guard<std::mutex> lock(supportWindowModesMutex_);
638 supportedWindowModes = supportedWindowModes_;
639 }
640
SetWindowSizeLimits(const WindowSizeLimits & windowSizeLimits)641 void WindowSessionProperty::SetWindowSizeLimits(const WindowSizeLimits& windowSizeLimits)
642 {
643 windowSizeLimits_ = windowSizeLimits;
644 }
645
GetWindowSizeLimits() const646 WindowSizeLimits WindowSessionProperty::GetWindowSizeLimits() const
647 {
648 return windowSizeLimits_;
649 }
650
SetAnimationFlag(uint32_t animationFlag)651 void WindowSessionProperty::SetAnimationFlag(uint32_t animationFlag)
652 {
653 animationFlag_ = animationFlag;
654 }
655
GetAnimationFlag() const656 uint32_t WindowSessionProperty::GetAnimationFlag() const
657 {
658 return animationFlag_;
659 }
660
IsFloatingWindowAppType() const661 bool WindowSessionProperty::IsFloatingWindowAppType() const
662 {
663 return isFloatingWindowAppType_;
664 }
665
setTouchHotAreasInner(const std::vector<Rect> & rects,std::vector<Rect> & touchHotAreas)666 void WindowSessionProperty::setTouchHotAreasInner(const std::vector<Rect>& rects, std::vector<Rect>& touchHotAreas)
667 {
668 if (GetPersistentId() != 0 && rects != touchHotAreas) {
669 std::ostringstream oss;
670 for (const auto& rect : rects) {
671 oss << "[" << rect.posX_ << "," << rect.posY_ << "," << rect.width_ << "," << rect.height_ << "]";
672 }
673 TLOGI(WmsLogTag::WMS_EVENT, "id:%{public}d hot:%{public}s", GetPersistentId(), oss.str().c_str());
674 }
675 touchHotAreas = rects;
676 }
677
SetTouchHotAreas(const std::vector<Rect> & rects)678 void WindowSessionProperty::SetTouchHotAreas(const std::vector<Rect>& rects)
679 {
680 {
681 std::lock_guard lock(touchHotAreasMutex_);
682 setTouchHotAreasInner(rects, touchHotAreas_);
683 }
684 if (touchHotAreasChangeCallback_) {
685 touchHotAreasChangeCallback_();
686 }
687 }
688
SetKeyboardTouchHotAreas(const KeyboardTouchHotAreas & keyboardTouchHotAreas)689 void WindowSessionProperty::SetKeyboardTouchHotAreas(const KeyboardTouchHotAreas& keyboardTouchHotAreas)
690 {
691 {
692 std::lock_guard lock(touchHotAreasMutex_);
693 setTouchHotAreasInner(
694 keyboardTouchHotAreas.landscapeKeyboardHotAreas_, keyboardTouchHotAreas_.landscapeKeyboardHotAreas_);
695 setTouchHotAreasInner(
696 keyboardTouchHotAreas.portraitKeyboardHotAreas_, keyboardTouchHotAreas_.portraitKeyboardHotAreas_);
697 setTouchHotAreasInner(
698 keyboardTouchHotAreas.landscapePanelHotAreas_, keyboardTouchHotAreas_.landscapePanelHotAreas_);
699 setTouchHotAreasInner(
700 keyboardTouchHotAreas.portraitPanelHotAreas_, keyboardTouchHotAreas_.portraitPanelHotAreas_);
701 }
702 if (touchHotAreasChangeCallback_) {
703 touchHotAreasChangeCallback_();
704 }
705 }
706
GetTouchHotAreas(std::vector<Rect> & rects) const707 void WindowSessionProperty::GetTouchHotAreas(std::vector<Rect>& rects) const
708 {
709 std::lock_guard lock(touchHotAreasMutex_);
710 rects = touchHotAreas_;
711 }
712
GetKeyboardTouchHotAreas() const713 KeyboardTouchHotAreas WindowSessionProperty::GetKeyboardTouchHotAreas() const
714 {
715 std::lock_guard lock(touchHotAreasMutex_);
716 return keyboardTouchHotAreas_;
717 }
718
KeepKeyboardOnFocus(bool keepKeyboardFlag)719 void WindowSessionProperty::KeepKeyboardOnFocus(bool keepKeyboardFlag)
720 {
721 keepKeyboardFlag_ = keepKeyboardFlag;
722 }
723
GetKeepKeyboardFlag() const724 bool WindowSessionProperty::GetKeepKeyboardFlag() const
725 {
726 return keepKeyboardFlag_;
727 }
728
SetCallingSessionId(uint32_t sessionId)729 void WindowSessionProperty::SetCallingSessionId(uint32_t sessionId)
730 {
731 callingSessionId_ = sessionId;
732 }
733
GetCallingSessionId() const734 uint32_t WindowSessionProperty::GetCallingSessionId() const
735 {
736 return callingSessionId_;
737 }
738
SetPiPTemplateInfo(const PiPTemplateInfo & pipTemplateInfo)739 void WindowSessionProperty::SetPiPTemplateInfo(const PiPTemplateInfo& pipTemplateInfo)
740 {
741 pipTemplateInfo_ = pipTemplateInfo;
742 }
743
GetPiPTemplateInfo() const744 PiPTemplateInfo WindowSessionProperty::GetPiPTemplateInfo() const
745 {
746 return pipTemplateInfo_;
747 }
748
SetIsNeedUpdateWindowMode(bool isNeedUpdateWindowMode)749 void WindowSessionProperty::SetIsNeedUpdateWindowMode(bool isNeedUpdateWindowMode)
750 {
751 isNeedUpdateWindowMode_ = isNeedUpdateWindowMode;
752 }
753
GetIsNeedUpdateWindowMode() const754 bool WindowSessionProperty::GetIsNeedUpdateWindowMode() const
755 {
756 return isNeedUpdateWindowMode_;
757 }
758
SetWindowCornerRadius(float cornerRadius)759 void WindowSessionProperty::SetWindowCornerRadius(float cornerRadius)
760 {
761 std::lock_guard<std::mutex> lock(cornerRadiusMutex_);
762 cornerRadius_ = cornerRadius;
763 }
764
GetWindowCornerRadius() const765 float WindowSessionProperty::GetWindowCornerRadius() const
766 {
767 std::lock_guard<std::mutex> lock(cornerRadiusMutex_);
768 return cornerRadius_;
769 }
770
MarshallingWindowLimits(Parcel & parcel) const771 bool WindowSessionProperty::MarshallingWindowLimits(Parcel& parcel) const
772 {
773 if (parcel.WriteUint32(limits_.maxWidth_) &&
774 parcel.WriteUint32(limits_.maxHeight_) && parcel.WriteUint32(limits_.minWidth_) &&
775 parcel.WriteUint32(limits_.minHeight_) && parcel.WriteFloat(limits_.maxRatio_) &&
776 parcel.WriteFloat(limits_.minRatio_) && parcel.WriteFloat(limits_.vpRatio_)) {
777 return true;
778 }
779 return false;
780 }
781
UnmarshallingWindowLimits(Parcel & parcel,WindowSessionProperty * property)782 void WindowSessionProperty::UnmarshallingWindowLimits(Parcel& parcel, WindowSessionProperty* property)
783 {
784 WindowLimits windowLimits = { parcel.ReadUint32(), parcel.ReadUint32(), parcel.ReadUint32(),
785 parcel.ReadUint32(), parcel.ReadFloat(), parcel.ReadFloat(), parcel.ReadFloat() };
786 property->SetWindowLimits(windowLimits);
787 }
788
MarshallingSystemBarMap(Parcel & parcel) const789 bool WindowSessionProperty::MarshallingSystemBarMap(Parcel& parcel) const
790 {
791 auto size = sysBarPropMap_.size();
792 uint32_t maxSystemBarNumber = 3;
793 if (size > maxSystemBarNumber) { // max systembar number
794 return false;
795 }
796
797 if (!parcel.WriteUint32(static_cast<uint32_t>(size))) {
798 return false;
799 }
800 for (auto it : sysBarPropMap_) {
801 if (!parcel.WriteUint32(static_cast<uint32_t>(it.first))) {
802 return false;
803 }
804 if (!(parcel.WriteBool(it.second.enable_) && parcel.WriteUint32(it.second.backgroundColor_) &&
805 parcel.WriteUint32(it.second.contentColor_) && parcel.WriteBool(it.second.enableAnimation_) &&
806 parcel.WriteUint32(static_cast<uint32_t>(it.second.settingFlag_)))) {
807 return false;
808 }
809 }
810 return true;
811 }
812
UnMarshallingSystemBarMap(Parcel & parcel,WindowSessionProperty * property)813 void WindowSessionProperty::UnMarshallingSystemBarMap(Parcel& parcel, WindowSessionProperty* property)
814 {
815 uint32_t size = parcel.ReadUint32();
816 uint32_t maxSystemBarNumber = 3;
817 if (size > maxSystemBarNumber) { // max systembar number
818 return;
819 }
820
821 for (uint32_t i = 0; i < size; i++) {
822 WindowType type = static_cast<WindowType>(parcel.ReadUint32());
823 SystemBarProperty prop = { parcel.ReadBool(), parcel.ReadUint32(), parcel.ReadUint32(), parcel.ReadBool(),
824 static_cast<SystemBarSettingFlag>(parcel.ReadUint32()) };
825 property->SetSystemBarProperty(type, prop);
826 }
827 }
828
MarshallingTouchHotAreasInner(const std::vector<Rect> & touchHotAreas,Parcel & parcel) const829 bool WindowSessionProperty::MarshallingTouchHotAreasInner(const std::vector<Rect>& touchHotAreas, Parcel& parcel) const
830 {
831 auto size = touchHotAreas.size();
832 if (size > TOUCH_HOT_AREA_MAX_NUM) {
833 return false;
834 }
835 if (!parcel.WriteUint32(static_cast<uint32_t>(size))) {
836 return false;
837 }
838 for (const auto& rect : touchHotAreas) {
839 if (!parcel.WriteInt32(rect.posX_) || !parcel.WriteInt32(rect.posY_) ||
840 !parcel.WriteUint32(rect.width_) || !parcel.WriteUint32(rect.height_)) {
841 return false;
842 }
843 }
844 return true;
845 }
846
MarshallingTouchHotAreas(Parcel & parcel) const847 bool WindowSessionProperty::MarshallingTouchHotAreas(Parcel& parcel) const
848 {
849 return MarshallingTouchHotAreasInner(touchHotAreas_, parcel);
850 }
851
MarshallingKeyboardTouchHotAreas(Parcel & parcel) const852 bool WindowSessionProperty::MarshallingKeyboardTouchHotAreas(Parcel& parcel) const
853 {
854 return MarshallingTouchHotAreasInner(keyboardTouchHotAreas_.landscapeKeyboardHotAreas_, parcel) &&
855 MarshallingTouchHotAreasInner(keyboardTouchHotAreas_.portraitKeyboardHotAreas_, parcel) &&
856 MarshallingTouchHotAreasInner(keyboardTouchHotAreas_.landscapePanelHotAreas_, parcel) &&
857 MarshallingTouchHotAreasInner(keyboardTouchHotAreas_.portraitPanelHotAreas_, parcel);
858 }
859
UnmarshallingTouchHotAreasInner(Parcel & parcel,std::vector<Rect> & touchHotAreas)860 void WindowSessionProperty::UnmarshallingTouchHotAreasInner(Parcel& parcel, std::vector<Rect>& touchHotAreas)
861 {
862 uint32_t size = parcel.ReadUint32();
863 if (size > TOUCH_HOT_AREA_MAX_NUM) {
864 return;
865 }
866 for (uint32_t i = 0; i < size; i++) {
867 touchHotAreas.emplace_back(
868 Rect{ parcel.ReadInt32(), parcel.ReadInt32(), parcel.ReadUint32(), parcel.ReadUint32() });
869 }
870 }
871
UnmarshallingTouchHotAreas(Parcel & parcel,WindowSessionProperty * property)872 void WindowSessionProperty::UnmarshallingTouchHotAreas(Parcel& parcel, WindowSessionProperty* property)
873 {
874 UnmarshallingTouchHotAreasInner(parcel, property->touchHotAreas_);
875 }
876
UnmarshallingKeyboardTouchHotAreas(Parcel & parcel,WindowSessionProperty * property)877 void WindowSessionProperty::UnmarshallingKeyboardTouchHotAreas(Parcel& parcel, WindowSessionProperty* property)
878 {
879 UnmarshallingTouchHotAreasInner(parcel, property->keyboardTouchHotAreas_.landscapeKeyboardHotAreas_);
880 UnmarshallingTouchHotAreasInner(parcel, property->keyboardTouchHotAreas_.portraitKeyboardHotAreas_);
881 UnmarshallingTouchHotAreasInner(parcel, property->keyboardTouchHotAreas_.landscapePanelHotAreas_);
882 UnmarshallingTouchHotAreasInner(parcel, property->keyboardTouchHotAreas_.portraitPanelHotAreas_);
883 }
884
MarshallingPiPTemplateInfo(Parcel & parcel) const885 bool WindowSessionProperty::MarshallingPiPTemplateInfo(Parcel& parcel) const
886 {
887 if (!WindowHelper::IsPipWindow(type_)) {
888 return true;
889 }
890 if (!parcel.WriteUint32(pipTemplateInfo_.pipTemplateType)) {
891 return false;
892 }
893 if (!parcel.WriteUint32(pipTemplateInfo_.priority)) {
894 return false;
895 }
896 auto size = pipTemplateInfo_.controlGroup.size();
897 if (size > MAX_SIZE_PIP_CONTROL_GROUP) {
898 return false;
899 }
900 if (!parcel.WriteUint32(static_cast<uint32_t>(size))) {
901 return false;
902 }
903 for (uint32_t i = 0; i < size; i++) {
904 if (!parcel.WriteUint32(pipTemplateInfo_.controlGroup[i])) {
905 return false;
906 }
907 }
908 auto controlStatusSize = pipTemplateInfo_.pipControlStatusInfoList.size();
909 if (controlStatusSize > MAX_SIZE_PIP_CONTROL) {
910 return false;
911 }
912 if (!parcel.WriteUint32(static_cast<uint32_t>(controlStatusSize))) {
913 return false;
914 }
915 for (uint32_t i = 0; i < controlStatusSize; i++) {
916 if (!parcel.WriteUint32(static_cast<uint32_t>(pipTemplateInfo_.pipControlStatusInfoList[i].controlType)) ||
917 !parcel.WriteInt32(static_cast<int32_t>(pipTemplateInfo_.pipControlStatusInfoList[i].status))) {
918 return false;
919 }
920 }
921 auto controlEnableSize = pipTemplateInfo_.pipControlEnableInfoList.size();
922 if (controlEnableSize > MAX_SIZE_PIP_CONTROL) {
923 return false;
924 }
925 if (!parcel.WriteUint32(static_cast<uint32_t>(controlEnableSize))) {
926 return false;
927 }
928 for (uint32_t i = 0; i < controlEnableSize; i++) {
929 if (!parcel.WriteUint32(static_cast<uint32_t>(pipTemplateInfo_.pipControlEnableInfoList[i].controlType)) ||
930 !parcel.WriteInt32(static_cast<int32_t>(pipTemplateInfo_.pipControlEnableInfoList[i].enabled))) {
931 return false;
932 }
933 }
934 return true;
935 }
936
UnmarshallingPiPTemplateInfo(Parcel & parcel,WindowSessionProperty * property)937 void WindowSessionProperty::UnmarshallingPiPTemplateInfo(Parcel& parcel, WindowSessionProperty* property)
938 {
939 if (!WindowHelper::IsPipWindow(property->GetWindowType())) {
940 return;
941 }
942 PiPTemplateInfo pipTemplateInfo;
943 pipTemplateInfo.pipTemplateType = parcel.ReadUint32();
944 pipTemplateInfo.priority = parcel.ReadUint32();
945 auto size = parcel.ReadUint32();
946 if (size > MAX_SIZE_PIP_CONTROL_GROUP) {
947 return;
948 }
949 for (uint32_t i = 0; i < size; i++) {
950 uint32_t controlGroupId = 0;
951 if (!parcel.ReadUint32(controlGroupId)) {
952 return;
953 }
954 pipTemplateInfo.controlGroup.push_back(controlGroupId);
955 }
956 auto controlStatusSize = parcel.ReadUint32();
957 if (controlStatusSize > MAX_SIZE_PIP_CONTROL) {
958 return;
959 }
960 for (uint32_t i = 0; i < controlStatusSize; i++) {
961 PiPControlStatusInfo pipControlStatusInfo;
962 uint32_t controlType = 0;
963 int32_t status = 0;
964 if (!parcel.ReadUint32(controlType) || !parcel.ReadInt32(status)) {
965 return;
966 }
967 pipControlStatusInfo.controlType = static_cast<PiPControlType>(controlType);
968 pipControlStatusInfo.status = static_cast<PiPControlStatus>(status);
969 pipTemplateInfo.pipControlStatusInfoList.push_back(pipControlStatusInfo);
970 }
971 auto controlEnableSize = parcel.ReadUint32();
972 if (controlEnableSize > MAX_SIZE_PIP_CONTROL) {
973 return;
974 }
975 for (uint32_t i = 0; i < controlEnableSize; i++) {
976 PiPControlEnableInfo pipControlEnableInfo;
977 uint32_t controlType = 0;
978 int32_t enabled = 0;
979 if (!parcel.ReadUint32(controlType) || !parcel.ReadInt32(enabled)) {
980 return;
981 }
982 pipControlEnableInfo.controlType = static_cast<PiPControlType>(controlType);
983 pipControlEnableInfo.enabled = static_cast<PiPControlStatus>(enabled);
984 pipTemplateInfo.pipControlEnableInfoList.push_back(pipControlEnableInfo);
985 }
986 property->SetPiPTemplateInfo(pipTemplateInfo);
987 }
988
MarshallingWindowMask(Parcel & parcel) const989 bool WindowSessionProperty::MarshallingWindowMask(Parcel& parcel) const
990 {
991 if (!parcel.WriteBool(isShaped_)) {
992 return false;
993 }
994 if (isShaped_) {
995 if (!windowMask_->Marshalling(parcel)) {
996 return false;
997 }
998 }
999 return true;
1000 }
1001
UnmarshallingWindowMask(Parcel & parcel,WindowSessionProperty * property)1002 void WindowSessionProperty::UnmarshallingWindowMask(Parcel& parcel, WindowSessionProperty* property)
1003 {
1004 bool isShaped = parcel.ReadBool();
1005 property->SetIsShaped(isShaped);
1006 if (isShaped) {
1007 Media::PixelMap* windowMask = Media::PixelMap::Unmarshalling(parcel);
1008 if (windowMask != nullptr) {
1009 property->SetWindowMask(std::shared_ptr<Media::PixelMap>(windowMask));
1010 }
1011 }
1012 }
1013
MarshallingMainWindowTopmost(Parcel & parcel) const1014 bool WindowSessionProperty::MarshallingMainWindowTopmost(Parcel& parcel) const
1015 {
1016 if (!parcel.WriteBool(mainWindowTopmost_) || !parcel.WriteUint32(accessTokenId_)) {
1017 return false;
1018 }
1019 return true;
1020 }
1021
UnmarshallingMainWindowTopmost(Parcel & parcel,WindowSessionProperty * property)1022 void WindowSessionProperty::UnmarshallingMainWindowTopmost(Parcel& parcel, WindowSessionProperty* property)
1023 {
1024 property->SetMainWindowTopmost(parcel.ReadBool());
1025 property->SetAccessTokenId(parcel.ReadUint32());
1026 }
1027
MarshallingSessionInfo(Parcel & parcel) const1028 bool WindowSessionProperty::MarshallingSessionInfo(Parcel& parcel) const
1029 {
1030 if (!parcel.WriteString(sessionInfo_.bundleName_) || !parcel.WriteString(sessionInfo_.moduleName_) ||
1031 !parcel.WriteString(sessionInfo_.abilityName_) ||
1032 !parcel.WriteInt32(static_cast<int32_t>(sessionInfo_.continueState))) {
1033 return false;
1034 }
1035 const auto& want = sessionInfo_.want;
1036 bool hasWant = want != nullptr;
1037 if (!parcel.WriteBool(hasWant)) {
1038 return false;
1039 }
1040 if (hasWant && !parcel.WriteParcelable(want.get())) {
1041 return false;
1042 }
1043 return true;
1044 }
1045
UnmarshallingSessionInfo(Parcel & parcel,WindowSessionProperty * property)1046 bool WindowSessionProperty::UnmarshallingSessionInfo(Parcel& parcel, WindowSessionProperty* property)
1047 {
1048 std::string bundleName;
1049 std::string moduleName;
1050 std::string abilityName;
1051 if (!parcel.ReadString(bundleName) || !parcel.ReadString(moduleName) || !parcel.ReadString(abilityName)) {
1052 TLOGE(WmsLogTag::DEFAULT, "Failed to read String!");
1053 return false;
1054 }
1055 SessionInfo info = { bundleName, moduleName, abilityName };
1056 int32_t continueState;
1057 if (!parcel.ReadInt32(continueState)) {
1058 TLOGE(WmsLogTag::DEFAULT, "Failed to read continueState!");
1059 return false;
1060 }
1061 info.continueState = static_cast<ContinueState>(continueState);
1062 bool hasWant;
1063 if (!parcel.ReadBool(hasWant)) {
1064 TLOGE(WmsLogTag::DEFAULT, "Failed to read hasWant!");
1065 return false;
1066 }
1067 if (hasWant) {
1068 std::shared_ptr<AAFwk::Want> want(parcel.ReadParcelable<AAFwk::Want>());
1069 if (want == nullptr) {
1070 TLOGE(WmsLogTag::DEFAULT, "Failed to read want!");
1071 return false;
1072 }
1073 info.want = want;
1074 }
1075 property->SetSessionInfo(info);
1076 return true;
1077 }
1078
SetCompatibleModeInPc(bool compatibleModeInPc)1079 void WindowSessionProperty::SetCompatibleModeInPc(bool compatibleModeInPc)
1080 {
1081 compatibleModeInPc_ = compatibleModeInPc;
1082 }
1083
GetCompatibleModeInPc() const1084 bool WindowSessionProperty::GetCompatibleModeInPc() const
1085 {
1086 return compatibleModeInPc_;
1087 }
1088
SetCompatibleWindowSizeInPc(int32_t portraitWidth,int32_t portraitHeight,int32_t landscapeWidth,int32_t landscapeHeight)1089 void WindowSessionProperty::SetCompatibleWindowSizeInPc(int32_t portraitWidth,
1090 int32_t portraitHeight, int32_t landscapeWidth, int32_t landscapeHeight)
1091 {
1092 compatibleInPcPortraitWidth_ = portraitWidth;
1093 compatibleInPcPortraitHeight_ = portraitHeight;
1094 compatibleInPcLandscapeWidth_ = landscapeWidth;
1095 compatibleInPcLandscapeHeight_ = landscapeHeight;
1096 }
1097
GetCompatibleInPcPortraitWidth() const1098 int32_t WindowSessionProperty::GetCompatibleInPcPortraitWidth() const
1099 {
1100 return compatibleInPcPortraitWidth_;
1101 }
1102
GetCompatibleInPcPortraitHeight() const1103 int32_t WindowSessionProperty::GetCompatibleInPcPortraitHeight() const
1104 {
1105 return compatibleInPcPortraitHeight_;
1106 }
1107
GetCompatibleInPcLandscapeWidth() const1108 int32_t WindowSessionProperty::GetCompatibleInPcLandscapeWidth() const
1109 {
1110 return compatibleInPcLandscapeWidth_;
1111 }
1112
GetCompatibleInPcLandscapeHeight() const1113 int32_t WindowSessionProperty::GetCompatibleInPcLandscapeHeight() const
1114 {
1115 return compatibleInPcLandscapeHeight_;
1116 }
1117
SetIsAppSupportPhoneInPc(bool isSupportPhone)1118 void WindowSessionProperty::SetIsAppSupportPhoneInPc(bool isSupportPhone)
1119 {
1120 isAppSupportPhoneInPc_ = isSupportPhone;
1121 }
1122
GetIsAppSupportPhoneInPc() const1123 bool WindowSessionProperty::GetIsAppSupportPhoneInPc() const
1124 {
1125 return isAppSupportPhoneInPc_;
1126 }
1127
SetIsPcAppInPad(bool isPcAppInPad)1128 void WindowSessionProperty::SetIsPcAppInPad(bool isPcAppInPad)
1129 {
1130 isPcAppInPad_ = isPcAppInPad;
1131 }
1132
GetIsPcAppInPad() const1133 bool WindowSessionProperty::GetIsPcAppInPad() const
1134 {
1135 return isPcAppInPad_;
1136 }
1137
SetCompatibleModeEnableInPad(bool enable)1138 void WindowSessionProperty::SetCompatibleModeEnableInPad(bool enable)
1139 {
1140 std::lock_guard<std::mutex> lock(compatibleModeMutex_);
1141 compatibleModeEnableInPad_ = enable;
1142 }
1143
GetCompatibleModeEnableInPad() const1144 bool WindowSessionProperty::GetCompatibleModeEnableInPad() const
1145 {
1146 std::lock_guard<std::mutex> lock(compatibleModeMutex_);
1147 return compatibleModeEnableInPad_;
1148 }
1149
SetSubWindowLevel(uint32_t subWindowLevel)1150 void WindowSessionProperty::SetSubWindowLevel(uint32_t subWindowLevel)
1151 {
1152 subWindowLevel_ = subWindowLevel;
1153 }
1154
GetSubWindowLevel() const1155 uint32_t WindowSessionProperty::GetSubWindowLevel() const
1156 {
1157 return subWindowLevel_;
1158 }
1159
SetSubWindowZLevel(int32_t zLevel)1160 void WindowSessionProperty::SetSubWindowZLevel(int32_t zLevel)
1161 {
1162 zLevel_ = zLevel;
1163 }
1164
GetSubWindowZLevel() const1165 int32_t WindowSessionProperty::GetSubWindowZLevel() const
1166 {
1167 return zLevel_;
1168 }
1169
SetIsSupportDragInPcCompatibleMode(bool isSupportDragInPcCompatibleMode)1170 void WindowSessionProperty::SetIsSupportDragInPcCompatibleMode(bool isSupportDragInPcCompatibleMode)
1171 {
1172 isSupportDragInPcCompatibleMode_ = isSupportDragInPcCompatibleMode;
1173 }
1174
GetIsSupportDragInPcCompatibleMode() const1175 bool WindowSessionProperty::GetIsSupportDragInPcCompatibleMode() const
1176 {
1177 return isSupportDragInPcCompatibleMode_;
1178 }
1179
SetIsAtomicService(bool isAtomicService)1180 void WindowSessionProperty::SetIsAtomicService(bool isAtomicService)
1181 {
1182 std::lock_guard lock(atomicServiceMutex_);
1183 isAtomicService_ = isAtomicService;
1184 }
1185
GetIsAtomicService() const1186 bool WindowSessionProperty::GetIsAtomicService() const
1187 {
1188 std::lock_guard lock(atomicServiceMutex_);
1189 return isAtomicService_;
1190 }
1191
SetIsSaveBySpecifiedFlag(bool isSaveBySpecifiedFlag)1192 void WindowSessionProperty::SetIsSaveBySpecifiedFlag(bool isSaveBySpecifiedFlag)
1193 {
1194 isSaveBySpecifiedFlag_ = isSaveBySpecifiedFlag;
1195 }
1196
GetIsSaveBySpecifiedFlag() const1197 bool WindowSessionProperty::GetIsSaveBySpecifiedFlag() const
1198 {
1199 return isSaveBySpecifiedFlag_;
1200 }
1201
Marshalling(Parcel & parcel) const1202 bool WindowSessionProperty::Marshalling(Parcel& parcel) const
1203 {
1204 return parcel.WriteString(windowName_) && parcel.WriteInt32(windowRect_.posX_) &&
1205 parcel.WriteInt32(windowRect_.posY_) && parcel.WriteUint32(windowRect_.width_) &&
1206 parcel.WriteUint32(windowRect_.height_) && parcel.WriteInt32(requestRect_.posX_) &&
1207 parcel.WriteInt32(requestRect_.posY_) && parcel.WriteUint32(requestRect_.width_) &&
1208 parcel.WriteUint32(requestRect_.height_) &&
1209 parcel.WriteUint32(rectAnimationConfig_.duration) && parcel.WriteFloat(rectAnimationConfig_.x1) &&
1210 parcel.WriteFloat(rectAnimationConfig_.y1) && parcel.WriteFloat(rectAnimationConfig_.x2) &&
1211 parcel.WriteFloat(rectAnimationConfig_.y2) &&
1212 parcel.WriteUint32(static_cast<uint32_t>(type_)) &&
1213 parcel.WriteBool(focusable_) && parcel.WriteBool(focusableOnShow_) &&
1214 parcel.WriteBool(touchable_) && parcel.WriteBool(tokenState_) &&
1215 parcel.WriteBool(turnScreenOn_) && parcel.WriteBool(keepScreenOn_) && parcel.WriteBool(viewKeepScreenOn_) &&
1216 parcel.WriteBool(isPrivacyMode_) && parcel.WriteBool(isSystemPrivacyMode_) &&
1217 parcel.WriteBool(isSnapshotSkip_) &&
1218 parcel.WriteUint64(displayId_) && parcel.WriteInt32(persistentId_) &&
1219 MarshallingSessionInfo(parcel) &&
1220 parcel.WriteInt32(parentPersistentId_) &&
1221 parcel.WriteUint32(accessTokenId_) && parcel.WriteUint32(static_cast<uint32_t>(maximizeMode_)) &&
1222 parcel.WriteUint32(static_cast<uint32_t>(requestedOrientation_)) &&
1223 parcel.WriteUint32(static_cast<uint32_t>(windowMode_)) &&
1224 parcel.WriteUint32(flags_) && parcel.WriteBool(raiseEnabled_) &&
1225 parcel.WriteBool(topmost_) && parcel.WriteBool(mainWindowTopmost_) &&
1226 parcel.WriteInt32(zLevel_) &&
1227 parcel.WriteBool(isDecorEnable_) && parcel.WriteBool(dragEnabled_) &&
1228 parcel.WriteBool(hideNonSystemFloatingWindows_) && parcel.WriteBool(forceHide_) &&
1229 MarshallingWindowLimits(parcel) && parcel.WriteFloat(brightness_) &&
1230 MarshallingSystemBarMap(parcel) && parcel.WriteUint32(animationFlag_) &&
1231 MarshallingPiPTemplateInfo(parcel) &&
1232 parcel.WriteBool(isFloatingWindowAppType_) && MarshallingTouchHotAreas(parcel) &&
1233 parcel.WriteBool(isSystemCalling_) &&
1234 parcel.WriteDouble(textFieldPositionY_) && parcel.WriteDouble(textFieldHeight_) &&
1235 parcel.WriteUint32(static_cast<uint32_t>(windowState_)) &&
1236 parcel.WriteBool(isNeedUpdateWindowMode_) && parcel.WriteUint32(callingSessionId_) &&
1237 parcel.WriteBool(isLayoutFullScreen_) &&
1238 parcel.WriteInt32(realParentId_) &&
1239 parcel.WriteBool(isUIExtFirstSubWindow_) &&
1240 parcel.WriteBool(isUIExtensionAbilityProcess_) &&
1241 parcel.WriteUint32(static_cast<uint32_t>(uiExtensionUsage_)) &&
1242 parcel.WriteUint32(static_cast<uint32_t>(parentWindowType_)) &&
1243 MarshallingWindowMask(parcel) &&
1244 parcel.WriteParcelable(&keyboardLayoutParams_) && parcel.WriteBool(compatibleModeInPc_) &&
1245 parcel.WriteInt32(compatibleInPcPortraitWidth_) && parcel.WriteInt32(compatibleInPcPortraitHeight_) &&
1246 parcel.WriteInt32(compatibleInPcLandscapeWidth_) && parcel.WriteInt32(compatibleInPcLandscapeHeight_) &&
1247 parcel.WriteBool(isAppSupportPhoneInPc_) && parcel.WriteBool(isSupportDragInPcCompatibleMode_) &&
1248 parcel.WriteBool(isPcAppInPad_) && parcel.WriteBool(compatibleModeEnableInPad_) &&
1249 parcel.WriteString(appInstanceKey_) && parcel.WriteBool(isSystemKeyboard_) &&
1250 parcel.WriteUint32(avoidAreaOption_) && parcel.WriteBool(isWindowDelayRaiseEnabled_) &&
1251 parcel.WriteUint8(backgroundAlpha_) && parcel.WriteUint32(static_cast<uint32_t>(keyboardViewMode_)) &&
1252 parcel.WriteFloat(cornerRadius_) && parcel.WriteBool(isExclusivelyHighlighted_) &&
1253 parcel.WriteBool(isAtomicService_) && parcel.WriteUint32(apiVersion_) &&
1254 parcel.WriteBool(isFullScreenWaterfallMode_) &&
1255 parcel.WriteBool(isSaveBySpecifiedFlag_);
1256 }
1257
Unmarshalling(Parcel & parcel)1258 WindowSessionProperty* WindowSessionProperty::Unmarshalling(Parcel& parcel)
1259 {
1260 WindowSessionProperty* property = new(std::nothrow) WindowSessionProperty();
1261 if (property == nullptr) {
1262 return nullptr;
1263 }
1264 property->SetWindowName(parcel.ReadString());
1265 Rect rect = { parcel.ReadInt32(), parcel.ReadInt32(), parcel.ReadUint32(), parcel.ReadUint32() };
1266 property->SetWindowRect(rect);
1267 Rect reqRect = { parcel.ReadInt32(), parcel.ReadInt32(), parcel.ReadUint32(), parcel.ReadUint32() };
1268 property->SetRequestRect(reqRect);
1269 RectAnimationConfig rectAnimationConfig = { parcel.ReadUint32(), parcel.ReadFloat(),
1270 parcel.ReadFloat(), parcel.ReadFloat(), parcel.ReadFloat() };
1271 property->SetRectAnimationConfig(rectAnimationConfig);
1272 property->SetWindowType(static_cast<WindowType>(parcel.ReadUint32()));
1273 property->SetFocusable(parcel.ReadBool());
1274 property->SetFocusableOnShow(parcel.ReadBool());
1275 property->SetTouchable(parcel.ReadBool());
1276 property->SetTokenState(parcel.ReadBool());
1277 property->SetTurnScreenOn(parcel.ReadBool());
1278 property->SetKeepScreenOn(parcel.ReadBool());
1279 property->SetViewKeepScreenOn(parcel.ReadBool());
1280 property->SetPrivacyMode(parcel.ReadBool());
1281 property->SetSystemPrivacyMode(parcel.ReadBool());
1282 property->SetSnapshotSkip(parcel.ReadBool());
1283 property->SetDisplayId(parcel.ReadUint64());
1284 property->SetPersistentId(parcel.ReadInt32());
1285 if (!UnmarshallingSessionInfo(parcel, property)) {
1286 delete property;
1287 return nullptr;
1288 }
1289 property->SetParentPersistentId(parcel.ReadInt32());
1290 property->SetAccessTokenId(parcel.ReadUint32());
1291 property->SetMaximizeMode(static_cast<MaximizeMode>(parcel.ReadUint32()));
1292 property->SetRequestedOrientation(static_cast<Orientation>(parcel.ReadUint32()));
1293 property->SetWindowMode(static_cast<WindowMode>(parcel.ReadUint32()));
1294 property->SetWindowFlags(parcel.ReadUint32());
1295 property->SetRaiseEnabled(parcel.ReadBool());
1296 property->SetTopmost(parcel.ReadBool());
1297 property->SetMainWindowTopmost(parcel.ReadBool());
1298 property->SetSubWindowZLevel(parcel.ReadInt32());
1299 property->SetDecorEnable(parcel.ReadBool());
1300 property->SetDragEnabled(parcel.ReadBool());
1301 property->SetHideNonSystemFloatingWindows(parcel.ReadBool());
1302 property->SetForceHide(parcel.ReadBool());
1303 UnmarshallingWindowLimits(parcel, property);
1304 property->SetBrightness(parcel.ReadFloat());
1305 UnMarshallingSystemBarMap(parcel, property);
1306 property->SetAnimationFlag(parcel.ReadUint32());
1307 UnmarshallingPiPTemplateInfo(parcel, property);
1308 property->SetFloatingWindowAppType(parcel.ReadBool());
1309 UnmarshallingTouchHotAreas(parcel, property);
1310 property->SetSystemCalling(parcel.ReadBool());
1311 property->SetTextFieldPositionY(parcel.ReadDouble());
1312 property->SetTextFieldHeight(parcel.ReadDouble());
1313 property->SetWindowState(static_cast<WindowState>(parcel.ReadUint32()));
1314 property->SetIsNeedUpdateWindowMode(parcel.ReadBool());
1315 property->SetCallingSessionId(parcel.ReadUint32());
1316 property->SetIsLayoutFullScreen(parcel.ReadBool());
1317 property->SetRealParentId(parcel.ReadInt32());
1318 property->SetIsUIExtFirstSubWindow(parcel.ReadBool());
1319 property->SetIsUIExtensionAbilityProcess(parcel.ReadBool());
1320 property->SetUIExtensionUsage(static_cast<UIExtensionUsage>(parcel.ReadUint32()));
1321 property->SetParentWindowType(static_cast<WindowType>(parcel.ReadUint32()));
1322 UnmarshallingWindowMask(parcel, property);
1323 sptr<KeyboardLayoutParams> keyboardLayoutParams = parcel.ReadParcelable<KeyboardLayoutParams>();
1324 if (keyboardLayoutParams == nullptr) {
1325 delete property;
1326 return nullptr;
1327 }
1328 property->SetKeyboardLayoutParams(*keyboardLayoutParams);
1329 property->SetCompatibleModeInPc(parcel.ReadBool());
1330 property->SetCompatibleWindowSizeInPc(parcel.ReadInt32(), parcel.ReadInt32(),
1331 parcel.ReadInt32(), parcel.ReadInt32());
1332 property->SetIsAppSupportPhoneInPc(parcel.ReadBool());
1333 property->SetIsSupportDragInPcCompatibleMode(parcel.ReadBool());
1334 property->SetIsPcAppInPad(parcel.ReadBool());
1335 property->SetCompatibleModeEnableInPad(parcel.ReadBool());
1336 property->SetAppInstanceKey(parcel.ReadString());
1337 property->SetIsSystemKeyboard(parcel.ReadBool());
1338 property->SetAvoidAreaOption(parcel.ReadUint32());
1339 property->SetWindowDelayRaiseEnabled(parcel.ReadBool());
1340 property->SetBackgroundAlpha(parcel.ReadUint8());
1341 property->SetKeyboardViewMode(static_cast<KeyboardViewMode>(parcel.ReadUint32()));
1342 property->SetWindowCornerRadius(parcel.ReadFloat());
1343 property->SetExclusivelyHighlighted(parcel.ReadBool());
1344 property->SetIsAtomicService(parcel.ReadBool());
1345 property->SetApiVersion(parcel.ReadUint32());
1346 property->SetIsFullScreenWaterfallMode(parcel.ReadBool());
1347 property->SetIsSaveBySpecifiedFlag(parcel.ReadBool());
1348 return property;
1349 }
1350
CopyFrom(const sptr<WindowSessionProperty> & property)1351 void WindowSessionProperty::CopyFrom(const sptr<WindowSessionProperty>& property)
1352 {
1353 windowName_ = property->windowName_;
1354 sessionInfo_ = property->sessionInfo_;
1355 requestRect_ = property->requestRect_;
1356 rectAnimationConfig_ = property->rectAnimationConfig_;
1357 windowRect_ = property->windowRect_;
1358 type_ = property->type_;
1359 focusable_ = property->focusable_;
1360 focusableOnShow_ = property->focusableOnShow_;
1361 touchable_ = property->touchable_;
1362 dragEnabled_ = property->dragEnabled_;
1363 raiseEnabled_ = property->raiseEnabled_;
1364 isSystemCalling_ = property->isSystemCalling_;
1365 tokenState_ = property->tokenState_;
1366 turnScreenOn_ = property->turnScreenOn_;
1367 keepScreenOn_ = property->keepScreenOn_;
1368 viewKeepScreenOn_ = property->viewKeepScreenOn_;
1369 topmost_ = property->topmost_;
1370 mainWindowTopmost_ = property->mainWindowTopmost_;
1371 zLevel_ = property->zLevel_;
1372 requestedOrientation_ = property->requestedOrientation_;
1373 defaultRequestedOrientation_ = property->defaultRequestedOrientation_;
1374 isPrivacyMode_ = property->isPrivacyMode_;
1375 isSystemPrivacyMode_ = property->isSystemPrivacyMode_;
1376 isSnapshotSkip_ = property->isSnapshotSkip_;
1377 brightness_ = property->brightness_;
1378 displayId_ = property->displayId_;
1379 parentId_ = property->parentId_;
1380 flags_ = property->flags_;
1381 persistentId_ = property->persistentId_;
1382 parentPersistentId_ = property->parentPersistentId_;
1383 accessTokenId_ = property->accessTokenId_;
1384 maximizeMode_ = property->maximizeMode_;
1385 windowMode_ = property->windowMode_;
1386 windowState_ = property->windowState_;
1387 limits_ = property->limits_;
1388 userLimits_ = property->userLimits_;
1389 configLimitsVP_ = property->configLimitsVP_;
1390 lastVpr_ = property->lastVpr_;
1391 pipTemplateInfo_ = property->pipTemplateInfo_;
1392 keyboardLayoutParams_ = property->keyboardLayoutParams_;
1393 windowModeSupportType_ = property->windowModeSupportType_;
1394 sysBarPropMap_ = property->sysBarPropMap_;
1395 isDecorEnable_ = property->isDecorEnable_;
1396 animationFlag_ = property->animationFlag_;
1397 trans_ = property->trans_;
1398 isFloatingWindowAppType_ = property->isFloatingWindowAppType_;
1399 touchHotAreas_ = property->touchHotAreas_;
1400 keyboardTouchHotAreas_ = property->keyboardTouchHotAreas_;
1401 hideNonSystemFloatingWindows_ = property->hideNonSystemFloatingWindows_;
1402 forceHide_ = property->forceHide_;
1403 keepKeyboardFlag_ = property->keepKeyboardFlag_;
1404 callingSessionId_ = property->callingSessionId_;
1405 textFieldPositionY_ = property->textFieldPositionY_;
1406 textFieldHeight_ = property->textFieldHeight_;
1407 isNeedUpdateWindowMode_ = property->isNeedUpdateWindowMode_;
1408 touchHotAreasChangeCallback_ = property->touchHotAreasChangeCallback_;
1409 isLayoutFullScreen_ = property->isLayoutFullScreen_;
1410 isShaped_ = property->isShaped_;
1411 fullScreenStart_ = property->fullScreenStart_;
1412 windowMask_ = property->windowMask_;
1413 collaboratorType_ = property->collaboratorType_;
1414 compatibleModeInPc_ = property->compatibleModeInPc_;
1415 compatibleInPcPortraitWidth_ = property->compatibleInPcPortraitWidth_;
1416 compatibleInPcPortraitHeight_ = property->compatibleInPcPortraitHeight_;
1417 compatibleInPcLandscapeWidth_ = property->compatibleInPcLandscapeWidth_;
1418 compatibleInPcLandscapeHeight_ = property->compatibleInPcLandscapeHeight_;
1419 isAppSupportPhoneInPc_ = property->isAppSupportPhoneInPc_;
1420 isSupportDragInPcCompatibleMode_ = property->isSupportDragInPcCompatibleMode_;
1421 isPcAppInPad_ = property->isPcAppInPad_;
1422 compatibleModeEnableInPad_ = property->compatibleModeEnableInPad_;
1423 subWindowLevel_ = property->subWindowLevel_;
1424 realParentId_ = property->realParentId_;
1425 uiExtensionUsage_ = property->uiExtensionUsage_;
1426 isUIExtFirstSubWindow_ = property->isUIExtFirstSubWindow_;
1427 isUIExtensionAbilityProcess_ = property->isUIExtensionAbilityProcess_;
1428 isUIExtAnySubWindow_ = property->isUIExtAnySubWindow_;
1429 parentWindowType_ = property->parentWindowType_;
1430 appInstanceKey_ = property->appInstanceKey_;
1431 isSystemKeyboard_ = property->isSystemKeyboard_;
1432 avoidAreaOption_ = property->avoidAreaOption_;
1433 isWindowDelayRaiseEnabled_ = property->isWindowDelayRaiseEnabled_;
1434 backgroundAlpha_ = property->backgroundAlpha_;
1435 keyboardViewMode_ = property->keyboardViewMode_;
1436 isExclusivelyHighlighted_ = property->isExclusivelyHighlighted_;
1437 cornerRadius_ = property->cornerRadius_;
1438 isAtomicService_ = property->isAtomicService_;
1439 apiVersion_ = property->apiVersion_;
1440 isFullScreenWaterfallMode_ = property->isFullScreenWaterfallMode_;
1441 isSaveBySpecifiedFlag_ = property->isSaveBySpecifiedFlag_;
1442 }
1443
Write(Parcel & parcel,WSPropertyChangeAction action)1444 bool WindowSessionProperty::Write(Parcel& parcel, WSPropertyChangeAction action)
1445 {
1446 const auto funcIter = writeFuncMap_.find(static_cast<uint64_t>(action));
1447 if (funcIter == writeFuncMap_.end()) {
1448 TLOGE(WmsLogTag::DEFAULT, "Failed to find func handler!");
1449 return false;
1450 }
1451 bool ret = parcel.WriteUint32(static_cast<uint32_t>(persistentId_));
1452 return ret && (this->*(funcIter->second))(parcel);
1453 }
1454
WriteActionUpdateTurnScreenOn(Parcel & parcel)1455 bool WindowSessionProperty::WriteActionUpdateTurnScreenOn(Parcel& parcel)
1456 {
1457 return parcel.WriteBool(turnScreenOn_);
1458 }
1459
WriteActionUpdateKeepScreenOn(Parcel & parcel)1460 bool WindowSessionProperty::WriteActionUpdateKeepScreenOn(Parcel& parcel)
1461 {
1462 return parcel.WriteBool(keepScreenOn_);
1463 }
1464
WriteActionUpdateViewKeepScreenOn(Parcel & parcel)1465 bool WindowSessionProperty::WriteActionUpdateViewKeepScreenOn(Parcel& parcel)
1466 {
1467 return parcel.WriteBool(viewKeepScreenOn_);
1468 }
1469
WriteActionUpdateFocusable(Parcel & parcel)1470 bool WindowSessionProperty::WriteActionUpdateFocusable(Parcel& parcel)
1471 {
1472 return parcel.WriteBool(focusable_);
1473 }
1474
WriteActionUpdateTouchable(Parcel & parcel)1475 bool WindowSessionProperty::WriteActionUpdateTouchable(Parcel& parcel)
1476 {
1477 return parcel.WriteBool(touchable_);
1478 }
1479
WriteActionUpdateSetBrightness(Parcel & parcel)1480 bool WindowSessionProperty::WriteActionUpdateSetBrightness(Parcel& parcel)
1481 {
1482 return parcel.WriteFloat(brightness_);
1483 }
1484
WriteActionUpdateOrientation(Parcel & parcel)1485 bool WindowSessionProperty::WriteActionUpdateOrientation(Parcel& parcel)
1486 {
1487 return parcel.WriteUint32(static_cast<uint32_t>(requestedOrientation_));
1488 }
1489
WriteActionUpdatePrivacyMode(Parcel & parcel)1490 bool WindowSessionProperty::WriteActionUpdatePrivacyMode(Parcel& parcel)
1491 {
1492 return parcel.WriteBool(isPrivacyMode_) && parcel.WriteBool(isSystemPrivacyMode_);
1493 }
1494
WriteActionUpdateSnapshotSkip(Parcel & parcel)1495 bool WindowSessionProperty::WriteActionUpdateSnapshotSkip(Parcel& parcel)
1496 {
1497 return parcel.WriteBool(isSnapshotSkip_);
1498 }
1499
WriteActionUpdateMaximizeState(Parcel & parcel)1500 bool WindowSessionProperty::WriteActionUpdateMaximizeState(Parcel& parcel)
1501 {
1502 return parcel.WriteUint32(static_cast<uint32_t>(maximizeMode_)) &&
1503 parcel.WriteBool(isLayoutFullScreen_);
1504 }
1505
WriteActionUpdateSystemBar(Parcel & parcel)1506 bool WindowSessionProperty::WriteActionUpdateSystemBar(Parcel& parcel)
1507 {
1508 return MarshallingSystemBarMap(parcel);
1509 }
1510
WriteActionUpdateFlags(Parcel & parcel)1511 bool WindowSessionProperty::WriteActionUpdateFlags(Parcel& parcel)
1512 {
1513 return parcel.WriteUint32(flags_);
1514 }
1515
WriteActionUpdateMode(Parcel & parcel)1516 bool WindowSessionProperty::WriteActionUpdateMode(Parcel& parcel)
1517 {
1518 return parcel.WriteUint32(static_cast<uint32_t>(windowMode_));
1519 }
1520
WriteActionUpdateAnimationFlag(Parcel & parcel)1521 bool WindowSessionProperty::WriteActionUpdateAnimationFlag(Parcel& parcel)
1522 {
1523 return parcel.WriteUint32(animationFlag_);
1524 }
1525
WriteActionUpdateTouchHotArea(Parcel & parcel)1526 bool WindowSessionProperty::WriteActionUpdateTouchHotArea(Parcel& parcel)
1527 {
1528 return MarshallingTouchHotAreas(parcel);
1529 }
1530
WriteActionUpdateKeyboardTouchHotArea(Parcel & parcel)1531 bool WindowSessionProperty::WriteActionUpdateKeyboardTouchHotArea(Parcel& parcel)
1532 {
1533 return MarshallingKeyboardTouchHotAreas(parcel);
1534 }
1535
WriteActionUpdateDecorEnable(Parcel & parcel)1536 bool WindowSessionProperty::WriteActionUpdateDecorEnable(Parcel& parcel)
1537 {
1538 return parcel.WriteBool(isDecorEnable_);
1539 }
1540
WriteActionUpdateWindowLimits(Parcel & parcel)1541 bool WindowSessionProperty::WriteActionUpdateWindowLimits(Parcel& parcel)
1542 {
1543 return MarshallingWindowLimits(parcel);
1544 }
1545
WriteActionUpdateDragenabled(Parcel & parcel)1546 bool WindowSessionProperty::WriteActionUpdateDragenabled(Parcel& parcel)
1547 {
1548 return parcel.WriteBool(dragEnabled_);
1549 }
1550
WriteActionUpdateRaiseenabled(Parcel & parcel)1551 bool WindowSessionProperty::WriteActionUpdateRaiseenabled(Parcel& parcel)
1552 {
1553 return parcel.WriteBool(raiseEnabled_);
1554 }
1555
WriteActionUpdateHideNonSystemFloatingWindows(Parcel & parcel)1556 bool WindowSessionProperty::WriteActionUpdateHideNonSystemFloatingWindows(Parcel& parcel)
1557 {
1558 return parcel.WriteBool(hideNonSystemFloatingWindows_) &&
1559 parcel.WriteBool(isFloatingWindowAppType_) && parcel.WriteBool(forceHide_);
1560 }
1561
WriteActionUpdateTextfieldAvoidInfo(Parcel & parcel)1562 bool WindowSessionProperty::WriteActionUpdateTextfieldAvoidInfo(Parcel& parcel)
1563 {
1564 return parcel.WriteDouble(textFieldPositionY_) && parcel.WriteDouble(textFieldHeight_);
1565 }
1566
WriteActionUpdateWindowMask(Parcel & parcel)1567 bool WindowSessionProperty::WriteActionUpdateWindowMask(Parcel& parcel)
1568 {
1569 return MarshallingWindowMask(parcel);
1570 }
1571
WriteActionUpdateTopmost(Parcel & parcel)1572 bool WindowSessionProperty::WriteActionUpdateTopmost(Parcel& parcel)
1573 {
1574 return parcel.WriteBool(topmost_);
1575 }
1576
WriteActionUpdateMainWindowTopmost(Parcel & parcel)1577 bool WindowSessionProperty::WriteActionUpdateMainWindowTopmost(Parcel& parcel)
1578 {
1579 return MarshallingMainWindowTopmost(parcel);
1580 }
1581
WriteActionUpdateSubWindowZLevel(Parcel & parcel)1582 bool WindowSessionProperty::WriteActionUpdateSubWindowZLevel(Parcel& parcel)
1583 {
1584 return parcel.WriteInt32(zLevel_);
1585 }
1586
WriteActionUpdateWindowModeSupportType(Parcel & parcel)1587 bool WindowSessionProperty::WriteActionUpdateWindowModeSupportType(Parcel& parcel)
1588 {
1589 return parcel.WriteUint32(windowModeSupportType_);
1590 }
1591
WriteActionUpdateAvoidAreaOption(Parcel & parcel)1592 bool WindowSessionProperty::WriteActionUpdateAvoidAreaOption(Parcel& parcel)
1593 {
1594 return parcel.WriteUint32(avoidAreaOption_);
1595 }
1596
WriteActionUpdateBackgroundAlpha(Parcel & parcel)1597 bool WindowSessionProperty::WriteActionUpdateBackgroundAlpha(Parcel& parcel)
1598 {
1599 return parcel.WriteUint8(backgroundAlpha_);
1600 }
1601
WriteActionUpdateExclusivelyHighlighted(Parcel & parcel)1602 bool WindowSessionProperty::WriteActionUpdateExclusivelyHighlighted(Parcel& parcel)
1603 {
1604 return parcel.WriteBool(isExclusivelyHighlighted_);
1605 }
1606
Read(Parcel & parcel,WSPropertyChangeAction action)1607 void WindowSessionProperty::Read(Parcel& parcel, WSPropertyChangeAction action)
1608 {
1609 const auto funcIter = readFuncMap_.find(static_cast<uint64_t>(action));
1610 if (funcIter == readFuncMap_.end()) {
1611 TLOGE(WmsLogTag::DEFAULT, "Failed to find func handler!");
1612 return;
1613 }
1614 SetPersistentId(parcel.ReadUint32());
1615 (this->*(funcIter->second))(parcel);
1616 }
1617
ReadActionUpdateTurnScreenOn(Parcel & parcel)1618 void WindowSessionProperty::ReadActionUpdateTurnScreenOn(Parcel& parcel)
1619 {
1620 SetTurnScreenOn(parcel.ReadBool());
1621 }
1622
ReadActionUpdateKeepScreenOn(Parcel & parcel)1623 void WindowSessionProperty::ReadActionUpdateKeepScreenOn(Parcel& parcel)
1624 {
1625 SetKeepScreenOn(parcel.ReadBool());
1626 }
1627
ReadActionUpdateViewKeepScreenOn(Parcel & parcel)1628 void WindowSessionProperty::ReadActionUpdateViewKeepScreenOn(Parcel& parcel)
1629 {
1630 SetViewKeepScreenOn(parcel.ReadBool());
1631 }
1632
ReadActionUpdateFocusable(Parcel & parcel)1633 void WindowSessionProperty::ReadActionUpdateFocusable(Parcel& parcel)
1634 {
1635 SetFocusable(parcel.ReadBool());
1636 }
1637
ReadActionUpdateTouchable(Parcel & parcel)1638 void WindowSessionProperty::ReadActionUpdateTouchable(Parcel& parcel)
1639 {
1640 SetTouchable(parcel.ReadBool());
1641 }
1642
ReadActionUpdateSetBrightness(Parcel & parcel)1643 void WindowSessionProperty::ReadActionUpdateSetBrightness(Parcel& parcel)
1644 {
1645 SetBrightness(parcel.ReadFloat());
1646 }
1647
ReadActionUpdateOrientation(Parcel & parcel)1648 void WindowSessionProperty::ReadActionUpdateOrientation(Parcel& parcel)
1649 {
1650 SetRequestedOrientation(static_cast<Orientation>(parcel.ReadUint32()));
1651 }
1652
ReadActionUpdatePrivacyMode(Parcel & parcel)1653 void WindowSessionProperty::ReadActionUpdatePrivacyMode(Parcel& parcel)
1654 {
1655 SetPrivacyMode(parcel.ReadBool());
1656 SetSystemPrivacyMode(parcel.ReadBool());
1657 }
1658
ReadActionUpdateSnapshotSkip(Parcel & parcel)1659 void WindowSessionProperty::ReadActionUpdateSnapshotSkip(Parcel& parcel)
1660 {
1661 SetSnapshotSkip(parcel.ReadBool());
1662 }
1663
ReadActionUpdateMaximizeState(Parcel & parcel)1664 void WindowSessionProperty::ReadActionUpdateMaximizeState(Parcel& parcel)
1665 {
1666 SetMaximizeMode(static_cast<MaximizeMode>(parcel.ReadUint32()));
1667 SetIsLayoutFullScreen(parcel.ReadBool());
1668 }
1669
ReadActionUpdateSystemBar(Parcel & parcel)1670 void WindowSessionProperty::ReadActionUpdateSystemBar(Parcel& parcel)
1671 {
1672 UnMarshallingSystemBarMap(parcel, this);
1673 }
1674
ReadActionUpdateFlags(Parcel & parcel)1675 void WindowSessionProperty::ReadActionUpdateFlags(Parcel& parcel)
1676 {
1677 SetWindowFlags(parcel.ReadUint32());
1678 }
1679
ReadActionUpdateMode(Parcel & parcel)1680 void WindowSessionProperty::ReadActionUpdateMode(Parcel& parcel)
1681 {
1682 SetWindowMode(static_cast<WindowMode>(parcel.ReadUint32()));
1683 }
1684
ReadActionUpdateAnimationFlag(Parcel & parcel)1685 void WindowSessionProperty::ReadActionUpdateAnimationFlag(Parcel& parcel)
1686 {
1687 SetAnimationFlag(parcel.ReadUint32());
1688 }
1689
ReadActionUpdateTouchHotArea(Parcel & parcel)1690 void WindowSessionProperty::ReadActionUpdateTouchHotArea(Parcel& parcel)
1691 {
1692 UnmarshallingTouchHotAreas(parcel, this);
1693 }
1694
ReadActionUpdateKeyboardTouchHotArea(Parcel & parcel)1695 void WindowSessionProperty::ReadActionUpdateKeyboardTouchHotArea(Parcel& parcel)
1696 {
1697 UnmarshallingKeyboardTouchHotAreas(parcel, this);
1698 }
1699
ReadActionUpdateDecorEnable(Parcel & parcel)1700 void WindowSessionProperty::ReadActionUpdateDecorEnable(Parcel& parcel)
1701 {
1702 SetDecorEnable(parcel.ReadBool());
1703 }
1704
ReadActionUpdateWindowLimits(Parcel & parcel)1705 void WindowSessionProperty::ReadActionUpdateWindowLimits(Parcel& parcel)
1706 {
1707 UnmarshallingWindowLimits(parcel, this);
1708 }
1709
ReadActionUpdateDragenabled(Parcel & parcel)1710 void WindowSessionProperty::ReadActionUpdateDragenabled(Parcel& parcel)
1711 {
1712 SetDragEnabled(parcel.ReadBool());
1713 }
1714
ReadActionUpdateRaiseenabled(Parcel & parcel)1715 void WindowSessionProperty::ReadActionUpdateRaiseenabled(Parcel& parcel)
1716 {
1717 SetRaiseEnabled(parcel.ReadBool());
1718 }
1719
ReadActionUpdateHideNonSystemFloatingWindows(Parcel & parcel)1720 void WindowSessionProperty::ReadActionUpdateHideNonSystemFloatingWindows(Parcel& parcel)
1721 {
1722 SetHideNonSystemFloatingWindows(parcel.ReadBool());
1723 SetFloatingWindowAppType(parcel.ReadBool());
1724 SetForceHide(parcel.ReadBool());
1725 }
1726
ReadActionUpdateTextfieldAvoidInfo(Parcel & parcel)1727 void WindowSessionProperty::ReadActionUpdateTextfieldAvoidInfo(Parcel& parcel)
1728 {
1729 SetTextFieldPositionY(parcel.ReadDouble());
1730 SetTextFieldHeight(parcel.ReadDouble());
1731 }
1732
ReadActionUpdateWindowMask(Parcel & parcel)1733 void WindowSessionProperty::ReadActionUpdateWindowMask(Parcel& parcel)
1734 {
1735 UnmarshallingWindowMask(parcel, this);
1736 }
1737
ReadActionUpdateTopmost(Parcel & parcel)1738 void WindowSessionProperty::ReadActionUpdateTopmost(Parcel& parcel)
1739 {
1740 SetTopmost(parcel.ReadBool());
1741 }
1742
ReadActionUpdateMainWindowTopmost(Parcel & parcel)1743 void WindowSessionProperty::ReadActionUpdateMainWindowTopmost(Parcel& parcel)
1744 {
1745 UnmarshallingMainWindowTopmost(parcel, this);
1746 }
1747
ReadActionUpdateSubWindowZLevel(Parcel & parcel)1748 void WindowSessionProperty::ReadActionUpdateSubWindowZLevel(Parcel& parcel)
1749 {
1750 SetSubWindowZLevel(parcel.ReadInt32());
1751 }
1752
ReadActionUpdateWindowModeSupportType(Parcel & parcel)1753 void WindowSessionProperty::ReadActionUpdateWindowModeSupportType(Parcel& parcel)
1754 {
1755 SetWindowModeSupportType(parcel.ReadUint32());
1756 }
1757
ReadActionUpdateAvoidAreaOption(Parcel & parcel)1758 void WindowSessionProperty::ReadActionUpdateAvoidAreaOption(Parcel& parcel)
1759 {
1760 SetAvoidAreaOption(parcel.ReadUint32());
1761 }
1762
ReadActionUpdateBackgroundAlpha(Parcel & parcel)1763 void WindowSessionProperty::ReadActionUpdateBackgroundAlpha(Parcel& parcel)
1764 {
1765 SetBackgroundAlpha(parcel.ReadUint8());
1766 }
1767
ReadActionUpdateExclusivelyHighlighted(Parcel & parcel)1768 void WindowSessionProperty::ReadActionUpdateExclusivelyHighlighted(Parcel& parcel)
1769 {
1770 SetExclusivelyHighlighted(parcel.ReadBool());
1771 }
1772
SetTransform(const Transform & trans)1773 void WindowSessionProperty::SetTransform(const Transform& trans)
1774 {
1775 trans_ = trans;
1776 }
1777
GetTransform() const1778 const Transform& WindowSessionProperty::GetTransform() const
1779 {
1780 return trans_;
1781 }
1782
SetTextFieldPositionY(double textFieldPositionY)1783 void WindowSessionProperty::SetTextFieldPositionY(double textFieldPositionY)
1784 {
1785 textFieldPositionY_ = textFieldPositionY;
1786 }
1787
SetTextFieldHeight(double textFieldHeight)1788 void WindowSessionProperty::SetTextFieldHeight(double textFieldHeight)
1789 {
1790 textFieldHeight_ = textFieldHeight;
1791 }
1792
GetTextFieldPositionY() const1793 double WindowSessionProperty::GetTextFieldPositionY() const
1794 {
1795 return textFieldPositionY_;
1796 }
1797
GetTextFieldHeight() const1798 double WindowSessionProperty::GetTextFieldHeight() const
1799 {
1800 return textFieldHeight_;
1801 }
1802
SetSessionPropertyChangeCallback(std::function<void ()> && callback)1803 void WindowSessionProperty::SetSessionPropertyChangeCallback(std::function<void()>&& callback)
1804 {
1805 touchHotAreasChangeCallback_ = std::move(callback);
1806 }
1807
IsLayoutFullScreen() const1808 bool WindowSessionProperty::IsLayoutFullScreen() const
1809 {
1810 return isLayoutFullScreen_;
1811 }
1812
SetIsLayoutFullScreen(bool isLayoutFullScreen)1813 void WindowSessionProperty::SetIsLayoutFullScreen(bool isLayoutFullScreen)
1814 {
1815 isLayoutFullScreen_ = isLayoutFullScreen;
1816 }
1817
SetRealParentId(int32_t realParentId)1818 void WindowSessionProperty::SetRealParentId(int32_t realParentId)
1819 {
1820 realParentId_ = realParentId;
1821 }
1822
GetRealParentId() const1823 int32_t WindowSessionProperty::GetRealParentId() const
1824 {
1825 return realParentId_;
1826 }
1827
SetIsUIExtFirstSubWindow(bool isUIExtFirstSubWindow)1828 void WindowSessionProperty::SetIsUIExtFirstSubWindow(bool isUIExtFirstSubWindow)
1829 {
1830 isUIExtFirstSubWindow_ = isUIExtFirstSubWindow;
1831 }
1832
GetIsUIExtFirstSubWindow() const1833 bool WindowSessionProperty::GetIsUIExtFirstSubWindow() const
1834 {
1835 return isUIExtFirstSubWindow_;
1836 }
1837
SetIsUIExtensionAbilityProcess(bool isUIExtensionAbilityProcess)1838 void WindowSessionProperty::SetIsUIExtensionAbilityProcess(bool isUIExtensionAbilityProcess)
1839 {
1840 isUIExtensionAbilityProcess_ = isUIExtensionAbilityProcess;
1841 }
1842
GetIsUIExtensionAbilityProcess() const1843 bool WindowSessionProperty::GetIsUIExtensionAbilityProcess() const
1844 {
1845 return isUIExtensionAbilityProcess_;
1846 }
1847
SetIsUIExtAnySubWindow(bool isUIExtAnySubWindow)1848 void WindowSessionProperty::SetIsUIExtAnySubWindow(bool isUIExtAnySubWindow)
1849 {
1850 isUIExtAnySubWindow_ = isUIExtAnySubWindow;
1851 }
1852
GetIsUIExtAnySubWindow() const1853 bool WindowSessionProperty::GetIsUIExtAnySubWindow() const
1854 {
1855 return isUIExtAnySubWindow_;
1856 }
1857
SetUIExtensionUsage(UIExtensionUsage uiExtensionUsage)1858 void WindowSessionProperty::SetUIExtensionUsage(UIExtensionUsage uiExtensionUsage)
1859 {
1860 uiExtensionUsage_ = uiExtensionUsage;
1861 }
1862
GetUIExtensionUsage() const1863 UIExtensionUsage WindowSessionProperty::GetUIExtensionUsage() const
1864 {
1865 return uiExtensionUsage_;
1866 }
1867
SetParentWindowType(WindowType parentWindowType)1868 void WindowSessionProperty::SetParentWindowType(WindowType parentWindowType)
1869 {
1870 parentWindowType_= parentWindowType;
1871 }
1872
GetParentWindowType() const1873 WindowType WindowSessionProperty::GetParentWindowType() const
1874 {
1875 return parentWindowType_;
1876 }
1877
SetWindowMask(const std::shared_ptr<Media::PixelMap> & windowMask)1878 void WindowSessionProperty::SetWindowMask(const std::shared_ptr<Media::PixelMap>& windowMask)
1879 {
1880 windowMask_ = windowMask;
1881 }
1882
GetWindowMask() const1883 std::shared_ptr<Media::PixelMap> WindowSessionProperty::GetWindowMask() const
1884 {
1885 return windowMask_;
1886 }
1887
SetIsShaped(bool isShaped)1888 void WindowSessionProperty::SetIsShaped(bool isShaped)
1889 {
1890 isShaped_ = isShaped;
1891 }
1892
GetIsShaped() const1893 bool WindowSessionProperty::GetIsShaped() const
1894 {
1895 return isShaped_;
1896 }
1897
GetCollaboratorType() const1898 int32_t WindowSessionProperty::GetCollaboratorType() const
1899 {
1900 return collaboratorType_;
1901 }
1902
SetCollaboratorType(int32_t collaboratorType)1903 void WindowSessionProperty::SetCollaboratorType(int32_t collaboratorType)
1904 {
1905 collaboratorType_ = collaboratorType;
1906 }
1907
SetUserWindowLimits(const WindowLimits & windowUserLimits)1908 void WindowSessionProperty::SetUserWindowLimits(const WindowLimits& windowUserLimits)
1909 {
1910 userLimits_ = windowUserLimits;
1911 }
1912
GetUserWindowLimits() const1913 WindowLimits WindowSessionProperty::GetUserWindowLimits() const
1914 {
1915 return userLimits_;
1916 }
1917
SetConfigWindowLimitsVP(const WindowLimits & windowConfigLimitsVP)1918 void WindowSessionProperty::SetConfigWindowLimitsVP(const WindowLimits& windowConfigLimitsVP)
1919 {
1920 configLimitsVP_ = windowConfigLimitsVP;
1921 }
1922
GetConfigWindowLimitsVP() const1923 WindowLimits WindowSessionProperty::GetConfigWindowLimitsVP() const
1924 {
1925 return configLimitsVP_;
1926 }
1927
SetLastLimitsVpr(float vpr)1928 void WindowSessionProperty::SetLastLimitsVpr(float vpr)
1929 {
1930 lastVpr_ = vpr;
1931 }
1932
GetLastLimitsVpr() const1933 float WindowSessionProperty::GetLastLimitsVpr() const
1934 {
1935 return lastVpr_;
1936 }
1937
GetFullScreenStart() const1938 bool WindowSessionProperty::GetFullScreenStart() const
1939 {
1940 return fullScreenStart_;
1941 }
1942
SetFullScreenStart(bool fullScreenStart)1943 void WindowSessionProperty::SetFullScreenStart(bool fullScreenStart)
1944 {
1945 fullScreenStart_ = fullScreenStart;
1946 }
1947
SetAppInstanceKey(const std::string & appInstanceKey)1948 void WindowSessionProperty::SetAppInstanceKey(const std::string& appInstanceKey)
1949 {
1950 appInstanceKey_ = appInstanceKey;
1951 }
1952
GetAppInstanceKey() const1953 std::string WindowSessionProperty::GetAppInstanceKey() const
1954 {
1955 return appInstanceKey_;
1956 }
1957
SetIsSystemKeyboard(bool isSystemKeyboard)1958 void WindowSessionProperty::SetIsSystemKeyboard(bool isSystemKeyboard)
1959 {
1960 isSystemKeyboard_ = isSystemKeyboard;
1961 }
1962
IsSystemKeyboard() const1963 bool WindowSessionProperty::IsSystemKeyboard() const
1964 {
1965 return isSystemKeyboard_;
1966 }
1967
SetKeyboardViewMode(KeyboardViewMode mode)1968 void WindowSessionProperty::SetKeyboardViewMode(KeyboardViewMode mode)
1969 {
1970 keyboardViewMode_ = mode;
1971 }
1972
GetKeyboardViewMode() const1973 KeyboardViewMode WindowSessionProperty::GetKeyboardViewMode() const
1974 {
1975 return keyboardViewMode_;
1976 }
1977
GetBackgroundAlpha() const1978 uint8_t WindowSessionProperty::GetBackgroundAlpha() const
1979 {
1980 return backgroundAlpha_;
1981 }
1982
SetBackgroundAlpha(uint8_t alpha)1983 void WindowSessionProperty::SetBackgroundAlpha(uint8_t alpha)
1984 {
1985 backgroundAlpha_ = alpha;
1986 }
1987
SetExclusivelyHighlighted(bool isExclusivelyHighlighted)1988 void WindowSessionProperty::SetExclusivelyHighlighted(bool isExclusivelyHighlighted)
1989 {
1990 isExclusivelyHighlighted_ = isExclusivelyHighlighted;
1991 }
1992
GetExclusivelyHighlighted() const1993 bool WindowSessionProperty::GetExclusivelyHighlighted() const
1994 {
1995 return isExclusivelyHighlighted_;
1996 }
1997
SetConstrainedModal(bool isConstrained)1998 void WindowSessionProperty::SetConstrainedModal(bool isConstrained)
1999 {
2000 isConstrainedModal_ = isConstrained;
2001 }
2002
IsConstrainedModal() const2003 bool WindowSessionProperty::IsConstrainedModal() const
2004 {
2005 return isConstrainedModal_;
2006 }
2007
SetApiVersion(uint32_t version)2008 void WindowSessionProperty::SetApiVersion(uint32_t version)
2009 {
2010 apiVersion_ = version;
2011 }
2012
GetApiVersion() const2013 uint32_t WindowSessionProperty::GetApiVersion() const
2014 {
2015 return apiVersion_;
2016 }
2017
SetIsFullScreenWaterfallMode(bool isFullScreenWaterfallMode)2018 void WindowSessionProperty::SetIsFullScreenWaterfallMode(bool isFullScreenWaterfallMode)
2019 {
2020 isFullScreenWaterfallMode_ = isFullScreenWaterfallMode;
2021 }
2022
GetIsFullScreenWaterfallMode() const2023 bool WindowSessionProperty::GetIsFullScreenWaterfallMode() const
2024 {
2025 return isFullScreenWaterfallMode_;
2026 }
2027 } // namespace Rosen
2028 } // namespace OHOS
2029