~aleteoryx/muditaos

f90e5131b0ac0d299a716a55d31b00ffebfe9c5f — Lukasz Mastalerz 2 years ago 2d99b97
[CP-1836] Lack of error handling for audio playback

Added error handling for incorrect audio formats and corrupted files inside Relaxation app
26 files changed, 291 insertions(+), 31 deletions(-)

M harmony_changelog.md
M image/system_a/data/lang/Deutsch.json
M image/system_a/data/lang/English.json
M image/system_a/data/lang/Espanol.json
M image/system_a/data/lang/Francais.json
M image/system_a/data/lang/Polski.json
M module-services/service-audio/AudioServiceAPI.cpp
M products/BellHybrid/CMakeLists.txt
M products/BellHybrid/apps/application-bell-relaxation/ApplicationBellRelaxation.cpp
M products/BellHybrid/apps/application-bell-relaxation/CMakeLists.txt
M products/BellHybrid/apps/application-bell-relaxation/data/RelaxationStyle.hpp
M products/BellHybrid/apps/application-bell-relaxation/include/application-bell-relaxation/ApplicationBellRelaxation.hpp
A products/BellHybrid/apps/application-bell-relaxation/presenter/RelaxationErrorPresenter.cpp
A products/BellHybrid/apps/application-bell-relaxation/presenter/RelaxationErrorPresenter.hpp
M products/BellHybrid/apps/application-bell-relaxation/presenter/RelaxationRunningLoopPresenter.cpp
M products/BellHybrid/apps/application-bell-relaxation/presenter/RelaxationRunningLoopPresenter.hpp
M products/BellHybrid/apps/application-bell-relaxation/presenter/RelaxationRunningProgressPresenter.cpp
M products/BellHybrid/apps/application-bell-relaxation/presenter/RelaxationRunningProgressPresenter.hpp
A products/BellHybrid/apps/application-bell-relaxation/windows/RelaxationErrorWindow.cpp
A products/BellHybrid/apps/application-bell-relaxation/windows/RelaxationErrorWindow.hpp
M products/BellHybrid/apps/application-bell-relaxation/windows/RelaxationMainWindow.cpp
M products/BellHybrid/apps/application-bell-relaxation/windows/RelaxationRunningLoopWindow.cpp
M products/BellHybrid/apps/application-bell-relaxation/windows/RelaxationRunningLoopWindow.hpp
M products/BellHybrid/apps/application-bell-relaxation/windows/RelaxationRunningProgressWindow.cpp
M products/BellHybrid/apps/application-bell-relaxation/windows/RelaxationRunningProgressWindow.hpp
M products/BellHybrid/assets/assets_common.json
M harmony_changelog.md => harmony_changelog.md +42 -1
@@ 3,6 3,7 @@
## Unreleased

### Fixed

* Fixed displayed device name when connected to Windows
* Fixed the wrong front light on back action in alarms
* Fixed the pause deactivation by a deep press in relaxation


@@ 12,7 13,10 @@

### Added

* Added error handling for incorrect audio formats and corrupted files inside Relaxation app

### Changed

* Added serial number and timestamp to crashdump filename

## [1.8.0 2022-12-14]


@@ 20,37 24,47 @@
### Added

#### Home Screen:

* Font size increased.
* Clock faces with dates.

#### General:

* Bedside lamp mode.

#### UI/UX:

* Improve refreshing of the display.

#### Onboarding

* Shortcuts instruction.

#### Alarm

* Front light intensity during the main alarm and pre-wake up

### Changed

#### Home Screen:

* Placement of battery and time format indicators.

#### Relaxation:

* New circular progress bar
* Add loop mode

### Fixed

* Brightness calculation for alarms

#### Home Screen:

* Centering of battery indicator.

#### Settings:

* Incorrect time format of the alarm in clock face settings.

## [1.7.0 2022-11-14]


@@ 58,52 72,65 @@
### Added

#### Home Screen:

* Battery status icon.

#### Meditation:
* Option to see Meditation statistics from the last 7, 30, and 365 days. 

* Option to see Meditation statistics from the last 7, 30, and 365 days.
* Preview a countdown before the Meditation starts.
* New meditation progress layout.
* Additional start delay interval - up to 90s.

#### PowerNap:

* New circular progress bar
* Ringing bell image at the end of the Power Nap

#### Settings:

* Option to set date.

### Fixed

#### Mudita Center:

