1 /* 2 * Copyright (C) 2021-2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef I_BASE_PHONE_SERVICE_H 17 #define I_BASE_PHONE_SERVICE_H 18 19 #include "cell_information.h" 20 #include "dialling_numbers_info.h" 21 #include "i_network_search_callback.h" 22 #include "ims_reg_info_callback.h" 23 #include "network_search_result.h" 24 #include "network_state.h" 25 #include "nr_ssb_information.h" 26 #include "operator_config_types.h" 27 #include "signal_information.h" 28 #include "sim_state_type.h" 29 30 namespace OHOS { 31 namespace Telephony { 32 class ICoreService : public IRemoteBroker { 33 public: 34 DECLARE_INTERFACE_DESCRIPTOR(u"ohos.telephony.ICoreService"); 35 36 public: 37 virtual ~ICoreService() = default; 38 virtual int32_t GetPsRadioTech(int32_t slotId, int32_t &psRadioTech) = 0; 39 virtual int32_t GetCsRadioTech(int32_t slotId, int32_t &csRadioTech) = 0; 40 virtual std::u16string GetOperatorNumeric(int32_t slotId) = 0; 41 virtual std::string GetResidentNetworkNumeric(int32_t slotId) = 0; 42 virtual int32_t GetOperatorName(int32_t slotId, std::u16string &operatorName) = 0; 43 virtual int32_t GetSignalInfoList(int32_t slotId, std::vector<sptr<SignalInformation>> &signals) = 0; 44 virtual int32_t GetNetworkState(int32_t slotId, sptr<NetworkState> &networkState) = 0; 45 virtual int32_t SetRadioState(int32_t slotId, bool isOn, const sptr<INetworkSearchCallback> &callback) = 0; 46 virtual int32_t GetRadioState(int32_t slotId, const sptr<INetworkSearchCallback> &callback) = 0; 47 virtual int32_t GetImei(int32_t slotId, std::u16string &imei) = 0; 48 virtual int32_t GetImeiSv(int32_t slotId, std::u16string &imeiSv) = 0; 49 virtual int32_t GetMeid(int32_t slotId, std::u16string &meid) = 0; 50 virtual int32_t GetUniqueDeviceId(int32_t slotId, std::u16string &deviceId) = 0; 51 virtual bool IsNrSupported(int32_t slotId) = 0; 52 virtual int32_t SetNrOptionMode(int32_t slotId, int32_t mode, const sptr<INetworkSearchCallback> &callback) = 0; 53 virtual int32_t GetNrOptionMode(int32_t slotId, const sptr<INetworkSearchCallback> &callback) = 0; 54 virtual int32_t HasSimCard(int32_t slotId, bool &hasSimCard) = 0; 55 virtual int32_t GetSimState(int32_t slotId, SimState &simState) = 0; 56 virtual int32_t GetDsdsMode(int32_t &dsdsMode) = 0; 57 virtual int32_t GetCardType(int32_t slotId, CardType &cardType) = 0; 58 virtual int32_t UnlockPin(int32_t slotId, const std::u16string &pin, LockStatusResponse &response) = 0; 59 virtual int32_t UnlockPuk( 60 int32_t slotId, const std::u16string &newPin, const std::u16string &puk, LockStatusResponse &response) = 0; 61 virtual int32_t AlterPin( 62 int32_t slotId, const std::u16string &newPin, const std::u16string &oldPin, LockStatusResponse &response) = 0; 63 virtual int32_t UnlockPin2(int32_t slotId, const std::u16string &pin2, LockStatusResponse &response) = 0; 64 virtual int32_t UnlockPuk2( 65 int32_t slotId, const std::u16string &newPin2, const std::u16string &puk2, LockStatusResponse &response) = 0; 66 virtual int32_t AlterPin2( 67 int32_t slotId, const std::u16string &newPin2, const std::u16string &oldPin2, LockStatusResponse &response) = 0; 68 virtual int32_t SetLockState(int32_t slotId, const LockInfo &options, LockStatusResponse &response) = 0; 69 virtual int32_t GetLockState(int32_t slotId, LockType lockType, LockState &lockState) = 0; 70 virtual int32_t GetSimOperatorNumeric(int32_t slotId, std::u16string &operatorNumeric) = 0; 71 virtual int32_t GetISOCountryCodeForSim(int32_t slotId, std::u16string &countryCode) = 0; 72 virtual int32_t GetSimSpn(int32_t slotId, std::u16string &spn) = 0; 73 virtual int32_t GetSimIccId(int32_t slotId, std::u16string &iccId) = 0; 74 virtual int32_t GetIMSI(int32_t slotId, std::u16string &imsi) = 0; 75 virtual int32_t IsCTSimCard(int32_t slotId, bool &isCTSimCard) = 0; 76 virtual bool IsSimActive(int32_t slotId) = 0; 77 virtual int32_t GetSlotId(int32_t simId) = 0; 78 virtual int32_t GetSimId(int32_t slotId) = 0; 79 virtual int32_t GetNetworkSearchInformation(int32_t slotId, const sptr<INetworkSearchCallback> &callback) = 0; 80 virtual int32_t GetNetworkSelectionMode(int32_t slotId, const sptr<INetworkSearchCallback> &callback) = 0; 81 virtual std::u16string GetLocaleFromDefaultSim() = 0; 82 virtual int32_t GetSimGid1(int32_t slotId, std::u16string &gid1) = 0; 83 virtual std::u16string GetSimGid2(int32_t slotId) = 0; 84 virtual std::u16string GetSimEons(int32_t slotId, const std::string &plmn, int32_t lac, bool longNameRequired) = 0; 85 virtual int32_t SetNetworkSelectionMode(int32_t slotId, int32_t selectMode, 86 const sptr<NetworkInformation> &networkInformation, bool resumeSelection, 87 const sptr<INetworkSearchCallback> &callback) = 0; 88 virtual int32_t GetIsoCountryCodeForNetwork(int32_t slotId, std::u16string &countryCode) = 0; 89 virtual int32_t GetSimAccountInfo(int32_t slotId, IccAccountInfo &info) = 0; 90 virtual int32_t SetDefaultVoiceSlotId(int32_t slotId) = 0; 91 virtual int32_t GetDefaultVoiceSlotId() = 0; 92 virtual int32_t GetDefaultVoiceSimId(int32_t &simId) = 0; 93 virtual int32_t SetPrimarySlotId(int32_t slotId) = 0; 94 virtual int32_t GetPrimarySlotId(int32_t &slotId) = 0; 95 virtual int32_t SetShowNumber(int32_t slotId, const std::u16string &number) = 0; 96 virtual int32_t GetShowNumber(int32_t slotId, std::u16string &showNumber) = 0; 97 virtual int32_t SetShowName(int32_t slotId, const std::u16string &name) = 0; 98 virtual int32_t GetShowName(int32_t slotId, std::u16string &showName) = 0; 99 virtual int32_t GetActiveSimAccountInfoList(std::vector<IccAccountInfo> &iccAccountInfoList) = 0; 100 virtual int32_t GetOperatorConfigs(int32_t slotId, OperatorConfig &poc) = 0; 101 virtual int32_t RefreshSimState(int32_t slotId) = 0; 102 virtual int32_t SetActiveSim(int32_t slotId, int32_t enable) = 0; 103 virtual int32_t GetPreferredNetwork(int32_t slotId, const sptr<INetworkSearchCallback> &callback) = 0; 104 virtual int32_t SetPreferredNetwork( 105 int32_t slotId, int32_t networkMode, const sptr<INetworkSearchCallback> &callback) = 0; 106 virtual int32_t GetNetworkCapability( 107 int32_t slotId, int32_t networkCapabilityType, int32_t &networkCapabilityState) = 0; 108 virtual int32_t SetNetworkCapability( 109 int32_t slotId, int32_t networkCapabilityType, int32_t networkCapabilityState) = 0; 110 virtual int32_t GetSimTelephoneNumber(int32_t slotId, std::u16string &telephoneNumber) = 0; 111 virtual std::u16string GetSimTeleNumberIdentifier(const int32_t slotId) = 0; 112 virtual int32_t GetVoiceMailIdentifier(int32_t slotId, std::u16string &voiceMailIdentifier) = 0; 113 virtual int32_t GetVoiceMailNumber(int32_t slotId, std::u16string &voiceMailNumber) = 0; 114 virtual int32_t GetVoiceMailCount(int32_t slotId, int32_t &voiceMailCount) = 0; 115 virtual int32_t SetVoiceMailCount(int32_t slotId, int32_t voiceMailCount) = 0; 116 virtual int32_t SetVoiceCallForwarding(int32_t slotId, bool enable, const std::string &number) = 0; 117 virtual int32_t QueryIccDiallingNumbers( 118 int slotId, int type, std::vector<std::shared_ptr<DiallingNumbersInfo>> &result) = 0; 119 virtual int32_t AddIccDiallingNumbers( 120 int slotId, int type, const std::shared_ptr<DiallingNumbersInfo> &diallingNumber) = 0; 121 virtual int32_t DelIccDiallingNumbers( 122 int slotId, int type, const std::shared_ptr<DiallingNumbersInfo> &diallingNumber) = 0; 123 virtual int32_t UpdateIccDiallingNumbers( 124 int slotId, int type, const std::shared_ptr<DiallingNumbersInfo> &diallingNumber) = 0; 125 virtual int32_t SetVoiceMailInfo( 126 const int32_t slotId, const std::u16string &mailName, const std::u16string &mailNumber) = 0; 127 virtual int32_t GetImsRegStatus(int32_t slotId, ImsServiceType imsSrvType, ImsRegInfo &info) = 0; 128 virtual int32_t GetMaxSimCount() = 0; 129 virtual int32_t GetOpKey(int32_t slotId, std::u16string &opkey) = 0; 130 virtual int32_t GetOpKeyExt(int32_t slotId, std::u16string &opkeyExt) = 0; 131 virtual int32_t GetOpName(int32_t slotId, std::u16string &opname) = 0; 132 virtual int32_t SendEnvelopeCmd(int32_t slotId, const std::string &cmd) = 0; 133 virtual int32_t SendTerminalResponseCmd(int32_t slotId, const std::string &cmd) = 0; 134 virtual int32_t SendCallSetupRequestResult(int32_t slotId, bool accept) = 0; 135 virtual int32_t UnlockSimLock(int32_t slotId, const PersoLockInfo &lockInfo, LockStatusResponse &response) = 0; 136 virtual int32_t GetCellInfoList(int32_t slotId, std::vector<sptr<CellInformation>> &cellInfo) = 0; 137 virtual int32_t SendUpdateCellLocationRequest(int32_t slotId) = 0; 138 virtual int32_t HasOperatorPrivileges(const int32_t slotId, bool &hasOperatorPrivileges) = 0; 139 virtual int32_t SimAuthentication( 140 int32_t slotId, AuthType authType, const std::string &authData, SimAuthenticationResponse &response) = 0; 141 virtual int32_t RegisterImsRegInfoCallback( 142 int32_t slotId, ImsServiceType imsSrvType, const sptr<ImsRegInfoCallback> &callback) = 0; 143 virtual int32_t UnregisterImsRegInfoCallback(int32_t slotId, ImsServiceType imsSrvType) = 0; 144 virtual int32_t GetBasebandVersion(int32_t slotId, std::string &version) = 0; 145 virtual int32_t FactoryReset(int32_t slotId) = 0; 146 virtual int32_t GetNrSsbIdInfo(int32_t slotId, const std::shared_ptr<NrSsbInformation> &nrSsbInformation) = 0; 147 virtual int32_t InitExtraModule(int32_t slotId) = 0; 148 virtual bool IsAllowedInsertApn(std::string &value) = 0; 149 virtual int32_t GetTargetOpkey(int32_t slotId, std::u16string &opkey) = 0; 150 virtual int32_t GetOpkeyVersion(std::string &versionInfo) = 0; 151 virtual int32_t GetSimIO(int32_t slotId, int32_t command, 152 int32_t fileId, const std::string &data, const std::string &path, SimAuthenticationResponse &response) = 0; 153 154 protected: 155 const int32_t ERROR = -1; 156 const int32_t MIN_STRING_LE = 0; 157 const int32_t MAX_STRING_LE = 36; 158 const int32_t MAX_VECTOR = 100; 159 }; 160 } // namespace Telephony 161 } // namespace OHOS 162 #endif // I_BASE_PHONE_SERVICE_H 163