~aleteoryx/muditaos

4df235d1ffd9ec18cc33cf89730f3eccc1f30ac3 — Lefucjusz 2 years ago e008509
Revert "[MOS-977] Added VoLTE support in additional countries"

This reverts commit b4568c32eb2a4b37e9dfbbe08c446430eee2145c.
21 files changed, 212 insertions(+), 279 deletions(-)

M module-services/service-cellular/CMakeLists.txt
M module-services/service-cellular/src/ServiceCellularPriv.cpp
D module-services/service-cellular/src/volte/ImsiParser.cpp
R module-services/service-cellular/src/volte/{ImsiParser => ImsiParserInterface}.hpp
A module-services/service-cellular/src/volte/ImsiParserUS.cpp
R module-services/service-cellular/src/volte/{ImsiParser_Denmark => ImsiParserUS}.hpp
D module-services/service-cellular/src/volte/ImsiParser_Canada.hpp
D module-services/service-cellular/src/volte/ImsiParser_GreatBritain.hpp
D module-services/service-cellular/src/volte/ImsiParser_Netherlands.hpp
D module-services/service-cellular/src/volte/ImsiParser_Poland.hpp
D module-services/service-cellular/src/volte/ImsiParser_UnitedStates.hpp
R module-services/service-cellular/src/volte/{ImsiParser_Germany => OperatorInfo}.hpp
M module-services/service-cellular/src/volte/VolteAllowedList.cpp
D module-services/service-cellular/src/volte/VolteAllowedList.hpp
M module-services/service-cellular/src/volte/VolteAllowedListInterface.hpp
A module-services/service-cellular/src/volte/VolteAllowedUSList.cpp
R module-services/service-cellular/src/volte/{ImsiParser_Austria => VolteAllowedUSList}.hpp
M module-services/service-cellular/src/volte/VolteCapabilityHandler.cpp
M module-services/service-cellular/src/volte/VolteCapabilityHandler.hpp
M module-services/service-cellular/tests/unittest_volteCapabilityHandler.cpp
M pure_changelog.md
M module-services/service-cellular/CMakeLists.txt => module-services/service-cellular/CMakeLists.txt +3 -5
@@ 17,9 17,9 @@ set(SOURCES
    src/CSQHandler.cpp

    src/volte/VolteCapabilityHandler.cpp
    src/volte/ImsiParserUS.cpp
    src/volte/VolteAllowedUSList.cpp
    src/volte/VolteCapabilityHandlerCellular.cpp
    src/volte/ImsiParser.cpp
    src/volte/VolteAllowedList.cpp

    src/ussd/USSDHandler.cpp



@@ 52,9 52,7 @@ set(SOURCES
    requests/ColpRequest.cpp
    requests/CallWaitingRequest.cpp
    requests/CallBarringRequest.cpp
    handler/RawATHandler.cpp
    src/volte/VolteAllowedList.hpp
)
    handler/RawATHandler.cpp)


add_library(${PROJECT_NAME} STATIC ${SOURCES})

M module-services/service-cellular/src/ServiceCellularPriv.cpp => module-services/service-cellular/src/ServiceCellularPriv.cpp +4 -2
@@ 9,7 9,8 @@

#include <service-db/agents/settings/SystemSettings.hpp>

#include <volte/VolteAllowedList.hpp>
#include <volte/ImsiParserUS.hpp>
#include <volte/VolteAllowedUSList.hpp>
#include <volte/VolteCapabilityHandlerCellular.hpp>

#include <service-evtmgr/EVMessages.hpp>


