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 #ifndef IMPL_CORE_MANAGER_INNER_H 17 #define IMPL_CORE_MANAGER_INNER_H 18 19 #include <thread> 20 #include <unistd.h> 21 22 #include "i_esim_manager.h" 23 #include "i_network_search.h" 24 #include "i_sim_manager.h" 25 #include "i_tel_ril_manager.h" 26 #include "sim_account_callback.h" 27 #include "telephony_errors.h" 28 #include "telephony_types.h" 29 30 namespace OHOS { 31 namespace Telephony { 32 class CoreManagerInner final { 33 public: 34 ~CoreManagerInner() = default; 35 DISALLOW_COPY_AND_MOVE(CoreManagerInner); 36 static CoreManagerInner &GetInstance(); 37 void OnInit(std::shared_ptr<INetworkSearch> networkSearchManager, 38 std::shared_ptr<Telephony::ISimManager> simManager, std::shared_ptr<ITelRilManager> telRilManager); 39 void SetTelRilMangerObj(std::shared_ptr<ITelRilManager> telRilManager); 40 void SetEsimManagerObj(std::shared_ptr<IEsimManager> esimManager); 41 int32_t RegisterCoreNotify( 42 int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler, int what, int32_t *obj); 43 int32_t UnRegisterCoreNotify( 44 int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &observerCallBack, int what); 45 void RegisterCellularDataObject(const sptr<NetworkSearchCallBackBase> &callback); 46 void UnRegisterCellularDataObject(const sptr<NetworkSearchCallBackBase> &callback); 47 void RegisterCellularCallObject(const sptr<NetworkSearchCallBackBase> &callback); 48 void UnRegisterCellularCallObject(const sptr<NetworkSearchCallBackBase> &callback); 49 bool IsInitFinished(void); 50 bool IsInitFinishedForTelRil(void); 51 int32_t InitExtraModule(int32_t slotId); 52 int32_t GetDefaultSlotId(void); 53 int32_t GetMaxSimCount(void); 54 int32_t RegisterSimAccountCallback(const int32_t tokenId, const sptr<SimAccountCallback> &callback); 55 int32_t UnregisterSimAccountCallback(const sptr<SimAccountCallback> &callback); 56 57 /******************** telRilManager start *******************/ 58 int32_t SetRadioState( 59 int32_t slotId, int32_t eventId, int fun, int rst, const std::shared_ptr<AppExecFwk::EventHandler> &handler); 60 int32_t GetRadioState( 61 int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler) const; 62 int32_t ShutDown(int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler); 63 int32_t Dial(int32_t slotId, int32_t eventId, std::string address, int clirMode, 64 const std::shared_ptr<AppExecFwk::EventHandler> &handler); 65 int32_t Reject(int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler); 66 int32_t Hangup( 67 int32_t slotId, int32_t eventId, int32_t gsmIndex, const std::shared_ptr<AppExecFwk::EventHandler> &handler); 68 int32_t Answer(int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler); 69 int32_t GetCallList( 70 int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler) const; 71 int32_t HoldCall(int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler); 72 int32_t UnHoldCall(int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler); 73 int32_t SwitchCall(int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler); 74 int32_t CombineConference( 75 int32_t slotId, int32_t eventId, int32_t callType, const std::shared_ptr<AppExecFwk::EventHandler> &handler); 76 int32_t SeparateConference(int32_t slotId, int32_t eventId, int32_t callIndex, int32_t callType, 77 const std::shared_ptr<AppExecFwk::EventHandler> &handler); 78 int32_t CallSupplement( 79 int32_t slotId, int32_t eventId, int32_t type, const std::shared_ptr<AppExecFwk::EventHandler> &handler); 80 int32_t GetClip(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &response) const; 81 int32_t SetClip(int32_t slotId, int32_t action, const AppExecFwk::InnerEvent::Pointer &response); 82 int32_t GetClir(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &response) const; 83 int32_t SetClir(int32_t slotId, int32_t action, const AppExecFwk::InnerEvent::Pointer &response); 84 int32_t SetCallWaiting(int32_t slotId, int32_t activate, const AppExecFwk::InnerEvent::Pointer &response); 85 int32_t SetCallTransferInfo( 86 int32_t slotId, const CallTransferParam &callTransfer, const AppExecFwk::InnerEvent::Pointer &response); 87 int32_t GetCallTransferInfo( 88 int32_t slotId, const int32_t reason, const AppExecFwk::InnerEvent::Pointer &response) const; 89 int32_t GetCallWaiting(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &response) const; 90 int32_t GetCallRestriction(int32_t slotId, std::string fac, const AppExecFwk::InnerEvent::Pointer &response) const; 91 int32_t SetCallRestriction( 92 int32_t slotId, const CallRestrictionParam &callRestriction, const AppExecFwk::InnerEvent::Pointer &response); 93 int32_t SetBarringPassword(int32_t slotId, const char *oldPassword, 94 const char *newPassword, const std::string &restrictionType, const AppExecFwk::InnerEvent::Pointer &response); 95 int32_t SetVoNRSwitch( 96 int32_t slotId, int32_t state, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler); 97 /* PDP start */ 98 int32_t SetDataPermitted(int32_t slotId, int32_t eventId, int32_t dataPermitted, 99 const std::shared_ptr<AppExecFwk::EventHandler> &handler); 100 int32_t SetInitApnInfo(int32_t slotId, int32_t eventId, const DataProfile &dataProfile, 101 const std::shared_ptr<AppExecFwk::EventHandler> &handler); 102 int32_t ActivatePdpContext(int32_t slotId, int32_t eventId, const ActivateDataParam &activateData, 103 const std::shared_ptr<AppExecFwk::EventHandler> &handler); 104 int32_t DeactivatePdpContext(int32_t slotId, int32_t eventId, const DeactivateDataParam &deactivateData, 105 const std::shared_ptr<AppExecFwk::EventHandler> &handler); 106 int32_t GetPdpContextList( 107 int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler); 108 int32_t GetLinkBandwidthInfo( 109 int32_t slotId, int32_t eventId, const int32_t cid, const std::shared_ptr<AppExecFwk::EventHandler> &handler); 110 int32_t GetLinkCapability( 111 int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler); 112 int32_t SetLinkBandwidthReportingRule(int32_t slotId, int32_t eventId, LinkBandwidthRule linkBandwidth, 113 const std::shared_ptr<AppExecFwk::EventHandler> &handler); 114 int32_t CleanAllConnections( 115 int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler); 116 int32_t SendUrspDecodeResult(int32_t slotId, std::vector<uint8_t> buffer, int32_t eventId); 117 int32_t SendUePolicySectionIdentifier(int32_t slotId, std::vector<uint8_t> buffer, int32_t eventId); 118 int32_t SendImsRsdList(int32_t slotId, std::vector<uint8_t> buffer, int32_t eventId); 119 int32_t GetNetworkSliceAllowedNssai(int32_t slotId, std::vector<uint8_t> buffer, int32_t eventId); 120 int32_t GetNetworkSliceEhplmn(int32_t slotId, int32_t eventId); 121 /* PDP end */ 122 int32_t StopDTMF( 123 int32_t slotId, int32_t eventId, int32_t index, const std::shared_ptr<AppExecFwk::EventHandler> &handler); 124 int32_t StartDTMF(int32_t slotId, int32_t eventId, char cDTMFCode, int32_t index, 125 const std::shared_ptr<AppExecFwk::EventHandler> &handler); 126 int32_t SendDTMF(int32_t slotId, int32_t eventId, char cDTMFCode, int32_t index, 127 const std::shared_ptr<AppExecFwk::EventHandler> &handler); 128 int32_t SendDTMF(int32_t slotId, int32_t eventId, const DtmfParam &dtmfParam, 129 const std::shared_ptr<AppExecFwk::EventHandler> &handler); 130 131 int32_t GetSignalStrength( 132 int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler) const; 133 int32_t GetCsRegStatus( 134 int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler) const; 135 int32_t GetPsRegStatus( 136 int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler) const; 137 int32_t SetCallPreferenceMode( 138 int32_t slotId, int32_t eventId, int32_t mode, const std::shared_ptr<AppExecFwk::EventHandler> &handler) const; 139 int32_t GetCallPreferenceMode( 140 int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler) const; 141 int32_t SetUssd(int32_t slotId, int32_t eventId, const std::string str, 142 const std::shared_ptr<AppExecFwk::EventHandler> &handler) const; 143 int32_t GetUssd(int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler) const; 144 int32_t CloseUnFinishedUssd( 145 int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler) const; 146 int32_t GetMute(int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler) const; 147 int32_t SetMute( 148 int32_t slotId, int32_t eventId, int32_t mute, const std::shared_ptr<AppExecFwk::EventHandler> &handler) const; 149 int32_t GetEmergencyCallList( 150 int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler) const; 151 int32_t SetEmergencyCallList(int32_t slotId, int32_t eventId, std::vector<EmergencyCall> &eccVec, 152 const std::shared_ptr<AppExecFwk::EventHandler> &handler) const; 153 int32_t GetCallFailReason( 154 int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler) const; 155 int32_t GetOperatorInfo( 156 int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler) const; 157 int32_t GetNeighboringCellInfoList( 158 int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler); 159 int32_t GetCurrentCellInfo( 160 int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler); 161 162 int32_t SendGsmSms(int32_t slotId, int32_t eventId, GsmSimMessageParam &gsmMessage, 163 const std::shared_ptr<AppExecFwk::EventHandler> &handler); 164 int32_t SendCdmaSms(int32_t slotId, int32_t eventId, std::string pdu, int64_t refId, 165 const std::shared_ptr<AppExecFwk::EventHandler> &handler); 166 int32_t AddSimMessage(int32_t slotId, int32_t eventId, const SimMessageParam &simMessage, 167 const std::shared_ptr<AppExecFwk::EventHandler> &handler); 168 int32_t GetSmscAddr( 169 int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler) const; 170 int32_t GetCdmaCBConfig(int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler); 171 int32_t SetSmscAddr(int32_t slotId, int32_t eventId, int32_t tosca, std::string address, 172 const std::shared_ptr<AppExecFwk::EventHandler> &handler); 173 int32_t DelSimMessage( 174 int32_t slotId, int32_t eventId, int32_t gsmIndex, const std::shared_ptr<AppExecFwk::EventHandler> &handler); 175 int32_t SendSmsMoreMode(int32_t slotId, int32_t eventId, GsmSimMessageParam &gsmMessage, 176 const std::shared_ptr<AppExecFwk::EventHandler> &handler); 177 int32_t SendSmsAck(int32_t slotId, int32_t eventId, bool success, int32_t cause, 178 const std::shared_ptr<AppExecFwk::EventHandler> &handler); 179 int32_t GetCBConfig(int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler); 180 int32_t SetCBConfig(int32_t slotId, int32_t eventId, const CBConfigParam &cbConfig, 181 const std::shared_ptr<AppExecFwk::EventHandler> &handler); 182 int32_t SetCdmaCBConfig(int32_t slotId, int32_t eventId, CdmaCBConfigInfoList &cdmaCBConfigInfoList, 183 const std::shared_ptr<AppExecFwk::EventHandler> &handler); 184 int32_t GetNetworkSearchInformation( 185 int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler) const; 186 int32_t GetNetworkSelectionMode( 187 int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler) const; 188 int32_t SetNetworkSelectionMode(int32_t slotId, int32_t eventId, int32_t automaticFlag, std::string oper, 189 const std::shared_ptr<AppExecFwk::EventHandler> &handler); 190 int32_t AddCdmaSimMessage(int32_t slotId, int32_t eventId, int32_t status, std::string pdu, 191 const std::shared_ptr<AppExecFwk::EventHandler> &handler); 192 int32_t DelCdmaSimMessage( 193 int32_t slotId, int32_t eventId, int32_t cdmaIndex, const std::shared_ptr<AppExecFwk::EventHandler> &handler); 194 int32_t UpdateCdmaSimMessage(int32_t slotId, int32_t eventId, const CdmaSimMessageParam &cdmaSimMsg, 195 const std::shared_ptr<AppExecFwk::EventHandler> &handler); 196 int32_t SetPreferredNetworkPara(int32_t slotId, int32_t eventId, int32_t preferredNetworkType, 197 const std::shared_ptr<AppExecFwk::EventHandler> &handler); 198 int32_t GetPreferredNetworkPara( 199 int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler); 200 /******************** telRilManager end *******************/ 201 /******************** networkSearchManager start *******************/ 202 int32_t GetPsRadioTech(int32_t slotId, int32_t &psRadioTech); 203 int32_t GetCsRadioTech(int32_t slotId, int32_t &csRadioTech); 204 int32_t GetPsRegState(int32_t slotId); 205 int32_t GetCsRegState(int32_t slotId); 206 int32_t GetPsRoamingState(int32_t slotId); 207 bool SetNetworkSelectionMode(int32_t slotId, int32_t selectMode, const sptr<NetworkInformation> &networkInformation, 208 bool resumeSelection, const sptr<INetworkSearchCallback> &callback); 209 int32_t GetSignalInfoList(int32_t slotId, std::vector<sptr<SignalInformation>> &signals); 210 std::u16string GetOperatorNumeric(int32_t slotId); 211 int32_t GetOperatorName(int32_t slotId, std::u16string &operatorName); 212 int32_t GetNetworkStatus(int32_t slotId, sptr<NetworkState> &networkState); 213 int32_t SetRadioState(int32_t slotId, bool isOn, int32_t rst, const sptr<INetworkSearchCallback> &callback); 214 int32_t GetRadioState(int32_t slotId); 215 int32_t GetRadioState(int32_t slotId, const sptr<INetworkSearchCallback> &callback); 216 int32_t GetIsoCountryCodeForNetwork(int32_t slotId, std::u16string &countryCode); 217 int32_t GetImei(int32_t slotId, std::u16string &imei); 218 int32_t GetImeiSv(int32_t slotId, std::u16string &imeiSv); 219 int32_t GetMeid(int32_t slotId, std::u16string &meid); 220 int32_t GetUniqueDeviceId(int32_t slotId, std::u16string &deviceId); 221 PhoneType GetPhoneType(int32_t slotId); 222 sptr<CellLocation> GetCellLocation(int32_t slotId); 223 int32_t GetNetworkSearchInformation(int32_t slotId, const sptr<INetworkSearchCallback> &callback); 224 int32_t GetNetworkSelectionMode(int32_t slotId, const sptr<INetworkSearchCallback> &callback); 225 int32_t GetImsRegStatus(int32_t slotId, ImsServiceType imsSrvType, ImsRegInfo &info) const; 226 int32_t GetCellInfoList(int32_t slotId, std::vector<sptr<CellInformation>> &cellInfo); 227 int32_t SendUpdateCellLocationRequest(int32_t slotId); 228 int32_t GetPreferredNetwork(int32_t slotId, const sptr<INetworkSearchCallback> &callback); 229 int32_t SetPreferredNetwork(int32_t slotId, int32_t networkMode, const sptr<INetworkSearchCallback> &callback); 230 bool SetPreferredNetwork(int32_t slotId, int32_t networkMode); 231 int32_t GetAirplaneMode(bool &airplaneMode); 232 int32_t UpdateRadioOn(int32_t slotId); 233 234 bool IsNrSupported(int32_t slotId); 235 bool IsSatelliteEnabled(); 236 int32_t SetNrOptionMode(int32_t slotId, NrMode mode); 237 int32_t GetNrOptionMode(int32_t slotId, NrMode &mode); 238 FrequencyType GetFrequencyType(int32_t slotId) const; 239 NrState GetNrState(int32_t slotId) const; 240 void DcPhysicalLinkActiveUpdate(int32_t slotId, bool isActive); 241 int32_t NotifyCallStatusToNetworkSearch(int32_t slotId, int32_t callStatus); 242 int32_t IsGsm(int32_t slotId, bool &isGsm); 243 int32_t IsCdma(int32_t slotId, bool &isCdma); 244 int32_t StartRadioOnState(int32_t slotId); 245 int32_t StartGetRilSignalIntensity(int32_t slotId); 246 int32_t ProcessSignalIntensity(int32_t slotId, const Rssi &signalIntensity); 247 int32_t UpdateOperatorName(int32_t slotId); 248 bool SetForcePreferredNetwork(int32_t slotId, int32_t networkMode); 249 /******************** networkSearchManager end *******************/ 250 /******************** simManager start ***************************/ 251 int32_t ObtainSpnCondition(int32_t slotId, bool roaming, std::string operatorNum); 252 int32_t GetSimSpn(int32_t slotId, std::u16string &spn); 253 std::u16string GetSimEons(int32_t slotId, const std::string &plmn, int32_t lac, bool longNameRequired); 254 int32_t SetVoiceMailInfo(int32_t slotId, const std::u16string &mailName, const std::u16string &mailNumber); 255 int32_t HasOperatorPrivileges(const int32_t slotId, bool &hasOperatorPrivileges); 256 int32_t SendEnvelopeCmd(int32_t slotId, const std::string &cmd); 257 int32_t SendTerminalResponseCmd(int32_t slotId, const std::string &cmd); 258 int32_t SendCallSetupRequestResult(int32_t slotId, bool accept); 259 int32_t UnlockSimLock(int32_t slotId, const PersoLockInfo &lockInfo, LockStatusResponse &response); 260 int32_t HasSimCard(int32_t slotId, bool &hasSimCard); 261 int32_t GetSimState(int32_t slotId, SimState &simState); 262 int32_t GetSimIccStatus(int32_t slotId, IccSimStatus &iccStatus); 263 int32_t GetCardType(int32_t slotId, CardType &cardType); 264 int32_t SetModemInit(int32_t slotId, bool state); 265 int32_t UnlockPin(int32_t slotId, const std::string &pin, LockStatusResponse &response); 266 int32_t UnlockPuk(int32_t slotId, const std::string &newPin, const std::string &puk, LockStatusResponse &response); 267 int32_t AlterPin( 268 int32_t slotId, const std::string &newPin, const std::string &oldPin, LockStatusResponse &response); 269 int32_t SetLockState(int32_t slotId, const LockInfo &options, LockStatusResponse &response); 270 int32_t GetLockState(int32_t slotId, LockType lockType, LockState &lockState); 271 int32_t RefreshSimState(int32_t slotId); 272 int32_t UnlockPin2(int32_t slotId, const std::string &pin2, LockStatusResponse &response); 273 int32_t UnlockPuk2( 274 int32_t slotId, const std::string &newPin2, const std::string &puk2, LockStatusResponse &response); 275 int32_t AlterPin2( 276 int32_t slotId, const std::string &newPin2, const std::string &oldPin2, LockStatusResponse &response); 277 int32_t GetShowNumber(int32_t slotId, std::u16string &showNumber); 278 int32_t GetShowName(int32_t slotId, std::u16string &showName); 279 int32_t GetActiveSimAccountInfoList(std::vector<IccAccountInfo> &iccAccountInfoList); 280 int32_t GetOperatorConfigs(int32_t slotId, OperatorConfig &poc); 281 int32_t UpdateOperatorConfigs(); 282 int32_t GetSimOperatorNumeric(int32_t slotId, std::u16string &operatorNumeric); 283 int32_t GetISOCountryCodeForSim(int32_t slotId, std::u16string &countryCode); 284 int32_t GetSimIccId(int32_t slotId, std::u16string &iccId); 285 int32_t GetIMSI(int32_t slotId, std::u16string &imsi); 286 std::u16string GetLocaleFromDefaultSim(int32_t slotId); 287 int32_t GetSlotId(int32_t simId); 288 int32_t GetSimId(int32_t slotId); 289 int32_t GetSimGid1(int32_t slotId, std::u16string &gid1); 290 std::u16string GetSimGid2(int32_t slotId); 291 int32_t GetOpName(int32_t slotId, std::u16string &opname); 292 int32_t GetOpKeyExt(int32_t slotId, std::u16string &opkeyExt); 293 int32_t GetOpKey(std::u16string &opkey); 294 int32_t GetOpKey(int32_t slotId, std::u16string &opkey); 295 int32_t GetSimTelephoneNumber(int32_t slotId, std::u16string &telephoneNumber); 296 std::u16string GetSimTeleNumberIdentifier(const int32_t slotId); 297 int32_t GetVoiceMailIdentifier(int32_t slotId, std::u16string &voiceMailIdentifier); 298 int32_t GetVoiceMailNumber(int32_t slotId, std::u16string &voiceMailNumber); 299 int32_t GetVoiceMailCount(int32_t slotId, int32_t &voiceMailCount); 300 int32_t SetVoiceMailCount(int32_t slotId, int32_t voiceMailCount); 301 int32_t SetVoiceCallForwarding(int32_t slotId, bool enable, const std::string &number); 302 std::u16string GetSimIst(int32_t slotId); 303 int32_t QueryIccDiallingNumbers(int slotId, int type, std::vector<std::shared_ptr<DiallingNumbersInfo>> &result); 304 int32_t AddIccDiallingNumbers(int slotId, int type, const std::shared_ptr<DiallingNumbersInfo> &diallingNumber); 305 int32_t DelIccDiallingNumbers(int slotId, int type, const std::shared_ptr<DiallingNumbersInfo> &diallingNumber); 306 int32_t UpdateIccDiallingNumbers(int slotId, int type, const std::shared_ptr<DiallingNumbersInfo> &diallingNumber); 307 int32_t AddSmsToIcc(int slotId, int status, std::string &pdu, std::string &smsc); 308 int32_t UpdateSmsIcc(int slotId, int index, int status, std::string &pduData, std::string &smsc); 309 int32_t DelSmsIcc(int slotId, int index); 310 std::vector<std::string> ObtainAllSmsOfIcc(int slotId); 311 bool IsSimActive(int32_t slotId); 312 int32_t SetActiveSim(int32_t slotId, int32_t enable); 313 int32_t SetActiveSimSatellite(int32_t slotId, int32_t enable); 314 int32_t ResetSimLoadAccount(int32_t slotId); 315 int32_t GetSimAccountInfo(int32_t slotId, IccAccountInfo &info); 316 int32_t SetDefaultVoiceSlotId(int32_t slotId); 317 int32_t SetDefaultSmsSlotId(int32_t slotId); 318 int32_t SetDefaultCellularDataSlotId(int32_t slotId); 319 int32_t SetPrimarySlotId(int32_t slotId, bool isUserSet = false); 320 int32_t SetShowNumber(int32_t slotId, const std::u16string &number); 321 int32_t SetShowName(int32_t slotId, const std::u16string &name); 322 int32_t GetDefaultVoiceSlotId(); 323 int32_t GetDefaultVoiceSimId(int32_t &simId); 324 int32_t GetDefaultSmsSlotId(); 325 int32_t GetDefaultSmsSimId(int32_t &simId); 326 int32_t GetDefaultCellularDataSlotId(); 327 int32_t GetDefaultCellularDataSimId(int32_t &simId); 328 int32_t GetPrimarySlotId(int32_t &slotId); 329 int32_t SaveImsSwitch(int32_t slotId, int32_t imsSwitchValue); 330 int32_t QueryImsSwitch(int32_t slotId, int32_t &imsSwitchValue); 331 int32_t GetDsdsMode(int32_t &dsdsMode); 332 int32_t SetDsdsMode(int32_t dsdsMode); 333 int32_t SendSimMatchedOperatorInfo( 334 int32_t slotId, int32_t state, const std::string &operName, const std::string &operKey); 335 int32_t IsCTSimCard(int32_t slotId, bool &isCTSimCard); 336 bool IsSetActiveSimInProgress(int32_t slotId); 337 bool IsSetPrimarySlotIdInProgress(); 338 int32_t SavePrimarySlotId(int32_t slotId); 339 bool IsDataShareError(); 340 void ResetDataShareError(); 341 void UpdateImsCapFromChip(int32_t slotId, const ImsCapFromChip &imsCapFromChip); 342 int32_t GetDefaultMainSlotByIccId(); 343 int32_t GetAllSimAccountInfoList(std::vector<IccAccountInfo> &iccAccountInfoList); 344 int32_t GetSimLabel(int32_t slotId, SimLabel &simLabel); 345 int32_t SetSimLabelIndex(const std::string &iccId, int32_t labelIndex); 346 int32_t NotifySimSlotsMapping(int32_t slotId); 347 int32_t InsertEsimData(const std::string &iccId, int32_t esimLabel, const std::string &operatorName); 348 /******************** simManager end *****************************/ 349 /******************** esimManager start *****************************/ 350 int32_t GetEid(int32_t slotId, std::u16string &eId); 351 int32_t GetEuiccProfileInfoList(int32_t slotId, GetEuiccProfileInfoListInnerResult &euiccProfileInfoList); 352 int32_t GetEuiccInfo(int32_t slotId, EuiccInfo &eUiccInfo); 353 int32_t DisableProfile( 354 int32_t slotId, int32_t portIndex, const std::u16string &iccId, bool refresh, int32_t &enumResult); 355 int32_t GetSmdsAddress(int32_t slotId, int32_t portIndex, std::u16string &smdsAddress); 356 int32_t GetRulesAuthTable(int32_t slotId, int32_t portIndex, EuiccRulesAuthTable &eUiccRulesAuthTable); 357 int32_t GetEuiccChallenge(int32_t slotId, int32_t portIndex, ResponseEsimInnerResult &responseResult); 358 int32_t GetDefaultSmdpAddress(int32_t slotId, std::u16string &defaultSmdpAddress); 359 int32_t CancelSession(int32_t slotId, const std::u16string &transactionId, CancelReason cancelReason, 360 ResponseEsimInnerResult &responseResult); 361 int32_t GetProfile( 362 int32_t slotId, int32_t portIndex, const std::u16string &iccId, EuiccProfile &eUiccProfile); 363 int32_t ResetMemory(int32_t slotId, ResetOption resetOption, int32_t &enumResult); 364 int32_t SetDefaultSmdpAddress( 365 int32_t slotId, const std::u16string &defaultSmdpAddress, int32_t &enumResult); 366 bool IsSupported(int32_t slotId); 367 int32_t SendApduData(int32_t slotId, const std::u16string &aid, const EsimApduData &apduData, 368 ResponseEsimInnerResult &responseResult); 369 int32_t PrepareDownload(int32_t slotId, const DownLoadConfigInfo &downLoadConfigInfo, 370 ResponseEsimInnerResult &responseResult); 371 int32_t LoadBoundProfilePackage(int32_t slotId, int32_t portIndex, const std::u16string &boundProfilePackage, 372 ResponseEsimBppResult &responseResult); 373 int32_t ListNotifications(int32_t slotId, int32_t portIndex, EsimEvent events, 374 EuiccNotificationList ¬ificationList); 375 int32_t RetrieveNotificationList( 376 int32_t slotId, int32_t portIndex, EsimEvent events, EuiccNotificationList ¬ificationList); 377 int32_t RetrieveNotification( 378 int32_t slotId, int32_t portIndex, int32_t seqNumber, EuiccNotification ¬ification); 379 int32_t RemoveNotificationFromList( 380 int32_t slotId, int32_t portIndex, int32_t seqNumber, int32_t &enumResult); 381 int32_t GetEuiccInfo2(int32_t slotId, int32_t portIndex, EuiccInfo2 &euiccInfo2); 382 int32_t AuthenticateServer(int32_t slotId, const AuthenticateConfigInfo &authenticateConfigInfo, 383 ResponseEsimInnerResult &responseResult); 384 int32_t DeleteProfile(int32_t slotId, const std::u16string &iccId, int32_t &enumResult); 385 int32_t SwitchToProfile(int32_t slotId, int32_t portIndex, const std::u16string &iccId, 386 bool forceDisableProfile, int32_t &enumResult); 387 int32_t SetProfileNickname( 388 int32_t slotId, const std::u16string &iccId, const std::u16string &nickname, int32_t &enumResult); 389 int32_t GetContractInfo( 390 int32_t slotId, GetContractInfoRequest &getContractInfoRequest, std::string &response); 391 /******************** esimManager end *****************************/ 392 393 private: 394 CoreManagerInner(); 395 396 private: 397 bool isInitAllObj_ = false; 398 bool isInitExtraObj_ = false; 399 std::shared_ptr<INetworkSearch> networkSearchManager_ = nullptr; 400 std::shared_ptr<ISimManager> simManager_ = nullptr; 401 std::shared_ptr<ITelRilManager> telRilManager_ = nullptr; 402 std::shared_ptr<IEsimManager> esimManager_ = nullptr; 403 }; 404 } // namespace Telephony 405 } // namespace OHOS 406 #endif 407