• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-2022 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 "zidl/window_manager_stub.h"
17 #include <ipc_skeleton.h>
18 #include <key_event.h>
19 #include <rs_iwindow_animation_controller.h>
20 #include <rs_window_animation_target.h>
21 
22 #include "marshalling_helper.h"
23 #include "memory_guard.h"
24 #include "window_manager_hilog.h"
25 
26 namespace OHOS {
27 namespace Rosen {
28 namespace {
29 constexpr HiviewDFX::HiLogLabel LABEL = {LOG_CORE, HILOG_DOMAIN_WINDOW, "WindowManagerStub"};
30 }
31 
OnRemoteRequest(uint32_t code,MessageParcel & data,MessageParcel & reply,MessageOption & option)32 int32_t WindowManagerStub::OnRemoteRequest(uint32_t code, MessageParcel& data, MessageParcel& reply,
33     MessageOption& option)
34 {
35     MemoryGuard cacheGuard;
36     if (data.ReadInterfaceToken() != GetDescriptor()) {
37         WLOGFE("InterfaceToken check failed");
38         return ERR_TRANSACTION_FAILED;
39     }
40     auto msgId = static_cast<WindowManagerMessage>(code);
41     switch (msgId) {
42         case WindowManagerMessage::TRANS_ID_CREATE_WINDOW: {
43             sptr<IRemoteObject> windowObject = data.ReadRemoteObject();
44             sptr<IWindow> windowProxy = iface_cast<IWindow>(windowObject);
45             sptr<WindowProperty> windowProperty = data.ReadStrongParcelable<WindowProperty>();
46             std::shared_ptr<RSSurfaceNode> surfaceNode = RSSurfaceNode::Unmarshalling(data);
47             uint32_t windowId;
48             sptr<IRemoteObject> token = nullptr;
49             if (windowProperty && windowProperty->GetTokenState()) {
50                 token = data.ReadRemoteObject();
51             }
52             WMError errCode = CreateWindow(windowProxy, windowProperty, surfaceNode, windowId, token);
53             reply.WriteUint32(windowId);
54             reply.WriteInt32(static_cast<int32_t>(errCode));
55             if (windowProperty) {
56                 reply.WriteUint32(windowProperty->GetWindowFlags());
57                 reply.WriteUint32(windowProperty->GetApiCompatibleVersion());
58             }
59             break;
60         }
61         case WindowManagerMessage::TRANS_ID_ADD_WINDOW: {
62             sptr<WindowProperty> windowProperty = data.ReadStrongParcelable<WindowProperty>();
63             WMError errCode = AddWindow(windowProperty);
64             reply.WriteInt32(static_cast<int32_t>(errCode));
65             break;
66         }
67         case WindowManagerMessage::TRANS_ID_REMOVE_WINDOW: {
68             uint32_t windowId = 0;
69             if (!data.ReadUint32(windowId)) {
70                 TLOGE(WmsLogTag::WMS_LIFE, "TRANS_ID_REMOVE_WINDOW Read windowId failed.");
71                 return ERR_INVALID_DATA;
72             }
73             bool isFromInnerkits = false;
74             if (!data.ReadBool(isFromInnerkits)) {
75                 TLOGE(WmsLogTag::WMS_LIFE, "TRANS_ID_REMOVE_WINDOW Read isFromInnerkits failed.");
76                 return ERR_INVALID_DATA;
77             }
78             WMError errCode = RemoveWindow(windowId, isFromInnerkits);
79             reply.WriteInt32(static_cast<int32_t>(errCode));
80             break;
81         }
82         case WindowManagerMessage::TRANS_ID_DESTROY_WINDOW: {
83             uint32_t windowId = 0;
84             if (!data.ReadUint32(windowId)) {
85                 TLOGE(WmsLogTag::WMS_LIFE, "TRANS_ID_DESTROY_WINDOW Read windowId failed.");
86                 return ERR_INVALID_DATA;
87             }
88             WMError errCode = DestroyWindow(windowId);
89             reply.WriteInt32(static_cast<int32_t>(errCode));
90             break;
91         }
92         case WindowManagerMessage::TRANS_ID_REQUEST_FOCUS: {
93             uint32_t windowId = 0;
94             if (!data.ReadUint32(windowId)) {
95                 TLOGE(WmsLogTag::WMS_FOCUS, "read focus failed");
96                 return ERR_INVALID_DATA;
97             }
98             WMError errCode = RequestFocus(windowId);
99             reply.WriteInt32(static_cast<int32_t>(errCode));
100             break;
101         }
102         case WindowManagerMessage::TRANS_ID_GET_AVOID_AREA: {
103             uint32_t windowId = data.ReadUint32();
104             uint32_t avoidAreaTypeId = 0;
105             if (!data.ReadUint32(avoidAreaTypeId) ||
106                 avoidAreaTypeId >= static_cast<uint32_t>(AvoidAreaType::TYPE_END)) {
107                 return ERR_INVALID_DATA;
108             }
109             auto avoidAreaType = static_cast<AvoidAreaType>(avoidAreaTypeId);
110             Rect rect = {};
111             if (!data.ReadInt32(rect.posX_) || !data.ReadInt32(rect.posY_) ||
112                 !data.ReadUint32(rect.width_) || !data.ReadUint32(rect.height_)) {
113                 TLOGE(WmsLogTag::WMS_IMMS, "read rect error");
114                 return ERR_INVALID_DATA;
115             }
116             AvoidArea avoidArea = GetAvoidAreaByType(windowId, avoidAreaType, rect);
117             reply.WriteParcelable(&avoidArea);
118             break;
119         }
120         case WindowManagerMessage::TRANS_ID_REGISTER_WINDOW_MANAGER_AGENT: {
121             uint32_t windowType = 0;
122             if (!data.ReadUint32(windowType) ||
123                 windowType >= static_cast<uint32_t>(WindowManagerAgentType::WINDOW_MANAGER_AGENT_TYPE_END)) {
124                 return ERR_INVALID_DATA;
125             }
126             auto type = static_cast<WindowManagerAgentType>(windowType);
127             sptr<IRemoteObject> windowManagerAgentObject = data.ReadRemoteObject();
128             if (windowManagerAgentObject == nullptr) {
129                 return ERR_INVALID_DATA;
130             }
131             sptr<IWindowManagerAgent> windowManagerAgentProxy =
132                 iface_cast<IWindowManagerAgent>(windowManagerAgentObject);
133             WMError errCode = RegisterWindowManagerAgent(type, windowManagerAgentProxy);
134             reply.WriteInt32(static_cast<int32_t>(errCode));
135             break;
136         }
137         case WindowManagerMessage::TRANS_ID_UNREGISTER_WINDOW_MANAGER_AGENT: {
138             uint32_t windowType = 0;
139             if (!data.ReadUint32(windowType) ||
140                 windowType >= static_cast<uint32_t>(WindowManagerAgentType::WINDOW_MANAGER_AGENT_TYPE_END)) {
141                 return ERR_INVALID_DATA;
142             }
143             auto type = static_cast<WindowManagerAgentType>(windowType);
144             sptr<IRemoteObject> windowManagerAgentObject = data.ReadRemoteObject();
145             if (windowManagerAgentObject == nullptr) {
146                 return ERR_INVALID_DATA;
147             }
148             sptr<IWindowManagerAgent> windowManagerAgentProxy =
149                 iface_cast<IWindowManagerAgent>(windowManagerAgentObject);
150             WMError errCode = UnregisterWindowManagerAgent(type, windowManagerAgentProxy);
151             reply.WriteInt32(static_cast<int32_t>(errCode));
152             break;
153         }
154         case WindowManagerMessage::TRANS_ID_NOTIFY_READY_MOVE_OR_DRAG: {
155             uint32_t windowId = 0;
156             if (!data.ReadUint32(windowId)) {
157                 return ERR_INVALID_DATA;
158             }
159             sptr<WindowProperty> windowProperty = data.ReadStrongParcelable<WindowProperty>();
160             if (windowProperty == nullptr) {
161                 return ERR_INVALID_DATA;
162             }
163             sptr<MoveDragProperty> moveDragProperty = data.ReadStrongParcelable<MoveDragProperty>();
164             if (moveDragProperty == nullptr) {
165                 return ERR_INVALID_DATA;
166             }
167             NotifyServerReadyToMoveOrDrag(windowId, windowProperty, moveDragProperty);
168             break;
169         }
170         case WindowManagerMessage::TRANS_ID_PROCESS_POINT_DOWN: {
171             uint32_t windowId = 0;
172             if (!data.ReadUint32(windowId)) {
173                 return ERR_INVALID_DATA;
174             }
175             bool isPointDown = false;
176             if (!data.ReadBool(isPointDown)) {
177                 return ERR_INVALID_DATA;
178             }
179             ProcessPointDown(windowId, isPointDown);
180             break;
181         }
182         case WindowManagerMessage::TRANS_ID_PROCESS_POINT_UP: {
183             uint32_t windowId = 0;
184             if (!data.ReadUint32(windowId)) {
185                 return ERR_INVALID_DATA;
186             }
187             ProcessPointUp(windowId);
188             break;
189         }
190         case WindowManagerMessage::TRANS_ID_GET_TOP_WINDOW_ID: {
191             uint32_t mainWinId = 0;
192             if (!data.ReadUint32(mainWinId)) {
193                 TLOGE(WmsLogTag::WMS_HIERARCHY, "read mainWinId failed");
194                 return ERR_INVALID_DATA;
195             }
196             uint32_t topWinId = 0;
197             WMError errCode = GetTopWindowId(mainWinId, topWinId);
198             reply.WriteUint32(topWinId);
199             reply.WriteInt32(static_cast<int32_t>(errCode));
200             break;
201         }
202         case WindowManagerMessage::TRANS_ID_MINIMIZE_ALL_APP_WINDOWS: {
203             uint64_t displayId = 0;
204             if (!data.ReadUint64(displayId)) {
205                 TLOGE(WmsLogTag::WMS_LIFE, "Read displayID failed.");
206                 return ERR_INVALID_DATA;
207             }
208             WMError errCode = MinimizeAllAppWindows(displayId);
209             reply.WriteInt32(static_cast<int32_t>(errCode));
210             break;
211         }
212         case WindowManagerMessage::TRANS_ID_TOGGLE_SHOWN_STATE_FOR_ALL_APP_WINDOWS: {
213             WMError errCode = ToggleShownStateForAllAppWindows();
214             reply.WriteInt32(static_cast<int32_t>(errCode));
215             break;
216         }
217         case WindowManagerMessage::TRANS_ID_UPDATE_LAYOUT_MODE: {
218             uint32_t layoutMode = 0;
219             if (!data.ReadUint32(layoutMode)) {
220                 TLOGE(WmsLogTag::WMS_LAYOUT, "read layoutMode failed");
221                 return ERR_INVALID_DATA;
222             }
223             auto mode = static_cast<WindowLayoutMode>(layoutMode);
224             WMError errCode = SetWindowLayoutMode(mode);
225             reply.WriteInt32(static_cast<int32_t>(errCode));
226             break;
227         }
228         case WindowManagerMessage::TRANS_ID_NOTIFY_SCREEN_SHOT_EVENT: {
229             int32_t screenshotEventType = 0;
230             if (!data.ReadInt32(screenshotEventType)) {
231                 TLOGE(WmsLogTag::WMS_ATTRIBUTE, "read screenshotEventType failed");
232                 return ERR_INVALID_DATA;
233             }
234             WMError errCode = NotifyScreenshotEvent(static_cast<ScreenshotEventType>(screenshotEventType));
235             reply.WriteInt32(static_cast<int32_t>(errCode));
236             break;
237         }
238         case WindowManagerMessage::TRANS_ID_UPDATE_PROPERTY: {
239             uint32_t actionValue = 0;
240             if (!data.ReadUint32(actionValue)) {
241                 TLOGE(WmsLogTag::DEFAULT, "read action error");
242                 return ERR_INVALID_DATA;
243             }
244             auto action = static_cast<PropertyChangeAction>(actionValue);
245             sptr<WindowProperty> windowProperty = new WindowProperty();
246             windowProperty->Read(data, action);
247             WMError errCode = UpdateProperty(windowProperty, action);
248             reply.WriteInt32(static_cast<int32_t>(errCode));
249             break;
250         }
251         case WindowManagerMessage::TRANS_ID_GET_ACCESSIBILITY_WINDOW_INFO_ID: {
252             std::vector<sptr<AccessibilityWindowInfo>> infos;
253             WMError errCode = GetAccessibilityWindowInfo(infos);
254             if (!MarshallingHelper::MarshallingVectorParcelableObj<AccessibilityWindowInfo>(reply, infos)) {
255                 WLOGFE("Write accessibility window infos failed");
256                 return -1;
257             }
258             reply.WriteInt32(static_cast<int32_t>(errCode));
259             break;
260         }
261         case WindowManagerMessage::TRANS_ID_GET_UNRELIABLE_WINDOW_INFO_ID: {
262             int32_t windowId = 0;
263             if (!data.ReadInt32(windowId)) {
264                 WLOGFE("Failed to readInt32 windowId");
265                 return ERR_INVALID_DATA;
266             }
267             std::vector<sptr<UnreliableWindowInfo>> infos;
268             WMError errCode = GetUnreliableWindowInfo(windowId, infos);
269             if (!MarshallingHelper::MarshallingVectorParcelableObj<UnreliableWindowInfo>(reply, infos)) {
270                 WLOGFE("Write unreliable window infos failed");
271                 return ERR_INVALID_DATA;
272             }
273             reply.WriteInt32(static_cast<int32_t>(errCode));
274             break;
275         }
276         case WindowManagerMessage::TRANS_ID_GET_VISIBILITY_WINDOW_INFO_ID: {
277             std::vector<sptr<WindowVisibilityInfo>> infos;
278             WMError errCode = GetVisibilityWindowInfo(infos);
279             if (!MarshallingHelper::MarshallingVectorParcelableObj<WindowVisibilityInfo>(reply, infos)) {
280                 WLOGFE("Write visibility window infos failed");
281                 return -1;
282             }
283             reply.WriteInt32(static_cast<int32_t>(errCode));
284             break;
285         }
286         case WindowManagerMessage::TRANS_ID_ANIMATION_SET_CONTROLLER: {
287             sptr<IRemoteObject> controllerObject = data.ReadRemoteObject();
288             if (controllerObject == nullptr) {
289                 TLOGE(WmsLogTag::DEFAULT, "Read animation controller object failed");
290                 return ERR_INVALID_DATA;
291             }
292             sptr<RSIWindowAnimationController> controller = iface_cast<RSIWindowAnimationController>(controllerObject);
293             WMError errCode = SetWindowAnimationController(controller);
294             reply.WriteInt32(static_cast<int32_t>(errCode));
295             break;
296         }
297         case WindowManagerMessage::TRANS_ID_GET_SYSTEM_CONFIG: {
298             SystemConfig config;
299             WMError errCode = GetSystemConfig(config);
300             reply.WriteParcelable(&config);
301             reply.WriteInt32(static_cast<int32_t>(errCode));
302             break;
303         }
304         case WindowManagerMessage::TRANS_ID_NOTIFY_WINDOW_TRANSITION: {
305             sptr<WindowTransitionInfo> from = data.ReadParcelable<WindowTransitionInfo>();
306             sptr<WindowTransitionInfo> to = data.ReadParcelable<WindowTransitionInfo>();
307             bool isFromClient = false;
308             if (!data.ReadBool(isFromClient)) {
309                 return ERR_INVALID_DATA;
310             }
311             WMError errCode = NotifyWindowTransition(from, to, isFromClient);
312             reply.WriteInt32(static_cast<int32_t>(errCode));
313             break;
314         }
315         case WindowManagerMessage::TRANS_ID_GET_FULLSCREEN_AND_SPLIT_HOT_ZONE: {
316             DisplayId displayId = 0;
317             if (!data.ReadUint64(displayId)) {
318                 TLOGE(WmsLogTag::WMS_FOCUS, "read displayId failed");
319                 return ERR_INVALID_DATA;
320             }
321             ModeChangeHotZones hotZones = { { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 } };
322             WMError errCode = GetModeChangeHotZones(displayId, hotZones);
323             reply.WriteInt32(static_cast<int32_t>(errCode));
324 
325             reply.WriteInt32(hotZones.fullscreen_.posX_);
326             reply.WriteInt32(hotZones.fullscreen_.posY_);
327             reply.WriteUint32(hotZones.fullscreen_.width_);
328             reply.WriteUint32(hotZones.fullscreen_.height_);
329 
330             reply.WriteInt32(hotZones.primary_.posX_);
331             reply.WriteInt32(hotZones.primary_.posY_);
332             reply.WriteUint32(hotZones.primary_.width_);
333             reply.WriteUint32(hotZones.primary_.height_);
334 
335             reply.WriteInt32(hotZones.secondary_.posX_);
336             reply.WriteInt32(hotZones.secondary_.posY_);
337             reply.WriteUint32(hotZones.secondary_.width_);
338             reply.WriteUint32(hotZones.secondary_.height_);
339             break;
340         }
341         case WindowManagerMessage::TRANS_ID_GET_ANIMATION_CALLBACK: {
342             std::vector<uint32_t> windowIds;
343             data.ReadUInt32Vector(&windowIds);
344             bool isAnimated = data.ReadBool();
345             sptr<RSIWindowAnimationFinishedCallback> finishedCallback = nullptr;
346             MinimizeWindowsByLauncher(windowIds, isAnimated, finishedCallback);
347             if (finishedCallback == nullptr) {
348                 if (!reply.WriteBool(false)) {
349                     WLOGFE("finishedCallback is nullptr and failed to write!");
350                     return ERR_INVALID_DATA;
351                 }
352             } else {
353                 if (!reply.WriteBool(true) || !reply.WriteRemoteObject(finishedCallback->AsObject())) {
354                     WLOGFE("finishedCallback is not nullptr and failed to write!");
355                     return ERR_INVALID_DATA;
356                 }
357             }
358             break;
359         }
360         case WindowManagerMessage::TRANS_ID_UPDATE_AVOIDAREA_LISTENER: {
361             uint32_t windowId = 0;
362             if (!data.ReadUint32(windowId)) {
363                 return ERR_INVALID_DATA;
364             }
365             bool haveAvoidAreaListener = false;
366             if (!data.ReadBool(haveAvoidAreaListener)) {
367                 return ERR_INVALID_DATA;
368             }
369             WMError errCode = UpdateAvoidAreaListener(windowId, haveAvoidAreaListener);
370             reply.WriteInt32(static_cast<int32_t>(errCode));
371             break;
372         }
373         case WindowManagerMessage::TRANS_ID_UPDATE_RS_TREE: {
374             uint32_t windowId = 0;
375             if (!data.ReadUint32(windowId)) {
376                 return ERR_INVALID_DATA;
377             }
378             bool isAdd = false;
379             if (!data.ReadBool(isAdd)) {
380                 return ERR_INVALID_DATA;
381             }
382             WMError errCode = UpdateRsTree(windowId, isAdd);
383             reply.WriteInt32(static_cast<int32_t>(errCode));
384             break;
385         }
386         case WindowManagerMessage::TRANS_ID_BIND_DIALOG_TARGET: {
387             uint32_t windowId = 0;
388             if (!data.ReadUint32(windowId)) {
389                 TLOGE(WmsLogTag::DEFAULT, "Failed to read windowId");
390                 return ERR_INVALID_DATA;
391             }
392             sptr<IRemoteObject> targetToken = data.ReadRemoteObject();
393             if (targetToken == nullptr) {
394                 TLOGE(WmsLogTag::WMS_DIALOG, "Read targetToken object failed!");
395                 return ERR_INVALID_DATA;
396             }
397             WMError errCode = BindDialogTarget(windowId, targetToken);
398             reply.WriteInt32(static_cast<int32_t>(errCode));
399             break;
400         }
401         case WindowManagerMessage::TRANS_ID_SET_ANCHOR_AND_SCALE : {
402             int32_t x = 0;
403             int32_t y = 0;
404             if (!data.ReadInt32(x) || !data.ReadInt32(y)) {
405                 return ERR_INVALID_DATA;
406             }
407             float scale = 0.0f;
408             if (!data.ReadFloat(scale)) {
409                 return ERR_INVALID_DATA;
410             }
411             SetAnchorAndScale(x, y, scale);
412             break;
413         }
414         case WindowManagerMessage::TRANS_ID_SET_ANCHOR_OFFSET: {
415             int32_t deltaX = 0;
416             int32_t deltaY = 0;
417             if (!data.ReadInt32(deltaX) || !data.ReadInt32(deltaY)) {
418                 return ERR_INVALID_DATA;
419             }
420             SetAnchorOffset(deltaX, deltaY);
421             break;
422         }
423         case WindowManagerMessage::TRANS_ID_OFF_WINDOW_ZOOM: {
424             OffWindowZoom();
425             break;
426         }
427         case WindowManagerMessage::TRANS_ID_RAISE_WINDOW_Z_ORDER: {
428             uint32_t windowId = 0;
429             if (!data.ReadUint32(windowId)) {
430                 TLOGE(WmsLogTag::WMS_HIERARCHY, "read windowId failed");
431                 return ERR_INVALID_DATA;
432             }
433             WMError errCode = RaiseToAppTop(windowId);
434             reply.WriteInt32(static_cast<int32_t>(errCode));
435             break;
436         }
437         case WindowManagerMessage::TRANS_ID_GET_SNAPSHOT: {
438             uint32_t windowId = 0;
439             if (!data.ReadUint32(windowId)) {
440                 TLOGE(WmsLogTag::WMS_ATTRIBUTE, "read windowId error");
441                 return ERR_INVALID_DATA;
442             }
443             std::shared_ptr<Media::PixelMap> pixelMap = GetSnapshot(windowId);
444             reply.WriteParcelable(pixelMap.get());
445             break;
446         }
447         case WindowManagerMessage::TRANS_ID_GESTURE_NAVIGATION_ENABLED: {
448             bool enable = data.ReadBool();
449             WMError errCode = SetGestureNavigationEnabled(enable);
450             reply.WriteInt32(static_cast<int32_t>(errCode));
451             break;
452         }
453         case WindowManagerMessage::TRANS_ID_SET_WINDOW_GRAVITY: {
454             uint32_t windowId = INVALID_WINDOW_ID;
455             if (!data.ReadUint32(windowId)) {
456                 TLOGE(WmsLogTag::WMS_KEYBOARD, "Read windowId failed.");
457                 return ERR_INVALID_DATA;
458             }
459             uint32_t gravityValue = 0;
460             if (!data.ReadUint32(gravityValue) ||
461                 gravityValue < static_cast<uint32_t>(WindowGravity::WINDOW_GRAVITY_FLOAT) ||
462                 gravityValue > static_cast<uint32_t>(WindowGravity::WINDOW_GRAVITY_BOTTOM)) {
463                 TLOGE(WmsLogTag::WMS_KEYBOARD, "Window gravity value read failed, gravityValue: %{public}d",
464                     gravityValue);
465                 return ERR_INVALID_DATA;
466             }
467             WindowGravity gravity = static_cast<WindowGravity>(gravityValue);
468             uint32_t percent = 0;
469             if (!data.ReadUint32(percent)) {
470                 TLOGE(WmsLogTag::WMS_KEYBOARD, "Percent read failed.");
471                 return ERR_INVALID_DATA;
472             }
473             WMError errCode = SetWindowGravity(windowId, gravity, percent);
474             reply.WriteInt32(static_cast<int32_t>(errCode));
475             break;
476         }
477         case WindowManagerMessage::TRANS_ID_DISPATCH_KEY_EVENT: {
478             uint32_t windowId = 0;
479             if (!data.ReadUint32(windowId)) {
480                 TLOGE(WmsLogTag::WMS_EVENT, "Read failed!");
481                 return ERR_INVALID_DATA;
482             }
483             std::shared_ptr<MMI::KeyEvent> event = MMI::KeyEvent::Create();
484             if (event == nullptr) {
485                 TLOGE(WmsLogTag::WMS_EVENT, "event is null");
486                 return ERR_INVALID_DATA;
487             }
488             event->ReadFromParcel(data);
489             DispatchKeyEvent(windowId, event);
490             break;
491         }
492         case WindowManagerMessage::TRANS_ID_NOTIFY_DUMP_INFO_RESULT: {
493             std::vector<std::string> info;
494             if (!data.ReadStringVector(&info)) {
495                 return ERR_INVALID_DATA;
496             }
497             NotifyDumpInfoResult(info);
498             break;
499         }
500         case WindowManagerMessage::TRANS_ID_GET_WINDOW_ANIMATION_TARGETS: {
501             std::vector<uint32_t> missionIds;
502             if (!data.ReadUInt32Vector(&missionIds)) {
503                 TLOGE(WmsLogTag::DEFAULT, "Read animation target mission ids failed");
504                 return ERR_INVALID_DATA;
505             }
506             std::vector<sptr<RSWindowAnimationTarget>> targets;
507             WMError errCode = GetWindowAnimationTargets(missionIds, targets);
508             if (!MarshallingHelper::MarshallingVectorParcelableObj<RSWindowAnimationTarget>(reply, targets)) {
509                 WLOGFE("Write window animation targets failed");
510                 return ERR_INVALID_DATA;
511             }
512             reply.WriteInt32(static_cast<int32_t>(errCode));
513             break;
514         }
515         case WindowManagerMessage::TRANS_ID_SET_MAXIMIZE_MODE: {
516             uint32_t modeId = 0;
517             if (!data.ReadUint32(modeId) || modeId >= static_cast<uint32_t>(MaximizeMode::MODE_END)) {
518                 return ERR_INVALID_DATA;
519             }
520             MaximizeMode maximizeMode = static_cast<MaximizeMode>(modeId);
521             SetMaximizeMode(maximizeMode);
522             break;
523         }
524         case WindowManagerMessage::TRANS_ID_GET_MAXIMIZE_MODE: {
525             MaximizeMode maximizeMode = GetMaximizeMode();
526             reply.WriteInt32(static_cast<int32_t>(maximizeMode));
527             break;
528         }
529         case WindowManagerMessage::TRANS_ID_GET_FOCUS_WINDOW_INFO: {
530             FocusChangeInfo focusInfo;
531             uint64_t displayId = 0;
532             if (!data.ReadUint64(displayId)) {
533                 TLOGE(WmsLogTag::WMS_FOCUS, "Failed to read displayId");
534                 return ERR_INVALID_DATA;
535             }
536             GetFocusWindowInfo(focusInfo, displayId);
537             reply.WriteParcelable(&focusInfo);
538             break;
539         }
540         default:
541             WLOGFW("unknown transaction code %{public}d", code);
542             return IPCObjectStub::OnRemoteRequest(code, data, reply, option);
543     }
544     return ERR_NONE;
545 }
546 } // namespace Rosen
547 } // namespace OHOS
548