@@ 45,7 46,8 @@ namespace cellular::internal
              std::make_unique<CSQHandler>(),
          },
          volteCapability{
              std::make_unique<VolteCapabilityHandler>(std::make_unique<cellular::service::VolteAllowedList>(),
              std::make_unique<VolteCapabilityHandler>(std::make_unique<cellular::service::ImsiParserUS>(),
                                                       std::make_unique<cellular::service::VolteAllowedUSList>(),
                                                       std::make_unique<cellular::service::VolteCapabilityCellular>())},
          ussdHandler{std::make_unique<USSDHandler>()}
    {

D module-services/service-cellular/src/volte/ImsiParser.cpp => module-services/service-cellular/src/volte/ImsiParser.cpp +0 -27
@@ 1,27 0,0 @@
// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "ImsiParser.hpp"

namespace cellular
{
    auto service::ImsiParser::isAllowed(const std::string &imsi) const -> bool
    {
        if (operatorCodes.empty()) {
            return false;
        }

        for (auto const &code : operatorCodes) {
            if (textStartsWith(imsi, code)) {
                return true;
            }
        }

        return false;
    }

    auto service::ImsiParser::textStartsWith(std::string_view text, std::string_view prefix) const -> bool
    {
        return !text.empty() && !prefix.empty() && std::equal(prefix.begin(), prefix.end(), text.begin());
    }
} // namespace cellular

R module-services/service-cellular/src/volte/ImsiParser.hpp => module-services/service-cellular/src/volte/ImsiParserInterface.hpp +5 -9
@@ 3,21 3,17 @@

#pragma once

#include "OperatorInfo.hpp"
#include <string>
#include <string_view>
#include <vector>
#include <optional>

namespace cellular::service
{
    class ImsiParser
    class ImsiParserInteface
    {
      public:
        explicit ImsiParser(std::vector<std::string> &&operatorList) : operatorCodes{operatorList}
        {}
        auto isAllowed(const std::string &imsi) const -> bool;
        virtual ~ImsiParserInteface() = default;

      private:
        std::vector<std::string> operatorCodes;
        inline auto textStartsWith(std::string_view text, std::string_view prefix) const -> bool;
        virtual auto parse(const std::string &imsi) -> std::optional<OperatorInfo> = 0;
    };
} // namespace cellular::service

A module-services/service-cellular/src/volte/ImsiParserUS.cpp => module-services/service-cellular/src/volte/ImsiParserUS.cpp +37 -0
@@ 0,0 1,37 @@
// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "ImsiParserUS.hpp"
#include <log/log.hpp>
#include <array>
#include <algorithm>
#include <stdexcept>

namespace cellular::service
{
    constexpr auto usMccCount = 7;
    const std::array<std::string, usMccCount> usMcc{"310", "311", "312", "313", "314", "315", "316"};

    auto ImsiParserUS::parse(const std::string &imsi) -> std::optional<OperatorInfo>
    {
        constexpr auto mccSize = 3;
        constexpr auto mncSize = 3;

        std::string mcc, mnc;
        try {
            mcc = imsi.substr(0, mccSize);
            mnc = imsi.substr(mccSize, mncSize);
        }
        catch (const std::out_of_range &e) {
            LOG_ERROR("[VoLTE] IMSI parsing error: %s", e.what());
            return std::nullopt;
        }

        if (std::find(std::begin(usMcc), std::end(usMcc), mcc) == std::end(usMcc)) {
            LOG_ERROR("[VoLTE] MCC not from USA");
            return std::nullopt;
        }

        return OperatorInfo(mcc, mnc);
    }
} // namespace cellular::service

R module-services/service-cellular/src/volte/ImsiParser_Denmark.hpp => module-services/service-cellular/src/volte/ImsiParserUS.hpp +4 -5
@@ 3,14 3,13 @@

#pragma once

#include "ImsiParser.hpp"
#include "ImsiParserInterface.hpp"

namespace cellular::service
{
    struct ImsiParserDK : ImsiParser
    class ImsiParserUS : public ImsiParserInteface
    {
        explicit ImsiParserDK()
            : ImsiParser(std::vector<std::string>{"23801", "23802", "23806", "23820", "23866", "28801", "28802"})
        {}
      public:
        auto parse(const std::string &imsi) -> std::optional<OperatorInfo> final;
    };
} // namespace cellular::service

D module-services/service-cellular/src/volte/ImsiParser_Canada.hpp => module-services/service-cellular/src/volte/ImsiParser_Canada.hpp +0 -17
@@ 1,17 0,0 @@
// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once

#include "ImsiParser.hpp"

namespace cellular::service
{
    struct ImsiParserCA : ImsiParser
    {
        explicit ImsiParserCA()
            : ImsiParser(std::vector<std::string>{
                  "302220", "302270", "302300", "302310", "302490", "302510", "302500", "302610", "302720", "302780"})
        {}
    };
} // namespace cellular::service

D module-services/service-cellular/src/volte/ImsiParser_GreatBritain.hpp => module-services/service-cellular/src/volte/ImsiParser_GreatBritain.hpp +0 -34
@@ 1,34 0,0 @@
// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once

#include "ImsiParser.hpp"

namespace cellular::service
{
    struct ImsiParserGB : ImsiParser
    {
        explicit ImsiParserGB()
            : ImsiParser(std::vector<std::string>{"23401",
                                                  "23410",
                                                  "23411",
                                                  "23403",
                                                  "23415",
                                                  "23420",
                                                  "23430",
                                                  "23433",
                                                  "23434",
                                                  "23450",
                                                  "23480",
                                                  "365010",
                                                  "348170",
                                                  "348770",
                                                  "34605",
                                                  "346001",
                                                  "346140",
                                                  "750001",
                                                  "26601"})
        {}
    };
} // namespace cellular::service

D module-services/service-cellular/src/volte/ImsiParser_Netherlands.hpp => module-services/service-cellular/src/volte/ImsiParser_Netherlands.hpp +0 -17
@@ 1,17 0,0 @@
// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once

#include "ImsiParser.hpp"

namespace cellular::service
{
    struct ImsiParserNL : ImsiParser
    {
        explicit ImsiParserNL()
            : ImsiParser(std::vector<std::string>{
                  "20402", "20404", "20406", "20407", "20408", "20410", "20416", "20420", "20433", "20418"})
        {}
    };
} // namespace cellular::service

D module-services/service-cellular/src/volte/ImsiParser_Poland.hpp => module-services/service-cellular/src/volte/ImsiParser_Poland.hpp +0 -32
@@ 1,32 0,0 @@
// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once

#include "ImsiParser.hpp"
#include <vector>

namespace cellular::service
{
    struct ImsiParserPL : ImsiParser
    {
        explicit ImsiParserPL()
            : ImsiParser(std::vector<std::string>{"26001",
                                                  "26011",
                                                  "26002",
                                                  "26010",
                                                  "26034",
                                                  "26003",
                                                  "26015",
                                                  "26016",
                                                  "26017",
                                                  "26006",
                                                  "26045",
                                                  "26098",
                                                  "26008",
                                                  "26009",
                                                  "26012",
                                                  "26013"})
        {}
    };
} // namespace cellular::service

D module-services/service-cellular/src/volte/ImsiParser_UnitedStates.hpp => module-services/service-cellular/src/volte/ImsiParser_UnitedStates.hpp +0 -28
@@ 1,28 0,0 @@
// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once

#include "ImsiParser.hpp"
#include <vector>

namespace cellular::service
{
    struct ImsiParserUS : ImsiParser
    {
        explicit ImsiParserUS()
            : ImsiParser(std::vector<std::string>{"310053",
                                                  "310120",
                                                  "310260",
                                                  "310530",
                                                  "310770",
                                                  "311490",
                                                  "311660",
                                                  "311880",
                                                  "311882",
                                                  "312190",
                                                  "312250",
                                                  "312530"})
        {}
    };
} // namespace cellular::service

R module-services/service-cellular/src/volte/ImsiParser_Germany.hpp => module-services/service-cellular/src/volte/OperatorInfo.hpp +10 -5
@@ 3,15 3,20 @@

#pragma once

#include "ImsiParser.hpp"
#include <string>

namespace cellular::service
{
    struct ImsiParserDE : ImsiParser
    struct OperatorInfo
    {
        explicit ImsiParserDE()
            : ImsiParser(std::vector<std::string>{
                  "26201", "26206", "26202", "26204", "26209", "26203", "26205", "26208", "26223"})
        OperatorInfo(const std::string &mcc, const std::string &mnc) : MCC(mcc), MNC(mnc)
        {}
        std::string MCC;
        std::string MNC;

        friend bool operator==(const OperatorInfo &lhs, const OperatorInfo &rhs)
        {
            return lhs.MCC == rhs.MCC && lhs.MNC == rhs.MNC;
        }
    };
} // namespace cellular::service

M module-services/service-cellular/src/volte/VolteAllowedList.cpp => module-services/service-cellular/src/volte/VolteAllowedList.cpp +0 -52
@@ 1,52 0,0 @@
// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "VolteAllowedList.hpp"
#include "ImsiParser_Poland.hpp"
#include "ImsiParser_UnitedStates.hpp"
#include "ImsiParser_Netherlands.hpp"
#include "ImsiParser_Germany.hpp"
#include "ImsiParser_Denmark.hpp"
#include "ImsiParser_GreatBritain.hpp"
#include "ImsiParser_Canada.hpp"
#include "ImsiParser_Austria.hpp"

#include "module-utils/log/Logger.hpp"

namespace
{
    template <typename Container, typename... Items>
    void pushBack(Container &container, Items &&...items)
    {
        (container.push_back(std::forward<Items>(items)), ...);
    }
} // namespace

namespace cellular::service
{
    auto VolteAllowedList::isVolteAllowed(const std::string &imsi) const -> bool
    {
        for (const auto &country : allowedList) {
            if (country.isAllowed(imsi)) {
                LOG_INFO("MCC supported, VoLTE allowed.");
                return true;
            }
        }

        LOG_ERROR("MCC not supported, VoLTE not allowed.");
        return false;
    }

    void VolteAllowedList::buildList()
    {
        pushBack(allowedList,
                 ImsiParserPL(),
                 ImsiParserUS(),
                 ImsiParserDK(),
                 ImsiParserDE(),
                 ImsiParserNL(),
                 ImsiParserGB(),
                 ImsiParserCA(),
                 ImsiParserAT());
    }
} // namespace cellular::service

D module-services/service-cellular/src/volte/VolteAllowedList.hpp => module-services/service-cellular/src/volte/VolteAllowedList.hpp +0 -24
@@ 1,24 0,0 @@
// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "VolteAllowedListInterface.hpp"
#include "ImsiParser.hpp"
#include <vector>

namespace cellular::service
{
    class VolteAllowedList : public VolteAllowedListInterface
    {
      public:
        VolteAllowedList()
        {
            buildList();
        }

        auto isVolteAllowed(const std::string &imsi) const -> bool final;

      private:
        void buildList();
        std::vector<cellular::service::ImsiParser> allowedList;
    };
} // namespace cellular::service

M module-services/service-cellular/src/volte/VolteAllowedListInterface.hpp => module-services/service-cellular/src/volte/VolteAllowedListInterface.hpp +2 -1
@@ 3,6 3,7 @@

#pragma once

#include "OperatorInfo.hpp"
#include <string>

namespace cellular::service


@@ 12,6 13,6 @@ namespace cellular::service
      public:
        virtual ~VolteAllowedListInterface() = default;

        virtual auto isVolteAllowed(const std::string &imsi) const -> bool = 0;
        auto virtual isVolteAllowed(const OperatorInfo &operatorInfo) -> bool = 0;
    };
} // namespace cellular::service

