1 /* 2 * Copyright (C) 2021 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_NETWORK_SEARCH_H 17 #define I_NETWORK_SEARCH_H 18 19 #include <vector> 20 #include "event_handler.h" 21 #include "network_search_result.h" 22 #include "network_state.h" 23 #include "signal_information.h" 24 #include "i_network_search_callback.h" 25 #include "network_search_callback_base.h" 26 #include "cell_information.h" 27 #include "cell_location.h" 28 29 namespace OHOS { 30 namespace Telephony { 31 class INetworkSearch { 32 public: 33 using HANDLE = const std::shared_ptr<AppExecFwk::EventHandler>; 34 using NSCALLBACK = const sptr<INetworkSearchCallback>; 35 virtual bool OnInit() = 0; 36 virtual int32_t GetPsRadioTech(int32_t slotId) = 0; 37 virtual int32_t GetCsRadioTech(int32_t slotId) = 0; 38 virtual std::u16string GetOperatorNumeric(int32_t slotId) = 0; 39 virtual std::u16string GetOperatorName(int32_t slotId) = 0; 40 virtual sptr<NetworkState> GetNetworkStatus(int32_t slotId) = 0; 41 virtual int32_t GetRadioState(int32_t slotId) = 0; 42 virtual bool GetRadioState(int32_t slotId, NSCALLBACK &callback) = 0; 43 /** 44 * Set radio state 45 * 27007-410_2001 8.2 Set phone functionality +CFUN 46 * 3GPP TS 27.007 V4.1.0 (2001-03) 47 */ 48 virtual void SetRadioState(int32_t slotId, bool isOn, int32_t rst) = 0; 49 virtual bool SetRadioState(int32_t slotId, bool isOn, int32_t rst, NSCALLBACK &callback) = 0; 50 virtual std::vector<sptr<SignalInformation>> GetSignalInfoList(int32_t slotId) = 0; 51 virtual void RegisterCoreNotify(int32_t slotId, HANDLE &handler, int32_t what) = 0; 52 virtual void UnRegisterCoreNotify(int32_t slotId, HANDLE &handler, int32_t what) = 0; 53 virtual void RegisterCellularDataObject(const sptr<NetworkSearchCallBackBase> &callback) = 0; 54 virtual void UnRegisterCellularDataObject(const sptr<NetworkSearchCallBackBase> &callback) = 0; 55 virtual void RegisterCellularCallObject(const sptr<NetworkSearchCallBackBase> &callback) = 0; 56 virtual void UnRegisterCellularCallObject(const sptr<NetworkSearchCallBackBase> &callback) = 0; 57 virtual bool GetNetworkSearchInformation(int32_t slotId, NSCALLBACK &callback) = 0; 58 virtual bool GetNetworkSelectionMode(int32_t slotId, NSCALLBACK &callback) = 0; 59 virtual bool SetNetworkSelectionMode(int32_t slotId, int32_t selectMode, 60 const sptr<NetworkInformation> &networkInformation, bool resumeSelection, NSCALLBACK &callback) = 0; 61 virtual std::u16string GetIsoCountryCodeForNetwork(int32_t slotId) = 0; 62 virtual bool GetPreferredNetwork(int32_t slotId, NSCALLBACK &callback) = 0; 63 virtual bool SetPreferredNetwork(int32_t slotId, int32_t networkMode, NSCALLBACK &callback) = 0; 64 virtual int32_t GetPsRegState(int32_t slotId) = 0; 65 virtual int32_t GetCsRegState(int32_t slotId) = 0; 66 virtual int32_t GetPsRoamingState(int32_t slotId) = 0; 67 virtual std::u16string GetImei(int32_t slotId) = 0; 68 virtual bool GetImsRegStatus(int32_t slotId) = 0; 69 virtual std::vector<sptr<CellInformation>> GetCellInfoList(int32_t slotId) = 0; 70 virtual bool SendUpdateCellLocationRequest(int32_t slotId) = 0; 71 virtual sptr<CellLocation> GetCellLocation(int32_t slotId) = 0; 72 virtual std::u16string GetMeid(int32_t slotId) = 0; 73 virtual std::u16string GetUniqueDeviceId(int32_t slotId) = 0; 74 virtual PhoneType GetPhoneType(int32_t slotId) = 0; 75 virtual NrMode GetNrOptionMode(int32_t slotId) = 0; 76 virtual FrequencyType GetFrequencyType(int32_t slotId) = 0; 77 virtual NrState GetNrState(int32_t slotId) = 0; 78 /** 79 * @brief support Nr network or not 80 * 81 * @return true support 82 * @return false not support 83 */ 84 virtual bool IsNrSupported(int32_t slotId) = 0; 85 virtual void DcPhysicalLinkActiveUpdate(int32_t slotId, bool isActive) = 0; 86 }; 87 } // namespace Telephony 88 } // namespace OHOS 89 #endif // I_NETWORK_SEARCH_H 90