12d43be4eSopenharmony_ci/* 22d43be4eSopenharmony_ci * Copyright (C) 2024 Huawei Device Co., Ltd. 32d43be4eSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 42d43be4eSopenharmony_ci * you may not use this file except in compliance with the License. 52d43be4eSopenharmony_ci * You may obtain a copy of the License at 62d43be4eSopenharmony_ci * 72d43be4eSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 82d43be4eSopenharmony_ci * 92d43be4eSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 102d43be4eSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 112d43be4eSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 122d43be4eSopenharmony_ci * See the License for the specific language governing permissions and 132d43be4eSopenharmony_ci * limitations under the License. 142d43be4eSopenharmony_ci */ 152d43be4eSopenharmony_ci 162d43be4eSopenharmony_ci#ifndef MOCK_SIM_MANAGER_H 172d43be4eSopenharmony_ci#define MOCK_SIM_MANAGER_H 182d43be4eSopenharmony_ci 192d43be4eSopenharmony_ci#include <gtest/gtest.h> 202d43be4eSopenharmony_ci#include <gmock/gmock.h> 212d43be4eSopenharmony_ci#include "i_sim_manager.h" 222d43be4eSopenharmony_ci 232d43be4eSopenharmony_cinamespace OHOS { 242d43be4eSopenharmony_cinamespace Telephony { 252d43be4eSopenharmony_ci 262d43be4eSopenharmony_ciclass MockSimManager : public ISimManager { 272d43be4eSopenharmony_cipublic: 282d43be4eSopenharmony_ci MockSimManager() = default; 292d43be4eSopenharmony_ci virtual ~MockSimManager() = default; 302d43be4eSopenharmony_ci 312d43be4eSopenharmony_ci MOCK_METHOD0(GetDefaultVoiceSlotId, int32_t(void)); 322d43be4eSopenharmony_ci MOCK_METHOD0(GetDefaultSmsSlotId, int32_t(void)); 332d43be4eSopenharmony_ci MOCK_METHOD0(GetDefaultCellularDataSlotId, int32_t(void)); 342d43be4eSopenharmony_ci MOCK_METHOD0(IsSetPrimarySlotIdInProgress, bool(void)); 352d43be4eSopenharmony_ci MOCK_METHOD1(OnInit, bool(int32_t)); 362d43be4eSopenharmony_ci MOCK_METHOD1(InitTelExtraModule, int32_t(int32_t)); 372d43be4eSopenharmony_ci MOCK_METHOD1(RefreshSimState, int32_t(int32_t)); 382d43be4eSopenharmony_ci MOCK_METHOD1(IsSimActive, bool(int32_t)); 392d43be4eSopenharmony_ci MOCK_METHOD1(SetDefaultVoiceSlotId, int32_t(int32_t)); 402d43be4eSopenharmony_ci MOCK_METHOD1(SetDefaultSmsSlotId, int32_t(int32_t)); 412d43be4eSopenharmony_ci MOCK_METHOD1(SetDefaultCellularDataSlotId, int32_t(int32_t)); 422d43be4eSopenharmony_ci MOCK_METHOD1(SetPrimarySlotId, int32_t(int32_t)); 432d43be4eSopenharmony_ci MOCK_METHOD1(GetDefaultVoiceSimId, int32_t(int32_t &)); 442d43be4eSopenharmony_ci MOCK_METHOD1(GetDefaultSmsSimId, int32_t(int32_t &)); 452d43be4eSopenharmony_ci MOCK_METHOD1(GetDefaultCellularDataSimId, int32_t(int32_t &)); 462d43be4eSopenharmony_ci MOCK_METHOD1(GetPrimarySlotId, int32_t(int32_t &)); 472d43be4eSopenharmony_ci MOCK_METHOD1(UpdateOperatorConfigs, int32_t(int32_t)); 482d43be4eSopenharmony_ci MOCK_METHOD1(GetRadioProtocolTech, int32_t(int32_t)); 492d43be4eSopenharmony_ci MOCK_METHOD1(GetRadioProtocol, void(int32_t)); 502d43be4eSopenharmony_ci MOCK_METHOD1(GetDsdsMode, int32_t(int32_t &)); 512d43be4eSopenharmony_ci MOCK_METHOD1(SetDsdsMode, int32_t(int32_t)); 522d43be4eSopenharmony_ci MOCK_METHOD1(GetLocaleFromDefaultSim, std::u16string(int32_t)); 532d43be4eSopenharmony_ci MOCK_METHOD1(GetSlotId, int32_t(int32_t)); 542d43be4eSopenharmony_ci MOCK_METHOD1(GetSimId, int32_t(int32_t)); 552d43be4eSopenharmony_ci MOCK_METHOD1(GetSimGid2, std::u16string(int32_t)); 562d43be4eSopenharmony_ci MOCK_METHOD1(GetSimIst, std::u16string(int32_t)); 572d43be4eSopenharmony_ci MOCK_METHOD1(ObtainAllSmsOfIcc, std::vector<std::string>(int32_t)); 582d43be4eSopenharmony_ci MOCK_METHOD1(IsSetActiveSimInProgress, bool(int32_t)); 592d43be4eSopenharmony_ci MOCK_METHOD1(UnregisterSimAccountCallback, int32_t(const int32_t)); 602d43be4eSopenharmony_ci MOCK_METHOD1(GetSimTeleNumberIdentifier, std::u16string(const int32_t)); 612d43be4eSopenharmony_ci MOCK_METHOD1(SavePrimarySlotId, int32_t(int32_t)); 622d43be4eSopenharmony_ci MOCK_METHOD2(HasSimCard, int32_t(int32_t, bool &)); 632d43be4eSopenharmony_ci MOCK_METHOD2(GetSimState, int32_t(int32_t, SimState &)); 642d43be4eSopenharmony_ci MOCK_METHOD2(GetSimIccStatus, int32_t(int32_t, IccSimStatus &)); 652d43be4eSopenharmony_ci MOCK_METHOD2(GetCardType, int32_t(int32_t, CardType &)); 662d43be4eSopenharmony_ci MOCK_METHOD2(SetModemInit, int32_t(int32_t, bool)); 672d43be4eSopenharmony_ci MOCK_METHOD2(SetActiveSim, int32_t(int32_t, int32_t)); 682d43be4eSopenharmony_ci MOCK_METHOD2(GetShowNumber, int32_t(int32_t, std::u16string &)); 692d43be4eSopenharmony_ci MOCK_METHOD2(GetShowName, int32_t(int32_t, std::u16string &)); 702d43be4eSopenharmony_ci MOCK_METHOD2(GetActiveSimAccountInfoList, int32_t(bool, std::vector<IccAccountInfo> &)); 712d43be4eSopenharmony_ci MOCK_METHOD2(GetOperatorConfigs, int32_t(int, OperatorConfig &)); 722d43be4eSopenharmony_ci MOCK_METHOD2(SendCallSetupRequestResult, int32_t(int32_t, bool)); 732d43be4eSopenharmony_ci MOCK_METHOD2(GetSimOperatorNumeric, int32_t(int32_t, std::u16string &)); 742d43be4eSopenharmony_ci MOCK_METHOD2(GetISOCountryCodeForSim, int32_t(int32_t, std::u16string &)); 752d43be4eSopenharmony_ci MOCK_METHOD2(GetSimSpn, int32_t(int32_t, std::u16string &)); 762d43be4eSopenharmony_ci MOCK_METHOD2(GetSimIccId, int32_t(int32_t, std::u16string &)); 772d43be4eSopenharmony_ci MOCK_METHOD2(GetIMSI, int32_t(int32_t, std::u16string &)); 782d43be4eSopenharmony_ci MOCK_METHOD2(GetSimGid1, int32_t(int32_t, std::u16string &)); 792d43be4eSopenharmony_ci MOCK_METHOD2(GetOpName, int32_t(int32_t, std::u16string &)); 802d43be4eSopenharmony_ci MOCK_METHOD2(GetOpKey, int32_t(int32_t, std::u16string &)); 812d43be4eSopenharmony_ci MOCK_METHOD2(GetOpKeyExt, int32_t(int32_t, std::u16string &)); 822d43be4eSopenharmony_ci MOCK_METHOD2(GetSimTelephoneNumber, int32_t(int32_t, std::u16string &)); 832d43be4eSopenharmony_ci MOCK_METHOD2(GetVoiceMailIdentifier, int32_t(int32_t, std::u16string &)); 842d43be4eSopenharmony_ci MOCK_METHOD2(GetVoiceMailNumber, int32_t(int32_t, std::u16string &)); 852d43be4eSopenharmony_ci MOCK_METHOD2(GetVoiceMailCount, int32_t(int32_t, int32_t &)); 862d43be4eSopenharmony_ci MOCK_METHOD2(SetVoiceMailCount, int32_t(int32_t, int32_t)); 872d43be4eSopenharmony_ci MOCK_METHOD2(IsCTSimCard, int32_t(int32_t, bool &)); 882d43be4eSopenharmony_ci MOCK_METHOD2(DelSmsIcc, int32_t(int32_t, int)); 892d43be4eSopenharmony_ci MOCK_METHOD2(SaveImsSwitch, int32_t(int32_t, int32_t)); 902d43be4eSopenharmony_ci MOCK_METHOD2(QueryImsSwitch, int32_t(int32_t, int32_t &)); 912d43be4eSopenharmony_ci MOCK_METHOD2(SetShowNumber, int32_t(int32_t, const std::u16string &)); 922d43be4eSopenharmony_ci MOCK_METHOD2(SetShowName, int32_t(int32_t, const std::u16string &)); 932d43be4eSopenharmony_ci MOCK_METHOD2(HasOperatorPrivileges, int32_t(const int32_t, bool &)); 942d43be4eSopenharmony_ci MOCK_METHOD2(SendEnvelopeCmd, int32_t(int32_t, const std::string &)); 952d43be4eSopenharmony_ci MOCK_METHOD2(SendTerminalResponseCmd, int32_t(int32_t, const std::string &)); 962d43be4eSopenharmony_ci MOCK_METHOD2(RegisterSimAccountCallback, int32_t(const int32_t, const sptr<SimAccountCallback> &)); 972d43be4eSopenharmony_ci MOCK_METHOD3(GetLockState, int32_t(int32_t, LockType, LockState &)); 982d43be4eSopenharmony_ci MOCK_METHOD3(GetSimAccountInfo, int32_t(int32_t, bool, IccAccountInfo &)); 992d43be4eSopenharmony_ci MOCK_METHOD3(ObtainSpnCondition, int(int32_t, bool, std::string)); 1002d43be4eSopenharmony_ci MOCK_METHOD3(QueryIccDiallingNumbers, int32_t(int, int, std::vector<std::shared_ptr<DiallingNumbersInfo>> &)); 1012d43be4eSopenharmony_ci MOCK_METHOD3(UnlockPin, int32_t(int32_t, const std::string &, LockStatusResponse &)); 1022d43be4eSopenharmony_ci MOCK_METHOD3(SetLockState, int32_t(int32_t, const LockInfo &, LockStatusResponse &)); 1032d43be4eSopenharmony_ci MOCK_METHOD3(UnlockPin2, int32_t(int32_t, const std::string &, LockStatusResponse &)); 1042d43be4eSopenharmony_ci MOCK_METHOD3(UnlockSimLock, int32_t(int32_t, const PersoLockInfo &, LockStatusResponse &)); 1052d43be4eSopenharmony_ci MOCK_METHOD3(SetVoiceCallForwarding, int32_t(int32_t, bool, const std::string &)); 1062d43be4eSopenharmony_ci MOCK_METHOD3(AddIccDiallingNumbers, int32_t(int, int, const std::shared_ptr<DiallingNumbersInfo> &)); 1072d43be4eSopenharmony_ci MOCK_METHOD3(DelIccDiallingNumbers, int32_t(int, int, const std::shared_ptr<DiallingNumbersInfo> &)); 1082d43be4eSopenharmony_ci MOCK_METHOD3(UpdateIccDiallingNumbers, int32_t(int, int, const std::shared_ptr<DiallingNumbersInfo> &)); 1092d43be4eSopenharmony_ci MOCK_METHOD3(RegisterCoreNotify, void(int32_t, const HANDLE &, int)); 1102d43be4eSopenharmony_ci MOCK_METHOD3(UnRegisterCoreNotify, void(int32_t, const HANDLE &, int)); 1112d43be4eSopenharmony_ci MOCK_METHOD3(SetVoiceMailInfo, int32_t(int32_t, const std::u16string &, const std::u16string &)); 1122d43be4eSopenharmony_ci MOCK_METHOD4(AddSmsToIcc, int32_t(int32_t, int, std::string &, std::string &)); 1132d43be4eSopenharmony_ci MOCK_METHOD4(SimAuthentication, int32_t(int32_t, AuthType, const std::string &, SimAuthenticationResponse &)); 1142d43be4eSopenharmony_ci MOCK_METHOD4(GetSimEons, std::u16string(int32_t, const std::string &, int32_t, bool)); 1152d43be4eSopenharmony_ci MOCK_METHOD4(UnlockPuk, int32_t(int32_t, const std::string &, const std::string &, LockStatusResponse &)); 1162d43be4eSopenharmony_ci MOCK_METHOD4(AlterPin, int32_t(int32_t, const std::string &, const std::string &, LockStatusResponse &)); 1172d43be4eSopenharmony_ci MOCK_METHOD4(UnlockPuk2, int32_t(int32_t, const std::string &, const std::string &, LockStatusResponse &)); 1182d43be4eSopenharmony_ci MOCK_METHOD4(AlterPin2, int32_t(int32_t, const std::string &, const std::string &, LockStatusResponse &)); 1192d43be4eSopenharmony_ci MOCK_METHOD4(SendSimMatchedOperatorInfo, int32_t(int32_t, int32_t, const std::string &, const std::string &)); 1202d43be4eSopenharmony_ci MOCK_METHOD5(UpdateSmsIcc, int32_t(int32_t, int, int, std::string &, std::string &)); 1212d43be4eSopenharmony_ci MOCK_METHOD6(GetSimIO, int32_t(int32_t, int32_t, int32_t, const std::string &, const std::string &, 1222d43be4eSopenharmony_ci SimAuthenticationResponse &)); 1232d43be4eSopenharmony_ci}; 1242d43be4eSopenharmony_ci} // namespace Telephony 1252d43be4eSopenharmony_ci} // namespace OHOS 1262d43be4eSopenharmony_ci#endif // MOCK_SIM_MANAGER_H