~aleteoryx/muditaos

ref: bf3cc2f23c293b686170a8d36b9894cfd03d378c muditaos/module-apps/apps-common/notifications/NotificationsHandler.hpp -rw-r--r-- 983 bytes
bf3cc2f2 — Wojtek Rzepecki [EGD-6955] Add calls notifications in DND 4 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once

#include "NotificationsConfiguration.hpp"
#include "policies/CallNotificationPolicy.hpp"
#include <PhoneModes/Observer.hpp>
#include <Service/Service.hpp>
#include <PhoneNumber.hpp>

namespace notifications
{
    class NotificationsHandler
    {
      public:
        NotificationsHandler(sys::Service *parentService, NotificationsConfiguration &notifcationConfig);
        void registerMessageHandlers();

      private:
        void policyNumberCheck(const utils::PhoneNumber::View &number);
        void playbackCallRingtone();
        void incomingCallHandler(sys::Message *request);
        void callerIdHandler(sys::Message *request);

        sys::Service *parentService = nullptr;
        NotificationsConfiguration &notifcationConfig;
        CallNotificationPolicy currentCallPolicy;
    };
} // namespace notifications