~aleteoryx/muditaos

3887c43ca51732e2c32b2ce35215e2bba11645d4 — Lefucjusz 3 years ago 58fe1b1
[CP-1734] Create factory reset reboot UI

Create window that will be shown when the
device turns off first time after factory
reset request made from PureOS.
M image/system_a/data/lang/Deutsch.json => image/system_a/data/lang/Deutsch.json +2 -1
@@ 452,7 452,8 @@
  "app_settings_security": "Sicherheit",
  "app_settings_language": "Sprache",
  "app_settings_factory_reset": "Auf Werkseinstellung zurücksetzen",
  "app_settings_display_factory_reset_confirmation": "Sie müssen Ihren Pure neu starten \num den Werksreset abzuschließen.\n Handy jetzt ausschalten?",
  "app_settings_display_factory_reset_confirmation": "Dadurch wird dein Pure ausgeschaltet. Schalte es wieder ein, um mit dem Prozess fortzufahren.\nTelefon jetzt ausschalten?",
  "app_settings_factory_reset_in_progress": "Die Werkseinstellungen wurden noch nicht vollständig wiederhergestellt. Schalte dein Pure wieder ein, um fortzufahren.",
  "app_settings_about_your_pure": "Über Ihr Pure",
  "app_settings_technical_information": "Technische Informationen",
  "app_settings_tech_info_model": "Modell",

M image/system_a/data/lang/English.json => image/system_a/data/lang/English.json +2 -1
@@ 409,7 409,8 @@
  "app_settings_security": "Security",
  "app_settings_language": "Language",
  "app_settings_factory_reset": "Factory reset",
  "app_settings_display_factory_reset_confirmation": "You need to restart your Pure \nto finalize factory reset.\n Turn off the phone now?",
  "app_settings_display_factory_reset_confirmation": "Your Pure will turn off. Turn it on manually to continue the process.\nTurn off the phone now?",
  "app_settings_factory_reset_in_progress": "The factory reset process is not\ncompleted yet, turn on your Pure\nto continue.",
  "app_settings_about_your_pure": "About your Pure",
  "app_settings_technical_information": "Technical Information",
  "app_settings_tech_info_model": "Model",

M image/system_a/data/lang/Espanol.json => image/system_a/data/lang/Espanol.json +2 -1
@@ 452,7 452,8 @@
  "app_settings_security": "Seguridad",
  "app_settings_language": "Idioma",
  "app_settings_factory_reset": "Configuración de fábrica",
  "app_settings_display_factory_reset_confirmation": "Necesita reiniciar su Pure \npara finalizar el reinicio de fábrica.\n ¿Apagar el teléfono ahora?",
  "app_settings_display_factory_reset_confirmation": "Tu Pure se va a apagar. Enciéndelo manualmente para continuar.\n¿Quieres apagar el teléfono ahora?",
  "app_settings_factory_reset_in_progress": "Aún no se han restablecido los valores de fábrica, enciende tu dispositivo Pure para continuar.",
  "app_settings_about_your_pure": "Mi dispositivo Pure",
  "app_settings_technical_information": "Información técnica",
  "app_settings_tech_info_model": "Modelo",

M image/system_a/data/lang/Francais.json => image/system_a/data/lang/Francais.json +2 -1
@@ 420,7 420,8 @@
  "app_settings_security": "Sécurité",
  "app_settings_language": "Langues",
  "app_settings_factory_reset": "Retour aux paramètres d'usine",
  "app_settings_display_factory_reset_confirmation": "Il faut redémarrer votre Pure\npour finaliser la réinitialisation d'usine.\nÉteindre le téléphone maintenant?",
  "app_settings_display_factory_reset_confirmation": "Votre Pure va s'éteindre. Allumez-la manuellement pour continuer.\nÉteindre le téléphone?",
  "app_settings_factory_reset_in_progress": "La ré-initialisation de l'usine n'est pas encore terminée, allumez votre Pure pour continuer.",
  "app_settings_about_your_pure": "À propos de votre Pure",
  "app_settings_technical_information": "Informations techniques",
  "app_settings_tech_info_model": "Modèle",

M image/system_a/data/lang/Polski.json => image/system_a/data/lang/Polski.json +2 -1
@@ 463,7 463,8 @@
  "app_settings_security": "Bezpieczeństwo",
  "app_settings_language": "Język",
  "app_settings_factory_reset": "Ustawienia fabryczne",
  "app_settings_display_factory_reset_confirmation": "Musisz ponownie uruchomić Pure \naby przywrócić ustawieia fabryczne.\nWyłączyć telefon?",
  "app_settings_display_factory_reset_confirmation": "Pure zostanie teraz wyłączony. Aby rozpocząć proces, włącz go ponownie.\nWyłączyć telefon?",
  "app_settings_factory_reset_in_progress": "Proces przywracania ustawień fabrycznych nie został jeszcze zakończony.\nUruchom telefon aby kontynuować.",
  "app_settings_about_your_pure": "Dane telefonu",
  "app_settings_technical_information": "Informacje techniczne",
  "app_settings_tech_info_model": "Model",

