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 "call_ability_callback_proxy.h"
17
18 #include "call_manager_errors.h"
19 #include "message_option.h"
20 #include "message_parcel.h"
21
22 namespace OHOS {
23 namespace Telephony {
CallAbilityCallbackProxy(const sptr<IRemoteObject> & impl)24 CallAbilityCallbackProxy::CallAbilityCallbackProxy(const sptr<IRemoteObject> &impl)
25 : IRemoteProxy<ICallAbilityCallback>(impl)
26 {}
27
OnCallDetailsChange(const CallAttributeInfo & info)28 int32_t CallAbilityCallbackProxy::OnCallDetailsChange(const CallAttributeInfo &info)
29 {
30 MessageParcel dataParcel;
31 MessageParcel replyParcel;
32 MessageOption option(MessageOption::TF_ASYNC);
33 if (!dataParcel.WriteInterfaceToken(CallAbilityCallbackProxy::GetDescriptor())) {
34 TELEPHONY_LOGE("write descriptor fail");
35 return TELEPHONY_ERR_WRITE_DESCRIPTOR_TOKEN_FAIL;
36 }
37 dataParcel.WriteCString(info.accountNumber);
38 dataParcel.WriteCString(info.bundleName);
39 dataParcel.WriteBool(info.speakerphoneOn);
40 dataParcel.WriteInt32(info.accountId);
41 dataParcel.WriteInt32(static_cast<int32_t>(info.videoState));
42 dataParcel.WriteInt64(info.startTime);
43 dataParcel.WriteBool(info.isEcc);
44 dataParcel.WriteInt32(static_cast<int32_t>(info.callType));
45 dataParcel.WriteInt32(info.callId);
46 dataParcel.WriteInt32(static_cast<int32_t>(info.callState));
47 dataParcel.WriteInt32(static_cast<int32_t>(info.conferenceState));
48 dataParcel.WriteInt64(info.callBeginTime);
49 dataParcel.WriteInt64(info.callEndTime);
50 dataParcel.WriteInt64(info.ringBeginTime);
51 dataParcel.WriteInt64(info.ringEndTime);
52 dataParcel.WriteInt32(static_cast<int32_t>(info.callDirection));
53 dataParcel.WriteInt32(static_cast<int32_t>(info.answerType));
54 dataParcel.WriteInt32(info.index);
55 dataParcel.WriteInt32(info.crsType);
56 dataParcel.WriteInt32(info.originalCallType);
57 if (info.callType == CallType::TYPE_VOIP) {
58 dataParcel.WriteString(info.voipCallInfo.voipCallId);
59 dataParcel.WriteString(info.voipCallInfo.userName);
60 dataParcel.WriteString(info.voipCallInfo.abilityName);
61 dataParcel.WriteString(info.voipCallInfo.extensionId);
62 dataParcel.WriteString(info.voipCallInfo.voipBundleName);
63 dataParcel.WriteUInt8Vector(info.voipCallInfo.userProfile);
64 }
65 if (Remote() == nullptr) {
66 TELEPHONY_LOGE("function Remote() return nullptr!");
67 return TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL;
68 }
69 int32_t error =
70 Remote()->SendRequest(static_cast<uint32_t>(CallManagerCallAbilityInterfaceCode::UPDATE_CALL_STATE_INFO),
71 dataParcel, replyParcel, option);
72 if (error != TELEPHONY_SUCCESS) {
73 TELEPHONY_LOGE("update call state info failed, error: %{public}d", error);
74 return TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL;
75 }
76 return replyParcel.ReadInt32();
77 }
78
OnCallEventChange(const CallEventInfo & info)79 int32_t CallAbilityCallbackProxy::OnCallEventChange(const CallEventInfo &info)
80 {
81 MessageParcel dataParcel;
82 MessageParcel replyParcel;
83 MessageOption option;
84 if (!dataParcel.WriteInterfaceToken(CallAbilityCallbackProxy::GetDescriptor())) {
85 TELEPHONY_LOGE("write descriptor fail");
86 return TELEPHONY_ERR_WRITE_DESCRIPTOR_TOKEN_FAIL;
87 }
88 int32_t length = sizeof(CallEventInfo);
89 dataParcel.WriteInt32(length);
90 dataParcel.WriteRawData((const void *)&info, length);
91 if (Remote() == nullptr) {
92 TELEPHONY_LOGE("function Remote() return nullptr!");
93 return TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL;
94 }
95 int32_t error = Remote()->SendRequest(static_cast<uint32_t>(CallManagerCallAbilityInterfaceCode::UPDATE_CALL_EVENT),
96 dataParcel, replyParcel, option);
97 if (error != TELEPHONY_SUCCESS) {
98 TELEPHONY_LOGE("update call event failed, error: %{public}d", error);
99 return TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL;
100 }
101 return replyParcel.ReadInt32();
102 }
103
OnCallDisconnectedCause(const DisconnectedDetails & details)104 int32_t CallAbilityCallbackProxy::OnCallDisconnectedCause(const DisconnectedDetails &details)
105 {
106 MessageParcel dataParcel;
107 MessageParcel replyParcel;
108 MessageOption option;
109 if (!dataParcel.WriteInterfaceToken(CallAbilityCallbackProxy::GetDescriptor())) {
110 TELEPHONY_LOGE("write descriptor fail");
111 return TELEPHONY_ERR_WRITE_DESCRIPTOR_TOKEN_FAIL;
112 }
113 if (!dataParcel.WriteInt32(static_cast<int32_t>(details.reason))) {
114 TELEPHONY_LOGE("write reason fail");
115 return TELEPHONY_ERR_WRITE_DATA_FAIL;
116 }
117 if (!dataParcel.WriteString(details.message)) {
118 TELEPHONY_LOGE("write message fail");
119 return TELEPHONY_ERR_WRITE_DATA_FAIL;
120 }
121 if (Remote() == nullptr) {
122 TELEPHONY_LOGE("function Remote() return nullptr!");
123 return TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL;
124 }
125 int32_t error = Remote()->SendRequest(
126 static_cast<uint32_t>(CallManagerCallAbilityInterfaceCode::UPDATE_CALL_DISCONNECTED_CAUSE), dataParcel,
127 replyParcel, option);
128 if (error != TELEPHONY_SUCCESS) {
129 TELEPHONY_LOGE("report call disconnected cause failed, error: %{public}d", error);
130 return TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL;
131 }
132 return replyParcel.ReadInt32();
133 }
134
OnReportAsyncResults(CallResultReportId reportId,AppExecFwk::PacMap & resultInfo)135 int32_t CallAbilityCallbackProxy::OnReportAsyncResults(CallResultReportId reportId, AppExecFwk::PacMap &resultInfo)
136 {
137 MessageParcel dataParcel;
138 MessageParcel replyParcel;
139 MessageOption option;
140 if (!dataParcel.WriteInterfaceToken(CallAbilityCallbackProxy::GetDescriptor())) {
141 TELEPHONY_LOGE("write descriptor fail");
142 return TELEPHONY_ERR_WRITE_DESCRIPTOR_TOKEN_FAIL;
143 }
144 PackDataParcel(reportId, resultInfo, dataParcel);
145 if (Remote() == nullptr) {
146 TELEPHONY_LOGE("function Remote() return nullptr!");
147 return TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL;
148 }
149 int32_t error = Remote()->SendRequest(
150 static_cast<uint32_t>(CallManagerCallAbilityInterfaceCode::UPDATE_CALL_ASYNC_RESULT_REQUEST), dataParcel,
151 replyParcel, option);
152 if (error != TELEPHONY_SUCCESS) {
153 TELEPHONY_LOGE("report async results failed, error: %{public}d", error);
154 return TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL;
155 }
156 return replyParcel.ReadInt32();
157 }
158
OnReportMmiCodeResult(const MmiCodeInfo & info)159 int32_t CallAbilityCallbackProxy::OnReportMmiCodeResult(const MmiCodeInfo &info)
160 {
161 MessageParcel dataParcel;
162 MessageParcel replyParcel;
163 MessageOption option;
164 if (!dataParcel.WriteInterfaceToken(CallAbilityCallbackProxy::GetDescriptor())) {
165 TELEPHONY_LOGE("write descriptor fail");
166 return TELEPHONY_ERR_WRITE_DESCRIPTOR_TOKEN_FAIL;
167 }
168 int32_t length = sizeof(MmiCodeInfo);
169 dataParcel.WriteInt32(length);
170 dataParcel.WriteRawData((const void *)&info, length);
171 if (Remote() == nullptr) {
172 TELEPHONY_LOGE("function Remote() return nullptr!");
173 return TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL;
174 }
175 int32_t error = Remote()->SendRequest(static_cast<uint32_t>(
176 CallManagerCallAbilityInterfaceCode::UPDATE_MMI_CODE_RESULT_REQUEST), dataParcel,
177 replyParcel, option);
178 if (error != TELEPHONY_SUCCESS) {
179 TELEPHONY_LOGE("report async results failed, error: %{public}d", error);
180 return TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL;
181 }
182 return replyParcel.ReadInt32();
183 }
184
PackDataParcel(CallResultReportId reportId,AppExecFwk::PacMap & resultInfo,MessageParcel & dataParcel)185 void CallAbilityCallbackProxy::PackDataParcel(
186 CallResultReportId reportId, AppExecFwk::PacMap &resultInfo, MessageParcel &dataParcel)
187 {
188 dataParcel.WriteInt32(static_cast<int32_t>(reportId));
189 dataParcel.WriteInt32(resultInfo.GetIntValue("result"));
190 switch (reportId) {
191 case CallResultReportId::GET_CALL_WAITING_REPORT_ID:
192 case CallResultReportId::GET_CALL_RESTRICTION_REPORT_ID:
193 dataParcel.WriteInt32(resultInfo.GetIntValue("status"));
194 dataParcel.WriteInt32(resultInfo.GetIntValue("classCw"));
195 break;
196 case CallResultReportId::GET_CALL_TRANSFER_REPORT_ID:
197 dataParcel.WriteInt32(resultInfo.GetIntValue("status"));
198 dataParcel.WriteInt32(resultInfo.GetIntValue("classx"));
199 dataParcel.WriteString(resultInfo.GetStringValue("number"));
200 dataParcel.WriteInt32(resultInfo.GetIntValue("type"));
201 dataParcel.WriteInt32(resultInfo.GetIntValue("reason"));
202 break;
203 case CallResultReportId::GET_CALL_CLIP_ID:
204 dataParcel.WriteInt32(resultInfo.GetIntValue("action"));
205 dataParcel.WriteInt32(resultInfo.GetIntValue("clipStat"));
206 break;
207 case CallResultReportId::GET_CALL_CLIR_ID:
208 dataParcel.WriteInt32(resultInfo.GetIntValue("action"));
209 dataParcel.WriteInt32(resultInfo.GetIntValue("clirStat"));
210 break;
211 case CallResultReportId::GET_IMS_CONFIG_REPORT_ID:
212 case CallResultReportId::GET_IMS_FEATURE_VALUE_REPORT_ID:
213 dataParcel.WriteInt32(resultInfo.GetIntValue("value"));
214 break;
215 case CallResultReportId::START_RTT_REPORT_ID:
216 dataParcel.WriteInt32(resultInfo.GetIntValue("active"));
217 break;
218 case CallResultReportId::STOP_RTT_REPORT_ID:
219 dataParcel.WriteInt32(resultInfo.GetIntValue("inactive"));
220 break;
221 default:
222 break;
223 }
224 }
225
OnOttCallRequest(OttCallRequestId requestId,AppExecFwk::PacMap & info)226 int32_t CallAbilityCallbackProxy::OnOttCallRequest(OttCallRequestId requestId, AppExecFwk::PacMap &info)
227 {
228 MessageParcel dataParcel;
229 MessageParcel replyParcel;
230 MessageOption option;
231 if (!dataParcel.WriteInterfaceToken(CallAbilityCallbackProxy::GetDescriptor())) {
232 TELEPHONY_LOGE("write descriptor fail");
233 return TELEPHONY_ERR_WRITE_DESCRIPTOR_TOKEN_FAIL;
234 }
235 dataParcel.WriteInt32(static_cast<int32_t>(requestId));
236 dataParcel.WriteString(info.GetStringValue("phoneNumber"));
237 dataParcel.WriteString(info.GetStringValue("bundleName"));
238 dataParcel.WriteInt32(info.GetIntValue("videoState"));
239 switch (requestId) {
240 case OttCallRequestId::OTT_REQUEST_INVITE_TO_CONFERENCE:
241 if (info.GetIntValue("listCnt") > 0) {
242 dataParcel.WriteString(info.GetStringValue("number"));
243 }
244 break;
245 case OttCallRequestId::OTT_REQUEST_UPDATE_CALL_MEDIA_MODE:
246 dataParcel.WriteInt32(info.GetIntValue("callMediaMode"));
247 break;
248 default:
249 break;
250 }
251 if (Remote() == nullptr) {
252 TELEPHONY_LOGE("function Remote() return nullptr!");
253 return TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL;
254 }
255 int32_t error =
256 Remote()->SendRequest(static_cast<uint32_t>(CallManagerCallAbilityInterfaceCode::REPORT_OTT_CALL_REQUEST),
257 dataParcel, replyParcel, option);
258 if (error != TELEPHONY_SUCCESS) {
259 TELEPHONY_LOGE("report ott call request failed, error: %{public}d", error);
260 return TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL;
261 }
262 return replyParcel.ReadInt32();
263 }
264
OnReportAudioDeviceChange(const AudioDeviceInfo & info)265 int32_t CallAbilityCallbackProxy::OnReportAudioDeviceChange(const AudioDeviceInfo &info)
266 {
267 MessageParcel dataParcel;
268 MessageParcel replyParcel;
269 MessageOption option;
270 if (!dataParcel.WriteInterfaceToken(CallAbilityCallbackProxy::GetDescriptor())) {
271 TELEPHONY_LOGE("write descriptor fail");
272 return TELEPHONY_ERR_WRITE_DESCRIPTOR_TOKEN_FAIL;
273 }
274 size_t audioDeviceListLength = info.audioDeviceList.size();
275 dataParcel.WriteInt32(static_cast<int32_t>(audioDeviceListLength));
276 for (auto &audioDevice : info.audioDeviceList) {
277 dataParcel.WriteRawData((const void *)&audioDevice, sizeof(AudioDevice));
278 }
279 dataParcel.WriteRawData((const void *)&info.currentAudioDevice, sizeof(AudioDevice));
280 dataParcel.WriteBool(info.isMuted);
281
282 TELEPHONY_LOGD("audioDeviceListLength=%{public}zu", audioDeviceListLength);
283 if (Remote() == nullptr) {
284 TELEPHONY_LOGE("function Remote() return nullptr!");
285 return TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL;
286 }
287 int32_t error = Remote()->SendRequest(
288 static_cast<uint32_t>(CallManagerCallAbilityInterfaceCode::UPDATE_AUDIO_DEVICE_CHANGE_RESULT_REQUEST),
289 dataParcel, replyParcel, option);
290 if (error != TELEPHONY_SUCCESS) {
291 TELEPHONY_LOGE("report audio device info failed, error: %{public}d", error);
292 return TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL;
293 }
294 return replyParcel.ReadInt32();
295 }
296
OnReportPostDialDelay(const std::string & str)297 int32_t CallAbilityCallbackProxy::OnReportPostDialDelay(const std::string &str)
298 {
299 MessageParcel dataParcel;
300 MessageParcel replyParcel;
301 MessageOption option;
302 if (!dataParcel.WriteInterfaceToken(CallAbilityCallbackProxy::GetDescriptor())) {
303 TELEPHONY_LOGE("WriteInterfaceToken fail");
304 return TELEPHONY_ERR_WRITE_DESCRIPTOR_TOKEN_FAIL;
305 }
306 dataParcel.WriteString(str);
307 if (Remote() == nullptr) {
308 TELEPHONY_LOGE("Remote() return nullptr!");
309 return TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL;
310 }
311 int32_t error = Remote()->SendRequest(
312 static_cast<uint32_t>(CallManagerCallAbilityInterfaceCode::REPORT_POST_DIAL_DELAY),
313 dataParcel, replyParcel, option);
314 if (error != TELEPHONY_SUCCESS) {
315 TELEPHONY_LOGE("report post-dial wait failed, error: %{public}d", error);
316 return TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL;
317 }
318 return replyParcel.ReadInt32();
319 }
320
OnReportImsCallModeChange(const CallMediaModeInfo & imsCallModeInfo)321 int32_t CallAbilityCallbackProxy::OnReportImsCallModeChange(const CallMediaModeInfo &imsCallModeInfo)
322 {
323 MessageParcel dataParcel;
324 MessageParcel replyParcel;
325 MessageOption option;
326 if (!dataParcel.WriteInterfaceToken(CallAbilityCallbackProxy::GetDescriptor())) {
327 TELEPHONY_LOGE("write descriptor fail");
328 return TELEPHONY_ERR_WRITE_DESCRIPTOR_TOKEN_FAIL;
329 }
330 int32_t length = sizeof(CallMediaModeInfo);
331 dataParcel.WriteInt32(length);
332 dataParcel.WriteRawData((const void *)&imsCallModeInfo, length);
333 if (Remote() == nullptr) {
334 TELEPHONY_LOGE("function Remote() return nullptr!");
335 return TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL;
336 }
337 int32_t error = Remote()->SendRequest(static_cast<uint32_t>(
338 CallManagerCallAbilityInterfaceCode::UPDATE_IMS_CALL_MODE_RECEIVE), dataParcel,
339 replyParcel, option);
340 if (error != TELEPHONY_SUCCESS) {
341 TELEPHONY_LOGE("report async results failed, error: %{public}d", error);
342 return TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL;
343 }
344 return replyParcel.ReadInt32();
345 }
346
OnReportCallSessionEventChange(const CallSessionEvent & callSessionEventOptions)347 int32_t CallAbilityCallbackProxy::OnReportCallSessionEventChange(
348 const CallSessionEvent &callSessionEventOptions)
349 {
350 MessageParcel dataParcel;
351 MessageParcel replyParcel;
352 MessageOption option;
353 if (!dataParcel.WriteInterfaceToken(CallAbilityCallbackProxy::GetDescriptor())) {
354 TELEPHONY_LOGE("write descriptor fail");
355 return TELEPHONY_ERR_WRITE_DESCRIPTOR_TOKEN_FAIL;
356 }
357 int32_t length = sizeof(CallSessionEvent);
358 dataParcel.WriteInt32(length);
359 dataParcel.WriteRawData((const void *)&callSessionEventOptions, length);
360 if (Remote() == nullptr) {
361 TELEPHONY_LOGE("function Remote() return nullptr!");
362 return TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL;
363 }
364 int32_t error = Remote()->SendRequest(static_cast<uint32_t>(
365 CallManagerCallAbilityInterfaceCode::CALL_SESSION_EVENT_CHANGE), dataParcel,
366 replyParcel, option);
367 if (error != TELEPHONY_SUCCESS) {
368 TELEPHONY_LOGE("report async results failed, error: %{public}d", error);
369 return TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL;
370 }
371 return replyParcel.ReadInt32();
372 }
373
OnReportPeerDimensionsChange(const PeerDimensionsDetail & peerDimensionsDetail)374 int32_t CallAbilityCallbackProxy::OnReportPeerDimensionsChange(const PeerDimensionsDetail &peerDimensionsDetail)
375 {
376 MessageParcel dataParcel;
377 MessageParcel replyParcel;
378 MessageOption option;
379 if (!dataParcel.WriteInterfaceToken(CallAbilityCallbackProxy::GetDescriptor())) {
380 TELEPHONY_LOGE("write descriptor fail");
381 return TELEPHONY_ERR_WRITE_DESCRIPTOR_TOKEN_FAIL;
382 }
383 int32_t length = sizeof(PeerDimensionsDetail);
384 dataParcel.WriteInt32(length);
385 dataParcel.WriteRawData((const void *)&peerDimensionsDetail, length);
386 if (Remote() == nullptr) {
387 TELEPHONY_LOGE("function Remote() return nullptr!");
388 return TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL;
389 }
390 int32_t error = Remote()->SendRequest(static_cast<uint32_t>(
391 CallManagerCallAbilityInterfaceCode::PEERD_DIMENSIONS_CHANGE), dataParcel,
392 replyParcel, option);
393 if (error != TELEPHONY_SUCCESS) {
394 TELEPHONY_LOGE("report async results failed, error: %{public}d", error);
395 return TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL;
396 }
397 return replyParcel.ReadInt32();
398 }
399
OnReportCallDataUsageChange(const int64_t dataUsage)400 int32_t CallAbilityCallbackProxy::OnReportCallDataUsageChange(const int64_t dataUsage)
401 {
402 MessageParcel dataParcel;
403 MessageParcel replyParcel;
404 MessageOption option;
405 if (!dataParcel.WriteInterfaceToken(CallAbilityCallbackProxy::GetDescriptor())) {
406 TELEPHONY_LOGE("write descriptor fail");
407 return TELEPHONY_ERR_WRITE_DESCRIPTOR_TOKEN_FAIL;
408 }
409 dataParcel.WriteInt64(dataUsage);
410 if (Remote() == nullptr) {
411 TELEPHONY_LOGE("function Remote() return nullptr!");
412 return TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL;
413 }
414 int32_t error = Remote()->SendRequest(static_cast<uint32_t>(
415 CallManagerCallAbilityInterfaceCode::CALL_DATA_USAGE_CHANGE), dataParcel,
416 replyParcel, option);
417 if (error != TELEPHONY_SUCCESS) {
418 TELEPHONY_LOGE("report async results failed, error: %{public}d", error);
419 return TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL;
420 }
421 return replyParcel.ReadInt32();
422 }
423
OnReportCameraCapabilities(const CameraCapabilities & cameraCapabilities)424 int32_t CallAbilityCallbackProxy::OnReportCameraCapabilities(const CameraCapabilities &cameraCapabilities)
425 {
426 MessageParcel dataParcel;
427 MessageParcel replyParcel;
428 MessageOption option;
429 if (!dataParcel.WriteInterfaceToken(CallAbilityCallbackProxy::GetDescriptor())) {
430 TELEPHONY_LOGE("write descriptor fail");
431 return TELEPHONY_ERR_WRITE_DESCRIPTOR_TOKEN_FAIL;
432 }
433 int32_t length = sizeof(CameraCapabilities);
434 dataParcel.WriteInt32(length);
435 dataParcel.WriteRawData((const void *)&cameraCapabilities, length);
436 if (Remote() == nullptr) {
437 TELEPHONY_LOGE("function Remote() return nullptr!");
438 return TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL;
439 }
440 int32_t error = Remote()->SendRequest(static_cast<uint32_t>(
441 CallManagerCallAbilityInterfaceCode::CAMERA_CAPABILITIES_CHANGE), dataParcel,
442 replyParcel, option);
443 if (error != TELEPHONY_SUCCESS) {
444 TELEPHONY_LOGE("report async results failed, error: %{public}d", error);
445 return TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL;
446 }
447 return replyParcel.ReadInt32();
448 }
449 } // namespace Telephony
450 } // namespace OHOS
451