InfiniTime.git

commit 947c4f5067615fea540e2859c0c0127f2a3ce495

Author: mark9064 <30447455+mark9064@users.noreply.github.com>

aod: fix brightness getting stuck high

 src/displayapp/DisplayApp.cpp | 6 +++---
 src/displayapp/Messages.h | 2 +-
 src/systemtask/SystemTask.cpp | 10 +++++-----


diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp
index 1a579cb1c7fa841ae833a09c1fc35997e7b3d74e..6fda99db51b631ef0651ffe348da11d937fb30cf 100644
--- a/src/displayapp/DisplayApp.cpp
+++ b/src/displayapp/DisplayApp.cpp
@@ -238,9 +238,6 @@     switch (msg) {
       case Messages::DimScreen:
         DimScreen();
         break;
-      case Messages::RestoreBrightness:
-        RestoreBrightness();
-        break;
       case Messages::GoToSleep:
         while (brightnessController.Level() != Controllers::BrightnessController::Levels::Low) {
           brightnessController.Lower();
@@ -256,6 +253,9 @@           lcd.Sleep();
         }
         PushMessageToSystemTask(Pinetime::System::Messages::OnDisplayTaskSleeping);
         state = States::Idle;
+        break;
+      case Messages::NotifyDeviceActivity:
+        lv_disp_trig_activity(nullptr);
         break;
       case Messages::GoToRunning:
         if (settingsController.GetAlwaysOnDisplay()) {




diff --git a/src/displayapp/Messages.h b/src/displayapp/Messages.h
index dada30888d22ca05819bfa3269ab25e57ef00f2a..1418f6bea0e998b90cc0d16022baba7b76d2f3ba 100644
--- a/src/displayapp/Messages.h
+++ b/src/displayapp/Messages.h
@@ -18,7 +18,7 @@         NewNotification,
         TimerDone,
         BleFirmwareUpdateStarted,
         DimScreen,
-        RestoreBrightness,
+        NotifyDeviceActivity,
         ShowPairingKey,
         AlarmTriggered,
         Chime,




diff --git a/src/systemtask/SystemTask.cpp b/src/systemtask/SystemTask.cpp
index 5bd71c389d3ad879486ac1efc6aa3ffcb1d7b868..211e19ec8133aa192c3a855123bf3c11478b10a5 100644
--- a/src/systemtask/SystemTask.cpp
+++ b/src/systemtask/SystemTask.cpp
@@ -194,7 +194,7 @@           // if the exiting was caused by a firmware update
           if (!bleController.IsFirmwareUpdating()) {
             doNotGoToSleep = false;
           }
-          displayApp.PushMessage(Pinetime::Applications::Display::Messages::RestoreBrightness);
+          displayApp.PushMessage(Pinetime::Applications::Display::Messages::NotifyDeviceActivity);
           break;
         case Messages::DisableSleeping:
           doNotGoToSleep = true;
@@ -245,7 +245,7 @@           displayApp.PushMessage(Pinetime::Applications::Display::Messages::GoToSleep);
           heartRateApp.PushMessage(Pinetime::Applications::HeartRateTask::Messages::GoToSleep);
           break;
         case Messages::OnNewTime:
-          displayApp.PushMessage(Pinetime::Applications::Display::Messages::RestoreBrightness);
+          displayApp.PushMessage(Pinetime::Applications::Display::Messages::NotifyDeviceActivity);
           displayApp.PushMessage(Pinetime::Applications::Display::Messages::UpdateDateTime);
           if (alarmController.State() == Controllers::AlarmController::AlarmState::Set) {
             alarmController.ScheduleAlarm();
@@ -256,7 +256,7 @@           if (settingsController.GetNotificationStatus() == Pinetime::Controllers::Settings::Notification::On) {
             if (state == SystemTaskState::Sleeping) {
               GoToRunning();
             } else {
-              displayApp.PushMessage(Pinetime::Applications::Display::Messages::RestoreBrightness);
+              displayApp.PushMessage(Pinetime::Applications::Display::Messages::NotifyDeviceActivity);
             }
             displayApp.PushMessage(Pinetime::Applications::Display::Messages::NewNotification);
           }
@@ -268,7 +268,7 @@           }
           displayApp.PushMessage(Pinetime::Applications::Display::Messages::AlarmTriggered);
           break;
         case Messages::BleConnected:
-          displayApp.PushMessage(Pinetime::Applications::Display::Messages::RestoreBrightness);
+          displayApp.PushMessage(Pinetime::Applications::Display::Messages::NotifyDeviceActivity);
           isBleDiscoveryTimerRunning = true;
           bleDiscoveryTimer = 5;
           break;
@@ -466,7 +466,7 @@   if (IsSleeping()) {
     return;
   }
 
-  displayApp.PushMessage(Pinetime::Applications::Display::Messages::RestoreBrightness);
+  displayApp.PushMessage(Pinetime::Applications::Display::Messages::NotifyDeviceActivity);
 
   using Actions = Controllers::ButtonActions;