A module-services/service-cellular/src/volte/VolteAllowedUSList.cpp => module-services/service-cellular/src/volte/VolteAllowedUSList.cpp +37 -0
@@ 0,0 1,37 @@
// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "VolteAllowedUSList.hpp"
#include <log/log.hpp>
#include <array>
#include <algorithm>

namespace cellular::service
{

    constexpr auto allowedOperatorsCount = 12;
    const std::array<OperatorInfo, allowedOperatorsCount> allowedOperators{OperatorInfo{"310", "053"},
                                                                           OperatorInfo{"310", "120"},
                                                                           OperatorInfo{"310", "260"},
                                                                           OperatorInfo{"310", "530"},
                                                                           OperatorInfo{"310", "770"},
                                                                           OperatorInfo{"311", "490"},
                                                                           OperatorInfo{"311", "660"},
                                                                           OperatorInfo{"311", "880"},
                                                                           OperatorInfo{"311", "882"},
                                                                           OperatorInfo{"312", "190"},
                                                                           OperatorInfo{"312", "250"},
                                                                           OperatorInfo{"312", "530"}};

    auto VolteAllowedUSList::isVolteAllowed(const OperatorInfo &operatorInfo) -> bool
    {
        LOG_INFO("[VoLTE] trying to find MCC: %s, MNC: %s", operatorInfo.MCC.c_str(), operatorInfo.MNC.c_str());

        if (std::find(std::begin(allowedOperators), std::end(allowedOperators), operatorInfo) ==
            std::end(allowedOperators)) {
            LOG_ERROR("[VoLTE] unable to find MCC+MNC on list - VoLTE not allowed");
            return false;
        }
        return true;
    }
} // namespace cellular::service

