aboutsummaryrefslogtreecommitdiffstats
path: root/src/displayapp/screens/Notifications.cpp
diff options
context:
space:
mode:
authormark9064 <30447455+mark9064@users.noreply.github.com>2024-08-23 00:15:24 +0100
committerNeroBurner <pyro4hell@gmail.com>2024-09-21 22:45:57 +0200
commit7ca0418c82173fa1cff9537eaf1f030b5a712e9a (patch)
tree6d62fcabb5c764dff72943a08a8c7e554fcd5043 /src/displayapp/screens/Notifications.cpp
parentc3d05901a05a274f30c15b8c0640b6ecdd973ac3 (diff)
Refactor doNotGoToSleep to a wakelock counter
Diffstat (limited to 'src/displayapp/screens/Notifications.cpp')
-rw-r--r--src/displayapp/screens/Notifications.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/displayapp/screens/Notifications.cpp b/src/displayapp/screens/Notifications.cpp
index 3a3f5f2b..45f72f2e 100644
--- a/src/displayapp/screens/Notifications.cpp
+++ b/src/displayapp/screens/Notifications.cpp
@@ -20,7 +20,7 @@ Notifications::Notifications(DisplayApp* app,
notificationManager {notificationManager},
alertNotificationService {alertNotificationService},
motorController {motorController},
- systemTask {systemTask},
+ wakeLock(systemTask),
mode {mode} {
notificationManager.ClearNewNotificationFlag();
@@ -40,7 +40,7 @@ Notifications::Notifications(DisplayApp* app,
validDisplay = false;
}
if (mode == Modes::Preview) {
- systemTask.PushMessage(System::Messages::DisableSleeping);
+ wakeLock.Lock();
if (notification.category == Controllers::NotificationManager::Categories::IncomingCall) {
motorController.StartRinging();
} else {
@@ -65,7 +65,6 @@ Notifications::~Notifications() {
lv_task_del(taskRefresh);
// make sure we stop any vibrations before exiting
motorController.StopRinging();
- systemTask.PushMessage(System::Messages::EnableSleeping);
lv_obj_clean(lv_scr_act());
}
@@ -120,7 +119,7 @@ void Notifications::Refresh() {
}
void Notifications::OnPreviewInteraction() {
- systemTask.PushMessage(System::Messages::EnableSleeping);
+ wakeLock.Release();
motorController.StopRinging();
if (timeoutLine != nullptr) {
lv_obj_del(timeoutLine);