1 /* 2 * Copyright (c) 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 ACCESS_TOKEN_LOCKSCREEN_STATUS_OBSERVER_H 17 #define ACCESS_TOKEN_LOCKSCREEN_STATUS_OBSERVER_H 18 19 #include "active_change_response_info.h" 20 #ifdef COMMON_EVENT_SERVICE_ENABLE 21 #include "common_event_manager.h" 22 #include "common_event_support.h" 23 #endif //COMMON_EVENT_SERVICE_ENABLE 24 25 namespace OHOS { 26 namespace Security { 27 namespace AccessToken { 28 29 #ifdef COMMON_EVENT_SERVICE_ENABLE 30 class LockscreenObserver : public OHOS::EventFwk::CommonEventSubscriber { 31 public: LockscreenObserver(const OHOS::EventFwk::CommonEventSubscribeInfo & info)32 LockscreenObserver(const OHOS::EventFwk::CommonEventSubscribeInfo& info) : CommonEventSubscriber(info) 33 {} 34 35 ~LockscreenObserver() override = default; 36 37 static void RegisterEvent(); 38 39 static void UnRegisterEvent(); 40 41 void OnReceiveEvent(const OHOS::EventFwk::CommonEventData& event) override; 42 }; 43 #endif //COMMON_EVENT_SERVICE_ENABLE 44 } // namespace AccessToken 45 } // namespace Security 46 } // namespace OHOS 47 #endif // ACCESS_TOKEN_LOCKSCREEN_STATUS_PBSERVER_H