* Fixed problem with errors while connecting the device to Mudita Center.

#### Snooze:

* Fixed the problem with the alarm light flashing during snooze time.

#### Bedtime reminder:

* Fixed an issue with not pausing music notifications at bedtime.

#### Alarm:

* Fixed problem with wrong alarm status message when setting alarm from the menu.
* Fixed the spelling of the titles of two soundtracks in the alarms application.
* Fixed the issue with the welcome message not being displayed when the alarm is turned off.

#### Meditation:

* Fixed view of diacritic signs.
* Fixed resetting meditation settings with deep press.
* Fixed an issue with saving meditation settings before going through the entire setup process.

#### Relaxation:

* Fixed the navigation of the back button during relaxation.

#### General:

* Fixed inconsistencies in welcome messages.

#### UX/UI:

* Updated screens according to design.

#### Translations:

* Fixed gaps in translations.

## [1.6.0 2022-06-14]


@@ 111,18 138,23 @@
### Added

#### Home Screen:

* Possibility to choose Clock Face from 8 options (3 for 24h format, 5 for 12h format).

#### Meditation:

* Possibility to set a Meditation Timer start delay.

#### UI/UX:

* UI update (Home Screen settings).

#### Translations:

* Completed missing translations.

### Fixed

* Fixed problem with confirmation of language change action.
* Fixed problem with mixed translations appearing after language change.
* Fixed missing texts.


@@ 136,6 168,7 @@
## [1.5.1 2022-04-07]

### Fixed

* Fixed issue with the device appearing in service mode when connected via USB.
* Fixed problems with clock desynchronization.



@@ 144,15 177,18 @@
### Added

#### Settings:

* Ability to scroll between Harmony settings.
* The order of alarm sounds has been defined.

### Changed / Improved

* The default alarm volume has been changed.
* Updated alarm sounds.
* The welcome screen has been updated.

### Fixed

* Fixed problem with Pre wake-up light.
* Fixed problems with turning on the device despite high battery level.
* Fixed problems with incorrect display of battery charge status.


@@ 167,13 203,17 @@
## [1.4.0 2022-02-01]

### Added

#### General:

* Transportation mode.

#### PowerNap:

* Add front light functionality to PowerNap app.

### Changed/Improved

#### UI/UX:

* Changed exit screen with instruction to turn on.


@@ 196,6 236,7 @@
* Corrected mistakes in translations.

### Fixed

* Fixed errors in the translation of the incoming alarm message.
* Fixed the operation of the alarm when using other alarm clock functions.
* Fixed problem with the truncated relaxation screen.

M image/system_a/data/lang/Deutsch.json => image/system_a/data/lang/Deutsch.json +1 -0
@@ 665,6 665,7 @@
  "app_bell_relaxation_loop": "endlos",
  "app_bell_relaxation_looped": "geschlungen",
  "app_bell_relaxation_loop_description": "der Titel wird abgespielt, bis Sie ihn ausschalten",
  "app_bell_relaxation_error_message": "Nicht unterstütztes Dateiformat",
  "app_bell_onboarding_welcome_message": "<text>Mudita Harmony<br/>ist ausgeschaltet</text>",
  "app_bell_onboarding_info_rotate": "<text weight='regular' size='38'>Drehen </text><text weight='light' size='38'>um auszuwählen</text>",
  "app_bell_onboarding_info_light_click": "<text weight='regular' size='38'>Leichter Klick </text><text weight='light' size='38'>um fortzufahren</text>",

M image/system_a/data/lang/English.json => image/system_a/data/lang/English.json +1 -0
@@ 715,6 715,7 @@
  "app_bell_relaxation_loop": "loop",
  "app_bell_relaxation_looped": "looped",
  "app_bell_relaxation_loop_description": "the song will play until you turn it off",
  "app_bell_relaxation_error_message": "Unsupported media type",
  "app_bell_turn_off_question": "Turn off Mudita Harmony?",
  "app_bell_goodbye": "Goodbye",
  "app_bell_reset_message": "<text>Resetting Mudita<br />Harmony</text>",

M image/system_a/data/lang/Espanol.json => image/system_a/data/lang/Espanol.json +1 -0
@@ 682,6 682,7 @@
  "app_bell_relaxation_loop": "bucle",
  "app_bell_relaxation_looped": "en bucle",
  "app_bell_relaxation_loop_description": "la canción se reproducirá hasta que la apagues",
  "app_bell_relaxation_error_message": "Formato de archivo no admitido",
  "app_bell_settings_home_view": "Vista de inicio",
  "app_bell_settings_alarm_settings": "Ajustes de alarma",
  "app_bell_settings_alarm_settings_title": "Ajustes de alarma",

