• 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/display_manager_agent_proxy.h"
17 
18 #include <ipc_types.h>
19 
20 #include "dm_common.h"
21 #include "marshalling_helper.h"
22 #include "window_manager_hilog.h"
23 
24 namespace OHOS {
25 namespace Rosen {
26 
NotifyDisplayPowerEvent(DisplayPowerEvent event,EventStatus status)27 void DisplayManagerAgentProxy::NotifyDisplayPowerEvent(DisplayPowerEvent event, EventStatus status)
28 {
29     sptr<IRemoteObject> remote = Remote();
30     if (remote == nullptr) {
31         TLOGW(WmsLogTag::DMS, "remote is nullptr");
32         return;
33     }
34 
35     MessageParcel data;
36     MessageParcel reply;
37     MessageOption option;
38     if (!data.WriteInterfaceToken(GetDescriptor())) {
39         TLOGE(WmsLogTag::DMS, "WriteInterfaceToken failed");
40         return;
41     }
42 
43     if (!data.WriteUint32(static_cast<uint32_t>(event))) {
44         TLOGE(WmsLogTag::DMS, "Write event failed");
45         return;
46     }
47 
48     if (!data.WriteUint32(static_cast<uint32_t>(status))) {
49         TLOGE(WmsLogTag::DMS, "Write status failed");
50         return;
51     }
52 
53     if (remote->SendRequest(TRANS_ID_NOTIFY_DISPLAY_POWER_EVENT, data, reply, option) != ERR_NONE) {
54         TLOGE(WmsLogTag::DMS, "SendRequest failed");
55     }
56 }
57 
NotifyDisplayStateChanged(DisplayId id,DisplayState state)58 void DisplayManagerAgentProxy::NotifyDisplayStateChanged(DisplayId id, DisplayState state)
59 {
60     sptr<IRemoteObject> remote = Remote();
61     if (remote == nullptr) {
62         TLOGW(WmsLogTag::DMS, "remote is nullptr");
63         return;
64     }
65 
66     MessageParcel data;
67     MessageParcel reply;
68     MessageOption option;
69     if (!data.WriteInterfaceToken(GetDescriptor())) {
70         TLOGE(WmsLogTag::DMS, "WriteInterfaceToken failed");
71         return;
72     }
73 
74     if (!data.WriteUint32(static_cast<uint32_t>(state))) {
75         TLOGE(WmsLogTag::DMS, "Write DisplayState failed");
76         return;
77     }
78 
79     if (!data.WriteUint64(static_cast<uint64_t>(id))) {
80         TLOGE(WmsLogTag::DMS, "Write displayId failed");
81         return;
82     }
83 
84     if (remote->SendRequest(TRANS_ID_NOTIFY_DISPLAY_STATE_CHANGED, data, reply, option) != ERR_NONE) {
85         TLOGE(WmsLogTag::DMS, "SendRequest failed");
86     }
87 }
88 
OnScreenConnect(sptr<ScreenInfo> screenInfo)89 void DisplayManagerAgentProxy::OnScreenConnect(sptr<ScreenInfo> screenInfo)
90 {
91     sptr<IRemoteObject> remote = Remote();
92     if (remote == nullptr) {
93         TLOGW(WmsLogTag::DMS, "remote is nullptr");
94         return;
95     }
96 
97     MessageParcel data;
98     MessageParcel reply;
99     MessageOption option(MessageOption::TF_ASYNC);
100     if (!data.WriteInterfaceToken(GetDescriptor())) {
101         TLOGE(WmsLogTag::DMS, "WriteInterfaceToken failed");
102         return;
103     }
104 
105     if (!data.WriteParcelable(screenInfo.GetRefPtr())) {
106         TLOGE(WmsLogTag::DMS, "Write ScreenInfo failed");
107         return;
108     }
109 
110     if (remote->SendRequest(TRANS_ID_ON_SCREEN_CONNECT, data, reply, option) != ERR_NONE) {
111         TLOGE(WmsLogTag::DMS, "SendRequest failed");
112     }
113 }
114 
OnScreenDisconnect(ScreenId screenId)115 void DisplayManagerAgentProxy::OnScreenDisconnect(ScreenId screenId)
116 {
117     sptr<IRemoteObject> remote = Remote();
118     if (remote == nullptr) {
119         TLOGW(WmsLogTag::DMS, "remote is nullptr");
120         return;
121     }
122 
123     MessageParcel data;
124     MessageParcel reply;
125     MessageOption option(MessageOption::TF_ASYNC);
126     if (!data.WriteInterfaceToken(GetDescriptor())) {
127         TLOGE(WmsLogTag::DMS, "WriteInterfaceToken failed");
128         return;
129     }
130 
131     if (!data.WriteUint64(screenId)) {
132         TLOGE(WmsLogTag::DMS, "Write ScreenId failed");
133         return;
134     }
135 
136     if (remote->SendRequest(TRANS_ID_ON_SCREEN_DISCONNECT, data, reply, option) != ERR_NONE) {
137         TLOGE(WmsLogTag::DMS, "SendRequest failed");
138     }
139 }
140 
OnScreenChange(const sptr<ScreenInfo> & screenInfo,ScreenChangeEvent event)141 void DisplayManagerAgentProxy::OnScreenChange(const sptr<ScreenInfo>& screenInfo, ScreenChangeEvent event)
142 {
143     sptr<IRemoteObject> remote = Remote();
144     if (remote == nullptr) {
145         TLOGW(WmsLogTag::DMS, "remote is nullptr");
146         return;
147     }
148 
149     MessageParcel data;
150     MessageParcel reply;
151     MessageOption option(MessageOption::TF_ASYNC);
152     if (!data.WriteInterfaceToken(GetDescriptor())) {
153         TLOGE(WmsLogTag::DMS, "WriteInterfaceToken failed");
154         return;
155     }
156 
157     if (!data.WriteParcelable(screenInfo.GetRefPtr())) {
158         TLOGE(WmsLogTag::DMS, "Write screenInfo failed");
159         return;
160     }
161 
162     if (!data.WriteUint32(static_cast<uint32_t>(event))) {
163         TLOGE(WmsLogTag::DMS, "Write ScreenChangeEvent failed");
164         return;
165     }
166 
167     if (remote->SendRequest(TRANS_ID_ON_SCREEN_CHANGED, data, reply, option) != ERR_NONE) {
168         TLOGE(WmsLogTag::DMS, "SendRequest failed");
169     }
170 }
171 
OnScreenGroupChange(const std::string & trigger,const std::vector<sptr<ScreenInfo>> & screenInfos,ScreenGroupChangeEvent event)172 void DisplayManagerAgentProxy::OnScreenGroupChange(const std::string& trigger,
173     const std::vector<sptr<ScreenInfo>>& screenInfos, ScreenGroupChangeEvent event)
174 {
175     sptr<IRemoteObject> remote = Remote();
176     if (remote == nullptr) {
177         TLOGW(WmsLogTag::DMS, "remote is nullptr");
178         return;
179     }
180 
181     MessageParcel data;
182     MessageParcel reply;
183     MessageOption option(MessageOption::TF_ASYNC);
184     if (!data.WriteInterfaceToken(GetDescriptor())) {
185         TLOGE(WmsLogTag::DMS, "WriteInterfaceToken failed");
186         return;
187     }
188 
189     if (!data.WriteString(trigger)) {
190         TLOGE(WmsLogTag::DMS, "Write trigger failed");
191         return;
192     }
193 
194     if (!MarshallingHelper::MarshallingVectorParcelableObj<ScreenInfo>(data, screenInfos)) {
195         TLOGE(WmsLogTag::DMS, "Write screenInfos failed");
196         return;
197     }
198 
199     if (!data.WriteUint32(static_cast<uint32_t>(event))) {
200         TLOGE(WmsLogTag::DMS, "Write ScreenGroupChangeEvent failed");
201         return;
202     }
203 
204     if (remote->SendRequest(TRANS_ID_ON_SCREENGROUP_CHANGED, data, reply, option) != ERR_NONE) {
205         TLOGE(WmsLogTag::DMS, "SendRequest failed");
206     }
207 }
208 
OnDisplayCreate(sptr<DisplayInfo> displayInfo)209 void DisplayManagerAgentProxy::OnDisplayCreate(sptr<DisplayInfo> displayInfo)
210 {
211     sptr<IRemoteObject> remote = Remote();
212     if (remote == nullptr) {
213         TLOGW(WmsLogTag::DMS, "remote is nullptr");
214         return;
215     }
216 
217     MessageParcel data;
218     MessageParcel reply;
219     MessageOption option(MessageOption::TF_ASYNC);
220     if (!data.WriteInterfaceToken(GetDescriptor())) {
221         TLOGE(WmsLogTag::DMS, "WriteInterfaceToken failed");
222         return;
223     }
224 
225     if (!data.WriteParcelable(displayInfo.GetRefPtr())) {
226         TLOGE(WmsLogTag::DMS, "Write DisplayInfo failed");
227         return;
228     }
229 
230     if (remote->SendRequest(TRANS_ID_ON_DISPLAY_CONNECT, data, reply, option) != ERR_NONE) {
231         TLOGE(WmsLogTag::DMS, "SendRequest failed");
232     }
233 }
234 
OnDisplayDestroy(DisplayId displayId)235 void DisplayManagerAgentProxy::OnDisplayDestroy(DisplayId displayId)
236 {
237     sptr<IRemoteObject> remote = Remote();
238     if (remote == nullptr) {
239         TLOGW(WmsLogTag::DMS, "remote is nullptr");
240         return;
241     }
242 
243     MessageParcel data;
244     MessageParcel reply;
245     MessageOption option(MessageOption::TF_ASYNC);
246     if (!data.WriteInterfaceToken(GetDescriptor())) {
247         TLOGE(WmsLogTag::DMS, "WriteInterfaceToken failed");
248         return;
249     }
250 
251     if (!data.WriteUint64(displayId)) {
252         TLOGE(WmsLogTag::DMS, "Write DisplayId failed");
253         return;
254     }
255 
256     if (remote->SendRequest(TRANS_ID_ON_DISPLAY_DISCONNECT, data, reply, option) != ERR_NONE) {
257         TLOGE(WmsLogTag::DMS, "SendRequest failed");
258     }
259 }
260 
OnDisplayChange(sptr<DisplayInfo> displayInfo,DisplayChangeEvent event)261 void DisplayManagerAgentProxy::OnDisplayChange(sptr<DisplayInfo> displayInfo, DisplayChangeEvent event)
262 {
263     sptr<IRemoteObject> remote = Remote();
264     if (remote == nullptr) {
265         TLOGW(WmsLogTag::DMS, "remote is nullptr");
266         return;
267     }
268 
269     MessageParcel data;
270     MessageParcel reply;
271     MessageOption option(MessageOption::TF_ASYNC);
272     if (!data.WriteInterfaceToken(GetDescriptor())) {
273         TLOGE(WmsLogTag::DMS, "WriteInterfaceToken failed");
274         return;
275     }
276 
277     if (!data.WriteParcelable(displayInfo.GetRefPtr())) {
278         TLOGE(WmsLogTag::DMS, "Write DisplayInfo failed");
279         return;
280     }
281 
282     if (!data.WriteUint32(static_cast<uint32_t>(event))) {
283         TLOGE(WmsLogTag::DMS, "Write DisplayChangeEvent failed");
284         return;
285     }
286 
287     if (remote->SendRequest(TRANS_ID_ON_DISPLAY_CHANGED, data, reply, option) != ERR_NONE) {
288         TLOGE(WmsLogTag::DMS, "SendRequest failed");
289     }
290 }
291 
OnScreenshot(sptr<ScreenshotInfo> snapshotInfo)292 void DisplayManagerAgentProxy::OnScreenshot(sptr<ScreenshotInfo> snapshotInfo)
293 {
294     sptr<IRemoteObject> remote = Remote();
295     if (remote == nullptr) {
296         TLOGW(WmsLogTag::DMS, "remote is nullptr");
297         return;
298     }
299 
300     MessageParcel data;
301     MessageParcel reply;
302     MessageOption option(MessageOption::TF_ASYNC);
303     if (!data.WriteInterfaceToken(GetDescriptor())) {
304         TLOGE(WmsLogTag::DMS, "WriteInterfaceToken failed");
305         return;
306     }
307     if (!data.WriteParcelable(snapshotInfo.GetRefPtr())) {
308         TLOGE(WmsLogTag::DMS, "Write ScreenshotInfo failed");
309         return;
310     }
311     if (remote->SendRequest(TRANS_ID_ON_SCREEN_SHOT, data, reply, option) != ERR_NONE) {
312         TLOGE(WmsLogTag::DMS, "SendRequest failed");
313     }
314 }
315 
NotifyPrivateWindowStateChanged(bool hasPrivate)316 void DisplayManagerAgentProxy::NotifyPrivateWindowStateChanged(bool hasPrivate)
317 {
318     sptr<IRemoteObject> remote = Remote();
319     if (remote == nullptr) {
320         TLOGW(WmsLogTag::DMS, "remote is nullptr");
321         return;
322     }
323 
324     MessageParcel data;
325     MessageParcel reply;
326     MessageOption option(MessageOption::TF_ASYNC);
327     if (!data.WriteInterfaceToken(GetDescriptor())) {
328         TLOGE(WmsLogTag::DMS, "WriteInterfaceToken failed");
329         return;
330     }
331     if (!data.WriteBool(hasPrivate)) {
332         TLOGE(WmsLogTag::DMS, "Write private info failed");
333         return;
334     }
335     if (remote->SendRequest(TRANS_ID_ON_PRIVATE_WINDOW, data, reply, option) != ERR_NONE) {
336         TLOGE(WmsLogTag::DMS, "SendRequest failed");
337     }
338 }
339 
NotifyPrivateStateWindowListChanged(DisplayId id,std::vector<std::string> privacyWindowList)340 void DisplayManagerAgentProxy::NotifyPrivateStateWindowListChanged(DisplayId id,
341     std::vector<std::string> privacyWindowList)
342 {
343     sptr<IRemoteObject> remote = Remote();
344     if (remote == nullptr) {
345         TLOGW(WmsLogTag::DMS, "remote is nullptr");
346         return;
347     }
348 
349     MessageParcel data;
350     MessageParcel reply;
351     MessageOption option(MessageOption::TF_ASYNC);
352     if (!data.WriteInterfaceToken(GetDescriptor())) {
353         TLOGE(WmsLogTag::DMS, "WriteInterfaceToken failed");
354         return;
355     }
356     if (!data.WriteUint64(id)) {
357         TLOGE(WmsLogTag::DMS, "Write DisplayId failed");
358         return;
359     }
360     if (!data.WriteStringVector(privacyWindowList)) {
361         TLOGE(WmsLogTag::DMS, "Write privacyWindowList failed");
362         return;
363     }
364     if (remote->SendRequest(TRANS_ID_ON_PRIVATE_WINDOW_LIST, data, reply, option) != ERR_NONE) {
365         TLOGE(WmsLogTag::DMS, "SendRequest failed");
366     }
367 }
368 
NotifyFoldStatusChanged(FoldStatus foldStatus)369 void DisplayManagerAgentProxy::NotifyFoldStatusChanged(FoldStatus foldStatus)
370 {
371     sptr<IRemoteObject> remote = Remote();
372     if (remote == nullptr) {
373         TLOGW(WmsLogTag::DMS, "remote is nullptr");
374         return;
375     }
376 
377     MessageParcel data;
378     MessageParcel reply;
379     MessageOption option(MessageOption::TF_ASYNC);
380     if (!data.WriteInterfaceToken(GetDescriptor())) {
381         TLOGE(WmsLogTag::DMS, "WriteInterfaceToken failed");
382         return;
383     }
384     if (!data.WriteUint32(static_cast<uint32_t>(foldStatus))) {
385         TLOGE(WmsLogTag::DMS, "Write foldStatus failed");
386         return;
387     }
388     if (remote->SendRequest(TRANS_ID_ON_FOLD_STATUS_CHANGED, data, reply, option) != ERR_NONE) {
389         TLOGE(WmsLogTag::DMS, "SendRequest failed");
390     }
391 }
392 
NotifyFoldAngleChanged(std::vector<float> foldAngles)393 void DisplayManagerAgentProxy::NotifyFoldAngleChanged(std::vector<float> foldAngles)
394 {
395     sptr<IRemoteObject> remote = Remote();
396     if (remote == nullptr) {
397         TLOGW(WmsLogTag::DMS, "remote is nullptr");
398         return;
399     }
400 
401     MessageParcel data;
402     MessageParcel reply;
403     MessageOption option(MessageOption::TF_ASYNC);
404     if (!data.WriteInterfaceToken(GetDescriptor())) {
405         TLOGE(WmsLogTag::DMS, "WriteInterfaceToken failed");
406         return;
407     }
408     if (!data.WriteFloatVector(foldAngles)) {
409         TLOGE(WmsLogTag::DMS, "Write foldAngles failed");
410         return;
411     }
412     if (remote->SendRequest(TRANS_ID_ON_FOLD_ANGLE_CHANGED, data, reply, option) != ERR_NONE) {
413         TLOGE(WmsLogTag::DMS, "SendRequest failed");
414     }
415 }
416 
NotifyCaptureStatusChanged(bool isCapture)417 void DisplayManagerAgentProxy::NotifyCaptureStatusChanged(bool isCapture)
418 {
419     sptr<IRemoteObject> remote = Remote();
420     if (remote == nullptr) {
421         TLOGW(WmsLogTag::DMS, "remote is nullptr");
422         return;
423     }
424 
425     MessageParcel data;
426     MessageParcel reply;
427     MessageOption option(MessageOption::TF_ASYNC);
428     if (!data.WriteInterfaceToken(GetDescriptor())) {
429         TLOGE(WmsLogTag::DMS, "WriteInterfaceToken failed");
430         return;
431     }
432     if (!data.WriteBool(isCapture)) {
433         TLOGE(WmsLogTag::DMS, "Write isCapture failed");
434         return;
435     }
436     if (remote->SendRequest(TRANS_ID_ON_CAPTURE_STATUS_CHANGED, data, reply, option) != ERR_NONE) {
437         TLOGE(WmsLogTag::DMS, "SendRequest failed");
438     }
439 }
440 
NotifyDisplayChangeInfoChanged(const sptr<DisplayChangeInfo> & info)441 void DisplayManagerAgentProxy::NotifyDisplayChangeInfoChanged(const sptr<DisplayChangeInfo>& info)
442 {
443     sptr<IRemoteObject> remote = Remote();
444     if (remote == nullptr) {
445         TLOGW(WmsLogTag::DMS, "remote is nullptr");
446         return;
447     }
448 
449     MessageParcel data;
450     MessageParcel reply;
451     MessageOption option(MessageOption::TF_ASYNC);
452     if (!data.WriteInterfaceToken(GetDescriptor())) {
453         TLOGE(WmsLogTag::DMS, "WriteInterfaceToken failed");
454         return;
455     }
456     if (!info->Marshalling(data)) {
457         TLOGE(WmsLogTag::DMS, "Write display change info failed");
458         return;
459     }
460     if (remote->SendRequest(TRANS_ID_ON_DISPLAY_CHANGE_INFO_CHANGED, data, reply, option) != ERR_NONE) {
461         TLOGE(WmsLogTag::DMS, "SendRequest failed");
462     }
463 }
464 
NotifyDisplayModeChanged(FoldDisplayMode displayMode)465 void DisplayManagerAgentProxy::NotifyDisplayModeChanged(FoldDisplayMode displayMode)
466 {
467     sptr<IRemoteObject> remote = Remote();
468     if (remote == nullptr) {
469         TLOGW(WmsLogTag::DMS, "remote is nullptr");
470         return;
471     }
472 
473     MessageParcel data;
474     MessageParcel reply;
475     MessageOption option(MessageOption::TF_ASYNC);
476     if (!data.WriteInterfaceToken(GetDescriptor())) {
477         TLOGE(WmsLogTag::DMS, "WriteInterfaceToken failed");
478         return;
479     }
480     if (!data.WriteUint32(static_cast<uint32_t>(displayMode))) {
481         TLOGE(WmsLogTag::DMS, "Write displayMode failed");
482         return;
483     }
484     if (remote->SendRequest(TRANS_ID_ON_DISPLAY_MODE_CHANGED, data, reply, option) != ERR_NONE) {
485         TLOGE(WmsLogTag::DMS, "SendRequest failed");
486     }
487 }
488 
NotifyScreenMagneticStateChanged(bool isMagneticState)489 void DisplayManagerAgentProxy::NotifyScreenMagneticStateChanged(bool isMagneticState)
490 {
491     sptr<IRemoteObject> remote = Remote();
492     if (remote == nullptr) {
493         TLOGW(WmsLogTag::DMS, "remote is nullptr");
494         return;
495     }
496 
497     MessageParcel data;
498     MessageParcel reply;
499     MessageOption option(MessageOption::TF_ASYNC);
500     if (!data.WriteInterfaceToken(GetDescriptor())) {
501         TLOGE(WmsLogTag::DMS, "WriteInterfaceToken failed");
502         return;
503     }
504     if (!data.WriteBool(isMagneticState)) {
505         TLOGE(WmsLogTag::DMS, "Write isMagneticState failed");
506         return;
507     }
508     if (remote->SendRequest(TRANS_ID_ON_SCREEN_MAGNETIC_STATE_CHANGED, data, reply, option) != ERR_NONE) {
509         TLOGE(WmsLogTag::DMS, "SendRequest failed");
510     }
511 }
512 
NotifyAvailableAreaChanged(DMRect area,DisplayId displayId)513 void DisplayManagerAgentProxy::NotifyAvailableAreaChanged(DMRect area, DisplayId displayId)
514 {
515     sptr<IRemoteObject> remote = Remote();
516     if (remote == nullptr) {
517         TLOGW(WmsLogTag::DMS, "remote is nullptr");
518         return;
519     }
520 
521     MessageParcel data;
522     MessageParcel reply;
523     MessageOption option(MessageOption::TF_ASYNC);
524     if (!data.WriteInterfaceToken(GetDescriptor())) {
525         TLOGE(WmsLogTag::DMS, "WriteInterfaceToken failed");
526         return;
527     }
528     if (!data.WriteUint64(displayId)) {
529         TLOGE(WmsLogTag::DMS, "Write DisplayId failed");
530         return;
531     }
532     if (!data.WriteInt32(area.posX_) || !data.WriteInt32(area.posY_) || !data.WriteUint32(area.width_)
533         ||!data.WriteUint32(area.height_)) {
534         TLOGE(WmsLogTag::DMS, "Write rect failed");
535         return;
536     }
537     if (remote->SendRequest(TRANS_ID_ON_AVAILABLE_AREA_CHANGED, data, reply, option) != ERR_NONE) {
538         TLOGE(WmsLogTag::DMS, "SendRequest failed");
539     }
540 }
541 
NotifyScreenModeChange(const std::vector<sptr<ScreenInfo>> & screenInfos)542 void DisplayManagerAgentProxy::NotifyScreenModeChange(const std::vector<sptr<ScreenInfo>>& screenInfos)
543 {
544     sptr<IRemoteObject> remote = Remote();
545     if (remote == nullptr) {
546         TLOGW(WmsLogTag::DMS, "remote is nullptr");
547         return;
548     }
549 
550     MessageParcel data;
551     MessageParcel reply;
552     MessageOption option(MessageOption::TF_ASYNC);
553     if (!data.WriteInterfaceToken(GetDescriptor())) {
554         TLOGE(WmsLogTag::DMS, "WriteInterfaceToken failed");
555         return;
556     }
557 
558     if (!MarshallingHelper::MarshallingVectorParcelableObj<ScreenInfo>(data, screenInfos)) {
559         TLOGE(WmsLogTag::DMS, "Write screenInfos failed");
560         return;
561     }
562 
563     if (remote->SendRequest(TRANS_ID_ON_SCREEN_MODE_CHANGED, data, reply, option) != ERR_NONE) {
564         TLOGE(WmsLogTag::DMS, "SendRequest failed");
565     }
566 }
567 
NotifyAbnormalScreenConnectChange(ScreenId screenId)568 void DisplayManagerAgentProxy::NotifyAbnormalScreenConnectChange(ScreenId screenId)
569 {
570     sptr<IRemoteObject> remote = Remote();
571     if (remote == nullptr) {
572         TLOGW(WmsLogTag::DMS, "remote is nullptr");
573         return;
574     }
575     MessageParcel data;
576     MessageParcel reply;
577     MessageOption option(MessageOption::TF_SYNC);
578     if (!data.WriteInterfaceToken(GetDescriptor())) {
579         TLOGE(WmsLogTag::DMS, "WriteInterfaceToken failed");
580         return;
581     }
582     if (!data.WriteUint64(screenId)) {
583         TLOGE(WmsLogTag::DMS, "Write screenId failed");
584         return;
585     }
586     if (remote->SendRequest(TRANS_ID_NOTIFY_ABNORMAL_SCREEN_CONNECT_CHANGED, data, reply, option) != ERR_NONE) {
587         TLOGE(WmsLogTag::DMS, "SendRequest failed");
588     }
589 }
590 } // namespace Rosen
591 } // namespace OHOS
592 
593