~aleteoryx/muditaos

2de71a003692ec1207cd4f0258379f82500f378f — Maciej-Mudita 3 years ago 2edcb7e
[MOS-74] Fix wrong tethering popup order

After connecting to PC with locked phone there were pop-ups
of tethering and unlocking the screen in the wrong order.
2 files changed, 17 insertions(+), 9 deletions(-)

M module-services/service-desktop/ServiceDesktop.cpp
M pure_changelog.md
M module-services/service-desktop/ServiceDesktop.cpp => module-services/service-desktop/ServiceDesktop.cpp +16 -9
@@ 255,6 255,13 @@ auto ServiceDesktop::handle(locks::UnlockedPhone * /*msg*/) -> std::shared_ptr<s
{
    LOG_INFO("Phone unlocked.");
    usbSecurityModel->setPhoneUnlocked();

    if (initialized && isPlugEventUnhandled) {
        bus.sendUnicast(std::make_shared<sys::TetheringStateRequest>(sys::phone_modes::Tethering::On),
                        service::name::system_manager);
        isPlugEventUnhandled = false;
    }

    return sys::MessageNone{};
}



@@ 346,19 353,19 @@ auto ServiceDesktop::handle(sdesktop::FactoryMessage * /*msg*/) -> std::shared_p

auto ServiceDesktop::handle(sdesktop::usb::USBConfigured *msg) -> std::shared_ptr<sys::Message>
{
    auto message = static_cast<sdesktop::usb::USBConfigured *>(msg);
    if (message->getConfigurationType() == sdesktop::usb::USBConfigurationType::firstConfiguration &&
        isPlugEventUnhandled) {
        bus.sendUnicast(std::make_shared<sys::TetheringStateRequest>(sys::phone_modes::Tethering::On),
                        service::name::system_manager);
        isPlugEventUnhandled = false;
    }

    if (usbSecurityModel->isSecurityEnabled()) {
        LOG_INFO("Endpoint security enabled, requesting passcode");

        bus.sendUnicast(std::make_shared<locks::UnlockPhone>(), service::name::appmgr);
    }
    else {
        auto message = static_cast<sdesktop::usb::USBConfigured *>(msg);
        if (message->getConfigurationType() == sdesktop::usb::USBConfigurationType::firstConfiguration &&
            isPlugEventUnhandled) {
            bus.sendUnicast(std::make_shared<sys::TetheringStateRequest>(sys::phone_modes::Tethering::On),
                            service::name::system_manager);
            isPlugEventUnhandled = false;
        }
    }

    return sys::MessageNone{};
}

M pure_changelog.md => pure_changelog.md +1 -0
@@ 7,6 7,7 @@
* Separated system volume from Bluetooth device volume for A2DP

### Fixed
* Fixed wrong tethering popup order
* Fixed crash during phone turn off
* Fixed improper duration of the rejected outgoing call shown in calls log
* Fixed Bluetooth volume control issues