M image/system_a/data/lang/Francais.json => image/system_a/data/lang/Francais.json +1 -0
@@ 653,6 653,7 @@
  "app_bell_relaxation_loop": "en boucle",
  "app_bell_relaxation_looped": "en boucle",
  "app_bell_relaxation_loop_description": "le morceau sera lu jusqu'à ce que vous l'éteigniez",
  "app_bell_relaxation_error_message": "<text>Format de fichier non pris en<br></br>charge</text>",
  "app_bell_settings_home_view": "Écran d'accueil",
  "app_bell_settings_alarm_settings": "Alarme",
  "app_bell_settings_alarm_settings_title": "Alarme",

M image/system_a/data/lang/Polski.json => image/system_a/data/lang/Polski.json +1 -0
@@ 705,6 705,7 @@
  "app_bell_relaxation_loop": "w pętli",
  "app_bell_relaxation_looped": "zapętlony",
  "app_bell_relaxation_loop_description": "utwór będzie odtwarzany do momentu wyłączenia go",
  "app_bell_relaxation_error_message": "Nieobsługiwany format pliku",
  "app_bell_settings_alarm_settings_prewake_up": "Wstępne budzenie",
  "app_bell_settings_alarm_settings_prewake_up_chime_top_description": "Wstępne budzenie",
  "app_bell_settings_alarm_settings_prewake_up_chime_bottom_description": "przed alarmem",

M module-services/service-audio/AudioServiceAPI.cpp => module-services/service-audio/AudioServiceAPI.cpp +0 -1
@@ 249,5 249,4 @@ namespace AudioServiceAPI
    {
        return serv->bus.sendUnicast(std::make_shared<HFPDeviceVolumeChanged>(volume), service::name::audio);
    }

} // namespace AudioServiceAPI

M products/BellHybrid/CMakeLists.txt => products/BellHybrid/CMakeLists.txt +2 -2
@@ 142,14 142,14 @@ download_asset_release_json(json-common-target
                            ${CMAKE_CURRENT_SOURCE_DIR}/assets/assets_common.json
                           ${SYSROOT_PATH}/system_a/
                            MuditaOSPublicAssets
                            0.0.15
                            0.0.17
                            ${MUDITA_CACHE_DIR}
    )
download_asset_release_json(json-community-target
                            ${CMAKE_CURRENT_SOURCE_DIR}/assets/assets_community.json
                           ${SYSROOT_PATH}/system_a/
                            MuditaOSPublicAssets
                            0.0.15
                            0.0.17
                            ${MUDITA_CACHE_DIR}
    )
