1 /* 2 * Copyright (c) 2023-2024 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 TELEPHONY_EXT_WRAPPER_H 17 #define TELEPHONY_EXT_WRAPPER_H 18 19 #include "nocopyable.h" 20 #include "singleton.h" 21 #include "network_state.h" 22 #include "network_search_types.h" 23 #include "network_search_result.h" 24 #include "signal_information.h" 25 #include "network_state.h" 26 #include "cell_information.h" 27 28 namespace OHOS { 29 namespace Telephony { 30 class TelephonyExtWrapper final { 31 DECLARE_DELAYED_REF_SINGLETON(TelephonyExtWrapper); 32 33 public: 34 DISALLOW_COPY_AND_MOVE(TelephonyExtWrapper); 35 void InitTelephonyExtWrapper(); 36 37 typedef bool (*CHECK_OPC_VERSION_IS_UPDATE)(void); 38 typedef void (*UPDATE_OPC_VERSION)(void); 39 typedef char* (*GET_VOICE_MAIL_ICCID_PARAMETER)(int32_t, const char*); 40 typedef void (*SET_VOICE_MAIL_ICCID_PARAMETER)(int32_t, const char*, const char*); 41 typedef void (*INIT_VOICE_MAIL_MANAGER_EXT)(int32_t); 42 typedef void (*DEINIT_VOICE_MAIL_MANAGER_EXT)(int32_t); 43 typedef void (*RESET_VOICE_MAIL_LOADED_FLAG_EXT)(int32_t); 44 typedef void (*SET_VOICE_MAIL_ON_SIM_EXT)(int32_t, const char*, const char*); 45 typedef bool (*GET_VOICE_MAIL_FIXED_EXT)(int32_t, const char*); 46 typedef char* (*GET_VOICE_MAIL_NUMBER_EXT)(int32_t, const char*); 47 typedef char* (*GET_VOICE_MAIL_TAG_EXT)(int32_t, const char*); 48 typedef void (*RESET_VOICE_MAIL_MANAGER_EXT)(int32_t); 49 typedef void (*GET_NETWORK_STATUS_EXT)(int32_t slotId, sptr<OHOS::Telephony::NetworkState> &networkState); 50 51 typedef int32_t (*GET_CELL_INFO_LIST)(int32_t slotId, std::vector<sptr<OHOS::Telephony::CellInformation>> &cells); 52 typedef void (*GET_RADIO_TECH_EXT)(int32_t slotId, int32_t &domainRadioTech); 53 typedef void (*GET_NR_OPTION_MODE_EXT)(int32_t slotId, int32_t &mode); 54 typedef void (*GET_NR_OPTION_MODE_EXTEND)(int32_t slotId, OHOS::Telephony::NrMode &mode); 55 typedef void (*GET_PREFERRED_NETWORK_EXT)(int32_t &preferredNetworkType); 56 typedef bool (*IS_NR_SUPPORTED_NATIVE)(int32_t modemRaf); 57 typedef void (*GET_SIGNAL_INFO_LIST_EXT)(int32_t slotId, 58 std::vector<sptr<OHOS::Telephony::SignalInformation>> &signals); 59 typedef void (*GET_NETWORK_CAPABILITY_EXT)(int32_t slotId, int32_t networkCapabilityType, 60 int32_t &networkCapabilityState); 61 typedef void (*ON_GET_NETWORK_SEARCH_INFORMATION_EXT)(int32_t &availableSize, 62 std::vector<OHOS::Telephony::NetworkInformation> &networkInformations); 63 64 typedef void (*UPDATE_COUNTRY_CODE_EXT)(int32_t, const char *); 65 typedef void (*UPDATE_TIME_ZONE_OFFSET_EXT)(int32_t, int32_t); 66 67 CHECK_OPC_VERSION_IS_UPDATE checkOpcVersionIsUpdate_ = nullptr; 68 UPDATE_OPC_VERSION updateOpcVersion_ = nullptr; 69 GET_VOICE_MAIL_ICCID_PARAMETER getVoiceMailIccidParameter_ = nullptr; 70 SET_VOICE_MAIL_ICCID_PARAMETER setVoiceMailIccidParameter_ = nullptr; 71 INIT_VOICE_MAIL_MANAGER_EXT initVoiceMailManagerExt_ = nullptr; 72 DEINIT_VOICE_MAIL_MANAGER_EXT deinitVoiceMailManagerExt_ = nullptr; 73 RESET_VOICE_MAIL_LOADED_FLAG_EXT resetVoiceMailLoadedFlagExt_ = nullptr; 74 SET_VOICE_MAIL_ON_SIM_EXT setVoiceMailOnSimExt_ = nullptr; 75 GET_VOICE_MAIL_FIXED_EXT getVoiceMailFixedExt_ = nullptr; 76 GET_VOICE_MAIL_NUMBER_EXT getVoiceMailNumberExt_ = nullptr; 77 GET_VOICE_MAIL_TAG_EXT getVoiceMailTagExt_ = nullptr; 78 RESET_VOICE_MAIL_MANAGER_EXT resetVoiceMailManagerExt_ = nullptr; 79 GET_NETWORK_STATUS_EXT getNetworkStatusExt_ = nullptr; 80 81 GET_CELL_INFO_LIST getCellInfoList_ = nullptr; 82 GET_RADIO_TECH_EXT getRadioTechExt_ = nullptr; 83 GET_NR_OPTION_MODE_EXT getNrOptionModeExt_ = nullptr; 84 GET_NR_OPTION_MODE_EXTEND getNrOptionModeExtend_ = nullptr; 85 GET_PREFERRED_NETWORK_EXT getPreferredNetworkExt_ = nullptr; 86 IS_NR_SUPPORTED_NATIVE isNrSupportedNative_ = nullptr; 87 GET_SIGNAL_INFO_LIST_EXT getSignalInfoListExt_ = nullptr; 88 GET_NETWORK_CAPABILITY_EXT getNetworkCapabilityExt_ = nullptr; 89 ON_GET_NETWORK_SEARCH_INFORMATION_EXT onGetNetworkSearchInformationExt_ = nullptr; 90 91 UPDATE_COUNTRY_CODE_EXT updateCountryCodeExt_ = nullptr; 92 UPDATE_TIME_ZONE_OFFSET_EXT updateTimeZoneOffsetExt_ = nullptr; 93 94 private: 95 void* telephonyExtWrapperHandle_ = nullptr; 96 void InitTelephonyExtWrapperForNetWork(); 97 void InitTelephonyExtWrapperForVoiceMail(); 98 }; 99 100 #define TELEPHONY_EXT_WRAPPER ::OHOS::DelayedRefSingleton<TelephonyExtWrapper>::GetInstance() 101 } // namespace Telephony 102 } // namespace OHOS 103 #endif // TELEPHONY_EXT_WRAPPER_H 104