~aleteoryx/muditaos

85cf420b8d68c5b3da68cbcda5f7fe93bc38bcca — Przemyslaw Brudny 4 years ago 7ad067d
[EGD-8080] Added 4 hour deep refresh on locked screen

Added 4 hour deep refresh on locked screen.
M module-apps/apps-common/ApplicationCommon.cpp => module-apps/apps-common/ApplicationCommon.cpp +2 -2
@@ 927,8 927,8 @@ namespace app

    bool ApplicationCommon::isCurrentWindow(const std::string &windowName) const noexcept
    {
        if (const auto &window = windowsStack().get(windowName); window != nullptr) {
            return window->getName() == windowName;
        if (const auto &window = windowsStack().get(topWindow); window != std::nullopt) {
            return window == windowName;
        }
        LOG_ERROR("no window: %s", windowName.c_str());
        return false;

M module-apps/apps-common/popups/lock-popups/PhoneLockedWindow.cpp => module-apps/apps-common/popups/lock-popups/PhoneLockedWindow.cpp +13 -0
@@ 3,6 3,7 @@

#include "PhoneLockedWindow.hpp"
#include "PhoneLockedInfoData.hpp"
#include "Timers/TimerFactory.hpp"

#include <locks/input/PhoneLockedKeysWhitelist.hpp>
#include <service-appmgr/Controller.hpp>


@@ 24,6 25,12 @@ namespace gui
        buildInterface();

        preBuildDrawListHook = [this](std::list<Command> &cmd) { updateTime(); };

        screenRefreshTimer =
            sys::TimerFactory::createPeriodicTimer(application, refreshTimerName, refreshTimeout, [this](sys::Timer &) {
                application->refreshWindow(RefreshModes::GUI_REFRESH_DEEP);
                return;
            });
    }

    void PhoneLockedWindow::buildInterface()


@@ 61,6 68,7 @@ namespace gui
            navBar->setText(nav_bar::Side::Center, utils::translate("app_desktop_unlock"));
            navBar->setActive(nav_bar::Side::Right, false);
        }
        screenRefreshTimer.start();
    }

    bool PhoneLockedWindow::updateTime()


@@ 105,6 113,11 @@ namespace gui
        return true;
    }

    void PhoneLockedWindow::onClose(Window::CloseReason reason)
    {
        screenRefreshTimer.stop();
    }

    status_bar::Configuration PhoneLockedWindow::configureStatusBar(status_bar::Configuration appConfiguration)
    {
        appConfiguration.disable(status_bar::Indicator::NetworkAccessTechnology);

M module-apps/apps-common/popups/lock-popups/PhoneLockedWindow.hpp => module-apps/apps-common/popups/lock-popups/PhoneLockedWindow.hpp +5 -0
@@ 26,6 26,7 @@ namespace gui

        bool onInput(const InputEvent &inputEvent) override;
        void onBeforeShow(ShowMode mode, SwitchData *data) override;
        void onClose(CloseReason reason) override;
        void buildInterface() override;
        status_bar::Configuration configureStatusBar(status_bar::Configuration appConfiguration) override;



@@ 40,6 41,10 @@ namespace gui
        bool processLongReleaseEvent(const InputEvent &inputEvent);

      private:
        static constexpr auto refreshTimerName = "PhoneLockRefreshTimer";
        static constexpr auto refreshTimeout   = std::chrono::hours(4);
        sys::TimerHandle screenRefreshTimer;

        std::shared_ptr<WallpaperClock> clockWallpaper;
        std::unique_ptr<WallpaperPresenter> wallpaperPresenter;
    };