~aleteoryx/muditaos

829b9b256008baebe6a556b08e726e9d05c4b739 — Maciej-Mudita 3 years ago dcfe367
[MOS-74] Fix wrong tethering popup order

Fix for tethering popup when charger is connected
M module-services/service-desktop/ServiceDesktop.cpp => module-services/service-desktop/ServiceDesktop.cpp +3 -1
@@ 221,6 221,7 @@ auto ServiceDesktop::usbWorkerDeinit() -> sys::ReturnCodes
        desktopWorker->closeWorker();
        desktopWorker.reset();
        initialized = false;
        isUsbConfigured = false;
    }
    return sys::ReturnCodes::Success;
}


@@ 256,7 257,7 @@ auto ServiceDesktop::handle(locks::UnlockedPhone * /*msg*/) -> std::shared_ptr<s
    LOG_INFO("Phone unlocked.");
    usbSecurityModel->setPhoneUnlocked();

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


@@ 353,6 354,7 @@ auto ServiceDesktop::handle(sdesktop::FactoryMessage * /*msg*/) -> std::shared_p

auto ServiceDesktop::handle(sdesktop::usb::USBConfigured *msg) -> std::shared_ptr<sys::Message>
{
    isUsbConfigured = true;
    if (usbSecurityModel->isSecurityEnabled()) {
        LOG_INFO("Endpoint security enabled, requesting passcode");
        bus.sendUnicast(std::make_shared<locks::UnlockPhone>(), service::name::appmgr);

M module-services/service-desktop/include/service-desktop/ServiceDesktop.hpp => module-services/service-desktop/include/service-desktop/ServiceDesktop.hpp +1 -0
@@ 92,6 92,7 @@ class ServiceDesktop : public sys::Service
    static constexpr unsigned int DefaultLogFlushTimeoutInMs = 1000U;
    bool initialized                                         = false;
    bool isPlugEventUnhandled                                = false;
    bool isUsbConfigured                                     = false;

    void generateDeviceUniqueId();
    auto getDeviceUniqueId() const -> std::string;