R module-services/service-cellular/src/volte/ImsiParser_Austria.hpp => module-services/service-cellular/src/volte/VolteAllowedUSList.hpp +5 -7
@@ 3,16 3,14 @@

#pragma once

#include "ImsiParser.hpp"
#include "VolteAllowedListInterface.hpp"
#include "OperatorInfo.hpp"

namespace cellular::service
{
    ;

    struct ImsiParserAT : ImsiParser
    class VolteAllowedUSList : public VolteAllowedListInterface
    {
        explicit ImsiParserAT()
            : ImsiParser(std::vector<std::string>{"23201", "23203", "23213", "23205", "23210", "23207", "23208"})
        {}
      public:
        auto isVolteAllowed(const OperatorInfo &operatorInfo) -> bool final;
    };
} // namespace cellular::service

M module-services/service-cellular/src/volte/VolteCapabilityHandler.cpp => module-services/service-cellular/src/volte/VolteCapabilityHandler.cpp +12 -4
@@ 1,4 1,4 @@
// Copyright (c) 2017-2021, 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 "VolteCapabilityHandler.hpp"


@@ 7,9 7,11 @@

namespace cellular::service
{
    VolteCapabilityHandler::VolteCapabilityHandler(std::unique_ptr<VolteAllowedListInterface> allowedList,
    VolteCapabilityHandler::VolteCapabilityHandler(std::unique_ptr<ImsiParserInteface> imsiParser,
                                                   std::unique_ptr<VolteAllowedListInterface> allowedList,
                                                   std::unique_ptr<VolteCapabilityCellularInterface> cellularInterface)
        : allowedList(std::move(allowedList)), cellularInterface(std::move(cellularInterface))
        : imsiParser(std::move(imsiParser)), allowedList(std::move(allowedList)),
          cellularInterface(std::move(cellularInterface))
    {}

    auto VolteCapabilityHandler::isVolteAllowed(at::BaseChannel &channel) -> bool


@@ 20,6 22,12 @@ namespace cellular::service
            return false;
        }

