DisplayApp: Go to clock on sleep if no app loaded

When turning off the screen, if there is no actual app loaded (i.e. we
are still in the Launcher, Notifications, QuickSettings, or Settings
screens) we should just reload the Clock app directly.
This commit is contained in:
Victor Kareh 2024-01-18 16:08:49 -05:00
parent 3a0d673df4
commit 1d0df29b2c

View file

@ -303,6 +303,11 @@ void DisplayApp::Refresh() {
} else {
brightnessController.Set(Controllers::BrightnessController::Levels::Off);
lcd.Sleep();
// Since the active screen is not really an app, go back to Clock.
if (currentApp == Apps::Launcher || currentApp == Apps::Notifications || currentApp == Apps::QuickSettings ||
currentApp == Apps::Settings) {
LoadScreen(Apps::Clock, DisplayApp::FullRefreshDirections::None);
}
}
PushMessageToSystemTask(Pinetime::System::Messages::OnDisplayTaskSleeping);
state = States::Idle;