~aleteoryx/muditaos

3623a84da9d7a9e382da241b8c365d36431925ac — Pawel Paprocki 5 years ago e6fdf0e
[EGD-5517] Add MMI custom response window

Add MMI custom response windows for:
Call barring
Call waiting
CLIP
CLIR
IMEI
M image/assets/lang/English.json => image/assets/lang/English.json +36 -5
@@ 182,7 182,27 @@
  "app_desktop_info_mmi_none_specified_failed": "Operation failed",
  "app_desktop_info_mmi_none_specified_success": "Operation successful",
  "app_desktop_info_mmi_common_failed": "failed",
  "app_desktop_info_mmi_common_no" :"not",
  "app_desktop_info_mmi_common_no_meassage" :"not",
  "app_desktop_info_mmi_common_mmi_not_supported": "not supported",
  "app_desktop_info_mmi_common_enabled": "enabled",
  "app_desktop_info_mmi_common_disabled": "disabled",
  "app_desktop_info_mmi_common_voice": "voice",
  "app_desktop_info_mmi_common_data": "data",
  "app_desktop_info_mmi_common_fax": "FAX",
  "app_desktop_info_mmi_common_sync": "sync",
  "app_desktop_info_mmi_common_async": "async",
  "app_desktop_info_mmi_common_all_disabled": "all disabled",
  "app_desktop_info_mmi_common_deactivated":"deactivated",
  "app_desktop_info_mmi_common_activated": "activated",
  "app_desktop_info_mmi_common_query": "query",
  "app_desktop_info_mmi_clir_according_to_subscription": "CLIR according to subscription",
  "app_desktop_info_mmi_clir_enabled": "CLIR enabled",
  "app_desktop_info_mmi_clir_disabled": "CLIR diasbled",
  "app_desktop_info_mmi_clir_not_provisioned": "CLIR not provisioned",
  "app_desktop_info_mmi_clir_permanent_provisioned": "CLIR permanently provisioned",
  "app_desktop_info_mmi_clir_unknown": "CLIR unknown",
  "app_desktop_info_mmi_clir_temporary_restricted": "CLIR temporarily restricted",
  "app_desktop_info_mmi_clir_temporary_allowed": "CLIR temporarily allowed",
  "app_desktop_info_mmi_registration_failed": "Registration failed",
  "app_desktop_info_mmi_registration_success": "Registration was successful",
  "app_desktop_info_mmi_erasure_failed": "Erasure failed",


@@ 191,11 211,22 @@
  "app_desktop_info_mmi_disabling_success": "Service has been disabled",
  "app_desktop_info_mmi_enabling_failed": "Service enabling failed",
  "app_desktop_info_mmi_enabling_success": "Service has been enabled",
  "app_desktop_info_mmi_voice": "voice",
  "app_desktop_info_mmi_fax": "FAX",
  "app_desktop_info_mmi_sync": "sync",
  "app_desktop_info_mmi_async": "async",
  "app_desktop_info_mmi_call_forwarding_disabled": "call forwarding disabled",
  "app_desktop_info_mmi_call_barring_activated": "call barring activated",
  "app_desktop_info_mmi_call_barring_deactivated": "call barring deactivated",
  "app_desktop_info_mmi_clip_activated": "CLIP activated",
  "app_desktop_info_mmi_clip_deactivated": "CLIP deactivated",
  "app_desktop_info_mmi_clip_not_provisioned": "CLIP not provisioned",
  "app_desktop_info_mmi_clip_provisioned": "CLIP provisioned",
  "app_desktop_info_mmi_clip_unknown": "CLIP unknown",
  "app_desktop_info_mmi_call_waiting_activated": " call waiting activated",
  "app_desktop_info_mmi_call_waiting_deactivated": "call waiting deactivated",
  "app_desktop_info_mmi_call_forwarding" : "Call forwarding",
  "app_desktop_info_mmi_call_barring" : "Call barring",
  "app_desktop_info_mmi_call_waiting" : "Call waiting",
  "app_desktop_info_mmi_clip" : "Caller ID displayed (CLIP)",
  "app_desktop_info_mmi_clir" : "Caller ID suppressed (CLIR)",
  "app_desktop_info_mmi_imei" : "IMEI (MEID)",
  "app_desktop_info_mmi_result_success": "Success",
  "app_desktop_info_mmi_result_failed": "Failed",
  "app_desktop_header_sim_setup": "<text><token>$SIM</token> setup</text>",

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

