1 /* 2 * Copyright (c) 2022-2023 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 CO_AUTH_SERVICE_H 17 #define CO_AUTH_SERVICE_H 18 19 #include "co_auth_stub.h" 20 21 #include <system_ability.h> 22 #include <system_ability_definition.h> 23 24 namespace OHOS { 25 namespace UserIam { 26 namespace UserAuth { 27 class CoAuthService : public SystemAbility, public CoAuthStub { 28 public: 29 static constexpr uint64_t DEFER_TIME = 2000; 30 DECLARE_SYSTEM_ABILITY(CoAuthService); 31 explicit CoAuthService(int32_t systemAbilityId, bool runOnCreate = false); 32 ~CoAuthService() override = default; 33 int Dump(int fd, const std::vector<std::u16string> &args) override; 34 uint64_t ExecutorRegister(const ExecutorRegisterInfo &info, sptr<ExecutorCallbackInterface> &callback) override; 35 36 protected: 37 void OnStart() override; 38 void OnStop() override; 39 40 private: 41 static void Init(); 42 }; 43 } // namespace UserAuth 44 } // namespace UserIam 45 } // namespace OHOS 46 #endif // CO_AUTH_SERVICE_H