14f7ff21fSopenharmony_ci/* 24f7ff21fSopenharmony_ci * Copyright (c) 2023 Huawei Device Co., Ltd. 34f7ff21fSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 44f7ff21fSopenharmony_ci * you may not use this file except in compliance with the License. 54f7ff21fSopenharmony_ci * You may obtain a copy of the License at 64f7ff21fSopenharmony_ci * 74f7ff21fSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 84f7ff21fSopenharmony_ci * 94f7ff21fSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 104f7ff21fSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 114f7ff21fSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 124f7ff21fSopenharmony_ci * See the License for the specific language governing permissions and 134f7ff21fSopenharmony_ci * limitations under the License. 144f7ff21fSopenharmony_ci */ 154f7ff21fSopenharmony_ci 164f7ff21fSopenharmony_ci#ifndef SERVICE_EX_MANAGER 174f7ff21fSopenharmony_ci#define SERVICE_EX_MANAGER 184f7ff21fSopenharmony_ci 194f7ff21fSopenharmony_ci#include <mutex> 204f7ff21fSopenharmony_ci 214f7ff21fSopenharmony_ci#include "timer.h" 224f7ff21fSopenharmony_ci 234f7ff21fSopenharmony_ci#include "isensor_illumination_task.h" 244f7ff21fSopenharmony_ci 254f7ff21fSopenharmony_cinamespace OHOS { 264f7ff21fSopenharmony_cinamespace UserIam { 274f7ff21fSopenharmony_cinamespace FingerprintAuth { 284f7ff21fSopenharmony_ciclass ServiceExManager { 294f7ff21fSopenharmony_cipublic: 304f7ff21fSopenharmony_ci static ServiceExManager &GetInstance(); 314f7ff21fSopenharmony_ci 324f7ff21fSopenharmony_ci UserAuth::ResultCode Acquire(); 334f7ff21fSopenharmony_ci void Release(); 344f7ff21fSopenharmony_ci void DoClose(); 354f7ff21fSopenharmony_ci std::shared_ptr<ISensorIlluminationTask> GetSensorIlluminationTask(); 364f7ff21fSopenharmony_ci 374f7ff21fSopenharmony_ciprivate: 384f7ff21fSopenharmony_ci ServiceExManager() = default; 394f7ff21fSopenharmony_ci ~ServiceExManager() = default; 404f7ff21fSopenharmony_ci 414f7ff21fSopenharmony_ci void *handle_; 424f7ff21fSopenharmony_ci bool isOpened_ = false; 434f7ff21fSopenharmony_ci std::recursive_mutex recursiveMutex_; 444f7ff21fSopenharmony_ci}; 454f7ff21fSopenharmony_ci} // namespace FingerprintAuth 464f7ff21fSopenharmony_ci} // namespace UserIam 474f7ff21fSopenharmony_ci} // namespace OHOS 484f7ff21fSopenharmony_ci 494f7ff21fSopenharmony_ci#endif // SERVICE_EX_MANAGER