bearermanagement/mpm/src/mpmdatausagewatcher.cpp
branchRCL_3
changeset 55 fc7b30ed2058
parent 17 c14618f9de99
child 57 05bc53fe583b
--- a/bearermanagement/mpm/src/mpmdatausagewatcher.cpp	Thu Jul 15 19:05:04 2010 +0300
+++ b/bearermanagement/mpm/src/mpmdatausagewatcher.cpp	Thu Aug 19 10:18:49 2010 +0300
@@ -118,15 +118,24 @@
         // Get the new Cellular data usage setting value from central repository.
         TInt oldCellularDataUsage = iCellularDataUsage;
 
-        if ( GetCurrentDataUsageValue() == KErrNone )
+        if ( GetCurrentDataUsageValue() == KErrNone // Updates iCellularDataUsage
+             && oldCellularDataUsage != iCellularDataUsage
+             && iServer->RoamingWatcher()->RoamingStatus() != EMPMRoamingStatusUnknown )
             {
-            // Stop cellular connections if the setting changes into Disabled.
-            if ( oldCellularDataUsage != ECmCellularDataUsageDisabled &&
-                    iCellularDataUsage == ECmCellularDataUsageDisabled &&
-                    iServer->RoamingWatcher()->RoamingStatus() != EMPMRoamingStatusUnknown )
+            // Setting changed while cellular is in use
+
+            if ( iCellularDataUsage == ECmCellularDataUsageDisabled )
                 {
+                // Cellular data usage disabled -> disconnect cellular
                 iServer->StopCellularConns();
                 }
+            else if ( iCellularDataUsage == ECmCellularDataUsageConfirm )
+                {
+                // Cellular data usage needs to be confirmed -> disconnect if 
+                // there are only silent cellular connections left.
+                iServer->StopCellularConns( ETrue );
+                }
+
             }
         }
     
@@ -182,3 +191,12 @@
         }
     return err;
     }
+
+// -----------------------------------------------------------------------------
+// CMpmDataUsageWatcher::CellularDataUsage
+// -----------------------------------------------------------------------------
+//
+TInt CMpmDataUsageWatcher::CellularDataUsage() const
+    {
+    return iCellularDataUsage;
+    }