Skip to content

Commit

Permalink
ui: wait for lte connection to update before reactivating (#34275)
Browse files Browse the repository at this point in the history
async
  • Loading branch information
sshane authored Dec 17, 2024
1 parent f149083 commit 8571336
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions selfdrive/ui/qt/network/wifi_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
}
}
}
Expand Down

0 comments on commit 8571336

Please sign in to comment.