bearermanagement/mpm/src/mpmiapselection.cpp
branchRCL_3
changeset 23 fc7b30ed2058
parent 22 984e13af52c4
child 24 05bc53fe583b
equal deleted inserted replaced
22:984e13af52c4 23:fc7b30ed2058
   152         { 
   152         { 
   153         TMPMBearerType bearerType = iSession->MyServer().CommsDatAccess()->GetBearerTypeL( iChooseIapPref.IapId() );
   153         TMPMBearerType bearerType = iSession->MyServer().CommsDatAccess()->GetBearerTypeL( iChooseIapPref.IapId() );
   154         MPMLOGSTRING2( "CMPMIapSelection::ChooseIapL: bearerType: %i", bearerType )
   154         MPMLOGSTRING2( "CMPMIapSelection::ChooseIapL: bearerType: %i", bearerType )
   155 
   155 
   156         // Complete selection with error code if wlan only was set and cellular IAP other 
   156         // Complete selection with error code if wlan only was set and cellular IAP other 
   157         // than MMS IAP was tried to access  
   157         // than MMS IAP was tried to access
   158         if ( wlanOnly && 
   158         // Note that CurrentCellularDataUsage()tells if internal cellular connections are 
   159                 ( bearerType == EMPMBearerTypePacketData ) && 
   159         // temporarily disabled because dial-up connection is prioritized over internal connections.
   160                 ( iSession->IsMMSIap( iChooseIapPref.IapId() ) == EFalse ) ) 
   160         // 
       
   161         if ( ( wlanOnly || CurrentCellularDataUsage() == ECmCellularDataUsageDisabled ) && 
       
   162              ( bearerType == EMPMBearerTypePacketData ) && 
       
   163              ( iSession->IsMMSIap( iChooseIapPref.IapId() ) == EFalse ) ) 
   161             {            
   164             {            
   162             ChooseIapComplete( KErrPermissionDenied, NULL );
   165             ChooseIapComplete( KErrPermissionDenied, NULL );
   163             return;
   166             return;
   164             }
   167             }
   165         }
   168         }
   377                 {
   380                 {
   378                 // Check if we are roaming and cellular data usage query has not yet been presented
   381                 // Check if we are roaming and cellular data usage query has not yet been presented
   379                 // to the user in this country
   382                 // to the user in this country
   380                 if ( iSession->MyServer().RoamingWatcher()->RoamingStatus() == EMPMInternationalRoaming )
   383                 if ( iSession->MyServer().RoamingWatcher()->RoamingStatus() == EMPMInternationalRoaming )
   381                     {
   384                     {
   382                     // Check whether queries are enabled
   385                     // Check that queries aren't disabled and
   383                     if ( !( iChooseIapPref.NoteBehaviour() & TExtendedConnPref::ENoteBehaviourConnDisableQueries ) )
   386                     // enough time has elapsed from the last query cancelled by the user.
       
   387                     if ( !( iChooseIapPref.NoteBehaviour() & TExtendedConnPref::ENoteBehaviourConnDisableQueries ) &&
       
   388                             !iSession->MyServer().IsConnPermQueryTimerOn() )
   384                         {
   389                         {
   385                         TConnectionId connId = iSession->ConnectionId();
   390                         TConnectionId connId = iSession->ConnectionId();
   386                                                             
   391                                                             
   387                         // International roaming
   392                         // International roaming
   388                         iConfirmDlgStarting = CMPMConfirmDlgStarting::NewL( 
   393                         iConfirmDlgStarting = CMPMConfirmDlgStarting::NewL( 
   530 		// This is skipped for VPN (= virtual) IAPs
   535 		// This is skipped for VPN (= virtual) IAPs
   531         if ( ( iSession->IsConfirmFirstL( validateIapId ) ) && 
   536         if ( ( iSession->IsConfirmFirstL( validateIapId ) ) && 
   532              ( iSession->MyServer().CommsDatAccess()->CheckWlanL( validateIapId ) == ENotWlanIap ) &&
   537              ( iSession->MyServer().CommsDatAccess()->CheckWlanL( validateIapId ) == ENotWlanIap ) &&
   533              !( iSession->MyServer().CommsDatAccess()->IsVirtualIapL( validateIapId ) ) )
   538              !( iSession->MyServer().CommsDatAccess()->IsVirtualIapL( validateIapId ) ) )
   534             {
   539             {
   535             // Check whether queries are disabled
   540             // Check that queries aren't disabled and
   536             if ( !( iChooseIapPref.NoteBehaviour() & TExtendedConnPref::ENoteBehaviourConnDisableQueries ) )
   541             // enough time has elapsed from the last query cancelled by the user.
       
   542             if ( !( iChooseIapPref.NoteBehaviour() & TExtendedConnPref::ENoteBehaviourConnDisableQueries ) &&
       
   543                     !iSession->MyServer().IsConnPermQueryTimerOn() )
   537                 {
   544                 {
   538                 if ( iSession->MyServer().RoamingWatcher()->RoamingStatus() == EMPMInternationalRoaming )
   545                 if ( iSession->MyServer().RoamingWatcher()->RoamingStatus() == EMPMInternationalRoaming )
   539                     {
   546                     {
   540                     // International roaming
   547                     // International roaming
   541                     iConfirmDlgStarting = CMPMConfirmDlgStarting::NewL( 
   548                     iConfirmDlgStarting = CMPMConfirmDlgStarting::NewL( 
   920             {
   927             {
   921             // Check if we are roaming and cellular data usage query has not yet been presented
   928             // Check if we are roaming and cellular data usage query has not yet been presented
   922             // to the user in this country
   929             // to the user in this country
   923             if ( iSession->MyServer().RoamingWatcher()->RoamingStatus() == EMPMInternationalRoaming )
   930             if ( iSession->MyServer().RoamingWatcher()->RoamingStatus() == EMPMInternationalRoaming )
   924                 {
   931                 {
   925                 // Check whether queries are enabled
   932                 // Check that queries aren't disabled and
   926                 if ( !( iChooseIapPref.NoteBehaviour() & TExtendedConnPref::ENoteBehaviourConnDisableQueries ) )
   933                 // enough time has elapsed from the last query cancelled by the user.
       
   934                 if ( !( iChooseIapPref.NoteBehaviour() & TExtendedConnPref::ENoteBehaviourConnDisableQueries ) &&
       
   935                         !iSession->MyServer().IsConnPermQueryTimerOn() )
   927                     {
   936                     {
   928                     TConnectionId connId = iSession->ConnectionId();
   937                     TConnectionId connId = iSession->ConnectionId();
   929                                                                     
   938                                                                     
   930                     // International roaming
   939                     // International roaming
   931                     iConfirmDlgStarting = CMPMConfirmDlgStarting::NewL( 
   940                     iConfirmDlgStarting = CMPMConfirmDlgStarting::NewL( 
  1281 TMpmConnPref CMPMIapSelection::MpmConnPref()
  1290 TMpmConnPref CMPMIapSelection::MpmConnPref()
  1282     {
  1291     {
  1283     return iChooseIapPref;
  1292     return iChooseIapPref;
  1284     }
  1293     }
  1285 
  1294 
       
  1295 // ---------------------------------------------------------------------------
       
  1296 // Get current cellular data usage setting
       
  1297 // ---------------------------------------------------------------------------
       
  1298 //
       
  1299 TInt CMPMIapSelection::CurrentCellularDataUsage() const
       
  1300     {
       
  1301     return iSession->MyServer().DataUsageWatcher()->CellularDataUsage();
       
  1302     }