always use connman to connect to cellular services
connman provides better error messages. Change-Id: Ifcfd4a4ff8d632273ab9ff7478a6c43cbf2cde98 Reviewed-by: Robin Burchell <robin+qt@viroteck.net>bb10
parent
9764f86027
commit
b12bec0fcf
|
|
@ -150,20 +150,7 @@ void QConnmanEngine::connectToId(const QString &id)
|
|||
if(!serv.isValid()) {
|
||||
emit connectionError(id, QBearerEngineImpl::InterfaceLookupError);
|
||||
} else {
|
||||
if(serv.getType() != "cellular") {
|
||||
|
||||
serv.connect();
|
||||
} else {
|
||||
QOfonoManagerInterface ofonoManager(0);
|
||||
QString modemPath = ofonoManager.currentModem().path();
|
||||
QOfonoDataConnectionManagerInterface dc(modemPath,0);
|
||||
foreach (const QDBusObjectPath &dcPath,dc.getPrimaryContexts()) {
|
||||
if(dcPath.path().contains(servicePath.section("_",-1))) {
|
||||
QOfonoConnectionContextInterface primaryContext(dcPath.path(),0);
|
||||
primaryContext.setActive(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
serv.connect();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -175,19 +162,7 @@ void QConnmanEngine::disconnectFromId(const QString &id)
|
|||
if(!serv.isValid()) {
|
||||
emit connectionError(id, DisconnectionError);
|
||||
} else {
|
||||
if(serv.getType() != "cellular") {
|
||||
serv.disconnect();
|
||||
} else {
|
||||
QOfonoManagerInterface ofonoManager(0);
|
||||
QString modemPath = ofonoManager.currentModem().path();
|
||||
QOfonoDataConnectionManagerInterface dc(modemPath,0);
|
||||
foreach (const QDBusObjectPath &dcPath,dc.getPrimaryContexts()) {
|
||||
if(dcPath.path().contains(servicePath.section("_",-1))) {
|
||||
QOfonoConnectionContextInterface primaryContext(dcPath.path(),0);
|
||||
primaryContext.setActive(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
serv.disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue