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