~aleteoryx/muditaos

8ea8626e8de656462067b49fc5f338f8f3e8f3cd — Maciej Janicki 4 years ago bb63966
[EGD-6426] Fix sim card not being detected

Adds selected sim read from settings.
1 files changed, 10 insertions(+), 2 deletions(-)

M module-apps/application-desktop/ApplicationDesktop.cpp
M module-apps/application-desktop/ApplicationDesktop.cpp => module-apps/application-desktop/ApplicationDesktop.cpp +10 -2
@@ 187,7 187,6 @@ namespace app
    }
    ApplicationDesktop::~ApplicationDesktop()
    {
        LOG_INFO("Desktop destruktor");
    }

    // Invoked upon receiving data message


@@ 478,11 477,20 @@ namespace app
            std::make_shared<sdesktop::UpdateOsMessage>(updateos::UpdateMessageType::UpdateCheckForUpdateOnce);
        bus.sendUnicast(msgToSend, service::name::service_desktop);

        auto selectedSim = magic_enum::enum_cast<Store::GSM::SIM>(
            settings->getValue(settings::SystemProperties::activeSim, settings::SettingsScope::Global));
        if (selectedSim.has_value()) {
            Store::GSM::get()->selected = selectedSim.value();
        }
        else {
            Store::GSM::get()->selected = Store::GSM::SIM::NONE;
        }

        settings->registerValueChange(
            settings::SystemProperties::activeSim,
            [this](const std::string &value) { activeSimChanged(value); },
            settings::SettingsScope::Global);
        Store::GSM::get()->selected = Store::GSM::SIM::NONE;

        settings->registerValueChange(
            settings::SystemProperties::lockPassHash,
            [this](const std::string &value) { lockPassHashChanged(value); },