From a38e153d2b0de511060515509264b03abb8cc46a Mon Sep 17 00:00:00 2001 From: Lorn Potter Date: Wed, 9 Jul 2014 10:56:50 +1000 Subject: [PATCH] [connectionagent] Do not send connectionRequest if there is a service 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. --- connd/qconnectionagent.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/connd/qconnectionagent.cpp b/connd/qconnectionagent.cpp index 17f80fb..08338fc 100644 --- a/connd/qconnectionagent.cpp +++ b/connd/qconnectionagent.cpp @@ -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" <name() << servicesMap.value(path)->autoConnect(); + if (servicesMap.value(path)->autoConnect()) { + okToRequest = false; + break; + } + } + if (!flightModeSuppression && okToRequest) { Q_EMIT connectionRequest(); } }