~aleteoryx/muditaos

4ce5b308fddfea99336f9ec27fec13e197d08688 — Wojtek Rzepecki 4 years ago 5ad878c
[EGD-6899] Fix AppCall access

Fix of an access to call window
during tethering
M module-apps/application-desktop/windows/DesktopMainWindow.cpp => module-apps/application-desktop/windows/DesktopMainWindow.cpp +13 -4
@@ 134,8 134,7 @@ namespace gui
    {
        // long press of '0' key is translated to '+'
        if (inputEvent.is(KeyCode::KEY_0)) {
            return app::manager::Controller::sendAction(
                application, app::manager::actions::Dial, std::make_unique<app::EnterNumberData>("+"));
            return resolveDialAction(std::string{"+"});
        }
        if (inputEvent.is(KeyCode::KEY_RF)) {
            application->switchWindow(popup::window::power_off_window);


@@ 157,8 156,7 @@ namespace gui
        // if numeric key was pressed record that key and send it to call application
        if (code != 0) {
            const auto &number = std::string(1, static_cast<char>(code));
            return app::manager::Controller::sendAction(
                application, app::manager::actions::Dial, std::make_unique<app::EnterNumberData>(number));
            return resolveDialAction(number);
        }
        else if (const auto notificationsNotFocused = (focusItem == nullptr);
                 notificationsNotFocused && !notificationsModel->isEmpty()) {


@@ 268,4 266,15 @@ namespace gui
        return true;
    }

    bool DesktopMainWindow::resolveDialAction(const std::string &number)
    {
        if (notificationsModel->isTetheringOn()) {
            return false;
        }
        else {
            return app::manager::Controller::sendAction(
                application, app::manager::actions::Dial, std::make_unique<app::EnterNumberData>(number));
        }
    }

} /* namespace gui */

M module-apps/application-desktop/windows/DesktopMainWindow.hpp => module-apps/application-desktop/windows/DesktopMainWindow.hpp +1 -0
@@ 50,6 50,7 @@ namespace gui
        bool updateTime() override;

      private:
        bool resolveDialAction(const std::string &number);
        bool showInformationPopup(std::function<bool()> action, const std::string &notification);
        void invalidate() noexcept;
        std::string osUpdateVer;