1 /* 2 * Copyright (c) 2022 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 CONCURRENT_TASK_SEVICES_INCLUDE_CONCURRENT_TASK_SERVICE_ABILITY_H 17 #define CONCURRENT_TASK_SEVICES_INCLUDE_CONCURRENT_TASK_SERVICE_ABILITY_H 18 19 #include "system_ability.h" 20 #include "concurrent_task_service.h" 21 22 namespace OHOS { 23 namespace ConcurrentTask { 24 class ConcurrentTaskServiceAbility : public SystemAbility { 25 DECLARE_SYSTEM_ABILITY(ConcurrentTaskServiceAbility); 26 27 public: ConcurrentTaskServiceAbility(int32_t sysAbilityId,bool runOnCreate)28 ConcurrentTaskServiceAbility(int32_t sysAbilityId, bool runOnCreate) : SystemAbility(sysAbilityId, runOnCreate) {} 29 ~ConcurrentTaskServiceAbility() override = default; 30 31 private: 32 void OnStart() override; 33 34 void OnStop() override; 35 36 void OnAddSystemAbility(int32_t systemAbilityId, const std::string& deviceId) override; 37 38 void OnRemoveSystemAbility(int32_t systemAbilityId, const std::string& deviceId) override; 39 40 sptr<ConcurrentTaskService> service_; 41 42 DISALLOW_COPY_AND_MOVE(ConcurrentTaskServiceAbility); 43 }; 44 } // namespace ConcurrentTask 45 } // namespace OHOS 46 47 #endif // CONCURRENT_TASK_SEVICES_INCLUDE_CONCURRENT_TASK_SERVICE_ABILITY_H 48