summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorShane Kearns <shane.kearns@accenture.com>2011-09-09 15:00:19 (GMT)
committerShane Kearns <shane.kearns@accenture.com>2011-09-13 13:17:52 (GMT)
commit0ed694bd074be42272bf795a3add4f55457ddd75 (patch)
tree29e650614500f6eb2fafbf793133e1451b184a14 /src/plugins
parente9060024fa2100ce5c8b2e8689d2ec72b75a3211 (diff)
downloadQt-0ed694bd074be42272bf795a3add4f55457ddd75.zip
Qt-0ed694bd074be42272bf795a3add4f55457ddd75.tar.gz
Qt-0ed694bd074be42272bf795a3add4f55457ddd75.tar.bz2
More accurately determine bearer type for symbian GPRS/3G
The symbian IAP records don't distinguish between GRPS/EDGE/3G/HSPA, although the phone knows what type of cell it is attached to. For the IAP records which are of packet data type (reported as KCommDbBearerWcdma), we now query the phone network mode to determine the bearer type to report. The Qt API doesn't distinguish GRPS/EDGE (both are "2G") The Symbian API doesn't distinguish 3G and HSPA unless there is an active connection. So we have to report both of these as WCDMA. When a connection becomes active, we update Qt's IAP record list to show the known connection type (which may include HSPA now). Qt already contained code to observe roaming between cell types, which reports all types. Note that the bearer type may change during connection (handover to another cell may occur), which should be covered by the already existing code. Task-Number: QTBUG-19011 Reviewed-By: mread
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/bearer/symbian/symbianengine.cpp36
1 files changed, 34 insertions, 2 deletions
diff --git a/src/plugins/bearer/symbian/symbianengine.cpp b/src/plugins/bearer/symbian/symbianengine.cpp
index fc2791a..fdfe94a 100644
--- a/src/plugins/bearer/symbian/symbianengine.cpp
+++ b/src/plugins/bearer/symbian/symbianengine.cpp
@@ -505,8 +505,33 @@ SymbianNetworkConfigurationPrivate *SymbianEngine::configFromConnectionMethodL(
cpPriv->bearerType = QNetworkConfiguration::Bearer2G;
break;
case KCommDbBearerWcdma:
- cpPriv->bearerType = QNetworkConfiguration::BearerWCDMA;
- break;
+ {
+ //This is ambiguous, check the network status to find out what the expected connection will be
+ TUint mode;
+ TRequestStatus status;
+ iConnectionMonitor.GetUintAttribute(0, 0, KMobilePhoneNetworkMode, mode, status);
+ User::WaitForRequest(status);
+ if (status != KErrNone)
+ cpPriv->bearerType = QNetworkConfiguration::BearerUnknown;
+ else switch (mode) {
+ case EConnMonNetworkModeCdma2000:
+ cpPriv->bearerType = QNetworkConfiguration::BearerCDMA2000;
+ break;
+ case EConnMonNetworkModeWcdma:
+ case EConnMonNetworkModeTdcdma:
+ cpPriv->bearerType = QNetworkConfiguration::BearerWCDMA; //includes HSDPA, as this API can't detect it
+ break;
+ case EConnMonNetworkModeGsm:
+ case EConnMonNetworkModeAmps:
+ case EConnMonNetworkModeCdma95:
+ cpPriv->bearerType = QNetworkConfiguration::Bearer2G; //includes GPRS and EDGE, Qt API treats them both as 2G
+ break;
+ default:
+ cpPriv->bearerType = QNetworkConfiguration::BearerUnknown;
+ break;
+ }
+ break;
+ }
case KCommDbBearerLAN:
cpPriv->bearerType = QNetworkConfiguration::BearerEthernet;
break;
@@ -1122,6 +1147,13 @@ void SymbianEngine::EventL(const CConnMonEventBase& aEvent)
}
);
}
+
+ //update bearer type for 2G/3G connections
+ TInt bearer;
+ iConnectionMonitor.GetIntAttribute(connectionId, 0, KBearerInfo, bearer, status);
+ User::WaitForRequest(status);
+ if (status == KErrNone)
+ updateMobileBearerToConfigs(TConnMonBearerInfo(bearer));
} else if (connectionStatus == KConfigDaemonStartingDeregistration) {
TUint connectionId = realEvent->ConnectionId();
QNetworkConfigurationPrivatePointer ptr = dataByConnectionId(connectionId);