Skip to content

Commit

Permalink
[connectionagent] Do not send connectionRequest if there is a service
Browse files Browse the repository at this point in the history
available that is auto connectable.

This fixes condition when changing from one tech to another and
there is a dns lookup error that causes a connectionRequest from
connman in the moment between connections.
  • Loading branch information
Lorn Potter committed Jul 9, 2014
1 parent 2147d2f commit a38e153
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion connd/qconnectionagent.cpp
Expand Up @@ -170,7 +170,15 @@ void QConnectionAgent::onConnectionRequest()
{
sendConnectReply("Suppress", 15);
qDebug() << flightModeSuppression;
if (!flightModeSuppression) {
bool okToRequest = true;
Q_FOREACH (const QString &path, servicesMap.keys()) {
qDebug() << "checking" <<servicesMap.value(path)->name() << servicesMap.value(path)->autoConnect();
if (servicesMap.value(path)->autoConnect()) {
okToRequest = false;
break;
}
}
if (!flightModeSuppression && okToRequest) {
Q_EMIT connectionRequest();
}
}
Expand Down

0 comments on commit a38e153

Please sign in to comment.