download_asset_json(json-rt1051-target

M products/BellHybrid/apps/application-bell-relaxation/ApplicationBellRelaxation.cpp => products/BellHybrid/apps/application-bell-relaxation/ApplicationBellRelaxation.cpp +8 -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 "ApplicationBellRelaxation.hpp"


@@ 10,6 10,7 @@
#include "presenter/RelaxationPausedPresenter.hpp"
#include "presenter/RelaxationEndedPresenter.hpp"
#include "presenter/RelaxationLowBatteryPresenter.hpp"
#include "presenter/RelaxationErrorPresenter.hpp"
#include "windows/RelaxationMainWindow.hpp"
#include "windows/RelaxationPausedWindow.hpp"
#include "windows/RelaxationRunningProgressWindow.hpp"


@@ 18,6 19,7 @@
#include "windows/RelaxationVolumeWindow.hpp"
#include "windows/RelaxationEndedWindow.hpp"
#include "windows/RelaxationLowBatteryWindow.hpp"
#include "windows/RelaxationErrorWindow.hpp"
#include "widgets/RelaxationPlayer.hpp"
#include <Paths.hpp>
#include <apps-common/messages/AppMessage.hpp>


@@ 114,6 116,11 @@ namespace app
                                  return std::make_unique<gui::RelaxationLowBatteryWindow>(app, std::move(presenter));
                              });

        windowsFactory.attach(gui::window::name::relaxationError, [](ApplicationCommon *app, const std::string &name) {
            auto presenter = std::make_unique<relaxation::RelaxationErrorPresenter>(app);
            return std::make_unique<gui::RelaxationErrorWindow>(app, std::move(presenter));
        });

        attachPopups({gui::popup::ID::AlarmActivated,
                      gui::popup::ID::AlarmDeactivated,
                      gui::popup::ID::PowerOff,

M products/BellHybrid/apps/application-bell-relaxation/CMakeLists.txt => products/BellHybrid/apps/application-bell-relaxation/CMakeLists.txt +14 -10
@@ 2,16 2,16 @@ add_library(application-bell-relaxation STATIC)
add_library(bell::app-relaxation ALIAS application-bell-relaxation)

target_include_directories(application-bell-relaxation
    PRIVATE
        PRIVATE
        $<BUILD_INTERFACE:
            include/application-bell-relaxation
        include/application-bell-relaxation
        >
    PUBLIC
        PUBLIC
        $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
)
        )

target_sources(application-bell-relaxation
    PRIVATE
        PRIVATE
        ApplicationBellRelaxation.cpp
        presenter/RelaxationMainWindowPresenter.cpp
        presenter/RelaxationRunningProgressPresenter.cpp


@@ 21,6 21,7 @@ target_sources(application-bell-relaxation
        presenter/RelaxationPausedPresenter.cpp
        presenter/RelaxationEndedPresenter.cpp
        presenter/RelaxationLowBatteryPresenter.cpp
        presenter/RelaxationErrorPresenter.cpp
        widgets/RelaxationPlayer.cpp
        windows/RelaxationMainWindow.cpp
        windows/RelaxationPausedWindow.cpp


@@ 30,6 31,7 @@ target_sources(application-bell-relaxation
        windows/RelaxationVolumeWindow.cpp
        windows/RelaxationEndedWindow.cpp
        windows/RelaxationLowBatteryWindow.cpp
        windows/RelaxationErrorWindow.cpp

        data/RelaxationCommon.hpp
        data/RelaxationStyle.hpp


@@ 45,6 47,7 @@ target_sources(application-bell-relaxation
        presenter/RelaxationPausedPresenter.hpp
        presenter/RelaxationEndedPresenter.hpp
        presenter/RelaxationLowBatteryPresenter.hpp
        presenter/RelaxationErrorPresenter.cpp
        windows/RelaxationMainWindow.hpp
        windows/RelaxationPausedWindow.hpp
        windows/RelaxationRunningProgressWindow.hpp


@@ 53,13 56,14 @@ target_sources(application-bell-relaxation
        windows/RelaxationVolumeWindow.hpp
        windows/RelaxationEndedWindow.hpp
        windows/RelaxationLowBatteryWindow.hpp
        windows/RelaxationErrorWindow.hpp

    PUBLIC
        PUBLIC
        include/application-bell-relaxation/ApplicationBellRelaxation.hpp
)
        )

target_link_libraries(application-bell-relaxation
    PRIVATE
        PRIVATE
        apps-common
        bell::app-main
        bell::audio


@@ 67,7 71,7 @@ target_link_libraries(application-bell-relaxation
        bell::paths
        Microsoft.GSL::GSL

    PUBLIC
        PUBLIC
        module-gui
        bell::app-common
)
        )

M products/BellHybrid/apps/application-bell-relaxation/data/RelaxationStyle.hpp => products/BellHybrid/apps/application-bell-relaxation/data/RelaxationStyle.hpp +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

#pragma once


@@ 72,4 72,10 @@ namespace gui::relaxationStyle
        } // namespace clock
    }     // namespace relStyle

    namespace error
    {
        constexpr inline auto imageMarginTop = 122U;
        constexpr inline auto textPaddingTop = 30U;
    } // namespace error

} // namespace gui::relaxationStyle

M products/BellHybrid/apps/application-bell-relaxation/include/application-bell-relaxation/ApplicationBellRelaxation.hpp => products/BellHybrid/apps/application-bell-relaxation/include/application-bell-relaxation/ApplicationBellRelaxation.hpp +2 -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

#pragma once


@@ 16,6 16,7 @@ namespace gui::window::name
    inline constexpr auto relaxationTimerSelect     = "RelaxationTimerSelectWindow";
    inline constexpr auto relaxationEnded           = "RelaxationEndedWindow";
    inline constexpr auto relaxationLowBattery      = "RelaxationLowBatteryWindow";
    inline constexpr auto relaxationError           = "RelaxationError";

} // namespace gui::window::name
namespace app

