Skip to content

Commit 99bd6bd

Browse files
committed
Replace Allow AOD with Enable AOD
Leaving it as "Allow AOD" assumes the user wants it the same during the day as during sleep. In my opinion the user would either want AOD on during sleep or they wouldn't.
1 parent 8d3f25d commit 99bd6bd

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

src/components/settings/Settings.h

+2-6
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace Pinetime {
1414
enum class Notification : uint8_t { On, Off, Sleep };
1515
enum class ChimesOption : uint8_t { None, Hours, HalfHours };
1616
enum class WakeUpMode : uint8_t { SingleTap = 0, DoubleTap = 1, RaiseWrist = 2, Shake = 3, LowerWrist = 4 };
17-
enum class SleepOption : uint8_t { AllowAOD = 0, AllowChimes = 1, AllowNotify = 2, DisableBle = 3 };
17+
enum class SleepOption : uint8_t { AllowChimes = 0, AllowNotify = 1, DisableBle = 2, EnableAOD = 3 };
1818
enum class Colors : uint8_t {
1919
White,
2020
Silver,
@@ -216,11 +216,7 @@ namespace Pinetime {
216216
};
217217

218218
bool GetAlwaysOnDisplay() const {
219-
if (isSleepOptionOn(Controllers::Settings::SleepOption::AllowAOD)) {
220-
return settings.alwaysOnDisplay;
221-
} else {
222-
return settings.alwaysOnDisplay && GetNotificationStatus() != Notification::Sleep;
223-
}
219+
return settings.alwaysOnDisplay && GetNotificationStatus() != Notification::Sleep;
224220
};
225221

226222
void SetAlwaysOnDisplaySetting(bool state) {

src/displayapp/screens/settings/QuickSettings.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ void QuickSettings::OnButtonEvent(lv_obj_t* object) {
151151
settingsController.SetNotificationStatus(Controllers::Settings::Notification::Off);
152152
lv_label_set_text_static(btn3_lvl, Symbols::notificationsOff);
153153
lv_obj_set_state(btn3, static_cast<lv_state_t>(ButtonState::NotificationsOff));
154-
// Turn sleep on
154+
// Turn sleep on
155155
} else if (settingsController.GetNotificationStatus() == Controllers::Settings::Notification::Off) {
156156
settingsController.SetNotificationStatus(Controllers::Settings::Notification::Sleep);
157157
lv_label_set_text_static(btn3_lvl, Symbols::sleep);
@@ -164,7 +164,7 @@ void QuickSettings::OnButtonEvent(lv_obj_t* object) {
164164
settingsController.sleepDisabledBle = true;
165165
}
166166
}
167-
// Turn notifications on
167+
// Turn notifications on
168168
} else if (settingsController.GetNotificationStatus() == Controllers::Settings::Notification::Sleep) {
169169
settingsController.SetNotificationStatus(Controllers::Settings::Notification::On);
170170
lv_label_set_text_static(btn3_lvl, Symbols::notificationsOn);

src/displayapp/screens/settings/SettingSleep.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ namespace Pinetime {
2626

2727
Controllers::Settings& settingsController;
2828
static constexpr std::array<Option, 4> options = {{
29-
{Controllers::Settings::SleepOption::AllowAOD, "Allow AOD"},
3029
{Controllers::Settings::SleepOption::AllowChimes, "Allow Chimes"},
3130
{Controllers::Settings::SleepOption::AllowNotify, "Allow Notify"},
3231
{Controllers::Settings::SleepOption::DisableBle, "Disable BLE"},
32+
{Controllers::Settings::SleepOption::EnableAOD, "Enable AOD"},
3333
}};
3434

3535
lv_obj_t* cbOption[options.size()];

src/systemtask/SystemTask.cpp

+6-2
Original file line numberDiff line numberDiff line change
@@ -419,11 +419,15 @@ void SystemTask::GoToSleep() {
419419
return;
420420
}
421421

422-
if (settingsController.GetAlwaysOnDisplay()) {
422+
if (settingsController.isSleepOptionOn(Pinetime::Controllers::Settings::SleepOption::EnableAOD) &&
423+
settingsController.GetNotificationStatus() == Pinetime::Controllers::Settings::Notification::Sleep) {
424+
NRF_LOG_INFO("[systemtask] Always On Display Enabled For Sleep");
425+
displayApp.PushMessage(Pinetime::Applications::Display::Messages::GoToAOD);
426+
} else if (settingsController.GetAlwaysOnDisplay()) {
423427
NRF_LOG_INFO("[systemtask] Going To Always On Display");
424428
displayApp.PushMessage(Pinetime::Applications::Display::Messages::GoToAOD);
425429
} else {
426-
NRF_LOG_INFO("[systemtask] Going To sleep");
430+
NRF_LOG_INFO("[systemtask] Going To Sleep");
427431
displayApp.PushMessage(Pinetime::Applications::Display::Messages::GoToSleep);
428432
}
429433
heartRateApp.PushMessage(Pinetime::Applications::HeartRateTask::Messages::GoToSleep);

0 commit comments

Comments
 (0)