• 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 "session/host/include/zidl/session_stub.h"
17 
18 #include <ipc_types.h>
19 #include <ui/rs_surface_node.h>
20 
21 #include "ability_start_setting.h"
22 #include "want.h"
23 #include "want_params.h"
24 #include "window_manager_hilog.h"
25 
26 namespace OHOS::Rosen {
27 namespace {
28     constexpr HiviewDFX::HiLogLabel LABEL = {LOG_CORE, HILOG_DOMAIN_WINDOW, "SessionStub"};
29 }
30 
31 const std::map<uint32_t, SessionStubFunc> SessionStub::stubFuncMap_{
32     std::make_pair(static_cast<uint32_t>(SessionMessage::TRANS_ID_FOREGROUND), &SessionStub::HandleForeground),
33     std::make_pair(static_cast<uint32_t>(SessionMessage::TRANS_ID_BACKGROUND), &SessionStub::HandleBackground),
34     std::make_pair(static_cast<uint32_t>(SessionMessage::TRANS_ID_DISCONNECT), &SessionStub::HandleDisconnect),
35     std::make_pair(static_cast<uint32_t>(SessionMessage::TRANS_ID_CONNECT), &SessionStub::HandleConnect),
36     std::make_pair(static_cast<uint32_t>(SessionMessage::TRANS_ID_ACTIVE_PENDING_SESSION),
37         &SessionStub::HandlePendingSessionActivation),
38     std::make_pair(static_cast<uint32_t>(SessionMessage::TRANS_ID_UPDATE_ACTIVE_STATUS),
39         &SessionStub::HandleUpdateActivateStatus),
40 
41     // for scene only
42     std::make_pair(static_cast<uint32_t>(SessionMessage::TRANS_ID_SESSION_EVENT), &SessionStub::HandleSessionEvent),
43     std::make_pair(static_cast<uint32_t>(SessionMessage::TRANS_ID_TERMINATE), &SessionStub::HandleTerminateSession),
44     std::make_pair(static_cast<uint32_t>(SessionMessage::TRANS_ID_EXCEPTION), &SessionStub::HandleSessionException),
45     std::make_pair(static_cast<uint32_t>(SessionMessage::TRANS_ID_UPDATE_SESSION_RECT),
46         &SessionStub::HandleUpdateSessionRect),
47     std::make_pair(static_cast<uint32_t>(SessionMessage::TRANS_ID_CREATE_AND_CONNECT_SPECIFIC_SESSION),
48         &SessionStub::HandleCreateAndConnectSpecificSession),
49     std::make_pair(static_cast<uint32_t>(SessionMessage::TRANS_ID_DESTROY_AND_DISCONNECT_SPECIFIC_SESSION),
50         &SessionStub::HandleDestroyAndDisconnectSpecificSession),
51     std::make_pair(static_cast<uint32_t>(SessionMessage::TRANS_ID_RAISE_TO_APP_TOP),
52         &SessionStub::HandleRaiseToAppTop),
53     std::make_pair(static_cast<uint32_t>(SessionMessage::TRANS_ID_BACKPRESSED), &SessionStub::HandleBackPressed),
54     std::make_pair(static_cast<uint32_t>(SessionMessage::TRANS_ID_MARK_PROCESSED), &SessionStub::HandleMarkProcessed),
55     std::make_pair(static_cast<uint32_t>(SessionMessage::TRANS_ID_SET_MAXIMIZE_MODE),
56         &SessionStub::HandleSetGlobalMaximizeMode),
57     std::make_pair(static_cast<uint32_t>(SessionMessage::TRANS_ID_GET_MAXIMIZE_MODE),
58         &SessionStub::HandleGetGlobalMaximizeMode),
59     std::make_pair(static_cast<uint32_t>(SessionMessage::TRANS_ID_NEED_AVOID),
60         &SessionStub::HandleNeedAvoid),
61     std::make_pair(static_cast<uint32_t>(SessionMessage::TRANS_ID_GET_AVOID_AREA),
62         &SessionStub::HandleGetAvoidAreaByType),
63     std::make_pair(static_cast<uint32_t>(SessionMessage::TRANS_ID_UPDATE_WINDOW_SESSION_PROPERTY),
64         &SessionStub::HandleUpdateWindowSessionProperty),
65     std::make_pair(static_cast<uint32_t>(SessionMessage::TRANS_ID_SET_ASPECT_RATIO),
66         &SessionStub::HandleSetAspectRatio),
67     std::make_pair(static_cast<uint32_t>(SessionMessage::TRANS_ID_UPDATE_WINDOW_ANIMATION_FLAG),
68         &SessionStub::HandleSetWindowAnimationFlag),
69 
70     std::make_pair(static_cast<uint32_t>(SessionMessage::TRANS_ID_UPDATE_CUSTOM_ANIMATION),
71         &SessionStub::HandleUpdateWindowSceneAfterCustomAnimation),
72     std::make_pair(static_cast<uint32_t>(SessionMessage::TRANS_ID_RAISE_ABOVE_TARGET),
73         &SessionStub::HandleRaiseAboveTarget),
74     // for extension only
75     std::make_pair(static_cast<uint32_t>(SessionMessage::TRANS_ID_TRANSFER_ABILITY_RESULT),
76         &SessionStub::HandleTransferAbilityResult),
77     std::make_pair(static_cast<uint32_t>(SessionMessage::TRANS_ID_TRANSFER_EXTENSION_DATA),
78         &SessionStub::HandleTransferExtensionData),
79     std::make_pair(static_cast<uint32_t>(SessionMessage::TRANS_ID_NOTIFY_REMOTE_READY),
80         &SessionStub::HandleNotifyRemoteReady),
81     std::make_pair(static_cast<uint32_t>(SessionMessage::TRANS_ID_NOTIFY_EXTENSION_DIED),
82         &SessionStub::HandleNotifyExtensionDied)
83 };
84 
OnRemoteRequest(uint32_t code,MessageParcel & data,MessageParcel & reply,MessageOption & option)85 int SessionStub::OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option)
86 {
87     WLOGFD("Scene session on remote request!, code: %{public}u", code);
88     if (data.ReadInterfaceToken() != GetDescriptor()) {
89         WLOGFE("Failed to check interface token!");
90         return ERR_INVALID_STATE;
91     }
92 
93     const auto& func = stubFuncMap_.find(code);
94     if (func == stubFuncMap_.end()) {
95         WLOGFE("Failed to find function handler!");
96         return IPCObjectStub::OnRemoteRequest(code, data, reply, option);
97     }
98 
99     return (this->*(func->second))(data, reply);
100 }
101 
HandleSetWindowAnimationFlag(MessageParcel & data,MessageParcel & reply)102 int SessionStub::HandleSetWindowAnimationFlag(MessageParcel& data, MessageParcel& reply)
103 {
104     WLOGFD("HandleSetWindowAnimationFlag!");
105     bool isNeedWindowAnimationFlag = data.ReadBool();
106     const WSError& errCode = UpdateWindowAnimationFlag(isNeedWindowAnimationFlag);
107     reply.WriteUint32(static_cast<uint32_t>(errCode));
108     return ERR_NONE;
109 }
110 
HandleForeground(MessageParcel & data,MessageParcel & reply)111 int SessionStub::HandleForeground(MessageParcel& data, MessageParcel& reply)
112 {
113     WLOGFD("Foreground!");
114     sptr<WindowSessionProperty> property = nullptr;
115     if (data.ReadBool()) {
116         property = data.ReadStrongParcelable<WindowSessionProperty>();
117     } else {
118         WLOGFW("Property not exist!");
119         property = new WindowSessionProperty();
120     }
121     const WSError& errCode = Foreground(property);
122     reply.WriteUint32(static_cast<uint32_t>(errCode));
123     return ERR_NONE;
124 }
125 
HandleBackground(MessageParcel & data,MessageParcel & reply)126 int SessionStub::HandleBackground(MessageParcel& data, MessageParcel& reply)
127 {
128     WLOGFD("Background!");
129     const WSError& errCode = Background();
130     reply.WriteUint32(static_cast<uint32_t>(errCode));
131     return ERR_NONE;
132 }
133 
HandleDisconnect(MessageParcel & data,MessageParcel & reply)134 int SessionStub::HandleDisconnect(MessageParcel& data, MessageParcel& reply)
135 {
136     WLOGFD("Disconnect!");
137     const WSError& errCode = Disconnect();
138     reply.WriteUint32(static_cast<uint32_t>(errCode));
139     return ERR_NONE;
140 }
141 
HandleConnect(MessageParcel & data,MessageParcel & reply)142 int SessionStub::HandleConnect(MessageParcel& data, MessageParcel& reply)
143 {
144     WLOGFD("Connect!");
145     sptr<IRemoteObject> sessionStageObject = data.ReadRemoteObject();
146     sptr<ISessionStage> sessionStage = iface_cast<ISessionStage>(sessionStageObject);
147     sptr<IRemoteObject> eventChannelObject = data.ReadRemoteObject();
148     sptr<IWindowEventChannel> eventChannel = iface_cast<IWindowEventChannel>(eventChannelObject);
149     std::shared_ptr<RSSurfaceNode> surfaceNode = RSSurfaceNode::Unmarshalling(data);
150     if (sessionStage == nullptr || eventChannel == nullptr || surfaceNode == nullptr) {
151         WLOGFE("Failed to read scene session stage object or event channel object!");
152         return ERR_INVALID_DATA;
153     }
154 
155     sptr<WindowSessionProperty> property = nullptr;
156     if (data.ReadBool()) {
157         property = data.ReadStrongParcelable<WindowSessionProperty>();
158     } else {
159         WLOGFW("Property not exist!");
160     }
161 
162     sptr<IRemoteObject> token = nullptr;
163     if (property && property->GetTokenState()) {
164         token = data.ReadRemoteObject();
165     } else {
166         WLOGI("accept token is nullptr");
167     }
168     SystemSessionConfig systemConfig;
169     WSError errCode = Connect(sessionStage, eventChannel, surfaceNode, systemConfig, property, token);
170     reply.WriteParcelable(&systemConfig);
171     if (property) {
172         reply.WriteInt32(property->GetPersistentId());
173     }
174     reply.WriteUint32(static_cast<uint32_t>(errCode));
175     return ERR_NONE;
176 }
177 
HandleSessionEvent(MessageParcel & data,MessageParcel & reply)178 int SessionStub::HandleSessionEvent(MessageParcel& data, MessageParcel& reply)
179 {
180     uint32_t eventId = data.ReadUint32();
181     WLOGFD("HandleSessionEvent eventId: %{public}d", eventId);
182     WSError errCode = OnSessionEvent(static_cast<SessionEvent>(eventId));
183     reply.WriteUint32(static_cast<uint32_t>(errCode));
184     return ERR_NONE;
185 }
186 
HandleTerminateSession(MessageParcel & data,MessageParcel & reply)187 int SessionStub::HandleTerminateSession(MessageParcel& data, MessageParcel& reply)
188 {
189     WLOGFD("run HandleTerminateSession");
190     sptr<AAFwk::SessionInfo> abilitySessionInfo(new AAFwk::SessionInfo());
191     std::unique_ptr<AAFwk::Want> want(data.ReadParcelable<AAFwk::Want>());
192     abilitySessionInfo->want = *want;
193     if (data.ReadBool()) {
194         abilitySessionInfo->callerToken = data.ReadRemoteObject();
195     }
196     abilitySessionInfo->resultCode = data.ReadInt32();
197     const WSError& errCode = TerminateSession(abilitySessionInfo);
198     reply.WriteUint32(static_cast<uint32_t>(errCode));
199     return ERR_NONE;
200 }
201 
HandleSessionException(MessageParcel & data,MessageParcel & reply)202 int SessionStub::HandleSessionException(MessageParcel& data, MessageParcel& reply)
203 {
204     WLOGFD("run HandleSessionException");
205     sptr<AAFwk::SessionInfo> abilitySessionInfo(new AAFwk::SessionInfo());
206     std::unique_ptr<AAFwk::Want> want(data.ReadParcelable<AAFwk::Want>());
207     abilitySessionInfo->want = *want;
208     if (data.ReadBool()) {
209         abilitySessionInfo->callerToken = data.ReadRemoteObject();
210     }
211 
212     abilitySessionInfo->errorCode = data.ReadInt32();
213     abilitySessionInfo->errorReason = data.ReadString();
214     const WSError& errCode = NotifySessionException(abilitySessionInfo);
215     reply.WriteUint32(static_cast<uint32_t>(errCode));
216     return ERR_NONE;
217 }
218 
HandlePendingSessionActivation(MessageParcel & data,MessageParcel & reply)219 int SessionStub::HandlePendingSessionActivation(MessageParcel& data, MessageParcel& reply)
220 {
221     WLOGFD("PendingSessionActivation!");
222     sptr<AAFwk::SessionInfo> abilitySessionInfo(new AAFwk::SessionInfo());
223     std::unique_ptr<AAFwk::Want> want(data.ReadParcelable<AAFwk::Want>());
224     abilitySessionInfo->want = *want;
225     abilitySessionInfo->requestCode = data.ReadInt32();
226     abilitySessionInfo->persistentId = data.ReadInt32();
227     abilitySessionInfo->state = static_cast<AAFwk::CallToState>(data.ReadInt32());
228     abilitySessionInfo->uiAbilityId = data.ReadInt64();
229     abilitySessionInfo->callingTokenId = data.ReadUint32();
230     abilitySessionInfo->reuse = data.ReadBool();
231     if (data.ReadBool()) {
232         abilitySessionInfo->callerToken = data.ReadRemoteObject();
233     }
234     if (data.ReadBool()) {
235         abilitySessionInfo->startSetting.reset(data.ReadParcelable<AAFwk::AbilityStartSetting>());
236     }
237     const WSError& errCode = PendingSessionActivation(abilitySessionInfo);
238     reply.WriteUint32(static_cast<uint32_t>(errCode));
239     return ERR_NONE;
240 }
241 
HandleUpdateActivateStatus(MessageParcel & data,MessageParcel & reply)242 int SessionStub::HandleUpdateActivateStatus(MessageParcel& data, MessageParcel& reply)
243 {
244     WLOGFD("HandleUpdateActivateStatus!");
245     bool isActive = data.ReadBool();
246     const WSError& errCode = UpdateActiveStatus(isActive);
247     reply.WriteUint32(static_cast<uint32_t>(errCode));
248     return ERR_NONE;
249 }
250 
HandleUpdateSessionRect(MessageParcel & data,MessageParcel & reply)251 int SessionStub::HandleUpdateSessionRect(MessageParcel& data, MessageParcel& reply)
252 {
253     WLOGFD("HandleUpdateSessionRect!");
254     auto posX = data.ReadInt32();
255     auto posY = data.ReadInt32();
256     auto width = data.ReadUint32();
257     auto height = data.ReadUint32();
258     WSRect rect = {posX, posY, width, height};
259     WLOGFI("HandleUpdateSessionRect [%{public}d, %{public}d, %{public}u, %{public}u]", posX, posY,
260         width, height);
261     const SizeChangeReason& reason = static_cast<SizeChangeReason>(data.ReadUint32());
262     const WSError& errCode = UpdateSessionRect(rect, reason);
263     reply.WriteUint32(static_cast<uint32_t>(errCode));
264     return ERR_NONE;
265 }
266 
HandleCreateAndConnectSpecificSession(MessageParcel & data,MessageParcel & reply)267 int SessionStub::HandleCreateAndConnectSpecificSession(MessageParcel& data, MessageParcel& reply)
268 {
269     WLOGFD("HandleCreateAndConnectSpecificSession!");
270     sptr<IRemoteObject> sessionStageObject = data.ReadRemoteObject();
271     sptr<ISessionStage> sessionStage = iface_cast<ISessionStage>(sessionStageObject);
272     sptr<IRemoteObject> eventChannelObject = data.ReadRemoteObject();
273     sptr<IWindowEventChannel> eventChannel = iface_cast<IWindowEventChannel>(eventChannelObject);
274     std::shared_ptr<RSSurfaceNode> surfaceNode = RSSurfaceNode::Unmarshalling(data);
275     if (sessionStage == nullptr || eventChannel == nullptr || surfaceNode == nullptr) {
276         WLOGFE("Failed to read scene session stage object or event channel object!");
277         return ERR_INVALID_DATA;
278     }
279 
280     sptr<WindowSessionProperty> property = nullptr;
281     if (data.ReadBool()) {
282         property = data.ReadStrongParcelable<WindowSessionProperty>();
283     } else {
284         WLOGFW("Property not exist!");
285     }
286 
287     sptr<IRemoteObject> token = nullptr;
288     if (property && property->GetTokenState()) {
289         token = data.ReadRemoteObject();
290     } else {
291         WLOGI("accept token is nullptr");
292     }
293 
294     auto persistentId = INVALID_SESSION_ID;
295     sptr<ISession> sceneSession;
296     CreateAndConnectSpecificSession(sessionStage, eventChannel, surfaceNode,
297         property, persistentId, sceneSession, token);
298     if (sceneSession== nullptr) {
299         return ERR_INVALID_STATE;
300     }
301     reply.WriteInt32(persistentId);
302     reply.WriteRemoteObject(sceneSession->AsObject());
303     reply.WriteUint32(static_cast<uint32_t>(WSError::WS_OK));
304     return ERR_NONE;
305 }
306 
HandleDestroyAndDisconnectSpecificSession(MessageParcel & data,MessageParcel & reply)307 int SessionStub::HandleDestroyAndDisconnectSpecificSession(MessageParcel& data, MessageParcel& reply)
308 {
309     auto persistentId = data.ReadUint32();
310     const WSError& ret = DestroyAndDisconnectSpecificSession(persistentId);
311     reply.WriteUint32(static_cast<uint32_t>(ret));
312     return ERR_NONE;
313 }
314 
HandleRaiseToAppTop(MessageParcel & data,MessageParcel & reply)315 int SessionStub::HandleRaiseToAppTop(MessageParcel& data, MessageParcel& reply)
316 {
317     WLOGFD("RaiseToAppTop!");
318     const WSError& errCode = RaiseToAppTop();
319     reply.WriteUint32(static_cast<uint32_t>(errCode));
320     return ERR_NONE;
321 }
322 
HandleRaiseAboveTarget(MessageParcel & data,MessageParcel & reply)323 int SessionStub::HandleRaiseAboveTarget(MessageParcel& data, MessageParcel& reply)
324 {
325     WLOGFD("RaiseAboveTarget!");
326     auto subWindowId = data.ReadInt32();
327     const WSError& errCode = RaiseAboveTarget(subWindowId);
328     reply.WriteUint32(static_cast<uint32_t>(errCode));
329     return ERR_NONE;
330 }
331 
HandleBackPressed(MessageParcel & data,MessageParcel & reply)332 int SessionStub::HandleBackPressed(MessageParcel& data, MessageParcel& reply)
333 {
334     WLOGFD("HandleBackPressed!");
335     WSError errCode = RequestSessionBack();
336     reply.WriteUint32(static_cast<uint32_t>(errCode));
337     return ERR_NONE;
338 }
339 
HandleMarkProcessed(MessageParcel & data,MessageParcel & reply)340 int SessionStub::HandleMarkProcessed(MessageParcel& data, MessageParcel& reply)
341 {
342     WLOGFD("HandleMarkProcessed!");
343     int32_t eventId = 0;
344     if (!data.ReadInt32(eventId)) {
345         WLOGFE("Read eventId from parcel failed!");
346         return ERR_INVALID_DATA;
347     }
348     WSError errCode = MarkProcessed(eventId);
349     reply.WriteUint32(static_cast<uint32_t>(errCode));
350     return ERR_NONE;
351 }
352 
HandleSetGlobalMaximizeMode(MessageParcel & data,MessageParcel & reply)353 int SessionStub::HandleSetGlobalMaximizeMode(MessageParcel &data, MessageParcel &reply)
354 {
355     WLOGFD("HandleSetGlobalMaximizeMode!");
356     auto mode = data.ReadUint32();
357     WSError errCode = SetGlobalMaximizeMode(static_cast<MaximizeMode>(mode));
358     reply.WriteUint32(static_cast<uint32_t>(errCode));
359     return ERR_NONE;
360 }
361 
HandleGetGlobalMaximizeMode(MessageParcel & data,MessageParcel & reply)362 int SessionStub::HandleGetGlobalMaximizeMode(MessageParcel &data, MessageParcel &reply)
363 {
364     WLOGFD("HandleGetGlobalMaximizeMode!");
365     MaximizeMode mode = MaximizeMode::MODE_FULL_FILL;
366     WSError errCode = GetGlobalMaximizeMode(mode);
367     reply.WriteUint32(static_cast<uint32_t>(mode));
368     reply.WriteUint32(static_cast<uint32_t>(errCode));
369     return ERR_NONE;
370 }
371 
HandleNeedAvoid(MessageParcel & data,MessageParcel & reply)372 int SessionStub::HandleNeedAvoid(MessageParcel& data, MessageParcel& reply)
373 {
374     bool status = static_cast<bool>(data.ReadUint32());
375     WLOGFD("HandleNeedAvoid status:%{public}d", static_cast<int32_t>(status));
376     WSError errCode = OnNeedAvoid(status);
377     reply.WriteUint32(static_cast<uint32_t>(errCode));
378     return ERR_NONE;
379 }
380 
HandleGetAvoidAreaByType(MessageParcel & data,MessageParcel & reply)381 int SessionStub::HandleGetAvoidAreaByType(MessageParcel& data, MessageParcel& reply)
382 {
383     AvoidAreaType type = static_cast<AvoidAreaType>(data.ReadUint32());
384     WLOGFD("HandleGetAvoidArea type:%{public}d", static_cast<int32_t>(type));
385     AvoidArea avoidArea = GetAvoidAreaByType(type);
386     reply.WriteParcelable(&avoidArea);
387     return ERR_NONE;
388 }
389 
HandleUpdateWindowSessionProperty(MessageParcel & data,MessageParcel & reply)390 int SessionStub::HandleUpdateWindowSessionProperty(MessageParcel& data, MessageParcel& reply)
391 {
392     WLOGFD("UpdateWindowSessionProperty!");
393     sptr<WindowSessionProperty> property = nullptr;
394     property = data.ReadStrongParcelable<WindowSessionProperty>();
395     const WSError& errCode = UpdateWindowSessionProperty(property);
396     reply.WriteUint32(static_cast<uint32_t>(errCode));
397     return ERR_NONE;
398 }
399 
HandleSetAspectRatio(MessageParcel & data,MessageParcel & reply)400 int SessionStub::HandleSetAspectRatio(MessageParcel& data, MessageParcel& reply)
401 {
402     WLOGFD("HandleSetAspectRatio!");
403     float ratio = data.ReadFloat();
404     const WSError& errCode = SetAspectRatio(ratio);
405     reply.WriteUint32(static_cast<uint32_t>(errCode));
406     return ERR_NONE;
407 }
408 
HandleUpdateWindowSceneAfterCustomAnimation(MessageParcel & data,MessageParcel & reply)409 int SessionStub::HandleUpdateWindowSceneAfterCustomAnimation(MessageParcel& data, MessageParcel& reply)
410 {
411     WLOGD("HandleUpdateWindowSceneAfterCustomAnimation!");
412     bool isAdd = data.ReadBool();
413     const WSError& errCode = UpdateWindowSceneAfterCustomAnimation(isAdd);
414     reply.WriteUint32(static_cast<uint32_t>(errCode));
415     return ERR_NONE;
416 }
417 
HandleTransferAbilityResult(MessageParcel & data,MessageParcel & reply)418 int SessionStub::HandleTransferAbilityResult(MessageParcel& data, MessageParcel& reply)
419 {
420     WLOGFD("HandleTransferAbilityResult!");
421     uint32_t resultCode = data.ReadUint32();
422     std::shared_ptr<AAFwk::Want> want(data.ReadParcelable<AAFwk::Want>());
423     if (want == nullptr) {
424         WLOGFE("want is nullptr");
425         return ERR_INVALID_VALUE;
426     }
427     WSError errCode = TransferAbilityResult(resultCode, *want);
428     reply.WriteUint32(static_cast<uint32_t>(errCode));
429     return ERR_NONE;
430 }
431 
HandleTransferExtensionData(MessageParcel & data,MessageParcel & reply)432 int SessionStub::HandleTransferExtensionData(MessageParcel& data, MessageParcel& reply)
433 {
434     WLOGFD("HandleTransferExtensionData!");
435     std::shared_ptr<AAFwk::WantParams> wantParams(data.ReadParcelable<AAFwk::WantParams>());
436     if (wantParams == nullptr) {
437         WLOGFE("wantParams is nullptr");
438         return ERR_INVALID_VALUE;
439     }
440     WSError errCode = TransferExtensionData(*wantParams);
441     reply.WriteUint32(static_cast<uint32_t>(errCode));
442     return ERR_NONE;
443 }
444 
HandleNotifyRemoteReady(MessageParcel & data,MessageParcel & reply)445 int SessionStub::HandleNotifyRemoteReady(MessageParcel& data, MessageParcel& reply)
446 {
447     WLOGFD("HandleNotifyRemoteReady!");
448     NotifyRemoteReady();
449     return ERR_NONE;
450 }
451 
HandleNotifyExtensionDied(MessageParcel & data,MessageParcel & reply)452 int SessionStub::HandleNotifyExtensionDied(MessageParcel& data, MessageParcel& reply)
453 {
454     WLOGFD("called");
455     NotifyExtensionDied();
456     return ERR_NONE;
457 }
458 } // namespace OHOS::Rosen
459