A products/BellHybrid/apps/application-bell-relaxation/presenter/RelaxationErrorPresenter.cpp => products/BellHybrid/apps/application-bell-relaxation/presenter/RelaxationErrorPresenter.cpp +23 -0
@@ 0,0 1,23 @@
// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "presenter/RelaxationErrorPresenter.hpp"
#include "ApplicationBellRelaxation.hpp"

#include <Application.hpp>
#include <service-appmgr/Controller.hpp>
#include <application-bell-main/ApplicationBellMain.hpp>

namespace app::relaxation
{
    RelaxationErrorPresenter::RelaxationErrorPresenter(app::ApplicationCommon *app) : app{app}
    {}

    void RelaxationErrorPresenter::activate()
    {
        app::manager::Controller::sendAction(
            app,
            app::manager::actions::Launch,
            std::make_unique<app::ApplicationLaunchData>(app::applicationBellRelaxationName));
    }
} // namespace app::relaxation

A products/BellHybrid/apps/application-bell-relaxation/presenter/RelaxationErrorPresenter.hpp => products/BellHybrid/apps/application-bell-relaxation/presenter/RelaxationErrorPresenter.hpp +38 -0
@@ 0,0 1,38 @@
// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once

#include <apps-common/BasePresenter.hpp>

namespace app
{
    class ApplicationCommon;
}

namespace app::relaxation
{
    class RelaxationErrorContract
    {
      public:
        class View
        {
          public:
            virtual ~View() = default;
        };
        class Presenter : public BasePresenter<RelaxationErrorContract::View>
        {
          public:
            virtual void activate() = 0;
        };
    };

    class RelaxationErrorPresenter : public RelaxationErrorContract::Presenter
    {
        app::ApplicationCommon *app{};
        void activate() override;

      public:
        explicit RelaxationErrorPresenter(app::ApplicationCommon *app);
    };
} // namespace app::relaxation

M products/BellHybrid/apps/application-bell-relaxation/presenter/RelaxationRunningLoopPresenter.cpp => products/BellHybrid/apps/application-bell-relaxation/presenter/RelaxationRunningLoopPresenter.cpp +16 -3
@@ 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 "RelaxationRunningLoopPresenter.hpp"


@@ 36,13 36,26 @@ namespace app::relaxation
            mode = AbstractRelaxationPlayer::PlaybackMode::Looped;
        }
        else {
            timer->reset(std::chrono::seconds{song.audioProperties.songLength});
            mode = AbstractRelaxationPlayer::PlaybackMode::SingleShot;
            const auto songLength = std::chrono::seconds{song.audioProperties.songLength};
            mode                  = AbstractRelaxationPlayer::PlaybackMode::SingleShot;

            if (songLength > std::chrono::seconds::zero()) {
                timer->reset(songLength);
            }
            else {
                getView()->handleError();
                return;
            }
        }

        auto onStartCallback = [this](audio::RetCode retCode) {
            if (retCode == audio::RetCode::Success) {
                timer->start();
            }
            else {
                getView()->handleError();
                return;
            }
        };
        player.start(song.fileInfo.path, mode, std::move(onStartCallback));
    }

M products/BellHybrid/apps/application-bell-relaxation/presenter/RelaxationRunningLoopPresenter.hpp => products/BellHybrid/apps/application-bell-relaxation/presenter/RelaxationRunningLoopPresenter.hpp +2 -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

#pragma once


@@ 40,6 40,7 @@ namespace app::relaxation
            virtual void resume()                                           = 0;
            virtual void setTime(std::time_t newTime)                       = 0;
            virtual void setTimeFormat(utils::time::Locale::TimeFormat fmt) = 0;
            virtual void handleError()                                      = 0;
        };

        class Presenter : public BasePresenter<RelaxationRunningLoopContract::View>

M products/BellHybrid/apps/application-bell-relaxation/presenter/RelaxationRunningProgressPresenter.cpp => products/BellHybrid/apps/application-bell-relaxation/presenter/RelaxationRunningProgressPresenter.cpp +15 -3
@@ 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 "RelaxationRunningProgressPresenter.hpp"


