22#include " displayapp/DisplayApp.h"
33#include " components/ble/MusicService.h"
44#include " components/ble/AlertNotificationService.h"
5+ #include " components/brightness/BrightnessController.h"
6+ #include " components/motion/MotionController.h"
57#include " displayapp/screens/Symbols.h"
68#include < algorithm>
79#include " displayapp/InfiniTimeTheme.h"
@@ -14,12 +16,16 @@ Notifications::Notifications(DisplayApp* app,
1416 Pinetime::Controllers::NotificationManager& notificationManager,
1517 Pinetime::Controllers::AlertNotificationService& alertNotificationService,
1618 Pinetime::Controllers::MotorController& motorController,
19+ Pinetime::Controllers::BrightnessController& brightnessController,
20+ Pinetime::Controllers::MotionController& motionController,
1721 System::SystemTask& systemTask,
1822 Modes mode)
1923 : app {app},
2024 notificationManager {notificationManager},
2125 alertNotificationService {alertNotificationService},
2226 motorController {motorController},
27+ brightnessController {brightnessController},
28+ motionController {motionController},
2329 wakeLock (systemTask),
2430 mode {mode} {
2531
@@ -58,6 +64,10 @@ Notifications::Notifications(DisplayApp* app,
5864 interacted = false ;
5965 }
6066
67+ previousBrightnessLevel = brightnessController.Level ();
68+ if (motionController.Locomotion ()) {
69+ brightnessController.Set (Pinetime::Controllers::BrightnessController::Levels::High);
70+ }
6171 taskRefresh = lv_task_create (RefreshTaskCallback, LV_DISP_DEF_REFR_PERIOD , LV_TASK_PRIO_MID , this );
6272}
6373
@@ -66,6 +76,7 @@ Notifications::~Notifications() {
6676 // make sure we stop any vibrations before exiting
6777 motorController.StopRinging ();
6878 lv_obj_clean (lv_scr_act ());
79+ brightnessController.Set (previousBrightnessLevel);
6980}
7081
7182void Notifications::Refresh () {
0 commit comments