bearermanagement/mpm/src/mpmdatausagewatcher.cpp
branchRCL_3
changeset 58 83ca720e2b9a
parent 57 05bc53fe583b
child 69 cf1b3ddbe9a1
equal deleted inserted replaced
57:05bc53fe583b 58:83ca720e2b9a
   116         iErrorCounter = 0;
   116         iErrorCounter = 0;
   117 
   117 
   118         // Get the new Cellular data usage setting value from central repository.
   118         // Get the new Cellular data usage setting value from central repository.
   119         TInt oldCellularDataUsage = iCellularDataUsage;
   119         TInt oldCellularDataUsage = iCellularDataUsage;
   120 
   120 
   121         if ( GetCurrentDataUsageValue() == KErrNone )
   121         if ( GetCurrentDataUsageValue() == KErrNone // Updates iCellularDataUsage
       
   122              && oldCellularDataUsage != iCellularDataUsage
       
   123              && iServer->RoamingWatcher()->RoamingStatus() != EMPMRoamingStatusUnknown )
   122             {
   124             {
   123             // Stop cellular connections if the setting changes into Disabled.
   125             // Setting changed while cellular is in use
   124             if ( oldCellularDataUsage != ECmCellularDataUsageDisabled &&
   126 
   125                     iCellularDataUsage == ECmCellularDataUsageDisabled &&
   127             if ( iCellularDataUsage == ECmCellularDataUsageDisabled )
   126                     iServer->RoamingWatcher()->RoamingStatus() != EMPMRoamingStatusUnknown )
       
   127                 {
   128                 {
       
   129                 // Cellular data usage disabled -> disconnect cellular
   128                 iServer->StopCellularConns();
   130                 iServer->StopCellularConns();
   129                 }
   131                 }
       
   132             else if ( iCellularDataUsage == ECmCellularDataUsageConfirm )
       
   133                 {
       
   134                 // Cellular data usage needs to be confirmed -> disconnect if 
       
   135                 // there are only silent cellular connections left.
       
   136                 iServer->StopCellularConns( ETrue );
       
   137                 }
       
   138 
   130             }
   139             }
   131         }
   140         }
   132     
   141     
   133     RequestNotifications();
   142     RequestNotifications();
   134     }
   143     }