1 /* 2 * Copyright (c) 2021 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 IF_LOCAL_ABILITY_MANAGER_H 17 #define IF_LOCAL_ABILITY_MANAGER_H 18 19 #include <string> 20 #include <unordered_map> 21 #include "iremote_broker.h" 22 #include "iremote_object.h" 23 #include "iremote_stub.h" 24 #include "iremote_proxy.h" 25 #include "nlohmann/json.hpp" 26 #include "safwk_ipc_interface_code.h" 27 28 namespace OHOS { 29 class ILocalAbilityManager : public IRemoteBroker { 30 public: 31 virtual bool StartAbility(int32_t systemAbilityId, const std::string& eventStr) = 0; 32 virtual bool StopAbility(int32_t systemAbilityId, const std::string& eventStr) = 0; 33 virtual bool ActiveAbility(int32_t systemAbilityId, 34 const nlohmann::json& activeReason) = 0; 35 virtual bool IdleAbility(int32_t systemAbilityId, 36 const nlohmann::json& idleReason, int32_t& delayTime) = 0; 37 virtual bool SendStrategyToSA(int32_t type, int32_t systemAbilityId, int32_t level, std::string& action) = 0; 38 DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.ILocalAbilityManager"); 39 protected: 40 static inline const std::u16string LOCAL_ABILITY_MANAGER_INTERFACE_TOKEN = u"ohos.localabilitymanager.accessToken"; 41 }; 42 } 43 #endif // !defined(IF_LOCAL_ABILITY_MANAGER_H) 44