@@ 37,13 37,25 @@ namespace app::relaxation
            mode = AbstractRelaxationPlayer::PlaybackMode::Looped;
        }
        else {
            timer->reset(std::chrono::seconds{song.audioProperties.songLength});
            mode = AbstractRelaxationPlayer::PlaybackMode::SingleShot;
            const auto songLength = std::chrono::seconds{song.audioProperties.songLength};
            mode                  = AbstractRelaxationPlayer::PlaybackMode::SingleShot;

            if (songLength > std::chrono::seconds::zero()) {
                timer->reset(songLength);
            }
            else {
                getView()->handleError();
                return;
            }
        }
        auto onStartCallback = [this](audio::RetCode retCode) {
            if (retCode == audio::RetCode::Success) {
                timer->start();
            }
            else {
                getView()->handleError();
                return;
            }
        };
        player.start(song.fileInfo.path, mode, std::move(onStartCallback));
    }

M products/BellHybrid/apps/application-bell-relaxation/presenter/RelaxationRunningProgressPresenter.hpp => products/BellHybrid/apps/application-bell-relaxation/presenter/RelaxationRunningProgressPresenter.hpp +2 -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

#pragma once


@@ 39,6 39,7 @@ namespace app::relaxation
            virtual void resume()                                           = 0;
            virtual void setTime(std::time_t newTime)                       = 0;
            virtual void setTimeFormat(utils::time::Locale::TimeFormat fmt) = 0;
            virtual void handleError()                                      = 0;
        };

        class Presenter : public BasePresenter<RelaxationRunningProgressContract::View>

A products/BellHybrid/apps/application-bell-relaxation/windows/RelaxationErrorWindow.cpp => products/BellHybrid/apps/application-bell-relaxation/windows/RelaxationErrorWindow.cpp +68 -0
@@ 0,0 1,68 @@
// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "RelaxationErrorWindow.hpp"
#include <data/RelaxationSwitchData.hpp>
#include <data/RelaxationStyle.hpp>
#include <ApplicationBellRelaxation.hpp>
#include <gui/widgets/Icon.hpp>

#include <apps-common/widgets/BellBaseLayout.hpp>

namespace gui
{
    RelaxationErrorWindow::RelaxationErrorWindow(
        app::ApplicationCommon *app, std::unique_ptr<app::relaxation::RelaxationErrorContract::Presenter> &&presenter)
        : WindowWithTimer(app, gui::window::name::relaxationError, std::chrono::seconds{6}), presenter{
                                                                                                 std::move(presenter)}
    {
        buildInterface();
    }

    void RelaxationErrorWindow::buildInterface()
    {
        AppWindow::buildInterface();
        buildLayout();
        registerCallbacks();
    }

    void RelaxationErrorWindow::buildLayout()
    {
        statusBar->setVisible(false);

        auto icon = new Icon(this,
                             0,
                             0,
                             style::window_width,
                             style::window_height,
                             "big_information",
                             utils::translate("app_bell_relaxation_error_message"),
                             ImageTypeSpecifier::W_G);
        icon->image->setMargins({0, gui::relaxationStyle::error::imageMarginTop, 0, 0});
        icon->text->setFont(style::window::font::verybiglight);
        const auto textPadding = icon->text->getPadding();
        icon->text->setPadding(
            {textPadding.left, gui::relaxationStyle::error::textPaddingTop, textPadding.right, textPadding.bottom});
        icon->text->setAlignment(Alignment(Alignment::Horizontal::Center, Alignment::Vertical::Center));
        icon->setAlignment(Alignment(Alignment::Horizontal::Center, Alignment::Vertical::Top));

        icon->resizeItems();
    }

    void RelaxationErrorWindow::registerCallbacks()
    {
        timerCallback = [this](Item &, sys::Timer &timer) {
            application->switchWindow(gui::name::window::main_window);
            return true;
        };
    }

    bool RelaxationErrorWindow::onInput(const InputEvent &inputEvent)
    {
        if (inputEvent.isShortRelease(KeyCode::KEY_ENTER) || inputEvent.isShortRelease(KeyCode::KEY_RF)) {
            application->switchWindow(gui::name::window::main_window);
            return true;
        }
        return true;
    }
} // namespace gui

A products/BellHybrid/apps/application-bell-relaxation/windows/RelaxationErrorWindow.hpp => products/BellHybrid/apps/application-bell-relaxation/windows/RelaxationErrorWindow.hpp +28 -0
@@ 0,0 1,28 @@
// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once

#include "presenter/RelaxationErrorPresenter.hpp"
#include <apps-common/popups/WindowWithTimer.hpp>
#include <memory>

