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 CELLULAR_CALL_MODULE_SERVICE_UTILS_H 17 #define CELLULAR_CALL_MODULE_SERVICE_UTILS_H 18 19 #include "iservice_registry.h" 20 #include "singleton.h" 21 22 #include "ims_call_interface.h" 23 #include "network_state.h" 24 25 namespace OHOS { 26 namespace Telephony { 27 class ModuleServiceUtils : public std::enable_shared_from_this<ModuleServiceUtils> { 28 public: 29 /** 30 * Get Cs Radio state 31 * 32 * @param slotId 33 * @return bool 34 */ 35 bool GetRadioState(int32_t slotId); 36 37 /** 38 * Get Network State 39 * 40 * @param slotId 41 * @return Network State 42 */ 43 PhoneType GetNetworkStatus(int32_t slotId); 44 45 /** 46 * Get Iso Country Code 47 * 48 * @param slotId 49 * @return Iso Country Code 50 */ 51 std::string GetIsoCountryCode(int32_t slotId); 52 53 /** 54 * Get net work Country Code 55 * 56 * @param slotId 57 * @return Network Country Code 58 */ 59 std::string GetNetworkCountryCode(int32_t slotId); 60 61 /** 62 * Get IMS Domain Registration State 63 * 64 * @param slotId 65 * @return Whether to register 66 */ 67 bool GetImsRegistrationState(int32_t slotId); 68 69 /** 70 * Confirm IMS support UT or not 71 * 72 * @param slotId 73 * @return bool 74 */ 75 bool GetImsUtSupportState(int32_t slotId); 76 77 /** 78 * Get Satellite status 79 * 80 * @return Satellite status 81 */ 82 bool GetSatelliteStatus(); 83 84 /** 85 * Get slot info 86 * 87 * @return slot id 88 */ 89 std::vector<int32_t> GetSlotInfo(); 90 91 /** 92 * Need to call ImsService 93 * 94 * @return bool 95 */ 96 bool NeedCallImsService() const; 97 98 /** 99 * Get ImsService Remote Object 100 * 101 * @return sptr<ImsInterface> 102 */ 103 sptr<ImsCallInterface> GetImsServiceRemoteObject() const; 104 105 int32_t GetAirplaneMode(bool &airplaneModeOn); 106 107 int32_t UpdateRadioOn(int32_t slotId); 108 109 RegServiceState GetCsRegState(int32_t slotId); 110 111 RegServiceState GetPsRegState(int32_t slotId); 112 }; 113 } // namespace Telephony 114 } // namespace OHOS 115 #endif // CELLULAR_CALL_MODULE_SERVICE_UTILS_H 116