~aleteoryx/muditaos

203f81977f0b69865f54949ff4bcd9487caddddb — lblach 5 years ago 080a2bf
[EGD-5756] Add Update Window

Create Update Window(s) to control and visualize the MuditaOS update
process on Pure.
A image/assets/images/circle_update.vpi => image/assets/images/circle_update.vpi +0 -0
M image/assets/lang/Deutsch.json => image/assets/lang/Deutsch.json +5 -0
@@ 15,6 15,7 @@
  "common_mute": "MUTE",
  "common_switch": "SWITCH",
  "common_options": "OPTIONS",
  "common_abort": "ABORT",
  "common_monday": "Monday",
  "common_tuesday": "Tuesday",
  "common_wednesday": "Wednesday",


@@ 159,6 160,10 @@
  "app_phonebook_check": "CHECK",
  "app_phonebook_uncheck": "UNCHECK",
  "app_meditation_title_main": "Meditation",
  "app_desktop_update_preparing": "Preparing MuditaOS update ver.",
  "app_desktop_update_muditaos": "MuditaOS update",
  "app_desktop_update_in_progress": "Update in progress...",
  "app_desktop_update_ready_for_reset": "Ready for reset...",
  "sms_call_text": "Call: ",
  "sms_contact_details": "Contact details",
  "sms_delete_conversation": "Delete conversation",

M image/assets/lang/English.json => image/assets/lang/English.json +5 -0
@@ 24,6 24,7 @@
  "common_resume": "RESUME",
  "common_pause": "PAUSE",
  "common_retry": "TRY AGAIN",
  "common_abort": "ABORT",
  "common_mo": "MO",
  "common_tu": "TU",
  "common_we": "WE",


@@ 511,5 512,9 @@
  "app_desktop_update_size": "size",
  "app_desktop_update_bytes": "bytes",
  "app_desktop_update_unpacking": "Unpacking",
  "app_desktop_update_preparing": "Preparing MuditaOS update ver.",
  "app_desktop_update_muditaos": "MuditaOS update",
  "app_desktop_update_in_progress": "Update in progress...",
  "app_desktop_update_ready_for_reset": "Ready for reset...",
  "app_call_private_number": "Private number"
}

M image/assets/lang/Espanol.json => image/assets/lang/Espanol.json +5 -0
@@ 15,6 15,7 @@
  "common_mute": "MUTE",
  "common_switch": "CAMBIAR",
  "common_options": "OPCIONES",
  "common_abort": "ABORT",
  "common_monday": "Lunes",
  "common_tuesday": "Martes",
  "common_wednesday": "Miércoles",


@@ 164,6 165,10 @@
  "app_phonebook_check": "CHECK",
  "app_phonebook_uncheck": "UNCHECK",
  "app_meditation_title_main": "Meditation",
  "app_desktop_update_preparing": "Preparing MuditaOS update ver.",
  "app_desktop_update_muditaos": "MuditaOS update",
  "app_desktop_update_in_progress": "Update in progress...",
  "app_desktop_update_ready_for_reset": "Ready for reset...",
  "sms_call_text": "Llamado: ",
  "sms_contact_details": "Detales de contacto: ",
  "sms_delete_conversation": "Eliminar conversación",

M image/assets/lang/Francais.json => image/assets/lang/Francais.json +5 -0
@@ 15,6 15,7 @@
  "common_mute": "MUTE",
  "common_switch": "SWITCH",
  "common_options": "OPTIONS",
  "common_abort": "ABORT",
  "common_monday": "Monday",
  "common_tuesday": "Tuesday",
  "common_wednesday": "Wednesday",


@@ 159,6 160,10 @@
  "app_phonebook_check": "CHECK",
  "app_phonebook_uncheck": "UNCHECK",
  "app_meditation_title_main": "Meditation",
  "app_desktop_update_preparing": "Preparing MuditaOS update ver.",
  "app_desktop_update_muditaos": "MuditaOS update",
  "app_desktop_update_in_progress": "Update in progress...",
  "app_desktop_update_ready_for_reset": "Ready for reset...",
  "sms_call_text": "Call: ",
  "sms_contact_details": "Contact details",
  "sms_delete_conversation": "Delete conversation",

