~aleteoryx/muditaos

ace3f5e6ce84bb2eaf3e290c2ce510faa56900b6 — rrandomsky 2 years ago f522905
[MOS-973] Fix for a ghost call after quick click back key to end a call

Fixed a scenario where the user click to make a call to some contact and
then quickly click BACK (right function button) to end the call and despite
that Pure was still calling without showing any information.
This fix prevent to handle key press event as a key longpress even after
application lose a focus, or change a state.
M module-apps/application-call/ApplicationCall.cpp => module-apps/application-call/ApplicationCall.cpp +6 -0
@@ 205,6 205,12 @@ namespace app
        return ret;
    }

    sys::MessagePointer ApplicationCall::handleAppClose(sys::Message *msgl)
    {
        callModel->hangUpCall();
        return ApplicationCommon::handleAppClose(msgl);
    }

    void ApplicationCall::createUserInterface()
    {
        windowsFactory.attach(app::window::name_enterNumber, [](ApplicationCommon *app, const std::string &name) {

M module-apps/application-call/include/application-call/ApplicationCall.hpp => module-apps/application-call/include/application-call/ApplicationCall.hpp +1 -0
@@ 54,6 54,7 @@ namespace app
                                 StartInBackground startInBackground = {false});
        sys::MessagePointer DataReceivedHandler(sys::DataMessage *msgl, sys::ResponseMessage *resp) override;
        sys::ReturnCodes InitHandler() override;
        sys::MessagePointer handleAppClose(sys::Message *msgl) override;

        sys::ReturnCodes SwitchPowerModeHandler(const sys::ServicePowerMode mode) override final
        {

M module-apps/apps-common/ApplicationCommon.cpp => module-apps/apps-common/ApplicationCommon.cpp +5 -0
@@ 180,6 180,11 @@ namespace app
#if DEBUG_APPLICATION_MANAGEMENT == 1
        LOG_DEBUG("[%s] (%s) -> (%s)", GetName().c_str(), stateStr(state), stateStr(st));
#endif
        // To prevent handling of key presses event from other state of application as a longPress
        if (state != st) {
            keyTranslator->resetPreviousKeyPress();
            longPressTimer.stop();
        }
        state = st;
    }


M module-gui/gui/input/Translator.cpp => module-gui/gui/input/Translator.cpp +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

#include "Translator.hpp"


@@ 71,6 71,7 @@ namespace gui
    void KeyBaseTranslation::resetPreviousKeyPress()
    {
        previousKeyPress = {};
        isPreviousKeyPressed = false;
    }

    void KeyBaseTranslation::setPreviousKeyTimedOut(bool status)

M pure_changelog.md => pure_changelog.md +1 -0
@@ 43,6 43,7 @@
* Fixed wrong notification about multiple unread messages in case there's only one unread left
* Fixed missing notification about new SMS when phone was locked on application Messages
* Fixed MTP availability only after phone unlocked
* Fixed a ghost call after quick click back key to end a call after start a call

## [1.7.0 2023-03-23]
### Changed / Improved