ui: wait for lte connection to update before reactivating (#34275)

async
pull/34273/head^2
Shane Smiskol 4 months ago committed by GitHub
parent f149083e4a
commit 857133635c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 10
      selfdrive/ui/qt/network/wifi_manager.cc

@ -403,9 +403,13 @@ void WifiManager::updateGsmSettings(bool roaming, QString apn, bool metered) {
}
if (changes) {
call(lteConnectionPath.path(), NM_DBUS_INTERFACE_SETTINGS_CONNECTION, "UpdateUnsaved", QVariant::fromValue(settings)); // update is temporary
deactivateConnection(lteConnectionPath);
activateModemConnection(lteConnectionPath);
QDBusPendingCall pending_call = asyncCall(lteConnectionPath.path(), NM_DBUS_INTERFACE_SETTINGS_CONNECTION, "UpdateUnsaved", QVariant::fromValue(settings)); // update is temporary
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pending_call);
QObject::connect(watcher, &QDBusPendingCallWatcher::finished, this, [this, watcher]() {
deactivateConnection(lteConnectionPath);
activateModemConnection(lteConnectionPath);
watcher->deleteLater();
});
}
}
}

Loading…
Cancel
Save