M image/assets/lang/Polski.json => image/assets/lang/Polski.json +5 -0
@@ 15,6 15,7 @@
  "common_mute": "WYCISZ",
  "common_switch": "ZMIEŃ",
  "common_options": "OPCJE",
  "common_abort": "PRZERWIJ",
  "common_monday": "poniedziałek",
  "common_tuesday": "wtorek",
  "common_wednesday": "środa",


@@ 161,6 162,10 @@
  "app_phonebook_check": "ZAZNACZ",
  "app_phonebook_uncheck": "ODZNACZ",
  "app_meditation_title_main": "Medytacja",
  "app_desktop_update_preparing": "Przygotowanie aktualizacji MuditaOS wer.",
  "app_desktop_update_muditaos": "Aktualizacja MuditaOS",
  "app_desktop_update_in_progress": "Aktualizacja w toku...",
  "app_desktop_update_ready_for_reset": "Gotowy do restartu...",
  "sms_call_text": "Call: ",
  "sms_contact_details": "Contact details",
  "sms_delete_conversation": "Delete conversation",

M module-apps/CMakeLists.txt => module-apps/CMakeLists.txt +1 -1
@@ 46,7 46,7 @@ set( SOURCES
    "options/type/OptionSetting.cpp"
    "options/type/OptionChangePin.cpp"
    "options/type/OptionWithActiveIcons.cpp"
    )
    "application-desktop/windows/UpdateProgress.cpp")

add_library(${PROJECT_NAME} STATIC ${SOURCES} ${BOARD_SOURCES})


M module-apps/application-desktop/ApplicationDesktop.cpp => module-apps/application-desktop/ApplicationDesktop.cpp +9 -1
@@ 12,6 12,7 @@
#include "windows/LockedInfoWindow.hpp"
#include "windows/Reboot.hpp"
#include "windows/Update.hpp"
#include "windows/UpdateProgress.hpp"
#include "windows/MmiPullWindow.hpp"
#include "windows/MmiPushWindow.hpp"
#include "windows/MmiInternalMsgWindow.hpp"


