bearermanagement/mpm/src/mpmiapselection.cpp
changeset 33 d15c703eefa3
parent 32 5c4486441ae6
child 44 a0c4ceac30d0
equal deleted inserted replaced
32:5c4486441ae6 33:d15c703eefa3
   348             // When application is starting an IAP confirmation is asked only when roaming.
   348             // When application is starting an IAP confirmation is asked only when roaming.
   349             // This is skipped for VPN (= virtual) IAPs
   349             // This is skipped for VPN (= virtual) IAPs
   350             if ( iSession->IsConfirmFirstL( validateIapId ) &&
   350             if ( iSession->IsConfirmFirstL( validateIapId ) &&
   351                  !( iSession->MyServer().CommsDatAccess()->IsVirtualIapL( validateIapId ) ))
   351                  !( iSession->MyServer().CommsDatAccess()->IsVirtualIapL( validateIapId ) ))
   352                 {
   352                 {
   353                 // Check if we are roaming and cellular data usage query has not yet been presented
   353             
   354                 // to the user in this country
   354                 // Check whether queries are enabled
   355                 if ( iSession->MyServer().RoamingWatcher()->RoamingStatus() == EMPMInternationalRoaming )
   355                 if ( !( iChooseIapPref.NoteBehaviour()
       
   356                         & TExtendedConnPref::ENoteBehaviourConnDisableQueries ) )
   356                     {
   357                     {
   357                     // Check whether queries are enabled
   358                 
   358                     if ( !( iChooseIapPref.NoteBehaviour() & TExtendedConnPref::ENoteBehaviourConnDisableQueries ) )
   359                     TConnectionId connId = iSession->ConnectionId();
   359                         {
   360 
   360                         TConnectionId connId = iSession->ConnectionId();
   361                     // Set confirmation type based on roaming status
   361                                                             
   362                     CMPMConfirmDlg::TDialogType type = 
   362                         // International roaming
   363                             CMPMConfirmDlg::EConfirmDlgHomeNetwork;
   363                         iConfirmDlgStarting = CMPMConfirmDlgStarting::NewL( 
   364                     if ( iSession->MyServer().RoamingWatcher()->RoamingStatus()
   364                             *this, 
   365                             == EMPMInternationalRoaming ) {
   365                             connId,
   366                         type = CMPMConfirmDlg::EConfirmDlgVisitorNetwork;
   366                             snap, 
   367                     }
   367                             validateIapId, 
   368                     
   368                             CMPMConfirmDlg::EConfirmDlgVisitorNetwork,
   369                     iConfirmDlgStarting = CMPMConfirmDlgStarting::NewL( 
   369                             iChooseIapPref,
   370                         *this, 
   370                             iSession->MyServer(),
   371                         connId,
   371                             *iSession,
   372                         snap, 
   372                             EExplicitConnection );
   373                         validateIapId, 
   373                         return;    
   374                         type,
   374                         }
   375                         iChooseIapPref,
   375                     else
   376                         iSession->MyServer(),
   376                         {
   377                         *iSession,
   377                         // Queries disabled, connection must fail
   378                         EExplicitConnection );
   378                         ChooseIapComplete( KErrPermissionDenied, &iChooseIapPref );
   379                     return;    
   379                         return;
   380                     }
   380                         }
   381                 else
       
   382                     {
       
   383                     // Queries disabled, connection must fail
       
   384                     ChooseIapComplete( KErrPermissionDenied, &iChooseIapPref );
       
   385                     return;
   381                     }
   386                     }
   382                 }
   387                 }
   383                            
   388                            
   384             // Add info into the BM connections
   389             // Add info into the BM connections
   385             //
   390             //
   453     ChooseBestIAPL( iChooseIapPref, availableIAPList, iNextBestExists );
   458     ChooseBestIAPL( iChooseIapPref, availableIAPList, iNextBestExists );
   454     TUint32 validateIapId = iChooseIapPref.IapId();
   459     TUint32 validateIapId = iChooseIapPref.IapId();
   455     // Check if any suitable IAP's were found, if not then complete selection with error code
   460     // Check if any suitable IAP's were found, if not then complete selection with error code
   456     if ( validateIapId == 0 )
   461     if ( validateIapId == 0 )
   457         {
   462         {
   458         if ( iChooseIapPref.ConnType() == TMpmConnPref::EConnTypeDefault ||
   463         if ( !( iChooseIapPref.NoteBehaviour() & TExtendedConnPref::ENoteBehaviourConnDisableQueries ) &&
       
   464                 ( iChooseIapPref.ConnType() == TMpmConnPref::EConnTypeDefault ||
   459                 ( iChooseIapPref.ConnType() == TMpmConnPref::EConnTypeExplicit &&
   465                 ( iChooseIapPref.ConnType() == TMpmConnPref::EConnTypeExplicit &&
   460                 !( iChooseIapPref.NoteBehaviour() & TExtendedConnPref::ENoteBehaviourConnDisableQueries ) &&
   466                   iCommsDatAccess->IsInternetSnapL( 0, snap ) ) ) )
   461                 iCommsDatAccess->IsInternetSnapL( 0, snap ) ) )
       
   462             {
   467             {
   463             ImplicitConnectionL();
   468             ImplicitConnectionL();
   464             }
   469             }
   465         else
   470         else
   466             {
   471             {