summaryrefslogtreecommitdiffstats
path: root/src/plugins/bearer
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/bearer')
-rw-r--r--src/plugins/bearer/symbian/qnetworksession_impl.cpp3
-rw-r--r--src/plugins/bearer/symbian/symbianengine.cpp52
-rw-r--r--src/plugins/bearer/symbian/symbianengine.h1
3 files changed, 55 insertions, 1 deletions
diff --git a/src/plugins/bearer/symbian/qnetworksession_impl.cpp b/src/plugins/bearer/symbian/qnetworksession_impl.cpp
index fc65b86..a7dad2b 100644
--- a/src/plugins/bearer/symbian/qnetworksession_impl.cpp
+++ b/src/plugins/bearer/symbian/qnetworksession_impl.cpp
@@ -1377,6 +1377,9 @@ void QNetworkSessionPrivateImpl::handleSymbianConnectionStatusChange(TInt aConne
newState(QNetworkSession::Closing,accessPointId);
break;
+ // Connection stopped
+ case KConfigDaemonFinishedDeregistrationStop: //this comes if this is the last session, instead of KLinkLayerClosed
+ case KConfigDaemonFinishedDeregistrationPreserve:
// Connection closed
case KConnectionClosed:
case KLinkLayerClosed:
diff --git a/src/plugins/bearer/symbian/symbianengine.cpp b/src/plugins/bearer/symbian/symbianengine.cpp
index fdfe94a..ee80297 100644
--- a/src/plugins/bearer/symbian/symbianengine.cpp
+++ b/src/plugins/bearer/symbian/symbianengine.cpp
@@ -329,7 +329,27 @@ void SymbianEngine::updateConfigurationsL()
cpPriv->connectionId = 0;
cpPriv->state = QNetworkConfiguration::Defined;
cpPriv->type = QNetworkConfiguration::ServiceNetwork;
- cpPriv->purpose = QNetworkConfiguration::UnknownPurpose;
+
+ // determine purpose of this SNAP
+ TUint32 purpose = CMManager::ESnapPurposeUnknown;
+ TRAP_IGNORE(purpose = destination.MetadataL(CMManager::ESnapMetadataPurpose));
+ switch (purpose) {
+ case CMManager::ESnapPurposeInternet:
+ cpPriv->purpose = QNetworkConfiguration::PublicPurpose;
+ break;
+ case CMManager::ESnapPurposeIntranet:
+ cpPriv->purpose = QNetworkConfiguration::PrivatePurpose;
+ break;
+ case CMManager::ESnapPurposeMMS:
+ case CMManager::ESnapPurposeOperator:
+ cpPriv->purpose = QNetworkConfiguration::ServiceSpecificPurpose;
+ break;
+ case CMManager::ESnapPurposeUnknown:
+ default:
+ cpPriv->purpose = QNetworkConfiguration::UnknownPurpose;
+ break;
+ }
+
cpPriv->roamingSupported = false;
QNetworkConfigurationPrivatePointer ptr(cpPriv);
@@ -482,9 +502,39 @@ void SymbianEngine::updateConfigurationsL()
#ifdef SNAP_FUNCTIONALITY_AVAILABLE
updateStatesToSnaps();
+ updatePurposeToIaps();
#endif
}
+//copy purpose from SNAP to child IAPs, unless child is contained in more than one SNAP with conflicting purposes.
+void SymbianEngine::updatePurposeToIaps()
+{
+ QMutexLocker lock(&mutex);
+ QHash<QString,int> purposes;
+ foreach (QNetworkConfigurationPrivatePointer snap, snapConfigurations.values()) {
+ QMutexLocker snaplock(&snap->mutex);
+ foreach (QNetworkConfigurationPrivatePointer iap, snap->serviceNetworkMembers.values()) {
+ QMutexLocker iaplock(&iap->mutex);
+ QString id = iap->id;
+ if (purposes.contains(id) && purposes.value(id) != snap->purpose)
+ purposes[id] = -1; //conflict detected
+ else
+ purposes[id] = snap->purpose;
+ }
+ }
+
+ for (QHash<QString,int>::const_iterator it = purposes.constBegin(); it != purposes.constEnd(); ++it) {
+ if (accessPointConfigurations.contains(it.key())) {
+ QNetworkConfigurationPrivatePointer iap = accessPointConfigurations.value(it.key());
+ QMutexLocker iaplock(&iap->mutex);
+ int purpose = it.value();
+ if (purpose == -1) //resolve conflicts as unknown
+ purpose = QNetworkConfiguration::UnknownPurpose;
+ iap->purpose = (QNetworkConfiguration::Purpose)purpose;
+ }
+ }
+}
+
#ifdef SNAP_FUNCTIONALITY_AVAILABLE
SymbianNetworkConfigurationPrivate *SymbianEngine::configFromConnectionMethodL(
RCmConnectionMethod& connectionMethod)
diff --git a/src/plugins/bearer/symbian/symbianengine.h b/src/plugins/bearer/symbian/symbianengine.h
index a205c97..b75f27e 100644
--- a/src/plugins/bearer/symbian/symbianengine.h
+++ b/src/plugins/bearer/symbian/symbianengine.h
@@ -155,6 +155,7 @@ public Q_SLOTS:
private:
void updateStatesToSnaps();
+ void updatePurposeToIaps();
bool changeConfigurationStateTo(QNetworkConfigurationPrivatePointer ptr,
QNetworkConfiguration::StateFlags newState);
bool changeConfigurationStateAtMinTo(QNetworkConfigurationPrivatePointer ptr,