@@ 315,11 316,15 @@ namespace app

                if (getWindow(app::window::name::desktop_update)) {
                    std::unique_ptr<gui::UpdateSwitchData> data = std::make_unique<gui::UpdateSwitchData>(updateMsg);

                    switchWindow(app::window::name::desktop_update, gui::ShowMode::GUI_SHOW_INIT, std::move(data));
                }
            }

            if (updateMsg != nullptr && updateMsg->messageType == updateos::UpdateMessageType::UpdateNow) {
                auto data = std::make_unique<gui::UpdateSwitchData>(updateMsg);
                switchWindow(app::window::name::desktop_update_progress, gui::ShowMode::GUI_SHOW_INIT, std::move(data));
            }

            if (updateMsg != nullptr && updateMsg->messageType == updateos::UpdateMessageType::UpdateInform) {
                if (getWindow(app::window::name::desktop_update)) {
                    std::unique_ptr<gui::UpdateSwitchData> data = std::make_unique<gui::UpdateSwitchData>(updateMsg);


@@ 380,6 385,9 @@ namespace app
        windowsFactory.attach(desktop_update, [](Application *app, const std::string newname) {
            return std::make_unique<gui::UpdateWindow>(app);
        });
        windowsFactory.attach(desktop_update_progress, [](Application *app, const std::string newname) {
            return std::make_unique<gui::UpdateProgressWindow>(app);
        });
        windowsFactory.attach(desktop_mmi_pull, [](Application *app, const std::string newname) {
            return std::make_unique<gui::MmiPullWindow>(app, desktop_mmi_pull);
        });

M module-apps/application-desktop/CMakeLists.txt => module-apps/application-desktop/CMakeLists.txt +2 -0
@@ 31,6 31,7 @@ target_sources( ${PROJECT_NAME}
		"${CMAKE_CURRENT_LIST_DIR}/windows/LockedInfoWindow.cpp"
        "${CMAKE_CURRENT_LIST_DIR}/windows/Reboot.cpp"
		"${CMAKE_CURRENT_LIST_DIR}/windows/Update.cpp"
		"${CMAKE_CURRENT_LIST_DIR}/windows/UpdateProgress.cpp"
		"${CMAKE_CURRENT_LIST_DIR}/windows/MmiPullWindow.cpp"
		"${CMAKE_CURRENT_LIST_DIR}/windows/MmiPushWindow.cpp"
		"${CMAKE_CURRENT_LIST_DIR}/windows/MmiInternalMsgWindow.cpp"


@@ 58,6 59,7 @@ target_sources( ${PROJECT_NAME}
		"${CMAKE_CURRENT_LIST_DIR}/windows/LockedInfoWindow.hpp"
        "${CMAKE_CURRENT_LIST_DIR}/windows/Reboot.hpp"
		"${CMAKE_CURRENT_LIST_DIR}/windows/Update.hpp"
		"${CMAKE_CURRENT_LIST_DIR}/windows/UpdateProgress.hpp"
        "${CMAKE_CURRENT_LIST_DIR}/windows/Names.hpp"
		"${CMAKE_CURRENT_LIST_DIR}/windows/MmiPullWindow.hpp"
		"${CMAKE_CURRENT_LIST_DIR}/windows/MmiPushWindow.hpp"

M module-apps/application-desktop/data/LockPhoneData.hpp => module-apps/application-desktop/data/LockPhoneData.hpp +1 -0
@@ 48,6 48,7 @@ namespace gui
      public:
        UpdateSwitchData(sdesktop::UpdateOsMessage *messageToCopyFrom) : updateOsMessage(*messageToCopyFrom)
        {}

        const sdesktop::UpdateOsMessage &getUpdateOsMessage()
        {
            return updateOsMessage;

M module-apps/application-desktop/windows/Names.hpp => module-apps/application-desktop/windows/Names.hpp +11 -10
@@ 7,14 7,15 @@
namespace app::window::name
{
    inline constexpr auto desktop_main_window = gui::name::window::main_window;
    inline constexpr auto desktop_menu         = "MenuWindow";
    inline constexpr auto desktop_reboot       = "Reboot";
    inline constexpr auto desktop_poweroff     = "PowerOffWindow";
    inline constexpr auto dead_battery         = "DeadBatteryWindow";
    inline constexpr auto desktop_pin_lock     = "PinLockWindow";
    inline constexpr auto desktop_locked       = "LockedInfoWindow";
    inline constexpr auto desktop_update       = "Update";
    inline constexpr auto desktop_mmi_pull     = "MmiPullWindow";
    inline constexpr auto desktop_mmi_push     = "MmiPushWindow";
    inline constexpr auto desktop_mmi_internal = "MmiInternalMsgWindow";
    inline constexpr auto desktop_menu            = "MenuWindow";
    inline constexpr auto desktop_reboot          = "Reboot";
    inline constexpr auto desktop_poweroff        = "PowerOffWindow";
    inline constexpr auto dead_battery            = "DeadBatteryWindow";
    inline constexpr auto desktop_pin_lock        = "PinLockWindow";
    inline constexpr auto desktop_locked          = "LockedInfoWindow";
    inline constexpr auto desktop_update          = "Update";
    inline constexpr auto desktop_update_progress = "UpdateProgress";
    inline constexpr auto desktop_mmi_pull        = "MmiPullWindow";
    inline constexpr auto desktop_mmi_push        = "MmiPushWindow";
    inline constexpr auto desktop_mmi_internal    = "MmiInternalMsgWindow";
}; // namespace app::window::name

A module-apps/application-desktop/windows/UpdateProgress.cpp => module-apps/application-desktop/windows/UpdateProgress.cpp +181 -0
@@ 0,0 1,181 @@
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include <log/log.hpp>
#include <gui/widgets/BottomBar.hpp>
#include <gui/widgets/TopBar.hpp>
#include <application-desktop/data/LockPhoneData.hpp>
#include <source/version.hpp>

// module-utils
#include <i18n/i18n.hpp>

#include <application-desktop/ApplicationDesktop.hpp>

// services
#include <service-appmgr/model/ApplicationManager.hpp>

#include <Style.hpp>
#include <DialogMetadataMessage.hpp>

#include "UpdateProgress.hpp"

namespace style
{
    namespace image
    {
        constexpr uint32_t x = 176;
        constexpr uint32_t y = 132;
    } // namespace image

    namespace text
    {
        constexpr uint32_t x = 120;
        constexpr uint32_t y = 250;
        constexpr uint32_t w = 250;
        constexpr uint32_t h = 100;
    } // namespace text

    namespace percentlabel
    {
        constexpr uint32_t x = 0;
        constexpr uint32_t y = 450;
        constexpr uint32_t w = 500;
        constexpr uint32_t h = 100;
    } // namespace percentlabel

    namespace progressbar
    {
        constexpr uint32_t x = 100;
        constexpr uint32_t y = 400;
    } // namespace progressbar

} // namespace style
namespace gui
{

    UpdateProgressWindow::UpdateProgressWindow(app::Application *app)
        : AppWindow(app, app::window::name::desktop_update_progress)
    {
        buildInterface();
    }

    void UpdateProgressWindow::rebuild()
    {
        destroyInterface();
        buildInterface();
    }

    void UpdateProgressWindow::buildInterface()
    {
        AppWindow::buildInterface();

        setTitle(utils::localize.get("app_desktop_update_muditaos"));

        icon = new Image(this, style::image::x, style::image::y, "circle_update");

        text = new Text(this, style::text::x, style::text::y, style::text::w, style::text::h);
        text->setTextType(TextType::MultiLine);
        text->setEditMode(EditMode::Browse);
        text->setEdges(RectangleEdge::None);
        text->setFont(style::window::font::biglight);
        text->setAlignment(gui::Alignment(gui::Alignment::Horizontal::Center, gui::Alignment::Vertical::Center));

        percentLabel = new gui::Label(
            this, style::percentlabel::x, style::percentlabel::y, style::percentlabel::w, style::percentlabel::h);
        percentLabel->setFilled(false);
        percentLabel->setBorderColor(gui::ColorNoColor);
        percentLabel->setFont(style::window::font::biglight);
        percentLabel->setAlignment(
            gui::Alignment(gui::Alignment::Horizontal::Center, gui::Alignment::Vertical::Center));
        percentLabel->setVisible(true);

        updateProgress = new ProgressBar(this,
                                         style::progressbar::x,
                                         style::progressbar::y,
                                         style::window_width - 2 * style::progressbar::x,
                                         style::window::label::default_h);
        updateProgress->setMaximum(100);
        updateProgress->setValue(0);
        updateProgress->setVisible(true);
    }

    void UpdateProgressWindow::destroyInterface()
    {
        erase();
    }

    void UpdateProgressWindow::onBeforeShow(ShowMode mode, SwitchData *data)
    {
        if (data == nullptr) {
            LOG_ERROR("Received null pointer");
        }
        else {
            auto *item = dynamic_cast<gui::UpdateSwitchData *>(data);
            if (item != nullptr) {
                auto msg   = item->getUpdateOsMessage();
                updateFile = msg.updateStats.updateFile;
                auto updateVersion =
                    msg.updateStats.versionInformation[boot::json::os_version][boot::json::version_string]
                        .string_value();
                text->setRichText(utils::localize.get("app_desktop_update_preparing") + " " + updateVersion);
            }
        }
        state = State::Return;
    }

    bool UpdateProgressWindow::handleSwitchData(SwitchData *data)
    {
        auto *item = dynamic_cast<gui::UpdateSwitchData *>(data);
        if (item != nullptr) {
            auto status = static_cast<updateos::UpdateState>(item->getUpdateOsMessage().updateStats.status);

            switch (status) {
            case updateos::UpdateState::Initial:
                text->setRichText(text->getText());
                progressPercent = 10;
                break;
            case updateos::UpdateState::UpdateFileSet:
                text->setRichText(text->getText());
                progressPercent = 20;
                break;
            case updateos::UpdateState::CreatingDirectories:
                text->setRichText(text->getText());
                progressPercent = 30;
                break;
            case updateos::UpdateState::ExtractingFiles:
                text->setRichText(utils::localize.get("app_desktop_update_in_progress"));
                progressPercent = 40;
                break;
            case updateos::UpdateState::ChecksumVerification:
                text->setRichText(text->getText());
                progressPercent = 70;
                break;
            case updateos::UpdateState::VersionVerificiation:
                text->setRichText(text->getText());
                progressPercent = 90;
                break;
            case updateos::UpdateState::UpdatingBootloader:
                text->setRichText(text->getText());
                progressPercent = 99;
                break;
            case updateos::UpdateState::ReadyForReset:
                text->setRichText(utils::localize.get("app_desktop_update_ready_for_reset"));
                progressPercent = 100;
                break;
            default:
                if (item->getUpdateOsMessage().updateStats.messageText != "") {
                    percentLabel->setText(item->getUpdateOsMessage().updateStats.messageText);
                }
            }

            percentLabel->setVisible(true);
            percentLabel->setText(std::to_string(progressPercent) + " %");
            updateProgress->setVisible(true);
            updateProgress->setFocus(true);
            updateProgress->setValue(progressPercent);
            text->setVisible(true);
        }
        return true;
    }
} /* namespace gui */

A module-apps/application-desktop/windows/UpdateProgress.hpp => module-apps/application-desktop/windows/UpdateProgress.hpp +47 -0
@@ 0,0 1,47 @@
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once

#include <vector>
#include "AppWindow.hpp"
#include "Dialog.hpp"
#include "gui/widgets/Label.hpp"
#include "gui/widgets/TextFixedSize.hpp"
#include "gui/widgets/Image.hpp"
#include "gui/widgets/BottomBar.hpp"
#include "gui/widgets/ProgressBar.hpp"
namespace gui
{

    class UpdateProgressWindow : public AppWindow
    {

        enum class State
        {
            UpdateNow,
            Return,
        };

        unsigned int progressPercent = 0;

        gui::Label *percentLabel    = nullptr;
        ProgressBar *updateProgress = nullptr;

        State state = State::Return;
        fs::path updateFile;

      protected:
        Text *text  = nullptr;
        Image *icon = nullptr;

      public:
        UpdateProgressWindow(app::Application *app);
        void onBeforeShow(ShowMode mode, SwitchData *data) override;
        bool handleSwitchData(SwitchData *data) override;
        void rebuild() override;
        void buildInterface() override;
        void destroyInterface() override;
    };

} /* namespace gui */

M module-gui/gui/widgets/Style.hpp => module-gui/gui/widgets/Style.hpp +1 -1
@@ 153,7 153,7 @@ namespace style
            inline constexpr auto pause          = "common_pause";
            inline constexpr auto accept         = "common_accept";
            inline constexpr auto retry          = "common_retry";

            inline constexpr auto abort          = "common_abort";
            // days
            inline constexpr auto Monday    = "common_monday";
            inline constexpr auto Tuesday   = "common_tuesday";

M module-services/service-desktop/ServiceDesktop.cpp => module-services/service-desktop/ServiceDesktop.cpp +1 -0
@@ 158,6 158,7 @@ sys::ReturnCodes ServiceDesktop::InitHandler()
                updateOS->runUpdate();
            }
        }

        return std::make_shared<sys::ResponseMessage>();
    });


M module-services/service-desktop/endpoints/update/UpdateMuditaOS.cpp => module-services/service-desktop/endpoints/update/UpdateMuditaOS.cpp +65 -6
@@ 58,8 58,12 @@ updateos::UpdateError UpdateMuditaOS::setUpdateFile(const std::filesystem::path 
{
    if (isUpdateToBeAborted()) {
        setUpdateAbortFlag(false);
        sys::SystemManager::Reboot(owner);
        return informError(updateos::UpdateError::UpdateAborted, "update aborted");
    }
    else {
        informUpdateWindow();
    }

    updateFile = purefs::dir::getUpdatesOSPath() / updateFileToUse;
    if (std::filesystem::exists(updateFile.c_str())) {


@@ 80,6 84,9 @@ updateos::UpdateError UpdateMuditaOS::setUpdateFile(const std::filesystem::path 
    }

    status = updateos::UpdateState::UpdateFileSet;

    informUpdateWindow();

    return updateos::UpdateError::NoError;
}



@@ 166,13 173,25 @@ updateos::UpdateError UpdateMuditaOS::runUpdate()

updateos::UpdateError UpdateMuditaOS::unpackUpdate()
{
    status = updateos::UpdateState::ExtractingFiles;

    if (isUpdateToBeAborted()) {
        setUpdateAbortFlag(false);
        sys::SystemManager::Reboot(owner);
        return updateos::UpdateError::UpdateAborted;
    }
    else {
        informUpdateWindow();
    }

    mtar_header_t tarHeader;
    filesInUpdatePackage.clear();
    status = updateos::UpdateState::ExtractingFiles;

    std::rewind(updateTar.stream);
    while ((mtar_read_header(&updateTar, &tarHeader)) != MTAR_ENULLRECORD) {
        if (isUpdateToBeAborted()) {
            setUpdateAbortFlag(false);
            sys::SystemManager::Reboot(owner);
            return updateos::UpdateError::UpdateAborted;
        }
        if (std::string(tarHeader.name) == "./") {


@@ 226,12 245,16 @@ std::string UpdateMuditaOS::readContent(const char *filename) noexcept

updateos::UpdateError UpdateMuditaOS::verifyChecksums()
{
    status = updateos::UpdateState::ChecksumVerification;

    if (isUpdateToBeAborted()) {
        setUpdateAbortFlag(false);
        return informError(updateos::UpdateError::UpdateAborted, "update aborted");
        sys::SystemManager::Reboot(owner);
        return updateos::UpdateError::UpdateAborted;
    }
    else {
        informUpdateWindow();
    }

    status = updateos::UpdateState::ChecksumVerification;

    auto lineBuff = std::make_unique<char[]>(
        boot::consts::tar_buf); // max line should be freertos max path + checksum, so this is enough


@@ 272,6 295,15 @@ updateos::UpdateError UpdateMuditaOS::verifyVersion()
{
    status = updateos::UpdateState::VersionVerificiation;

    if (isUpdateToBeAborted()) {
        setUpdateAbortFlag(false);
        sys::SystemManager::Reboot(owner);
        return updateos::UpdateError::UpdateAborted;
    }
    else {
        informUpdateWindow();
    }

    if (!std::filesystem::exists(getUpdateTmpChild(updateos::file::version).c_str())) {
        return informError(updateos::UpdateError::VerifyVersionFailure,
                           "verifyVersion %s does not exist",


@@ 298,6 330,17 @@ updateos::UpdateError UpdateMuditaOS::verifyVersion()
updateos::UpdateError UpdateMuditaOS::updateBootloader()
{
    informDebug("updateBootloader");
    status = updateos::UpdateState::UpdatingBootloader;

    if (isUpdateToBeAborted()) {
        setUpdateAbortFlag(false);
        sys::SystemManager::Reboot(owner);
        return updateos::UpdateError::UpdateAborted;
    }
    else {
        informUpdateWindow();
    }

    if (targetVersionInfo[boot::json::bootloader][parserFSM::json::fileName].is_string()) {
        fs::path bootloaderFile =
            getUpdateTmpChild(targetVersionInfo[boot::json::bootloader][parserFSM::json::fileName].string_value());


@@ 338,6 381,7 @@ updateos::UpdateError UpdateMuditaOS::prepareRoot()
    informDebug("prepareRoot()");
    // basic needed dirs

    status                    = updateos::UpdateState::VersionVerificiation;
    const auto previousOSPath = purefs::dir::getPreviousOSPath();
    const auto currentOSPath  = purefs::dir::getCurrentOSPath();
    const auto userDiskPath   = purefs::dir::getUserDiskPath();


@@ 508,6 552,9 @@ updateos::UpdateError UpdateMuditaOS::cleanupAfterUpdate()
    }

    status = updateos::UpdateState::ReadyForReset;

    informUpdateWindow();

    return updateos::UpdateError::NoError;
}



@@ 522,12 569,16 @@ const fs::path UpdateMuditaOS::getUpdateTmpChild(const fs::path &childPath)
updateos::UpdateError UpdateMuditaOS::prepareTempDirForUpdate(const std::filesystem::path &temporaryPath,
                                                              const std::filesystem::path &updatesOSPath)
{
    status = updateos::UpdateState::CreatingDirectories;

    if (isUpdateToBeAborted()) {
        setUpdateAbortFlag(false);
        sys::SystemManager::Reboot(owner);
        return updateos::UpdateError::UpdateAborted;
    }

    status = updateos::UpdateState::CreatingDirectories;
    else {
        informUpdateWindow();
    }

    updateTempDirectory = temporaryPath / utils::filesystem::generateRandomId(updateos::prefix_len);



@@ 806,6 857,14 @@ void UpdateMuditaOS::setInitialHistory(const std::string &initialHistory)
        updateHistory = json11::Json();
    }
}
void UpdateMuditaOS::informUpdateWindow()
{
    fs::path file  = UpdateMuditaOS::checkForUpdate();
    auto msgToSend = std::make_shared<sdesktop::UpdateOsMessage>(updateos::UpdateMessageType::UpdateNow, file);
    msgToSend->updateStats.versionInformation = UpdateMuditaOS::getVersionInfoFromFile(file);
    msgToSend->updateStats.status             = status;
    owner->bus.sendUnicast(msgToSend, app::name_desktop);
}

void UpdateMuditaOS::storeRunStatusInDB()
{

M module-services/service-desktop/endpoints/update/UpdateMuditaOS.hpp => module-services/service-desktop/endpoints/update/UpdateMuditaOS.hpp +1 -0
@@ 171,6 171,7 @@ class UpdateMuditaOS : public updateos::UpdateStats
    static const fs::path checkForUpdate();
    void historyValueChanged(const std::string &value);
    void setInitialHistory(const std::string &initialHistory);
    void informUpdateWindow();
    json11::Json getUpdateHistory() const
    {
        return updateHistory;

M module-sys/SystemManager/SystemManager.cpp => module-sys/SystemManager/SystemManager.cpp +10 -0
@@ 458,6 458,16 @@ namespace sys
                    continue;
                }

                if (service->GetName() == service::name::gui) {
                    LOG_DEBUG("Delay closing %s", service::name::gui);
                    continue;
                }

                if (service->GetName() == service::name::eink) {
                    LOG_DEBUG("Delay closing %s", service::name::eink);
                    continue;
                }

                if (service->GetName() == app::manager::ApplicationManager::ServiceName) {
                    LOG_DEBUG("Delay closing %s", app::manager::ApplicationManager::ServiceName);
                    continue;