M image/system_a/data/lang/Svenska.json => image/system_a/data/lang/Svenska.json +2 -1
@@ 363,7 363,8 @@
  "app_settings_security": "Säkerhet",
  "app_settings_language": "Språk",
  "app_settings_factory_reset": "Fabriksinställningar",
  "app_settings_display_factory_reset_confirmation": "Du måste starta om din Pure\nslutföra fabriksåterställningen.\nStänga av telefonen nu?",
  "app_settings_display_factory_reset_confirmation": "Din Pure stängs av. Sätt på den manuellt för att fortsätta.\nStäng av telefonen nu?",
  "app_settings_factory_reset_in_progress": "Fabriksåterställningen är inte klar än. Sätt på din Pure för att fortsätta.",
  "app_settings_about_your_pure": "Om din Pure",
  "app_settings_technical_information": "Teknisk information",
  "app_settings_tech_info_model": "Model",

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

#pragma once

M module-apps/application-settings/ApplicationSettings.cpp => module-apps/application-settings/ApplicationSettings.cpp +10 -1
@@ 51,6 51,7 @@
#include <application-settings/windows/system/TechnicalInformationWindow.hpp>
#include <application-settings/windows/system/CertificationWindow.hpp>
#include <application-settings/windows/system/SARInfoWindow.hpp>
#include <application-settings/windows/system/FactoryResetInProgressWindow.hpp>
#include <application-settings/data/ApnListData.hpp>
#include <application-settings/data/BondedDevicesData.hpp>
#include <application-settings/data/BluetoothStatusData.hpp>


@@ 329,6 330,11 @@ namespace app
        connect(typeid(cellular::VolteStateNotification),
                [&](sys::Message *msg) -> sys::MessagePointer { return handleVolteState(msg); });

        addActionReceiver(app::manager::actions::DisplayFactoryResetInProgressScreen, [this](auto &&data) {
            requestShutdownWindow(gui::window::name::factory_reset_in_progress);
            return actionHandled();
        });

        createUserInterface();

        settings->registerValueChange(settings::operators_on,


@@ 557,7 563,6 @@ namespace app
        windowsFactory.attach(gui::window::name::factory_reset, [](ApplicationCommon *app, const std::string &name) {
            return std::make_unique<gui::DialogYesNo>(app, name);
        });

        windowsFactory.attach(gui::window::name::dialog_settings, [](ApplicationCommon *app, const std::string &name) {
            return std::make_unique<gui::Dialog>(app, name);
        });


@@ 567,6 572,10 @@ namespace app
        windowsFactory.attach(gui::window::name::dialog_retry, [](ApplicationCommon *app, const std::string &name) {
            return std::make_unique<gui::DialogRetry>(app, name);
        });
        windowsFactory.attach(gui::window::name::factory_reset_in_progress,
                              [](ApplicationCommon *app, const std::string &name) {
                                  return std::make_unique<gui::FactoryResetInProgressWindow>(app);
                              });

        attachPopups({gui::popup::ID::Volume,
                      gui::popup::ID::Tethering,

M module-apps/application-settings/CMakeLists.txt => module-apps/application-settings/CMakeLists.txt +2 -0
@@ 94,6 94,7 @@ target_sources(application-settings
        windows/system/SARInfoWindow.cpp
        windows/system/SystemMainWindow.cpp
        windows/system/TechnicalInformationWindow.cpp
        windows/system/FactoryResetInProgressWindow.cpp
    PRIVATE
        models/advanced/ColorTestModel.hpp
        widgets/SettingsStyle.hpp


@@ 128,6 129,7 @@ target_sources(application-settings
        windows/system/LanguagesWindow.hpp
        windows/system/SystemMainWindow.hpp
        windows/system/TechnicalInformationWindow.hpp
        windows/system/FactoryResetInProgressWindow.hpp
    PUBLIC
        include/application-settings/ApplicationSettings.hpp
)

M module-apps/application-settings/include/application-settings/ApplicationSettings.hpp => module-apps/application-settings/include/application-settings/ApplicationSettings.hpp +2 -1
@@ 217,7 217,8 @@ namespace app
            return {{manager::actions::Launch,
                     manager::actions::PhoneModeChanged,
                     manager::actions::BluetoothModeChanged,
                     manager::actions::AlarmClockStatusChanged}};
                     manager::actions::AlarmClockStatusChanged,
                     manager::actions::DisplayFactoryResetInProgressScreen}};
        }
    };
} /* namespace app */

