mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-01-04 20:08:32 -05:00
* Added notification showing on the main screen if the battery has reached too high temperature to continue charging. * Code cleanups.
38 lines
1.6 KiB
C++
38 lines
1.6 KiB
C++
// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
|
|
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
|
|
|
|
#include "NotificationsConfiguration.hpp"
|
|
#include <Utils.hpp>
|
|
#include <service-db/agents/settings/SystemSettings.hpp>
|
|
|
|
using namespace notifications;
|
|
|
|
NotificationsConfiguration::NotificationsConfiguration(std::shared_ptr<sys::phone_modes::Observer> phoneModeObserver,
|
|
std::shared_ptr<settings::Settings> 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<bool>(
|
|
settings->getValue(settings::Offline::notificationsWhenLocked, settings::SettingsScope::Global));
|
|
}
|