bearermanagement/mpm/src/mpmserversession.cpp
branchRCL_3
changeset 65 14754bf06654
parent 58 83ca720e2b9a
child 69 cf1b3ddbe9a1
equal deleted inserted replaced
62:bb1f80fb7db2 65:14754bf06654
   105 // CMPMServerSession::~CMPMServerSession
   105 // CMPMServerSession::~CMPMServerSession
   106 // -----------------------------------------------------------------------------
   106 // -----------------------------------------------------------------------------
   107 //
   107 //
   108 CMPMServerSession::~CMPMServerSession()
   108 CMPMServerSession::~CMPMServerSession()
   109     {
   109     {
       
   110     MPMLOGSTRING( "CMPMServerSession::~CMPMServerSession" )
   110 
   111 
   111 
   112 
   112     // Remove serverside objects for notification session.
   113     // Remove serverside objects for notification session.
   113     // 
   114     // 
   114     iMyServer.RemoveSession( this );
   115     iMyServer.RemoveSession( this );
  3354     TInt                aError,
  3355     TInt                aError,
  3355     const TMpmConnPref* aPolicyPref )
  3356     const TMpmConnPref* aPolicyPref )
  3356     {
  3357     {
  3357     MPMLOGSTRING2( "CMPMServerSession::ChooseIapComplete aError = %d", aError )
  3358     MPMLOGSTRING2( "CMPMServerSession::ChooseIapComplete aError = %d", aError )
  3358 
  3359 
  3359     // Show error popup if it's allowed per client request.
       
  3360 	// Error popup shown to SNAP only if error discreet has not been shown for IAP.
       
  3361     if ( ChooseBestIapCalled() && (!( iIapSelection->MpmConnPref().NoteBehaviour() &
       
  3362             TExtendedConnPref::ENoteBehaviourConnDisableNotes ))
       
  3363               && ( aError != KErrNone )
       
  3364               && ( iErrorDiscreetPopupShown == EFalse ) )
       
  3365         {
       
  3366         CConnectionUiUtilities* connUiUtils = NULL;
       
  3367         TRAPD( error, connUiUtils = CConnectionUiUtilities::NewL() );
       
  3368         if ( error == KErrNone && connUiUtils )
       
  3369             {
       
  3370             // Note: Below function shows the discreet popup only if the error code
       
  3371             // belongs to the set of errors that are shown to the user.
       
  3372             // Otherwise the popup is not shown.
       
  3373             connUiUtils->ConnectionErrorDiscreetPopup( aError );
       
  3374             delete connUiUtils;
       
  3375             connUiUtils = NULL;
       
  3376             }
       
  3377         }
       
  3378     
       
  3379     // Try to write back arguments and complete message.
  3360     // Try to write back arguments and complete message.
  3380     // 
  3361     // 
  3381     if ( !iChooseIapMessage.IsNull() )
  3362     if ( !iChooseIapMessage.IsNull() )
  3382         {
  3363         {
  3383         if ( aError == KErrNone && aPolicyPref )
  3364         if ( aError == KErrNone && aPolicyPref )
  3428                 }
  3409                 }
  3429             }
  3410             }
  3430         MPMLOGSTRING( "CMPMServerSession::ChooseIapComplete Message completed" )
  3411         MPMLOGSTRING( "CMPMServerSession::ChooseIapComplete Message completed" )
  3431         iChooseIapMessage.Complete( aError );
  3412         iChooseIapMessage.Complete( aError );
  3432         }
  3413         }
  3433     
  3414 
       
  3415     CConnectionUiUtilities* connUiUtils( NULL );
       
  3416     
       
  3417     MPMLOGSTRING2( "CMPMServerSession::ChooseIapComplete: this = %X", this )
       
  3418     MPMLOGSTRING2( "CMPMServerSession::ChooseIapComplete: iIapSelection = %X", iIapSelection )
       
  3419 
  3434     // Enable showing error discreet popup for SNAP again
  3420     // Enable showing error discreet popup for SNAP again
       
  3421     // Temp var used because session may get deleted during the showing of popup
       
  3422     TBool tempErrorDiscreetPopupShown = iErrorDiscreetPopupShown; 
  3435     iErrorDiscreetPopupShown = EFalse;
  3423     iErrorDiscreetPopupShown = EFalse;
       
  3424     
       
  3425     // NOTE: Be careful with discreet popups! It jams session at this point
       
  3426     // for a moment, BUT the session may be called meanwhile.
       
  3427     // This may/will lead to problems e.g. if session is being deleted => all (heap) objects
       
  3428     // deleted in destructor are gone!
       
  3429     // Show error popup if it's allowed per client request.
       
  3430 	// Error popup shown to SNAP only if error discreet has not been shown for IAP.
       
  3431     if ( ChooseBestIapCalled() && (!( iIapSelection->MpmConnPref().NoteBehaviour() &
       
  3432             TExtendedConnPref::ENoteBehaviourConnDisableNotes ))
       
  3433               && ( aError != KErrNone )
       
  3434               && ( tempErrorDiscreetPopupShown == EFalse ) )
       
  3435         {
       
  3436         TRAPD( popupError, connUiUtils = CConnectionUiUtilities::NewL() );
       
  3437         if ( popupError == KErrNone )
       
  3438             {
       
  3439             // Note: Below function shows the discreet popup only if the error code
       
  3440             // belongs to the set of errors that are shown to the user.
       
  3441             // Otherwise the popup is not shown.
       
  3442             connUiUtils->ConnectionErrorDiscreetPopup( aError );
       
  3443             delete connUiUtils;
       
  3444             connUiUtils = NULL;
       
  3445             }
       
  3446         }
       
  3447     else if ( aPolicyPref &&
       
  3448                     ( aError == KErrNone ) &&
       
  3449                     !( iIapSelection->MpmConnPref().NoteBehaviour() &
       
  3450                             TExtendedConnPref::ENoteBehaviourConnDisableNotes ) )
       
  3451         {
       
  3452         TConnectionState state = iMyServer.CheckUsageOfIap( aPolicyPref->IapId(), iConnId );
       
  3453 		TBool connectionAlreadyActive = (state == EStarted || state == EStarting || state == ERoaming);
       
  3454         if ( !connectionAlreadyActive &&
       
  3455                 ( IsMMSIap( aPolicyPref->IapId() ) == EFalse ) )
       
  3456             {
       
  3457             TRAPD( popupError, connUiUtils = CConnectionUiUtilities::NewL() );
       
  3458             if ( popupError == KErrNone )
       
  3459                 {
       
  3460                 connUiUtils->ConnectingViaDiscreetPopup( aPolicyPref->IapId() );
       
  3461                 delete connUiUtils;
       
  3462                 connUiUtils = NULL;
       
  3463                 }
       
  3464             }
       
  3465         }
  3436     }
  3466     }
  3437 
  3467 
  3438 
  3468 
  3439 // -----------------------------------------------------------------------------
  3469 // -----------------------------------------------------------------------------
  3440 // CMPMServerSession::ProcessErrorComplete
  3470 // CMPMServerSession::ProcessErrorComplete