• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 "scene_input_manager.h"
17 
18 #include <hitrace_meter.h>
19 #include "perform_reporter.h"
20 #include "scene_session_dirty_manager.h"
21 #include "screen_session_manager_client/include/screen_session_manager_client.h"
22 #include "session_manager/include/scene_session_manager.h"
23 #include "session/host/include/session_change_recorder.h"
24 
25 namespace OHOS {
26 namespace Rosen {
27 
28 namespace {
29 constexpr HiviewDFX::HiLogLabel LABEL = { LOG_CORE, HILOG_DOMAIN_WINDOW, "SceneInputManager" };
30 const std::string SCENE_INPUT_MANAGER_THREAD = "SceneInputManager";
31 const std::string FLUSH_DISPLAY_INFO_THREAD = "OS_FlushDisplayInfoThread";
32 
33 constexpr int MAX_WINDOWINFO_NUM = 15;
34 constexpr int DEFALUT_DISPLAYID = 0;
35 constexpr int EMPTY_FOCUS_WINDOW_ID = -1;
36 constexpr int INVALID_PERSISTENT_ID = 0;
37 constexpr int DEFAULT_SCREEN_POS = 0;
38 constexpr int DEFAULT_SCREEN_SCALE = 100;
39 constexpr int DEFAULT_EXPAND_HEIGHT = 0;
40 
41 bool IsEqualUiExtentionWindowInfo(const std::vector<MMI::WindowInfo>& a, const std::vector<MMI::WindowInfo>& b);
42 constexpr unsigned int TRANSFORM_DATA_LEN = 9;
43 
operator !=(const MMI::Rect & a,const MMI::Rect & b)44 bool operator!=(const MMI::Rect& a, const MMI::Rect& b)
45 {
46     if (a.x != b.x || a.y != b.y || a.width != b.width || a.height != b.height) {
47         return true;
48     }
49     return false;
50 }
51 
operator ==(const MMI::ScreenInfo & a,const MMI::ScreenInfo & b)52 bool operator==(const MMI::ScreenInfo& a, const MMI::ScreenInfo& b)
53 {
54     if (a.id != b.id || a.uniqueId != b.uniqueId || a.screenType != b.screenType ||
55         a.width != b.width || a.height != b.height ||
56         a.physicalWidth != b.physicalWidth || a.physicalHeight != b.physicalHeight ||
57         static_cast<int32_t>(a.tpDirection) != static_cast<int32_t>(b.tpDirection) ||
58         a.dpi != b.dpi || a.ppi != b.ppi) {
59         return false;
60     }
61     return true;
62 }
63 
operator ==(const MMI::DisplayInfo & a,const MMI::DisplayInfo & b)64 bool operator==(const MMI::DisplayInfo& a, const MMI::DisplayInfo& b)
65 {
66     if (a.id != b.id || a.x != b.x || a.y != b.y || a.width != b.width ||
67         a.height != b.height || a.dpi != b.dpi || a.name != b.name ||
68         static_cast<int32_t>(a.direction) != static_cast<int32_t>(b.direction) ||
69         static_cast<int32_t>(a.displayDirection) != static_cast<int32_t>(b.displayDirection) ||
70         static_cast<int32_t>(a.displayMode) != static_cast<int32_t>(b.displayMode) ||
71         a.transform != b.transform || a.scalePercent != b.scalePercent || a.expandHeight != b.expandHeight ||
72         a.isCurrentOffScreenRendering != b.isCurrentOffScreenRendering || a.displaySourceMode != b.displaySourceMode ||
73         a.oneHandX != b.oneHandX || a.oneHandY != b.oneHandY || a.screenArea.id != b.screenArea.id ||
74         a.screenArea.area != b.screenArea.area || a.rsId != b.rsId) {
75         return false;
76     }
77     return true;
78 }
79 
operator !=(const std::vector<float> & a,const std::vector<float> & b)80 bool operator!=(const std::vector<float>& a, const std::vector<float>& b)
81 {
82     if (a.size() != b.size()) {
83         return true;
84     }
85     int sizeOfA = static_cast<int>(a.size());
86     for (int index = 0; index < sizeOfA; index++) {
87         if (a[index] != b[index]) {
88             return true;
89         }
90     }
91     return false;
92 }
93 
IsEqualWindowInfo(const MMI::WindowInfo & a,const MMI::WindowInfo & b)94 bool IsEqualWindowInfo(const MMI::WindowInfo& a, const MMI::WindowInfo& b)
95 {
96     if (a.id != b.id || a.pid != b.pid || a.uid != b.uid || a.agentWindowId != b.agentWindowId || a.flags != b.flags ||
97         a.displayId != b.displayId || a.zOrder != b.zOrder) {
98         return false;
99     }
100 
101     if (a.windowInputType != b.windowInputType || a.privacyMode != b.privacyMode ||
102         a.windowType != b.windowType || a.pixelMap != b.pixelMap) {
103         return false;
104     }
105     return true;
106 }
107 
operator ==(const MMI::WindowInfo & a,const MMI::WindowInfo & b)108 bool operator==(const MMI::WindowInfo& a, const MMI::WindowInfo& b)
109 {
110     if (!IsEqualWindowInfo(a, b)) {
111         return false;
112     }
113 
114     if (a.area != b.area || a.defaultHotAreas.size() != b.defaultHotAreas.size() ||
115         a.pointerHotAreas.size() != b.pointerHotAreas.size() ||
116         a.pointerChangeAreas.size() != b.pointerChangeAreas.size() || a.transform.size() != b.transform.size()) {
117         return false;
118     }
119 
120     int sizeOfDefaultHotAreas = static_cast<int>(a.defaultHotAreas.size());
121     for (int index = 0; index < sizeOfDefaultHotAreas; index++) {
122         if (a.defaultHotAreas[index] != b.defaultHotAreas[index]) {
123             return false;
124         }
125     }
126     int sizeOfPointerHotAreas = static_cast<int>(a.pointerHotAreas.size());
127     for (int index = 0; index < sizeOfPointerHotAreas; index++) {
128         if (a.pointerHotAreas[index] != b.pointerHotAreas[index]) {
129             return false;
130         }
131     }
132     int sizeOfPointerChangeAreas = static_cast<int>(a.pointerChangeAreas.size());
133     for (int index = 0; index < sizeOfPointerChangeAreas; index++) {
134         if (a.pointerChangeAreas[index] != b.pointerChangeAreas[index]) {
135             return false;
136         }
137     }
138 
139     if (a.transform != b.transform) {
140         return false;
141     }
142     if (!IsEqualUiExtentionWindowInfo(a.uiExtentionWindowInfo, b.uiExtentionWindowInfo)) {
143         return false;
144     }
145     return true;
146 }
147 
operator !=(const MMI::WindowInfo & a,const MMI::WindowInfo & b)148 bool operator!=(const MMI::WindowInfo& a, const MMI::WindowInfo& b)
149 {
150     if (a == b) {
151         return false;
152     }
153     return true;
154 }
155 
IsEqualUiExtentionWindowInfo(const std::vector<MMI::WindowInfo> & a,const std::vector<MMI::WindowInfo> & b)156 bool IsEqualUiExtentionWindowInfo(const std::vector<MMI::WindowInfo>& a, const std::vector<MMI::WindowInfo>& b)
157 {
158     if (a.size() != b.size()) {
159         return false;
160     }
161     int size = static_cast<int>(a.size());
162     for (int i = 0; i < size; i++) {
163         if (a[i] != b[i]) {
164             return false;
165         }
166     }
167     return true;
168 }
169 
DumpTransformInDisplayInfo(const std::vector<float> & transform)170 std::string DumpTransformInDisplayInfo(const std::vector<float>& transform)
171 {
172     std::stringstream stream("[");
173     for (float transformItem : transform) {
174         stream << transformItem << ",";
175     }
176     stream << "]";
177     return stream.str();
178 }
179 
DumpDisplayInfo(const MMI::DisplayInfo & info)180 std::string DumpDisplayInfo(const MMI::DisplayInfo& info)
181 {
182     std::ostringstream infoStream("DisplayInfo: ");
183     infoStream << " id: " << info.id << " x: " << info.x << " y: " << info.y
184                << " width: " << info.width << " height: " << info.height << " dpi: " << info.dpi
185                << " name: " << info.name
186                << " direction: " << static_cast<int>(info.direction)
187                << " direction: " << static_cast<int>(info.displayDirection)
188                << " displayMode: " << static_cast<int>(info.displayMode)
189                << " transform: " << DumpTransformInDisplayInfo(info.transform);
190     std::string infoStr = infoStream.str();
191     return infoStr;
192 }
193 } //namespace
194 
195 
WM_IMPLEMENT_SINGLE_INSTANCE(SceneInputManager)196 WM_IMPLEMENT_SINGLE_INSTANCE(SceneInputManager)
197 
198 void SceneInputManager::Init()
199 {
200     sceneSessionDirty_ = std::make_shared<SceneSessionDirtyManager>();
201     eventLoop_ = AppExecFwk::EventRunner::Create(FLUSH_DISPLAY_INFO_THREAD);
202     eventHandler_ = std::make_shared<AppExecFwk::EventHandler>(eventLoop_);
203     SceneSession::RegisterGetConstrainedModalExtWindowInfo(
204         [](const sptr<SceneSession>& sceneSession) -> std::optional<ExtensionWindowEventInfo> {
205             return SceneInputManager::GetInstance().GetConstrainedModalExtWindowInfo(sceneSession);
206         });
207 }
208 
RegisterFlushWindowInfoCallback(FlushWindowInfoCallback && callback)209 void SceneInputManager::RegisterFlushWindowInfoCallback(FlushWindowInfoCallback&& callback)
210 {
211     sceneSessionDirty_->RegisterFlushWindowInfoCallback(std::move(callback));
212 }
213 
ResetSessionDirty()214 void SceneInputManager::ResetSessionDirty()
215 {
216     sceneSessionDirty_->ResetSessionDirty();
217 }
218 
GetFullWindowInfoList()219 auto SceneInputManager::GetFullWindowInfoList() ->
220     std::pair<std::vector<MMI::WindowInfo>, std::vector<std::shared_ptr<Media::PixelMap>>>
221 {
222     return sceneSessionDirty_->GetFullWindowInfoList();
223 }
224 
ConstructScreenInfos(std::map<ScreenId,ScreenProperty> & screensProperties)225 std::vector<MMI::ScreenInfo> SceneInputManager::ConstructScreenInfos(
226     std::map<ScreenId, ScreenProperty>& screensProperties)
227 {
228     std::vector<MMI::ScreenInfo> screenInfos;
229     if (screensProperties.empty()) {
230         TLOGE(WmsLogTag::WMS_EVENT, "screensProperties is empty");
231         return screenInfos;
232     }
233     for (auto& [screenId, screenProperty] : screensProperties) {
234         MMI::ScreenInfo screenInfo = {
235             .id = screenId,
236             .uniqueId = "default" + std::to_string(screenProperty.GetRsId()),
237             .screenType = static_cast<MMI::ScreenType>(screenProperty.GetScreenType()),
238             .width = screenProperty.GetScreenRealWidth(),
239             .height = screenProperty.GetScreenRealHeight(),
240             .physicalWidth = screenProperty.GetPhyWidth(),
241             .physicalHeight = screenProperty.GetPhyHeight(),
242             .tpDirection = ConvertDegreeToMMIRotation(screenProperty.GetDefaultDeviceRotationOffset()),
243             .dpi = screenProperty.GetScreenRealPPI(),
244             .ppi = screenProperty.GetXDpi(),
245             .rotation = ConvertToMMIRotation(screenProperty.GetRotation())
246         };
247         screenInfos.emplace_back(screenInfo);
248     }
249     return screenInfos;
250 }
251 
ConstructDisplayGroupInfos(std::map<ScreenId,ScreenProperty> & screensProperties,std::map<DisplayGroupId,MMI::DisplayGroupInfo> & displayGroupMap)252 void SceneInputManager::ConstructDisplayGroupInfos(std::map<ScreenId, ScreenProperty>& screensProperties,
253     std::map<DisplayGroupId, MMI::DisplayGroupInfo>& displayGroupMap)
254 {
255     if (screensProperties.empty()) {
256         TLOGE(WmsLogTag::WMS_EVENT, "screensProperties is empty");
257         return;
258     }
259     auto displayMode = ScreenSessionManagerClient::GetInstance().GetFoldDisplayMode();
260     for (auto& [screenId, screenProperty] : screensProperties) {
261         auto screenSession = ScreenSessionManagerClient::GetInstance().GetScreenSessionById(screenId);
262         if (screenSession == nullptr) {
263             TLOGE(WmsLogTag::WMS_EVENT, "screenSession get failed, screenId: %{public}" PRIu64"", screenId);
264             continue;
265         }
266         auto transform = Matrix3f::IDENTITY;
267         Vector2f scale(screenProperty.GetScaleX(), screenProperty.GetScaleY());
268         transform = transform.Scale(scale, screenProperty.GetPivotX() * screenProperty.GetBounds().rect_.GetWidth(),
269             screenProperty.GetPivotY() * screenProperty.GetBounds().rect_.GetHeight()).Inverse();
270         std::vector<float> transformData(transform.GetData(), transform.GetData() + TRANSFORM_DATA_LEN);
271         int32_t screenOneHandX = DEFAULT_SCREEN_POS;
272         int32_t screenOneHandY = DEFAULT_SCREEN_POS;
273         int32_t scalePercent = DEFAULT_SCREEN_SCALE;
274         int32_t expandHeight = DEFAULT_EXPAND_HEIGHT;
275         const SingleHandScreenInfo& singleHandScreenInfo = SceneSessionManager::GetInstance().GetSingleHandScreenInfo();
276         if (screenId == ScreenSessionManagerClient::GetInstance().GetDefaultScreenId() &&
277             singleHandScreenInfo.mode != SingleHandMode::MIDDLE) {
278             SingleHandTransform singleHandTransform = SceneSessionManager::GetInstance().GetNormalSingleHandTransform();
279             WSRect originRect = SceneSessionManager::GetInstance().GetOriginRect();
280             screenOneHandX = singleHandTransform.posX;
281             screenOneHandY = singleHandTransform.posY;
282             scalePercent = singleHandTransform.scaleX * DEFAULT_SCREEN_SCALE;
283             expandHeight = screenProperty.GetBounds().rect_.GetHeight() - originRect.height_;
284         }
285         MMI::DisplayInfo displayInfo = {
286             .id = screenId,
287             .x = screenProperty.GetX(),
288             .y = screenProperty.GetY(),
289             .width = screenProperty.GetValidWidth(),
290             .height =screenProperty.GetValidHeight(),
291             .dpi = screenProperty.GetDensity() *  DOT_PER_INCH,
292             .name = "display" + std::to_string(screenId),
293             .direction = ConvertDegreeToMMIRotation(screenProperty.GetPhysicalRotation()),
294             .displayDirection = ConvertDegreeToMMIRotation(screenProperty.GetScreenComponentRotation()),
295             .displayMode = static_cast<MMI::DisplayMode>(displayMode),
296             .transform = transformData,
297             .scalePercent = scalePercent,
298             .expandHeight = expandHeight,
299             .isCurrentOffScreenRendering = screenProperty.GetCurrentOffScreenRendering(),
300             .displaySourceMode = static_cast<MMI::DisplaySourceMode>(screenSession->GetScreenCombination()),
301             .oneHandX = screenOneHandX,
302             .oneHandY = screenOneHandY,
303             .screenArea = {
304                 .id = screenId,
305                 .area = {screenProperty.GetScreenAreaOffsetX(), screenProperty.GetScreenAreaOffsetY(),
306                     screenProperty.GetScreenAreaWidth(), screenProperty.GetScreenAreaHeight()}
307             },
308             .rsId = screenProperty.GetRsId(),
309             .offsetX = screenProperty.GetInputOffsetX(),
310             .offsetY = screenProperty.GetInputOffsetY(),
311             .pointerActiveWidth = screenProperty.GetPointerActiveWidth(),
312             .pointerActiveHeight = screenProperty.GetPointerActiveHeight()
313         };
314         DisplayGroupId displayGroupId = screenSession->GetDisplayGroupId();
315         if (displayGroupMap.count(displayGroupId) == 0) {
316             MMI::DisplayGroupInfo displayGroupInfo = {
317                 .id = displayGroupId,
318                 .name = "displayGroup" + std::to_string(displayGroupId),
319                 .type = displayGroupId == 0 ? MMI::GROUP_DEFAULT : MMI::GROUP_SPECIAL,
320                 .mainDisplayId = screenProperty.GetMainDisplayIdOfGroup(),
321             };
322             displayGroupMap[displayGroupId] = displayGroupInfo;
323         }
324         displayGroupMap[displayGroupId].displaysInfo.emplace_back(displayInfo);
325     }
326 }
327 
GetFocusedSessionMap() const328 std::unordered_map<DisplayId, int32_t> SceneInputManager::GetFocusedSessionMap() const
329 {
330     std::unordered_map<DisplayId, int32_t> focusInfoMap;
331     auto focusInfoMapArray = SceneSessionManager::GetInstance().GetAllFocusedSessionList();
332     for (const auto& item : focusInfoMapArray) {
333         int32_t focusedSessionId = item.second;
334         auto focusedSession = SceneSessionManager::GetInstance().GetSceneSession(focusedSessionId);
335         if (focusedSession == nullptr) {
336             TLOGE(WmsLogTag::WMS_EVENT, "focusedSession is null, id: %{public}d", focusedSessionId);
337             focusInfoMap[item.first] = INVALID_PERSISTENT_ID;
338             continue;
339         }
340         if (auto modalUIExtensionEventInfo = focusedSession->GetLastModalUIExtensionEventInfo()) {
341             focusedSessionId = modalUIExtensionEventInfo.value().persistentId;
342         }
343         focusInfoMap[item.first] = focusedSessionId;
344     }
345     return focusInfoMap;
346 }
347 
FlushFullInfoToMMI(const std::vector<MMI::ScreenInfo> & screenInfos,std::map<DisplayGroupId,MMI::DisplayGroupInfo> & displayGroupMap,const std::vector<MMI::WindowInfo> & windowInfoList,bool isOverBatchSize)348 void SceneInputManager::FlushFullInfoToMMI(const std::vector<MMI::ScreenInfo>& screenInfos,
349     std::map<DisplayGroupId, MMI::DisplayGroupInfo>& displayGroupMap,
350     const std::vector<MMI::WindowInfo>& windowInfoList, bool isOverBatchSize)
351 {
352     auto focusInfoMap = GetFocusedSessionMap();
353     std::unordered_map<DisplayGroupId, std::vector<MMI::WindowInfo>> windowInfoMap;
354     for (const auto& windowInfo : windowInfoList) {
355         windowInfoMap[windowInfo.groupId].emplace_back(windowInfo);
356     }
357     std::vector<MMI::DisplayGroupInfo> displayGroupInfos;
358     for (auto& [displayGroupId, displayGroup] : displayGroupMap) {
359         if (!isOverBatchSize && !windowInfoMap[displayGroupId].empty()) {
360             windowInfoMap[displayGroupId].back().action = MMI::WINDOW_UPDATE_ACTION::ADD_END;
361         }
362         displayGroup.windowsInfo = windowInfoMap[displayGroupId];
363         displayGroup.focusWindowId = focusInfoMap[displayGroupId];
364         displayGroupInfos.emplace_back(displayGroup);
365     }
366     MMI::UserScreenInfo userScreenInfo = {
367         .userId = currentUserId_,
368         .screens = screenInfos,
369         .displayGroups = displayGroupInfos
370     };
371     MMI::InputManager::GetInstance()->UpdateDisplayInfo(userScreenInfo);
372 
373     for (auto groupInfo : displayGroupInfos) {
374         TLOGD(WmsLogTag::WMS_EVENT, "[EventDispatch] - displayGroupId: %{public}d", groupInfo.id);
375         for (const auto& displayInfo : groupInfo.displaysInfo) {
376             TLOGD(WmsLogTag::WMS_EVENT, "[EventDispatch] - %{public}s", DumpDisplayInfo(displayInfo).c_str());
377         }
378         std::string windowInfoListDump = "windowinfo  ";
379         for (const auto& windowInfo : groupInfo.windowsInfo) {
380             windowInfoListDump.append(DumpWindowInfo(windowInfo).append("  ||  "));
381         }
382         TLOGD(WmsLogTag::WMS_EVENT, "[EventDispatch] - %{public}s", windowInfoListDump.c_str());
383     }
384 }
385 
FlushEmptyInfoToMMI()386 void SceneInputManager::FlushEmptyInfoToMMI()
387 {
388     auto task = [this]() {
389         std::map<ScreenId, ScreenProperty> screensProperties =
390             ScreenSessionManagerClient::GetInstance().GetAllScreensProperties();
391         std::vector<MMI::ScreenInfo> screenInfos = ConstructScreenInfos(screensProperties);
392         std::map<DisplayGroupId, MMI::DisplayGroupInfo> displayGroupMap;
393         ConstructDisplayGroupInfos(screensProperties, displayGroupMap);
394         std::vector<MMI::DisplayGroupInfo> displayGroupInfos;
395         for (auto& [displayGroupId, displayGroup] : displayGroupMap) {
396             displayGroupInfos.emplace_back(displayGroup);
397         }
398         MMI::UserScreenInfo userScreenInfo = {
399             .userId = currentUserId_,
400             .screens = screenInfos,
401             .displayGroups = displayGroupInfos
402         };
403         TLOGNI(WmsLogTag::WMS_EVENT, "userId:%{public}d", currentUserId_);
404         MMI::InputManager::GetInstance()->UpdateDisplayInfo(userScreenInfo);
405     };
406     if (eventHandler_) {
407         eventHandler_->PostTask(task);
408     }
409 }
410 
NotifyWindowInfoChange(const sptr<SceneSession> & sceneSession,const WindowUpdateType & type)411 void SceneInputManager::NotifyWindowInfoChange(const sptr<SceneSession>& sceneSession, const WindowUpdateType& type)
412 {
413     if (sceneSessionDirty_) {
414         sceneSessionDirty_->NotifyWindowInfoChange(sceneSession, type);
415     }
416 }
417 
NotifyMMIWindowPidChange(const sptr<SceneSession> & sceneSession,const bool startMoving)418 void SceneInputManager::NotifyMMIWindowPidChange(const sptr<SceneSession>& sceneSession, const bool startMoving)
419 {
420     if (sceneSessionDirty_) {
421         sceneSessionDirty_->NotifyWindowInfoChange(sceneSession,
422             WindowUpdateType::WINDOW_UPDATE_PROPERTY, startMoving);
423         if (sceneSession == nullptr) {
424             return;
425         }
426         sceneSession->SetIsStartMoving(startMoving);
427     }
428 }
429 
NotifyWindowInfoChangeFromSession(const sptr<SceneSession> & sceneSesion)430 void SceneInputManager::NotifyWindowInfoChangeFromSession(const sptr<SceneSession>& sceneSesion)
431 {
432     if (sceneSessionDirty_) {
433         sceneSessionDirty_->NotifyWindowInfoChange(sceneSesion, WindowUpdateType::WINDOW_UPDATE_PROPERTY);
434     } else {
435         TLOGD(WmsLogTag::WMS_EVENT, "sceneSessionDirty is nullptr");
436     }
437 }
438 
FlushChangeInfoToMMI(const std::map<uint64_t,std::vector<MMI::WindowInfo>> & screenId2Windows)439 void SceneInputManager::FlushChangeInfoToMMI(const std::map<uint64_t, std::vector<MMI::WindowInfo>>& screenId2Windows)
440 {
441     for (auto& iter : screenId2Windows) {
442         auto displayId = iter.first;
443         auto& windowInfos = iter.second;
444         std::string windowInfoListDump = "windowinfo  ";
445         for (auto& windowInfo : windowInfos) {
446             windowInfoListDump.append(DumpWindowInfo(windowInfo).append("  ||  "));
447         }
448         TLOGD(WmsLogTag::WMS_EVENT, "[EventDispatch] --- %{public}s", windowInfoListDump.c_str());
449         MMI::WindowGroupInfo windowGroup = {focusedSessionId_, displayId, windowInfos};
450         MMI::InputManager::GetInstance()->UpdateWindowInfo(windowGroup);
451     }
452 }
453 
CheckNeedUpdate(const std::vector<MMI::ScreenInfo> & screenInfos,const std::vector<MMI::DisplayInfo> & displayInfos,const std::vector<MMI::WindowInfo> & windowInfoList)454 bool SceneInputManager::CheckNeedUpdate(const std::vector<MMI::ScreenInfo>& screenInfos,
455     const std::vector<MMI::DisplayInfo>& displayInfos, const std::vector<MMI::WindowInfo>& windowInfoList)
456 {
457     int32_t focusId = SceneSessionManager::GetInstance().GetFocusedSessionId();
458     if (focusId != lastFocusId_) {
459         lastFocusId_ = focusId;
460         lastScreenInfos_ = screenInfos;
461         lastDisplayInfos_ = displayInfos;
462         lastWindowInfoList_ = windowInfoList;
463         return true;
464     }
465 
466     if (screenInfos.size() != lastScreenInfos_.size() || displayInfos.size() != lastDisplayInfos_.size() ||
467         windowInfoList.size() != lastWindowInfoList_.size()) {
468         lastScreenInfos_ = screenInfos;
469         lastDisplayInfos_ = displayInfos;
470         lastWindowInfoList_ = windowInfoList;
471         return true;
472     }
473 
474     int sizeOfScreenInfos = static_cast<int>(screenInfos.size());
475     for (int index = 0; index < sizeOfScreenInfos; index++) {
476         if (!(screenInfos[index] == lastScreenInfos_[index])) {
477             lastScreenInfos_ = screenInfos;
478             lastDisplayInfos_ = displayInfos;
479             lastWindowInfoList_ = windowInfoList;
480             return true;
481         }
482     }
483 
484     int sizeOfDisplayInfos = static_cast<int>(displayInfos.size());
485     for (int index = 0; index < sizeOfDisplayInfos; index++) {
486         if (!(displayInfos[index] == lastDisplayInfos_[index])) {
487             lastDisplayInfos_ = displayInfos;
488             lastWindowInfoList_ = windowInfoList;
489             return true;
490         }
491     }
492 
493     int sizeOfWindowInfoList = static_cast<int>(windowInfoList.size());
494     for (int index = 0; index < sizeOfWindowInfoList; index++) {
495         if (!(windowInfoList[index] == lastWindowInfoList_[index])) {
496             lastWindowInfoList_ = windowInfoList;
497             return true;
498         }
499     }
500     return false;
501 }
502 
UpdateFocusedSessionId(int32_t focusedSessionId)503 void SceneInputManager::UpdateFocusedSessionId(int32_t focusedSessionId)
504 {
505     auto focusedSceneSession = SceneSessionManager::GetInstance().GetSceneSession(focusedSessionId);
506     if (focusedSceneSession == nullptr) {
507         TLOGE(WmsLogTag::WMS_EVENT, "focusedSceneSession is null");
508         return;
509     }
510     if (auto modalUIExtensionEventInfo = focusedSceneSession->GetLastModalUIExtensionEventInfo()) {
511         focusedSessionId_ = modalUIExtensionEventInfo.value().persistentId;
512     }
513 }
514 
DumpUIExtentionWindowInfo(const MMI::WindowInfo & windowInfo)515 void DumpUIExtentionWindowInfo(const MMI::WindowInfo& windowInfo)
516 {
517     auto sceneSession = SceneSessionManager::GetInstance().GetSceneSession(windowInfo.id);
518     if (sceneSession == nullptr) {
519         TLOGE(WmsLogTag::WMS_EVENT, "sceneSession is null");
520         return;
521     }
522     auto surfaceNode = sceneSession->GetSurfaceNode();
523     if (surfaceNode == nullptr) {
524         TLOGE(WmsLogTag::WMS_EVENT, "surfaceNode is null");
525         return;
526     }
527     auto surfaceId = surfaceNode->GetId();
528     std::ostringstream dumpUecWindowInfo;
529     dumpUecWindowInfo << "DumpUecWindowInfo:" << windowInfo.id << ";"<< surfaceId;
530     dumpUecWindowInfo << ";" << windowInfo.uiExtentionWindowInfo.size();
531     for (const auto& uiExtWindowInfo : windowInfo.uiExtentionWindowInfo) {
532         auto str = DumpWindowInfo(uiExtWindowInfo);
533         str = "sec:" + std::to_string(uiExtWindowInfo.privacyUIFlag) + " " + str;
534         dumpUecWindowInfo << ";{" << str << "}";
535     }
536     TLOGND(WmsLogTag::WMS_EVENT, "DumpUecWindowInfo: wid;surfaceId;uecInfoSize"
537         "{wInfo:wId|pid|uid|[x,y,width,height]|agentWindowId|flags|displayId|action|zOrder,hot:[x,y,width,height]}");
538     TLOGNI(WmsLogTag::WMS_EVENT, "%{public}s", dumpUecWindowInfo.str().c_str());
539 }
540 
PrintWindowInfo(const std::vector<MMI::WindowInfo> & windowInfoList)541 void SceneInputManager::PrintWindowInfo(const std::vector<MMI::WindowInfo>& windowInfoList)
542 {
543     int windowListSize = static_cast<int>(windowInfoList.size());
544     std::ostringstream idListStream;
545     std::ostringstream dumpWindowListStream;
546     static std::string lastIdList;
547     static uint32_t windowEventID = 0;
548     if (windowEventID == UINT32_MAX) {
549         windowEventID = 0;
550     }
551     focusedSessionId_ = SceneSessionManager::GetInstance().GetFocusedSessionId();
552     std::unordered_map<int32_t, MMI::Rect> currWindowDefaultHotArea;
553     static std::unordered_map<int32_t, MMI::Rect> lastWindowDefaultHotArea;
554     for (auto& e : windowInfoList) {
555         idListStream << e.id << "|" << e.flags << "|" << e.zOrder << "|"
556                      << e.pid << "|" << e.defaultHotAreas.size();
557 
558         if (e.defaultHotAreas.size() > 0) {
559             auto iter = lastWindowDefaultHotArea.find(e.id);
560             if (iter == lastWindowDefaultHotArea.end() || iter->second != e.defaultHotAreas[0]) {
561                 idListStream << "|" << e.defaultHotAreas[0].x << "|" << e.defaultHotAreas[0].y
562                              << "|" << e.defaultHotAreas[0].width << "|" << e.defaultHotAreas[0].height;
563             }
564             currWindowDefaultHotArea.insert({e.id, e.defaultHotAreas[0]});
565         }
566         idListStream << ",";
567         if ((focusedSessionId_ == e.id) && (e.id == e.agentWindowId)) {
568             UpdateFocusedSessionId(focusedSessionId_);
569         }
570         if (e.uiExtentionWindowInfo.size() > 0) {
571             DumpUIExtentionWindowInfo(e);
572         }
573         ConstructDumpWindowInfo(e, dumpWindowListStream);
574     }
575     lastWindowDefaultHotArea = currWindowDefaultHotArea;
576     SingleHandTransform transform = SceneSessionManager::GetInstance().GetNormalSingleHandTransform();
577     idListStream << focusedSessionId_ << "|" << transform.posX << "|" << transform.posY
578         << "|" << transform.scaleX << "|" << transform.scaleY;
579     std::string idList = idListStream.str();
580     if (lastIdList != idList) {
581         windowEventID++;
582         TLOGNI(WmsLogTag::WMS_EVENT, "LogWinInfo: eid:%{public}d,size:%{public}d,idList:%{public}s",
583             windowEventID, windowListSize, idList.c_str());
584         lastIdList = idList;
585     }
586     std::string dumpWindowList = dumpWindowListStream.str();
587     SceneSessionChangeInfo changeInfo {
588         .changeInfo_ = "WindowInfos: " + dumpWindowList,
589         .logTag_ = WmsLogTag::WMS_EVENT,
590     };
591     SessionChangeRecorder::GetInstance().RecordSceneSessionChange(RecordType::EVENT_RECORD, changeInfo);
592 }
593 
PrintScreenInfo(const std::vector<MMI::ScreenInfo> & screenInfos)594 void SceneInputManager::PrintScreenInfo(const std::vector<MMI::ScreenInfo>& screenInfos)
595 {
596     int screenListSize = static_cast<int>(screenInfos.size());
597     std::ostringstream screenListStream;
598     static std::string lastScreenList = "";
599     for (auto& screenInfo : screenInfos) {
600         screenListStream << screenInfo.id << "|" << screenInfo.uniqueId << "|"
601                          << static_cast<uint32_t>(screenInfo.screenType) << "|"
602                          << screenInfo.width << "|" << screenInfo.height << "|"
603                          << screenInfo.physicalWidth << "|" << screenInfo.physicalHeight << "|"
604                          << static_cast<int32_t>(screenInfo.tpDirection) << "|"
605                          << screenInfo.dpi << "|" << screenInfo.ppi << ",";
606     }
607 
608     std::string screenList = screenListStream.str();
609     if (lastScreenList != screenList) {
610         TLOGI(WmsLogTag::WMS_EVENT, "num:%{public}d,list:%{public}s", screenListSize, screenList.c_str());
611         lastScreenList = screenList;
612     }
613 }
614 
PrintDisplayInfo(const std::vector<MMI::DisplayInfo> & displayInfos)615 void SceneInputManager::PrintDisplayInfo(const std::vector<MMI::DisplayInfo>& displayInfos)
616 {
617     int displayListSize = static_cast<int>(displayInfos.size());
618     std::ostringstream displayListStream;
619     std::ostringstream dumpDisplayListStream;
620     static std::string lastDisplayList = "";
621     for (auto& displayInfo : displayInfos) {
622         displayListStream << displayInfo.id << "|" << displayInfo.x << "|" << displayInfo.y << "|"
623                           << displayInfo.width << "|" << displayInfo.height << "|"
624                           << displayInfo.dpi << "|"
625                           << static_cast<int32_t>(displayInfo.direction) << "|"
626                           << static_cast<int32_t>(displayInfo.displayDirection) << "|"
627                           << static_cast<int32_t>(displayInfo.displayMode) << "|"
628                           << displayInfo.scalePercent << "|" << displayInfo.expandHeight << "|"
629                           << displayInfo.isCurrentOffScreenRendering << "|"
630                           << static_cast<uint32_t>(displayInfo.displaySourceMode) << "|" << displayInfo.oneHandX << "|"
631                           << displayInfo.oneHandY << "|" << displayInfo.screenArea.area.x << "|"
632                           << displayInfo.screenArea.area.y << "|" << displayInfo.screenArea.area.width << "|"
633                           << displayInfo.screenArea.area.height << "|" << displayInfo.rsId << ",";
634         ConstructDumpDisplayInfo(displayInfo, dumpDisplayListStream);
635     }
636 
637     std::string displayList = displayListStream.str();
638     if (lastDisplayList != displayList) {
639         TLOGI(WmsLogTag::WMS_EVENT, "num:%{public}d,list:%{public}s", displayListSize, displayList.c_str());
640         lastDisplayList = displayList;
641     }
642     std::string dumpDisplayList = dumpDisplayListStream.str();
643     SceneSessionChangeInfo changeInfo {
644         .changeInfo_ = "DisplayInfos: " + dumpDisplayList,
645         .logTag_ = WmsLogTag::WMS_EVENT,
646     };
647     SessionChangeRecorder::GetInstance().RecordSceneSessionChange(RecordType::EVENT_RECORD, changeInfo);
648 }
649 
SetUserBackground(bool userBackground)650 void SceneInputManager::SetUserBackground(bool userBackground)
651 {
652     TLOGD(WmsLogTag::WMS_MULTI_USER, "userBackground=%{public}d", userBackground);
653     isUserBackground_.store(userBackground);
654 }
655 
SetCurrentUserId(int32_t userId)656 void SceneInputManager::SetCurrentUserId(int32_t userId)
657 {
658     TLOGD(WmsLogTag::WMS_MULTI_USER, "Current userId=%{public}d", userId);
659     currentUserId_ = userId;
660     MMI::InputManager::GetInstance()->SetCurrentUser(userId);
661 }
662 
UpdateDisplayAndWindowInfo(const std::vector<MMI::ScreenInfo> & screenInfos,std::map<DisplayGroupId,MMI::DisplayGroupInfo> & displayGroupMap,std::vector<MMI::WindowInfo> windowInfoList)663 void SceneInputManager::UpdateDisplayAndWindowInfo(const std::vector<MMI::ScreenInfo>& screenInfos,
664     std::map<DisplayGroupId, MMI::DisplayGroupInfo>& displayGroupMap,
665     std::vector<MMI::WindowInfo> windowInfoList)
666 {
667     if (windowInfoList.size() == 0) {
668         FlushFullInfoToMMI(screenInfos, displayGroupMap, windowInfoList);
669         return;
670     }
671     int32_t windowBatchSize = MAX_WINDOWINFO_NUM;
672     if (windowInfoList[0].defaultHotAreas.size() > MMI::WindowInfo::DEFAULT_HOTAREA_COUNT) {
673         windowBatchSize = MMI::InputManager::GetInstance()->GetWinSyncBatchSize(
674             static_cast<int32_t>(windowInfoList[0].defaultHotAreas.size()),
675             static_cast<int32_t>(displayGroupMap.size()));
676     }
677     int32_t windowListSize = static_cast<int32_t>(windowInfoList.size());
678     if (windowListSize <= windowBatchSize) {
679         FlushFullInfoToMMI(screenInfos, displayGroupMap, windowInfoList);
680         return;
681     }
682     std::unordered_map<int32_t, std::vector<int32_t>> windowIndexMap;
683     int32_t index = 0;
684     for (const auto& windowInfo : windowInfoList) {
685         windowIndexMap[windowInfo.groupId].emplace_back(index);
686         index++;
687     }
688     for (auto& [displayGroupId, indexInfos] : windowIndexMap) {
689         windowInfoList[indexInfos.back()].action = MMI::WINDOW_UPDATE_ACTION::ADD_END;
690     }
691     auto iterBegin = windowInfoList.begin();
692     auto iterEnd = windowInfoList.end();
693     auto iterNext = std::next(iterBegin, windowBatchSize);
694     FlushFullInfoToMMI(screenInfos, displayGroupMap, std::vector<MMI::WindowInfo>(iterBegin, iterNext), true);
695     while (iterNext != iterEnd) {
696         auto iterNewBegin = iterNext;
697         if (iterNewBegin->defaultHotAreas.size() <= MMI::WindowInfo::DEFAULT_HOTAREA_COUNT) {
698             windowBatchSize = MAX_WINDOWINFO_NUM;
699         }
700         if (std::distance(iterNewBegin, iterEnd) <= windowBatchSize) {
701             iterNext = iterEnd;
702         } else {
703             iterNext = std::next(iterNewBegin, windowBatchSize);
704         }
705         std::map<uint64_t, std::vector<MMI::WindowInfo>> screenToWindowInfoList;
706         screenToWindowInfoList.emplace(DEFALUT_DISPLAYID, std::vector<MMI::WindowInfo>(iterNewBegin, iterNext));
707         FlushChangeInfoToMMI(screenToWindowInfoList);
708     }
709 }
710 
FlushDisplayInfoToMMI(std::vector<MMI::WindowInfo> && windowInfoList,std::vector<std::shared_ptr<Media::PixelMap>> && pixelMapList,const bool forceFlush)711 void SceneInputManager::FlushDisplayInfoToMMI(std::vector<MMI::WindowInfo>&& windowInfoList,
712                                               std::vector<std::shared_ptr<Media::PixelMap>>&& pixelMapList,
713                                               const bool forceFlush)
714 {
715     eventHandler_->PostTask([this, windowInfoList = std::move(windowInfoList),
716                             pixelMapList = std::move(pixelMapList), forceFlush]() {
717         HITRACE_METER_FMT(HITRACE_TAG_WINDOW_MANAGER, "FlushDisplayInfoToMMI");
718         if (isUserBackground_.load()) {
719             TLOGND(WmsLogTag::WMS_MULTI_USER, "User in background, no need to flush display info");
720             return;
721         }
722         if (sceneSessionDirty_ == nullptr) {
723             TLOGNE(WmsLogTag::WMS_EVENT, "sceneSessionDirty_ is nullptr");
724             return;
725         }
726         std::map<ScreenId, ScreenProperty> screensProperties =
727             ScreenSessionManagerClient::GetInstance().GetAllScreensProperties();
728         std::vector<MMI::ScreenInfo> screenInfos = ConstructScreenInfos(screensProperties);
729         std::map<DisplayGroupId, MMI::DisplayGroupInfo> displayGroupMap;
730         ConstructDisplayGroupInfos(screensProperties, displayGroupMap);
731         if (displayGroupMap.empty()) {
732             std::ostringstream oss;
733             oss << "displayInfos flush to MMI is empty!";
734             int32_t ret = WindowInfoReporter::GetInstance().ReportEventDispatchException(
735                 static_cast<int32_t>(WindowDFXHelperType::WINDOW_FLUSH_EMPTY_DISPLAY_INFO_TO_MMI_EXCEPTION),
736                 getpid(), oss.str()
737             );
738             if (ret != 0) {
739                 TLOGNI(WmsLogTag::WMS_EVENT, "ReportEventDispatchException message failed, ret: %{public}d", ret);
740             }
741             return;
742         }
743         std::vector<MMI::DisplayInfo> displayInfos;
744         for (auto& [displayGroupId, displayGroup] : displayGroupMap) {
745             for (auto& displayInfo : displayGroup.displaysInfo) {
746                 displayInfos.emplace_back(displayInfo);
747             }
748         }
749         if (!forceFlush && !CheckNeedUpdate(screenInfos, displayInfos, windowInfoList)) {
750             return;
751         }
752         PrintScreenInfo(screenInfos);
753         PrintDisplayInfo(displayInfos);
754         PrintWindowInfo(windowInfoList);
755         UpdateDisplayAndWindowInfo(screenInfos, displayGroupMap, std::move(windowInfoList));
756     });
757 }
758 
UpdateSecSurfaceInfo(const std::map<uint64_t,std::vector<SecSurfaceInfo>> & secSurfaceInfoMap)759 void SceneInputManager::UpdateSecSurfaceInfo(const std::map<uint64_t, std::vector<SecSurfaceInfo>>& secSurfaceInfoMap)
760 {
761     if (sceneSessionDirty_ == nullptr) {
762         TLOGE(WmsLogTag::WMS_EVENT, "sceneSessionDirty_ is nullptr");
763         return;
764     }
765     sceneSessionDirty_->UpdateSecSurfaceInfo(secSurfaceInfoMap);
766 }
767 
UpdateConstrainedModalUIExtInfo(const std::map<uint64_t,std::vector<SecSurfaceInfo>> & constrainedModalUIExtInfoMap)768 void SceneInputManager::UpdateConstrainedModalUIExtInfo(
769     const std::map<uint64_t, std::vector<SecSurfaceInfo>>& constrainedModalUIExtInfoMap)
770 {
771     if (sceneSessionDirty_ == nullptr) {
772         TLOGE(WmsLogTag::WMS_EVENT, "sceneSessionDirty_ is nullptr");
773         return;
774     }
775     sceneSessionDirty_->UpdateConstrainedModalUIExtInfo(constrainedModalUIExtInfoMap);
776 }
777 
GetConstrainedModalExtWindowInfo(const sptr<SceneSession> & sceneSession)778 std::optional<ExtensionWindowEventInfo> SceneInputManager::GetConstrainedModalExtWindowInfo(
779     const sptr<SceneSession>& sceneSession)
780 {
781     if (sceneSession == nullptr) {
782         TLOGE(WmsLogTag::WMS_EVENT, "sceneSession is nullptr");
783         return std::nullopt;
784     }
785     if (sceneSessionDirty_ == nullptr) {
786         TLOGE(WmsLogTag::WMS_EVENT, "sceneSessionDirty_ is nullptr");
787         return std::nullopt;
788     }
789     SecSurfaceInfo constrainedModalUIExtInfo;
790     if (!sceneSessionDirty_->GetLastConstrainedModalUIExtInfo(sceneSession, constrainedModalUIExtInfo)) {
791         return std::nullopt;
792     }
793     auto persistentId = sceneSession->GetUIExtPersistentIdBySurfaceNodeId(constrainedModalUIExtInfo.uiExtensionNodeId);
794     if (persistentId == INVALID_PERSISTENT_ID) {
795         TLOGE(WmsLogTag::WMS_EVENT, "invalid persistentId");
796         return std::nullopt;
797     }
798     return ExtensionWindowEventInfo {
799         .persistentId = persistentId,
800         .pid = constrainedModalUIExtInfo.uiExtensionPid,
801         .isConstrainedModal = true };
802 }
803 
ConstructDumpDisplayInfo(const MMI::DisplayInfo & displayInfo,std::ostringstream & dumpDisplayListStream)804 void SceneInputManager::ConstructDumpDisplayInfo(const MMI::DisplayInfo& displayInfo,
805     std::ostringstream& dumpDisplayListStream)
806 {
807     std::ostringstream transformStream;
808     transformStream << "[";
809     for (auto& it : displayInfo.transform) {
810         transformStream << it << ", ";
811     }
812     transformStream << "]";
813     dumpDisplayListStream << "id:" << displayInfo.id
814                           << "|x:" << displayInfo.x
815                           << "|y:" << displayInfo.y
816                           << "|width:" << displayInfo.width
817                           << "|height:" << displayInfo.height
818                           << "|dpi:" << displayInfo.dpi
819                           << "|name:" << displayInfo.name
820                           << "|direction:" << static_cast<int32_t>(displayInfo.direction)
821                           << "|displayDirection:" << static_cast<int32_t>(displayInfo.displayDirection)
822                           << "|displayMode:" << static_cast<int32_t>(displayInfo.displayMode)
823                           << "|transform:" << transformStream.str()
824                           << "|screenOneHandX:" << displayInfo.oneHandX
825                           << "|screenOneHandY:" << displayInfo.oneHandY
826                           << "|scalePercent:" << displayInfo.scalePercent
827                           << "|expandHeight:" << displayInfo.expandHeight
828                           << "|isCurrentOffScreenRendering:" << displayInfo.isCurrentOffScreenRendering
829                           << "|displaySourceMode:" << static_cast<int32_t>(displayInfo.displaySourceMode)
830                           << "|screenArea.id:" << displayInfo.screenArea.id
831                           << "|screenArea.area:[" << displayInfo.screenArea.area.x << ","
832                           << displayInfo.screenArea.area.y << ","
833                           << displayInfo.screenArea.area.width << ","
834                           << displayInfo.screenArea.area.height << "]"
835                           << "|rsId:" << displayInfo.rsId
836                           << "|offsetX:" << displayInfo.offsetX
837                           << "|offsetY:" << displayInfo.offsetY
838                           << "|pointerActiveWidth:" << displayInfo.pointerActiveWidth
839                           << "|pointerActiveHeight:" << displayInfo.pointerActiveHeight << ", ";
840 }
841 
ConstructDumpWindowInfo(const MMI::WindowInfo & windowInfo,std::ostringstream & dumpWindowListStream)842 void SceneInputManager::ConstructDumpWindowInfo(const MMI::WindowInfo& windowInfo,
843     std::ostringstream& dumpWindowListStream)
844 {
845     std::ostringstream transformStream;
846     transformStream << "[";
847     for (auto& it : windowInfo.transform) {
848         transformStream << it << ", ";
849     }
850     transformStream << "]";
851     std::ostringstream defaultHotAreasStream;
852     for (auto& defaultHotArea : windowInfo.defaultHotAreas) {
853         std::ostringstream defaultHotAreaStream;
854         defaultHotAreaStream << "[" << defaultHotArea.x << ", " <<defaultHotArea.y << ", "
855                              << defaultHotArea.width << ", " <<defaultHotArea.height << "]";
856         defaultHotAreasStream << defaultHotAreaStream.str() << " ";
857     }
858     std::ostringstream pointerHotAreasStream;
859     for (auto& pointerHotArea : windowInfo.pointerHotAreas) {
860         std::ostringstream pointerHotAreaStream;
861         pointerHotAreaStream << "[" << pointerHotArea.x << ", " <<pointerHotArea.y << ", "
862                              << pointerHotArea.width << ", " <<pointerHotArea.height << "]";
863         pointerHotAreasStream << pointerHotAreaStream.str() << " ";
864     }
865     std::ostringstream pointerChangeAreasStream;
866     pointerChangeAreasStream << "[";
867     for (auto& pointerChangeArea : windowInfo.pointerChangeAreas) {
868         pointerChangeAreasStream << pointerChangeArea << ", ";
869     }
870     pointerChangeAreasStream << "]";
871     dumpWindowListStream << "id:" << windowInfo.id << "|pid:" << windowInfo.pid << "|uid:" << windowInfo.uid
872                           << "|area:[" << windowInfo.area.x << ", " << windowInfo.area.y << ", "
873                           << windowInfo.area.width << ", " << windowInfo.area.height << "]"
874                           << "|defaultHotAreas:" << defaultHotAreasStream.str()
875                           << "|pointerHotAreas:" << pointerHotAreasStream.str() << "|agentWindowId:"
876                           << windowInfo.agentWindowId << "|action:" << static_cast<uint32_t>(windowInfo.action)
877                           << "|displayId:" << windowInfo.displayId << "|zOrder:" << windowInfo.zOrder
878                           << "|pointerChangeAreas:" << pointerChangeAreasStream.str() << "|transform:"
879                           << transformStream.str() << "|windowInputType:"
880                           << static_cast<int32_t>(windowInfo.windowInputType) << "|windowType:"
881                           << windowInfo.windowType << "|isSkipSelfWhenShowOnVirtualScreen:"
882                           << windowInfo.isSkipSelfWhenShowOnVirtualScreen << "|windowNameType:"
883                           << windowInfo.windowNameType << "|groupId:" << windowInfo.groupId
884                           << "|flags:" << windowInfo.flags << ", ";
885 }
886 }
887 } // namespace OHOS::Rosen
888