Skip to content

Commit

Permalink
[connectionagent] Suppress errors when enabling tethering.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Aaron McCarthy committed Jun 24, 2014
1 parent 77ec166 commit 31f3b4e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions connd/qconnectionagent.cpp
Expand Up @@ -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())) {
// 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);
}
Expand Down

0 comments on commit 31f3b4e

Please sign in to comment.