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