From 357ae2d51cdc93679b23bb9c99bfe5ed4a54e27f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Zieli=C5=84ski?= Date: Fri, 25 Nov 2022 22:12:22 +0100 Subject: [PATCH] [MOS-825] VoLTE steering according to IMSI Steering the GUI and the modem according to whether VoLTE is permitted for the active SIM card's operator. This is done based on the SIM card's IMSI string. Additionally, made logging more consistent. --- image/assets/lang/Deutsch.json | 2 +- image/assets/lang/Espanol.json | 2 +- image/assets/lang/Francais.json | 2 +- image/assets/lang/Svenska.json | 2 +- .../windows/network/NetworkWindow.cpp | 2 +- .../service-cellular/ServiceCellular.cpp | 24 +++------ .../service-cellular/VolteState.hpp | 2 +- .../src/ServiceCellularPriv.cpp | 24 +++++++++ .../service-cellular/src/VolteHandler.hpp | 15 ++++-- .../src/volte/ImsiParserUS.cpp | 4 +- .../src/volte/VolteAllowedUSList.cpp | 4 +- .../src/volte/VolteCapabilityHandler.cpp | 23 +++------ .../src/volte/VolteCapabilityHandler.hpp | 15 +----- .../volte/VolteCapabilityHandlerCellular.cpp | 17 ++----- .../volte/VolteCapabilityHandlerCellular.hpp | 11 +--- ...VolteCapabiltyHandlerCellularInterface.hpp | 7 +-- .../tests/unittest_volteCapabilityHandler.cpp | 51 ++++++++++++++----- .../tests/unittest_volteHandler.cpp | 22 ++++---- pure_changelog.md | 1 + 19 files changed, 120 insertions(+), 110 deletions(-) diff --git a/image/assets/lang/Deutsch.json b/image/assets/lang/Deutsch.json index 990cb5a5780e0b5a294b9dfac0f95a2920cc6d76..0a1eaec3af396afab2cbe3d617f83a436516560a 100644 --- a/image/assets/lang/Deutsch.json +++ b/image/assets/lang/Deutsch.json @@ -469,7 +469,7 @@ "app_settings_about": "Über Mudita Pure", "app_settings_title_languages": "Sprachauswahl", "app_settings_network_sim_cards": "SIM-Karten", - "app_settings_network_volte_not_available": "not available", + "app_settings_network_volte_not_available": "nicht verfügbar", "app_settings_network_active_card": "Aktiver Slot", "app_settings_network_unblock_card": "Entsperren Karte", "app_settings_network_not_connected": "keine Karte", diff --git a/image/assets/lang/Espanol.json b/image/assets/lang/Espanol.json index b28b4d6ce92cd288f5a6e8a31bc27a95633c0f39..1e0d51ab12211bc031c22d03e708ea85dcc61ef9 100644 --- a/image/assets/lang/Espanol.json +++ b/image/assets/lang/Espanol.json @@ -469,7 +469,7 @@ "app_settings_about": "Sobre Mudita Pure", "app_settings_title_languages": "Selección de idioma", "app_settings_network_sim_cards": "Tarjetas SIM", - "app_settings_network_volte_not_available": "not available", + "app_settings_network_volte_not_available": "no disponible", "app_settings_network_active_card": "Toma activa", "app_settings_network_unblock_card": "Desbloquear la tarjeta", "app_settings_network_not_connected": "sin tarjeta", diff --git a/image/assets/lang/Francais.json b/image/assets/lang/Francais.json index e5964d5c9621b761ec4dfa633552a023763c7f33..9e6bf2b44a20e005defdfe0969d5447b749f6489 100644 --- a/image/assets/lang/Francais.json +++ b/image/assets/lang/Francais.json @@ -437,7 +437,7 @@ "app_settings_about": "À propos de Mudita Pure", "app_settings_title_languages": "Sélection de langue", "app_settings_network_sim_cards": "Cartes SIM", - "app_settings_network_volte_not_available": "not available", + "app_settings_network_volte_not_available": "non disponible", "app_settings_network_active_card": "Fente active", "app_settings_network_unblock_card": "Débloquer la carte", "app_settings_network_not_connected": "pas de carte", diff --git a/image/assets/lang/Svenska.json b/image/assets/lang/Svenska.json index fdc4958a1c836c09860d57b7384bd5caf8dd0f14..4d1f442dd647342b30a53db760da062b14ab1235 100644 --- a/image/assets/lang/Svenska.json +++ b/image/assets/lang/Svenska.json @@ -377,7 +377,7 @@ "app_settings_about": "Om Mudita Pure", "app_settings_title_languages": "Språkval", "app_settings_network_sim_cards": "SIM-kort", - "app_settings_network_volte_not_available": "not available", + "app_settings_network_volte_not_available": "inte tillgängligt", "app_settings_network_active_card": "Aktivt slot", "app_settings_network_unblock_card": "Avblockera kort", "app_settings_network_not_connected": "inget kort", diff --git a/module-apps/application-settings/windows/network/NetworkWindow.cpp b/module-apps/application-settings/windows/network/NetworkWindow.cpp index 1f675e5d3d1103d8ca62c0ee53b1975cb48bc984..e31c0c7870a646ccfb0f9b343ea48e65a8fb5f46 100644 --- a/module-apps/application-settings/windows/network/NetworkWindow.cpp +++ b/module-apps/application-settings/windows/network/NetworkWindow.cpp @@ -75,7 +75,7 @@ namespace gui settingsApp->sendVolteChangeRequest(false); break; default: - LOG_INFO("Skip request due unsettled VoLTE state"); + LOG_INFO("[VoLTE] skip request due to unsettled VoLTE state"); break; } return true; diff --git a/module-services/service-cellular/ServiceCellular.cpp b/module-services/service-cellular/ServiceCellular.cpp index 584251b01c886b3c4a02d1e8f01e440ac6ff87c9..15e570d4f3f1e8de53024ee7488b4f858ed7ea4a 100644 --- a/module-services/service-cellular/ServiceCellular.cpp +++ b/module-services/service-cellular/ServiceCellular.cpp @@ -253,7 +253,7 @@ sys::ReturnCodes ServiceCellular::InitHandler() const auto rawVolteSetting = settings->getValue(settings::Cellular::volteEnabled, settings::SettingsScope::Global); if (rawVolteSetting.empty()) { - LOG_ERROR("VoLTE setting missing, setting to default disabled"); + LOG_ERROR("[VoLTE] setting missing in database - defaulting to disabled"); settings->setValue(settings::Cellular::volteEnabled, "0", settings::SettingsScope::Global); } @@ -607,13 +607,15 @@ void ServiceCellular::registerMessageHandlers() auto message = static_cast(request); auto channel = cmux->get(CellularMux::Channel::Commands); if (channel == nullptr) { - LOG_ERROR("Failed to get channel, skipping VoLTE request!"); + LOG_ERROR("[VoLTE] failed to get channel, skipping request"); return sys::MessageNone{}; } settings->setValue( settings::Cellular::volteEnabled, message->enable ? "1" : "0", settings::SettingsScope::Global); try { - if (not priv->volteHandler->switchVolte(*channel, message->enable)) { + // here we always assume that VoLTE is permitted as changing the setting when not permitted is made + // impossible by the GUI + if (not priv->volteHandler->switchVolte(*channel, true, message->enable)) { auto notification = std::make_shared(priv->volteHandler->getVolteState()); bus.sendMulticast(std::move(notification), sys::BusChannel::ServiceCellularNotifications); @@ -629,7 +631,7 @@ void ServiceCellular::registerMessageHandlers() connect(typeid(cellular::msg::notification::SimReady), [&](sys::Message *) { if (priv->volteHandler->isFunctionalityResetNeeded()) { - LOG_INFO("First run after VoLTE switch, functionality reset needed"); + LOG_INFO("[VoLTE] first run after switching - functionality reset needed"); priv->modemResetHandler->performFunctionalityReset(); } return sys::MessageNone{}; @@ -912,20 +914,8 @@ bool ServiceCellular::handle_cellular_priv_init() priv->privInit(channel); - auto enableVolte = - settings->getValue(settings::Cellular::volteEnabled, settings::SettingsScope::Global) == "1" ? true : false; - bool volteNeedReset = false; - try { - volteNeedReset = !priv->volteHandler->switchVolte(*channel, enableVolte); - auto notification = std::make_shared(priv->volteHandler->getVolteState()); - bus.sendMulticast(std::move(notification), sys::BusChannel::ServiceCellularNotifications); - } - catch (std::runtime_error const &exc) { - LOG_ERROR("%s", exc.what()); - } - auto tetheringNeedReset = !priv->tetheringHandler->configure(); - if (tetheringNeedReset || volteNeedReset) { + if (tetheringNeedReset) { priv->modemResetHandler->performHardReset(); return true; } diff --git a/module-services/service-cellular/service-cellular/VolteState.hpp b/module-services/service-cellular/service-cellular/VolteState.hpp index c203578fa36124f8f21861540da3c91f39d00dbc..2d615c9f3b015dc660e40f6c987074e134d2b007 100644 --- a/module-services/service-cellular/service-cellular/VolteState.hpp +++ b/module-services/service-cellular/service-cellular/VolteState.hpp @@ -15,6 +15,6 @@ namespace cellular SwitchingToOn, Undefined } enablement = Enablement::Undefined; - bool permitted = true; + bool permitted = false; }; } diff --git a/module-services/service-cellular/src/ServiceCellularPriv.cpp b/module-services/service-cellular/src/ServiceCellularPriv.cpp index 6841f6e385111f3d91081c0257dc1743e86f5fb5..f0513c2174b7f6112a563655306412bcb27fa381 100644 --- a/module-services/service-cellular/src/ServiceCellularPriv.cpp +++ b/module-services/service-cellular/src/ServiceCellularPriv.cpp @@ -8,6 +8,8 @@ #include #include +#include + #include #include #include @@ -62,6 +64,28 @@ namespace cellular::internal using namespace cellular::msg; simCard->onSimReady = [this]() { state->set(State::ST::Ready); + + auto channel = owner->cmux->get(CellularMux::Channel::Commands); + auto permitVolte = volteCapability->isVolteAllowed(*channel); + auto enableVolte = + owner->settings->getValue(settings::Cellular::volteEnabled, settings::SettingsScope::Global) == "1" + ? true + : false; + bool volteNeedReset = false; + try { + volteNeedReset = !volteHandler->switchVolte(*channel, permitVolte, enableVolte); + auto notification = std::make_shared(volteHandler->getVolteState()); + owner->bus.sendMulticast(std::move(notification), sys::BusChannel::ServiceCellularNotifications); + } + catch (std::runtime_error const &exc) { + LOG_ERROR("%s", exc.what()); + } + + if (volteNeedReset) { + modemResetHandler->performHardReset(); + return; + } + owner->bus.sendMulticast(); }; simCard->onNeedPin = [this](unsigned int attempts) { diff --git a/module-services/service-cellular/src/VolteHandler.hpp b/module-services/service-cellular/src/VolteHandler.hpp index ebec1e002caf16cc341530bde916108f9943afbd..ad611b1e164f72c7e17ac4ae1af32ea1ff60a614 100644 --- a/module-services/service-cellular/src/VolteHandler.hpp +++ b/module-services/service-cellular/src/VolteHandler.hpp @@ -36,9 +36,15 @@ namespace cellular::service template struct VolteHandler : private NonCopyable { - bool switchVolte(CmuxChannel &channel, bool enable) + bool switchVolte(CmuxChannel &channel, bool permit, bool enable) { - ModemResponseParser const parser; + if (!permit) { + if (enable) { + LOG_INFO("[VoLTE] requested to enable, but not permitted for this operator - disabling"); + } + + enable = false; + } if (enable) { // according to Quectel, this setting doesn't have to be reset when disabling @@ -75,7 +81,7 @@ namespace cellular::service bool alreadyConfigured; try { - alreadyConfigured = parser(QcfgImsResult{imsCheckAnswer}, enable); + alreadyConfigured = ModemResponseParser()(QcfgImsResult{imsCheckAnswer}, enable); } catch (std::runtime_error const &exc) { throw; @@ -103,6 +109,7 @@ namespace cellular::service enable ? cellular::VolteState::Enablement::On : cellular::VolteState::Enablement::Off; } + volteState.permitted = permit; return alreadyConfigured; } @@ -140,7 +147,7 @@ namespace cellular::service preference_ = 0x03; return; default: - throw std::logic_error("unimplemented network service domain: " + + throw std::logic_error("[VoLTE] unimplemented network service domain: " + std::string(magic_enum::enum_name(type))); } } diff --git a/module-services/service-cellular/src/volte/ImsiParserUS.cpp b/module-services/service-cellular/src/volte/ImsiParserUS.cpp index 95c573deda0ce0710bb66667df369a176330de80..8507b35cb767366ec4a0054ffc81c3a3c9280ea3 100644 --- a/module-services/service-cellular/src/volte/ImsiParserUS.cpp +++ b/module-services/service-cellular/src/volte/ImsiParserUS.cpp @@ -23,12 +23,12 @@ namespace cellular::service mnc = imsi.substr(mccSize, mncSize); } catch (const std::out_of_range &e) { - LOG_ERROR("IMSI parsing error: %s", e.what()); + 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("Not US MCC."); + LOG_ERROR("[VoLTE] MCC not from USA"); return std::nullopt; } diff --git a/module-services/service-cellular/src/volte/VolteAllowedUSList.cpp b/module-services/service-cellular/src/volte/VolteAllowedUSList.cpp index e340aa1e8e58f493b5014155bb4201caa5eb6fbe..64e184a62d6ef3ed11b72aaa07de0272d16e8c13 100644 --- a/module-services/service-cellular/src/volte/VolteAllowedUSList.cpp +++ b/module-services/service-cellular/src/volte/VolteAllowedUSList.cpp @@ -25,11 +25,11 @@ namespace cellular::service auto VolteAllowedUSList::isVolteAllowed(const OperatorInfo &operatorInfo) -> bool { - LOG_INFO("Trying to find MCC: %s, MNC: %s", operatorInfo.MCC.c_str(), operatorInfo.MNC.c_str()); + 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("Unable to find. VoLTE not allowed."); + LOG_ERROR("[VoLTE] unable to find MCC+MNC on list - VoLTE not allowed"); return false; } return true; diff --git a/module-services/service-cellular/src/volte/VolteCapabilityHandler.cpp b/module-services/service-cellular/src/volte/VolteCapabilityHandler.cpp index d36160963215c83fe5a47aa7a59c5ed803073731..7c54321071877b58085ef41e3b412c5a64e158c3 100644 --- a/module-services/service-cellular/src/volte/VolteCapabilityHandler.cpp +++ b/module-services/service-cellular/src/volte/VolteCapabilityHandler.cpp @@ -2,8 +2,10 @@ // For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md #include "VolteCapabilityHandler.hpp" +#include #include #include + namespace cellular::service { VolteCapabilityHandler::VolteCapabilityHandler(std::unique_ptr imsiParser, @@ -13,31 +15,20 @@ namespace cellular::service cellularInterface(std::move(cellularInterface)) {} - void VolteCapabilityHandler::setChannel(at::BaseChannel *channel) - { - if (cellularInterface.get() != nullptr) { - cellularInterface->setChannel(channel); - } - } - - auto VolteCapabilityHandler::isVolteAllowed() -> bool + auto VolteCapabilityHandler::isVolteAllowed(at::BaseChannel &channel) -> bool { - const auto imsi = cellularInterface->getImsi(); + const auto imsi = cellularInterface->getImsi(channel); if (not imsi.has_value()) { - LOG_ERROR("Failed to read IMSI, disable VoLTE."); + LOG_ERROR("[VoLTE] failed to read IMSI - VoLTE not permitted"); return false; } const auto operatorInfo = imsiParser->parse(imsi.value()); if (not operatorInfo.has_value()) { - LOG_ERROR("Failed to parse IMSI, disable VoLTE."); + LOG_ERROR("[VoLTE] failed to parse IMSI - VoLTE not permitted"); return false; } - return allowedList->isVolteAllowed(operatorInfo.value()); - } - auto VolteCapabilityHandler::isCellularInterfaceReady() -> bool - { - return cellularInterface.get() != nullptr; + return allowedList->isVolteAllowed(operatorInfo.value()); } } // namespace cellular::service diff --git a/module-services/service-cellular/src/volte/VolteCapabilityHandler.hpp b/module-services/service-cellular/src/volte/VolteCapabilityHandler.hpp index f17a50dc3dc20a6a282f82f24624cf1b2d2a3477..e76d7c571e7e40f053ef391a20e1b5e880f1cf4f 100644 --- a/module-services/service-cellular/src/volte/VolteCapabilityHandler.hpp +++ b/module-services/service-cellular/src/volte/VolteCapabilityHandler.hpp @@ -8,13 +8,6 @@ #include "VolteAllowedListInterface.hpp" #include -#include - -namespace at -{ - class Result; - class BaseChannel; -} // namespace at namespace cellular::service { @@ -24,20 +17,14 @@ namespace cellular::service VolteCapabilityHandler(std::unique_ptr imsiParser, std::unique_ptr allowedList, std::unique_ptr cellularInterface); - /** Set AT command channel - * \param channel channel (or nullptr to block communication): - */ - void setChannel(at::BaseChannel *channel); /** Check if it is a possibility to enable VoLTE on current operator * @return true when VoLTE is allowed, false when not */ - auto isVolteAllowed() -> bool; + auto isVolteAllowed(at::BaseChannel &channel) -> bool; private: std::unique_ptr imsiParser; std::unique_ptr allowedList; std::unique_ptr cellularInterface; - - auto isCellularInterfaceReady() -> bool; }; } // namespace cellular::service diff --git a/module-services/service-cellular/src/volte/VolteCapabilityHandlerCellular.cpp b/module-services/service-cellular/src/volte/VolteCapabilityHandlerCellular.cpp index e342d31c8bfd68378a947d02b27fb2daeb627c7f..8d68f4eaadae34817eba8de146a2e4b79955dafa 100644 --- a/module-services/service-cellular/src/volte/VolteCapabilityHandlerCellular.cpp +++ b/module-services/service-cellular/src/volte/VolteCapabilityHandlerCellular.cpp @@ -3,24 +3,15 @@ #include "VolteCapabilityHandlerCellular.hpp" #include +#include namespace cellular::service { - void VolteCapabilityCellular::setChannel(at::BaseChannel *channel) + auto VolteCapabilityCellular::getImsi(at::BaseChannel &channel) -> std::optional { - this->channel = channel; - } - - auto VolteCapabilityCellular::getImsi() -> std::optional - { - if (channel == nullptr) { - LOG_ERROR("No channel provided. Request ignored"); - return std::nullopt; - } - - auto result = channel->cmd(at::AT::CIMI); + auto result = channel.cmd(at::AT::CIMI); if (not result) { - LOG_ERROR("Failed to read IMSI, disable VoLTE."); + LOG_ERROR("[VoLTE] failed to read IMSI - will disable VoLTE"); return std::nullopt; } diff --git a/module-services/service-cellular/src/volte/VolteCapabilityHandlerCellular.hpp b/module-services/service-cellular/src/volte/VolteCapabilityHandlerCellular.hpp index c00a503da571b087b9584eae17aaf72b438dd64c..7eee03cbb64b5ef31e843d33c555c6fd0dfee36b 100644 --- a/module-services/service-cellular/src/volte/VolteCapabilityHandlerCellular.hpp +++ b/module-services/service-cellular/src/volte/VolteCapabilityHandlerCellular.hpp @@ -10,20 +10,13 @@ namespace at { - class Result; class BaseChannel; } // namespace at namespace cellular::service { - - class VolteCapabilityCellular : public VolteCapabilityCellularInterface + struct VolteCapabilityCellular : VolteCapabilityCellularInterface { - public: - void setChannel(at::BaseChannel *channel) final; - auto getImsi() -> std::optional final; - - private: - at::BaseChannel *channel = nullptr; + auto getImsi(at::BaseChannel &) -> std::optional final; }; } // namespace cellular::service diff --git a/module-services/service-cellular/src/volte/VolteCapabiltyHandlerCellularInterface.hpp b/module-services/service-cellular/src/volte/VolteCapabiltyHandlerCellularInterface.hpp index d8ff64084bec966b2c41a72332c0f0d00741b730..7c019b420b257084eddad7f1f02302cdd9931f5a 100644 --- a/module-services/service-cellular/src/volte/VolteCapabiltyHandlerCellularInterface.hpp +++ b/module-services/service-cellular/src/volte/VolteCapabiltyHandlerCellularInterface.hpp @@ -8,18 +8,15 @@ namespace at { - class Result; class BaseChannel; -} // namespace at +} namespace cellular::service { - class VolteCapabilityCellularInterface { public: virtual ~VolteCapabilityCellularInterface() = default; - virtual void setChannel(at::BaseChannel *channel) = 0; - virtual auto getImsi() -> std::optional = 0; + virtual auto getImsi(at::BaseChannel &) -> std::optional = 0; }; } // namespace cellular::service diff --git a/module-services/service-cellular/tests/unittest_volteCapabilityHandler.cpp b/module-services/service-cellular/tests/unittest_volteCapabilityHandler.cpp index 00f9bd6227a1d8400a9798e08536d8ada9cb6e03..3c384c8841ff6e8ed98def3ba2e0c77270f6fed8 100644 --- a/module-services/service-cellular/tests/unittest_volteCapabilityHandler.cpp +++ b/module-services/service-cellular/tests/unittest_volteCapabilityHandler.cpp @@ -7,9 +7,42 @@ #include #include #include +#include TEST_CASE("VoLTE Capability handler") { + struct BaseChannelStub final : at::BaseChannel + { + virtual ~BaseChannelStub() = default; + + virtual auto cmd(const std::string &, std::chrono::milliseconds = at::default_timeout, size_t = 0) -> at::Result + { + return at::Result{}; + } + virtual auto cmd(const at::AT &) -> at::Result + { + return at::Result{}; + } + virtual auto cmd(const at::Cmd &) -> at::Result + { + return at::Result{}; + } + virtual void cmdLog(std::string, const at::Result &, std::chrono::milliseconds) + {} + virtual void cmdInit() + {} + virtual void cmdSend(std::string) + {} + virtual size_t cmdReceive(std::uint8_t *, std::chrono::milliseconds) + { + return 0; + } + virtual void cmdPost() + {} + }; + + static BaseChannelStub baseChannelStub; + SECTION("ImsiParserUS success - US IMSI") { using namespace cellular::service; @@ -86,9 +119,7 @@ TEST_CASE("VoLTE Capability handler") class MockTMobileUS : public cellular::service::VolteCapabilityCellularInterface { - void setChannel(at::BaseChannel *channel) - {} - auto getImsi() -> std::optional + auto getImsi(at::BaseChannel &) -> std::optional override { return "310120123456789"; } @@ -100,15 +131,13 @@ TEST_CASE("VoLTE Capability handler") VolteCapabilityHandler handler{std::make_unique(), std::make_unique(), std::make_unique()}; - auto result = handler.isVolteAllowed(); + auto result = handler.isVolteAllowed(baseChannelStub); REQUIRE(result == true); } class MockNonTMobileUS : public cellular::service::VolteCapabilityCellularInterface { - void setChannel(at::BaseChannel *channel) - {} - auto getImsi() -> std::optional + auto getImsi(at::BaseChannel &) -> std::optional { return "310999123456789"; } @@ -120,15 +149,13 @@ TEST_CASE("VoLTE Capability handler") VolteCapabilityHandler handler{std::make_unique(), std::make_unique(), std::make_unique()}; - auto result = handler.isVolteAllowed(); + auto result = handler.isVolteAllowed(baseChannelStub); REQUIRE(result == false); } class MockFailedToGetImsi : public cellular::service::VolteCapabilityCellularInterface { - void setChannel(at::BaseChannel *channel) - {} - auto getImsi() -> std::optional + auto getImsi(at::BaseChannel &) -> std::optional { return std::nullopt; } @@ -140,7 +167,7 @@ TEST_CASE("VoLTE Capability handler") VolteCapabilityHandler handler{std::make_unique(), std::make_unique(), std::make_unique()}; - auto result = handler.isVolteAllowed(); + auto result = handler.isVolteAllowed(baseChannelStub); REQUIRE(result == false); } } diff --git a/module-services/service-cellular/tests/unittest_volteHandler.cpp b/module-services/service-cellular/tests/unittest_volteHandler.cpp index 5241a0b59dd9ed9313d26f2d406943e1d23d560a..bc0b91bfa505620f6fdbcb069742fd1cb964ddd2 100644 --- a/module-services/service-cellular/tests/unittest_volteHandler.cpp +++ b/module-services/service-cellular/tests/unittest_volteHandler.cpp @@ -113,7 +113,7 @@ TEST_CASE("VoLTE handler test") VolteHandler handler; - REQUIRE_THROWS_WITH(handler.switchVolte(channel, true), Catch::Contains("voice domain")); + REQUIRE_THROWS_WITH(handler.switchVolte(channel, true, true), Catch::Contains("voice domain")); } SECTION("ThrowsAboutMbnAutoselectFailure_When_TryingToEnableVolte_And_AutoselectCommandRespondsNOK") @@ -127,7 +127,7 @@ TEST_CASE("VoLTE handler test") VolteHandler handler; - REQUIRE_THROWS_WITH(handler.switchVolte(channel, true), Catch::Contains("MBN")); + REQUIRE_THROWS_WITH(handler.switchVolte(channel, true, true), Catch::Contains("MBN")); } SECTION("ThrowsAboutImsCheckingFailure_When_TryingToEnableVolte_And_ImsConfigurationQueryRespondsNOK") @@ -142,7 +142,7 @@ TEST_CASE("VoLTE handler test") VolteHandler handler; - REQUIRE_THROWS_WITH(handler.switchVolte(channel, true), Catch::Contains("IMS")); + REQUIRE_THROWS_WITH(handler.switchVolte(channel, true, true), Catch::Contains("IMS")); } SECTION("ThrowsAboutImsCheckingFailure_When_TryingToEnableVolte_And_CantParseImsConfigurationQuery") @@ -157,7 +157,7 @@ TEST_CASE("VoLTE handler test") VolteHandler handler; - REQUIRE_THROWS_WITH(handler.switchVolte(channel, true), Catch::Contains("IMS")); + REQUIRE_THROWS_WITH(handler.switchVolte(channel, true, true), Catch::Contains("IMS")); } SECTION("ReturnsOk_When_TryingToEnableVolte_And_AlreadyEnabled") @@ -172,7 +172,7 @@ TEST_CASE("VoLTE handler test") VolteHandler> handler; - REQUIRE(handler.switchVolte(channel, true)); + REQUIRE(handler.switchVolte(channel, true, true)); } SECTION("ReturnsOk_When_TryingToDisableVolte_And_AlreadyDisabled") @@ -183,7 +183,7 @@ TEST_CASE("VoLTE handler test") VolteHandler> handler; - REQUIRE(handler.switchVolte(channel, false)); + REQUIRE(handler.switchVolte(channel, true, false)); } SECTION("ReturnsFalse_When_TryingToDisableVolte_And_WasEnabledBefore") @@ -197,7 +197,7 @@ TEST_CASE("VoLTE handler test") VolteHandler> handler; - REQUIRE_FALSE(handler.switchVolte(channel, false)); + REQUIRE_FALSE(handler.switchVolte(channel, true, false)); } SECTION("ReturnsFalse_When_TryingToEnableVolte_And_WasEnabledBefore") @@ -211,7 +211,7 @@ TEST_CASE("VoLTE handler test") VolteHandler> handler; - REQUIRE_FALSE(handler.switchVolte(channel, false)); + REQUIRE_FALSE(handler.switchVolte(channel, true, false)); } SECTION("ThrowsAboutImsFailure_When_DisablingVolte_And_ImsSteeringCommandFailed") @@ -225,7 +225,8 @@ TEST_CASE("VoLTE handler test") VolteHandler> handler; - REQUIRE_THROWS_WITH(handler.switchVolte(channel, false), Catch::Contains("fail") && Catch::Contains("IMS")); + REQUIRE_THROWS_WITH(handler.switchVolte(channel, true, false), + Catch::Contains("fail") && Catch::Contains("IMS")); } SECTION("ThrowsAboutImsFailure_When_EnablingVolte_And_ImsSteeringCommandFailed") @@ -241,6 +242,7 @@ TEST_CASE("VoLTE handler test") VolteHandler> handler; - REQUIRE_THROWS_WITH(handler.switchVolte(channel, true), Catch::Contains("fail") && Catch::Contains("IMS")); + REQUIRE_THROWS_WITH(handler.switchVolte(channel, true, true), + Catch::Contains("fail") && Catch::Contains("IMS")); } } diff --git a/pure_changelog.md b/pure_changelog.md index 5614c9c6a8aee27866874cc56822184c0445a06a..9dd4ae4d606069847c35245d94630a9f89d072b2 100644 --- a/pure_changelog.md +++ b/pure_changelog.md @@ -12,6 +12,7 @@ * Fixed MTP issues * Rebuilt SIM cards window * Added option to provide custom GDB to crash analysis script +* Made VoLTE available for proven cellular network(s) only ### Fixed * Fixed incorrect total CPU usage in logs