bearermanagement/mpm/src/mpmiapselection.cpp
branchRCL_3
changeset 12 ea6e024ea6f9
parent 8 2e6c4614c58e
child 13 68f0c7cd80ec
equal deleted inserted replaced
8:2e6c4614c58e 12:ea6e024ea6f9
    81 CMPMIapSelection::~CMPMIapSelection()
    81 CMPMIapSelection::~CMPMIapSelection()
    82     {
    82     {
    83     // stop confirm dialog in case one exists
    83     // stop confirm dialog in case one exists
    84     //
    84     //
    85     StopDisplayingStartingDlg();
    85     StopDisplayingStartingDlg();
    86     
       
    87     // Cancel WLAN availability check in case it is active
       
    88     //
       
    89     if ( iSession )
       
    90         {
       
    91     	  iSession->MyServer().Events()->CancelCheckWlanWlanAvailability( this );	
       
    92         }	
       
    93     
    86     
    94     delete iConfirmDlgStarting;
    87     delete iConfirmDlgStarting;
    95     delete iDialog;
    88     delete iDialog;
    96     delete iWlanDialog;
    89     delete iWlanDialog;
    97     }
    90     }
   417    
   410    
   418         //Check if WLAN bearerset is in use
   411         //Check if WLAN bearerset is in use
   419         if ( ( iChooseIapPref.BearerSet() & TExtendedConnPref::EExtendedConnBearerWLAN ) ||
   412         if ( ( iChooseIapPref.BearerSet() & TExtendedConnPref::EExtendedConnBearerWLAN ) ||
   420              ( iChooseIapPref.BearerSet() == TExtendedConnPref::EExtendedConnBearerUnknown ) )
   413              ( iChooseIapPref.BearerSet() == TExtendedConnPref::EExtendedConnBearerUnknown ) )
   421             {
   414             {
   422             if ( iNewWlansAllowed && 
   415             if( iCommsDatAccess->SnapContainsWlanL( snap, iapPath, KMPMNrWlansOne ) )
   423             	   ( iChooseIapPref.BearerSet() == 
       
   424             	     TExtendedConnPref::EExtendedConnBearerWLAN ) )
       
   425                 {
       
   426                 // User allows only WLAN connections, check WLAN availability.
       
   427                 // A note will be shown if no WLANs are available.
       
   428                 //
       
   429                 iSession->MyServer().Events()->CheckWlanAvailabilityL( this );
       
   430                 }
       
   431             else if( iCommsDatAccess->SnapContainsWlanL( snap, iapPath, KMPMNrWlansOne ) )
       
   432                 {
   416                 {
   433                 // Scan wlan networks. After that execution continues 
   417                 // Scan wlan networks. After that execution continues 
   434                 // in CompleteExplicitSnapConnectionL()
   418                 // in CompleteExplicitSnapConnectionL()
   435                 //
   419                 //
   436                 iChooseIapState = EExplicitConnection; 
   420                 iChooseIapState = EExplicitConnection; 
   852         // User selected SNAP
   836         // User selected SNAP
   853         // 
   837         // 
   854         TMpmConnPref userPref;
   838         TMpmConnPref userPref;
   855         iUserSelectionSnapId = iCommsDatAccess->MapNetIdtoSnapAPL( aId );
   839         iUserSelectionSnapId = iCommsDatAccess->MapNetIdtoSnapAPL( aId );
   856         userPref.SetSnapId( iUserSelectionSnapId );
   840         userPref.SetSnapId( iUserSelectionSnapId );
   857 
   841         userPref.SetIapId( 0 );
   858         
   842 
   859 // Agreed that MPM will be migrated to SNAP TAG ID SNAPS.
       
   860 //        if ( iUserSelectionSnapId < 0x1000 )  // TODO: remove when connection dialog return valid SNAP TAG ID.
       
   861 //            {
       
   862 //            // legacy snaps ok
       
   863 //            userPref.SetNetId( aId );
       
   864 //            iUserSelectionSnapId = aId;
       
   865 //            }
       
   866 //        else
       
   867 //            {
       
   868 //            // 5.2 snaps, MPM uses internally legacy snaps. Convert back. -jl- TODO: use CommsDat mapping in future.
       
   869 //            userPref.SetNetId( aId - 3000 );
       
   870 //            iUserSelectionSnapId = aId - 3000;
       
   871 //            }
       
   872         
       
   873         MPMLOGSTRING2(
   843         MPMLOGSTRING2(
   874                 "CMPMIapSelection::HandleUserSelectionL: Snap = %i selected by the User", 
   844                 "CMPMIapSelection::HandleUserSelectionL: Snap = %i selected by the User", 
   875                 iUserSelectionSnapId )
   845                 iUserSelectionSnapId )
   876 
   846 
   877 //        userPref.SetNetId( aId );
       
   878         userPref.SetIapId( 0 );
       
   879 
   847 
   880         ChooseBestIAPL( userPref, iStoredAvailableIaps );
   848         ChooseBestIAPL( userPref, iStoredAvailableIaps );
   881         iUserSelectionIapId = userPref.IapId();
   849         iUserSelectionIapId = userPref.IapId();
   882 
   850 
   883         }
   851         }
  1320     {
  1288     {
  1321     return iSession;
  1289     return iSession;
  1322     }
  1290     }
  1323 
  1291 
  1324 // -----------------------------------------------------------------------------
  1292 // -----------------------------------------------------------------------------
  1325 // CMPMIapSelection::TriggerInformationNote
       
  1326 // -----------------------------------------------------------------------------
       
  1327 //
       
  1328 void CMPMIapSelection::TriggerInformationNoteL()
       
  1329     {
       
  1330     // ConnectioUiUtilities client side has a nonblocking active object 
       
  1331     // implementation
       
  1332     //
       
  1333     if ( !( iChooseIapPref.NoteBehaviour() &
       
  1334            TExtendedConnPref::ENoteBehaviourConnDisableNotes ) )
       
  1335         {           	
       
  1336         CConnectionUiUtilities* connUiUtils = CConnectionUiUtilities::NewL();        
       
  1337                             
       
  1338         connUiUtils->NoWLANNetworksAvailableNote();
       
  1339                             
       
  1340         delete connUiUtils;
       
  1341         }            
       
  1342     }
       
  1343 
       
  1344 // -----------------------------------------------------------------------------
       
  1345 // CMPMIapSelection::WlanAvailabilityResponse
       
  1346 // -----------------------------------------------------------------------------
       
  1347 //
       
  1348 void CMPMIapSelection::WlanAvailabilityResponse( const TInt  aError, 
       
  1349                                                  const TBool aResult )
       
  1350     {
       
  1351     if ( ( aError == KErrNone && aResult == EFalse )
       
  1352           || ( aError == KErrNotSupported ) )
       
  1353         {
       
  1354         // no WLANs are available and user allows only
       
  1355         // WLAN connections
       
  1356         TRAPD( err, TriggerInformationNoteL() );
       
  1357         
       
  1358         if ( err )
       
  1359             {
       
  1360             MPMLOGSTRING2( "TriggerInformationNoteL leaved %d", err )
       
  1361             }
       
  1362             
       
  1363         ChooseIapComplete( KErrNotFound, NULL );
       
  1364         }
       
  1365     else
       
  1366         {
       
  1367         // Some WLANs are available,
       
  1368         // or an error has occured while requesting available WLANs.
       
  1369         //
       
  1370         TRAPD( err, CompleteExplicitSnapConnectionL() );
       
  1371         
       
  1372         if ( err )
       
  1373             {
       
  1374             MPMLOGSTRING2( "CompleteExplicitSnapConnectionL leaved %d", err )
       
  1375             ChooseIapComplete( KErrCancel, NULL );
       
  1376             }
       
  1377         }
       
  1378     }
       
  1379 
       
  1380 // -----------------------------------------------------------------------------
       
  1381 // CMPMIapSelection::MpmConnPref
  1293 // CMPMIapSelection::MpmConnPref
  1382 // -----------------------------------------------------------------------------
  1294 // -----------------------------------------------------------------------------
  1383 //
  1295 //
  1384 TMpmConnPref CMPMIapSelection::MpmConnPref()
  1296 TMpmConnPref CMPMIapSelection::MpmConnPref()
  1385     {
  1297     {