#pragma once


@@ 31,7 31,47 @@ namespace mmi
            messageDictionary.emplace(mmiactions::IMMICustomResultParams::MMIResultMessage::CommonFailure,
                                      "app_desktop_info_mmi_common_failed");
            messageDictionary.emplace(mmiactions::IMMICustomResultParams::MMIResultMessage::CommonNoMessage,
                                      "app_desktop_info_mmi_common_no");
                                      "app_desktop_info_mmi_common_no_message");
            messageDictionary.emplace(mmiactions::IMMICustomResultParams::MMIResultMessage::CommonMMINotSupported,
                                      "app_desktop_info_mmi_common_mmi_not_supported");
            messageDictionary.emplace(mmiactions::IMMICustomResultParams::MMIResultMessage::CommonEnabled,
                                      "app_desktop_info_mmi_common_enabled");
            messageDictionary.emplace(mmiactions::IMMICustomResultParams::MMIResultMessage::CommonDisabled,
                                      "app_desktop_info_mmi_common_disabled");
            messageDictionary.emplace(mmiactions::IMMICustomResultParams::MMIResultMessage::CommonVoice,
                                      "app_desktop_info_mmi_common_voice");
            messageDictionary.emplace(mmiactions::IMMICustomResultParams::MMIResultMessage::CommonData,
                                      "app_desktop_info_mmi_common_data");
            messageDictionary.emplace(mmiactions::IMMICustomResultParams::MMIResultMessage::CommonFax,
                                      "app_desktop_info_mmi_common_fax");
            messageDictionary.emplace(mmiactions::IMMICustomResultParams::MMIResultMessage::CommonSync,
                                      "app_desktop_info_mmi_common_sync");
            messageDictionary.emplace(mmiactions::IMMICustomResultParams::MMIResultMessage::CommonAsync,
                                      "app_desktop_info_mmi_common_async");
            messageDictionary.emplace(mmiactions::IMMICustomResultParams::MMIResultMessage::CommonAllDisabled,
                                      "app_desktop_info_mmi_common_all_disabled");
            messageDictionary.emplace(mmiactions::IMMICustomResultParams::MMIResultMessage::CommonDeactivated,
                                      "app_desktop_info_mmi_common_deactivated");
            messageDictionary.emplace(mmiactions::IMMICustomResultParams::MMIResultMessage::CommonActivated,
                                      "app_desktop_info_mmi_common_activated");
            messageDictionary.emplace(mmiactions::IMMICustomResultParams::MMIResultMessage::CommonQuery,
                                      "app_desktop_info_mmi_common_query");
            messageDictionary.emplace(mmiactions::IMMICustomResultParams::MMIResultMessage::ClirAccordingToSubscription,
                                      "app_desktop_info_mmi_clir_according_to_subscription");
            messageDictionary.emplace(mmiactions::IMMICustomResultParams::MMIResultMessage::ClirEnabled,
                                      "app_desktop_info_mmi_clir_enabled");
            messageDictionary.emplace(mmiactions::IMMICustomResultParams::MMIResultMessage::ClirDisabled,
                                      "app_desktop_info_mmi_clir_disabled");
            messageDictionary.emplace(mmiactions::IMMICustomResultParams::MMIResultMessage::ClirNotProvisioned,
                                      "app_desktop_info_mmi_clir_not_provisioned");
            messageDictionary.emplace(mmiactions::IMMICustomResultParams::MMIResultMessage::ClirPermanentProvisioned,
                                      "app_desktop_info_mmi_clir_permanent_provisioned");
            messageDictionary.emplace(mmiactions::IMMICustomResultParams::MMIResultMessage::ClirUnknown,
                                      "app_desktop_info_mmi_clir_unknown");
            messageDictionary.emplace(mmiactions::IMMICustomResultParams::MMIResultMessage::ClirTemporaryRestricted,
                                      "app_desktop_info_mmi_clir_temporary_restricted");
            messageDictionary.emplace(mmiactions::IMMICustomResultParams::MMIResultMessage::ClirTemporaryAllowed,
                                      "app_desktop_info_mmi_clir_temporary_allowed");
            messageDictionary.emplace(mmiactions::IMMICustomResultParams::MMIResultMessage::RegistrationSuccessful,
                                      "app_desktop_info_mmi_registration_success");
            messageDictionary.emplace(mmiactions::IMMICustomResultParams::MMIResultMessage::RegistrationFailed,


@@ 48,6 88,26 @@ namespace mmi
                                      "app_desktop_info_mmi_enabling_success");
            messageDictionary.emplace(mmiactions::IMMICustomResultParams::MMIResultMessage::EnablingFailed,
                                      "app_desktop_info_mmi_enabling_failed");
            messageDictionary.emplace(mmiactions::IMMICustomResultParams::MMIResultMessage::CallForwardingDisabled,
                                      "app_desktop_info_mmi_call_forwarding_disabled");
            messageDictionary.emplace(mmiactions::IMMICustomResultParams::MMIResultMessage::CallBarringActivated,
                                      "app_desktop_info_mmi_call_barring_activated");
            messageDictionary.emplace(mmiactions::IMMICustomResultParams::MMIResultMessage::CallBarringDeactivated,
                                      "app_desktop_info_mmi_call_barring_deactivated");
            messageDictionary.emplace(mmiactions::IMMICustomResultParams::MMIResultMessage::ClipActivted,
                                      "app_desktop_info_mmi_clip_activated");
            messageDictionary.emplace(mmiactions::IMMICustomResultParams::MMIResultMessage::ClipDeactivated,
                                      "app_desktop_info_mmi_clip_deactivated");
            messageDictionary.emplace(mmiactions::IMMICustomResultParams::MMIResultMessage::ClipNotProvisioned,
                                      "app_desktop_info_mmi_clip_not_provisioned");
            messageDictionary.emplace(mmiactions::IMMICustomResultParams::MMIResultMessage::ClipProvisioned,
                                      "app_desktop_info_mmi_clip_provisioned");
            messageDictionary.emplace(mmiactions::IMMICustomResultParams::MMIResultMessage::ClipUnknown,
                                      "app_desktop_info_mmi_clip_unknown");
            messageDictionary.emplace(mmiactions::IMMICustomResultParams::MMIResultMessage::CallWaitingActivated,
                                      "app_desktop_info_mmi_call_waiting_activated");
            messageDictionary.emplace(mmiactions::IMMICustomResultParams::MMIResultMessage::CallWaitingDeactivated,
                                      "app_desktop_info_mmi_call_waiting_deactivated");
        };

        virtual void visit(mmiactions::MMINoneSpecifiedResult &customResult, std::string &displayMessage)


