24 #include "mpmconnmonevents.h" |
24 #include "mpmconnmonevents.h" |
25 #include "mpmconnmonreqs.h" |
25 #include "mpmconnmonreqs.h" |
26 #include "mpmserver.h" |
26 #include "mpmserver.h" |
27 #include "mpmserversession.h" |
27 #include "mpmserversession.h" |
28 #include "mpmlogger.h" |
28 #include "mpmlogger.h" |
29 #include "mpmwlanavailability.h" |
|
30 |
29 |
31 // ============================= LOCAL FUNCTIONS =============================== |
30 // ============================= LOCAL FUNCTIONS =============================== |
32 |
31 |
33 // ============================ MEMBER FUNCTIONS =============================== |
32 // ============================ MEMBER FUNCTIONS =============================== |
34 |
33 |
66 { |
65 { |
67 iConnMon.CancelNotifications(); |
66 iConnMon.CancelNotifications(); |
68 iConnMon.Close(); |
67 iConnMon.Close(); |
69 iReqPtrs.ResetAndDestroy(); |
68 iReqPtrs.ResetAndDestroy(); |
70 iConnInfoArray.Close(); |
69 iConnInfoArray.Close(); |
71 delete iWlanAvailability; |
|
72 iWlanAvailability = NULL; |
|
73 } |
70 } |
74 |
71 |
75 |
72 |
76 // ----------------------------------------------------------------------------- |
73 // ----------------------------------------------------------------------------- |
77 // CMPMConnMonEvents::ConstructL |
74 // CMPMConnMonEvents::ConstructL |
462 |
459 |
463 // ----------------------------------------------------------------------------- |
460 // ----------------------------------------------------------------------------- |
464 // CMPMConnMonEvents::IapAvailabilityChange |
461 // CMPMConnMonEvents::IapAvailabilityChange |
465 // ----------------------------------------------------------------------------- |
462 // ----------------------------------------------------------------------------- |
466 // |
463 // |
467 void CMPMConnMonEvents::IapAvailabilityChange() |
464 void CMPMConnMonEvents::IapAvailabilityChange( const TPrefIAPNotifCaller aCaller ) |
468 { |
465 { |
469 if ( ( iAvailableIAPs.Count() > 0 ) && |
466 if ( ( iAvailableIAPs.Count() > 0 ) && |
470 !DiscardAvailabilityNotification() ) |
467 !DiscardAvailabilityNotification() ) |
471 { |
468 { |
472 // Remove temporary blacklistings as fresh availability |
469 // Remove temporary blacklistings as fresh availability |
476 |
473 |
477 // Send preferred IAP notifications, but DO NOT LEAVE |
474 // Send preferred IAP notifications, but DO NOT LEAVE |
478 // or Connection Monitor CConnMonEventHandler::RunL() |
475 // or Connection Monitor CConnMonEventHandler::RunL() |
479 // will also leave, which will make mpmserver.exe CRASH. |
476 // will also leave, which will make mpmserver.exe CRASH. |
480 // |
477 // |
481 TRAP_IGNORE( iMyServer.NotifyBMPrefIapL( iAvailableIAPs ) ) |
478 TRAP_IGNORE( iMyServer.NotifyBMPrefIapL( iAvailableIAPs, aCaller ) ) |
482 } |
479 } |
483 else |
480 else |
484 { |
481 { |
485 MPMLOGSTRING2( "CMPMConnMonEvents::EventL - IAPs count: %d", |
482 MPMLOGSTRING2( "CMPMConnMonEvents::EventL - IAPs count: %d", |
486 iAvailableIAPs.Count() ) |
483 iAvailableIAPs.Count() ) |
535 eventIap = static_cast<const CConnMonIapAvailabilityChange*>( |
532 eventIap = static_cast<const CConnMonIapAvailabilityChange*>( |
536 &aConnMonEvent ); |
533 &aConnMonEvent ); |
537 |
534 |
538 iAvailableIAPs = eventIap->IapAvailability(); |
535 iAvailableIAPs = eventIap->IapAvailability(); |
539 UpdateIAPRefreshTime(); |
536 UpdateIAPRefreshTime(); |
540 IapAvailabilityChange(); |
537 IapAvailabilityChange( EConnMonEvent ); |
541 |
538 |
542 TRAPD( err, iMyServer.UpdateSessionConnectionDlgL() ) |
539 TRAPD( err, iMyServer.UpdateSessionConnectionDlgL() ) |
543 if( err != KErrNone ) |
540 if( err != KErrNone ) |
544 { |
541 { |
545 MPMLOGSTRING2( "CMPMConnMonEvents::EventL UpdateSessionConnectionDlgL \ |
542 MPMLOGSTRING2( "CMPMConnMonEvents::EventL UpdateSessionConnectionDlgL \ |
695 iSSID(), |
692 iSSID(), |
696 iConnType( EConnectionGeneric ) |
693 iConnType( EConnectionGeneric ) |
697 { |
694 { |
698 } |
695 } |
699 |
696 |
700 // ----------------------------------------------------------------------------- |
|
701 // CMPMConnMonEvents::CheckWlanAvailabilityL |
|
702 // ----------------------------------------------------------------------------- |
|
703 // |
|
704 void CMPMConnMonEvents::CheckWlanAvailabilityL( MWlanAvailability* aObserver ) |
|
705 { |
|
706 MPMLOGSTRING( "CMPMConnMonEvents::CheckWlanAvailabilityL" ) |
|
707 // Sanity check null pointer |
|
708 ASSERT( aObserver != NULL ); |
|
709 |
|
710 // Request for WLAN bearer availability info |
|
711 // |
|
712 if ( !iWlanAvailability ) |
|
713 { |
|
714 iWlanAvailability = CWlanAvailability::NewL( this, iConnMon ); |
|
715 } |
|
716 |
|
717 iWlanAvailability->Start( aObserver ); |
|
718 } |
|
719 |
|
720 // ----------------------------------------------------------------------------- |
|
721 // CMPMConnMonEvents::CancelCheckWlanWlanAvailability |
|
722 // ----------------------------------------------------------------------------- |
|
723 // |
|
724 void CMPMConnMonEvents::CancelCheckWlanWlanAvailability( MWlanAvailability* aObserver ) |
|
725 { |
|
726 MPMLOGSTRING( "CMPMConnMonEvents::CancelCheckWlanWlanAvailability" ) |
|
727 // Sanity check null pointer |
|
728 ASSERT( aObserver != NULL ); |
|
729 |
|
730 // Cancel WLAN bearer availability check for this observer |
|
731 // |
|
732 if ( iWlanAvailability ) |
|
733 { |
|
734 iWlanAvailability->CancelObserver( aObserver ); |
|
735 } |
|
736 } |
|
737 |
|
738 // ----------------------------------------------------------------------------- |
|
739 // CMPMConnMonEvents::SetWlanAvailabilityPtrNull |
|
740 // ----------------------------------------------------------------------------- |
|
741 // |
|
742 void CMPMConnMonEvents::SetWlanAvailabilityPtrNull() |
|
743 { |
|
744 iWlanAvailability = NULL; |
|
745 } |
|
746 |
|
747 // End of File |
697 // End of File |
748 |
698 |