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