        return allowedList->isVolteAllowed(imsi.value());
        const auto operatorInfo = imsiParser->parse(imsi.value());
        if (not operatorInfo.has_value()) {
            LOG_ERROR("[VoLTE] failed to parse IMSI - VoLTE not permitted");
            return false;
        }

        return allowedList->isVolteAllowed(operatorInfo.value());
    }
} // namespace cellular::service

M module-services/service-cellular/src/volte/VolteCapabilityHandler.hpp => module-services/service-cellular/src/volte/VolteCapabilityHandler.hpp +5 -2
@@ 1,9 1,10 @@
// Copyright (c) 2017-2021, 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

#pragma once

#include "VolteCapabiltyHandlerCellularInterface.hpp"
#include "ImsiParserInterface.hpp"
#include "VolteAllowedListInterface.hpp"

#include <memory>


@@ 13,7 14,8 @@ namespace cellular::service
    class VolteCapabilityHandler
    {
      public:
        VolteCapabilityHandler(std::unique_ptr<VolteAllowedListInterface> allowedList,
        VolteCapabilityHandler(std::unique_ptr<ImsiParserInteface> imsiParser,
                               std::unique_ptr<VolteAllowedListInterface> allowedList,
                               std::unique_ptr<VolteCapabilityCellularInterface> cellularInterface);
        /** Check if it is a possibility to enable VoLTE on current operator
         * @return true when VoLTE is allowed, false when not


@@ 21,6 23,7 @@ namespace cellular::service
        auto isVolteAllowed(at::BaseChannel &channel) -> bool;

      private:
        std::unique_ptr<ImsiParserInteface> imsiParser;
        std::unique_ptr<VolteAllowedListInterface> allowedList;
        std::unique_ptr<VolteCapabilityCellularInterface> cellularInterface;
    };

M module-services/service-cellular/tests/unittest_volteCapabilityHandler.cpp => module-services/service-cellular/tests/unittest_volteCapabilityHandler.cpp +88 -7
@@ 1,10 1,11 @@
// 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 <catch2/catch.hpp>

#include <module-services/service-cellular/src/volte/VolteCapabilityHandler.hpp>
#include <module-services/service-cellular/src/volte/VolteAllowedList.hpp>
#include <module-services/service-cellular/src/volte/ImsiParserUS.hpp>
#include <module-services/service-cellular/src/volte/VolteAllowedUSList.hpp>
#include <module-services/service-cellular/src/volte/VolteCapabiltyHandlerCellularInterface.hpp>
#include <module-cellular/modem/BaseChannel.hpp>



@@ 42,6 43,80 @@ TEST_CASE("VoLTE Capability handler")

    static BaseChannelStub baseChannelStub;

    SECTION("ImsiParserUS success - US IMSI")
    {
        using namespace cellular::service;

        cellular::service::ImsiParserUS parser;
        std::string imsi("3111231234567890");

        auto result = parser.parse(imsi);

        REQUIRE(result.has_value() == true);
        REQUIRE(result.value().MCC == "311");
        REQUIRE(result.value().MNC == "123");
    }

    SECTION("ImsiParserUS failure - non US IMSI")
    {
        using namespace cellular::service;

        cellular::service::ImsiParserUS parser;
        std::string imsi("2601231234567890");

        auto result = parser.parse(imsi);

        REQUIRE(result.has_value() == false);
    }

    SECTION("ImsiParserUS failure -too short IMSI")
    {
        using namespace cellular::service;

        cellular::service::ImsiParserUS parser;
        std::string imsi("2601");

        auto result = parser.parse(imsi);

        REQUIRE(result.has_value() == false);
    }

    SECTION("VolteAllowedUSList success - TMobileUS IMSI")
    {
        using namespace cellular::service;

        VolteAllowedUSList list;
        OperatorInfo operatorInfo{"310", "120"};

        auto result = list.isVolteAllowed(operatorInfo);

        REQUIRE(result == true);
    }

    SECTION("VolteAllowedUSList failure - non TMobileUS MCC")
    {
        using namespace cellular::service;

        VolteAllowedUSList list;
        OperatorInfo operatorInfo{"210", "120"};

        auto result = list.isVolteAllowed(operatorInfo);

        REQUIRE(result == false);
    }

    SECTION("VolteAllowedUSList failure - non TMobileUS MNC")
    {
        using namespace cellular::service;

        VolteAllowedUSList list;
        OperatorInfo operatorInfo{"310", "999"};

        auto result = list.isVolteAllowed(operatorInfo);

        REQUIRE(result == false);
    }

    class MockTMobileUS : public cellular::service::VolteCapabilityCellularInterface
    {
        auto getImsi(at::BaseChannel &) -> std::optional<std::string> override


@@ 53,12 128,14 @@ TEST_CASE("VoLTE Capability handler")
    SECTION("VolteCapabilityHandler succes = TMobileUS")
    {
        using namespace cellular::service;
        VolteCapabilityHandler handler{std::make_unique<VolteAllowedList>(), std::make_unique<MockTMobileUS>()};
        VolteCapabilityHandler handler{std::make_unique<ImsiParserUS>(),
                                       std::make_unique<VolteAllowedUSList>(),
                                       std::make_unique<MockTMobileUS>()};
        auto result = handler.isVolteAllowed(baseChannelStub);
        REQUIRE(result == true);
    }

    class MockNotAllowedIMSI : public cellular::service::VolteCapabilityCellularInterface
    class MockNonTMobileUS : public cellular::service::VolteCapabilityCellularInterface
    {
        auto getImsi(at::BaseChannel &) -> std::optional<std::string>
        {


@@ 66,10 143,12 @@ TEST_CASE("VoLTE Capability handler")
        }
    };

    SECTION("VolteCapabilityHandler failure = not allowed IMSI")
    SECTION("VolteCapabilityHandler failure = non TMobileUS")
    {
        using namespace cellular::service;
        VolteCapabilityHandler handler{std::make_unique<VolteAllowedList>(), std::make_unique<MockNotAllowedIMSI>()};
        VolteCapabilityHandler handler{std::make_unique<ImsiParserUS>(),
                                       std::make_unique<VolteAllowedUSList>(),
                                       std::make_unique<MockNonTMobileUS>()};
        auto result = handler.isVolteAllowed(baseChannelStub);
        REQUIRE(result == false);
    }


@@ 85,7 164,9 @@ TEST_CASE("VoLTE Capability handler")
    SECTION("VolteCapabilityHandler failure = failed to get imsi")
    {
        using namespace cellular::service;
        VolteCapabilityHandler handler{std::make_unique<VolteAllowedList>(), std::make_unique<MockFailedToGetImsi>()};
        VolteCapabilityHandler handler{std::make_unique<ImsiParserUS>(),
                                       std::make_unique<VolteAllowedUSList>(),
                                       std::make_unique<MockFailedToGetImsi>()};
        auto result = handler.isVolteAllowed(baseChannelStub);
        REQUIRE(result == false);
    }

M pure_changelog.md => pure_changelog.md +0 -1
@@ 4,7 4,6 @@

### Added

* Added VoLTE support in Poland, Germany, Denmark, United Kingdom, Netherlands, Canada and Austria
* Added extended information to crashdump filename
* Added extended information to log filename
* Added GUI screens informing about failed MMI/USSD request