namespace gui
{
    class BellBaseLayout;
    class RelaxationErrorWindow : public WindowWithTimer
    {
      public:
        explicit RelaxationErrorWindow(
            app::ApplicationCommon *app,
            std::unique_ptr<app::relaxation::RelaxationErrorContract::Presenter> &&presenter);

      private:
        std::unique_ptr<app::relaxation::RelaxationErrorContract::Presenter> presenter;

        void buildInterface() override;
        bool onInput(const gui::InputEvent &inputEvent) override;
        void registerCallbacks();
        void buildLayout();
    };
} // namespace gui

M products/BellHybrid/apps/application-bell-relaxation/windows/RelaxationMainWindow.cpp => products/BellHybrid/apps/application-bell-relaxation/windows/RelaxationMainWindow.cpp +1 -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 "RelaxationMainWindow.hpp"

M products/BellHybrid/apps/application-bell-relaxation/windows/RelaxationRunningLoopWindow.cpp => products/BellHybrid/apps/application-bell-relaxation/windows/RelaxationRunningLoopWindow.cpp +5 -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 "RelaxationRunningLoopWindow.hpp"


@@ 222,4 222,8 @@ namespace gui
                                      std::make_unique<gui::RelaxationLowBatterySwitchData>(soc));
        }
    }
    void RelaxationRunningLoopWindow::handleError()
    {
        application->switchWindow(gui::window::name::relaxationError);
    }
} // namespace gui

M products/BellHybrid/apps/application-bell-relaxation/windows/RelaxationRunningLoopWindow.hpp => products/BellHybrid/apps/application-bell-relaxation/windows/RelaxationRunningLoopWindow.hpp +2 -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

#pragma once


@@ 40,6 40,7 @@ namespace gui
        void onPaused() override;
        void resume() override;
        bool updateBatteryStatus() override;
        void handleError() override;

        void buildLayout();
        void configureTimer();

M products/BellHybrid/apps/application-bell-relaxation/windows/RelaxationRunningProgressWindow.cpp => products/BellHybrid/apps/application-bell-relaxation/windows/RelaxationRunningProgressWindow.cpp +6 -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 "RelaxationRunningProgressWindow.hpp"


@@ 172,4 172,9 @@ namespace gui
        return RefreshModes::GUI_REFRESH_FAST;
    }

    void RelaxationRunningProgressWindow::handleError()
    {
        application->switchWindow(gui::window::name::relaxationError);
    }

} // namespace gui

M products/BellHybrid/apps/application-bell-relaxation/windows/RelaxationRunningProgressWindow.hpp => products/BellHybrid/apps/application-bell-relaxation/windows/RelaxationRunningProgressWindow.hpp +2 -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

#pragma once


@@ 41,6 41,7 @@ namespace gui
        void onPaused() override;
        void resume() override;
        RefreshModes updateTime() override;
        void handleError() override;

        void buildLayout();
        void configureTimer();

M products/BellHybrid/assets/assets_common.json => products/BellHybrid/assets/assets_common.json +3 -1
@@ 60,7 60,9 @@
        {"name": "release.tgz", "tarfile" :"image/assets/images/bell/shortcuts_step_turn_off_W_G.vpi", "output": "assets/images/shortcuts_step_turn_off_W_G.vpi"},
        {"name": "release.tgz", "tarfile" :"image/assets/images/bell/shortcuts_step_restart_W_G.vpi", "output": "assets/images/shortcuts_step_restart_W_G.vpi"},
        {"name": "release.tgz", "tarfile" :"image/assets/images/bell/shortcuts_step_bedside_lamp_W_G.vpi", "output": "assets/images/shortcuts_step_bedside_lamp_W_G.vpi"},
        
        {"name": "release.tgz", "tarfile" :"image/assets/images/bell/big_information_W_G.vpi", "output": "assets/images/big_information_W_G.vpi"},


        {"name": "release_audio.tgz", "tarfile" :"./image/assets/audio/bell/chimes/Blissful_Dream.mp3", "output": "assets/audio/chimes/Blissful_Dream.mp3"},
        {"name": "release_audio.tgz", "tarfile" :"./image/assets/audio/bell/chimes/Gentle_Chime.mp3", "output": "assets/audio/chimes/Gentle_Chime.mp3"},
        {"name": "release_audio.tgz", "tarfile" :"./image/assets/audio/bell/chimes/Rise_&_Shine.mp3", "output": "assets/audio/chimes/Rise_&_Shine.mp3"},