bearermanagement/mpm/src/mpmdatausagewatcher.cpp
changeset 72 0c32cf868819
parent 71 9f263f780e41
equal deleted inserted replaced
71:9f263f780e41 72:0c32cf868819
   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     }