@@ 65,10 125,10 @@ namespace mmi
            displayMessage += utils::localize.get("app_desktop_info_mmi_call_forwarding") + "\n";
            if (customResult.getMessageType() == mmiactions::IMMICustomResultParams::MMIType::CallForwardingData) {
                auto [voice, fax, sync, async] = customResult.getData();
                displayMessage += utils::localize.get("app_desktop_info_mmi_voice") + ": " + voice + "\n" +
                                  utils::localize.get("app_desktop_info_mmi_fax") + ": " + fax + "\n" +
                                  utils::localize.get("app_desktop_info_mmi_sync") + ": " + sync + "\n" +
                                  utils::localize.get("app_desktop_info_mmi_async") + ": " + async + "\n";
                displayMessage += utils::localize.get("app_desktop_info_mmi_common_voice") + ": " + voice + "\n" +
                                  utils::localize.get("app_desktop_info_mmi_common_fax") + ": " + fax + "\n" +
                                  utils::localize.get("app_desktop_info_mmi_common_sync") + ": " + sync + "\n" +
                                  utils::localize.get("app_desktop_info_mmi_common_async") + ": " + async + "\n";
            }
            else if (customResult.getMessageType() ==
                     mmiactions::IMMICustomResultParams::MMIType::CallForwardingNotification) {


@@ 76,6 136,66 @@ namespace mmi
            }
        }

        virtual void visit(mmiactions::MMICallBarringResult &customResult, std::string &displayMessage)
        {
            displayMessage += utils::localize.get("app_desktop_info_mmi_call_barring") + "\n";
            if (customResult.getMessageType() == mmiactions::IMMICustomResultParams::MMIType::CallBarringData) {
                displayMessage += getQueryResult(customResult.getMessages());
            }
            else if (customResult.getMessageType() ==
                     mmiactions::IMMICustomResultParams::MMIType::CallBarringNotification) {
                displayMessage += getSelectedMessagesFromDictionary(customResult.getMessage());
            }
        }

        virtual void visit(mmiactions::MMICallWaitingResult &customResult, std::string &displayMessage)
        {
            displayMessage += utils::localize.get("app_desktop_info_mmi_call_waiting") + "\n";
            if (customResult.getMessageType() == mmiactions::IMMICustomResultParams::MMIType::CallWaitingData) {
                displayMessage += getQueryResult(customResult.getMessages());
            }
            else if (customResult.getMessageType() ==
                     mmiactions::IMMICustomResultParams::MMIType::CallWaitingNotification) {
                displayMessage += getSelectedMessagesFromDictionary(customResult.getMessage());
            }
        }

        virtual void visit(mmiactions::MMIClipResult &customResult, std::string &displayMessage)
        {
            displayMessage += utils::localize.get("app_desktop_info_mmi_clip") + "\n";
            displayMessage += getSelectedMessagesFromDictionary(customResult.getMessage());
        }

        virtual void visit(mmiactions::MMIClirResult &customResult, std::string &displayMessage)
        {
            displayMessage += utils::localize.get("app_desktop_info_mmi_clir") + "\n";
            displayMessage += getSelectedMessagesFromDictionary(customResult.getMessage());
        }

        virtual void visit(mmiactions::MMIImeiResult &customResult, std::string &displayMessage)
        {
            displayMessage += utils::localize.get("app_desktop_info_mmi_imei") + "\n";
            displayMessage += customResult.getImei() + "\n";
            displayMessage += getSelectedMessagesFromDictionary(customResult.getMessage());
        }

        std::string getQueryResult(std::vector<std::pair<mmiactions::IMMICustomResultParams::MMIResultMessage,
                                                         mmiactions::IMMICustomResultParams::MMIResultMessage>> msgData)
        {
            std::string queryStr;
            for (auto msg : msgData) {
                auto serviceClass = msg.first;
                auto serviceState = msg.second;
                if (serviceState == mmiactions::IMMICustomResultParams::MMIResultMessage::CommonQuery) {
                    auto it = messageDictionary.find(serviceClass);
                    if (messageDictionary.end() != it) {
                        queryStr += utils::localize.get(it->second) + "\n";
                    }
                }
            }
            return queryStr;
        }

        UTF8 getSelectedMessagesFromDictionary(
            const std::vector<mmiactions::IMMICustomResultParams::MMIResultMessage> &msgList)
        {

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

#include <memory>

M module-services/service-appmgr/data/MmiActionsParams.cpp => module-services/service-appmgr/data/MmiActionsParams.cpp +26 -1
@@ 1,4 1,4 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include <service-appmgr/data/MmiActionsParams.hpp>


@@ 40,6 40,31 @@ void MMICallForwardingResult::accept(Visitor &v, std::string &displayMessage)
    v.visit(*this, displayMessage);
}

