bearermanagement/mpm/src/mpmdatausagewatcher.cpp
branchRCL_3
changeset 57 05bc53fe583b
parent 55 fc7b30ed2058
child 58 83ca720e2b9a
equal deleted inserted replaced
55:fc7b30ed2058 57:05bc53fe583b
   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 // Updates iCellularDataUsage
   121         if ( GetCurrentDataUsageValue() == KErrNone )
   122              && oldCellularDataUsage != iCellularDataUsage
       
   123              && iServer->RoamingWatcher()->RoamingStatus() != EMPMRoamingStatusUnknown )
       
   124             {
   122             {
   125             // Setting changed while cellular is in use
   123             // Stop cellular connections if the setting changes into Disabled.
   126 
   124             if ( oldCellularDataUsage != ECmCellularDataUsageDisabled &&
   127             if ( iCellularDataUsage == ECmCellularDataUsageDisabled )
   125                     iCellularDataUsage == ECmCellularDataUsageDisabled &&
       
   126                     iServer->RoamingWatcher()->RoamingStatus() != EMPMRoamingStatusUnknown )
   128                 {
   127                 {
   129                 // Cellular data usage disabled -> disconnect cellular
       
   130                 iServer->StopCellularConns();
   128                 iServer->StopCellularConns();
   131                 }
   129                 }
   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 
       
   139             }
   130             }
   140         }
   131         }
   141     
   132     
   142     RequestNotifications();
   133     RequestNotifications();
   143     }
   134     }