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 EL5_FILEKEY_MANAGER_SERVICE_ABILITY_H
17 #define EL5_FILEKEY_MANAGER_SERVICE_ABILITY_H
18 
19 #include "el5_filekey_manager_log.h"
20 #include "el5_filekey_manager_service.h"
21 #include "system_ability.h"
22 
23 namespace OHOS {
24 namespace Security {
25 namespace AccessToken {
26 class El5FilekeyManagerServiceAbility final : public SystemAbility {
27 public:
28     /**
29      * @brief The constructor of the el5 filekey manager service ability.
30      * @param systemAbilityId Indicates the system ability id.
31      * @param runOnCreate Run the system ability on created.
32      */
33     El5FilekeyManagerServiceAbility(int32_t systemAbilityId, bool runOnCreate);
34 
35     /**
36      * @brief The destructor.
37      */
38     virtual ~El5FilekeyManagerServiceAbility() final;
39 
40 private:
41     void OnStart(const SystemAbilityOnDemandReason &startReason) final;
42     void OnStop() final;
43 
44     DISALLOW_COPY_AND_MOVE(El5FilekeyManagerServiceAbility);
45     DECLARE_SYSTEM_ABILITY(El5FilekeyManagerServiceAbility);
46 
47 private:
48     std::shared_ptr<El5FilekeyManagerService> service_;
49 };
50 }  // namespace AccessToken
51 }  // namespace Security
52 }  // namespace OHOS
53 #endif // EL5_FILEKEY_MANAGER_SERVICE_ABILITY_H
54