~aleteoryx/muditaos

5e7ff6e5af464e62eb1759276bda0d5952414f3e — Marcin Zieliński 3 years ago c82f16e
[MOS-840] VoLTE switch unavailability fix

Added checking if a SIM card is present in the active slot
during ApplicationSettings initialization so that in case
there's no SIM, the VoLTE switch is made anavailable to
toggle.
1 files changed, 5 insertions(+), 2 deletions(-)

M module-services/service-cellular/ServiceCellular.cpp
M module-services/service-cellular/ServiceCellular.cpp => module-services/service-cellular/ServiceCellular.cpp +5 -2
@@ 594,8 594,11 @@ void ServiceCellular::registerMessageHandlers()
    });

    connect(typeid(cellular::GetVolteStateRequest), [&](sys::Message *request) -> sys::MessagePointer {
        bus.sendUnicast(std::make_shared<cellular::GetVolteStateResponse>(priv->volteHandler->getVolteState()),
                        request->sender);
        auto simInsertedStatus = priv->simCard->getSimInsertedStatus();
        auto volteState = (simInsertedStatus.has_value() && *simInsertedStatus == at::SimInsertedStatus::Inserted)
                              ? priv->volteHandler->getVolteState()
                              : VolteState{VolteState::Enablement::Off, false};
        bus.sendUnicast(std::make_shared<cellular::GetVolteStateResponse>(volteState), request->sender);
        return sys::MessageNone{};
    });