• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2024-2025 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 #ifndef BASE_NOTIFICATION_DISTRIBUTED_NOTIFICATION_SERVICE_SERVICES_ANS_INCLUDE_REMINDER_SWING_DECISION_CENTER_H
16 #define BASE_NOTIFICATION_DISTRIBUTED_NOTIFICATION_SERVICE_SERVICES_ANS_INCLUDE_REMINDER_SWING_DECISION_CENTER_H
17 #ifdef NOTIFICATION_SMART_REMINDER_SUPPORTED
18 
19 #include <functional>
20 
21 #include "refbase.h"
22 #include "singleton.h"
23 
24 #include "ans_log_wrapper.h"
25 #include "ans_inner_errors.h"
26 #include "swing_call_back_proxy.h"
27 
28 namespace OHOS {
29 namespace Notification {
30 using namespace std;
31 class ReminderSwingDecisionCenter {
32 public:
33     ReminderSwingDecisionCenter();
34     ~ReminderSwingDecisionCenter();
35     static ReminderSwingDecisionCenter &GetInstance();
36     static sptr<ISwingCallBack> swingCallback_;
37     void ResetSwingCallbackProxy();
38     ErrCode RegisterSwingCallback(const sptr<IRemoteObject> &swingCallback);
39 
40 private:
41     static mutex swingMutex_;
42     sptr<IRemoteObject::DeathRecipient> swingRecipient_ = nullptr;
43 };
44 
45 class SwingCallbackRecipient : public IRemoteObject::DeathRecipient {
46 public:
47     SwingCallbackRecipient();
48     virtual ~SwingCallbackRecipient();
49     void OnRemoteDied(const wptr<IRemoteObject> &remote);
50 };
51 }
52 }
53 #endif
54 #endif