M module-apps/application-settings/windows/WindowNames.hpp => module-apps/application-settings/windows/WindowNames.hpp +1 -0
@@ 65,6 65,7 @@ namespace gui::window::name
    inline constexpr auto certification         = "Certification";
    inline constexpr auto sar                   = "Sar";
    inline constexpr auto factory_reset         = "FactoryReset";
    inline constexpr auto factory_reset_in_progress = "FactoryResetInProgress";

    inline constexpr auto dialog_settings = "DialogSettings";
} // namespace gui::window::name

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

#include "FactoryResetInProgressWindow.hpp"
#include <application-settings/windows/WindowNames.hpp>

#include <i18n/i18n.hpp>

namespace gui
{
    FactoryResetInProgressWindow::FactoryResetInProgressWindow(app::ApplicationCommon *app)
        : AppWindow(app, gui::window::name::factory_reset_in_progress)
    {
        buildInterface();
    }

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

        statusBar->setVisible(false);
        navBar->setVisible(false);

        infoIcon = new gui::Icon(this,
                                 style::window::default_left_margin,
                                 style::window::default_vertical_pos,
                                 style::window::default_body_width,
                                 style::window::default_body_height,
                                 "",
                                 utils::translate(""));
        infoIcon->setAlignment(Alignment::Horizontal::Center);
        infoIcon->image->set("progress_128px_W_G");
        infoIcon->text->setText(utils::translate("app_settings_factory_reset_in_progress"));
    }

} /* namespace gui */

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

#pragma once

#include <AppWindow.hpp>
#include <gui/widgets/Icon.hpp>

namespace gui
{
    class FactoryResetInProgressWindow : public AppWindow
    {
      private:
        Icon *infoIcon = nullptr;

      public:
        explicit FactoryResetInProgressWindow(app::ApplicationCommon *app);
        void buildInterface() override;
    };
} /* namespace gui */

M module-services/service-appmgr/include/service-appmgr/Actions.hpp => module-services/service-appmgr/include/service-appmgr/Actions.hpp +1 -0
@@ 52,6 52,7 @@ namespace app::manager
            DisplayLowBatteryScreen,
            SystemBrownout,
            DisplayLogoAtExit,
            DisplayFactoryResetInProgressScreen,
            SMSRejectedByOfflineNotification,
            CallRejectedByOfflineNotification,
            PhoneModeChanged,

M module-services/service-appmgr/model/ApplicationManagerCommon.cpp => module-services/service-appmgr/model/ApplicationManagerCommon.cpp +4 -3
@@ 21,11 21,9 @@
#include <Utils.hpp>
#include <service-appmgr/Constants.hpp>
#include <service-desktop/Constants.hpp>
#include <service-desktop/DesktopMessages.hpp>
#include <service-eink/ServiceEink.hpp>
#include <service-evtmgr/EventManagerCommon.hpp>
#include <AppWindowConstants.hpp>
#include <service-db/DBServiceAPI.hpp>

#include <algorithm>
#include <utility>


@@ 38,7 36,8 @@ namespace app::manager

        bool checkIfCloseableAction(const actions::Action action)
        {
            return action == app::manager::actions::DisplayLogoAtExit or
            return action == app::manager::actions::DisplayFactoryResetInProgressScreen ||
                   action == app::manager::actions::DisplayLogoAtExit ||
                   action == app::manager::actions::SystemBrownout;
        }



@@ 48,6 47,8 @@ namespace app::manager
            case sys::CloseReason::SystemBrownout:
            case sys::CloseReason::LowBattery:
                return ActionRequest{senderName, app::manager::actions::SystemBrownout, nullptr};
            case sys::CloseReason::RebootToRecovery:
                return ActionRequest{senderName, app::manager::actions::DisplayFactoryResetInProgressScreen, nullptr};
            default:
                return ActionRequest{senderName, app::manager::actions::DisplayLogoAtExit, nullptr};
            }

M products/PurePhone/PurePhoneMain.cpp => products/PurePhone/PurePhoneMain.cpp +1 -1
@@ 185,7 185,7 @@ int main()
    systemServices.emplace_back(sys::CreatorFor<stm::ServiceTime>(std::make_shared<alarms::AlarmOperationsFactory>()));
#endif
#ifdef ENABLE_SERVICE_EINK
    systemServices.emplace_back(sys::CreatorFor<service::eink::ServiceEink>());
    systemServices.emplace_back(sys::CreatorFor<service::eink::ServiceEink>(service::eink::ExitAction::None));
#endif
#ifdef ENABLE_SERVICE_GUI
    systemServices.emplace_back(