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 I_TEL_RIL_MANAGER_H 17 #define I_TEL_RIL_MANAGER_H 18 19 #include "event_runner.h" 20 #include "hril_network_parcel.h" 21 #include "hril_sim_parcel.h" 22 #include "hril_sms_parcel.h" 23 #include "hril_types.h" 24 #include "telephony_types.h" 25 26 namespace OHOS { 27 namespace Telephony { 28 class ITelRilManager { 29 public: 30 virtual bool OnInit() = 0; 31 virtual ~ITelRilManager() = default; 32 33 virtual int32_t RegisterCoreNotify( 34 int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler, int32_t what, int32_t *obj) = 0; 35 virtual int32_t UnRegisterCoreNotify( 36 int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &observerCallBack, int32_t what) = 0; 37 38 virtual int32_t SetRadioState( 39 int32_t slotId, int32_t fun, int32_t rst, const AppExecFwk::InnerEvent::Pointer &response) = 0; 40 virtual int32_t GetRadioState(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &response) = 0; 41 42 virtual int32_t ShutDown(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &response) = 0; 43 44 virtual int32_t GetCallList(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &result) = 0; 45 46 virtual int32_t Dial( 47 int32_t slotId, std::string address, int32_t clirMode, const AppExecFwk::InnerEvent::Pointer &result) = 0; 48 49 virtual int32_t Reject(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &result) = 0; 50 51 virtual int32_t Hangup(int32_t slotId, int32_t gsmIndex, const AppExecFwk::InnerEvent::Pointer &result) = 0; 52 53 virtual int32_t Answer(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &result) = 0; 54 55 virtual int32_t HoldCall(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &result) = 0; 56 57 virtual int32_t UnHoldCall(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &result) = 0; 58 59 virtual int32_t SwitchCall(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &result) = 0; 60 61 virtual int32_t CombineConference( 62 int32_t slotId, int32_t callType, const AppExecFwk::InnerEvent::Pointer &result) = 0; 63 64 virtual int32_t SeparateConference( 65 int32_t slotId, int32_t callIndex, int32_t callType, const AppExecFwk::InnerEvent::Pointer &result) = 0; 66 67 virtual int32_t CallSupplement(int32_t slotId, int32_t type, const AppExecFwk::InnerEvent::Pointer &result) = 0; 68 69 virtual int32_t GetCallWaiting(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &result) = 0; 70 71 virtual int32_t SetCallWaiting( 72 int32_t slotId, const int32_t activate, const AppExecFwk::InnerEvent::Pointer &result) = 0; 73 74 virtual int32_t GetCallTransferInfo( 75 int32_t slotId, const int32_t reason, const AppExecFwk::InnerEvent::Pointer &result) = 0; 76 77 virtual int32_t SetCallTransferInfo( 78 int32_t slotId, const CallTransferParam &callTransfer, const AppExecFwk::InnerEvent::Pointer &result) = 0; 79 80 virtual int32_t GetClip(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &result) = 0; 81 82 virtual int32_t SetClip(int32_t slotId, const int32_t action, const AppExecFwk::InnerEvent::Pointer &result) = 0; 83 84 virtual int32_t GetClir(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &result) = 0; 85 86 virtual int32_t SetClir(int32_t slotId, const int32_t action, const AppExecFwk::InnerEvent::Pointer &result) = 0; 87 88 virtual int32_t GetCallRestriction( 89 int32_t slotId, std::string fac, const AppExecFwk::InnerEvent::Pointer &result) = 0; 90 91 virtual int32_t SetCallRestriction( 92 int32_t slotId, const CallRestrictionParam &callrestriction, const AppExecFwk::InnerEvent::Pointer &result) = 0; 93 94 virtual int32_t SetBarringPassword(int32_t slotId, const char *oldPassword, const char *newPassword, 95 const std::string &restrictionType, const AppExecFwk::InnerEvent::Pointer &response) = 0; 96 97 virtual int32_t SendDtmf( 98 int32_t slotId, const DtmfParam &dtmfParam, const AppExecFwk::InnerEvent::Pointer &result) = 0; 99 virtual int32_t SendDtmf( 100 int32_t slotId, char cDTMFCode, int32_t index, const AppExecFwk::InnerEvent::Pointer &result) = 0; 101 virtual int32_t StartDtmf( 102 int32_t slotId, char cDTMFCode, int32_t index, const AppExecFwk::InnerEvent::Pointer &result) = 0; 103 virtual int32_t StopDtmf(int32_t slotId, int32_t index, const AppExecFwk::InnerEvent::Pointer &result) = 0; 104 105 virtual int32_t SetVoNRSwitch( 106 int32_t slotId, int32_t state, const AppExecFwk::InnerEvent::Pointer &result) = 0; 107 108 virtual int32_t GetSignalStrength(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &response) = 0; 109 110 virtual int32_t GetCsRegStatus(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &response) = 0; 111 112 virtual int32_t GetPsRegStatus(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &response) = 0; 113 114 virtual int32_t GetOperatorInfo(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &response) = 0; 115 116 virtual int32_t GetCellInfoList(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &response) = 0; 117 118 virtual int32_t GetCurrentCellInfo(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &response) = 0; 119 120 virtual int32_t GetImei(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &response) = 0; 121 122 virtual int32_t GetMeid(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &response) = 0; 123 124 virtual int32_t GetVoiceRadioTechnology(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &response) = 0; 125 126 virtual int32_t GetPhysicalChannelConfig(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &response) = 0; 127 128 virtual int32_t GetBasebandVersion(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &response) = 0; 129 130 virtual int32_t SetLocateUpdates( 131 int32_t slotId, HRilRegNotifyMode mode, const AppExecFwk::InnerEvent::Pointer &response) = 0; 132 133 virtual int32_t SendGsmSms( 134 int32_t slotId, std::string smscPdu, std::string pdu, const AppExecFwk::InnerEvent::Pointer &response) = 0; 135 136 virtual int32_t SendCdmaSms(int32_t slotId, std::string pdu, const AppExecFwk::InnerEvent::Pointer &response) = 0; 137 138 virtual int32_t AddSimMessage( 139 int32_t slotId, const SimMessageParam &simMessage, const AppExecFwk::InnerEvent::Pointer &response) = 0; 140 141 virtual int32_t DelSimMessage( 142 int32_t slotId, int32_t gsmIndex, const AppExecFwk::InnerEvent::Pointer &response) = 0; 143 144 virtual int32_t UpdateSimMessage( 145 int32_t slotId, const SimMessageParam &simMessage, const AppExecFwk::InnerEvent::Pointer &response) = 0; 146 147 virtual int32_t GetSmscAddr(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &response) = 0; 148 149 virtual int32_t GetCdmaCBConfig(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &response) = 0; 150 151 virtual int32_t SetSmscAddr( 152 int32_t slotId, int32_t tosca, std::string address, const AppExecFwk::InnerEvent::Pointer &response) = 0; 153 154 virtual int32_t SetCBConfig( 155 int32_t slotId, const CBConfigParam &cbConfig, const AppExecFwk::InnerEvent::Pointer &response) = 0; 156 157 virtual int32_t SetCdmaCBConfig(int32_t slotId, CdmaCBConfigInfoList &cdmaCBConfigInfoList, 158 const AppExecFwk::InnerEvent::Pointer &response) = 0; 159 160 virtual int32_t GetCBConfig(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &result) = 0; 161 162 virtual int32_t SendSmsMoreMode( 163 int32_t slotId, std::string smscPdu, std::string pdu, const AppExecFwk::InnerEvent::Pointer &response) = 0; 164 165 virtual int32_t SendSmsAck( 166 int32_t slotId, bool success, int32_t cause, const AppExecFwk::InnerEvent::Pointer &response) = 0; 167 virtual int32_t AddCdmaSimMessage( 168 int32_t slotId, int32_t status, std::string pdu, const AppExecFwk::InnerEvent::Pointer &response) = 0; 169 virtual int32_t DelCdmaSimMessage( 170 int32_t slotId, int32_t cdmaIndex, const AppExecFwk::InnerEvent::Pointer &response) = 0; 171 virtual int32_t UpdateCdmaSimMessage( 172 int32_t slotId, const CdmaSimMessageParam &cdmaSimMsg, const AppExecFwk::InnerEvent::Pointer &response) = 0; 173 174 /* PDP start */ 175 virtual int32_t SetInitApnInfo( 176 int32_t slotId, const DataProfile &dataProfile, const AppExecFwk::InnerEvent::Pointer &response) = 0; 177 virtual int32_t ActivatePdpContext( 178 int32_t slotId, const ActivateDataParam &activeData, const AppExecFwk::InnerEvent::Pointer &response) = 0; 179 virtual int32_t DeactivatePdpContext( 180 int32_t slotId, int32_t cid, int32_t reason, const AppExecFwk::InnerEvent::Pointer &response) = 0; 181 virtual int32_t GetPdpContextList(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &response) = 0; 182 virtual int32_t GetLinkBandwidthInfo( 183 int32_t slotId, const int32_t cid, const AppExecFwk::InnerEvent::Pointer &response) = 0; 184 virtual int32_t SetLinkBandwidthReportingRule( 185 int32_t slotId, LinkBandwidthRule linkBandwidth, const AppExecFwk::InnerEvent::Pointer &response) = 0; 186 virtual int32_t SetDataPermitted( 187 int32_t slotId, int32_t dataPermitted, const AppExecFwk::InnerEvent::Pointer &response) = 0; 188 virtual int32_t GetLinkCapability(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &response) = 0; 189 190 /* PDP end */ 191 192 virtual int32_t GetSimStatus(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &result) = 0; 193 virtual int32_t GetSimIO( 194 int32_t slotId, SimIoRequestInfo data, const AppExecFwk::InnerEvent::Pointer &response) = 0; 195 virtual int32_t GetImsi(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &result) = 0; 196 virtual int32_t GetSimLockStatus( 197 int32_t slotId, std::string fac, const AppExecFwk::InnerEvent::Pointer &result) = 0; 198 virtual int32_t SetSimLock( 199 int32_t slotId, const SimLockParam &simLock, const AppExecFwk::InnerEvent::Pointer &result) = 0; 200 virtual int32_t ChangeSimPassword( 201 int32_t slotId, const SimPasswordParam &simPassword, const AppExecFwk::InnerEvent::Pointer &result) = 0; 202 virtual int32_t UnlockPin( 203 int32_t slotId, const std::string &pin, const AppExecFwk::InnerEvent::Pointer &result) = 0; 204 virtual int32_t UnlockPuk(int32_t slotId, const std::string &puk, const std::string &pin, 205 const AppExecFwk::InnerEvent::Pointer &result) = 0; 206 virtual int32_t UnlockPin2( 207 int32_t slotId, const std::string &pin2, const AppExecFwk::InnerEvent::Pointer &result) = 0; 208 virtual int32_t UnlockPuk2(int32_t slotId, const std::string &puk2, const std::string &pin2, 209 const AppExecFwk::InnerEvent::Pointer &result) = 0; 210 virtual int32_t SetActiveSim( 211 int32_t slotId, int32_t index, int32_t enable, const AppExecFwk::InnerEvent::Pointer &result) = 0; 212 virtual int32_t SendTerminalResponseCmd( 213 int32_t slotId, const std::string &strCmd, const AppExecFwk::InnerEvent::Pointer &response) = 0; 214 virtual int32_t SendEnvelopeCmd( 215 int32_t slotId, const std::string &strCmd, const AppExecFwk::InnerEvent::Pointer &response) = 0; 216 virtual int32_t SendCallSetupRequestResult( 217 int32_t slotId, bool accept, const AppExecFwk::InnerEvent::Pointer &response) = 0; 218 virtual int32_t SimStkIsReady(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &response) = 0; 219 virtual int32_t UnlockSimLock( 220 int32_t slotId, int32_t lockType, std::string password, const AppExecFwk::InnerEvent::Pointer &response) = 0; 221 virtual int32_t GetRadioProtocol(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &response) = 0; 222 virtual int32_t SetRadioProtocol( 223 int32_t slotId, RadioProtocol radioProtocol, const AppExecFwk::InnerEvent::Pointer &response) = 0; 224 225 virtual int32_t GetNetworkSearchInformation(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &result) = 0; 226 virtual int32_t GetNetworkSelectionMode(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &result) = 0; 227 virtual int32_t SetNetworkSelectionMode( 228 int32_t slotId, int32_t automaticFlag, std::string oper, const AppExecFwk::InnerEvent::Pointer &result) = 0; 229 virtual int32_t SetPreferredNetwork( 230 int32_t slotId, int32_t preferredNetworkType, const AppExecFwk::InnerEvent::Pointer &response) = 0; 231 virtual int32_t GetPreferredNetwork(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &response) = 0; 232 233 virtual int32_t SetCallPreferenceMode( 234 int32_t slotId, const int32_t mode, const AppExecFwk::InnerEvent::Pointer &response) = 0; 235 virtual int32_t GetCallPreferenceMode(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &response) = 0; 236 virtual int32_t SetUssd(int32_t slotId, const std::string str, const AppExecFwk::InnerEvent::Pointer &response) = 0; 237 virtual int32_t GetUssd(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &response) = 0; 238 virtual int32_t CloseUnFinishedUssd(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &response) = 0; 239 virtual int32_t SetMute(int32_t slotId, const int32_t mute, const AppExecFwk::InnerEvent::Pointer &response) = 0; 240 virtual int32_t GetMute(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &response) = 0; 241 virtual int32_t GetEmergencyCallList(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &response) = 0; 242 virtual int32_t SetEmergencyCallList( 243 int32_t slotId, const std::vector<EmergencyCall> &eccVec, const AppExecFwk::InnerEvent::Pointer &response) = 0; 244 virtual int32_t GetCallFailReason(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &response) = 0; 245 virtual int32_t SimOpenLogicalChannel(int32_t slotId, const std::string &appID, const int32_t p2, 246 const AppExecFwk::InnerEvent::Pointer &response) = 0; 247 virtual int32_t SimCloseLogicalChannel( 248 int32_t slotId, const int32_t channelId, const AppExecFwk::InnerEvent::Pointer &response) = 0; 249 virtual int32_t SimTransmitApduLogicalChannel( 250 int32_t slotId, const ApduSimIORequestInfo &reqInfo, const AppExecFwk::InnerEvent::Pointer &response) = 0; 251 virtual int32_t SimTransmitApduBasicChannel( 252 int32_t slotId, const ApduSimIORequestInfo &reqInfo, const AppExecFwk::InnerEvent::Pointer &response) = 0; 253 virtual int32_t SimAuthentication(int32_t slotId, const SimAuthenticationRequestInfo &reqInfo, 254 const AppExecFwk::InnerEvent::Pointer &response) = 0; 255 256 virtual int32_t SetNotificationFilter( 257 int32_t slotId, int32_t newFilter, const AppExecFwk::InnerEvent::Pointer &response) = 0; 258 virtual int32_t SetDeviceState(int32_t slotId, int32_t deviceStateType, bool deviceStateOn, 259 const AppExecFwk::InnerEvent::Pointer &response) = 0; 260 virtual int32_t SetNrOptionMode(int32_t slotId, int32_t mode, const AppExecFwk::InnerEvent::Pointer &response) = 0; 261 virtual int32_t GetNrOptionMode(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &response) = 0; 262 virtual int32_t GetRrcConnectionState(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &response) = 0; 263 }; 264 } // namespace Telephony 265 } // namespace OHOS 266 #endif // I_TEL_RIL_MANAGER_H 267