bearermanagement/mpm/src/mpmiapselection.cpp
branchRCL_3
changeset 17 c14618f9de99
parent 15 4dc3bb0099b0
child 19 22c3c67e5001
equal deleted inserted replaced
15:4dc3bb0099b0 17:c14618f9de99
    41       iWlanDialog( NULL ),
    41       iWlanDialog( NULL ),
    42       iNextBestExists( EFalse ),
    42       iNextBestExists( EFalse ),
    43       iUserSelectionIapId( 0 ),
    43       iUserSelectionIapId( 0 ),
    44       iUserSelectionSnapId( 0 ),
    44       iUserSelectionSnapId( 0 ),
    45       iImplicitState( EImplicitStart ),
    45       iImplicitState( EImplicitStart ),
    46       iOfflineNoteResponse( EOfflineResponseUndefined ),
       
    47       iIsRoaming( EFalse ),
    46       iIsRoaming( EFalse ),
    48       iNewWlansAllowed ( EFalse )
    47       iNewWlansAllowed ( EFalse )
    49     {
    48     {
    50     }
    49     }
    51 
    50 
   342         // In case offline mode is enabled, only LAN or WLAN is allowed.
   341         // In case offline mode is enabled, only LAN or WLAN is allowed.
   343         // If some other bearer has been requested, then error code 
   342         // If some other bearer has been requested, then error code 
   344         // KErrGprsOfflineMode should be returned instead of KErrNone.
   343         // KErrGprsOfflineMode should be returned instead of KErrNone.
   345         // 
   344         // 
   346         
   345         
   347         if ( !iapTypeLanOrWlan && iSession->IsPhoneOfflineL() )
   346         if ( !iapTypeLanOrWlan && iSession->MyServer().IsPhoneOffline() )
   348             {
   347             {
   349             ChooseIapComplete( KErrGprsOfflineMode, &iChooseIapPref );
   348             ChooseIapComplete( KErrGprsOfflineMode, &iChooseIapPref );
   350             }
   349             }
   351         else
   350         else
   352             {
   351             {
   510 
   509 
   511     if ( !CheckGprsServicesAllowedL( iapTypeLanOrWlan ) )
   510     if ( !CheckGprsServicesAllowedL( iapTypeLanOrWlan ) )
   512         {
   511         {
   513         ChooseIapComplete( KErrGprsServicesNotAllowed, NULL );
   512         ChooseIapComplete( KErrGprsServicesNotAllowed, NULL );
   514         }
   513         }
   515     else if ( !iapTypeLanOrWlan && iSession->IsPhoneOfflineL() )
   514     else if ( !iapTypeLanOrWlan && iSession->MyServer().IsPhoneOffline() )
   516         {
   515         {
   517         // In case offline mode is enabled, only LAN or WLAN is allowed.
   516         // In case offline mode is enabled, only LAN or WLAN is allowed.
   518         // If some other bearer has been requested, then error code 
   517         // If some other bearer has been requested, then error code 
   519         // KErrGprsOfflineMode should be returned instead of KErrNone.
   518         // KErrGprsOfflineMode should be returned instead of KErrNone.
   520         // 
   519         // 
   950         CompleteImplicitConnectionL();
   949         CompleteImplicitConnectionL();
   951         }
   950         }
   952     }
   951     }
   953 
   952 
   954 // -----------------------------------------------------------------------------
   953 // -----------------------------------------------------------------------------
   955 // CMPMIapSelection::OfflineNoteResponse
       
   956 // -----------------------------------------------------------------------------
       
   957 //
       
   958 TOfflineNoteResponse CMPMIapSelection::OfflineNoteResponse()
       
   959     {
       
   960 #ifndef _PLATFORM_SIMULATOR_
       
   961     MPMLOGSTRING2( "CMPMIapSelection::OfflineNoteResponse: %d",
       
   962                    iOfflineNoteResponse )
       
   963     return iOfflineNoteResponse;
       
   964 #else
       
   965     // Platsim simulates WLAN and offline-mode. To ease automated testing,
       
   966     // offline connection confirmation is not asked in Platsim-variant
       
   967     MPMLOGSTRING( "CMPMIapSelection::OfflineNoteResponse: yes for Platsim" )
       
   968     return EOfflineResponseYes;
       
   969 #endif
       
   970     }
       
   971 
       
   972 // -----------------------------------------------------------------------------
       
   973 // CMPMIapSelection::ConnectionStarted
       
   974 // -----------------------------------------------------------------------------
       
   975 //
       
   976 void CMPMIapSelection::ConnectionStarted()
       
   977     {
       
   978     MPMLOGSTRING( "CMPMIapSelection::ConnectionStarted: reset offline response" )
       
   979     SetOfflineNoteResponse( EOfflineResponseUndefined );
       
   980     }
       
   981     
       
   982 // -----------------------------------------------------------------------------
       
   983 // CMPMIapSelection::SetOfflineNoteShown
       
   984 // -----------------------------------------------------------------------------
       
   985 //
       
   986 void CMPMIapSelection::SetOfflineNoteResponse( TOfflineNoteResponse aResponse )
       
   987     {
       
   988     MPMLOGSTRING2( "CMPMIapSelection::SetOfflineNoteResponse %d ", aResponse )
       
   989     iOfflineNoteResponse = aResponse;
       
   990     }
       
   991 // -----------------------------------------------------------------------------
       
   992 // CMPMIapSelection::CompleteImplicitConnectionL
   954 // CMPMIapSelection::CompleteImplicitConnectionL
   993 // -----------------------------------------------------------------------------
   955 // -----------------------------------------------------------------------------
   994 //
   956 //
   995 
   957 
   996 void CMPMIapSelection::CompleteImplicitConnectionL()
   958 void CMPMIapSelection::CompleteImplicitConnectionL()
  1001                                    iUserSelectionIapId, 
   963                                    iUserSelectionIapId, 
  1002                                    retNetId, 
   964                                    retNetId, 
  1003                                    iapTypeLanOrWlan,
   965                                    iapTypeLanOrWlan,
  1004                                    *iSession );
   966                                    *iSession );
  1005                                    
   967                                    
  1006     if ( !iapTypeLanOrWlan && iSession->IsPhoneOfflineL() )
   968     if ( !iapTypeLanOrWlan && iSession->MyServer().IsPhoneOffline() )
  1007         {
   969         {
  1008         MPMLOGSTRING2( "CMPMIapSelection::CompleteImplicitConnectionL: Completing with code = %i",
   970         MPMLOGSTRING2( "CMPMIapSelection::CompleteImplicitConnectionL: Completing with code = %i",
  1009                 KErrGprsOfflineMode )
   971                 KErrGprsOfflineMode )
  1010         ChooseIapComplete( KErrGprsOfflineMode, NULL );
   972         ChooseIapComplete( KErrGprsOfflineMode, NULL );
  1011         }
   973         }