make sure connman bearer service is autconnect before connecting

Change-Id: I4c9a93d69f7fe990bf9d7f2e939abbe2c82ba449
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
This commit is contained in:
Lorn Potter 2014-03-21 05:04:08 +10:00 committed by The Qt Project
parent da77aaa98c
commit e368866d68

View File

@ -189,7 +189,20 @@ void QConnmanEngine::connectToId(const QString &id)
if (!serv->isValid()) {
emit connectionError(id, QBearerEngineImpl::InterfaceLookupError);
} else {
serv->connect();
if (serv->type() == QLatin1String("cellular")) {
if (serv->roaming()) {
if (!isRoamingAllowed(serv->path())) {
emit connectionError(id, QBearerEngineImpl::OperationNotSupported);
return;
}
if (isAlwaysAskRoaming()) {
emit connectionError(id, QBearerEngineImpl::OperationNotSupported);
return;
}
}
}
if (serv->autoConnect())
serv->connect();
}
}