~aleteoryx/muditaos

a2cef32dc4d0dd498b76a5ff244b4e3a52eeda06 — Lukasz Mastalerz 2 years ago 1984c7f pure_1.7.1-rc.1
[BH-1532] Changing alarm's trigger time when alarm is snoozed causes several problems

Fixed alarm problems when it was re-set while snooze was still active
2 files changed, 9 insertions(+), 2 deletions(-)

M harmony_changelog.md
M products/BellHybrid/apps/common/src/AlarmModel.cpp
M harmony_changelog.md => harmony_changelog.md +2 -1
@@ 20,7 20,8 @@
* Fixed problem with deleting files during Relaxation session.
* Fixed occasional crash on system startup.
* Fixed occasional USB crash when USB cable was disconnected during files upload
* Fixed back button power off timer changed to 10s 
* Fixed back button power off timer changed to 10s
* Fixed alarm problems when it was re-set while snooze was still active

### Added


M products/BellHybrid/apps/common/src/AlarmModel.cpp => products/BellHybrid/apps/common/src/AlarmModel.cpp +7 -1
@@ 1,4 1,4 @@
// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "models/AlarmModel.hpp"


@@ 56,6 56,12 @@ namespace app
        if (!alarmEventPtr) {
            return;
        }

        if (alarmStatus == alarms::AlarmStatus::Snoozed) {
            disableSnooze(*alarmEventPtr);
            alarmStatus = alarms::AlarmStatus::Activated;
        }

        auto clockTime = std::localtime(&time);
        alarmEventPtr->alarmTime =
            AlarmTime{std::chrono::hours{clockTime->tm_hour}, std::chrono::minutes{clockTime->tm_min}};