~aleteoryx/muditaos

bc2e3cc04aa84239854a243e810f1e9e7c6bb99e — Lefucjusz 3 years ago edfe8ac
[MOS-600] Fix RF button hold leaves alarm ringing

Fix of the issue that long press
of right function button causes
alarm popup window to close,
but alarm is still ringing.
The only way to turn it off was
to power off the phone.
1 files changed, 7 insertions(+), 9 deletions(-)

M module-apps/apps-common/popups/AlarmPopup.cpp
M module-apps/apps-common/popups/AlarmPopup.cpp => module-apps/apps-common/popups/AlarmPopup.cpp +7 -9
@@ 85,15 85,13 @@ namespace gui

    bool AlarmPopup::onInput(const InputEvent &inputEvent)
    {
        if (inputEvent.isShortRelease()) {
            if (inputEvent.is(KeyCode::KEY_RF)) {
                getPresenter()->stopAlarm();
                return true;
            }
            else if (inputEvent.is(KeyCode::KEY_LF) && getPresenter()->haveSnoozedSkip()) {
                getPresenter()->skipToNextSnooze();
                return true;
            }
        if (inputEvent.isShortRelease(KeyCode::KEY_RF) || inputEvent.isLongRelease(KeyCode::KEY_RF)) {
            getPresenter()->stopAlarm();
            return true;
        }
        else if (inputEvent.isShortRelease(KeyCode::KEY_LF) && getPresenter()->haveSnoozedSkip()) {
            getPresenter()->skipToNextSnooze();
            return true;
        }

        return AppWindow::onInput(inputEvent);