~aleteoryx/muditaos

006d210a42977518b8a17f3f3e7832b02c255f9e — Lukasz Mastalerz 2 years ago 035eb42
[CP-1419] Signal range in Pure status without SIM card inserted

Fix for incorrect signal strength displayed in Center when network
status is NotRegistered.
M products/PurePhone/services/desktop/endpoints/deviceInfo/DeviceInfoEndpoint.cpp => products/PurePhone/services/desktop/endpoints/deviceInfo/DeviceInfoEndpoint.cpp +10 -2
@@ 1,4 1,4 @@
// 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 <endpoints/deviceInfo/DeviceInfoEndpoint.hpp>


@@ 38,12 38,20 @@ namespace sdesktop::endpoints
    {
        auto [totalDeviceSpaceMiB, reservedSystemSpaceMiB, usedUserSpaceMiB] = getStorageInfo();

        const auto signalStrength = []() {
            const auto status = Store::GSM::get()->getNetwork().status;
            if (status == Store::Network::Status::NotRegistered) {
                return 0;
            }
            return static_cast<int>(Store::GSM::get()->getSignalStrength().rssiBar);
        }();

        context.setResponseBody(json11::Json::object(
            {{json::batteryLevel, std::to_string(Store::Battery::get().level)},
             {json::batteryState, std::to_string(static_cast<int>(Store::Battery::get().state))},
             {json::selectedSim, std::to_string(static_cast<int>(Store::GSM::get()->selected))},
             {json::trayState, std::to_string(static_cast<int>(Store::GSM::get()->tray))},
             {json::signalStrength, std::to_string(static_cast<int>(Store::GSM::get()->getSignalStrength().rssiBar))},
             {json::signalStrength, std::to_string(signalStrength)},
             {json::accessTechnology,
              std::to_string(static_cast<int>(Store::GSM::get()->getNetwork().accessTechnology))},
             {json::networkStatus, std::to_string(static_cast<int>(Store::GSM::get()->getNetwork().status))},

M pure_changelog.md => pure_changelog.md +1 -0
@@ 47,6 47,7 @@
* Fixed scrollbar behavior in call log view
* Fixed contacts imported from SIM do not show up in Mudita Center 
* Fixed broken events counter on main screen for more than 99 events
* Fixed for incorrect signal strength displayed in Center

### Added