1 /* 2 * Copyright (c) 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 CORE_SERVICE_CLIENT_IF_SYSTEM_ABILITY_MANAGER_MOCK_H 17 #define CORE_SERVICE_CLIENT_IF_SYSTEM_ABILITY_MANAGER_MOCK_H 18 19 #include "if_system_ability_manager.h" 20 #include "gmock/gmock.h" 21 22 namespace OHOS { 23 class ISystemAbilityManagerMock : public ISystemAbilityManager { 24 public: 25 MOCK_METHOD0(AsObject, sptr<IRemoteObject>()); 26 MOCK_METHOD1(ListSystemAbilities, std::vector<std::u16string>(unsigned int dumpFlags)); 27 MOCK_METHOD1(GetSystemAbility, sptr<IRemoteObject>(int32_t systemAbilityId)); 28 MOCK_METHOD1(CheckSystemAbility, sptr<IRemoteObject>(int32_t systemAbilityId)); 29 MOCK_METHOD1(RemoveSystemAbility, int32_t(int32_t systemAbilityId)); 30 MOCK_METHOD2(SubscribeSystemAbility, int32_t(int32_t systemAbilityId, 31 const sptr<ISystemAbilityStatusChange>& listener)); 32 MOCK_METHOD2(UnSubscribeSystemAbility, int32_t(int32_t systemAbilityId, 33 const sptr<ISystemAbilityStatusChange>& listener)); 34 MOCK_METHOD2(GetSystemAbility, sptr<IRemoteObject>(int32_t systemAbilityId, const std::string& deviceId)); 35 MOCK_METHOD2(CheckSystemAbility, sptr<IRemoteObject>(int32_t systemAbilityId, const std::string& deviceId)); 36 MOCK_METHOD2(AddOnDemandSystemAbilityInfo, int32_t(int32_t systemAbilityId, 37 const std::u16string& localAbilityManagerName)); 38 MOCK_METHOD2(CheckSystemAbility, sptr<IRemoteObject>(int32_t systemAbilityId, bool& isExist)); 39 MOCK_METHOD3(AddSystemAbility, int32_t(int32_t systemAbilityId, const sptr<IRemoteObject>& ability, 40 const SAExtraProp& extraProp)); 41 MOCK_METHOD2(AddSystemProcess, int32_t(const std::u16string& procName, const sptr<IRemoteObject>& procObject)); 42 MOCK_METHOD2(LoadSystemAbility, sptr<IRemoteObject>(int32_t systemAbilityId, int32_t timeout)); 43 MOCK_METHOD2(LoadSystemAbility, int32_t(int32_t systemAbilityId, const sptr<ISystemAbilityLoadCallback>& callback)); 44 MOCK_METHOD3(LoadSystemAbility, int32_t(int32_t systemAbilityId, const std::string& deviceId, 45 const sptr<ISystemAbilityLoadCallback>& callback)); 46 MOCK_METHOD1(UnloadSystemAbility, int32_t(int32_t systemAbilityId)); 47 MOCK_METHOD1(CancelUnloadSystemAbility, int32_t(int32_t systemAbilityId)); 48 MOCK_METHOD0(UnloadAllIdleSystemAbility, int32_t()); 49 MOCK_METHOD2(GetSystemProcessInfo, int32_t(int32_t systemAbilityId, SystemProcessInfo& systemProcessInfo)); 50 MOCK_METHOD1(GetRunningSystemProcess, int32_t(std::list<SystemProcessInfo>& systemProcessInfos)); 51 MOCK_METHOD1(SubscribeSystemProcess, int32_t(const sptr<ISystemProcessStatusChange>& listener)); 52 MOCK_METHOD4(SendStrategy, int32_t(int32_t type, std::vector<int32_t>& systemAbilityIds, 53 int32_t level, std::string& action)); 54 MOCK_METHOD1(UnSubscribeSystemProcess, int32_t(const sptr<ISystemProcessStatusChange>& listener)); 55 MOCK_METHOD2(GetOnDemandReasonExtraData, int32_t(int64_t extraDataId, MessageParcel& extraDataParcel)); 56 MOCK_METHOD3(GetOnDemandPolicy, int32_t(int32_t systemAbilityId, OnDemandPolicyType type, 57 std::vector<SystemAbilityOnDemandEvent>& abilityOnDemandEvents)); 58 MOCK_METHOD3(UpdateOnDemandPolicy, int32_t(int32_t systemAbilityId, OnDemandPolicyType type, 59 const std::vector<SystemAbilityOnDemandEvent>& abilityOnDemandEvents)); 60 MOCK_METHOD1(GetOnDemandSystemAbilityIds, int32_t(std::vector<int32_t>& systemAbilityIds)); 61 MOCK_METHOD2(GetExtensionSaIds, int32_t(const std::string& extension, std::vector<int32_t> &saIds)); 62 MOCK_METHOD2(GetExtensionRunningSaList, int32_t(const std::string& extension, 63 std::vector<sptr<IRemoteObject>>& saList)); 64 MOCK_METHOD2(GetRunningSaExtensionInfoList, int32_t(const std::string& extension, 65 std::vector<SaExtensionInfo>& infoList)); 66 MOCK_METHOD3(GetCommonEventExtraDataIdlist, int32_t(int32_t systemAbilityId, 67 std::vector<int64_t>& extraDataIdList, const std::string& eventName)); 68 MOCK_METHOD1(GetLocalAbilityManagerProxy, sptr<IRemoteObject>(int32_t)); 69 }; 70 } // namespace OHOS 71 #endif // CORE_SERVICE_CLIENT_IF_SYSTEM_ABILITY_MANAGER_MOCK_H 72