void MMICallBarringResult::accept(Visitor &v, std::string &displayMessage)
{
    v.visit(*this, displayMessage);
}

void MMICallWaitingResult::accept(Visitor &v, std::string &displayMessage)
{
    v.visit(*this, displayMessage);
}

void MMIClipResult::accept(Visitor &v, std::string &displayMessage)
{
    v.visit(*this, displayMessage);
}

void MMIClirResult::accept(Visitor &v, std::string &displayMessage)
{
    v.visit(*this, displayMessage);
}

void MMIImeiResult::accept(Visitor &v, std::string &displayMessage)
{
    v.visit(*this, displayMessage);
}

MMIParams::MMIParams(std::string mmiData) : mmiData{std::move(mmiData)}
{}


M module-services/service-appmgr/service-appmgr/data/MmiActionsParams.hpp => module-services/service-appmgr/service-appmgr/data/MmiActionsParams.hpp +19 -4
@@ 1,4 1,4 @@
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once


@@ 13,6 13,11 @@ namespace app::manager::actions
    class MMINoneSpecifiedResult;
    class MMICallForwardingResult;
    class MMICustomResultParams;
    class MMICallBarringResult;
    class MMICallWaitingResult;
    class MMIClipResult;
    class MMIClirResult;
    class MMIImeiResult;

    class Visitor
    {


@@ 20,6 25,11 @@ namespace app::manager::actions
        virtual void visit(MMINoneSpecifiedResult &, std::string &)  = 0;
        virtual void visit(MMICallForwardingResult &, std::string &) = 0;
        virtual void visit(MMICustomResultParams &, std::string &)   = 0;
        virtual void visit(MMICallBarringResult &, std::string &)    = 0;
        virtual void visit(MMICallWaitingResult &, std::string &)    = 0;
        virtual void visit(MMIClipResult &, std::string &)           = 0;
        virtual void visit(MMIClirResult &, std::string &)           = 0;
        virtual void visit(MMIImeiResult &, std::string &)           = 0;
    };

    class IMMICustomResultParams


