• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 RESSCHED_EXECUTOR_SERVICES_RESSCHEDEXESERVICE_INCLUDE_RES_SCHED_EXE_SERVICE_ABILITY_H
17 #define RESSCHED_EXECUTOR_SERVICES_RESSCHEDEXESERVICE_INCLUDE_RES_SCHED_EXE_SERVICE_ABILITY_H
18 
19 #include "singleton.h"
20 #include "system_ability.h"
21 
22 #include "res_sched_exe_service.h"
23 
24 namespace OHOS {
25 namespace ResourceSchedule {
26 class ResSchedExeServiceAbility : public SystemAbility,
27     public std::enable_shared_from_this<ResSchedExeServiceAbility> {
28     DECLARE_SYSTEM_ABILITY(ResSchedExeServiceAbility);
29     DECLARE_DELAYED_SINGLETON(ResSchedExeServiceAbility);
30 
31 public:
32     /**
33      * @brief Construct a new ResSchedExeServiceAbilityResSchedExeServiceAbility object.
34      *
35      * @param sysAbilityId SA id
36      * @param runOnCreate register sa to samgr time, process start or used
37      */
ResSchedExeServiceAbility(int32_t sysAbilityId,bool runOnCreate)38     ResSchedExeServiceAbility(int32_t sysAbilityId, bool runOnCreate) : SystemAbility(sysAbilityId, runOnCreate) {}
39 
40 private:
41     void OnStart() override;
42     void OnStop() override;
43 
44     sptr<ResSchedExeService> service_;
45     DISALLOW_COPY_AND_MOVE(ResSchedExeServiceAbility);
46 };
47 } // namespace ResourceSchedule
48 } // namespace OHOS
49 
50 #endif // RESSCHED_EXECUTOR_SERVICES_RESSCHEDEXESERVICE_INCLUDE_RES_SCHED_EXE_SERVICE_ABILITY_H
51