@@ -196,14 +196,6 @@ namespace Pinetime {
196
196
if (status != settings.notificationStatus ) {
197
197
settingsChanged = true ;
198
198
}
199
- // Disable always on screen while sleep mode is enabled
200
- if (settings.alwaysOnDisplay .enabled ) {
201
- if (status == Notification::Sleep) {
202
- settings.alwaysOnDisplay .state = false ;
203
- } else {
204
- settings.alwaysOnDisplay .state = true ;
205
- }
206
- }
207
199
settings.notificationStatus = status;
208
200
};
209
201
@@ -222,31 +214,19 @@ namespace Pinetime {
222
214
return settings.screenTimeOut ;
223
215
};
224
216
225
- void SetAlwaysOnDisplay (bool state) {
226
- if (state != settings.alwaysOnDisplay .state ) {
227
- settingsChanged = true ;
228
- }
229
- settings.alwaysOnDisplay .state = state;
230
- };
231
-
232
217
bool GetAlwaysOnDisplay () const {
233
- return settings.alwaysOnDisplay . state ;
218
+ return settings.alwaysOnDisplay && GetNotificationStatus () != Notification::Sleep ;
234
219
};
235
220
236
221
void SetAlwaysOnDisplaySetting (bool state) {
237
- if (state != settings.alwaysOnDisplay . enabled ) {
222
+ if (state != settings.alwaysOnDisplay ) {
238
223
settingsChanged = true ;
239
224
}
240
- settings.alwaysOnDisplay .enabled = state;
241
-
242
- // Don't enable always on if we are currently in notification sleep
243
- if (GetNotificationStatus () != Notification::Sleep) {
244
- SetAlwaysOnDisplay (state);
245
- }
225
+ settings.alwaysOnDisplay = state;
246
226
}
247
227
248
228
bool GetAlwaysOnDisplaySetting () const {
249
- return settings.alwaysOnDisplay . enabled ;
229
+ return settings.alwaysOnDisplay ;
250
230
}
251
231
252
232
void SetShakeThreshold (uint16_t thresh) {
@@ -323,19 +303,12 @@ namespace Pinetime {
323
303
324
304
static constexpr uint32_t settingsVersion = 0x0008 ;
325
305
326
- // To enable disabling it during notification sleep, differentiate between
327
- // the setting being on, and the setting being set by the user
328
- struct alwaysOnDisplayData {
329
- bool enabled = false ;
330
- bool state = false ;
331
- };
332
-
333
306
struct SettingsData {
334
307
uint32_t version = settingsVersion;
335
308
uint32_t stepsGoal = 10000 ;
336
309
uint32_t screenTimeOut = 15000 ;
337
310
338
- alwaysOnDisplayData alwaysOnDisplay;
311
+ bool alwaysOnDisplay = false ;
339
312
340
313
ClockType clockType = ClockType::H24;
341
314
WeatherFormat weatherFormat = WeatherFormat::Metric;
0 commit comments