@@ 82,7 92,7 @@ namespace app::manager::actions
            CallBarringDeactivated,

            ClipActivted,
            ClipDaectivated,
            ClipDeactivated,
            ClipNotProvisioned,
            ClipProvisioned,
            ClipUnknown,


@@ 117,7 127,7 @@ namespace app::manager::actions
      public:
        MMINoneSpecifiedResult() : MMICustomResultParams(MMIType::NoneSpecified)
        {}
        virtual void accept(Visitor &v, std::string &displayMessage) override;
        void accept(Visitor &v, std::string &displayMessage) override;
    };

    class MMICallForwardingResult : public MMICustomResultParams


@@ 132,7 142,7 @@ namespace app::manager::actions
        {}

        auto getData() const -> std::tuple<std::string, std::string, std::string, std::string>;
        virtual void accept(Visitor &v, std::string &displayMessage) override;
        void accept(Visitor &v, std::string &displayMessage) override;

      private:
        std::string voice;


@@ 146,6 156,7 @@ namespace app::manager::actions
      public:
        MMIClirResult() : MMICustomResultParams(MMIType::Clir)
        {}
        void accept(Visitor &v, std::string &displayMessage) override;
    };

    class MMICallBarringResult : public MMICustomResultParams


@@ 155,6 166,7 @@ namespace app::manager::actions
        {}
        void addMessages(const std::pair<MMIResultMessage, MMIResultMessage> &message) noexcept;
        auto getMessages(void) noexcept -> std::vector<std::pair<MMIResultMessage, MMIResultMessage>>;
        void accept(Visitor &v, std::string &displayMessage) override;

      private:
        std::vector<std::pair<MMIResultMessage, MMIResultMessage>> data;


@@ 195,6 207,7 @@ namespace app::manager::actions
      public:
        MMIClipResult() : MMICustomResultParams(MMIType::Clip)
        {}
        void accept(Visitor &v, std::string &displayMessage) override;
    };

    class MMIImeiResult : public MMICustomResultParams


@@ 205,6 218,7 @@ namespace app::manager::actions
        explicit MMIImeiResult() : MMICustomResultParams(MMIType::Imei)
        {}
        auto getImei() const noexcept -> std::string;
        void accept(Visitor &v, std::string &displayMessage) override;

      private:
        std::string imei;


@@ 217,6 231,7 @@ namespace app::manager::actions
        {}
        void addMessages(const std::pair<MMIResultMessage, MMIResultMessage> &message);
        auto getMessages() const noexcept -> std::vector<std::pair<MMIResultMessage, MMIResultMessage>>;
        void accept(Visitor &v, std::string &displayMessage) override;

      private:
        std::vector<std::pair<MMIResultMessage, MMIResultMessage>> messages;