From 31f3b4e99bfc31ad79cb9e56e96e43eb2fd6de9e Mon Sep 17 00:00:00 2001 From: Aaron McCarthy Date: Tue, 24 Jun 2014 15:20:44 +1000 Subject: [PATCH] [connectionagent] Suppress errors when enabling tethering. Enabling tethering when wlan is not powered causes it to first be powered on. Connman will initiate a scan and may attempt to connect to a known network. The wifi technology will then be switched to tethering mode causing any in progress wlan connection to abort with an error notification. As these error notifications are expected, suppress them. --- connd/qconnectionagent.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/connd/qconnectionagent.cpp b/connd/qconnectionagent.cpp index 520a3ff..9e5dc31 100644 --- a/connd/qconnectionagent.cpp +++ b/connd/qconnectionagent.cpp @@ -153,10 +153,14 @@ void QConnectionAgent::onUserInputCanceled() // from useragent void QConnectionAgent::onErrorReported(const QString &servicePath, const QString &error) { - if (error == "connect-failed" - && (servicePath.contains("cellular") && netman->offlineMode())) { - return; - } + // Suppress errors when switching to offline mode + if (error == "connect-failed" && servicePath.contains("cellular") && netman->offlineMode()) + return; + + // Suppress errors when switching to tethering mode + if ((delayedTethering || tetheringWifiTech->tethering()) && servicePath.contains(QStringLiteral("wifi"))) + return; + qDebug() << "<<<<<<<<<<<<<<<<<<<<" << servicePath << error; Q_EMIT errorReported(servicePath, error); }