// Copyright (c) 2017-2024, Mudita Sp. z.o.o. All rights reserved. // For licensing, see https://github.com/mudita/MuditaOS/blob/master/LICENSE.md #include "NotificationsConfiguration.hpp" #include #include using namespace notifications; NotificationsConfiguration::NotificationsConfiguration(std::shared_ptr phoneModeObserver, std::shared_ptr settings, const locks::PhoneLockHandler &phoneLockHandler) : phoneModeObserver{std::move(phoneModeObserver)}, settings{std::move(settings)}, phoneLockHandler{phoneLockHandler} {} void NotificationsConfiguration::updateCurrentCall(CallNotificationPolicy &policy) { policy.updateCurrentCall(phoneModeObserver->getCurrentPhoneMode()); } void NotificationsConfiguration::updateCurrentList(NotificationsListPolicy &policy) { policy.updateCurrentList(phoneModeObserver->getCurrentPhoneMode(), phoneLockHandler.isPhoneLocked(), getDNDNotificationsOnLockedScreen()); } void NotificationsConfiguration::updateCurrentSMS(SMSNotificationPolicy &policy) { policy.updateCurrentSMS(phoneModeObserver->getCurrentPhoneMode()); } auto NotificationsConfiguration::getDNDNotificationsOnLockedScreen() const noexcept -> bool { return utils::getNumericValue( settings->getValue(settings::Offline::notificationsWhenLocked, settings::SettingsScope::Global)); }