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 "core_manager_inner.h"
17
18 #include "network_search_types.h"
19 #include "parameter.h"
20 #include "radio_event.h"
21 #include "string_ex.h"
22 #include "telephony_errors.h"
23 #include "telephony_log_wrapper.h"
24
25 using namespace OHOS::Telephony;
26 namespace OHOS {
27 namespace Telephony {
28 constexpr int NETWORK_IS_NULL = -1;
29 constexpr int32_t INVALID_VALUE = -1;
30
CoreManagerInner()31 CoreManagerInner::CoreManagerInner() {}
32
GetInstance()33 CoreManagerInner &CoreManagerInner::GetInstance()
34 {
35 static CoreManagerInner instance;
36 return instance;
37 }
38
OnInit(std::shared_ptr<INetworkSearch> networkSearchManager,std::shared_ptr<ISimManager> simManager,std::shared_ptr<ITelRilManager> telRilManager)39 void CoreManagerInner::OnInit(std::shared_ptr<INetworkSearch> networkSearchManager,
40 std::shared_ptr<ISimManager> simManager, std::shared_ptr<ITelRilManager> telRilManager)
41 {
42 networkSearchManager_ = networkSearchManager;
43 simManager_ = simManager;
44 telRilManager_ = telRilManager;
45 isInitAllObj_ = true;
46 }
47
IsInitFinished(void)48 bool CoreManagerInner::IsInitFinished(void)
49 {
50 return isInitAllObj_;
51 }
52
SetTelRilMangerObj(std::shared_ptr<ITelRilManager> telRilManager)53 void CoreManagerInner::SetTelRilMangerObj(std::shared_ptr<ITelRilManager> telRilManager)
54 {
55 telRilManager_ = telRilManager;
56 }
57
IsInitFinishedForTelRil(void)58 bool CoreManagerInner::IsInitFinishedForTelRil(void)
59 {
60 if (telRilManager_ == nullptr) {
61 TELEPHONY_LOGE("telrilmanager is null");
62 }
63 return telRilManager_ != nullptr;
64 }
65
GetDefaultSlotId(void)66 int32_t CoreManagerInner::GetDefaultSlotId(void)
67 {
68 return DEFAULT_SIM_SLOT_ID;
69 }
70
GetMaxSimCount(void)71 int32_t CoreManagerInner::GetMaxSimCount(void)
72 {
73 return SIM_SLOT_COUNT;
74 }
75
RegisterCoreNotify(int32_t slotId,const std::shared_ptr<AppExecFwk::EventHandler> & handler,int what,int32_t * obj)76 int32_t CoreManagerInner::RegisterCoreNotify(
77 int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler, int what, int32_t *obj)
78 {
79 if (what >= RadioEvent::RADIO_PS_CONNECTION_ATTACHED && what <= RadioEvent::RADIO_EMERGENCY_STATE_CLOSE) {
80 if (networkSearchManager_ == nullptr) {
81 TELEPHONY_LOGE("networkSearchManager is null!");
82 return TELEPHONY_ERR_LOCAL_PTR_NULL;
83 }
84 networkSearchManager_->RegisterCoreNotify(slotId, handler, what);
85 } else if ((what >= RadioEvent::RADIO_SIM_STATE_CHANGE) && (what <= RadioEvent::RADIO_SIM_ACCOUNT_LOADED)) {
86 if (simManager_ == nullptr) {
87 TELEPHONY_LOGE("simManager_ is null");
88 return TELEPHONY_ERR_LOCAL_PTR_NULL;
89 }
90 simManager_->RegisterCoreNotify(slotId, handler, what);
91 } else {
92 if (telRilManager_ == nullptr) {
93 TELEPHONY_LOGE("telRilManager is null!");
94 return TELEPHONY_ERR_LOCAL_PTR_NULL;
95 }
96 return telRilManager_->RegisterCoreNotify(slotId, handler, what, obj);
97 }
98 return TELEPHONY_SUCCESS;
99 }
100
UnRegisterCoreNotify(int32_t slotId,const std::shared_ptr<AppExecFwk::EventHandler> & observerCallBack,int what)101 int32_t CoreManagerInner::UnRegisterCoreNotify(
102 int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &observerCallBack, int what)
103 {
104 if (what >= RadioEvent::RADIO_PS_CONNECTION_ATTACHED && what <= RadioEvent::RADIO_EMERGENCY_STATE_CLOSE) {
105 if (networkSearchManager_ == nullptr) {
106 TELEPHONY_LOGE("networkSearchManager is null!");
107 return TELEPHONY_ERR_LOCAL_PTR_NULL;
108 }
109 networkSearchManager_->UnRegisterCoreNotify(slotId, observerCallBack, what);
110 } else if (what >= RadioEvent::RADIO_SIM_STATE_CHANGE && what <= RadioEvent::RADIO_SIM_RECORDS_LOADED) {
111 if (simManager_ == nullptr) {
112 TELEPHONY_LOGE("simManager_ is null");
113 return TELEPHONY_ERR_LOCAL_PTR_NULL;
114 }
115 simManager_->UnRegisterCoreNotify(slotId, observerCallBack, what);
116 } else {
117 if (telRilManager_ == nullptr) {
118 TELEPHONY_LOGE("telRilManager is null!");
119 return TELEPHONY_ERR_LOCAL_PTR_NULL;
120 }
121 return telRilManager_->UnRegisterCoreNotify(slotId, observerCallBack, what);
122 }
123 return TELEPHONY_SUCCESS;
124 }
125
RegisterCellularDataObject(const sptr<NetworkSearchCallBackBase> & callback)126 void CoreManagerInner::RegisterCellularDataObject(const sptr<NetworkSearchCallBackBase> &callback)
127 {
128 if (networkSearchManager_ == nullptr) {
129 TELEPHONY_LOGE("networkSearchManager is null!");
130 return;
131 }
132 networkSearchManager_->RegisterCellularDataObject(callback);
133 }
134
UnRegisterCellularDataObject(const sptr<NetworkSearchCallBackBase> & callback)135 void CoreManagerInner::UnRegisterCellularDataObject(const sptr<NetworkSearchCallBackBase> &callback)
136 {
137 if (networkSearchManager_ == nullptr) {
138 TELEPHONY_LOGE("networkSearchManager is null!");
139 return;
140 }
141 networkSearchManager_->UnRegisterCellularDataObject(callback);
142 }
143
RegisterCellularCallObject(const sptr<NetworkSearchCallBackBase> & callback)144 void CoreManagerInner::RegisterCellularCallObject(const sptr<NetworkSearchCallBackBase> &callback)
145 {
146 if (networkSearchManager_ == nullptr) {
147 TELEPHONY_LOGE("networkSearchManager is null!");
148 return;
149 }
150 networkSearchManager_->RegisterCellularCallObject(callback);
151 }
152
UnRegisterCellularCallObject(const sptr<NetworkSearchCallBackBase> & callback)153 void CoreManagerInner::UnRegisterCellularCallObject(const sptr<NetworkSearchCallBackBase> &callback)
154 {
155 if (networkSearchManager_ == nullptr) {
156 TELEPHONY_LOGE("networkSearchManager is null!");
157 return;
158 }
159 networkSearchManager_->UnRegisterCellularCallObject(callback);
160 }
161
RegisterSimAccountCallback(const std::string & bundleName,const sptr<SimAccountCallback> & callback)162 int32_t CoreManagerInner::RegisterSimAccountCallback(
163 const std::string &bundleName, const sptr<SimAccountCallback> &callback)
164 {
165 if (simManager_ == nullptr) {
166 TELEPHONY_LOGE("simManager_ is null");
167 return TELEPHONY_ERR_LOCAL_PTR_NULL;
168 }
169 return simManager_->RegisterSimAccountCallback(bundleName, callback);
170 }
171
UnregisterSimAccountCallback(const std::string & bundleName)172 int32_t CoreManagerInner::UnregisterSimAccountCallback(const std::string &bundleName)
173 {
174 if (simManager_ == nullptr) {
175 TELEPHONY_LOGE("simManager_ is null");
176 return TELEPHONY_ERR_LOCAL_PTR_NULL;
177 }
178 return simManager_->UnregisterSimAccountCallback(bundleName);
179 }
180
181 /******************** telRilManager start *******************/
SetUssd(int32_t slotId,int32_t eventId,const std::string str,const std::shared_ptr<AppExecFwk::EventHandler> & handler) const182 int32_t CoreManagerInner::SetUssd(int32_t slotId, int32_t eventId, const std::string str,
183 const std::shared_ptr<AppExecFwk::EventHandler> &handler) const
184 {
185 if (telRilManager_ == nullptr) {
186 TELEPHONY_LOGE("telRilManager is null!");
187 return TELEPHONY_ERR_LOCAL_PTR_NULL;
188 }
189 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
190 if (response == nullptr) {
191 TELEPHONY_LOGE("response is null!");
192 return TELEPHONY_ERR_LOCAL_PTR_NULL;
193 }
194 response->SetOwner(handler);
195 return telRilManager_->SetUssd(slotId, str, response);
196 }
197
CloseUnFinishedUssd(int32_t slotId,int32_t eventId,const std::shared_ptr<AppExecFwk::EventHandler> & handler) const198 int32_t CoreManagerInner::CloseUnFinishedUssd(
199 int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler) const
200 {
201 if (telRilManager_ == nullptr) {
202 TELEPHONY_LOGE("telRilManager is null!");
203 return TELEPHONY_ERR_LOCAL_PTR_NULL;
204 }
205 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
206 if (response == nullptr) {
207 TELEPHONY_LOGE("response is null!");
208 return TELEPHONY_ERR_LOCAL_PTR_NULL;
209 }
210 response->SetOwner(handler);
211 return telRilManager_->CloseUnFinishedUssd(slotId, response);
212 }
213
GetUssd(int32_t slotId,int32_t eventId,const std::shared_ptr<AppExecFwk::EventHandler> & handler) const214 int32_t CoreManagerInner::GetUssd(
215 int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler) const
216 {
217 if (telRilManager_ == nullptr) {
218 TELEPHONY_LOGE("telRilManager is null!");
219 return TELEPHONY_ERR_LOCAL_PTR_NULL;
220 }
221 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
222 if (response == nullptr) {
223 TELEPHONY_LOGE("response is null!");
224 return TELEPHONY_ERR_LOCAL_PTR_NULL;
225 }
226 response->SetOwner(handler);
227 return telRilManager_->GetUssd(slotId, response);
228 }
229
GetMute(int32_t slotId,int32_t eventId,const std::shared_ptr<AppExecFwk::EventHandler> & handler) const230 int32_t CoreManagerInner::GetMute(
231 int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler) const
232 {
233 if (telRilManager_ == nullptr) {
234 TELEPHONY_LOGE("telRilManager is null!");
235 return TELEPHONY_ERR_LOCAL_PTR_NULL;
236 }
237 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
238 if (response == nullptr) {
239 TELEPHONY_LOGE("response is null!");
240 return TELEPHONY_ERR_LOCAL_PTR_NULL;
241 }
242 response->SetOwner(handler);
243 return telRilManager_->GetMute(slotId, response);
244 }
245
SetMute(int32_t slotId,int32_t eventId,int32_t mute,const std::shared_ptr<AppExecFwk::EventHandler> & handler) const246 int32_t CoreManagerInner::SetMute(
247 int32_t slotId, int32_t eventId, int32_t mute, const std::shared_ptr<AppExecFwk::EventHandler> &handler) const
248 {
249 if (telRilManager_ == nullptr) {
250 TELEPHONY_LOGE("telRilManager is null!");
251 return TELEPHONY_ERR_LOCAL_PTR_NULL;
252 }
253 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
254 if (response == nullptr) {
255 TELEPHONY_LOGE("response is null!");
256 return TELEPHONY_ERR_LOCAL_PTR_NULL;
257 }
258 response->SetOwner(handler);
259 return telRilManager_->SetMute(slotId, mute, response);
260 }
261
GetEmergencyCallList(int32_t slotId,int32_t eventId,const std::shared_ptr<AppExecFwk::EventHandler> & handler) const262 int32_t CoreManagerInner::GetEmergencyCallList(
263 int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler) const
264 {
265 if (telRilManager_ == nullptr) {
266 TELEPHONY_LOGE("telRilManager is null!");
267 return TELEPHONY_ERR_LOCAL_PTR_NULL;
268 }
269 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
270 if (response == nullptr) {
271 TELEPHONY_LOGE("response is null!");
272 return TELEPHONY_ERR_LOCAL_PTR_NULL;
273 }
274 response->SetOwner(handler);
275 return telRilManager_->GetEmergencyCallList(slotId, response);
276 }
277
SetEmergencyCallList(int32_t slotId,int32_t eventId,std::vector<EmergencyCall> & eccVec,const std::shared_ptr<AppExecFwk::EventHandler> & handler) const278 int32_t CoreManagerInner::SetEmergencyCallList(int32_t slotId, int32_t eventId, std::vector<EmergencyCall> &eccVec,
279 const std::shared_ptr<AppExecFwk::EventHandler> &handler) const
280 {
281 TELEPHONY_LOGI("SetEmergencyCallList start");
282 if (telRilManager_ == nullptr) {
283 TELEPHONY_LOGE("telRilManager is null!");
284 return TELEPHONY_ERR_LOCAL_PTR_NULL;
285 }
286 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
287 if (response == nullptr) {
288 TELEPHONY_LOGE("response is null!");
289 return TELEPHONY_ERR_LOCAL_PTR_NULL;
290 }
291 response->SetOwner(handler);
292 return telRilManager_->SetEmergencyCallList(slotId, eccVec, response);
293 }
294
GetCallFailReason(int32_t slotId,int32_t eventId,const std::shared_ptr<AppExecFwk::EventHandler> & handler) const295 int32_t CoreManagerInner::GetCallFailReason(
296 int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler) const
297 {
298 if (telRilManager_ == nullptr) {
299 TELEPHONY_LOGE("telRilManager is null!");
300 return TELEPHONY_ERR_LOCAL_PTR_NULL;
301 }
302 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
303 if (response == nullptr) {
304 TELEPHONY_LOGE("response is null!");
305 return TELEPHONY_ERR_LOCAL_PTR_NULL;
306 }
307 response->SetOwner(handler);
308 return telRilManager_->GetCallFailReason(slotId, response);
309 }
310
SetCallPreferenceMode(int32_t slotId,int32_t eventId,int32_t mode,const std::shared_ptr<AppExecFwk::EventHandler> & handler) const311 int32_t CoreManagerInner::SetCallPreferenceMode(
312 int32_t slotId, int32_t eventId, int32_t mode, const std::shared_ptr<AppExecFwk::EventHandler> &handler) const
313 {
314 if (telRilManager_ == nullptr) {
315 TELEPHONY_LOGE("telRilManager is null!");
316 return TELEPHONY_ERR_LOCAL_PTR_NULL;
317 }
318 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
319 if (response == nullptr) {
320 TELEPHONY_LOGE("response is null!");
321 return TELEPHONY_ERR_LOCAL_PTR_NULL;
322 }
323 response->SetOwner(handler);
324 return telRilManager_->SetCallPreferenceMode(slotId, mode, response);
325 }
326
GetCallPreferenceMode(int32_t slotId,int32_t eventId,const std::shared_ptr<AppExecFwk::EventHandler> & handler) const327 int32_t CoreManagerInner::GetCallPreferenceMode(
328 int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler) const
329 {
330 if (telRilManager_ == nullptr) {
331 TELEPHONY_LOGE("telRilManager is null!");
332 return TELEPHONY_ERR_LOCAL_PTR_NULL;
333 }
334 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
335 if (response == nullptr) {
336 TELEPHONY_LOGE("response is null!");
337 return TELEPHONY_ERR_LOCAL_PTR_NULL;
338 }
339 response->SetOwner(handler);
340 return telRilManager_->GetCallPreferenceMode(slotId, response);
341 }
342
SetPreferredNetworkPara(int32_t slotId,int32_t eventId,int32_t preferredNetworkType,const std::shared_ptr<AppExecFwk::EventHandler> & handler)343 int32_t CoreManagerInner::SetPreferredNetworkPara(int32_t slotId, int32_t eventId, int32_t preferredNetworkType,
344 const std::shared_ptr<AppExecFwk::EventHandler> &handler)
345 {
346 if (telRilManager_ == nullptr) {
347 TELEPHONY_LOGE("telRilManager is null!");
348 return TELEPHONY_ERR_LOCAL_PTR_NULL;
349 }
350 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
351 if (response == nullptr) {
352 TELEPHONY_LOGE("response is null!");
353 return TELEPHONY_ERR_LOCAL_PTR_NULL;
354 }
355 response->SetOwner(handler);
356 return telRilManager_->SetPreferredNetwork(slotId, preferredNetworkType, response);
357 }
358
GetPreferredNetworkPara(int32_t slotId,int32_t eventId,const std::shared_ptr<AppExecFwk::EventHandler> & handler)359 int32_t CoreManagerInner::GetPreferredNetworkPara(
360 int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler)
361 {
362 if (telRilManager_ == nullptr) {
363 TELEPHONY_LOGE("telRilManager is null!");
364 return TELEPHONY_ERR_LOCAL_PTR_NULL;
365 }
366 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
367 if (response == nullptr) {
368 TELEPHONY_LOGE("response is null!");
369 return TELEPHONY_ERR_LOCAL_PTR_NULL;
370 }
371 response->SetOwner(handler);
372 return telRilManager_->GetPreferredNetwork(slotId, response);
373 }
374
GetOperatorInfo(int32_t slotId,int32_t eventId,const std::shared_ptr<AppExecFwk::EventHandler> & handler) const375 int32_t CoreManagerInner::GetOperatorInfo(
376 int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler) const
377 {
378 if (telRilManager_ == nullptr) {
379 TELEPHONY_LOGE("telRilManager is null!");
380 return TELEPHONY_ERR_LOCAL_PTR_NULL;
381 }
382 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
383 if (response == nullptr) {
384 TELEPHONY_LOGE("response is null!");
385 return TELEPHONY_ERR_LOCAL_PTR_NULL;
386 }
387 response->SetOwner(handler);
388 return telRilManager_->GetOperatorInfo(slotId, response);
389 }
390
GetCellInfoList(int32_t slotId,int32_t eventId,const std::shared_ptr<AppExecFwk::EventHandler> & handler)391 int32_t CoreManagerInner::GetCellInfoList(
392 int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler)
393 {
394 if (telRilManager_ == nullptr) {
395 TELEPHONY_LOGE("telRilManager is null!");
396 return TELEPHONY_ERR_LOCAL_PTR_NULL;
397 }
398 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
399 if (response == nullptr) {
400 TELEPHONY_LOGE("response is null!");
401 return TELEPHONY_ERR_LOCAL_PTR_NULL;
402 }
403 response->SetOwner(handler);
404 return telRilManager_->GetCellInfoList(slotId, response);
405 }
406
GetCurrentCellInfo(int32_t slotId,int32_t eventId,const std::shared_ptr<AppExecFwk::EventHandler> & handler)407 int32_t CoreManagerInner::GetCurrentCellInfo(
408 int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler)
409 {
410 if (telRilManager_ == nullptr) {
411 TELEPHONY_LOGE("telRilManager is null!");
412 return TELEPHONY_ERR_LOCAL_PTR_NULL;
413 }
414 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
415 if (response == nullptr) {
416 TELEPHONY_LOGE("response is null!");
417 return TELEPHONY_ERR_LOCAL_PTR_NULL;
418 }
419 response->SetOwner(handler);
420 return telRilManager_->GetCurrentCellInfo(slotId, response);
421 }
422
SendGsmSms(int32_t slotId,int32_t eventId,GsmSimMessageParam & gsmMessage,const std::shared_ptr<AppExecFwk::EventHandler> & handler)423 int32_t CoreManagerInner::SendGsmSms(int32_t slotId, int32_t eventId, GsmSimMessageParam &gsmMessage,
424 const std::shared_ptr<AppExecFwk::EventHandler> &handler)
425 {
426 if (telRilManager_ == nullptr) {
427 TELEPHONY_LOGE("telRilManager is null!");
428 return TELEPHONY_ERR_LOCAL_PTR_NULL;
429 }
430 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId, gsmMessage.refId);
431 if (response == nullptr) {
432 TELEPHONY_LOGE("response is null!");
433 return TELEPHONY_ERR_LOCAL_PTR_NULL;
434 }
435 response->SetOwner(handler);
436 return telRilManager_->SendGsmSms(slotId, gsmMessage.smscPdu, gsmMessage.pdu, response);
437 }
438
SendCdmaSms(int32_t slotId,int32_t eventId,std::string pdu,int64_t refId,const std::shared_ptr<AppExecFwk::EventHandler> & handler)439 int32_t CoreManagerInner::SendCdmaSms(int32_t slotId, int32_t eventId, std::string pdu, int64_t refId,
440 const std::shared_ptr<AppExecFwk::EventHandler> &handler)
441 {
442 if (telRilManager_ == nullptr) {
443 TELEPHONY_LOGE("telRilManager is null!");
444 return TELEPHONY_ERR_LOCAL_PTR_NULL;
445 }
446 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId, refId);
447 if (response == nullptr) {
448 TELEPHONY_LOGE("response is null!");
449 return TELEPHONY_ERR_LOCAL_PTR_NULL;
450 }
451 response->SetOwner(handler);
452 return telRilManager_->SendCdmaSms(slotId, pdu, response);
453 }
454
AddSimMessage(int32_t slotId,int32_t eventId,const SimMessageParam & simMessage,const std::shared_ptr<AppExecFwk::EventHandler> & handler)455 int32_t CoreManagerInner::AddSimMessage(int32_t slotId, int32_t eventId, const SimMessageParam &simMessage,
456 const std::shared_ptr<AppExecFwk::EventHandler> &handler)
457 {
458 if (telRilManager_ == nullptr) {
459 TELEPHONY_LOGE("telRilManager is null!");
460 return TELEPHONY_ERR_LOCAL_PTR_NULL;
461 }
462 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
463 if (response == nullptr) {
464 TELEPHONY_LOGE("response is null!");
465 return TELEPHONY_ERR_LOCAL_PTR_NULL;
466 }
467 response->SetOwner(handler);
468 return telRilManager_->AddSimMessage(slotId, simMessage, response);
469 }
470
DelSimMessage(int32_t slotId,int32_t eventId,int32_t gsmIndex,const std::shared_ptr<AppExecFwk::EventHandler> & handler)471 int32_t CoreManagerInner::DelSimMessage(
472 int32_t slotId, int32_t eventId, int32_t gsmIndex, const std::shared_ptr<AppExecFwk::EventHandler> &handler)
473 {
474 if (telRilManager_ == nullptr) {
475 TELEPHONY_LOGE("telRilManager is null!");
476 return TELEPHONY_ERR_LOCAL_PTR_NULL;
477 }
478 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
479 if (response == nullptr) {
480 TELEPHONY_LOGE("response is null!");
481 return TELEPHONY_ERR_LOCAL_PTR_NULL;
482 }
483 response->SetOwner(handler);
484 return telRilManager_->DelSimMessage(slotId, gsmIndex, response);
485 }
486
GetSmscAddr(int32_t slotId,int32_t eventId,const std::shared_ptr<AppExecFwk::EventHandler> & handler) const487 int32_t CoreManagerInner::GetSmscAddr(
488 int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler) const
489 {
490 if (telRilManager_ == nullptr) {
491 TELEPHONY_LOGE("telRilManager is null!");
492 return TELEPHONY_ERR_LOCAL_PTR_NULL;
493 }
494 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
495 if (response == nullptr) {
496 TELEPHONY_LOGE("response is null!");
497 return TELEPHONY_ERR_LOCAL_PTR_NULL;
498 }
499 response->SetOwner(handler);
500 return telRilManager_->GetSmscAddr(slotId, response);
501 }
502
SetSmscAddr(int32_t slotId,int32_t eventId,int32_t tosca,std::string address,const std::shared_ptr<AppExecFwk::EventHandler> & handler)503 int32_t CoreManagerInner::SetSmscAddr(int32_t slotId, int32_t eventId, int32_t tosca, std::string address,
504 const std::shared_ptr<AppExecFwk::EventHandler> &handler)
505 {
506 if (telRilManager_ == nullptr) {
507 TELEPHONY_LOGE("telRilManager is null!");
508 return TELEPHONY_ERR_LOCAL_PTR_NULL;
509 }
510 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
511 if (response == nullptr) {
512 TELEPHONY_LOGE("response is null!");
513 return TELEPHONY_ERR_LOCAL_PTR_NULL;
514 }
515 response->SetOwner(handler);
516 return telRilManager_->SetSmscAddr(slotId, tosca, address, response);
517 }
518
SetCBConfig(int32_t slotId,int32_t eventId,const CBConfigParam & cbConfig,const std::shared_ptr<AppExecFwk::EventHandler> & handler)519 int32_t CoreManagerInner::SetCBConfig(int32_t slotId, int32_t eventId, const CBConfigParam &cbConfig,
520 const std::shared_ptr<AppExecFwk::EventHandler> &handler)
521 {
522 if (telRilManager_ == nullptr) {
523 TELEPHONY_LOGE("telRilManager is null!");
524 return TELEPHONY_ERR_LOCAL_PTR_NULL;
525 }
526 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
527 if (response == nullptr) {
528 TELEPHONY_LOGE("response is null!");
529 return TELEPHONY_ERR_LOCAL_PTR_NULL;
530 }
531 response->SetOwner(handler);
532 return telRilManager_->SetCBConfig(slotId, cbConfig, response);
533 }
534
SetCdmaCBConfig(int32_t slotId,int32_t eventId,CdmaCBConfigInfoList & cdmaCBConfigInfoList,const std::shared_ptr<AppExecFwk::EventHandler> & handler)535 int32_t CoreManagerInner::SetCdmaCBConfig(int32_t slotId, int32_t eventId, CdmaCBConfigInfoList &cdmaCBConfigInfoList,
536 const std::shared_ptr<AppExecFwk::EventHandler> &handler)
537 {
538 if (telRilManager_ == nullptr) {
539 TELEPHONY_LOGE("telRilManager is null!");
540 return TELEPHONY_ERR_LOCAL_PTR_NULL;
541 }
542 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
543 if (response == nullptr) {
544 TELEPHONY_LOGE("response is null!");
545 return TELEPHONY_ERR_LOCAL_PTR_NULL;
546 }
547 response->SetOwner(handler);
548 return telRilManager_->SetCdmaCBConfig(slotId, cdmaCBConfigInfoList, response);
549 }
550
GetCBConfig(int32_t slotId,int32_t eventId,const std::shared_ptr<AppExecFwk::EventHandler> & handler)551 int32_t CoreManagerInner::GetCBConfig(
552 int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler)
553 {
554 if (telRilManager_ == nullptr) {
555 TELEPHONY_LOGE("telRilManager is null!");
556 return TELEPHONY_ERR_LOCAL_PTR_NULL;
557 }
558 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
559 if (response == nullptr) {
560 TELEPHONY_LOGE("response is null!");
561 return TELEPHONY_ERR_LOCAL_PTR_NULL;
562 }
563 response->SetOwner(handler);
564 return telRilManager_->GetCBConfig(slotId, response);
565 }
566
GetCdmaCBConfig(int32_t slotId,int32_t eventId,const std::shared_ptr<AppExecFwk::EventHandler> & handler)567 int32_t CoreManagerInner::GetCdmaCBConfig(
568 int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler)
569 {
570 if (telRilManager_ == nullptr) {
571 TELEPHONY_LOGE("telRilManager is null!");
572 return TELEPHONY_ERR_LOCAL_PTR_NULL;
573 }
574 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
575 if (response == nullptr) {
576 TELEPHONY_LOGE("response is null!");
577 return TELEPHONY_ERR_LOCAL_PTR_NULL;
578 }
579 response->SetOwner(handler);
580 return telRilManager_->GetCdmaCBConfig(slotId, response);
581 }
582
SendSmsMoreMode(int32_t slotId,int32_t eventId,GsmSimMessageParam & gsmMessage,const std::shared_ptr<AppExecFwk::EventHandler> & handler)583 int32_t CoreManagerInner::SendSmsMoreMode(int32_t slotId, int32_t eventId, GsmSimMessageParam &gsmMessage,
584 const std::shared_ptr<AppExecFwk::EventHandler> &handler)
585 {
586 if (telRilManager_ == nullptr) {
587 TELEPHONY_LOGE("telRilManager is null!");
588 return TELEPHONY_ERR_LOCAL_PTR_NULL;
589 }
590 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId, gsmMessage.refId);
591 if (response == nullptr) {
592 TELEPHONY_LOGE("response is null!");
593 return TELEPHONY_ERR_LOCAL_PTR_NULL;
594 }
595 response->SetOwner(handler);
596 return telRilManager_->SendSmsMoreMode(slotId, gsmMessage.smscPdu, gsmMessage.pdu, response);
597 }
598
SendSmsAck(int32_t slotId,int32_t eventId,bool success,int32_t cause,const std::shared_ptr<AppExecFwk::EventHandler> & handler)599 int32_t CoreManagerInner::SendSmsAck(int32_t slotId, int32_t eventId, bool success, int32_t cause,
600 const std::shared_ptr<AppExecFwk::EventHandler> &handler)
601 {
602 if (telRilManager_ == nullptr) {
603 TELEPHONY_LOGE("telRilManager is null!");
604 return TELEPHONY_ERR_LOCAL_PTR_NULL;
605 }
606 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
607 if (response == nullptr) {
608 TELEPHONY_LOGE("response is null!");
609 return TELEPHONY_ERR_LOCAL_PTR_NULL;
610 }
611 response->SetOwner(handler);
612 return telRilManager_->SendSmsAck(slotId, success, cause, response);
613 }
614
AddCdmaSimMessage(int32_t slotId,int32_t eventId,int32_t status,std::string pdu,const std::shared_ptr<AppExecFwk::EventHandler> & handler)615 int32_t CoreManagerInner::AddCdmaSimMessage(int32_t slotId, int32_t eventId, int32_t status, std::string pdu,
616 const std::shared_ptr<AppExecFwk::EventHandler> &handler)
617 {
618 if (telRilManager_ == nullptr) {
619 TELEPHONY_LOGE("telRilManager is null!");
620 return TELEPHONY_ERR_LOCAL_PTR_NULL;
621 }
622 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
623 if (response == nullptr) {
624 TELEPHONY_LOGE("response is null!");
625 return TELEPHONY_ERR_LOCAL_PTR_NULL;
626 }
627 response->SetOwner(handler);
628 return telRilManager_->AddCdmaSimMessage(slotId, status, pdu, response);
629 }
630
DelCdmaSimMessage(int32_t slotId,int32_t eventId,int32_t cdmaIndex,const std::shared_ptr<AppExecFwk::EventHandler> & handler)631 int32_t CoreManagerInner::DelCdmaSimMessage(
632 int32_t slotId, int32_t eventId, int32_t cdmaIndex, const std::shared_ptr<AppExecFwk::EventHandler> &handler)
633 {
634 if (telRilManager_ == nullptr) {
635 TELEPHONY_LOGE("telRilManager is null!");
636 return TELEPHONY_ERR_LOCAL_PTR_NULL;
637 }
638 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
639 if (response == nullptr) {
640 TELEPHONY_LOGE("response is null!");
641 return TELEPHONY_ERR_LOCAL_PTR_NULL;
642 }
643 response->SetOwner(handler);
644 return telRilManager_->DelCdmaSimMessage(slotId, cdmaIndex, response);
645 }
646
UpdateCdmaSimMessage(int32_t slotId,int32_t eventId,const CdmaSimMessageParam & cdmaSimMsg,const std::shared_ptr<AppExecFwk::EventHandler> & handler)647 int32_t CoreManagerInner::UpdateCdmaSimMessage(int32_t slotId, int32_t eventId, const CdmaSimMessageParam &cdmaSimMsg,
648 const std::shared_ptr<AppExecFwk::EventHandler> &handler)
649 {
650 if (telRilManager_ == nullptr) {
651 TELEPHONY_LOGE("telRilManager is null!");
652 return TELEPHONY_ERR_LOCAL_PTR_NULL;
653 }
654 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
655 if (response == nullptr) {
656 TELEPHONY_LOGE("response is null!");
657 return TELEPHONY_ERR_LOCAL_PTR_NULL;
658 }
659 response->SetOwner(handler);
660 return telRilManager_->UpdateCdmaSimMessage(slotId, cdmaSimMsg, response);
661 }
662
GetNetworkSearchInformation(int32_t slotId,int32_t eventId,const std::shared_ptr<AppExecFwk::EventHandler> & handler) const663 int32_t CoreManagerInner::GetNetworkSearchInformation(
664 int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler) const
665 {
666 if (telRilManager_ == nullptr) {
667 TELEPHONY_LOGE("telRilManager is null!");
668 return TELEPHONY_ERR_LOCAL_PTR_NULL;
669 }
670 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
671 if (response == nullptr) {
672 TELEPHONY_LOGE("response is null!");
673 return TELEPHONY_ERR_LOCAL_PTR_NULL;
674 }
675 response->SetOwner(handler);
676 return telRilManager_->GetNetworkSearchInformation(slotId, response);
677 }
678
GetNetworkSelectionMode(int32_t slotId,int32_t eventId,const std::shared_ptr<AppExecFwk::EventHandler> & handler) const679 int32_t CoreManagerInner::GetNetworkSelectionMode(
680 int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler) const
681 {
682 if (telRilManager_ == nullptr) {
683 TELEPHONY_LOGE("telRilManager is null!");
684 return TELEPHONY_ERR_LOCAL_PTR_NULL;
685 }
686 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
687 if (response == nullptr) {
688 TELEPHONY_LOGE("response is null!");
689 return TELEPHONY_ERR_LOCAL_PTR_NULL;
690 }
691 response->SetOwner(handler);
692 return telRilManager_->GetNetworkSelectionMode(slotId, response);
693 }
694
SetNetworkSelectionMode(int32_t slotId,int32_t eventId,int32_t automaticFlag,std::string oper,const std::shared_ptr<AppExecFwk::EventHandler> & handler)695 int32_t CoreManagerInner::SetNetworkSelectionMode(int32_t slotId, int32_t eventId, int32_t automaticFlag,
696 std::string oper, const std::shared_ptr<AppExecFwk::EventHandler> &handler)
697 {
698 if (telRilManager_ == nullptr) {
699 TELEPHONY_LOGE("telRilManager is null!");
700 return TELEPHONY_ERR_LOCAL_PTR_NULL;
701 }
702 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
703 if (response == nullptr) {
704 TELEPHONY_LOGE("response is null!");
705 return TELEPHONY_ERR_LOCAL_PTR_NULL;
706 }
707 response->SetOwner(handler);
708 return telRilManager_->SetNetworkSelectionMode(slotId, automaticFlag, oper, response);
709 }
710
SetRadioState(int32_t slotId,int32_t eventId,int fun,int rst,const std::shared_ptr<AppExecFwk::EventHandler> & handler)711 int32_t CoreManagerInner::SetRadioState(
712 int32_t slotId, int32_t eventId, int fun, int rst, const std::shared_ptr<AppExecFwk::EventHandler> &handler)
713 {
714 if (telRilManager_ == nullptr) {
715 TELEPHONY_LOGE("telRilManager is null!");
716 return TELEPHONY_ERR_LOCAL_PTR_NULL;
717 }
718 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
719 if (response == nullptr) {
720 TELEPHONY_LOGE("response is null!");
721 return TELEPHONY_ERR_LOCAL_PTR_NULL;
722 }
723 response->SetOwner(handler);
724 return telRilManager_->SetRadioState(slotId, fun, rst, response);
725 }
726
GetRadioState(int32_t slotId,int32_t eventId,const std::shared_ptr<AppExecFwk::EventHandler> & handler) const727 int32_t CoreManagerInner::GetRadioState(
728 int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler) const
729 {
730 if (telRilManager_ == nullptr) {
731 TELEPHONY_LOGE("telRilManager is null!");
732 return TELEPHONY_ERR_LOCAL_PTR_NULL;
733 }
734 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
735 if (response == nullptr) {
736 TELEPHONY_LOGE("response is null!");
737 return TELEPHONY_ERR_LOCAL_PTR_NULL;
738 }
739 response->SetOwner(handler);
740 return telRilManager_->GetRadioState(slotId, response);
741 }
742
ShutDown(int32_t slotId,int32_t eventId,const std::shared_ptr<AppExecFwk::EventHandler> & handler)743 int32_t CoreManagerInner::ShutDown(
744 int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler)
745 {
746 if (telRilManager_ == nullptr) {
747 TELEPHONY_LOGE("telRilManager is null!");
748 return TELEPHONY_ERR_LOCAL_PTR_NULL;
749 }
750 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
751 if (response == nullptr) {
752 TELEPHONY_LOGE("response is null!");
753 return TELEPHONY_ERR_LOCAL_PTR_NULL;
754 }
755 response->SetOwner(handler);
756 return telRilManager_->ShutDown(slotId, response);
757 }
758
Dial(int32_t slotId,int32_t eventId,std::string address,int clirMode,const std::shared_ptr<AppExecFwk::EventHandler> & handler)759 int32_t CoreManagerInner::Dial(int32_t slotId, int32_t eventId, std::string address, int clirMode,
760 const std::shared_ptr<AppExecFwk::EventHandler> &handler)
761 {
762 if (telRilManager_ == nullptr) {
763 TELEPHONY_LOGE("telRilManager is null!");
764 return TELEPHONY_ERR_LOCAL_PTR_NULL;
765 }
766 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
767 if (response == nullptr) {
768 TELEPHONY_LOGE("response is null!");
769 return TELEPHONY_ERR_LOCAL_PTR_NULL;
770 }
771 response->SetOwner(handler);
772 return telRilManager_->Dial(slotId, address, clirMode, response);
773 }
774
Reject(int32_t slotId,int32_t eventId,const std::shared_ptr<AppExecFwk::EventHandler> & handler)775 int32_t CoreManagerInner::Reject(
776 int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler)
777 {
778 if (telRilManager_ == nullptr) {
779 TELEPHONY_LOGE("telRilManager is null!");
780 return TELEPHONY_ERR_LOCAL_PTR_NULL;
781 }
782 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
783 if (response == nullptr) {
784 TELEPHONY_LOGE("response is null!");
785 return TELEPHONY_ERR_LOCAL_PTR_NULL;
786 }
787 response->SetOwner(handler);
788 return telRilManager_->Reject(slotId, response);
789 }
790
Hangup(int32_t slotId,int32_t eventId,int32_t gsmIndex,const std::shared_ptr<AppExecFwk::EventHandler> & handler)791 int32_t CoreManagerInner::Hangup(
792 int32_t slotId, int32_t eventId, int32_t gsmIndex, const std::shared_ptr<AppExecFwk::EventHandler> &handler)
793 {
794 if (telRilManager_ == nullptr) {
795 TELEPHONY_LOGE("telRilManager is null!");
796 return TELEPHONY_ERR_LOCAL_PTR_NULL;
797 }
798 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
799 if (response == nullptr) {
800 TELEPHONY_LOGE("response is null!");
801 return TELEPHONY_ERR_LOCAL_PTR_NULL;
802 }
803 response->SetOwner(handler);
804 return telRilManager_->Hangup(slotId, gsmIndex, response);
805 }
806
Answer(int32_t slotId,int32_t eventId,const std::shared_ptr<AppExecFwk::EventHandler> & handler)807 int32_t CoreManagerInner::Answer(
808 int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler)
809 {
810 if (telRilManager_ == nullptr) {
811 TELEPHONY_LOGE("telRilManager is null!");
812 return TELEPHONY_ERR_LOCAL_PTR_NULL;
813 }
814 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
815 if (response == nullptr) {
816 TELEPHONY_LOGE("response is null!");
817 return TELEPHONY_ERR_LOCAL_PTR_NULL;
818 }
819 response->SetOwner(handler);
820 return telRilManager_->Answer(slotId, response);
821 }
822
GetCallList(int32_t slotId,int32_t eventId,const std::shared_ptr<AppExecFwk::EventHandler> & handler) const823 int32_t CoreManagerInner::GetCallList(
824 int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler) const
825 {
826 if (telRilManager_ == nullptr) {
827 TELEPHONY_LOGE("telRilManager is null!");
828 return TELEPHONY_ERR_LOCAL_PTR_NULL;
829 }
830 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
831 if (response == nullptr) {
832 TELEPHONY_LOGE("response is null!");
833 return TELEPHONY_ERR_LOCAL_PTR_NULL;
834 }
835 response->SetOwner(handler);
836 return telRilManager_->GetCallList(slotId, response);
837 }
838
HoldCall(int32_t slotId,int32_t eventId,const std::shared_ptr<AppExecFwk::EventHandler> & handler)839 int32_t CoreManagerInner::HoldCall(
840 int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler)
841 {
842 if (telRilManager_ == nullptr) {
843 TELEPHONY_LOGE("telRilManager is null!");
844 return TELEPHONY_ERR_LOCAL_PTR_NULL;
845 }
846 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
847 if (response == nullptr) {
848 TELEPHONY_LOGE("response is null!");
849 return TELEPHONY_ERR_LOCAL_PTR_NULL;
850 }
851 response->SetOwner(handler);
852 return telRilManager_->HoldCall(slotId, response);
853 }
854
UnHoldCall(int32_t slotId,int32_t eventId,const std::shared_ptr<AppExecFwk::EventHandler> & handler)855 int32_t CoreManagerInner::UnHoldCall(
856 int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler)
857 {
858 if (telRilManager_ == nullptr) {
859 TELEPHONY_LOGE("telRilManager is null!");
860 return TELEPHONY_ERR_LOCAL_PTR_NULL;
861 }
862 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
863 if (response == nullptr) {
864 TELEPHONY_LOGE("response is null!");
865 return TELEPHONY_ERR_LOCAL_PTR_NULL;
866 }
867 response->SetOwner(handler);
868 return telRilManager_->UnHoldCall(slotId, response);
869 }
870
SwitchCall(int32_t slotId,int32_t eventId,const std::shared_ptr<AppExecFwk::EventHandler> & handler)871 int32_t CoreManagerInner::SwitchCall(
872 int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler)
873 {
874 if (telRilManager_ == nullptr) {
875 TELEPHONY_LOGE("telRilManager is null!");
876 return TELEPHONY_ERR_LOCAL_PTR_NULL;
877 }
878 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
879 if (response == nullptr) {
880 TELEPHONY_LOGE("response is null!");
881 return TELEPHONY_ERR_LOCAL_PTR_NULL;
882 }
883 response->SetOwner(handler);
884 return telRilManager_->SwitchCall(slotId, response);
885 }
886
CombineConference(int32_t slotId,int32_t eventId,int32_t callType,const std::shared_ptr<AppExecFwk::EventHandler> & handler)887 int32_t CoreManagerInner::CombineConference(
888 int32_t slotId, int32_t eventId, int32_t callType, const std::shared_ptr<AppExecFwk::EventHandler> &handler)
889 {
890 if (telRilManager_ == nullptr) {
891 TELEPHONY_LOGE("telRilManager is null!");
892 return TELEPHONY_ERR_LOCAL_PTR_NULL;
893 }
894 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
895 if (response == nullptr) {
896 TELEPHONY_LOGE("response is null!");
897 return TELEPHONY_ERR_LOCAL_PTR_NULL;
898 }
899 response->SetOwner(handler);
900 return telRilManager_->CombineConference(slotId, callType, response);
901 }
902
SeparateConference(int32_t slotId,int32_t eventId,int32_t callIndex,int32_t callType,const std::shared_ptr<AppExecFwk::EventHandler> & handler)903 int32_t CoreManagerInner::SeparateConference(int32_t slotId, int32_t eventId, int32_t callIndex, int32_t callType,
904 const std::shared_ptr<AppExecFwk::EventHandler> &handler)
905 {
906 if (telRilManager_ == nullptr) {
907 TELEPHONY_LOGE("telRilManager is null!");
908 return TELEPHONY_ERR_LOCAL_PTR_NULL;
909 }
910 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
911 if (response == nullptr) {
912 TELEPHONY_LOGE("response is null!");
913 return TELEPHONY_ERR_LOCAL_PTR_NULL;
914 }
915 response->SetOwner(handler);
916 return telRilManager_->SeparateConference(slotId, callIndex, callType, response);
917 }
918
CallSupplement(int32_t slotId,int32_t eventId,int32_t type,const std::shared_ptr<AppExecFwk::EventHandler> & handler)919 int32_t CoreManagerInner::CallSupplement(
920 int32_t slotId, int32_t eventId, int32_t type, const std::shared_ptr<AppExecFwk::EventHandler> &handler)
921 {
922 if (telRilManager_ == nullptr) {
923 TELEPHONY_LOGE("telRilManager is null!");
924 return TELEPHONY_ERR_LOCAL_PTR_NULL;
925 }
926 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
927 if (response == nullptr) {
928 TELEPHONY_LOGE("response is null!");
929 return TELEPHONY_ERR_LOCAL_PTR_NULL;
930 }
931 response->SetOwner(handler);
932 return telRilManager_->CallSupplement(slotId, type, response);
933 }
934
GetClip(int32_t slotId,const AppExecFwk::InnerEvent::Pointer & response) const935 int32_t CoreManagerInner::GetClip(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &response) const
936 {
937 if (telRilManager_ == nullptr) {
938 TELEPHONY_LOGE("telRilManager is null!");
939 return TELEPHONY_ERR_LOCAL_PTR_NULL;
940 }
941 return telRilManager_->GetClip(slotId, response);
942 }
943
SetClip(int32_t slotId,int32_t action,const AppExecFwk::InnerEvent::Pointer & response)944 int32_t CoreManagerInner::SetClip(int32_t slotId, int32_t action, const AppExecFwk::InnerEvent::Pointer &response)
945 {
946 if (telRilManager_ == nullptr) {
947 TELEPHONY_LOGE("telRilManager is null!");
948 return TELEPHONY_ERR_LOCAL_PTR_NULL;
949 }
950 return telRilManager_->SetClip(slotId, action, response);
951 }
952
GetClir(int32_t slotId,const AppExecFwk::InnerEvent::Pointer & response) const953 int32_t CoreManagerInner::GetClir(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &response) const
954 {
955 if (telRilManager_ == nullptr) {
956 TELEPHONY_LOGE("telRilManager is null!");
957 return TELEPHONY_ERR_LOCAL_PTR_NULL;
958 }
959 return telRilManager_->GetClir(slotId, response);
960 }
961
SetClir(int32_t slotId,int32_t action,const AppExecFwk::InnerEvent::Pointer & response)962 int32_t CoreManagerInner::SetClir(int32_t slotId, int32_t action, const AppExecFwk::InnerEvent::Pointer &response)
963 {
964 if (telRilManager_ == nullptr) {
965 TELEPHONY_LOGE("telRilManager is null!");
966 return TELEPHONY_ERR_LOCAL_PTR_NULL;
967 }
968 return telRilManager_->SetClir(slotId, action, response);
969 }
970
SetCallWaiting(int32_t slotId,int32_t activate,const AppExecFwk::InnerEvent::Pointer & response)971 int32_t CoreManagerInner::SetCallWaiting(
972 int32_t slotId, int32_t activate, const AppExecFwk::InnerEvent::Pointer &response)
973 {
974 if (telRilManager_ == nullptr) {
975 TELEPHONY_LOGE("telRilManager is null!");
976 return TELEPHONY_ERR_LOCAL_PTR_NULL;
977 }
978 return telRilManager_->SetCallWaiting(slotId, activate, response);
979 }
980
SetCallTransferInfo(int32_t slotId,const CallTransferParam & callTransfer,const AppExecFwk::InnerEvent::Pointer & response)981 int32_t CoreManagerInner::SetCallTransferInfo(
982 int32_t slotId, const CallTransferParam &callTransfer, const AppExecFwk::InnerEvent::Pointer &response)
983 {
984 if (telRilManager_ == nullptr) {
985 TELEPHONY_LOGE("telRilManager is null!");
986 return TELEPHONY_ERR_LOCAL_PTR_NULL;
987 }
988 return telRilManager_->SetCallTransferInfo(slotId, callTransfer, response);
989 }
990
GetCallTransferInfo(int32_t slotId,const int32_t reason,const AppExecFwk::InnerEvent::Pointer & response) const991 int32_t CoreManagerInner::GetCallTransferInfo(
992 int32_t slotId, const int32_t reason, const AppExecFwk::InnerEvent::Pointer &response) const
993 {
994 if (telRilManager_ == nullptr) {
995 TELEPHONY_LOGE("telRilManager is null!");
996 return TELEPHONY_ERR_LOCAL_PTR_NULL;
997 }
998 return telRilManager_->GetCallTransferInfo(slotId, reason, response);
999 }
1000
GetCallWaiting(int32_t slotId,const AppExecFwk::InnerEvent::Pointer & response) const1001 int32_t CoreManagerInner::GetCallWaiting(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &response) const
1002 {
1003 if (telRilManager_ == nullptr) {
1004 TELEPHONY_LOGE("telRilManager is null!");
1005 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1006 }
1007 return telRilManager_->GetCallWaiting(slotId, response);
1008 }
1009
GetCallRestriction(int32_t slotId,std::string fac,const AppExecFwk::InnerEvent::Pointer & response) const1010 int32_t CoreManagerInner::GetCallRestriction(
1011 int32_t slotId, std::string fac, const AppExecFwk::InnerEvent::Pointer &response) const
1012 {
1013 if (telRilManager_ == nullptr) {
1014 TELEPHONY_LOGE("telRilManager is null!");
1015 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1016 }
1017 return telRilManager_->GetCallRestriction(slotId, fac, response);
1018 }
1019
SetCallRestriction(int32_t slotId,const CallRestrictionParam & callRestriction,const AppExecFwk::InnerEvent::Pointer & response)1020 int32_t CoreManagerInner::SetCallRestriction(
1021 int32_t slotId, const CallRestrictionParam &callRestriction, const AppExecFwk::InnerEvent::Pointer &response)
1022 {
1023 if (telRilManager_ == nullptr) {
1024 TELEPHONY_LOGE("telRilManager is null!");
1025 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1026 }
1027 return telRilManager_->SetCallRestriction(slotId, callRestriction, response);
1028 }
1029
SetBarringPassword(int32_t slotId,const char * oldPassword,const char * newPassword,const std::string & restrictionType,const AppExecFwk::InnerEvent::Pointer & response)1030 int32_t CoreManagerInner::SetBarringPassword(int32_t slotId, const char *oldPassword,
1031 const char *newPassword, const std::string &restrictionType, const AppExecFwk::InnerEvent::Pointer &response)
1032 {
1033 if (telRilManager_ == nullptr) {
1034 TELEPHONY_LOGE("telRilManager is null!");
1035 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1036 }
1037 return telRilManager_->SetBarringPassword(slotId, oldPassword, newPassword, restrictionType, response);
1038 }
1039
SetVoNRSwitch(int32_t slotId,int32_t state,int32_t eventId,const std::shared_ptr<AppExecFwk::EventHandler> & handler)1040 int32_t CoreManagerInner::SetVoNRSwitch(
1041 int32_t slotId, int32_t state, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler)
1042 {
1043 if (telRilManager_ == nullptr) {
1044 TELEPHONY_LOGE("telRilManager is null!");
1045 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1046 }
1047 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
1048 if (response == nullptr) {
1049 TELEPHONY_LOGE("response is null!");
1050 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1051 }
1052 response->SetOwner(handler);
1053 return telRilManager_->SetVoNRSwitch(slotId, state, response);
1054 }
1055
SendDTMF(int32_t slotId,int32_t eventId,const DtmfParam & dtmfParam,const std::shared_ptr<AppExecFwk::EventHandler> & handler)1056 int32_t CoreManagerInner::SendDTMF(int32_t slotId, int32_t eventId, const DtmfParam &dtmfParam,
1057 const std::shared_ptr<AppExecFwk::EventHandler> &handler)
1058 {
1059 if (telRilManager_ == nullptr) {
1060 TELEPHONY_LOGE("telRilManager is null!");
1061 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1062 }
1063 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
1064 if (response == nullptr) {
1065 TELEPHONY_LOGE("response is null!");
1066 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1067 }
1068 response->SetOwner(handler);
1069 return telRilManager_->SendDtmf(slotId, dtmfParam, response);
1070 }
1071
SendDTMF(int32_t slotId,int32_t eventId,char cDTMFCode,int32_t index,const std::shared_ptr<AppExecFwk::EventHandler> & handler)1072 int32_t CoreManagerInner::SendDTMF(int32_t slotId, int32_t eventId, char cDTMFCode, int32_t index,
1073 const std::shared_ptr<AppExecFwk::EventHandler> &handler)
1074 {
1075 if (telRilManager_ == nullptr) {
1076 TELEPHONY_LOGE("telRilManager is null!");
1077 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1078 }
1079 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId, index);
1080 if (response == nullptr) {
1081 TELEPHONY_LOGE("response is null!");
1082 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1083 }
1084 response->SetOwner(handler);
1085 return telRilManager_->SendDtmf(slotId, cDTMFCode, index, response);
1086 }
1087
StartDTMF(int32_t slotId,int32_t eventId,char cDTMFCode,int32_t index,const std::shared_ptr<AppExecFwk::EventHandler> & handler)1088 int32_t CoreManagerInner::StartDTMF(int32_t slotId, int32_t eventId, char cDTMFCode, int32_t index,
1089 const std::shared_ptr<AppExecFwk::EventHandler> &handler)
1090 {
1091 if (telRilManager_ == nullptr) {
1092 TELEPHONY_LOGE("telRilManager is null!");
1093 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1094 }
1095 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
1096 if (response == nullptr) {
1097 TELEPHONY_LOGE("response is null!");
1098 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1099 }
1100 response->SetOwner(handler);
1101 return telRilManager_->StartDtmf(slotId, cDTMFCode, index, response);
1102 }
1103
StopDTMF(int32_t slotId,int32_t eventId,int32_t index,const std::shared_ptr<AppExecFwk::EventHandler> & handler)1104 int32_t CoreManagerInner::StopDTMF(
1105 int32_t slotId, int32_t eventId, int32_t index, const std::shared_ptr<AppExecFwk::EventHandler> &handler)
1106 {
1107 if (telRilManager_ == nullptr) {
1108 TELEPHONY_LOGE("telRilManager is null!");
1109 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1110 }
1111 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
1112 if (response == nullptr) {
1113 TELEPHONY_LOGE("response is null!");
1114 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1115 }
1116 response->SetOwner(handler);
1117 return telRilManager_->StopDtmf(slotId, index, response);
1118 }
1119
SetDataPermitted(int32_t slotId,int32_t eventId,int32_t dataPermitted,const std::shared_ptr<AppExecFwk::EventHandler> & handler)1120 int32_t CoreManagerInner::SetDataPermitted(
1121 int32_t slotId, int32_t eventId, int32_t dataPermitted, const std::shared_ptr<AppExecFwk::EventHandler> &handler)
1122 {
1123 if (telRilManager_ == nullptr) {
1124 TELEPHONY_LOGE("telRilManager is null!");
1125 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1126 }
1127 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
1128 if (response == nullptr) {
1129 TELEPHONY_LOGE("response is null!");
1130 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1131 }
1132 response->SetOwner(handler);
1133 return telRilManager_->SetDataPermitted(slotId, dataPermitted, response);
1134 }
1135
SetInitApnInfo(int32_t slotId,int32_t eventId,const DataProfile & dataProfile,const std::shared_ptr<AppExecFwk::EventHandler> & handler)1136 int32_t CoreManagerInner::SetInitApnInfo(int32_t slotId, int32_t eventId, const DataProfile &dataProfile,
1137 const std::shared_ptr<AppExecFwk::EventHandler> &handler)
1138 {
1139 if (telRilManager_ == nullptr) {
1140 TELEPHONY_LOGE("telRilManager is null!");
1141 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1142 }
1143 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
1144 if (response == nullptr) {
1145 TELEPHONY_LOGE("response is null!");
1146 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1147 }
1148 response->SetOwner(handler);
1149 return telRilManager_->SetInitApnInfo(slotId, dataProfile, response);
1150 }
1151
ActivatePdpContext(int32_t slotId,int32_t eventId,const ActivateDataParam & activateData,const std::shared_ptr<AppExecFwk::EventHandler> & handler)1152 int32_t CoreManagerInner::ActivatePdpContext(int32_t slotId, int32_t eventId, const ActivateDataParam &activateData,
1153 const std::shared_ptr<AppExecFwk::EventHandler> &handler)
1154 {
1155 if (telRilManager_ == nullptr) {
1156 TELEPHONY_LOGE("telRilManager is null!");
1157 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1158 }
1159 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId, activateData.param);
1160 if (response == nullptr) {
1161 TELEPHONY_LOGE("response is null!");
1162 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1163 }
1164 response->SetOwner(handler);
1165 return telRilManager_->ActivatePdpContext(slotId, activateData, response);
1166 }
1167
DeactivatePdpContext(int32_t slotId,int32_t eventId,const DeactivateDataParam & deactivateData,const std::shared_ptr<AppExecFwk::EventHandler> & handler)1168 int32_t CoreManagerInner::DeactivatePdpContext(int32_t slotId, int32_t eventId,
1169 const DeactivateDataParam &deactivateData, const std::shared_ptr<AppExecFwk::EventHandler> &handler)
1170 {
1171 if (telRilManager_ == nullptr) {
1172 TELEPHONY_LOGE("telRilManager is null!");
1173 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1174 }
1175 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId, deactivateData.param);
1176 if (response == nullptr) {
1177 TELEPHONY_LOGE("response is null!");
1178 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1179 }
1180 response->SetOwner(handler);
1181 return telRilManager_->DeactivatePdpContext(slotId, deactivateData.cid, deactivateData.reason, response);
1182 }
1183
GetPdpContextList(int32_t slotId,int32_t eventId,const std::shared_ptr<AppExecFwk::EventHandler> & handler)1184 int32_t CoreManagerInner::GetPdpContextList(
1185 int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler)
1186 {
1187 if (telRilManager_ == nullptr) {
1188 TELEPHONY_LOGE("telRilManager is null!");
1189 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1190 }
1191 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
1192 if (response == nullptr) {
1193 TELEPHONY_LOGE("response is null!");
1194 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1195 }
1196 response->SetOwner(handler);
1197 return telRilManager_->GetPdpContextList(slotId, response);
1198 }
1199
SetLinkBandwidthReportingRule(int32_t slotId,int32_t eventId,LinkBandwidthRule linkBandwidth,const std::shared_ptr<AppExecFwk::EventHandler> & handler)1200 int32_t CoreManagerInner::SetLinkBandwidthReportingRule(int32_t slotId, int32_t eventId,
1201 LinkBandwidthRule linkBandwidth, const std::shared_ptr<AppExecFwk::EventHandler> &handler)
1202 {
1203 if (telRilManager_ == nullptr) {
1204 TELEPHONY_LOGE("telRilManager is null!");
1205 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1206 }
1207 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
1208 if (response == nullptr) {
1209 TELEPHONY_LOGE("response is null!");
1210 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1211 }
1212 response->SetOwner(handler);
1213 return telRilManager_->SetLinkBandwidthReportingRule(slotId, linkBandwidth, response);
1214 }
1215
GetLinkBandwidthInfo(int32_t slotId,int32_t eventId,const int32_t cid,const std::shared_ptr<AppExecFwk::EventHandler> & handler)1216 int32_t CoreManagerInner::GetLinkBandwidthInfo(
1217 int32_t slotId, int32_t eventId, const int32_t cid, const std::shared_ptr<AppExecFwk::EventHandler> &handler)
1218 {
1219 if (telRilManager_ == nullptr) {
1220 TELEPHONY_LOGE("telRilManager is null!");
1221 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1222 }
1223 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
1224 if (response == nullptr) {
1225 TELEPHONY_LOGE("response is null!");
1226 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1227 }
1228 response->SetOwner(handler);
1229 return telRilManager_->GetLinkBandwidthInfo(slotId, cid, response);
1230 }
1231
GetLinkCapability(int32_t slotId,int32_t eventId,const std::shared_ptr<AppExecFwk::EventHandler> & handler)1232 int32_t CoreManagerInner::GetLinkCapability(
1233 int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler)
1234 {
1235 if (telRilManager_ == nullptr) {
1236 TELEPHONY_LOGE("telRilManager is null!");
1237 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1238 }
1239 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
1240 if (response == nullptr) {
1241 TELEPHONY_LOGE("response is null!");
1242 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1243 }
1244 response->SetOwner(handler);
1245 return telRilManager_->GetLinkCapability(slotId, response);
1246 }
1247
GetSignalStrength(int32_t slotId,int32_t eventId,const std::shared_ptr<AppExecFwk::EventHandler> & handler) const1248 int32_t CoreManagerInner::GetSignalStrength(
1249 int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler) const
1250 {
1251 if (telRilManager_ == nullptr) {
1252 TELEPHONY_LOGE("telRilManager is null!");
1253 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1254 }
1255 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
1256 if (response == nullptr) {
1257 TELEPHONY_LOGE("response is null!");
1258 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1259 }
1260 response->SetOwner(handler);
1261 return telRilManager_->GetSignalStrength(slotId, response);
1262 }
1263
GetCsRegStatus(int32_t slotId,int32_t eventId,const std::shared_ptr<AppExecFwk::EventHandler> & handler) const1264 int32_t CoreManagerInner::GetCsRegStatus(
1265 int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler) const
1266 {
1267 if (telRilManager_ == nullptr) {
1268 TELEPHONY_LOGE("telRilManager is null!");
1269 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1270 }
1271 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
1272 if (response == nullptr) {
1273 TELEPHONY_LOGE("response is null!");
1274 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1275 }
1276 response->SetOwner(handler);
1277 return telRilManager_->GetCsRegStatus(slotId, response);
1278 }
1279
GetPsRegStatus(int32_t slotId,int32_t eventId,const std::shared_ptr<AppExecFwk::EventHandler> & handler) const1280 int32_t CoreManagerInner::GetPsRegStatus(
1281 int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler) const
1282 {
1283 if (telRilManager_ == nullptr) {
1284 TELEPHONY_LOGE("telRilManager is null!");
1285 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1286 }
1287 AppExecFwk::InnerEvent::Pointer response = AppExecFwk::InnerEvent::Get(eventId);
1288 if (response == nullptr) {
1289 TELEPHONY_LOGE("response is null!");
1290 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1291 }
1292 response->SetOwner(handler);
1293 return telRilManager_->GetPsRegStatus(slotId, response);
1294 }
1295 /******************** telRilManager end *******************/
1296 /******************** networkSearchManager start *******************/
GetPsRadioTech(int32_t slotId,int32_t & psRadioTech)1297 int32_t CoreManagerInner::GetPsRadioTech(int32_t slotId, int32_t &psRadioTech)
1298 {
1299 if (networkSearchManager_ == nullptr) {
1300 TELEPHONY_LOGE("networkSearchManager is null!");
1301 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1302 }
1303 return networkSearchManager_->GetPsRadioTech(slotId, psRadioTech);
1304 }
1305
GetCsRadioTech(int32_t slotId,int32_t & csRadioTech)1306 int32_t CoreManagerInner::GetCsRadioTech(int32_t slotId, int32_t &csRadioTech)
1307 {
1308 if (networkSearchManager_ == nullptr) {
1309 TELEPHONY_LOGE("networkSearchManager is null!");
1310 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1311 }
1312 return networkSearchManager_->GetCsRadioTech(slotId, csRadioTech);
1313 }
1314
GetPsRegState(int32_t slotId)1315 int32_t CoreManagerInner::GetPsRegState(int32_t slotId)
1316 {
1317 if (networkSearchManager_ == nullptr) {
1318 TELEPHONY_LOGE("networkSearchManager is null!");
1319 return NETWORK_IS_NULL;
1320 }
1321 return networkSearchManager_->GetPsRegState(slotId);
1322 }
1323
GetCsRegState(int32_t slotId)1324 int32_t CoreManagerInner::GetCsRegState(int32_t slotId)
1325 {
1326 if (networkSearchManager_ == nullptr) {
1327 TELEPHONY_LOGE("networkSearchManager is null!");
1328 return NETWORK_IS_NULL;
1329 }
1330 return networkSearchManager_->GetCsRegState(slotId);
1331 }
1332
GetPsRoamingState(int32_t slotId)1333 int32_t CoreManagerInner::GetPsRoamingState(int32_t slotId)
1334 {
1335 if (networkSearchManager_ == nullptr) {
1336 TELEPHONY_LOGE("networkSearchManager is null!");
1337 return NETWORK_IS_NULL;
1338 }
1339 return networkSearchManager_->GetPsRoamingState(slotId);
1340 }
1341
SetNetworkSelectionMode(int32_t slotId,int32_t selectMode,const sptr<NetworkInformation> & networkInformation,bool resumeSelection,const sptr<INetworkSearchCallback> & callback)1342 bool CoreManagerInner::SetNetworkSelectionMode(int32_t slotId, int32_t selectMode,
1343 const sptr<NetworkInformation> &networkInformation, bool resumeSelection,
1344 const sptr<INetworkSearchCallback> &callback)
1345 {
1346 if (networkSearchManager_ == nullptr) {
1347 TELEPHONY_LOGE("networkSearchManager is null!");
1348 return false;
1349 }
1350 return networkSearchManager_->SetNetworkSelectionMode(
1351 slotId, selectMode, networkInformation, resumeSelection, callback);
1352 }
1353
GetSignalInfoList(int32_t slotId,std::vector<sptr<SignalInformation>> & signals)1354 int32_t CoreManagerInner::GetSignalInfoList(int32_t slotId, std::vector<sptr<SignalInformation>> &signals)
1355 {
1356 if (networkSearchManager_ == nullptr) {
1357 TELEPHONY_LOGE("networkSearchManager is null!");
1358 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1359 }
1360 return networkSearchManager_->GetSignalInfoList(slotId, signals);
1361 }
1362
GetOperatorNumeric(int32_t slotId)1363 std::u16string CoreManagerInner::GetOperatorNumeric(int32_t slotId)
1364 {
1365 if (networkSearchManager_ == nullptr) {
1366 TELEPHONY_LOGE("networkSearchManager is null!");
1367 return std::u16string();
1368 }
1369 return networkSearchManager_->GetOperatorNumeric(slotId);
1370 }
1371
GetOperatorName(int32_t slotId,std::u16string & operatorName)1372 int32_t CoreManagerInner::GetOperatorName(int32_t slotId, std::u16string &operatorName)
1373 {
1374 if (networkSearchManager_ == nullptr) {
1375 TELEPHONY_LOGE("networkSearchManager is null!");
1376 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1377 }
1378 return networkSearchManager_->GetOperatorName(slotId, operatorName);
1379 }
1380
GetNetworkStatus(int32_t slotId,sptr<NetworkState> & networkState)1381 int32_t CoreManagerInner::GetNetworkStatus(int32_t slotId, sptr<NetworkState> &networkState)
1382 {
1383 if (networkSearchManager_ == nullptr) {
1384 TELEPHONY_LOGE("networkSearchManager is null!");
1385 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1386 }
1387 return networkSearchManager_->GetNetworkStatus(slotId, networkState);
1388 }
1389
SetRadioState(int32_t slotId,bool isOn,int32_t rst,const sptr<INetworkSearchCallback> & callback)1390 int32_t CoreManagerInner::SetRadioState(
1391 int32_t slotId, bool isOn, int32_t rst, const sptr<INetworkSearchCallback> &callback)
1392 {
1393 if (networkSearchManager_ == nullptr) {
1394 TELEPHONY_LOGE("networkSearchManager is null!");
1395 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1396 }
1397 return networkSearchManager_->SetRadioState(slotId, isOn, rst, callback);
1398 }
1399
GetRadioState(int32_t slotId)1400 int32_t CoreManagerInner::GetRadioState(int32_t slotId)
1401 {
1402 if (networkSearchManager_ == nullptr) {
1403 TELEPHONY_LOGE("networkSearchManager is null!");
1404 return NETWORK_IS_NULL;
1405 }
1406 return networkSearchManager_->GetRadioState(slotId);
1407 }
1408
GetRadioState(int32_t slotId,const sptr<INetworkSearchCallback> & callback)1409 int32_t CoreManagerInner::GetRadioState(int32_t slotId, const sptr<INetworkSearchCallback> &callback)
1410 {
1411 if (networkSearchManager_ == nullptr) {
1412 TELEPHONY_LOGE("networkSearchManager is null!");
1413 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1414 }
1415 return networkSearchManager_->GetRadioState(slotId, callback);
1416 }
1417
GetIsoCountryCodeForNetwork(int32_t slotId,std::u16string & countryCode)1418 int32_t CoreManagerInner::GetIsoCountryCodeForNetwork(int32_t slotId, std::u16string &countryCode)
1419 {
1420 if (networkSearchManager_ == nullptr) {
1421 TELEPHONY_LOGE("networkSearchManager is null!");
1422 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1423 }
1424 return networkSearchManager_->GetIsoCountryCodeForNetwork(slotId, countryCode);
1425 }
1426
GetImei(int32_t slotId,std::u16string & imei)1427 int32_t CoreManagerInner::GetImei(int32_t slotId, std::u16string &imei)
1428 {
1429 if (networkSearchManager_ == nullptr) {
1430 TELEPHONY_LOGE("networkSearchManager is null!");
1431 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1432 }
1433 return networkSearchManager_->GetImei(slotId, imei);
1434 }
1435
GetMeid(int32_t slotId,std::u16string & meid)1436 int32_t CoreManagerInner::GetMeid(int32_t slotId, std::u16string &meid)
1437 {
1438 if (networkSearchManager_ == nullptr) {
1439 TELEPHONY_LOGE("networkSearchManager is null!");
1440 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1441 }
1442 return networkSearchManager_->GetMeid(slotId, meid);
1443 }
1444
GetUniqueDeviceId(int32_t slotId,std::u16string & deviceId)1445 int32_t CoreManagerInner::GetUniqueDeviceId(int32_t slotId, std::u16string &deviceId)
1446 {
1447 if (networkSearchManager_ == nullptr) {
1448 TELEPHONY_LOGE("networkSearchManager is null!");
1449 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1450 }
1451 return networkSearchManager_->GetUniqueDeviceId(slotId, deviceId);
1452 }
1453
GetPhoneType(int32_t slotId)1454 PhoneType CoreManagerInner::GetPhoneType(int32_t slotId)
1455 {
1456 if (networkSearchManager_ == nullptr) {
1457 TELEPHONY_LOGE("networkSearchManager is null!");
1458 return PhoneType::PHONE_TYPE_IS_NONE;
1459 }
1460 return networkSearchManager_->GetPhoneType(slotId);
1461 }
1462
GetCellLocation(int32_t slotId)1463 sptr<CellLocation> CoreManagerInner::GetCellLocation(int32_t slotId)
1464 {
1465 if (networkSearchManager_ == nullptr) {
1466 TELEPHONY_LOGE("networkSearchManager is null!");
1467 return nullptr;
1468 }
1469 return networkSearchManager_->GetCellLocation(slotId);
1470 }
1471
GetNetworkSearchInformation(int32_t slotId,const sptr<INetworkSearchCallback> & callback)1472 int32_t CoreManagerInner::GetNetworkSearchInformation(int32_t slotId, const sptr<INetworkSearchCallback> &callback)
1473 {
1474 if (networkSearchManager_ == nullptr) {
1475 TELEPHONY_LOGE("networkSearchManager is null!");
1476 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1477 }
1478 return networkSearchManager_->GetNetworkSearchInformation(slotId, callback);
1479 }
1480
GetNetworkSelectionMode(int32_t slotId,const sptr<INetworkSearchCallback> & callback)1481 int32_t CoreManagerInner::GetNetworkSelectionMode(int32_t slotId, const sptr<INetworkSearchCallback> &callback)
1482 {
1483 if (networkSearchManager_ == nullptr) {
1484 TELEPHONY_LOGE("networkSearchManager is null!");
1485 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1486 }
1487 return networkSearchManager_->GetNetworkSelectionMode(slotId, callback);
1488 }
1489
GetCellInfoList(int32_t slotId,std::vector<sptr<CellInformation>> & cellInfo)1490 int32_t CoreManagerInner::GetCellInfoList(int32_t slotId, std::vector<sptr<CellInformation>> &cellInfo)
1491 {
1492 if (networkSearchManager_ == nullptr) {
1493 TELEPHONY_LOGE("networkSearchManager is null!");
1494 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1495 }
1496 return networkSearchManager_->GetCellInfoList(slotId, cellInfo);
1497 }
1498
SendUpdateCellLocationRequest(int32_t slotId)1499 int32_t CoreManagerInner::SendUpdateCellLocationRequest(int32_t slotId)
1500 {
1501 if (networkSearchManager_ == nullptr) {
1502 TELEPHONY_LOGE("networkSearchManager is null!");
1503 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1504 }
1505 return networkSearchManager_->SendUpdateCellLocationRequest(slotId);
1506 }
1507
GetPreferredNetwork(int32_t slotId,const sptr<INetworkSearchCallback> & callback)1508 int32_t CoreManagerInner::GetPreferredNetwork(int32_t slotId, const sptr<INetworkSearchCallback> &callback)
1509 {
1510 if (networkSearchManager_ != nullptr) {
1511 return networkSearchManager_->GetPreferredNetwork(slotId, callback);
1512 }
1513 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1514 }
1515
SetPreferredNetwork(int32_t slotId,int32_t networkMode,const sptr<INetworkSearchCallback> & callback)1516 int32_t CoreManagerInner::SetPreferredNetwork(
1517 int32_t slotId, int32_t networkMode, const sptr<INetworkSearchCallback> &callback)
1518 {
1519 if (networkSearchManager_ != nullptr) {
1520 return networkSearchManager_->SetPreferredNetwork(slotId, networkMode, callback);
1521 }
1522 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1523 }
1524
IsNrSupported(int32_t slotId)1525 bool CoreManagerInner::IsNrSupported(int32_t slotId)
1526 {
1527 if (networkSearchManager_ != nullptr) {
1528 return networkSearchManager_->IsNrSupported(slotId);
1529 }
1530 return false;
1531 }
1532
DcPhysicalLinkActiveUpdate(int32_t slotId,bool isActive)1533 void CoreManagerInner::DcPhysicalLinkActiveUpdate(int32_t slotId, bool isActive)
1534 {
1535 if (networkSearchManager_ != nullptr) {
1536 networkSearchManager_->DcPhysicalLinkActiveUpdate(slotId, isActive);
1537 }
1538 }
1539
NotifyCallStatusToNetworkSearch(int32_t slotId,int32_t callStatus)1540 int32_t CoreManagerInner::NotifyCallStatusToNetworkSearch(int32_t slotId, int32_t callStatus)
1541 {
1542 if (networkSearchManager_ == nullptr) {
1543 TELEPHONY_LOGE("networkSearchManager is null!");
1544 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1545 }
1546 return networkSearchManager_->NotifyCallStatusToNetworkSearch(slotId, callStatus);
1547 }
1548
GetNrOptionMode(int32_t slotId,NrMode & mode)1549 int32_t CoreManagerInner::GetNrOptionMode(int32_t slotId, NrMode &mode)
1550 {
1551 if (networkSearchManager_ != nullptr) {
1552 return networkSearchManager_->GetNrOptionMode(slotId, mode);
1553 }
1554 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1555 }
1556
GetFrequencyType(int32_t slotId) const1557 FrequencyType CoreManagerInner::GetFrequencyType(int32_t slotId) const
1558 {
1559 if (networkSearchManager_ != nullptr) {
1560 return networkSearchManager_->GetFrequencyType(slotId);
1561 }
1562 return FrequencyType::FREQ_TYPE_UNKNOWN;
1563 }
1564
GetNrState(int32_t slotId) const1565 NrState CoreManagerInner::GetNrState(int32_t slotId) const
1566 {
1567 if (networkSearchManager_ != nullptr) {
1568 return networkSearchManager_->GetNrState(slotId);
1569 }
1570 return NrState::NR_STATE_NOT_SUPPORT;
1571 }
1572
GetImsRegStatus(int32_t slotId,ImsServiceType imsSrvType,ImsRegInfo & info) const1573 int32_t CoreManagerInner::GetImsRegStatus(int32_t slotId, ImsServiceType imsSrvType, ImsRegInfo &info) const
1574 {
1575 if (networkSearchManager_ == nullptr) {
1576 TELEPHONY_LOGE("networkSearchManager is null!");
1577 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1578 }
1579 return networkSearchManager_->GetImsRegStatus(slotId, imsSrvType, info);
1580 }
1581
GetAirplaneMode(bool & airplaneMode)1582 int32_t CoreManagerInner::GetAirplaneMode(bool &airplaneMode)
1583 {
1584 if (networkSearchManager_ == nullptr) {
1585 TELEPHONY_LOGE("networkSearchManager is null!");
1586 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1587 }
1588 return networkSearchManager_->GetAirplaneMode(airplaneMode);
1589 }
1590
UpdateRadioOn(int32_t slotId)1591 int32_t CoreManagerInner::UpdateRadioOn(int32_t slotId)
1592 {
1593 if (networkSearchManager_ == nullptr) {
1594 TELEPHONY_LOGE("networkSearchManager is null!");
1595 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1596 }
1597 return networkSearchManager_->UpdateRadioOn(slotId);
1598 }
1599
1600 /******************** networkSearchManager end ************************/
1601 /******************** simManager_ start *******************/
1602
ObtainSpnCondition(int32_t slotId,bool roaming,std::string operatorNum)1603 int32_t CoreManagerInner::ObtainSpnCondition(int32_t slotId, bool roaming, std::string operatorNum)
1604 {
1605 if (simManager_ == nullptr) {
1606 TELEPHONY_LOGE("simManager_ is null");
1607 return 0;
1608 }
1609 return simManager_->ObtainSpnCondition(slotId, roaming, operatorNum);
1610 }
1611
GetSimSpn(int32_t slotId,std::u16string & spn)1612 int32_t CoreManagerInner::GetSimSpn(int32_t slotId, std::u16string &spn)
1613 {
1614 if (simManager_ == nullptr) {
1615 TELEPHONY_LOGE("simManager_ is null");
1616 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1617 }
1618 return simManager_->GetSimSpn(slotId, spn);
1619 }
1620
SetVoiceMailInfo(int32_t slotId,const std::u16string & mailName,const std::u16string & mailNumber)1621 int32_t CoreManagerInner::SetVoiceMailInfo(
1622 int32_t slotId, const std::u16string &mailName, const std::u16string &mailNumber)
1623 {
1624 if (simManager_ == nullptr) {
1625 TELEPHONY_LOGE("simManager_ is null");
1626 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1627 }
1628 return simManager_->SetVoiceMailInfo(slotId, mailName, mailNumber);
1629 }
1630
QueryIccDiallingNumbers(int slotId,int type,std::vector<std::shared_ptr<DiallingNumbersInfo>> & result)1631 int32_t CoreManagerInner::QueryIccDiallingNumbers(
1632 int slotId, int type, std::vector<std::shared_ptr<DiallingNumbersInfo>> &result)
1633 {
1634 if (simManager_ == nullptr) {
1635 TELEPHONY_LOGE("iccDiallingNumbersManager is null!");
1636 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1637 }
1638 return simManager_->QueryIccDiallingNumbers(slotId, type, result);
1639 }
1640
AddIccDiallingNumbers(int slotId,int type,const std::shared_ptr<DiallingNumbersInfo> & diallingNumber)1641 int32_t CoreManagerInner::AddIccDiallingNumbers(
1642 int slotId, int type, const std::shared_ptr<DiallingNumbersInfo> &diallingNumber)
1643 {
1644 if (simManager_ == nullptr) {
1645 TELEPHONY_LOGE("iccDiallingNumbersManager is null!");
1646 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1647 }
1648 return simManager_->AddIccDiallingNumbers(slotId, type, diallingNumber);
1649 }
1650
DelIccDiallingNumbers(int slotId,int type,const std::shared_ptr<DiallingNumbersInfo> & diallingNumber)1651 int32_t CoreManagerInner::DelIccDiallingNumbers(
1652 int slotId, int type, const std::shared_ptr<DiallingNumbersInfo> &diallingNumber)
1653 {
1654 if (simManager_ == nullptr) {
1655 TELEPHONY_LOGE("iccDiallingNumbersManager is null!");
1656 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1657 }
1658 return simManager_->DelIccDiallingNumbers(slotId, type, diallingNumber);
1659 }
1660
UpdateIccDiallingNumbers(int slotId,int type,const std::shared_ptr<DiallingNumbersInfo> & diallingNumber)1661 int32_t CoreManagerInner::UpdateIccDiallingNumbers(
1662 int slotId, int type, const std::shared_ptr<DiallingNumbersInfo> &diallingNumber)
1663 {
1664 if (simManager_ == nullptr) {
1665 TELEPHONY_LOGE("iccDiallingNumbersManager is null!");
1666 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1667 }
1668 return simManager_->UpdateIccDiallingNumbers(slotId, type, diallingNumber);
1669 }
1670
AddSmsToIcc(int slotId,int status,std::string & pdu,std::string & smsc)1671 int32_t CoreManagerInner::AddSmsToIcc(int slotId, int status, std::string &pdu, std::string &smsc)
1672 {
1673 if (simManager_ == nullptr) {
1674 TELEPHONY_LOGE("simManager_ is null!");
1675 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1676 }
1677 return simManager_->AddSmsToIcc(slotId, status, pdu, smsc);
1678 }
1679
UpdateSmsIcc(int slotId,int index,int status,std::string & pduData,std::string & smsc)1680 int32_t CoreManagerInner::UpdateSmsIcc(int slotId, int index, int status, std::string &pduData, std::string &smsc)
1681 {
1682 if (simManager_ == nullptr) {
1683 TELEPHONY_LOGE("simManager_ is null!");
1684 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1685 }
1686 return simManager_->UpdateSmsIcc(slotId, index, status, pduData, smsc);
1687 }
1688
ObtainAllSmsOfIcc(int slotId)1689 std::vector<std::string> CoreManagerInner::ObtainAllSmsOfIcc(int slotId)
1690 {
1691 if (simManager_ == nullptr) {
1692 TELEPHONY_LOGE("simManager_ is null!");
1693 std::vector<std::string> result;
1694 return result;
1695 }
1696 return simManager_->ObtainAllSmsOfIcc(slotId);
1697 }
1698
DelSmsIcc(int slotId,int index)1699 int32_t CoreManagerInner::DelSmsIcc(int slotId, int index)
1700 {
1701 if (simManager_ == nullptr) {
1702 TELEPHONY_LOGE("simManager_ is null!");
1703 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1704 }
1705 return simManager_->DelSmsIcc(slotId, index);
1706 }
1707
IsSimActive(int32_t slotId)1708 bool CoreManagerInner::IsSimActive(int32_t slotId)
1709 {
1710 if (simManager_ == nullptr) {
1711 TELEPHONY_LOGE("simManager_ is null!");
1712 return false;
1713 }
1714 return simManager_->IsSimActive(slotId);
1715 }
1716
SetActiveSim(int32_t slotId,int32_t enable)1717 int32_t CoreManagerInner::SetActiveSim(int32_t slotId, int32_t enable)
1718 {
1719 if (simManager_ == nullptr) {
1720 TELEPHONY_LOGE("simManager_ is null!");
1721 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1722 }
1723 return simManager_->SetActiveSim(slotId, enable);
1724 }
1725
GetSimAccountInfo(int32_t slotId,IccAccountInfo & info)1726 int32_t CoreManagerInner::GetSimAccountInfo(int32_t slotId, IccAccountInfo &info)
1727 {
1728 if (simManager_ == nullptr) {
1729 TELEPHONY_LOGE("simManager_ is null!");
1730 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1731 }
1732 return simManager_->GetSimAccountInfo(slotId, false, info);
1733 }
1734
SetDefaultVoiceSlotId(int32_t slotId)1735 int32_t CoreManagerInner::SetDefaultVoiceSlotId(int32_t slotId)
1736 {
1737 if (simManager_ == nullptr) {
1738 TELEPHONY_LOGE("simManager_ is null!");
1739 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1740 }
1741 return simManager_->SetDefaultVoiceSlotId(slotId);
1742 }
1743
SetDefaultSmsSlotId(int32_t slotId)1744 int32_t CoreManagerInner::SetDefaultSmsSlotId(int32_t slotId)
1745 {
1746 if (simManager_ == nullptr) {
1747 TELEPHONY_LOGE("simManager_ is null!");
1748 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1749 }
1750 return simManager_->SetDefaultSmsSlotId(slotId);
1751 }
1752
SetDefaultCellularDataSlotId(int32_t slotId)1753 int32_t CoreManagerInner::SetDefaultCellularDataSlotId(int32_t slotId)
1754 {
1755 if (simManager_ == nullptr) {
1756 TELEPHONY_LOGE("simManager_ is null!");
1757 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1758 }
1759 return simManager_->SetDefaultCellularDataSlotId(slotId);
1760 }
1761
SetPrimarySlotId(int32_t slotId)1762 int32_t CoreManagerInner::SetPrimarySlotId(int32_t slotId)
1763 {
1764 if (simManager_ == nullptr) {
1765 TELEPHONY_LOGE("simManager_ is null!");
1766 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1767 }
1768 return simManager_->SetPrimarySlotId(slotId);
1769 }
1770
SetShowNumber(int32_t slotId,const std::u16string & number)1771 int32_t CoreManagerInner::SetShowNumber(int32_t slotId, const std::u16string &number)
1772 {
1773 if (simManager_ == nullptr) {
1774 TELEPHONY_LOGE("simManager_ is null!");
1775 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1776 }
1777 return simManager_->SetShowNumber(slotId, number);
1778 }
1779
SetShowName(int32_t slotId,const std::u16string & name)1780 int32_t CoreManagerInner::SetShowName(int32_t slotId, const std::u16string &name)
1781 {
1782 if (simManager_ == nullptr) {
1783 TELEPHONY_LOGE("simManager_ is null!");
1784 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1785 }
1786 return simManager_->SetShowName(slotId, name);
1787 }
1788
GetDefaultVoiceSlotId()1789 int32_t CoreManagerInner::GetDefaultVoiceSlotId()
1790 {
1791 if (simManager_ == nullptr) {
1792 TELEPHONY_LOGE("simManager_ is null!");
1793 return TELEPHONY_ERROR;
1794 }
1795 return simManager_->GetDefaultVoiceSlotId();
1796 }
1797
GetDefaultVoiceSimId(int32_t & simId)1798 int32_t CoreManagerInner::GetDefaultVoiceSimId(int32_t &simId)
1799 {
1800 if (simManager_ == nullptr) {
1801 TELEPHONY_LOGE("simManager_ is null!");
1802 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1803 }
1804 return simManager_->GetDefaultVoiceSimId(simId);
1805 }
1806
GetDefaultSmsSlotId()1807 int32_t CoreManagerInner::GetDefaultSmsSlotId()
1808 {
1809 if (simManager_ == nullptr) {
1810 TELEPHONY_LOGE("simManager_ is null!");
1811 return TELEPHONY_ERROR;
1812 }
1813 return simManager_->GetDefaultSmsSlotId();
1814 }
1815
GetDefaultSmsSimId(int32_t & simId)1816 int32_t CoreManagerInner::GetDefaultSmsSimId(int32_t &simId)
1817 {
1818 if (simManager_ == nullptr) {
1819 TELEPHONY_LOGE("simManager_ is null!");
1820 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1821 }
1822 return simManager_->GetDefaultSmsSimId(simId);
1823 }
1824
GetDefaultCellularDataSlotId()1825 int32_t CoreManagerInner::GetDefaultCellularDataSlotId()
1826 {
1827 if (simManager_ == nullptr) {
1828 TELEPHONY_LOGE("simManager_ is null!");
1829 return TELEPHONY_ERROR;
1830 }
1831 return simManager_->GetDefaultCellularDataSlotId();
1832 }
1833
GetDefaultCellularDataSimId(int32_t & simId)1834 int32_t CoreManagerInner::GetDefaultCellularDataSimId(int32_t &simId)
1835 {
1836 if (simManager_ == nullptr) {
1837 TELEPHONY_LOGE("simManager_ is null!");
1838 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1839 }
1840 return simManager_->GetDefaultCellularDataSimId(simId);
1841 }
1842
GetDsdsMode(int32_t & dsdsMode)1843 int32_t CoreManagerInner::GetDsdsMode(int32_t &dsdsMode)
1844 {
1845 if (simManager_ == nullptr) {
1846 TELEPHONY_LOGE("simManager_ is null!");
1847 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1848 }
1849 return simManager_->GetDsdsMode(dsdsMode);
1850 }
1851
SetDsdsMode(int32_t dsdsMode)1852 int32_t CoreManagerInner::SetDsdsMode(int32_t dsdsMode)
1853 {
1854 if (simManager_ == nullptr) {
1855 TELEPHONY_LOGE("simManager_ is null!");
1856 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1857 }
1858 return simManager_->SetDsdsMode(dsdsMode);
1859 }
1860
GetPrimarySlotId(int32_t & slotId)1861 int32_t CoreManagerInner::GetPrimarySlotId(int32_t &slotId)
1862 {
1863 if (simManager_ == nullptr) {
1864 TELEPHONY_LOGE("simManager_ is null!");
1865 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1866 }
1867 return simManager_->GetPrimarySlotId(slotId);
1868 }
1869
GetShowNumber(int32_t slotId,std::u16string & showNumber)1870 int32_t CoreManagerInner::GetShowNumber(int32_t slotId, std::u16string &showNumber)
1871 {
1872 if (simManager_ == nullptr) {
1873 TELEPHONY_LOGE("simManager_ is null!");
1874 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1875 }
1876 return simManager_->GetShowNumber(slotId, showNumber);
1877 }
1878
GetShowName(int32_t slotId,std::u16string & showName)1879 int32_t CoreManagerInner::GetShowName(int32_t slotId, std::u16string &showName)
1880 {
1881 if (simManager_ == nullptr) {
1882 TELEPHONY_LOGE("simManager_ is null!");
1883 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1884 }
1885 return simManager_->GetShowName(slotId, showName);
1886 }
1887
GetActiveSimAccountInfoList(std::vector<IccAccountInfo> & iccAccountInfoList)1888 int32_t CoreManagerInner::GetActiveSimAccountInfoList(std::vector<IccAccountInfo> &iccAccountInfoList)
1889 {
1890 if (simManager_ == nullptr) {
1891 TELEPHONY_LOGE("simManager_ is null!");
1892 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1893 }
1894 return simManager_->GetActiveSimAccountInfoList(false, iccAccountInfoList);
1895 }
1896
GetOperatorConfigs(int32_t slotId,OperatorConfig & poc)1897 int32_t CoreManagerInner::GetOperatorConfigs(int32_t slotId, OperatorConfig &poc)
1898 {
1899 if (simManager_ == nullptr) {
1900 TELEPHONY_LOGE("simManager_ is null!");
1901 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1902 }
1903 return simManager_->GetOperatorConfigs(slotId, poc);
1904 }
1905
GetSimOperatorNumeric(int32_t slotId,std::u16string & operatorNumeric)1906 int32_t CoreManagerInner::GetSimOperatorNumeric(int32_t slotId, std::u16string &operatorNumeric)
1907 {
1908 if (simManager_ == nullptr) {
1909 TELEPHONY_LOGE("simManager_ is null!");
1910 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1911 }
1912 return simManager_->GetSimOperatorNumeric(slotId, operatorNumeric);
1913 }
1914
GetISOCountryCodeForSim(int32_t slotId,std::u16string & countryCode)1915 int32_t CoreManagerInner::GetISOCountryCodeForSim(int32_t slotId, std::u16string &countryCode)
1916 {
1917 if (simManager_ == nullptr) {
1918 TELEPHONY_LOGE("simManager_ is null!");
1919 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1920 }
1921 return simManager_->GetISOCountryCodeForSim(slotId, countryCode);
1922 }
1923
GetSimIccId(int32_t slotId,std::u16string & iccId)1924 int32_t CoreManagerInner::GetSimIccId(int32_t slotId, std::u16string &iccId)
1925 {
1926 if (simManager_ == nullptr) {
1927 TELEPHONY_LOGE("simManager_ is null!");
1928 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1929 }
1930 return simManager_->GetSimIccId(slotId, iccId);
1931 }
1932
GetIMSI(int32_t slotId,std::u16string & imsi)1933 int32_t CoreManagerInner::GetIMSI(int32_t slotId, std::u16string &imsi)
1934 {
1935 if (simManager_ == nullptr) {
1936 TELEPHONY_LOGE("simManager_ is null!");
1937 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1938 }
1939 return simManager_->GetIMSI(slotId, imsi);
1940 }
1941
GetLocaleFromDefaultSim(int32_t slotId)1942 std::u16string CoreManagerInner::GetLocaleFromDefaultSim(int32_t slotId)
1943 {
1944 if (simManager_ == nullptr) {
1945 TELEPHONY_LOGE("simManager_ is null!");
1946 return u"";
1947 }
1948 return simManager_->GetLocaleFromDefaultSim(slotId);
1949 }
1950
GetSlotId(int32_t simId)1951 std::int32_t CoreManagerInner::GetSlotId(int32_t simId)
1952 {
1953 if (simManager_ == nullptr) {
1954 TELEPHONY_LOGE("simManager_ is null!");
1955 return TELEPHONY_ERROR;
1956 }
1957 return simManager_->GetSlotId(simId);
1958 }
1959
GetSimId(int32_t slotId)1960 std::int32_t CoreManagerInner::GetSimId(int32_t slotId)
1961 {
1962 if (simManager_ == nullptr) {
1963 TELEPHONY_LOGE("simManager_ is null!");
1964 return TELEPHONY_ERROR;
1965 }
1966 return simManager_->GetSimId(slotId);
1967 }
1968
GetSimGid1(int32_t slotId,std::u16string & gid1)1969 int32_t CoreManagerInner::GetSimGid1(int32_t slotId, std::u16string &gid1)
1970 {
1971 if (simManager_ == nullptr) {
1972 TELEPHONY_LOGE("simManager_ is null!");
1973 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1974 }
1975 return simManager_->GetSimGid1(slotId, gid1);
1976 }
1977
GetSimGid2(int32_t slotId)1978 std::u16string CoreManagerInner::GetSimGid2(int32_t slotId)
1979 {
1980 if (simManager_ == nullptr) {
1981 TELEPHONY_LOGE("simManager_ is null!");
1982 return u"";
1983 }
1984 return simManager_->GetSimGid2(slotId);
1985 }
1986
GetOpName(int32_t slotId,std::u16string & opname)1987 int32_t CoreManagerInner::GetOpName(int32_t slotId, std::u16string &opname)
1988 {
1989 if (simManager_ == nullptr) {
1990 TELEPHONY_LOGE("simManager_ is null!");
1991 return TELEPHONY_ERR_LOCAL_PTR_NULL;
1992 }
1993 return simManager_->GetOpName(slotId, opname);
1994 }
1995
GetOpKeyExt(int32_t slotId,std::u16string & opkeyExt)1996 int32_t CoreManagerInner::GetOpKeyExt(int32_t slotId, std::u16string &opkeyExt)
1997 {
1998 if (simManager_ == nullptr) {
1999 TELEPHONY_LOGE("simManager_ is null!");
2000 return TELEPHONY_ERR_LOCAL_PTR_NULL;
2001 }
2002 return simManager_->GetOpKeyExt(slotId, opkeyExt);
2003 }
2004
GetOpKey(std::u16string & opkey)2005 int32_t CoreManagerInner::GetOpKey(std::u16string &opkey)
2006 {
2007 if (simManager_ == nullptr) {
2008 TELEPHONY_LOGE("simManager_ is null!");
2009 return TELEPHONY_ERR_LOCAL_PTR_NULL;
2010 }
2011 int32_t slotId = INVALID_VALUE;
2012 simManager_->GetPrimarySlotId(slotId);
2013 return GetOpKey(slotId, opkey);
2014 }
2015
GetOpKey(int32_t slotId,std::u16string & opkey)2016 int32_t CoreManagerInner::GetOpKey(int32_t slotId, std::u16string &opkey)
2017 {
2018 if (simManager_ == nullptr) {
2019 TELEPHONY_LOGE("simManager_ is null!");
2020 return TELEPHONY_ERR_LOCAL_PTR_NULL;
2021 }
2022 return simManager_->GetOpKey(slotId, opkey);
2023 }
2024
GetSimTelephoneNumber(int32_t slotId,std::u16string & telephoneNumber)2025 int32_t CoreManagerInner::GetSimTelephoneNumber(int32_t slotId, std::u16string &telephoneNumber)
2026 {
2027 if (simManager_ == nullptr) {
2028 TELEPHONY_LOGE("simManager_ is null!");
2029 return TELEPHONY_ERR_LOCAL_PTR_NULL;
2030 }
2031 return simManager_->GetSimTelephoneNumber(slotId, telephoneNumber);
2032 }
2033
GetSimTeleNumberIdentifier(const int32_t slotId)2034 std::u16string CoreManagerInner::GetSimTeleNumberIdentifier(const int32_t slotId)
2035 {
2036 if (simManager_ == nullptr) {
2037 TELEPHONY_LOGE("simManager_ is null!");
2038 return u"";
2039 }
2040 return simManager_->GetSimTeleNumberIdentifier(slotId);
2041 }
2042
GetVoiceMailIdentifier(int32_t slotId,std::u16string & voiceMailIdentifier)2043 int32_t CoreManagerInner::GetVoiceMailIdentifier(int32_t slotId, std::u16string &voiceMailIdentifier)
2044 {
2045 if (simManager_ == nullptr) {
2046 TELEPHONY_LOGE("simManager_ is null!");
2047 return TELEPHONY_ERR_LOCAL_PTR_NULL;
2048 }
2049 return simManager_->GetVoiceMailIdentifier(slotId, voiceMailIdentifier);
2050 }
2051
GetVoiceMailNumber(int32_t slotId,std::u16string & voiceMailNumber)2052 int32_t CoreManagerInner::GetVoiceMailNumber(int32_t slotId, std::u16string &voiceMailNumber)
2053 {
2054 if (simManager_ == nullptr) {
2055 TELEPHONY_LOGE("simManager_ is null!");
2056 return TELEPHONY_ERR_LOCAL_PTR_NULL;
2057 }
2058 return simManager_->GetVoiceMailNumber(slotId, voiceMailNumber);
2059 }
2060
GetVoiceMailCount(int32_t slotId,int32_t & voiceMailCount)2061 int32_t CoreManagerInner::GetVoiceMailCount(int32_t slotId, int32_t &voiceMailCount)
2062 {
2063 if (simManager_ == nullptr) {
2064 TELEPHONY_LOGE("simManager_ is null!");
2065 return TELEPHONY_ERR_LOCAL_PTR_NULL;
2066 }
2067 return simManager_->GetVoiceMailCount(slotId, voiceMailCount);
2068 }
2069
SetVoiceMailCount(int32_t slotId,int32_t voiceMailCount)2070 int32_t CoreManagerInner::SetVoiceMailCount(int32_t slotId, int32_t voiceMailCount)
2071 {
2072 if (simManager_ == nullptr) {
2073 TELEPHONY_LOGE("simManager_ is null!");
2074 return TELEPHONY_ERR_LOCAL_PTR_NULL;
2075 }
2076 return simManager_->SetVoiceMailCount(slotId, voiceMailCount);
2077 }
2078
SetVoiceCallForwarding(int32_t slotId,bool enable,const std::string & number)2079 int32_t CoreManagerInner::SetVoiceCallForwarding(int32_t slotId, bool enable, const std::string &number)
2080 {
2081 if (simManager_ == nullptr) {
2082 TELEPHONY_LOGE("simManager_ is null!");
2083 return TELEPHONY_ERR_LOCAL_PTR_NULL;
2084 }
2085 return simManager_->SetVoiceCallForwarding(slotId, enable, number);
2086 }
2087
HasSimCard(int32_t slotId,bool & hasSimCard)2088 int32_t CoreManagerInner::HasSimCard(int32_t slotId, bool &hasSimCard)
2089 {
2090 if (simManager_ == nullptr) {
2091 TELEPHONY_LOGE("simManager_ is null!");
2092 return TELEPHONY_ERR_LOCAL_PTR_NULL;
2093 }
2094 return simManager_->HasSimCard(slotId, hasSimCard);
2095 }
2096
GetSimState(int32_t slotId,SimState & simState)2097 int32_t CoreManagerInner::GetSimState(int32_t slotId, SimState &simState)
2098 {
2099 if (simManager_ == nullptr) {
2100 TELEPHONY_LOGE("simManager_ is null!");
2101 return TELEPHONY_ERR_LOCAL_PTR_NULL;
2102 }
2103 return simManager_->GetSimState(slotId, simState);
2104 }
2105
GetCardType(int32_t slotId,CardType & cardType)2106 int32_t CoreManagerInner::GetCardType(int32_t slotId, CardType &cardType)
2107 {
2108 if (simManager_ == nullptr) {
2109 TELEPHONY_LOGE("simManager_ is null!");
2110 return TELEPHONY_ERR_LOCAL_PTR_NULL;
2111 }
2112 return simManager_->GetCardType(slotId, cardType);
2113 }
2114
UnlockPin(int32_t slotId,const std::string & pin,LockStatusResponse & response)2115 int32_t CoreManagerInner::UnlockPin(int32_t slotId, const std::string &pin, LockStatusResponse &response)
2116 {
2117 if (simManager_ == nullptr) {
2118 TELEPHONY_LOGE("simManager_ is null!");
2119 return TELEPHONY_ERR_LOCAL_PTR_NULL;
2120 }
2121 return simManager_->UnlockPin(slotId, pin, response);
2122 }
2123
UnlockPuk(int32_t slotId,const std::string & newPin,const std::string & puk,LockStatusResponse & response)2124 int32_t CoreManagerInner::UnlockPuk(
2125 int32_t slotId, const std::string &newPin, const std::string &puk, LockStatusResponse &response)
2126 {
2127 if (simManager_ == nullptr) {
2128 TELEPHONY_LOGE("simManager_ is null!");
2129 return TELEPHONY_ERR_LOCAL_PTR_NULL;
2130 }
2131 return simManager_->UnlockPuk(slotId, newPin, puk, response);
2132 }
2133
AlterPin(int32_t slotId,const std::string & newPin,const std::string & oldPin,LockStatusResponse & response)2134 int32_t CoreManagerInner::AlterPin(
2135 int32_t slotId, const std::string &newPin, const std::string &oldPin, LockStatusResponse &response)
2136 {
2137 if (simManager_ == nullptr) {
2138 TELEPHONY_LOGE("simManager_ is null!");
2139 return TELEPHONY_ERR_LOCAL_PTR_NULL;
2140 }
2141 return simManager_->AlterPin(slotId, newPin, oldPin, response);
2142 }
2143
SetLockState(int32_t slotId,const LockInfo & options,LockStatusResponse & response)2144 int32_t CoreManagerInner::SetLockState(int32_t slotId, const LockInfo &options, LockStatusResponse &response)
2145 {
2146 if (simManager_ == nullptr) {
2147 TELEPHONY_LOGE("simManager_ is null!");
2148 return TELEPHONY_ERR_LOCAL_PTR_NULL;
2149 }
2150 return simManager_->SetLockState(slotId, options, response);
2151 }
2152
GetLockState(int32_t slotId,LockType lockType,LockState & lockState)2153 int32_t CoreManagerInner::GetLockState(int32_t slotId, LockType lockType, LockState &lockState)
2154 {
2155 if (simManager_ == nullptr) {
2156 TELEPHONY_LOGE("simManager_ is null!");
2157 return TELEPHONY_ERR_LOCAL_PTR_NULL;
2158 }
2159 return simManager_->GetLockState(slotId, lockType, lockState);
2160 }
2161
RefreshSimState(int32_t slotId)2162 int32_t CoreManagerInner::RefreshSimState(int32_t slotId)
2163 {
2164 if (simManager_ == nullptr) {
2165 TELEPHONY_LOGE("simManager_ is null!");
2166 return false;
2167 }
2168 return simManager_->RefreshSimState(slotId);
2169 }
2170
UnlockPin2(int32_t slotId,const std::string & pin2,LockStatusResponse & response)2171 int32_t CoreManagerInner::UnlockPin2(int32_t slotId, const std::string &pin2, LockStatusResponse &response)
2172 {
2173 if (simManager_ == nullptr) {
2174 TELEPHONY_LOGE("simManager_ is null!");
2175 return TELEPHONY_ERR_LOCAL_PTR_NULL;
2176 }
2177 return simManager_->UnlockPin2(slotId, pin2, response);
2178 }
2179
UnlockPuk2(int32_t slotId,const std::string & newPin2,const std::string & puk2,LockStatusResponse & response)2180 int32_t CoreManagerInner::UnlockPuk2(
2181 int32_t slotId, const std::string &newPin2, const std::string &puk2, LockStatusResponse &response)
2182 {
2183 if (simManager_ == nullptr) {
2184 TELEPHONY_LOGE("simManager_ is null!");
2185 return TELEPHONY_ERR_LOCAL_PTR_NULL;
2186 }
2187 return simManager_->UnlockPuk2(slotId, newPin2, puk2, response);
2188 }
2189
AlterPin2(int32_t slotId,const std::string & newPin2,const std::string & oldPin2,LockStatusResponse & response)2190 int32_t CoreManagerInner::AlterPin2(
2191 int32_t slotId, const std::string &newPin2, const std::string &oldPin2, LockStatusResponse &response)
2192 {
2193 if (simManager_ == nullptr) {
2194 TELEPHONY_LOGE("simManager_ is null!");
2195 return TELEPHONY_ERR_LOCAL_PTR_NULL;
2196 }
2197 return simManager_->AlterPin2(slotId, newPin2, oldPin2, response);
2198 }
2199
SendEnvelopeCmd(int32_t slotId,const std::string & cmd)2200 int32_t CoreManagerInner::SendEnvelopeCmd(int32_t slotId, const std::string &cmd)
2201 {
2202 if (simManager_ == nullptr) {
2203 TELEPHONY_LOGE("simManager_ is null!");
2204 return TELEPHONY_ERR_LOCAL_PTR_NULL;
2205 }
2206 return simManager_->SendEnvelopeCmd(slotId, cmd);
2207 }
2208
SendTerminalResponseCmd(int32_t slotId,const std::string & cmd)2209 int32_t CoreManagerInner::SendTerminalResponseCmd(int32_t slotId, const std::string &cmd)
2210 {
2211 if (simManager_ == nullptr) {
2212 TELEPHONY_LOGE("simManager_ is null!");
2213 return TELEPHONY_ERR_LOCAL_PTR_NULL;
2214 }
2215 return simManager_->SendTerminalResponseCmd(slotId, cmd);
2216 }
2217
SendCallSetupRequestResult(int32_t slotId,bool accept)2218 int32_t CoreManagerInner::SendCallSetupRequestResult(int32_t slotId, bool accept)
2219 {
2220 if (simManager_ == nullptr) {
2221 TELEPHONY_LOGE("simManager_ is null!");
2222 return TELEPHONY_ERR_LOCAL_PTR_NULL;
2223 }
2224 return simManager_->SendCallSetupRequestResult(slotId, accept);
2225 }
2226
UnlockSimLock(int32_t slotId,const PersoLockInfo & lockInfo,LockStatusResponse & response)2227 int32_t CoreManagerInner::UnlockSimLock(int32_t slotId, const PersoLockInfo &lockInfo, LockStatusResponse &response)
2228 {
2229 if (simManager_ == nullptr) {
2230 TELEPHONY_LOGE("simManager_ is null!");
2231 return TELEPHONY_ERR_LOCAL_PTR_NULL;
2232 }
2233 return simManager_->UnlockSimLock(slotId, lockInfo, response);
2234 }
2235
HasOperatorPrivileges(const int32_t slotId,bool & hasOperatorPrivileges)2236 int32_t CoreManagerInner::HasOperatorPrivileges(const int32_t slotId, bool &hasOperatorPrivileges)
2237 {
2238 TELEPHONY_LOGI("CoreManagerInner::HasOperatorPrivileges slotId:%{public}d", slotId);
2239 if (simManager_ == nullptr) {
2240 TELEPHONY_LOGE("simManager_ can not be null!");
2241 return TELEPHONY_ERR_LOCAL_PTR_NULL;
2242 }
2243 return simManager_->HasOperatorPrivileges(slotId, hasOperatorPrivileges);
2244 }
2245
GetSimIst(int32_t slotId)2246 std::u16string CoreManagerInner::GetSimIst(int32_t slotId)
2247 {
2248 if (simManager_ == nullptr) {
2249 TELEPHONY_LOGE("simManager_ is null!");
2250 return u"";
2251 }
2252 return simManager_->GetSimIst(slotId);
2253 }
2254
SaveImsSwitch(int32_t slotId,int32_t imsSwitchValue)2255 int32_t CoreManagerInner::SaveImsSwitch(int32_t slotId, int32_t imsSwitchValue)
2256 {
2257 if (simManager_ == nullptr) {
2258 TELEPHONY_LOGE("simManager_ is null!");
2259 return TELEPHONY_ERROR;
2260 }
2261 return simManager_->SaveImsSwitch(slotId, imsSwitchValue);
2262 }
2263
QueryImsSwitch(int32_t slotId,int32_t & imsSwitchValue)2264 int32_t CoreManagerInner::QueryImsSwitch(int32_t slotId, int32_t &imsSwitchValue)
2265 {
2266 if (simManager_ == nullptr) {
2267 TELEPHONY_LOGE("simManager_ is null!");
2268 return TELEPHONY_ERROR;
2269 }
2270 return simManager_->QueryImsSwitch(slotId, imsSwitchValue);
2271 }
2272 /******************** simManager_ end ************************/
2273 } // namespace Telephony
2274 } // namespace OHOS
2275