Revision: 201039 RCL_3 PDK_3.0.4
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 13 Oct 2010 14:59:48 +0300
branchRCL_3
changeset 69 cf1b3ddbe9a1
parent 65 14754bf06654
child 75 dd7f31e692c1
Revision: 201039 Kit: 201041
bearermanagement/S60MCPR/inc/s60mcpr.h
bearermanagement/S60MCPR/inc/s60mcpractivities.h
bearermanagement/S60MCPR/inc/s60mcpractivityids.h
bearermanagement/S60MCPR/inc/s60mcprstates.h
bearermanagement/S60MCPR/src/s60mcpr.cpp
bearermanagement/S60MCPR/src/s60mcpractivities.cpp
bearermanagement/S60MCPR/src/s60mcprerrorrecoveryactivity.cpp
bearermanagement/S60MCPR/src/s60mcprmobilityactivity.cpp
bearermanagement/S60MCPR/src/s60mcprstates.cpp
bearermanagement/mpm/group/mpmserver.mmp
bearermanagement/mpm/inc/mpmcommsdataccess.h
bearermanagement/mpm/inc/mpmconnselectiondlgtimer.h
bearermanagement/mpm/inc/mpmofflinequerytimer.h
bearermanagement/mpm/inc/mpmserver.h
bearermanagement/mpm/inc/mpmserversession.h
bearermanagement/mpm/src/mpmcommsdataccess.cpp
bearermanagement/mpm/src/mpmconnselectiondlgtimer.cpp
bearermanagement/mpm/src/mpmdatausagewatcher.cpp
bearermanagement/mpm/src/mpmiapselection.cpp
bearermanagement/mpm/src/mpmofflinequerytimer.cpp
bearermanagement/mpm/src/mpmserver.cpp
bearermanagement/mpm/src/mpmserversession.cpp
bearermanagement/mpm/src/mpmwlanquerydialog.cpp
cmmanager/cmmgr/Framework/BWinsCw/CmManager_prot_setupU.DEF
cmmanager/cmmgr/Framework/EABI/CmManager_prot_setupU.def
cmmanager/cmmgr/Framework/Inc/cmsettingsuiimpl.h
cmmanager/cmmgr/Framework/Src/cmmanagerimpl.cpp
cmmanager/cmmgr/Framework/Src/cmsettingsui.cpp
cmmanager/cmmgr/Framework/Src/cmsettingsuiimpl.cpp
cmmanager/cmmgr/Plugins/Group/bld.inf
cmmanager/cmmgr/Plugins/cmplugintundriver/data/20027F3E.rss
cmmanager/cmmgr/Plugins/cmplugintundriver/group/bld.inf
cmmanager/cmmgr/Plugins/cmplugintundriver/group/cmplugintundriver.mmp
cmmanager/cmmgr/Plugins/cmplugintundriver/group/cmplugintundriver_icons.mk
cmmanager/cmmgr/Plugins/cmplugintundriver/inc/cmplugintundriver.h
cmmanager/cmmgr/Plugins/cmplugintundriver/inc/cmtundrivercommonconstants.h
cmmanager/cmmgr/Plugins/cmplugintundriver/src/cmpluginproxytundriver.cpp
cmmanager/cmmgr/Plugins/cmplugintundriver/src/cmplugintundriver.cpp
cmmanager/cmmgr/Rom/cmplugintundriver.iby
cmmanager/cmmgr/Rom/cmplugintundriverresources.iby
cmmanager/cmmgr/group/bld.inf
connectionmonitoring/connectionmonitorui/inc/ConnectionInfoBase.h
connectionmonitoring/connectionmonitorui/src/ConnectionInfoBase.cpp
connectionmonitoring/connectionmonitorui/src/CsdConnectionInfo.cpp
connectionmonitoring/connectionmonitorui/src/EasyWLANConnectionInfo.cpp
connectionmonitoring/connectionmonitorui/src/GprsConnectionInfo.cpp
connectionmonitoring/connectionmonitorui/src/WlanConnectionInfo.cpp
data/cccccc00_emulator.cre
inc/meshpreface1.cfg
ipcm_plat/extended_connection_settings_api/inc/cmsettingsui.h
ipcm_pub/connection_settings_api/group/bld.inf
ipcm_pub/connection_settings_api/inc/cmplugintundriverdef.h
--- a/bearermanagement/S60MCPR/inc/s60mcpr.h	Wed Sep 15 12:38:40 2010 +0300
+++ b/bearermanagement/S60MCPR/inc/s60mcpr.h	Wed Oct 13 14:59:48 2010 +0300
@@ -174,6 +174,24 @@
      * Clears handshaking flag. 
      */
     void ClearHandshakingFlag();
+
+    /**
+     * Checking whether the node is in the middle of a gone down error
+     * recovery.
+     * 
+     * @return ETrue if recovering a GoneDown error
+     */
+    TBool IsGoneDownRecoveryOngoing() const;
+    
+    /**
+     * Sets gone down recovery flag. 
+     */
+    void SetGoneDownRecoveryOngoing();
+    
+    /**
+     * Clears gone down recovery flag. 
+     */
+    void ClearGoneDownRecoveryOngoing();    
     
     /**
      * Re-send last received policy notification if it exists.
@@ -262,6 +280,19 @@
     TBool                   iIsHandshakingNow : 1; 
     
     /**
+     * Status flag indicating that we are currently recovering from GoneDown.
+     * This is set while MPM is making recovery decision, and in case of
+     * mobility connections also for the period while the connection roams 
+     * to a new interface. This is used (at least) for erroring NoBearer
+     * requests coming from the data clients.
+     * 
+     * Even though the bit fields are generally quite useless optimization in
+     * this kind of cases, used also in here since there are a couple of
+     * those above...
+     */
+    TBool                   iGoneDownRecoveryOngoing : 1;
+    
+    /**
      * Connection preference list
      */
     ESock::RConnPrefList    iConnPrefList;
--- a/bearermanagement/S60MCPR/inc/s60mcpractivities.h	Wed Sep 15 12:38:40 2010 +0300
+++ b/bearermanagement/S60MCPR/inc/s60mcpractivities.h	Wed Oct 13 14:59:48 2010 +0300
@@ -30,12 +30,6 @@
 // Forward declarations
 class CS60MetaConnectionProvider;
 
-enum TS60MCprActivities
-    {
-    ECFActivityS60McprServiceIdMessage2Handler = ESock::ECFActivityCustom + 10,
-    ECFActivityS60McprStopIAP
-    };
-
 /**
  * S60MCprActivities namespace contains the 
  * definition of S60MCPR's activity map. 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bearermanagement/S60MCPR/inc/s60mcpractivityids.h	Wed Oct 13 14:59:48 2010 +0300
@@ -0,0 +1,34 @@
+/*
+* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: S60 MCPR's activities.
+*
+*/
+
+/**
+@file s60mcpractivityids.h
+S60 MCPR's activity id's.
+*/
+
+#ifndef S60MCPRACTIVITYIDS_H
+#define S60MCPRACTIVITYIDS_H
+
+enum TS60MCprActivities
+    {
+    ECFActivityS60McprServiceIdMessage2Handler = ESock::ECFActivityCustom + 10,
+    ECFActivityS60McprStopIAP,
+    ECFActivityS60McprDataClientIdle,
+    ECFActivityS60DataClientStatusChangeConsumeActivity
+    };
+
+#endif //S60MCPRACTIVITYIDS_H
--- a/bearermanagement/S60MCPR/inc/s60mcprstates.h	Wed Sep 15 12:38:40 2010 +0300
+++ b/bearermanagement/S60MCPR/inc/s60mcprstates.h	Wed Oct 13 14:59:48 2010 +0300
@@ -30,6 +30,7 @@
 
 #include "s60mcpr.h"
 #include "s60mpmrequests.h"
+#include "s60mcpractivityids.h"
 
 /**
  * S60McprState namespace packages all S60 specific state, forks and 
@@ -58,6 +59,7 @@
     const TInt KConsumeRejectedMsg = 11054;
     const TInt KInformMigrationCompleted = 11055;
     const TInt KRequestReConnectToCurrentSP = 11056;
+    const TInt KStopActivityNotRunning = 11057;
     
     /**
      * Execution context
@@ -117,6 +119,17 @@
                               TContext )
     virtual void DoL();
     DECLARE_SMELEMENT_FOOTER( TProcessError )
+
+    /**
+     * TRANSITION/ACTION: Error no bearer request while in gone down recovery.
+     */
+    DECLARE_SMELEMENT_HEADER( THandleNoBearerDuringGoneDownRecovery, 
+                              MeshMachine::TStateTransition<TContext>, 
+                              NetStateMachine::MStateTransition, 
+                              TContext )
+    virtual void DoL();
+    DECLARE_SMELEMENT_FOOTER( THandleNoBearerDuringGoneDownRecovery )
+
     
     /**
      * STATE: Waits for valid select or error message.
@@ -163,6 +176,18 @@
     DECLARE_SMELEMENT_FOOTER( TAwaitingServiceIdRequest )
 
     /**
+     * STATE: Waits for NoBearer request while in gone down recovery. 
+     * @return ETrue if message is accepted. 
+     */
+    DECLARE_SMELEMENT_HEADER( TAwaitingNoBearerInGoneDownRecovery, 
+                              MeshMachine::TState<TContext>, 
+                              NetStateMachine::MState, 
+                              TContext )
+    virtual TBool Accept();
+    DECLARE_SMELEMENT_FOOTER( TAwaitingNoBearerInGoneDownRecovery )
+    
+
+    /**
      * TRANSITION/ACTION: Retrieve ServiceId.
      */
     DECLARE_SMELEMENT_HEADER( TRetrieveServiceId, 
@@ -204,6 +229,35 @@
                               TContext )
     virtual TBool Accept();
     DECLARE_SMELEMENT_FOOTER( TAwaitingStoppedOrError )
+    
+    
+    /**
+     * STATE: Waits for TIdle
+     */
+    DECLARE_SMELEMENT_HEADER( TAwaitingDataClientIdle,
+                              MeshMachine::TState<TContext>, 
+                              NetStateMachine::MState, 
+                              TContext )
+    virtual TBool Accept();
+    DECLARE_SMELEMENT_FOOTER( TAwaitingDataClientIdle )
+
+    /**
+     * STATE: Waits for TDataClientStatusChange
+     */
+    DECLARE_SMELEMENT_HEADER( TAwaitingDataClientStatusChange,
+                              MeshMachine::TState<TContext>, 
+                              NetStateMachine::MState, 
+                              TContext )
+    virtual TBool Accept();
+    DECLARE_SMELEMENT_FOOTER( TAwaitingDataClientStatusChange )
+    
+    
+    /** 
+     * FORK/MUTEX: Waits for StopIAPActivity to complete
+     */
+    DECLARE_SERIALIZABLE_STATE( TStopActivityNotRunning,
+                                MeshMachine::TActivityIdMutex<ECFActivityS60McprStopIAP>,
+                                MeshMachine::TTag<S60MCprStates::KStopActivityNotRunning> )
         
     class CS60ErrorRecoveryActivity : public MeshMachine::CNodeRetryActivity
         {
--- a/bearermanagement/S60MCPR/src/s60mcpr.cpp	Wed Sep 15 12:38:40 2010 +0300
+++ b/bearermanagement/S60MCPR/src/s60mcpr.cpp	Wed Oct 13 14:59:48 2010 +0300
@@ -68,7 +68,8 @@
                                                         const TProviderInfo& aProviderInfo, 
                                                         const MeshMachine::TNodeActivityMap& aActivityMap )
     :   CMobilityMetaConnectionProvider( aFactory, aProviderInfo, aActivityMap ),
-        iDataClientStatusStarted( EFalse )
+        iDataClientStatusStarted( EFalse ),
+        iGoneDownRecoveryOngoing( EFalse )
     {
     LOG_NODE_CREATE(KS60MCprTag, CS60MetaConnectionProvider);
     }
@@ -283,6 +284,34 @@
     iIsHandshakingNow = EFalse;
     }
 
+// -----------------------------------------------------------------------------
+// CS60MetaConnectionProvider::IsGoneDownRecoveryOngoing
+// -----------------------------------------------------------------------------
+//
+TBool CS60MetaConnectionProvider::IsGoneDownRecoveryOngoing() const
+    {
+    return iGoneDownRecoveryOngoing;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CS60MetaConnectionProvider::SetGoneDownRecoveryOngoing
+// -----------------------------------------------------------------------------
+//
+void CS60MetaConnectionProvider::SetGoneDownRecoveryOngoing()
+    {
+    iGoneDownRecoveryOngoing = ETrue;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CS60MetaConnectionProvider::ClearGoneDownRecoveryOngoing
+// -----------------------------------------------------------------------------
+//
+void CS60MetaConnectionProvider::ClearGoneDownRecoveryOngoing()
+    {
+    iGoneDownRecoveryOngoing = EFalse;
+    }
 
 // -----------------------------------------------------------------------------
 // CS60MetaConnectionProvider::PolicyNotification
--- a/bearermanagement/S60MCPR/src/s60mcpractivities.cpp	Wed Sep 15 12:38:40 2010 +0300
+++ b/bearermanagement/S60MCPR/src/s60mcpractivities.cpp	Wed Oct 13 14:59:48 2010 +0300
@@ -21,6 +21,7 @@
 */
 
 #include "s60mcpractivities.h"
+#include "s60mcpractivityids.h"
 
 using namespace Messages;
 using namespace MeshMachine;
@@ -183,6 +184,7 @@
     DECLARE_DEFINE_NODEACTIVITY( ECFActivityMonitorProviderStatus, 
                                  MCprDataClientStatusChange, 
                                  TCFControlProvider::TDataClientStatusChange )
+ 
     SINGLE_NODEACTIVITY_ENTRY( S60MCprStates::THandleMPMAndCoreDataClientStatusChangeAndDestroyOrphans, 
                                CoreNetStates::TAwaitingDataClientStatusChange )
     NODEACTIVITY_END()
@@ -431,12 +433,67 @@
     } // S60MCprStopIAPActivity
 
 // -----------------------------------------------------------------------------
+// S60McprNoBearerDuringGoneDownErrorRecovery
+// -----------------------------------------------------------------------------
+//
+namespace S60McprNoBearerDuringGoneDownErrorRecovery
+    {
+    DECLARE_DEFINE_NODEACTIVITY( ECFActivityNoBearer, 
+                                 S60MCprNoBearerDuringGoneDown, 
+                                 TCFControlProvider::TNoBearer )
+    SINGLE_NODEACTIVITY_ENTRY( S60MCprStates::THandleNoBearerDuringGoneDownRecovery, 
+                               S60MCprStates::TAwaitingNoBearerInGoneDownRecovery )
+    NODEACTIVITY_END()
+    }
+	
+// -----------------------------------------------------------------------------
+// S60MCprDataClientIdleActivity
+// -----------------------------------------------------------------------------
+//
+
+namespace S60MCprDataClientIdleActivity
+    {
+    DECLARE_DEFINE_CUSTOM_NODEACTIVITY( ECFActivityS60McprDataClientIdle,
+                                 MCprDataClientIdleActivity,
+                                 TCFControlProvider::TIdle,
+                                 MeshMachine::CNodeRetryActivity::NewL)
+                                 
+    FIRST_NODEACTIVITY_ENTRY( CoreNetStates::TAwaitingDataClientIdle,
+                              S60MCprStates::TStopActivityNotRunning )  
+    
+    LAST_NODEACTIVITY_ENTRY( S60MCprStates::KStopActivityNotRunning,
+                             CoreNetStates::THandleDataClientIdle )
+                             
+    NODEACTIVITY_END()
+    } // S60MCprDataClientIdleActivity
+                             
+// -----------------------------------------------------------------------------
+// S60MCprDataClientStatusChangeConsumeActivity
+// -----------------------------------------------------------------------------
+//
+
+namespace S60MCprDataClientStatusChangeConsumeActivity
+    {
+    DECLARE_DEFINE_NODEACTIVITY( ECFActivityS60DataClientStatusChangeConsumeActivity,
+                                        MCprDataClientStatusChangeConsumeActivity,
+                                        TCFControlProvider::TDataClientStatusChange)
+                                 
+    SINGLE_NODEACTIVITY_ENTRY( MeshMachine::TDoNothing,
+                               S60MCprStates::TAwaitingDataClientStatusChange ) 
+          
+    NODEACTIVITY_END()
+    } // S60MCprDataClientStatusChangeConsumeActivity
+                             
+
+
+// -----------------------------------------------------------------------------
 // S60MCprActivities - activitymap
 // -----------------------------------------------------------------------------
 //
 namespace S60MCprActivities
     {
     DEFINE_ACTIVITY_MAP(S60MCprActivityMap)
+    ACTIVITY_MAP_ENTRY(S60MCprDataClientStatusChangeConsumeActivity, MCprDataClientStatusChangeConsumeActivity)            
     ACTIVITY_MAP_ENTRY(S60MCprMonitorDataClientStatusActivity, MCprDataClientStatusChange)
 	ACTIVITY_MAP_ENTRY(S60MCprSelectActivity, S60MCprSelect) // in s60mcprsimpleselectactivity.cpp
     ACTIVITY_MAP_ENTRY(S60MCprSimpleSelectActivity, MCprSimpleSelect) // in s60mcprsimpleselectactivity.cpp
@@ -444,7 +501,9 @@
     ACTIVITY_MAP_ENTRY(S60MCprMobilityActivity, MCprMobility) // in s60mcprmobilityactivity.cpp
     ACTIVITY_MAP_ENTRY(S60MCprConnectionGoneDownRecoveryActivity, MCprConnectionGoneDownRecovery)
     ACTIVITY_MAP_ENTRY(S60MCprServiceIdRMessage2HandlerActivity, S60MCprServiceIdLegacyRMessage2Handler)
+    ACTIVITY_MAP_ENTRY(S60McprNoBearerDuringGoneDownErrorRecovery, S60MCprNoBearerDuringGoneDown)
     ACTIVITY_MAP_ENTRY(S60MCprStopIAPActivity, MCprStopIAPActivity)
+    ACTIVITY_MAP_ENTRY(S60MCprDataClientIdleActivity, MCprDataClientIdleActivity)
     ACTIVITY_MAP_END_BASE(MobilityMCprActivities, mobilityMCprActivities)
     }
 
--- a/bearermanagement/S60MCPR/src/s60mcprerrorrecoveryactivity.cpp	Wed Sep 15 12:38:40 2010 +0300
+++ b/bearermanagement/S60MCPR/src/s60mcprerrorrecoveryactivity.cpp	Wed Oct 13 14:59:48 2010 +0300
@@ -113,6 +113,31 @@
             iContext.iNodeActivity->SetError( KErrGeneral );
             }
 
+#ifdef _DEBUG
+        // Purely for debugging purposes
+        CS60MetaConnectionProvider& node = (CS60MetaConnectionProvider&)iContext.Node();
+        if ( node.IsGoneDownRecoveryOngoing() )
+            {
+            // This transition is done in both connection start recovery and in
+            // gone down recovery. If we are running gone down recovery, there
+            // are two possible options what can happen next:
+            // 1) If we are running mobility activity, the error can be ignored
+            //    if there is another carrier available. In this case MPM will
+            //    send a preffered carrier available soon after.
+            // 2) In all other cases, the only way forward is error propagation
+            //    (see gone down activity for further info). In this case, the
+            //    gone down error is sent to clients and connection will be 
+            //    teared down.
+            //
+            // In both cases, the GoneDownRecoveryOngoing flag is not cleared.
+            // For case 1) above, it will be cleared after the connection has
+            // roamed, and for option 2) it is pretty much irrelevant (we can
+            // probably avoid a couple of race conditions by leaving the flag
+            // active for the time being.
+            S60MCPRLOGSTRING1("S60MCPR<%x>::TNoTagOrIgnoreErrorOrErrorTag::TransitionTag() MPM response while GoneDown recovery active",(TInt*)&iContext.Node());
+            }
+#endif
+        
         // Error transition
         //
         if ( !msg )
--- a/bearermanagement/S60MCPR/src/s60mcprmobilityactivity.cpp	Wed Sep 15 12:38:40 2010 +0300
+++ b/bearermanagement/S60MCPR/src/s60mcprmobilityactivity.cpp	Wed Oct 13 14:59:48 2010 +0300
@@ -357,6 +357,30 @@
         activity.PostToOriginators(msg);
         activity.ClearPostedTo();
         activity.SetHandshakingFlag();
+        
+        
+#ifdef _DEBUG
+        // Purely for debugging purposes
+        CS60MetaConnectionProvider& node = (CS60MetaConnectionProvider&)iContext.Node();
+        if ( node.IsGoneDownRecoveryOngoing() )
+            {
+            S60MCPRLOGSTRING1("S60MCPR<%x>::TInformMigrationAvailableAndSetHandshakingFlag::DoL() Start mobility handshake while gone down recovery is active",(TInt*)&iContext.Node())
+            // During the handshake, there is four different paths that 
+            // needs to be considered for reseting the gone down recovery
+            // flag. These are:
+            // 1) Migration is done successfully
+            // 2) Application rejects the migration
+            // 3) While migrating, a new preferred carrier is found       
+            // 4) Operation is cancelled or an error occurs
+            //
+            // For 1) and 2) the flag needs to be reset, where as for 3) we
+            // can keep the flag set until the "loop" is exited with a valid
+            // reselection (essentially this will be same as 1) but only
+            // after a couple of retrials). For the last option 4) the
+            // connection is tear down and reseting the flag is not needed.
+            }
+#endif
+        
         }
 
     
@@ -373,6 +397,15 @@
         CS60MetaConnectionProvider& node = (CS60MetaConnectionProvider&)iContext.Node();
         CS60MobilityActivity& activity = static_cast<CS60MobilityActivity&>(*iContext.iNodeActivity);
         node.Policy()->ApplicationIgnoredTheCarrierL( activity.iPreferredAPId );
+        if (node.IsGoneDownRecoveryOngoing() )
+            {
+            // Too bad... Old link has gone down, and application rejected
+            // the new one. Nothing but problems ahead, but who cares, if
+            // the application doesn't. So reset the gone down recovery flag
+            // and assume that everybody is happy with the choise.
+            S60MCPRLOGSTRING1("S60MCPR<%x>::TSendMigrationRejected::DoL() Application rejected the carrier during gone down recovery -> reset flag",(TInt*)&iContext.Node())
+            node.ClearGoneDownRecoveryOngoing();
+            }
         }
 
 
@@ -449,6 +482,15 @@
         {
         S60MCPRLOGSTRING1("S60MCPR<%x>::TInformMigrationCompleted::DoL()",(TInt*)&iContext.Node())
         __ASSERT_DEBUG(iContext.iNodeActivity, User::Panic(KS60MCprPanic, KPanicNoActivity));
+        CS60MetaConnectionProvider& node = (CS60MetaConnectionProvider&)iContext.Node();
+        if ( node.IsGoneDownRecoveryOngoing() )
+            {
+            // Now we are on a safe side, since the reselect has been done
+            // IPCPr can and will complete NoBearer requests to the new
+            // interface instead of the old one. Reset the flag.
+            S60MCPRLOGSTRING1("S60MCPR<%x>::TInformMigrationCompleted::DoL() New bearer selected while in gone down recovery -> reset flag",(TInt*)&iContext.Node())
+            node.ClearGoneDownRecoveryOngoing();
+            }
         iContext.iNodeActivity->PostToOriginators(TCFMobilityProvider::TMigrationComplete().CRef());
         iContext.iNodeActivity->ClearPostedTo();
         }
@@ -471,6 +513,16 @@
         // 
         CS60MobilityActivity& activity = static_cast<CS60MobilityActivity&>(*iContext.iNodeActivity);
         activity.ClearHandshakingFlag();
+        
+        if ( node.IsGoneDownRecoveryOngoing() )
+            {
+            // Migration either errored or was cancelled while in gone down
+            // recovery. Node will be destroyed, so there is no point in
+            // such, but reset the flag anyway..
+            S60MCPRLOGSTRING1("S60MCPR<%x>::TCancelAvailabilityRequest::DoL() Error in migration while in gone down recovery -> reset flag",(TInt*)&iContext.Node())
+            node.ClearGoneDownRecoveryOngoing();
+            }
+        
         // At last we must set the activity in error since we're ready to go down.
         //
         iContext.iNodeActivity->SetError( KErrCancel );
--- a/bearermanagement/S60MCPR/src/s60mcprstates.cpp	Wed Sep 15 12:38:40 2010 +0300
+++ b/bearermanagement/S60MCPR/src/s60mcprstates.cpp	Wed Oct 13 14:59:48 2010 +0300
@@ -214,6 +214,19 @@
 
     ASSERT( error != KErrNone );
     
+    // Special handling for GoneDown errors. In this phase it is necessary
+    // to make sure that we are actually in GoneDown recovery, not in 
+    // start recovery. So check activity instead of error code
+    if (iContext.iNodeActivity->ActivityId() == ECFActivityConnectionGoneDownRecovery)
+        {
+        // We are requesting error recovery from MPM for GoneDown error
+        // Set the flag indicating that lower layer is not in a valid state
+        // so that we can discard NoBearer request coming from data clients
+        // for the time being.
+        S60MCPRLOGSTRING1("S60MCPR<%x>::TProcessError::DoL() Setting GoneDown recovery flag",(TInt*)&iContext.Node())
+        node.SetGoneDownRecoveryOngoing();
+        }    
+    
     // Create the callback that will eventually create the message that completes this state.
     CProcessErrorCb* cb = new( ELeave ) CProcessErrorCb( node, iContext.iNodeActivity );  // codescanner::leave
     CleanupStack::PushL( cb );  // codescanner::leave
@@ -223,6 +236,20 @@
     // After this we wait for cancellation/error/completion.
     }
 
+// -----------------------------------------------------------------------------
+// THandleNoBearerDuringGoneDownRecovery::DoL
+// -----------------------------------------------------------------------------
+//
+DEFINE_SMELEMENT( THandleNoBearerDuringGoneDownRecovery, NetStateMachine::MStateTransition, TContext )
+void THandleNoBearerDuringGoneDownRecovery::DoL() // codescanner::leave
+    { 
+    // As this is a single triple activity, there is no real activity
+    // instance available. Therefore, we need to live with the info
+    // available in the context.
+    S60MCPRLOGSTRING1("S60MCPR<%x>::THandleNoBearerDuringGoneDownRecovery::DoL() Return error",(TInt*)&iContext.Node())
+    TEBase::TError errorMsg ( iContext.iMessage.MessageId(), KErrNotReady );
+    iContext.PostToSender( errorMsg );
+    }
 
 // -----------------------------------------------------------------------------
 // TAwaitingSelectNextLayerCompletedOrError::Accept
@@ -482,7 +509,59 @@
     return EFalse;
     }
 
+// -----------------------------------------------------------------------------
+// TAwaitingDataClientIdle::Accept
+// -----------------------------------------------------------------------------
+//
+DEFINE_SMELEMENT( TAwaitingDataClientIdle, NetStateMachine::MState, TContext )
+TBool TAwaitingDataClientIdle::Accept()
+    {
+    if (!iContext.iMessage.IsMessage<TCFControlProvider::TIdle>())
+        {
+        return EFalse;
+        }
+    __ASSERT_DEBUG(iContext.iPeer, User::Panic(KS60MCprPanic, KPanicPeerMessage));
+    iContext.iPeer->ClearFlags(TCFClientType::EActive);
+    return ETrue;
+    }
 
+// -----------------------------------------------------------------------------
+// TAwaitingDataClientStatusChange::Accept
+// -----------------------------------------------------------------------------
+//
+DEFINE_SMELEMENT( TAwaitingDataClientStatusChange, NetStateMachine::MState, TContext )
+TBool TAwaitingDataClientStatusChange::Accept()
+    {
+    // Consume the received DataClientStatusChange if a DataClientIdle activity is running
+    if (iContext.iMessage.IsMessage<TCFControlProvider::TDataClientStatusChange>() &&
+        (iContext.Node().CountActivities( ECFActivityS60McprDataClientIdle ) > 0))
+        {
+        return ETrue;
+        }
+    return EFalse;
+    }
+
+// -----------------------------------------------------------------------------
+// TAwaitingNoBearerInGoneDownRecovery::Accept
+// -----------------------------------------------------------------------------
+//
+DEFINE_SMELEMENT( TAwaitingNoBearerInGoneDownRecovery, NetStateMachine::MState, TContext )
+TBool TAwaitingNoBearerInGoneDownRecovery::Accept()
+    {
+    if ( iContext.iMessage.IsMessage<TCFControlProvider::TNoBearer>() )
+        {
+        // Get MCPR to check gone down flag status 
+        CS60MetaConnectionProvider& node = (CS60MetaConnectionProvider&)iContext.Node();
+        if ( node.IsGoneDownRecoveryOngoing() )
+            {
+            // We have received a NoBearer while recovering from a GoneDown error
+            // Needs special handling -> accept
+            S60MCPRLOGSTRING1("S60MCPR<%x>::TAwaitingNoBearerInGoneDownRecovery::Accept() return true", (TInt*)&iContext.Node())
+            return ETrue;
+            }
+        }
+    return EFalse;
+    }
 
 // -----------------------------------------------------------------------------
 // TRetrieveServiceId::DoL
--- a/bearermanagement/mpm/group/mpmserver.mmp	Wed Sep 15 12:38:40 2010 +0300
+++ b/bearermanagement/mpm/group/mpmserver.mmp	Wed Oct 13 14:59:48 2010 +0300
@@ -58,8 +58,6 @@
 SOURCE            mpmofflinewatcher.cpp
 SOURCE            mpmexpirytimer.cpp
 SOURCE            mpmconnpermquerytimer.cpp
-SOURCE            mpmofflinequerytimer.cpp
-SOURCE            mpmconnselectiondlgtimer.cpp
 
 USERINCLUDE       ../inc
 
--- a/bearermanagement/mpm/inc/mpmcommsdataccess.h	Wed Sep 15 12:38:40 2010 +0300
+++ b/bearermanagement/mpm/inc/mpmcommsdataccess.h	Wed Oct 13 14:59:48 2010 +0300
@@ -300,14 +300,6 @@
         TWlanIapType CheckWlanL( TUint32 aIapId ) const;
 
         /**
-        * Checks if given IAP is TUN driver IAP.
-        * @since S^3
-        * @param aIapId IAP Id.
-        * @return True if given IAP is TUN driver IAP, false otherwise.
-        */
-		TBool IsTunDriverIap( TUint32 aIapId ) const;
-
-        /**
         * Removes categorised IAPs from the list of available IAPs.
         * @since 3.2
         * @param aIAPList List of IAPs
--- a/bearermanagement/mpm/inc/mpmconnselectiondlgtimer.h	Wed Sep 15 12:38:40 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,99 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Declaration of class CMPMConnSelectionDlgTimer.
-*
-*/
-
-#ifndef MPMCONNSELECTIONDLGTIMER_H
-#define MPMCONNSELECTIONDLGTIMER_H
-
-//  INCLUDES
-#include <e32base.h>
-#include "mpmexpirytimercallback.h"
-
-class CMPMServer;
-class CMPMExpiryTimer;
-
-/**
-* Class that implements connection selection dialog's
-* cancellation delay timer and callback.
-* @since 5.2
-*/
-class CMPMConnSelectionDlgTimer : public CBase, public MMPMExpiryTimerCallback
-    {
-
-public:
-
-    /**
-    * New for calling the two-phased constructor.
-    * @since 5.2
-    * @param aServer Pointer to the MPM server object, for callback purposes    
-    * @return Pointer to created object instance
-    */
-    static CMPMConnSelectionDlgTimer* NewL( CMPMServer* aServer );
-
-    /**
-    * Destructor.
-    * @since 5.2
-    */
-    virtual ~CMPMConnSelectionDlgTimer();
-
-    /**
-    * Start the timer.
-    * @since 5.2
-    */
-    void StartTimer();
-
-    /**
-    * Dialog expiration timeout callback, inherited from MMPMExpiryTimerCallback.
-    * @since 5.2
-    */
-    void HandleTimedOut();
-    
-private:
-
-    /**
-    * C++ default constructor.
-    * @since 5.2
-    * @param aServer Pointer to the MPM server object, for callback purposes    
-    */
-    CMPMConnSelectionDlgTimer( CMPMServer* aServer );
-
-    /**
-    * Symbian 2nd phase constructor.
-    * @since 5.2
-    */
-    void ConstructL();
-
-
-private: // data
-
-    /**
-    * Pointer to the MPM Server object. Not own.
-    */
-    CMPMServer* iServer;
-    
-    /**
-    * Pointer to the common MPM expiry timer object.
-    */
-    CMPMExpiryTimer* iExpiryTimer;
-
-    /**
-    * Timeout constant.
-    */
-    static const TInt KTimeout = 10000000; // 10 sec
-
-    };
-
-#endif // MPMCONNSELECTIONDLGTIMER_H
--- a/bearermanagement/mpm/inc/mpmofflinequerytimer.h	Wed Sep 15 12:38:40 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,99 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Declaration of class CMPMOfflineQueryTimer.
-*
-*/
-
-#ifndef MPMOFFLINEQUERYTIMER_H
-#define MPMOFFLINEQUERYTIMER_H
-
-//  INCLUDES
-#include <e32base.h>
-#include "mpmexpirytimercallback.h"
-
-class CMPMServer;
-class CMPMExpiryTimer;
-
-/**
-* Class that implements Offline query's cancellation delay timer
-* and callback.
-* @since 5.2
-*/
-class CMPMOfflineQueryTimer : public CBase, public MMPMExpiryTimerCallback
-    {
-
-public:
-
-    /**
-    * New for calling the two-phased constructor.
-    * @since 5.2
-    * @param aServer Pointer to the MPM server object, for callback purposes    
-    * @return Pointer to created object instance
-    */
-    static CMPMOfflineQueryTimer* NewL( CMPMServer* aServer );
-
-    /**
-    * Destructor.
-    * @since 5.2
-    */
-    virtual ~CMPMOfflineQueryTimer();
-
-    /**
-    * Start the timer.
-    * @since 5.2
-    */
-    void StartTimer();
-
-    /**
-    * Dialog expiration timeout callback, inherited from MMPMExpiryTimerCallback.
-    * @since 5.2
-    */
-    void HandleTimedOut();
-    
-private:
-
-    /**
-    * C++ default constructor.
-    * @since 5.2
-    * @param aServer Pointer to the MPM server object, for callback purposes    
-    */
-    CMPMOfflineQueryTimer( CMPMServer* aServer );
-
-    /**
-    * Symbian 2nd phase constructor.
-    * @since 5.2
-    */
-    void ConstructL();
-
-
-private: // data
-
-    /**
-    * Pointer to the MPM Server object. Not own.
-    */
-    CMPMServer* iServer;
-    
-    /**
-    * Pointer to the common MPM expiry timer object.
-    */
-    CMPMExpiryTimer* iExpiryTimer;
-
-    /**
-    * Timeout constant.
-    */
-    static const TInt KTimeout = 10000000; // 10 sec
-
-    };
-
-#endif // MPMOFFLINEQUERYTIMER_H
--- a/bearermanagement/mpm/inc/mpmserver.h	Wed Sep 15 12:38:40 2010 +0300
+++ b/bearermanagement/mpm/inc/mpmserver.h	Wed Oct 13 14:59:48 2010 +0300
@@ -201,8 +201,6 @@
 class CMPMWlanQueryDialog;
 class CMPMDialog;
 class CMPMConnPermQueryTimer;
-class CMPMOfflineQueryTimer;
-class CMPMConnSelectionDlgTimer;
 
 // CLASS DECLARATION
 /**
@@ -915,10 +913,9 @@
         
         /**
         * Stops cellular connections, except MMS
-        * @param aSilentOnly stop only silent cellular connections
         * @since 5.2
         */
-        void StopCellularConns( TBool aSilentOnly = EFalse );
+        void StopCellularConns();
 
         /**
         * Offline mode watcher updates the mode variable stored by MPM server.
@@ -968,49 +965,7 @@
         * @return ETrue if timer is running, EFalse otherwise.
         */
         TBool IsConnPermQueryTimerOn();
-        
-        /**
-        * Starts the offline query timer.
-        * During the timer, offline query can not be initiated.
-        * @since 5.2
-        */
-        void StartOfflineQueryTimer();
 
-        /**
-        * Resets the offline query timer.
-        * @since 5.2
-        */
-        void ResetOfflineQueryTimer();
-
-        /**
-        * Returns true if the offline query timer is running.
-        * During the timer, offline query can not be initiated.
-        * @since 5.2
-        * @return ETrue if timer is running, EFalse otherwise.
-        */
-        TBool IsOfflineQueryTimerOn();
-        
-        /**
-        * Starts the connection selection dialog timer.
-        * During the timer, connection selection dialog can not be initiated.
-        * @since 5.2
-        */
-         void StartConnSelectionDlgTimer();
-
-        /**
-        * Resets the connection selection dialog timer.
-        * @since 5.2
-        */
-         void ResetConnSelectionDlgTimer();
-
-        /**
-        * Returns true if the connection selection dialog timer is running.
-        * During the timer, connection selection dialog can not be initiated.
-        * @since 5.2
-        * @return ETrue if timer is running, EFalse otherwise.
-        */
-         TBool IsConnSelectionDlgTimerOn();
-         
     private:
 
         /**
@@ -1039,13 +994,6 @@
                                 TBool aCheckForBestIap,
                                 TMPMBearerType aDestinationBearerType );
         
-        /**
-         * Check if iap can be disconnected, and disconnect it
-         * @since 5.2
-         * @param aIapId Iap id for checking
-         */
-        void CheckIapForDisconnect( TInt aIapId );
-        
 
     private: // Data
         // Pointer to the ConnMonEvents object
@@ -1164,13 +1112,6 @@
         
         // Connection permission query cancellation delay timer
         CMPMConnPermQueryTimer* iConnPermQueryTimer;
-        
-        // Offline query cancellation delay timer
-        CMPMOfflineQueryTimer* iOfflineQueryTimer;
-        
-        // Connection selection dialog cancellation delay timer         
-        CMPMConnSelectionDlgTimer* iConnSelectionDlgTimer;
-      
     };
 
 #include "mpmserver.inl"
--- a/bearermanagement/mpm/inc/mpmserversession.h	Wed Sep 15 12:38:40 2010 +0300
+++ b/bearermanagement/mpm/inc/mpmserversession.h	Wed Oct 13 14:59:48 2010 +0300
@@ -957,10 +957,6 @@
         // showing duplicate cellulara data usage dialog
         //
         TBool iDisconnectDialogShown;
-        
-        // Set when error discreet popup shown for IAP so it is
-        // not shown again if the SNAP is empty
-        TBool iErrorDiscreetPopupShown;
     };
 
 #include "mpmserversession.inl"
--- a/bearermanagement/mpm/src/mpmcommsdataccess.cpp	Wed Sep 15 12:38:40 2010 +0300
+++ b/bearermanagement/mpm/src/mpmcommsdataccess.cpp	Wed Oct 13 14:59:48 2010 +0300
@@ -1787,34 +1787,6 @@
     }
 
 // -----------------------------------------------------------------------------
-// CMPMCommsDatAccess::IsTunDriverIap
-// -----------------------------------------------------------------------------
-//
-TBool CMPMCommsDatAccess::IsTunDriverIap( TUint32 aIapId ) const
-    {
-    TBool isTunDriver = EFalse;
-    MPMLOGSTRING( "CMPMCommsDatAccess::IsTunDriverIap" )
-
-    CMDBSession* db = CMDBSession::NewLC( KCDVersion1_1 );
-    CCDIAPRecord* record = LoadIapRecordLC( aIapId, db );
-
-    TBuf<KMaxTextLength> bearerTypeName( record->iBearerType.GetL() );
-    TBuf<KMaxTextLength> serviceTypeName( record->iServiceType.GetL() );
-
-    if ( (bearerTypeName == TPtrC( KCDTypeNameVirtualBearer ) )
-            && ( serviceTypeName == TPtrC( KCDTypeNameLANService ) ) )
-        {
-        // TunDriver;
-        isTunDriver = ETrue;
-        }
-
-    CleanupStack::PopAndDestroy( record );
-    CleanupStack::PopAndDestroy( db );
-
-    return isTunDriver;
-    }
-
-// -----------------------------------------------------------------------------
 // CMPMCommsDatAccess::RemoveCategorisedIapsL
 // -----------------------------------------------------------------------------
 //
--- a/bearermanagement/mpm/src/mpmconnselectiondlgtimer.cpp	Wed Sep 15 12:38:40 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,96 +0,0 @@
-/*
- * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description: Implementation of class CMPMConnSelectionDlgTimer.
- * This timer is used for preventing showing of connection selection
- * dialog when the user has cancelled the previous selection dialog.
- *
- */
-
-#include "mpmlogger.h"
-#include "mpmserver.h"
-#include "mpmexpirytimer.h"
-#include "mpmconnselectiondlgtimer.h"
-
-// ---------------------------------------------------------------------------
-// Creates a new object by calling the two-phased constructor.
-// ---------------------------------------------------------------------------
-//
-CMPMConnSelectionDlgTimer* CMPMConnSelectionDlgTimer::NewL( CMPMServer* aServer )
-    {
-    MPMLOGSTRING( "CMPMConnSelectionDlgTimer::NewL" )
-            
-    CMPMConnSelectionDlgTimer* self = new( ELeave ) CMPMConnSelectionDlgTimer( aServer );
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-// ---------------------------------------------------------------------------
-// Default C++ constructor.
-// ---------------------------------------------------------------------------
-//
-CMPMConnSelectionDlgTimer::CMPMConnSelectionDlgTimer( CMPMServer* aServer ) :
-    iServer( aServer )
-    {
-    MPMLOGSTRING( "CMPMConnSelectionDlgTimer::CMPMConnSelectionDlgTimer" )
-    }
-
-// ---------------------------------------------------------------------------
-// Symbian 2nd phase constructor.
-// ---------------------------------------------------------------------------
-//
-void CMPMConnSelectionDlgTimer::ConstructL()
-    {
-    MPMLOGSTRING( "CMPMConnSelectionDlgTimer::ConstructL" )
-    iExpiryTimer = CMPMExpiryTimer::NewL( *this, KTimeout );
-    }
-
-// ---------------------------------------------------------------------------
-// Destructor.
-// ---------------------------------------------------------------------------
-//
-CMPMConnSelectionDlgTimer::~CMPMConnSelectionDlgTimer()
-    {
-    MPMLOGSTRING( "CMPMConnSelectionDlgTimer::~CMPMConnSelectionDlgTimer" )
-    if ( iExpiryTimer )
-        {
-        iExpiryTimer->Cancel();
-        delete iExpiryTimer;
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// Start the timer.
-// ---------------------------------------------------------------------------
-//
-void CMPMConnSelectionDlgTimer::StartTimer()
-    {
-    MPMLOGSTRING( "CMPMConnSelectionDlgTimer::StartTimer" )
-    if ( iExpiryTimer )
-        {
-        iExpiryTimer->Cancel();
-        iExpiryTimer->Start();    
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// Handles the timeout.
-// ---------------------------------------------------------------------------
-//
-void CMPMConnSelectionDlgTimer::HandleTimedOut()
-    {
-    MPMLOGSTRING( "CMPMConnSelectionDlgTimer::HandleTimedOut" )
-    iServer->ResetConnSelectionDlgTimer();
-    }
--- a/bearermanagement/mpm/src/mpmdatausagewatcher.cpp	Wed Sep 15 12:38:40 2010 +0300
+++ b/bearermanagement/mpm/src/mpmdatausagewatcher.cpp	Wed Oct 13 14:59:48 2010 +0300
@@ -118,24 +118,15 @@
         // Get the new Cellular data usage setting value from central repository.
         TInt oldCellularDataUsage = iCellularDataUsage;
 
-        if ( GetCurrentDataUsageValue() == KErrNone // Updates iCellularDataUsage
-             && oldCellularDataUsage != iCellularDataUsage
-             && iServer->RoamingWatcher()->RoamingStatus() != EMPMRoamingStatusUnknown )
+        if ( GetCurrentDataUsageValue() == KErrNone )
             {
-            // Setting changed while cellular is in use
-
-            if ( iCellularDataUsage == ECmCellularDataUsageDisabled )
+            // Stop cellular connections if the setting changes into Disabled.
+            if ( oldCellularDataUsage != ECmCellularDataUsageDisabled &&
+                    iCellularDataUsage == ECmCellularDataUsageDisabled &&
+                    iServer->RoamingWatcher()->RoamingStatus() != EMPMRoamingStatusUnknown )
                 {
-                // Cellular data usage disabled -> disconnect cellular
                 iServer->StopCellularConns();
                 }
-            else if ( iCellularDataUsage == ECmCellularDataUsageConfirm )
-                {
-                // Cellular data usage needs to be confirmed -> disconnect if 
-                // there are only silent cellular connections left.
-                iServer->StopCellularConns( ETrue );
-                }
-
             }
         }
     
--- a/bearermanagement/mpm/src/mpmiapselection.cpp	Wed Sep 15 12:38:40 2010 +0300
+++ b/bearermanagement/mpm/src/mpmiapselection.cpp	Wed Oct 13 14:59:48 2010 +0300
@@ -81,9 +81,9 @@
     {
     // stop confirm dialog in case one exists
     //
-    MPMLOGSTRING( "CMPMIapSelection::~CMPMIapSelection" )
     StopDisplayingStartingDlg();
     
+    delete iConfirmDlgStarting;
     delete iDialog;
     delete iWlanDialog;
     }
@@ -494,12 +494,12 @@
     TConnectionId connId = iSession->ConnectionId();
 
     ChooseBestIAPL( iChooseIapPref, availableIAPList, iNextBestExists );
-    CleanupStack::PopAndDestroy( &availableIAPList );
     TUint32 validateIapId = iChooseIapPref.IapId();
     // Check if any suitable IAP's were found, if not then complete selection with error code
     if ( validateIapId == 0 )
         {
         ChooseIapComplete( KErrNotFound, NULL );
+        CleanupStack::PopAndDestroy( &availableIAPList );
         return;
         }
     
@@ -590,9 +590,13 @@
                         EStarting,
                         *iSession );
                 ChooseIapComplete( KErrNone, &iChooseIapPref );
+
                 }
+
             }
         }
+
+    CleanupStack::PopAndDestroy( &availableIAPList );    
     }
 
 // -----------------------------------------------------------------------------
@@ -726,20 +730,40 @@
     {
     MPMLOGSTRING2( "CMPMIapSelection::ChooseIapComplete aError = %d", aError )
     
+    if ( ( aError == KErrNone ) &&
+        !( iChooseIapPref.NoteBehaviour() &
+           TExtendedConnPref::ENoteBehaviourConnDisableNotes ) )
+        {
+        TConnectionState state =
+            iSession->MyServer().CheckUsageOfIap( aPolicyPref->IapId(), 
+                                                  iSession->ConnectionId() );
+        TBool connectionAlreadyActive = (state == EStarted || state == EStarting || state == ERoaming);
+        if ( !connectionAlreadyActive &&
+                ( iSession->IsMMSIap( aPolicyPref->IapId() ) == EFalse ) )
+            {
+            CConnectionUiUtilities* connUiUtils( NULL );
+            TRAPD( popupError, connUiUtils = CConnectionUiUtilities::NewL() );
+            if ( popupError == KErrNone )
+        	    {
+            	connUiUtils->ConnectingViaDiscreetPopup( aPolicyPref->IapId() );
+               	delete connUiUtils;
+        	    }
+            }
+        }
+    
     if( iWlanDialog )
         {
         delete iWlanDialog;
         iWlanDialog = NULL;
         }
 
+    iSession->ChooseIapComplete( aError, aPolicyPref );
     // Set choose iap state to none
     iChooseIapState = ENoConnection;
     iNextBestExists = EFalse;
     iUserSelectionSnapId = 0;
     iUserSelectionIapId = 0;
     iImplicitState = EImplicitStart;
-
-	iSession->ChooseIapComplete( aError, aPolicyPref );
     }
 
 
@@ -811,13 +835,6 @@
     ChooseIapComplete( aError, NULL );
     delete iDialog;
     iDialog = NULL;
-    // Start ConnSelectionDlgTimer if user has cancelled the connection
-    // selection dialog. During the timer interval dialog is not shown.
-    // 
-    if( aError == KErrCancel )
-        {
-        iSession->MyServer().StartConnSelectionDlgTimer();
-        }
     }
 
        
@@ -1005,22 +1022,13 @@
     MPMLOGSTRING( "CMPMIapSelection::ImplicitConnectionIapSelectionL" )
     iSession->AvailableUnblacklistedIapsL( iStoredAvailableIaps, iSession->ConnectionId() );
 
-    // Create and initiate user dialog only if it hasnot 
-    // been cancelled in last 10s(KTimeout)
+    // Create and initiate user dialog
     //
-    if ( !iSession->MyServer().IsConnSelectionDlgTimerOn() )
-        {
-       iDialog = CMPMDialog::NewL( *this,
+    iDialog = CMPMDialog::NewL( *this,
                                 iStoredAvailableIaps,
                                 iChooseIapPref.BearerSet(),
                                 *iSession->MyServer().ConnectDialogQueue(),
                                 iSession->MyServer() );
-        }
-    else
-        {
-        MPMLOGSTRING( "CMPMIapSelection::ImplicitConnectionIapSelectionL, iConnSelectionDlgTimer running" )	
-        ChooseIapComplete( KErrCancel, NULL );        
-        }
     }
 
 // -----------------------------------------------------------------------------
@@ -1031,25 +1039,25 @@
     {
     if( iImplicitState  == EImplicitStart )
         {
-        MPMLOGSTRING( "CMPMIapSelection::ImplicitConnectionL EImplicitStart" )
+        MPMLOGSTRING( "CMPMIapSelection::ImplicitConnectionIapSelectionL EImplicitStart" )
         iImplicitState = EImplicitWlanScan;
         ImplicitConnectionCheckWlanScanNeededL();
         }
     else if( iImplicitState  == EImplicitWlanScan )
         {
-        MPMLOGSTRING( "CMPMIapSelection::ImplicitConnectionL EImplicitWlanScan" )
+        MPMLOGSTRING( "CMPMIapSelection::ImplicitConnectionIapSelectionL EImplicitWlanScan" )
         iImplicitState = EImplicitUserSelection;
         ImplicitConnectionIapSelectionL();
         }
     else if( iImplicitState  == EImplicitUserSelection )
         {
-        MPMLOGSTRING( "CMPMIapSelection::ImplicitConnectionL EImplicitUserSelection" )
+        MPMLOGSTRING( "CMPMIapSelection::ImplicitConnectionIapSelectionL EImplicitUserSelection" )
         iImplicitState = EImplicitWlanQuery;
         ImplicitConnectionWlanNoteL();
         }
     else //EImplicitWlanQuery
         {
-        MPMLOGSTRING( "CMPMIapSelection::ImplicitConnectionL EImplicitWlanQuery" )
+        MPMLOGSTRING( "CMPMIapSelection::ImplicitConnectionIapSelectionL EImplicitWlanQuery" )
         CompleteImplicitConnectionL();
         }
     }
@@ -1128,14 +1136,9 @@
         ret = aAvailableIAPs.Find( destNetIaps[k].iIapId );
         if ( ret == KErrNotFound )
             {
-            TBool isTunDriver = iCommsDatAccess->IsTunDriverIap(
-                    destNetIaps[k].iIapId );
-            if ( !isTunDriver )
-                {
-                MPMLOGSTRING2( "CMPMIapSelection::ChooseBestIAPL: \
-                     Remove unavailable IAP = %i", destNetIaps[k].iIapId )
-                destNetIaps.Remove( k );
-                }
+            MPMLOGSTRING2( "CMPMIapSelection::ChooseBestIAPL: \
+Remove unavailable IAP = %i", destNetIaps[k].iIapId )
+            destNetIaps.Remove( k );
             }
         }
 
@@ -1151,14 +1154,11 @@
             ret = aAvailableIAPs.Find( embeddedIaps[m].iIapId );
             if ( ret == KErrNotFound )
                 {
-                TBool isTunDriver = iCommsDatAccess->IsTunDriverIap( embeddedIaps[m].iIapId );
-                if ( !isTunDriver )
-                    {
-                    // Remove IapId because it's not available
-                    MPMLOGSTRING2( "CMPMIapSelection::ChooseBestIAPL: \
+                // Remove IapId because it's not available
+                // 
+                MPMLOGSTRING2( "CMPMIapSelection::ChooseBestIAPL: \
 Remove unavailable IAP = %i", embeddedIaps[m].iIapId )
-                                   embeddedIaps.Remove( m );
-                    }
+                              embeddedIaps.Remove( m );
                 }
             }
         }
--- a/bearermanagement/mpm/src/mpmofflinequerytimer.cpp	Wed Sep 15 12:38:40 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,96 +0,0 @@
-/*
- * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description: Implementation of class CMPMOfflineQueryTimer.
- * This timer is used for preventing offline query when the user
- * has cancelled the previous offline query.
- *
- */
-
-#include "mpmlogger.h"
-#include "mpmserver.h"
-#include "mpmexpirytimer.h"
-#include "mpmofflinequerytimer.h"
-
-// ---------------------------------------------------------------------------
-// Creates a new object by calling the two-phased constructor.
-// ---------------------------------------------------------------------------
-//
-CMPMOfflineQueryTimer* CMPMOfflineQueryTimer::NewL( CMPMServer* aServer )
-    {
-    MPMLOGSTRING( "CMPMOfflineQueryTimer::NewL" )
-            
-    CMPMOfflineQueryTimer* self = new( ELeave ) CMPMOfflineQueryTimer( aServer );
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-// ---------------------------------------------------------------------------
-// Default C++ constructor.
-// ---------------------------------------------------------------------------
-//
-CMPMOfflineQueryTimer::CMPMOfflineQueryTimer( CMPMServer* aServer ) :
-    iServer( aServer )
-    {
-    MPMLOGSTRING( "CMPMOfflineQueryTimer::CMPMOfflineQueryTimer" )
-    }
-
-// ---------------------------------------------------------------------------
-// Symbian 2nd phase constructor.
-// ---------------------------------------------------------------------------
-//
-void CMPMOfflineQueryTimer::ConstructL()
-    {
-    MPMLOGSTRING( "CMPMOfflineQueryTimer::ConstructL" )
-    iExpiryTimer = CMPMExpiryTimer::NewL( *this, KTimeout );
-    }
-
-// ---------------------------------------------------------------------------
-// Destructor.
-// ---------------------------------------------------------------------------
-//
-CMPMOfflineQueryTimer::~CMPMOfflineQueryTimer()
-    {
-    MPMLOGSTRING( "CMPMOfflineQueryTimer::~CMPMOfflineQueryTimer" )
-    if ( iExpiryTimer )
-        {
-        iExpiryTimer->Cancel();
-        delete iExpiryTimer;
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// Start the timer.
-// ---------------------------------------------------------------------------
-//
-void CMPMOfflineQueryTimer::StartTimer()
-    {
-    MPMLOGSTRING( "CMPMOfflineQueryTimer::StartTimer" )
-    if ( iExpiryTimer )
-        {
-        iExpiryTimer->Cancel();
-        iExpiryTimer->Start();    
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// Handles the timeout.
-// ---------------------------------------------------------------------------
-//
-void CMPMOfflineQueryTimer::HandleTimedOut()
-    {
-    MPMLOGSTRING( "CMPMOfflineQueryTimer::HandleTimedOut" )
-    iServer->ResetOfflineQueryTimer();
-    }
--- a/bearermanagement/mpm/src/mpmserver.cpp	Wed Sep 15 12:38:40 2010 +0300
+++ b/bearermanagement/mpm/src/mpmserver.cpp	Wed Oct 13 14:59:48 2010 +0300
@@ -47,8 +47,6 @@
 #include "mpmpropertydef.h"
 #include "mpmofflinewatcher.h"
 #include "mpmconnpermquerytimer.h"
-#include "mpmofflinequerytimer.h"
-#include "mpmconnselectiondlgtimer.h"
 
 // ============================= LOCAL FUNCTIONS ===============================
 
@@ -383,10 +381,6 @@
     delete iCommsDatAccess;
     
     delete iConnPermQueryTimer;
-    
-    delete iOfflineQueryTimer; 
-    
-    delete iConnSelectionDlgTimer;
     }
 
 
@@ -559,33 +553,32 @@
     MPMLOGSTRING2( "CMPMServer::RemoveBMConnection - aConnId = 0x%x", 
         aConnId )
 
+    TInt count = iActiveBMConns.Count();
+    
+    // Decrement by one, because count is n, 
+    // but indexes in array are 0 .. n-1.
+    // 
+    count--;
+
     // This time we are browsing the array from the end to the beginning, 
     // because removing one element from array affects index numbering.
-    // Decrement i by one, because count is n, but indexes in array are 0 .. n-1
-    for ( TInt i = iActiveBMConns.Count() - 1; i >= 0; i-- )
+    // 
+    for ( TInt i = count; i >= 0; i-- )
         {
         if ( iActiveBMConns[i].iConnInfo.iConnId == aConnId )
             {
-            
-            TInt closeIapId = iActiveBMConns[i].iConnInfo.iIapId;
-            if ( !closeIapId )
-                {
-                TRAP_IGNORE( closeIapId = aSession.IapSelectionL()->MpmConnPref().IapId() );
-                }
+            // If Connection Id found, remove it. 
+            //
+            iActiveBMConns.Remove( i );
 
-            // If Connection Id found, remove it. 
-            iActiveBMConns.Remove( i );
-            
             // Update active connection
             if ( aSession.ChooseBestIapCalled() )
                 {
                 UpdateActiveConnection( aSession );
                 }
-            
-            CheckIapForDisconnect( closeIapId );
             }
         }
-    
+
 #ifdef _DEBUG
     // Dump array of active connections to log in order to support testing.
     // 
@@ -604,6 +597,7 @@
     TUint32 connectionIapId( 0 );
 
     // Set the Connection Id and SNAP
+    // 
     TConnectionInfo connInfo;
     connInfo.iConnId = aConnId;
 
@@ -615,6 +609,7 @@
     if ( ( index1 != KErrNotFound ) && ( index1 < iActiveBMConns.Count() ) )
         {
         // If connInfo found, set the Iap Id as connectionIapId
+        //
         connectionIapId = iActiveBMConns[index1].iConnInfo.iIapId;
         }
 
@@ -883,13 +878,23 @@
         "CMPMServer::RemoveBMIAPConnection - aIapId = %i, aConnId = 0x%x", 
         aIapId, aConnId )
 
+    TActiveBMConn conn;
+    conn.iConnInfo.iIapId = aIapId;
+
     // The IAP connection lifetime is determined by the two calls 
     // IAPConnectionStarted and IAPConnectionStopped. 
+    //
+    TInt count = iActiveBMConns.Count();
+
+    // Decrement by one, because count is n, 
+    // but indexes in array are 0 .. n-1.
+    // 
+    count--;
 
     // This time we are browsing the array from the end to the beginning, 
     // because removing one element from array affects index numbering.
-    // Decrement i by one, because count is n, but indexes in array are 0 .. n-1
-    for ( TInt i = iActiveBMConns.Count() - 1; i >= 0; i-- )
+    // 
+    for ( TInt i = count; i >= 0; i-- )
         {
         if ( iActiveBMConns[i].iConnInfo.iIapId == aIapId )
             {
@@ -982,7 +987,7 @@
 #endif // _DEBUG
 
     // Read info for forced roaming from Commdat
-    TUint32 maxOpenTransAttempts ( KMaxOpenTransAttempts ) ;
+    TUint32 maxOpenTransAttempts ( KMaxOpenTransAttempts );
     TUint32 retryAfter ( KRetryAfter );
     TInt err;
     // CommDat reading might fail because CommDat session could be locked by another process at the moment
@@ -2247,7 +2252,7 @@
 // Stop all cellular connections except MMS
 // ---------------------------------------------------------------------------
 //
-void CMPMServer::StopCellularConns( TBool aSilentOnly )
+void CMPMServer::StopCellularConns()
     {
     MPMLOGSTRING( "CMPMServer::StopCellularConns" )
 
@@ -2276,14 +2281,7 @@
                 if (!(err == KErrNone && iapId == mmsIap))
                     {
                     // Stop the conn / IAP.
-                    if ( aSilentOnly )
-                        {
-                        CheckIapForDisconnect( iapId );
-                        }
-                    else
-                        {
-                        StopConnections( iapId );
-                        }
+                    StopConnections( iapId );
                     stoppedIaps.Append( iapId );
                     }
                 }
@@ -2416,189 +2414,6 @@
     return retval;
     }
 
-// ---------------------------------------------------------------------------
-// CMPMServer::StartOfflineQueryTimer
-// Starts the offline query timer.
-// ---------------------------------------------------------------------------
-//
-void CMPMServer::StartOfflineQueryTimer()
-    {
-    MPMLOGSTRING( "CMPMServer::StartOfflineQueryTimer" )
-
-    if ( !iOfflineQueryTimer )
-        {
-        TRAPD( err, iOfflineQueryTimer = CMPMOfflineQueryTimer::NewL( this ) );
-        if ( err == KErrNone )
-            {
-            iOfflineQueryTimer->StartTimer();
-            MPMLOGSTRING( "CMPMServer::StartOfflineQueryTimer: Ok." )
-            }
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// CMPMServer::ResetOfflineQueryTimer
-// Resets the offline query timer.
-// ---------------------------------------------------------------------------
-//
-void CMPMServer::ResetOfflineQueryTimer()
-    {
-    MPMLOGSTRING( "CMPMServer::ResetOfflineQueryTimer" )
-
-    if ( iOfflineQueryTimer )
-        {
-        delete iOfflineQueryTimer;
-        iOfflineQueryTimer = NULL;
-        MPMLOGSTRING( "CMPMServer::ResetOfflineQueryTimer: Ok." )
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// CMPMServer::IsOfflineQueryTimerOn
-// Tells if the offline query timer is on.
-// ---------------------------------------------------------------------------
-//
-TBool CMPMServer::IsOfflineQueryTimerOn()
-    {
-    MPMLOGSTRING( "CMPMServer::IsOfflineQueryTimerOn" )
-
-    TBool retval = EFalse;
-    if ( iOfflineQueryTimer )
-        {
-        retval = ETrue;
-        MPMLOGSTRING( "CMPMServer::IsOfflineQueryTimerOn: Yes." )
-        }
-    return retval;
-    }
-
-// ---------------------------------------------------------------------------
-// CMPMServer::StartConnSelectionDlgTimer
-// Starts the connection selection dialog timer.
-// ---------------------------------------------------------------------------
-//
-void CMPMServer::StartConnSelectionDlgTimer()
-    {
-    MPMLOGSTRING( "CMPMServer::StartConnSelectionDlgTimer" )
-
-    if ( !iConnSelectionDlgTimer )
-        {
-        TRAPD( err, iConnSelectionDlgTimer = CMPMConnSelectionDlgTimer::NewL( this ) );
-        if ( err == KErrNone )
-            {
-            iConnSelectionDlgTimer->StartTimer();
-            MPMLOGSTRING( "CMPMServer::StartConnSelectionDlgTimer: Ok." )
-            }
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// CMPMServer::ResetConnSelectionDlgTimer
-// Resets the connection selection dialog timer.
-// ---------------------------------------------------------------------------
-//
-void CMPMServer::ResetConnSelectionDlgTimer()
-    {
-    MPMLOGSTRING( "CMPMServer::ResetConnSelectionDlgTimer" )
-
-    if ( iConnSelectionDlgTimer )
-        {
-        delete iConnSelectionDlgTimer;
-        iConnSelectionDlgTimer = NULL;
-        MPMLOGSTRING( "CMPMServer::ResetConnSelectionDlgTimer: Ok." )
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// CMPMServer::IsConnSelectionDlgTimerOn
-// Tells if the connection selection dialog timer is on.
-// ---------------------------------------------------------------------------
-//
-TBool CMPMServer::IsConnSelectionDlgTimerOn()
-    {
-    MPMLOGSTRING( "CMPMServer::IsConnSelectionDlgTimerOn" )
-
-    TBool retval = EFalse;
-    if ( iConnSelectionDlgTimer )
-        {
-        retval = ETrue;
-        MPMLOGSTRING( "CMPMServer::IsConnSelectionDlgTimerOn: Yes." )
-        }
-    return retval;
-    }
-    
-// -----------------------------------------------------------------------------
-// CMPMServer::CheckIapForDisconnect
-// -----------------------------------------------------------------------------
-//
-void CMPMServer::CheckIapForDisconnect( TInt aIapId )
-    {
-    MPMLOGSTRING2( "CMPMServer::CheckIapForDisconnect - aIapId = 0x%x", 
-        aIapId )
-
-    // Fix for case ou1cimx1#468999: stop sessions to cellular iap
-    // when there is only silent connections to it, and cellular usage is set
-    // to always ask
-    
-    // Check iap type and usage policy
-    TMPMBearerType bearerType( EMPMBearerTypeNone );
-    TRAP_IGNORE( bearerType = CommsDatAccess()->GetBearerTypeL( aIapId ) );
-
-    TBool closeIap = ( bearerType == EMPMBearerTypePacketData
-                && DataUsageWatcher()->CellularDataUsage() == ECmCellularDataUsageConfirm ); 
-    
-    // No need to put iapSessions to CleanupStack; there are no leaves
-    RPointerArray<CMPMServerSession> iapSessions;
-    if ( closeIap )
-        {
-        // Check for non-silent sessions to iap
-        // closeIap is left true also when there are no sessions using the iap
-        for ( TInt i = 0; i < iActiveBMConns.Count(); i++ )
-            {
-
-            CMPMServerSession* session
-                = GetServerSession( iActiveBMConns[i].iConnInfo.iConnId );
-
-            TInt sessionIapId = iActiveBMConns[i].iConnInfo.iIapId;
-            if ( !sessionIapId )
-                {
-                TRAP_IGNORE( sessionIapId = session->IapSelectionL()->MpmConnPref().IapId() );
-                }
-
-            if ( sessionIapId == aIapId )
-                {
-                iapSessions.Append( session ); // Don't mind if Append fails
-                
-                TBool silent( ETrue );
-                TRAP_IGNORE( silent = session->IapSelectionL()->MpmConnPref().NoteBehaviour()
-                                      & TExtendedConnPref::ENoteBehaviourConnDisableNotes );
-                if ( !silent )
-                    {
-                    // Non-silent session to iap found
-                    closeIap = EFalse;
-                    break; // for
-                    }
-                }
-            }
-        }
-    
-    if ( closeIap )
-        {
-        MPMLOGSTRING2( "CMPMServer::CheckIapForDisconnect - stopping silent sessions to iap 0x%x", 
-            aIapId )
-        // Stop all (silent) sessions to iap
-        for ( TInt i = 0; i < iapSessions.Count(); i++)
-            {
-            MPMLOGSTRING2( "CMPMServer::CheckIapForDisconnect - stopping connId 0x%x",
-                    iapSessions[i]->ConnectionId());
-            iapSessions[i]->StopConnection();
-            }
-        }
-
-    iapSessions.Close();
-    
-    }
-
-
 // -----------------------------------------------------------------------------
 // TMPMBlackListConnId::Append
 // -----------------------------------------------------------------------------
--- a/bearermanagement/mpm/src/mpmserversession.cpp	Wed Sep 15 12:38:40 2010 +0300
+++ b/bearermanagement/mpm/src/mpmserversession.cpp	Wed Oct 13 14:59:48 2010 +0300
@@ -76,8 +76,7 @@
       iStoredIapInfo(),
       iIapSelection( NULL ),
       iMigrateState( EMigrateNone ),
-      iDisconnectDialogShown( EFalse ),
-      iErrorDiscreetPopupShown( EFalse )
+      iDisconnectDialogShown( EFalse )
     {
     }
 
@@ -107,12 +106,11 @@
 //
 CMPMServerSession::~CMPMServerSession()
     {
-    MPMLOGSTRING( "CMPMServerSession::~CMPMServerSession" )
-
-
-    // Remove serverside objects for notification session.
-    // 
-    iMyServer.RemoveSession( this );
+    MPMLOGSTRING( "CMPMServerSession::~CMPMServerSession - start" )
+
+    delete iDisconnectDlg;
+    delete iConfirmDlgRoaming;
+    delete iIapSelection;
 
     if (UserConnection())
         {
@@ -137,11 +135,11 @@
     
     // Make sure the connection is removed from server's information array.
     iMyServer.RemoveBMConnection( iConnId, *this );
-
-    delete iDisconnectDlg;
-    delete iConfirmDlgRoaming;
-    delete iIapSelection;
-
+    
+    // Remove server's objects releated to session.
+    iMyServer.RemoveSession( this );
+
+    MPMLOGSTRING( "CMPMServerSession::~CMPMServerSession - end" )
     }
 
 
@@ -1472,10 +1470,6 @@
             connUiUtils->ConnectionErrorDiscreetPopup( error );
             delete connUiUtils;
             connUiUtils = NULL;
-            
-            // Error discreet popup has been shown. This is needed so that we
-            // dont show it again for SNAP.
-            iErrorDiscreetPopupShown = ETrue;
             }
         }
 
@@ -1647,8 +1641,8 @@
         // KErrConnectionTerminated is received when user disconnects
         // connection from Settings/Connection mgr.
         //       
-        if ( ( error == KErrCancel ) || ( error == KErrTimedOut ) || ( error == KErrConnectionTerminated )
-                || ( error == KErrDisconnected && iMyServer.IsPhoneOffline() ) )
+    if ( ( error == KErrCancel ) || ( error == KErrTimedOut ) || ( error == KErrConnectionTerminated )
+            || ( error == KErrDisconnected && iMyServer.IsPhoneOffline() ) )
             {
             neededAction = EPropagateError;
 
@@ -3357,6 +3351,26 @@
     {
     MPMLOGSTRING2( "CMPMServerSession::ChooseIapComplete aError = %d", aError )
 
+    // Show error popup if it's allowed per client request.
+	// No error popup shown to SNAP.
+    if ( ChooseBestIapCalled() && (!( iIapSelection->MpmConnPref().NoteBehaviour() &
+            TExtendedConnPref::ENoteBehaviourConnDisableNotes ))
+            && ( aError != KErrNone ) 
+            && ( iIapSelection->MpmConnPref().SnapId() == 0 ) )
+        {
+        CConnectionUiUtilities* connUiUtils = NULL;
+        TRAPD( error, connUiUtils = CConnectionUiUtilities::NewL() );
+        if ( error == KErrNone && connUiUtils )
+            {
+            // Note: Below function shows the discreet popup only if the error code
+            // belongs to the set of errors that are shown to the user.
+            // Otherwise the popup is not shown.
+            connUiUtils->ConnectionErrorDiscreetPopup( aError );
+            delete connUiUtils;
+            connUiUtils = NULL;
+            }
+        }
+    
     // Try to write back arguments and complete message.
     // 
     if ( !iChooseIapMessage.IsNull() )
@@ -3411,58 +3425,6 @@
         MPMLOGSTRING( "CMPMServerSession::ChooseIapComplete Message completed" )
         iChooseIapMessage.Complete( aError );
         }
-
-    CConnectionUiUtilities* connUiUtils( NULL );
-    
-    MPMLOGSTRING2( "CMPMServerSession::ChooseIapComplete: this = %X", this )
-    MPMLOGSTRING2( "CMPMServerSession::ChooseIapComplete: iIapSelection = %X", iIapSelection )
-
-    // Enable showing error discreet popup for SNAP again
-    // Temp var used because session may get deleted during the showing of popup
-    TBool tempErrorDiscreetPopupShown = iErrorDiscreetPopupShown; 
-    iErrorDiscreetPopupShown = EFalse;
-    
-    // NOTE: Be careful with discreet popups! It jams session at this point
-    // for a moment, BUT the session may be called meanwhile.
-    // This may/will lead to problems e.g. if session is being deleted => all (heap) objects
-    // deleted in destructor are gone!
-    // Show error popup if it's allowed per client request.
-	// Error popup shown to SNAP only if error discreet has not been shown for IAP.
-    if ( ChooseBestIapCalled() && (!( iIapSelection->MpmConnPref().NoteBehaviour() &
-            TExtendedConnPref::ENoteBehaviourConnDisableNotes ))
-              && ( aError != KErrNone )
-              && ( tempErrorDiscreetPopupShown == EFalse ) )
-        {
-        TRAPD( popupError, connUiUtils = CConnectionUiUtilities::NewL() );
-        if ( popupError == KErrNone )
-            {
-            // Note: Below function shows the discreet popup only if the error code
-            // belongs to the set of errors that are shown to the user.
-            // Otherwise the popup is not shown.
-            connUiUtils->ConnectionErrorDiscreetPopup( aError );
-            delete connUiUtils;
-            connUiUtils = NULL;
-            }
-        }
-    else if ( aPolicyPref &&
-                    ( aError == KErrNone ) &&
-                    !( iIapSelection->MpmConnPref().NoteBehaviour() &
-                            TExtendedConnPref::ENoteBehaviourConnDisableNotes ) )
-        {
-        TConnectionState state = iMyServer.CheckUsageOfIap( aPolicyPref->IapId(), iConnId );
-		TBool connectionAlreadyActive = (state == EStarted || state == EStarting || state == ERoaming);
-        if ( !connectionAlreadyActive &&
-                ( IsMMSIap( aPolicyPref->IapId() ) == EFalse ) )
-            {
-            TRAPD( popupError, connUiUtils = CConnectionUiUtilities::NewL() );
-            if ( popupError == KErrNone )
-                {
-                connUiUtils->ConnectingViaDiscreetPopup( aPolicyPref->IapId() );
-                delete connUiUtils;
-                connUiUtils = NULL;
-                }
-            }
-        }
     }
 
 
@@ -3573,14 +3535,30 @@
 //
 TBool CMPMServerSession::UseUserConnPref()
     {
-    if ((iAppUid != iMyServer.CsIdWatcher()->ConnectScreenId()) &&
-        iMyServer.UserConnection())
+    if ( ( iAppUid != iMyServer.CsIdWatcher()->ConnectScreenId() ) &&
+         iMyServer.UserConnection() )
         {
         MPMLOGSTRING( "CMPMServerSession::UseUserConnPref - User connection active" );
+
+        // If user connection is blacklisted for this connection, don't use it.
+        RArray<TUint32> blacklistedIaps;
+        CleanupClosePushL( blacklistedIaps );
+        iMyServer.GetBlacklistedIAP( iConnId, blacklistedIaps );
+        TInt blacklistedIapFoundError = blacklistedIaps.Find( iMyServer.UserConnPref()->IapId() );
+        CleanupStack::PopAndDestroy( &blacklistedIaps );
         
+        if ( blacklistedIapFoundError != KErrNotFound )
+            {
+            MPMLOGSTRING( "CMPMServerSession::UseUserConnPref -\
+ User connection blacklisted -> don't use user connection" );
+            return EFalse;
+            }
+
         // Check whether default connection will be used
         if ( iIapSelection->MpmConnPref().ConnType() == TMpmConnPref::EConnTypeDefault )
             {
+            MPMLOGSTRING( "CMPMServerSession::UseUserConnPref -\
+ Default connection -> use user connection" );
             return ETrue;
             }
         else if ( ( iIapSelection->MpmConnPref().ConnType() ==
@@ -3588,7 +3566,7 @@
                   PrefsAllowWlan() )
             {            
             MPMLOGSTRING( "CMPMServerSession::UseUserConnPref -\
- Prompt from the user" );
+ Prompt from the user -> use user connection" );
             // Prompt from the user -> use user connection
             return ETrue;
             }
@@ -3607,6 +3585,8 @@
 
             if ( ( error == KErrNone ) && ( isInternetSnap ) && PrefsAllowWlan() )
                 {
+                MPMLOGSTRING( "CMPMServerSession::UseUserConnPref -\
+ Application preferencies in Internet SNAP -> use user connection" );
                 // Iap belongs to internet snap -> use user connection
                 return ETrue;
                 }
--- a/bearermanagement/mpm/src/mpmwlanquerydialog.cpp	Wed Sep 15 12:38:40 2010 +0300
+++ b/bearermanagement/mpm/src/mpmwlanquerydialog.cpp	Wed Oct 13 14:59:48 2010 +0300
@@ -198,16 +198,25 @@
                     EOfflineResponseYes );
             if( iIapSelection.Session()->MyServer().CommsDatAccess()->CheckEasyWLanL( iWlanIapId ) )
                 {
-                MPMLOGSTRING( "CMPMWlanQueryDialog::RunL starting wlan network query" )
-                GetNetworkPrefs();
-                return;
+                // It may be possible that there's still an active WLAN, which we'll now share.
+                TUint32 activeWlanIap = iIapSelection.Session()->MyServer().IsWlanConnectionStartedL( 
+                        iIapSelection.Session()->MyServer().CommsDatAccess() );
+                if ( activeWlanIap )
+                    {
+                    iWlanIapId = activeWlanIap;
+                    }
+                else
+                    {
+                    MPMLOGSTRING( "CMPMWlanQueryDialog::RunL starting wlan network query" )
+                    GetNetworkPrefs();
+                    return;
+                    }
                 }
             }
         else if ( iStatus.Int() == KErrCancel )
             {
             iIapSelection.Session()->MyServer().SetOfflineWlanQueryResponse(
                     EOfflineResponseNo );
-            iIapSelection.Session()->MyServer().StartOfflineQueryTimer();
             MPMLOGSTRING2( "CMPMWlanQueryDialog::RunL offline query returned %d", 
                            iStatus.Int() )
             }
@@ -465,7 +474,6 @@
     
     if( !emergencyCallEstablished && 
         iIapSelection.Session()->MyServer().IsPhoneOffline() && 
-        !activeWlanIap && 
         iIapSelection.Session()->MyServer().OfflineWlanQueryResponse() != EOfflineResponseYes &&
         iOverrideStatus == KErrNone )
         {
@@ -475,22 +483,14 @@
             iIapSelection.UserWlanSelectionDoneL( KErrPermissionDenied, iWlanIapId );
             }
         else
-            {         
+            {
+            MPMLOGSTRING( "CMPMWlanQueryDialog::StartWlanQuery, starting offline note" )            
             iWlanQueryState = EOffline;
-            if ( !iIapSelection.Session()->MyServer().IsOfflineQueryTimerOn() )
-                {
-                MPMLOGSTRING( "CMPMWlanQueryDialog::StartWlanQuery, starting offline query" )        
-                iNotifier.StartNotifierAndGetResponse( iStatus, 
-                                                       KUidCOfflineWlanNoteDlg, 
-                                                       KNullDesC8(), 
-                                                       iOfflineReply );
-                SetActive();
-                }
-            else
-                {
-                MPMLOGSTRING( "CMPMWlanQueryDialog::StartWlanQuery, offline note not shown as OfflineQueryTimer is active" )        
-                iIapSelection.UserWlanSelectionDoneL( KErrPermissionDenied, iWlanIapId );
-                }
+            iNotifier.StartNotifierAndGetResponse( iStatus, 
+                                                   KUidCOfflineWlanNoteDlg, 
+                                                   KNullDesC8(), 
+                                                   iOfflineReply );
+            SetActive();
             }
         }
     // if easy wlan iap and some wlan iap started, use existing connection
--- a/cmmanager/cmmgr/Framework/BWinsCw/CmManager_prot_setupU.DEF	Wed Sep 15 12:38:40 2010 +0300
+++ b/cmmanager/cmmgr/Framework/BWinsCw/CmManager_prot_setupU.DEF	Wed Oct 13 14:59:48 2010 +0300
@@ -388,6 +388,5 @@
 	?WatcherUnRegister@CCmManagerImpl@@QAEXXZ @ 387 NONAME ; void CCmManagerImpl::WatcherUnRegister(void)
 	?RemoveDestFromPool@CCmManagerImpl@@QAEXPAVCCmDestinationImpl@@@Z @ 388 NONAME ; void CCmManagerImpl::RemoveDestFromPool(class CCmDestinationImpl *)
 	?OfferKeyEventL@CmPluginBaseSettingsDlg@@MAE?AW4TKeyResponse@@ABUTKeyEvent@@W4TEventCode@@@Z @ 389 NONAME ; enum TKeyResponse CmPluginBaseSettingsDlg::OfferKeyEventL(struct TKeyEvent const &, enum TEventCode)
-	?AddCmL@CCmSettingsUi@@QAEKAAKK@Z @ 390 NONAME ; unsigned long CCmSettingsUi::AddCmL(unsigned long &, unsigned long)
-	?EditCmL@CCmSettingsUi@@QAE?AW4TResult@1@K@Z @ 391 NONAME ; enum CCmSettingsUi::TResult CCmSettingsUi::EditCmL(unsigned long)
 
+
--- a/cmmanager/cmmgr/Framework/EABI/CmManager_prot_setupU.def	Wed Sep 15 12:38:40 2010 +0300
+++ b/cmmanager/cmmgr/Framework/EABI/CmManager_prot_setupU.def	Wed Oct 13 14:59:48 2010 +0300
@@ -435,6 +435,4 @@
 	_ZN14CCmManagerImpl18RemoveDestFromPoolEP18CCmDestinationImpl @ 434 NONAME
 	_ZN14CCmManagerImpl24DestinationStillExistedLEP18CCmDestinationImpl @ 435 NONAME
 	_ZN23CmPluginBaseSettingsDlg14OfferKeyEventLERK9TKeyEvent10TEventCode @ 436 NONAME
-	_ZN13CCmSettingsUi6AddCmLERmm @ 437 NONAME
-	_ZN13CCmSettingsUi7EditCmLEm @ 438 NONAME
 
--- a/cmmanager/cmmgr/Framework/Inc/cmsettingsuiimpl.h	Wed Sep 15 12:38:40 2010 +0300
+++ b/cmmanager/cmmgr/Framework/Inc/cmsettingsuiimpl.h	Wed Oct 13 14:59:48 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -59,24 +59,6 @@
         * @return TBool
         */
         TBool SelectDestinationDlgL( TUint32& aDestinationId );
-        
-        /**
-        * Launches the dialog for adding connection methods
-        * @since 3.2.3
-        * @param  aDestUid destination id for the new cm
-        * @param  aBearerType bearer type for the new cm
-        * @return TUint32 id of the new cm
-        */
-        TUint32 AddCmL( TUint32& aDestUid, TUint32 aBearerType );
-
-        /**
-        * Launches the dialog for editing connection methods
-        * @since 3.2.3
-        * @param  aCmId id of the cm to edit
-        * @return TInt - KDialogUserExit or KDialogUserBack
-        */
-        TInt EditCmL( TUint32 aCmId );
-
 
     private:
 
--- a/cmmanager/cmmgr/Framework/Src/cmmanagerimpl.cpp	Wed Sep 15 12:38:40 2010 +0300
+++ b/cmmanager/cmmgr/Framework/Src/cmmanagerimpl.cpp	Wed Oct 13 14:59:48 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -712,17 +712,10 @@
     // Two instances of class CCmCommsDatNotifier are created here and
     // referred by all watchers in CmManager. One is to watch change in Iap Table
     // and the other is to watch change in Snap Table.
-    
-    if ( iCommsDatIapNotifier == NULL )
-        {
-        iCommsDatIapNotifier = CCmCommsDatNotifier::NewL( KCDTIdIAPRecord );
-        }
+    iCommsDatIapNotifier = CCmCommsDatNotifier::NewL( KCDTIdIAPRecord );
     
-    if ( iCommsDatSnapNotifier == NULL )
-        {
-        TUint32 snapTableId = GetSnapTableIdL();
-        iCommsDatSnapNotifier = CCmCommsDatNotifier::NewL( snapTableId );
-        }
+    TUint32 snapTableId = GetSnapTableIdL();
+    iCommsDatSnapNotifier = CCmCommsDatNotifier::NewL( snapTableId );
     }
 
 //=============================================================================
--- a/cmmanager/cmmgr/Framework/Src/cmsettingsui.cpp	Wed Sep 15 12:38:40 2010 +0300
+++ b/cmmanager/cmmgr/Framework/Src/cmsettingsui.cpp	Wed Oct 13 14:59:48 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -15,10 +15,7 @@
 *
 */
 
-//This include contains full path because there is 
-//an other version of the same file available in the public
-//SDK and we want to make sure that the internal header is used.
-#include <platform/mw/cmsettingsui.h> 
+#include <cmsettingsui.h>
 #include "cmsettingsuiimpl.h"
 #include <cmcommonconstants.h>
 
@@ -85,30 +82,3 @@
     {
     return iImpl->SelectDestinationDlgL( aDestinationId );
     }
-    
-//-----------------------------------------------------------------------------
-//  CCmSettingsUi::AddCmL()
-//-----------------------------------------------------------------------------
-//    
-
-EXPORT_C TUint32 CCmSettingsUi::AddCmL( TUint32& aDestUid, TUint32 aBearerType )
-    {
-    return iImpl->AddCmL( aDestUid, aBearerType );
-    }
-
-//-----------------------------------------------------------------------------
-//  CCmSettingsUi::EditCmL()
-//-----------------------------------------------------------------------------
-//
-
-EXPORT_C CCmSettingsUi::TResult CCmSettingsUi::EditCmL( TUint32 aCmId )
-    {
-    if ( iImpl->EditCmL( aCmId ) == KDialogUserExit )
-        {
-        return EExit;
-        }
-     else
-        {
-        return EBack;
-        }
-    }
--- a/cmmanager/cmmgr/Framework/Src/cmsettingsuiimpl.cpp	Wed Sep 15 12:38:40 2010 +0300
+++ b/cmmanager/cmmgr/Framework/Src/cmsettingsuiimpl.cpp	Wed Oct 13 14:59:48 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -20,11 +20,7 @@
 #include "cmsettingsuiimpl.h"
 #include "cmmanagerimpl.h"
 #include "destdlg.h"
-#include <cmcommonui.h>
-#include <cmpluginbase.h>
-#include <cmmanagerdef.h>
 #include <cmcommonconstants.h>
-#include <cmpluginwlandef.h>
 #include "selectdestinationdlg.h"
 #include <data_caging_path_literals.hrh>
 
@@ -126,102 +122,3 @@
                                                               
     return dlg->ExecuteLD( R_CMMANAGER_LIST_QUERY_WITH_MSGBOX );    
     }
-//-----------------------------------------------------------------------------
-//  CCmSettingsUiImpl::AddCmL
-//-----------------------------------------------------------------------------
-//
-TUint32 CCmSettingsUiImpl::AddCmL( TUint32& aDestUid, TUint32 aBearerType )
-    {
-    // Add new connection method
-    TUint32 addedIapId(0);
-
-    CCmDestinationImpl* destImpl = iCmManagerImpl->DestinationL( aDestUid );
-    CleanupStack::PushL(destImpl);
-    
-    // Check first if parent destination is protected
-    if ( destImpl->ProtectionLevel() == CMManager::EProtLevel1 )
-        {
-        TCmCommonUi::ShowNoteL( R_CMWIZARD_CANNOT_PERFORM_FOR_PROTECTED,
-                                TCmCommonUi::ECmErrorNote );
-        }
-    else
-        {
-        // Automatically check for available conn methods?
-    
-        TBool manualConfigure = ETrue;    
-        if (aBearerType == KUidWlanBearerType)
-            {
-            TInt retval =
-                    TCmCommonUi::ShowConfirmationQueryL( R_CMWIZARD_AUTOMATIC_CHECK );
-    
-            manualConfigure = ( retval == EAknSoftkeyYes || retval == EAknSoftkeyOk )
-                                      ?  EFalse : ETrue;
-            }
-            
-        CCmPluginBase* plugin = destImpl->CreateConnectionMethodL( aBearerType );
-        CleanupStack::PushL( plugin );
-       
-        // Bearer-specific UI-supported initialization is done by plug-ins
-        if ( plugin->InitializeWithUiL( manualConfigure ) )
-            {
-            destImpl->UpdateL();  // commit changes
-
-            RArray<TUint32> additionalCms;
-            CleanupClosePushL (additionalCms);
-            plugin->GetAdditionalUids( additionalCms );
-            //if there are additional cms created, move them to the target destination as well
-            for ( TInt i = 0; i<additionalCms.Count(); i++)
-                {
-                CCmPluginBase* cm = iCmManagerImpl->GetConnectionMethodL( additionalCms[i] );
-                CleanupStack::PushL(cm);
-                iCmManagerImpl->CopyConnectionMethodL( *destImpl, *cm );
-                CleanupStack::PopAndDestroy( cm );
-                }
-            CleanupStack::PopAndDestroy( &additionalCms );   
-            addedIapId = plugin->GetIntAttributeL( CMManager::ECmIapId );
-            }
-        CleanupStack::PopAndDestroy(plugin);
-        }    
-    CleanupStack::PopAndDestroy(destImpl);
-    
-    return addedIapId;
-    }
-
-//-----------------------------------------------------------------------------
-//  CCmSettingsUiImpl::EditCmL
-//-----------------------------------------------------------------------------
-//
-TInt CCmSettingsUiImpl::EditCmL( TUint32 aCmId )
-    {
-    // Edit connection method  
-    TInt ret( KDialogUserBack );
-    
-    CCmPluginBase* cm = iCmManagerImpl->GetConnectionMethodL( aCmId );
-    CleanupStack::PushL( cm );
-    
-    cm->ReLoadL();
-    if ( cm->GetBoolAttributeL( CMManager::ECmProtected ) ||
-         cm->GetBoolAttributeL( CMManager::ECmDestination ) )
-        {
-        TCmCommonUi::ShowNoteL( R_CMMANAGERUI_INFO_PROTECTED_CANNOT_EDIT,
-                                            TCmCommonUi::ECmErrorNote );
-        }
-   else if ( cm->GetBoolAttributeL( CMManager::ECmBearerHasUi ) )
-        {
-        // check if the cm is in use
-        if ( cm->GetBoolAttributeL( CMManager::ECmConnected ) )
-            {
-            TCmCommonUi::ShowNoteL( R_QTN_SET_NOTE_AP_IN_USE_EDIT,
-                                    TCmCommonUi::ECmErrorNote );
-            }
-        else
-            {
-            //Makes sure that the commsdat notifier is initialized.           
-            cm->CmMgr().StartCommsDatNotifierL();
-            ret = cm->RunSettingsL();
-            }
-        }
-    CleanupStack::PopAndDestroy(cm);
-    return ret;
-    }
-
--- a/cmmanager/cmmgr/Plugins/Group/bld.inf	Wed Sep 15 12:38:40 2010 +0300
+++ b/cmmanager/cmmgr/Plugins/Group/bld.inf	Wed Oct 13 14:59:48 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). 
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -32,6 +32,5 @@
 #include "../cmpluginwlan/group/bld.inf"
 #include "../cmpluginembdestination/group/bld.inf"
 #include "../cmpluginvpn/group/bld.inf"
-#include "../cmplugintundriver/group/bld.inf"
 
 // End of File
--- a/cmmanager/cmmgr/Plugins/cmplugintundriver/data/20027F3E.rss	Wed Sep 15 12:38:40 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  ECom resource descriptor for TUN Driver plug-in
-*
-*/
-
-#include "ecom/registryinfo.rh"
-
-// Because attribute enums had to be added to namespace CMManager
-// it's not possible to included cmplugintundriverdef.h.
-// Thus bearer type id had to be redefined here.
-#define KPluginTUNDriverBearerTypeUid   0x20027F3F
-
-RESOURCE REGISTRY_INFO theInfo
-    {
-    dll_uid = 0x20027F3E;
-    interfaces = 
-        {
-        INTERFACE_INFO
-            {
-            interface_uid = 0x10207377; // = KCMPluginInterfaceUid. Do NOT modify it!!!
-            implementations = 
-                {
-                IMPLEMENTATION_INFO
-                    {
-                    implementation_uid = KPluginTUNDriverBearerTypeUid;
-                    version_no = 1;
-                    display_name = "VPN";
-                    default_data = "VPN";
-                    opaque_data = "";
-                    }
-                };
-            }
-        };
-    }
--- a/cmmanager/cmmgr/Plugins/cmplugintundriver/group/bld.inf	Wed Sep 15 12:38:40 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  TUN Driver plug-in IF implementation class.
-*
-*/
-
-
-#include <platform_paths.hrh>
-
-PRJ_PLATFORMS
-DEFAULT
-
-PRJ_EXPORTS
-// export localised loc file
-
-PRJ_MMPFILES
-cmplugintundriver.mmp
-
-PRJ_EXTENSIONS
-START EXTENSION s60/mifconv
-OPTION TARGETFILE cmplugintundriver.mif
-OPTION HEADERFILE cmpluginvpn.mbg
-OPTION SOURCES -c8,1 qgn_prop_vpn_access_point
-END
--- a/cmmanager/cmmgr/Plugins/cmplugintundriver/group/cmplugintundriver.mmp	Wed Sep 15 12:38:40 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Project specification for TUN Driver plug-in
-*
-*/
-
-#include <data_caging_paths.hrh>
-#include <platform_paths.hrh>
-
-TARGET      cmplugintundriver.dll
-UID         0x10009D8D 0x20027F3E
-
-TARGETTYPE        PLUGIN
-
-CAPABILITY      CAP_ECOM_PLUGIN
-VENDORID        VID_DEFAULT
-
-SOURCEPATH  ../src
-
-SOURCE      cmpluginproxytundriver.cpp
-SOURCE      cmplugintundriver.cpp
-SOURCE      ../../../Framework/Src/cmlogger.cpp
-
-SOURCEPATH  ../data
-
-START RESOURCE 20027F3E.rss
-TARGET cmplugintundriver.rsc
-END
-
-
-USERINCLUDE     ../data
-USERINCLUDE     ../../../Framework/Inc
-USERINCLUDE     ../../../Framework/SrcData
-
-// Component specific internal headers 
-USERINCLUDE			../inc
-
-// ADO specific internal headers 
-SYSTEMINCLUDE		../../../../../inc
-
-//Macro to /epoc32 headers
-MW_LAYER_SYSTEMINCLUDE
-
-#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
-APP_LAYER_SYSTEMINCLUDE
-#endif
-
-LIBRARY hlplch.lib
-LIBRARY euser.lib
-LIBRARY ecom.lib
-LIBRARY cmmanager.lib
-LIBRARY commsdat.lib
-
-LIBRARY aknskins.lib
-LIBRARY efsrv.lib 
-LIBRARY	CommonEngine.lib
-LIBRARY cone.lib eikcore.lib avkon.lib
-LIBRARY eikcoctl.lib eikdlg.lib
-LIBRARY bafl.lib
-LIBRARY vpnapi.lib
-LIBRARY centralrepository.lib
-LIBRARY featmgr.lib
-LIBRARY cmmanagerdatabase.lib
-DEBUGLIBRARY flogger.lib
--- a/cmmanager/cmmgr/Plugins/cmplugintundriver/group/cmplugintundriver_icons.mk	Wed Sep 15 12:38:40 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-#
-# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-# All rights reserved.
-# This component and the accompanying materials are made available
-# under the terms of "Eclipse Public License v1.0"
-# which accompanies this distribution, and is available
-# at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-# Initial Contributors:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description:  Makefile for icons of TUN Driver plug-in
-#
-
-ifeq (WINS,$(findstring WINS, $(PLATFORM)))
-ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\Z
-else
-ZDIR=\epoc32\data\z
-endif
-
-
-TARGETDIR=$(ZDIR)\resource\apps
-ICONTARGETFILENAME=$(TARGETDIR)\cmpluginvpn.mif
-
-HEADERDIR=\epoc32\include
-HEADERFILENAME=$(HEADERDIR)\cmpluginvpn.mbg
-
-do_nothing :
-	@rem do_nothing
-
-MAKMAKE : do_nothing
-
-BLD : do_nothing
-
-CLEAN : do_nothing
-
-LIB : do_nothing
-
-CLEANLIB : do_nothing
-
-# ----------------------------------------------------------------------------
-# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by
-# MifConv if the mask detph is defined.
-#
-# NOTE 2: Usually, source paths should not be included in the bitmap
-# definitions. MifConv searches for the icons in all icon directories in a
-# predefined order, which is currently \s60\icons, \s60\bitmaps2, \s60\bitmaps.
-# The directory \s60\icons is included in the search only if the feature flag
-# __SCALABLE_ICONS is defined.
-# ----------------------------------------------------------------------------
-
-RESOURCE :
-	mifconv $(ICONTARGETFILENAME) /h$(HEADERFILENAME) \
-                /c8,1 qgn_prop_vpn_access_point.bmp
-
-FREEZE : do_nothing
-
-SAVESPACE : do_nothing
-
-RELEASABLES :
-	@echo $(HEADERFILENAME)&& \
-	@echo $(ICONTARGETFILENAME)
-
-FINAL : do_nothing
--- a/cmmanager/cmmgr/Plugins/cmplugintundriver/inc/cmplugintundriver.h	Wed Sep 15 12:38:40 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,165 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  TUN Driver plugin IF implementation class.
-*
-*/
-
-#ifndef TUNDRIVER_PLUGIN_INCLUDED
-#define TUNDRIVER_PLUGIN_INCLUDED
-
-#include <cmplugintundriverdef.h>
-#include <cmpluginlanbase.h>
-
-class CCDVirtualIAPNextLayerRecord;
-
-/**
- * TUN Driver Plugin IF implementation class
- * This class will be instantiated when the connection is created using the PluginBearer Id KPluginTUNDriverBearerTypeUid
- * @since S^3
- */
-NONSHARABLE_CLASS(CCmPluginTUNDriver) : public CCmPluginLanBase
-    {
-
-    public:
-
-        /**
-        * This function is invoked by the cmmanager plugin framework to load TUNDriver plugin. 
-        * This plugin will be identified based on the plugin UID from cmpluginproxy.cpp
-        * @param aInitParam Initialization parameters.
-        * @return CCmPluginTUNDriver.
-        */
-        static CCmPluginTUNDriver* NewL( TCmPluginInitParam* aInitParam );
-
-        /**
-        * Destructor. 
-        */
-        virtual ~CCmPluginTUNDriver();
-
-        /**
-        * This function is invoked by the cmmanager plugin framework while loading the plugin. 
-        * CreateInstance of the plugin will invoke each time plugin type needs to instantiated 
-        * @param aInitParam Initialization parameters.
-        * @return CCmPluginBaseEng.
-        */
-        virtual CCmPluginBaseEng* CreateInstanceL( TCmPluginInitParam& aInitParam ) const;
-        
-        /**
-        * This is function is invoked by cmmanager framework.
-        * Once the plugin type is identified, identifies the right ServiceRecord and loads.
-        */
-        void LoadServiceSettingL();
-        
-    public:
-
-        /**
-        * This is function is invoked by cmmanager framework.
-        * Check here if every data of the connection method is valid
-        * before records were saved to CommsDat.
-        * Set incorrect attribute id in iInvalidAttribute and leave
-        * with KErrArgument.
-        */
-        void PrepareToUpdateRecordsL();
-        
-        /**
-        * This is function is invoked by cmmanager framework. If Settings are enabled.
-        * Currently Settings for TUNDriver is not supported.
-        * @return KErrNotSupported.
-        */
-        virtual TInt RunSettingsL();
-
-        /**
-        * This is function is invoked by cmmanager framework.
-        * Once the plugin type is identified, type of bearer and other attributes types are obtained. 
-        * @param aAttribute Attribute type.
-        * @return Integer attribute's value.
-        */
-        virtual TUint32 GetIntAttributeL( const TUint32 aAttribute ) const;
-        
-        /**
-        * This is function is invoked by cmmanager framework.
-        * Once the plugin type is identified, finds wether the IAP selected belongs to TUNDriver. 
-        * @param aIapId IapId for the selected accesspoint
-        * @return ETrue if IAP can be handled else EFalse.
-        */
-        virtual TBool CanHandleIapIdL( TUint32 aIapId ) const;
-        
-        /**
-        * This is function is invoked by cmmanager framework.
-        * Once the plugin type is identified, finds wether the IAP selected belongs to TUNDriver.
-        * This is identified if service type is LANService and Bearer is VirtualBearer and
-        * IfName is TunDriverIf and agent is TunDriverAgent. 
-        * @param aIapRecord - iaprecord of type CCDIAPRecord from commsdatabase
-        * @return ETrue if IAP can be handled else EFalse.
-        */
-        virtual TBool CanHandleIapIdL( CommsDat::CCDIAPRecord* aIapRecord ) const;
-        
-        /**
-        * This is function is invoked by cmmanager framework when needs to initialzed with UI.
-        * This feature is currently not supported by the plugin.
-        * @param aManuallyConfigure Manual configuration on or off.
-        * @return KErrNotSupported
-        */
-        TBool InitializeWithUiL( TBool aManuallyConfigure );
-
-        /**
-        * This is function is invoked by plugin destructor.
-        * If the function is not defined then compiler will throw error for TUNDriver plugin construction.
-        */
-        virtual void AdditionalReset();
-
-    protected:
-
-        /**
-        * This is function is invoked by cmmanager framework.
-        * @return aName is LanService name and  aRecordId the service record Id.
-        */
-        virtual void ServiceRecordIdLC( HBufC* &aServiceName, TUint32& aRecordId );
-
-        /**
-        * This is function is invoked by cmmanager framework.
-        * @param aBearerName Output parameter for bearer name.
-        * @param aRecordId Output parameter for Bearer record Id.
-        */
-        virtual void BearerRecordIdLC( HBufC* &aBearerName, TUint32& aRecordId );
-
-        /**
-        * This is function is invoked by cmmanager framework.
-        * Once the plugin type is identified, this invoked for the first time when plgun is loaded
-        * while creating connection for TUNDriver plugin.
-        */
-        virtual void CreateNewServiceRecordL();
-        
-    private:
-
-        /**
-        * This is default constructor of the plugin. 
-        * @param aInitParam Initialization parameters.
-        */
-        CCmPluginTUNDriver( TCmPluginInitParam* aInitParam );
-
-        /**
-        * This is second phase constructor of the plugin.
-        * Builds the commsdatabase with the Tables required for TUNDriver plugin. 
-        */
-        void ConstructL();
-
-        /**
-        * This is function is invoked by cmmanager framework.
-        * Returns the service record of the TUN driver plugin.
-        * @return service record.
-        */
-        CommsDat::CCDLANServiceRecord& ServiceRecord()const;
-    };
-
-#endif // TUNDRIVER_PLUGIN_INCLUDED
--- a/cmmanager/cmmgr/Plugins/cmplugintundriver/inc/cmtundrivercommonconstants.h	Wed Sep 15 12:38:40 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  constants for the TUN Driver plugin
-*
-*/
-
-#ifndef CMTUNDRIVERCOMMONCONSTANTS_H
-#define CMTUNDRIVERCOMMONCONSTANTS_H
-
-// CONSTANTS
-_LIT( KPluginVPNResDirAndFileName, "z:cmpluginvpnui.rsc" );
-
-// Do not change this default to other value because proxy number is using this value as default port number
-const TInt KVpnProxyPortNumberDefault = 0;
-
-#endif  // CMTUNDRIVERCOMMONCONSTANTS_H
--- a/cmmanager/cmmgr/Plugins/cmplugintundriver/src/cmpluginproxytundriver.cpp	Wed Sep 15 12:38:40 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  TUN Driver plug-in IF implementation class.
-*
-*/
-
-#include "cmplugintundriver.h"
-#include <e32std.h>
-#include <ecom/implementationproxy.h>
-
-// Exported proxy for instantiation method resolution
-// Define the interface UIDs
-const TImplementationProxy ImplementationTable[] = 
-    {
-    IMPLEMENTATION_PROXY_ENTRY( KPluginTUNDriverBearerTypeUid, CCmPluginTUNDriver::NewL)
-    };
-
-EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
-/**
-* ImplementationGroupProxy
-* This is function is invoked by E-Com Plugin framework for TUNDriver plugin UID when needs to be loaded.
-* @param 
-* @return 
-*/
-    {
-    aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
-
-    return ImplementationTable;
-    }
--- a/cmmanager/cmmgr/Plugins/cmplugintundriver/src/cmplugintundriver.cpp	Wed Sep 15 12:38:40 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,472 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  TUN Driver plug-in IF implementation class.
-*
-*/
-
-#include <AknsUtils.h>
-#include <cmpluginvpn.mbg>
-#include <data_caging_path_literals.hrh>
-
-#include "cmlogger.h"
-#include "cmdestinationimpl.h"
-#include "cmplugintundriver.h"
-
-using namespace CMManager;
-using namespace CommsDat;
-
-const TUint32 KDefaultPriorityTUNDriver = 0;
-_LIT( KPluginTUNDriverFileIcons, "z:cmplugintundriver.mbm" );
-_LIT(KTUNDriverBearerName,"TUNDriverBearer");
-#define KCDAgentNameTUNDriver _S("tundriveragt.agt")
-_LIT(KTUNDriverTunnelAgent,"tundriveragt.agt");
-#define KCDInterfaceNameTUNDriver  _S("tundriver")
-_LIT(KTUNDriverInterfaceName,"tundriver");
-
-const TInt KLanLastSocketActivityTimeout = -1;
-const TInt KLanLastSocketClosedTimeout = -1;
-
-const TBool KDefIpAddrFromServer = EFalse;
-const TBool KDefIpDnsAddrFromServer = EFalse;
-const TBool KDefIp6DnsAddrFromServer = EFalse;
-_LIT( KEmpty, "");
-
-static const TCmAttribConvTable STUNDriverConvTbl[] = 
-    {      
-        { ETUNDriverIfNetworks, ETUNDriverRangeMax, NULL },
-        { ETUNDriverIfNetworks, KCDTIdLANIfNetworks, NULL },        
-        { ETUNDriverIpNetMask, KCDTIdLANIpNetMask, &CheckIPv4ValidityL },
-        { ETUNDriverIpGateway, KCDTIdLANIpGateway, &CheckIPv4ValidityL },
-        { ETUNDriverIpAddrFromServer, KCDTIdLANIpAddrFromServer, NULL },
-        { ETUNDriverIpAddr, KCDTIdLANIpAddr, &CheckIPv4ValidityL },
-        { ETUNDriverIpDNSAddrFromServer, KCDTIdLANIpDNSAddrFromServer, NULL },
-        { ETUNDriverIpNameServer1, KCDTIdLANIpNameServer1, &CheckIPv4ValidityL },
-        { ETUNDriverIpNameServer2, KCDTIdLANIpNameServer2, &CheckIPv4ValidityL },
-        { ETUNDriverIp6DNSAddrFromServer, KCDTIdLANIp6DNSAddrFromServer, NULL },
-        { ETUNDriverIp6NameServer1, KCDTIdLANIp6NameServer1, &CheckIPv4ValidityL },
-        { ETUNDriverIp6NameServer2, KCDTIdLANIp6NameServer2, &CheckIPv4ValidityL },
-        { ETUNDriverIpAddrLeaseValidFrom, KCDTIdLANIpAddrLeaseValidFrom, NULL },
-        { ETUNDriverIpAddrLeaseValidTo, KCDTIdLANIpAddrLeaseValidTo, NULL },
-        { ETUNDriverConfigDaemonManagerName, KCDTIdLANConfigDaemonManagerName, NULL },
-        { ETUNDriverConfigDaemonName, KCDTIdLANConfigDaemonName, NULL },
-        { ETUNDriverServiceExtensionTableName, KCDTIdLANServiceExtensionTableName, NULL },
-        { ETUNDriverServiceExtensionTableRecordId, KCDTIdLANServiceExtensionTableRecordId, NULL },
-        { 0, 0, NULL }
-    };
-
-static const TCmCommonAttrConvArrayItem STUNDriverCommonConvTbl[] =
-    {        
-        { ETUNDriverIfNetworks, ECmIFNetworks },
-        { ETUNDriverIpNetMask, ECmIPNetmask },
-        { ETUNDriverIpGateway, ECmIPGateway },
-        { ETUNDriverIpAddrFromServer, ECmIPAddFromServer },
-        { ETUNDriverIpAddr, ECmIPAddress },
-        { ETUNDriverIpDNSAddrFromServer, ECmIPDNSAddrFromServer },
-        { ETUNDriverIpNameServer1, ECmIPNameServer1 },
-        { ETUNDriverIpNameServer2, ECmIPNameServer2 },
-        { ETUNDriverIp6DNSAddrFromServer, ECmIP6DNSAddrFromServer },
-        { ETUNDriverIp6NameServer1, ECmIP6NameServer1 },
-        { ETUNDriverIp6NameServer2, ECmIP6NameServer2 },
-        { ETUNDriverIpAddrLeaseValidFrom, ECmIPAddrLeaseValidFrom },
-        { ETUNDriverIpAddrLeaseValidTo, ECmIPAddrLeaseValidTo },
-        { ETUNDriverConfigDaemonManagerName, ECmConfigDaemonManagerName },
-        { ETUNDriverConfigDaemonName, ECmConfigDaemonName },
-        { 0, 0 }
-    };
-
-// --------------------------------------------------------------------------
-// CCmPluginTUNDriver::NewL()
-// --------------------------------------------------------------------------
-//
-CCmPluginTUNDriver* CCmPluginTUNDriver::NewL( TCmPluginInitParam* aInitParam )
-    {
-    CCmPluginTUNDriver* self = new( ELeave ) CCmPluginTUNDriver( aInitParam );
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-// --------------------------------------------------------------------------
-// CCmPluginTUNDriver::~CCmPluginTUNDriver()
-// --------------------------------------------------------------------------
-//
-CCmPluginTUNDriver::~CCmPluginTUNDriver()
-    {
-    AdditionalReset();
-    }
-
-// --------------------------------------------------------------------------
-// CCmPluginTUNDriver::CreateInstanceL
-// --------------------------------------------------------------------------
-//
-CCmPluginBaseEng* CCmPluginTUNDriver::CreateInstanceL( TCmPluginInitParam& aInitParam ) const
-    {
-    CCmPluginTUNDriver* self = new( ELeave ) CCmPluginTUNDriver( &aInitParam );
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    return self;
-    }
-    
-// --------------------------------------------------------------------------
-// CCmPluginTUNDriver::CCmPluginTUNDriver()
-// --------------------------------------------------------------------------
-//
-CCmPluginTUNDriver::CCmPluginTUNDriver( TCmPluginInitParam* aInitParam )
-    : CCmPluginLanBase( aInitParam )
-    {
-    CLOG_CREATE;
-    iBearerType = KPluginTUNDriverBearerTypeUid;
-    }
-
-// --------------------------------------------------------------------------
-// CCmPluginTUNDriver::ConstructL()
-// --------------------------------------------------------------------------
-//
-void CCmPluginTUNDriver::ConstructL()
-    {
-    CCmPluginLanBase::ConstructL();
-    iBearerRecName = KCDTypeNameVirtualBearer;
-   
-    AddConverstionTableL( (CCDRecordBase**)&iServiceRecord, NULL, STUNDriverConvTbl );
-    AddCommonConversionTableL( STUNDriverCommonConvTbl );
-    }
-
-// --------------------------------------------------------------------------
-// CCmPluginTUNDriver::GetIntAttributeL()
-// --------------------------------------------------------------------------
-//
-TUint32 CCmPluginTUNDriver::GetIntAttributeL( const TUint32 aAttribute ) const
-    {
-    LOGGER_ENTERFN( "CCmPluginTUNDriver::GetIntAttributeL" );
-
-    TUint32 retVal( 0 );
-
-    switch( aAttribute )
-        {
-        case ECmBearerIcon:
-            {
-            MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance();
-            TAknsItemID id;      
-            TParse mbmFile;
-            User::LeaveIfError( mbmFile.Set( KPluginTUNDriverFileIcons, 
-                                             &KDC_BITMAP_DIR, NULL ) );
-
-            retVal = (TUint32)AknsUtils::CreateGulIconL( 
-                                    skinInstance, 
-                                    id,
-                                    mbmFile.FullName(), 
-                                    EMbmCmpluginvpnQgn_prop_vpn_access_point, 
-                                    EMbmCmpluginvpnQgn_prop_vpn_access_point_mask );
-            }
-            break;             
-        case ECmCommsDBBearerType:
-            {
-            retVal = KCommDbBearerLAN;
-            }
-            break;
-        case ECmDefaultUiPriority:
-        case ECmDefaultPriority:
-            {
-            retVal = aAttribute == ECmDefaultPriority ?
-                        GlobalBearerPriority( TPtrC(KCDTypeNameLANService) ) :
-                        GlobalUiBearerPriority( TPtrC(KCDTypeNameLANService) );
-
-            if ( retVal == KDataMobilitySelectionPolicyPriorityWildCard )
-                {
-                retVal = KDefaultPriorityTUNDriver;
-                }
-            }
-            break;             
-        default:
-            {
-            retVal = CCmPluginBaseEng::GetIntAttributeL( aAttribute );
-            }
-        }
-
-    return retVal;
-    }
-
-// --------------------------------------------------------------------------
-// CCmPluginTUNDriver::CanHandleIapIdL()
-// --------------------------------------------------------------------------
-//
-TBool CCmPluginTUNDriver::CanHandleIapIdL( TUint32 aIapId ) const
-    {
-    LOGGER_ENTERFN( "CCmPluginTUNDriver::CanHandleIapIdL1" );
-    TBool retVal( EFalse );
-
-    CCDIAPRecord *iapRecord = static_cast<CCDIAPRecord *>
-                            (CCDRecordBase::RecordFactoryL(KCDTIdIAPRecord));
-
-    CleanupStack::PushL( iapRecord );
-    iapRecord->SetRecordId( aIapId );
-
-    TRAPD( err, iapRecord->LoadL( Session() ));
-
-    if( !err )
-        {
-        CanHandleIapIdL( iapRecord );
-        }
-
-    CleanupStack::PopAndDestroy( iapRecord );
-    return retVal;
-    }
-
-// --------------------------------------------------------------------------
-// CCmPluginTUNDriver::CanHandleIapIdL()
-// --------------------------------------------------------------------------
-//
-TBool CCmPluginTUNDriver::CanHandleIapIdL( CCDIAPRecord *aIapRecord ) const
-    {
-    LOGGER_ENTERFN( "CCmPluginTUNDriver::CanHandleIapIdL" );
-
-    TBool retVal( EFalse );
-
-    if( TPtrC( aIapRecord->iServiceType ) == TPtrC(KCDTypeNameLANService) &&
-        TPtrC( aIapRecord->iBearerType ) == TPtrC(KCDTypeNameVirtualBearer) )
-        {
-        CMDBRecordSet<CCDVirtualBearerRecord>* bearersRS = 
-            new ( ELeave ) CMDBRecordSet<CCDVirtualBearerRecord>(KCDTIdVirtualBearerRecord);
-        CleanupStack::PushL( bearersRS );
-        CCDVirtualBearerRecord* bearerRecord =
-            static_cast<CCDVirtualBearerRecord *>( CCDRecordBase::RecordFactoryL( KCDTIdVirtualBearerRecord ) );
-        CleanupStack::PushL( bearerRecord );
-
-        // Find entries used "tundriveragt.agt" as agent from Table VirtualBearer
-        bearerRecord->iBearerAgent.SetL( KTUNDriverTunnelAgent );
-        bearerRecord->iVirtualBearerNifName.SetL( KTUNDriverInterfaceName );
-        bearersRS->iRecords.AppendL( bearerRecord );
-
-        CleanupStack::Pop( bearerRecord );
-        bearerRecord = NULL;
-        if ( bearersRS->FindL( Session() ) )
-            {
-            TUint32 recordId = (*bearersRS)[0]->RecordId();
-            TPtrC bearerName( (*bearersRS)[0]->iRecordName.GetL() );
-            TPtrC bearerAgent( (*bearersRS)[0]->iBearerAgent.GetL() );
-            TPtrC bearerInterface( (*bearersRS)[0]->iVirtualBearerNifName.GetL() );
-
-            // Further comparing record ID referred to by this VPN IAP with entry ID in table VirtualBearer
-            // And also comparing bear name with our expected one "vpnbearer"
-            if ( bearerAgent == TPtrC( KCDAgentNameTUNDriver ) &&
-                 bearerInterface == TPtrC( KCDInterfaceNameTUNDriver ) )
-                {
-                retVal = ETrue;
-                }
-            }
-
-        CleanupStack::PopAndDestroy( bearersRS );
-        }
-    return retVal;
-    }
-
-// --------------------------------------------------------------------------
-// CCmPluginTUNDriver::RunSettingsL()
-// --------------------------------------------------------------------------
-//        
-TInt CCmPluginTUNDriver::RunSettingsL()
-    {
-    LOGGER_ENTERFN( "CCmPluginTUNDriver::RunSettingsL" );
-    User::Leave( KErrNotSupported );
-    return KErrNotSupported;
-    }
-
-// --------------------------------------------------------------------------
-// CCmPluginTUNDriver::LoadServiceSettingL()
-// --------------------------------------------------------------------------
-//        
-void CCmPluginTUNDriver::LoadServiceSettingL()
-    {
-    LOGGER_ENTERFN( "CCmPluginTUNDriver::LoadServiceSettingL" );
-    
-    if( TPtrC(KCDTypeNameLANService) == iIapRecord->iServiceType )
-        {
-        iServiceRecord = static_cast<CCDLANServiceRecord *>
-                    ( CCDRecordBase::RecordFactoryL( KCDTIdLANServiceRecord ) );
-        }
-    else
-        {
-        User::Leave( KErrNotSupported );
-        }
-
-    CCmPluginBaseEng::LoadServiceSettingL();
-    }
-
-// --------------------------------------------------------------------------
-// CCmPluginTUNDriver::InitializeWithUiL()
-// --------------------------------------------------------------------------
-//   
-TBool CCmPluginTUNDriver::InitializeWithUiL( TBool /*aManuallyConfigure*/ )
-    {
-    User::Leave( KErrNotSupported );
-    return ETrue;
-    }
-
-// --------------------------------------------------------------------------
-// CCmPluginTUNDriver::ServiceRecord()
-// --------------------------------------------------------------------------
-//  
-CCDLANServiceRecord& CCmPluginTUNDriver::ServiceRecord() const
-    {
-    LOGGER_ENTERFN( "CCmPluginTUNDriver::ServiceRecord" );
-    return *static_cast<CCDLANServiceRecord*>( iServiceRecord );
-    }
-
-// --------------------------------------------------------------------------
-// CCmPluginTUNDriver::CreateNewServiceRecordL()
-// --------------------------------------------------------------------------
-//        
-void CCmPluginTUNDriver::CreateNewServiceRecordL()
-    {
-    LOGGER_ENTERFN( "CCmPluginTUNDriver::CreateNewServiceRecordL" );
-
-    delete iServiceRecord; 
-    iServiceRecord = NULL;
-
-    iServiceRecord = static_cast<CCDServiceRecordBase *>
-                (CCDRecordBase::RecordFactoryL( KCDTIdLANServiceRecord ));
-
-    // I do not think that we have to use the default record,
-    // but for compatibility with ApEngine, we write all fields 
-    CCDLANServiceRecord* record = 
-                            static_cast<CCDLANServiceRecord *>( iServiceRecord );
-
-    if ( FeatureSupported( KFeatureIdIPv6 ) )
-        {
-        record->iIfNetworks.SetL( KDefIspIfNetworksIPv4IPv6LAN );
-        }
-    else
-        {
-        record->iIfNetworks.SetL( KDefIspIfNetworksIPv4 );
-        }
-    record->iIpGateway.SetL( KUnspecifiedIPv4 );        
-    record->iIpAddrFromServer.SetL( KDefIpAddrFromServer );
-
-    record->iIpAddr.SetL( KUnspecifiedIPv4 );
-
-    record->iIpDnsAddrFromServer.SetL( KDefIpDnsAddrFromServer );
-
-    record->iIpNameServer1.SetL( KUnspecifiedIPv4 );
-    record->iIpNameServer2.SetL( KUnspecifiedIPv4 );
-    record->iIp6DnsAddrFromServer.SetL( KDefIp6DnsAddrFromServer );
-    record->iIp6NameServer1.SetL( KDynamicIpv6Address );
-    record->iIp6NameServer2.SetL( KDynamicIpv6Address );
-
-    if ( KDefIpAddrFromServer )
-        {
-        record->iConfigDaemonManagerName.SetL( KDaemonManagerName );
-        record->iConfigDaemonName.SetL( KConfigDaemonName );
-        }
-    else
-        {
-        record->iConfigDaemonManagerName.SetL( KEmpty );
-        record->iConfigDaemonName.SetL( KEmpty );
-        }
-    }
-
-// ---------------------------------------------------------------------------
-// CCmPluginTUNDriver::ServiceRecordIdLC
-// ---------------------------------------------------------------------------
-//
-void CCmPluginTUNDriver::ServiceRecordIdLC( HBufC* &aName, TUint32& aRecordId )
-    {
-    LOGGER_ENTERFN( "CCmPluginTUNDriver::ServiceRecordIdLC" );
-
-    aName = TPtrC( KCDTypeNameLANService ).AllocLC();    
-    aRecordId = iServiceRecord->RecordId();
-    }
-
-// --------------------------------------------------------------------------
-// CCmPluginTUNDriver::BearerRecordIdLC()
-// --------------------------------------------------------------------------
-//      
-void CCmPluginTUNDriver::BearerRecordIdLC( HBufC* &aBearerName, TUint32& aRecordId )
-    {
-    LOGGER_ENTERFN( "CCmPluginTUNDriver::BearerRecordIdLC" );
-
-    CMDBRecordSet<CCDVirtualBearerRecord>* bearersRS = 
-                  new(ELeave) CMDBRecordSet<CCDVirtualBearerRecord>
-                                                       (KCDTIdVirtualBearerRecord);
-    CleanupStack::PushL( bearersRS );
-
-    CCDVirtualBearerRecord* tmprec = static_cast<CCDVirtualBearerRecord*>
-                        (CCDRecordBase::RecordFactoryL( KCDTIdVirtualBearerRecord ));
-    CleanupStack::PushL( tmprec );
-    tmprec->iBearerAgent.SetL( KTUNDriverTunnelAgent );
-    bearersRS->iRecords.AppendL( tmprec );
-
-    CleanupStack::Pop( tmprec );
-    tmprec = NULL;
-
-    if ( !bearersRS->FindL( Session() ) )
-        // No bearer record found -> create a default one.
-        {
-        tmprec = static_cast<CCDVirtualBearerRecord *>
-                    (CCDRecordBase::RecordFactoryL(KCDTIdVirtualBearerRecord));
-        CleanupStack::PushL(tmprec);
-
-        tmprec->iRecordName.SetL( KTUNDriverBearerName );
-        tmprec->iBearerAgent.SetL( KTUNDriverTunnelAgent );
-        tmprec->iVirtualBearerNifName.SetL(KTUNDriverInterfaceName);
-        tmprec->iLastSocketActivityTimeout = (TUint32)KLanLastSocketActivityTimeout;
-        tmprec->iLastSessionClosedTimeout = (TUint32) KLanLastSocketClosedTimeout;
-        tmprec->iLastSocketClosedTimeout = (TUint32)KLanLastSocketActivityTimeout;
-        
-        tmprec->SetRecordId( KCDNewRecordRequest );
-        tmprec->StoreL( Session() );
-        
-        aRecordId = tmprec->RecordId();
-
-        CleanupStack::PopAndDestroy(tmprec);
-        }
-    else
-        {
-        aRecordId = (*bearersRS)[0]->RecordId();
-        }
-
-    CleanupStack::PopAndDestroy( bearersRS );
-
-    aBearerName = TPtrC( KCDTypeNameVirtualBearer ).AllocLC();
-    }
-
-// --------------------------------------------------------------------------
-// CCmPluginTUNDriver::PrepareToUpdateRecordsL()
-// --------------------------------------------------------------------------
-//        
-void CCmPluginTUNDriver::PrepareToUpdateRecordsL()
-    {
-    LOGGER_ENTERFN( "CCmPluginTUNDriver::PrepareToUpdateRecordsL" );
-    CheckDNSServerAddressL( ETrue, 
-                            ServiceRecord().iIp6NameServer1,
-                            ServiceRecord().iIp6NameServer2,
-                            ServiceRecord().iIp6DnsAddrFromServer );
-                            
-    CheckDNSServerAddressL( EFalse,
-                            ServiceRecord().iIpNameServer1,
-                            ServiceRecord().iIpNameServer2,
-                            ServiceRecord().iIpDnsAddrFromServer );
-    }
-
-// --------------------------------------------------------------------------
-// CCmPluginTUNDriver::AdditionalReset()
-// --------------------------------------------------------------------------
-//        
-void CCmPluginTUNDriver::AdditionalReset()
-    {
-
-    }
-
-// eof
--- a/cmmanager/cmmgr/Rom/cmplugintundriver.iby	Wed Sep 15 12:38:40 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef __CMPLUGINTUNDRIVER_IBY__
-#define __CMPLUGINTUNDRIVER_IBY__
-
-
-ECOM_PLUGIN(cmplugintundriver.dll,20027F3E.rsc)
-SCALABLE_IMAGE(APP_BITMAP_DIR,APP_BITMAP_DIR,cmplugintundriver)
-
-
-#endif
--- a/cmmanager/cmmgr/Rom/cmplugintundriverresources.iby	Wed Sep 15 12:38:40 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef __CMPLUGINTUNDRIVER_RESOURCES_IBY__
-#define __CMPLUGINTUNDRIVER_RESOURCES_IBY__
-
-
-data = DATAZ_\RESOURCE_FILES_DIR\cmplugintundriverui.rsc     RESOURCE_FILES_DIR\cmplugintundriverui.rsc
-
-#
-#endif
\ No newline at end of file
--- a/cmmanager/cmmgr/group/bld.inf	Wed Sep 15 12:38:40 2010 +0300
+++ b/cmmanager/cmmgr/group/bld.inf	Wed Oct 13 14:59:48 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). 
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -35,9 +35,6 @@
 ../Rom/cmpluginvpn.iby				CORE_MW_LAYER_IBY_EXPORT_PATH(cmpluginvpn.iby)
 ../Rom/cmpluginvpnresources.iby			LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(cmpluginvpnresources.iby)
 
-../Rom/cmplugintundriver.iby				CORE_MW_LAYER_IBY_EXPORT_PATH(cmplugintundriver.iby)
-../Rom/cmplugintundriverresources.iby			LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(cmplugintundriverresources.iby)
-
 ../Rom/cmpluginwlan.iby				CORE_MW_LAYER_IBY_EXPORT_PATH(cmpluginwlan.iby)
 ../Rom/cmpluginwlanresources.iby		LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(cmpluginwlanresources.iby)
 
--- a/connectionmonitoring/connectionmonitorui/inc/ConnectionInfoBase.h	Wed Sep 15 12:38:40 2010 +0300
+++ b/connectionmonitoring/connectionmonitorui/inc/ConnectionInfoBase.h	Wed Oct 13 14:59:48 2010 +0300
@@ -391,19 +391,6 @@
         */
         void InitializeConnectionInfoL();
 
-        /**
-         * Compare the provided UID array with the current cached UID array
-         * iClientBuf.
-         * @param aClients New array of UIDs.
-         * @return ETrue if the contents are the same, EFalse otherwise.
-         */
-        TBool IsTheSameUids( TConnMonClientEnumBuf& aClients );
-
-        /**
-         * Copy the provided UIDs into the cached UID array.
-         * @param aClients New array of UIDs.
-         */
-        void CopyUidsToBuf( TConnMonClientEnumBuf& aClients );
 
     protected:
         
@@ -491,13 +478,6 @@
         * The active object for info. refreshing. NOT Owned.
         */
         CActiveWrapper*                     iActiveWrapper;
-
-        /**
-         * Buffer to cache a connection's client application UIDs.
-         * These are kept in cache so application names are resolved only when
-         * the client list has changed.
-         */
-        TConnMonClientEnumBuf               iClientBuf;
     };
 
 
--- a/connectionmonitoring/connectionmonitorui/src/ConnectionInfoBase.cpp	Wed Sep 15 12:38:40 2010 +0300
+++ b/connectionmonitoring/connectionmonitorui/src/ConnectionInfoBase.cpp	Wed Oct 13 14:59:48 2010 +0300
@@ -34,11 +34,7 @@
 
 const TUint KUpArrowChar = 0x2191; ///< ASCII code of UpArrow
 const TUint KDownArrowChar = 0x2193; ///< ASCII code of DownArrow
-
-#ifndef _DEBUG
-const TUint KHiddenDhcpServerUid = 0x101fd9c5; ///< Hidden DHCP server UID (dhcpserv.exe)
-const TUint KHiddenDnsServerUid = 0x10000882; ///< Hidden DNS server UID (dnd.exe)
-#endif
+const TUint KBannedServerUID = 0x101fd9c5; // Banned DHCP server UID
 
 const TInt KFeedsServerUid         = 0x1020728E;
 const TInt KDownloadMgrServerUid   = 0x10008D60;
@@ -86,7 +82,6 @@
     iConnectionStatus = EConnectionUninitialized;
     iConnectionId = aConnectionId;
     iConnectionBearerType = aConnectionBearerType;
-    iClientBuf().iCount = 0;
     CMUILOGGER_WRITE( "CConnectionInfoBase constuctor - end " );
     }
 
@@ -497,291 +492,160 @@
 TInt CConnectionInfoBase::RefreshAppNamesL()
     {
     CMUILOGGER_ENTERFN( "CConnectionInfoBase::RefreshAppNamesL" );
-
+    
     TInt sharings( 0 );
-
-    if ( IsAlive() )
+    
+if ( IsAlive() )
+    {
+    if ( iAppNames )
         {
-        if ( iAppNames )
+        iAppNames->Reset();
+        HBufC* actAppName = NULL;
+        // Check whether it is an internal or external (modem) connection
+        // External (modem) connections does not need application name
+        if ( iConnectionBearerType < EBearerExternalCSD )
             {
-            // Check whether it is an internal or external (modem) connection
-            // External (modem) connections does not need application name
-            if ( iConnectionBearerType >= EBearerExternalCSD )
+            TInt count( 0 );
+            TConnMonClientEnumBuf clientBuf;
+            iActiveWrapper->StartGetConnSharings( iConnectionId,
+                                                  iConnectionMonitor,
+                                                  clientBuf );
+            
+            TInt err( iActiveWrapper->iStatus.Int() );
+            CMUILOGGER_WRITE_F( "RefreshSharings status: %d", err );
+            
+            if ( !err )
                 {
-                CMUILOGGER_WRITE( "External (modem) connections does not need application name" );
-                return sharings;
+                count = clientBuf().iCount;
                 }
-            else
+                
+            CMUILOGGER_WRITE_F( "clientBuf().iCount: %d", count );
+                
+#ifndef __WINS__ // Appl. uid is always zero in emulator
+
+            RApaLsSession appSess;
+            TApaAppInfo appInfo;
+
+            // The connection could be shared by several applications
+            User::LeaveIfError( appSess.Connect() );
+                    
+            TUint i;
+            for ( i = 0; i < count; i++ )
                 {
-                TInt count( 0 );
-                TConnMonClientEnumBuf clientBuf;
-                iActiveWrapper->StartGetConnSharings( iConnectionId,
-                                                      iConnectionMonitor,
-                                                      clientBuf );
+                actAppName = NULL;
+                appInfo.iCaption.Zero();
+
+                TInt result = appSess.GetAppInfo( appInfo, 
+                                                  clientBuf().iUid[i] );
 
-                TInt err( iActiveWrapper->iStatus.Int() );
-                CMUILOGGER_WRITE_F( "RefreshSharings status: %d", err );
-
-                if ( !err )
+                //================================
+                CMUILOGGER_WRITE_F( "result: %d", result ); 
+                CMUILOGGER_WRITE_F( "iClientInfo.iUid[i].iUid: %x", 
+                                    clientBuf().iUid[i].iUid );
+                
+                if ( result != KErrNone )
                     {
-                    count = clientBuf().iCount;
-                    }
-                CMUILOGGER_WRITE_F( "clientBuf().iCount: %d", count );
+                    TInt resId = 0;
+                    switch ( clientBuf().iUid[i].iUid )
+                        {
+                        case KMessagingServerUid: // Messaging
+                            {
+                            resId = R_QTN_CMON_SHARING_APP_MSG_SERVER;
+                            break;
+                            }
+                        case KDownloadMgrServerUid: // Downloads
+                            {
+                            resId = R_QTN_CMON_SHARING_APP_DL_MG;
+                            break;
+                            }
+                        case KFeedsServerUid: // Web Feeds
+                            {
+                            resId = R_QTN_CMON_SHARING_APP_RSS_SERVER;
+                            break;
+                            }
+                        case KJavaVMUid: // Application
+                            {
+                            resId = R_QTN_CMON_SHARING_APP_JAVA_MIDLET;
+                            break;
+                            }
+                        case KBannedServerUID:
+                            {   // Forget about DHCP server!
+                            break;
+                            }
+                        case KSUPLServerUid:
+                            {
+                            resId = R_QTN_CMON_SHARING_APP_SUPL;
+                            break;
+                            }
+                        default: // (unknown)
+                            {
+                            resId = R_QTN_CMON_SHARING_APP_UNKNOWN;
+                            break;
+                            }
+                        }
 
-                if ( IsTheSameUids( clientBuf ) )
-                    {
-                    // Same client list, use cached application names.
-                    CMUILOGGER_WRITE( "Client list unchanged, use cached names" );
-                    CMUILOGGER_WRITE_F( "sharings: %d", iAppNames->Count() );
-                    return iAppNames->Count();
+                    if ( resId )
+                        {
+                        actAppName = StringLoader::LoadL( resId );
+                        }
                     }
                 else
                     {
-                    CMUILOGGER_WRITE( "Client list changed, update names" );
-                    CopyUidsToBuf ( clientBuf );
+                    actAppName =  HBufC::NewL( appInfo.iCaption.Length() );
+                    TPtr actAppNameBuf = actAppName->Des();
+                    actAppNameBuf.Append( appInfo.iCaption );
                     }
 
-                iAppNames->Reset();
-                HBufC* actAppName = NULL;
-
-#ifndef __WINS__ // Appl. uid is always zero in emulator
-
-                RApaLsSession appSess;
-                TApaAppInfo appInfo;
-
-                // The connection could be shared by several applications
-                User::LeaveIfError( appSess.Connect() );
-
-                TUint i;
-                for ( i = 0; i < count; i++ )
+                if ( actAppName )
                     {
-                    actAppName = NULL;
-                    appInfo.iCaption.Zero();
-
-                    TInt result = appSess.GetAppInfo( appInfo,
-                            clientBuf().iUid[i] );
-
-                    //================================
-                    CMUILOGGER_WRITE_F( "result: %d", result );
-                    CMUILOGGER_WRITE_F( "iClientInfo.iUid[i].iUid: %x",
-                            clientBuf().iUid[i].iUid );
-
-                    if ( result != KErrNone )
-                        {
-                        TInt resId = 0;
-                        switch ( clientBuf().iUid[i].iUid )
-                            {
-                            case KMessagingServerUid: // Messaging
-                                {
-                                resId = R_QTN_CMON_SHARING_APP_MSG_SERVER;
-                                break;
-                                }
-                            case KDownloadMgrServerUid: // Downloads
-                                {
-                                resId = R_QTN_CMON_SHARING_APP_DL_MG;
-                                break;
-                                }
-                            case KFeedsServerUid: // Web Feeds
-                                {
-                                resId = R_QTN_CMON_SHARING_APP_RSS_SERVER;
-                                break;
-                                }
-                            case KJavaVMUid: // Application
-                                {
-                                resId = R_QTN_CMON_SHARING_APP_JAVA_MIDLET;
-                                break;
-                                }
-#ifndef _DEBUG
-                            // Hide DHCP & DNS from UI in release build.
-                            case KHiddenDhcpServerUid:
-                            case KHiddenDnsServerUid:
-                                {
-                                break;
-                                }
-#endif
-                            case KSUPLServerUid:
-                                {
-                                resId = R_QTN_CMON_SHARING_APP_SUPL;
-                                break;
-                                }
-                            default: // (unknown)
-                                {
-                                resId = R_QTN_CMON_SHARING_APP_UNKNOWN;
-                                break;
-                                }
-                            }
-
-                        if ( resId && resId != R_QTN_CMON_SHARING_APP_UNKNOWN  )
-                            {
-                            actAppName = StringLoader::LoadL( resId );
-                            }
-                        else if ( resId ) // Try to find application process name from system.
-                            {
-                            TFileName name;
-                            TFindProcess find;
-                            TBool name_solved( EFalse );
-                            while ( find.Next( name ) == KErrNone )
-                                {
-                                RProcess ph;
-                                TInt err2( KErrNone );
-                                err2 = ph.Open( name );
-
-                                if ( err2 )
-                                    {
-                                    ph.Close();
-                                    }
-                                else
-                                    {
-                                    TUidType procUid = ph.Type();
-                                    ph.Close();
-
-                                    // There are three UIDs in procUid. The last one is the second
-                                    // UID defined in MMP file and clientBuf().iUid[i].iUid is also
-                                    // the same kind of UID. So, we only need to compare them to
-                                    // find application name.
-                                    if ( procUid[2].iUid == clientBuf().iUid[i].iUid )
-                                        {
-                                        // Name is in format "app_name[uid]001", so cut rest of
-                                        // string starting from "[".
-                                        TInt index = name.LocateReverse('[');
-                                        if ( index >= 1 )
-                                            {
-                                            name.SetLength( index );
-                                            }
-
-                                        actAppName = HBufC::NewL( name.Length() );
-                                        TPtr actAppNameBuf = actAppName->Des();
-                                        actAppNameBuf.Append( name );
-
-#ifdef _DEBUG
-                                        CMUILOGGER_WRITE( "--------------------" );
-                                        CMUILOGGER_WRITE( " Application is Found:" );
-                                        CMUILOGGER_WRITE_F( "Client Uid: %x", clientBuf().iUid[i].iUid );
-                                        CMUILOGGER_WRITE_F( "Proc Uid: %x", procUid[2].iUid );
-                                        CMUILOGGER_WRITE_F( "App Name: %S", &name);
-                                        CMUILOGGER_WRITE( "--------------------" );
-#endif
-
-                                        name_solved = ETrue;
-                                        break;
-                                        }
-                                    }
-                                }
-
-                            if ( !name_solved )
-                                {
-                                actAppName = StringLoader::LoadL( R_QTN_CMON_SHARING_APP_UNKNOWN );
-                                }
-                            }
-                        }
-                    else
-                        {
-                        actAppName = HBufC::NewL( appInfo.iCaption.Length() );
-                        TPtr actAppNameBuf = actAppName->Des();
-                        actAppNameBuf.Append( appInfo.iCaption );
-                        }
-
-                    if ( actAppName )
-                        {
-                        iAppNames->AppendL( actAppName->Des() );
-                        delete actAppName;
-                        }
+                    iAppNames->AppendL( actAppName->Des() );        
+                    delete actAppName;
                     }
+                }
 
                 iAppNames->Sort();
                 appSess.Close();
 #else
-                TInt countBan( 0 );
-
-#ifndef _DEBUG
-                if ( !err )
-                    {
-                    // Remove DHCP and DNS from the client list. 
-                    for ( TUint tmp = 0; tmp < count; tmp++ )
-                        {
-                        TUid uid = clientBuf().iUid[tmp];
+            TInt countBan( 0 );
 
-                        if ( uid.iUid == KHiddenDhcpServerUid || uid.iUid == KHiddenDnsServerUid )
-                            {
-                            countBan++;
-                            }
+            if ( !err )
+                {
+                // remove the DHCP server is not actually 
+                // an owner of the connection
+                for ( TUint tmp = 0; tmp < count; ++tmp )
+                    {
+                    TUid uid = clientBuf().iUid[tmp];
+            
+                    if ( uid.iUid == KBannedServerUID )
+                        {
+                        ++countBan;
                         }
-                    }
-#endif
+                    } // end
+                }
 
-                _LIT( KStrApplication, "Application" );
-                // Give a dummy name for all applications.
-                for ( TInt i = 0; i < ( count - countBan ); i++ )
-                    {
-                    iAppNames->AppendL( KStrApplication );
-                    }
+            _LIT( KStrApplication, "Application" );
+            // Give a dummy name of the application
+            for ( TInt i = 0; i < ( count - countBan ); i++ )
+                {
+                iAppNames->AppendL( KStrApplication );
+                }
 
 #endif // __WINS__
-                } // End of else in if ( iConnectionBearerType > EBearerExternalCSD )
-            sharings = iAppNames->Count();
-            CMUILOGGER_WRITE_F( "sharings: %d", sharings );
-            } // End of if ( iAppNames )
-        } // End of if ( IsAlive() )
 
+            }
+        /* modem connections does not need application name
+        else 
+            {
+            }
+        */
+        sharings = iAppNames->Count();
+        }
+    }
+        
     CMUILOGGER_LEAVEFN( "CConnectionInfoBase::RefreshAppNamesL" );
     return sharings;
     }
 
-// ---------------------------------------------------------
-// CConnectionInfoBase::IsTheSameUids
-// ---------------------------------------------------------
-//
-TBool CConnectionInfoBase::IsTheSameUids( TConnMonClientEnumBuf& aClients )
-    {
-    TBool ret( EFalse );
-
-    if ( iClientBuf().iCount != aClients().iCount )
-        {
-        return ret;
-        }
-    else
-        {
-        TInt count = aClients().iCount;
-        for ( TInt i = 0; i < count; i++ )
-            {
-            // Is the current value inside aClients found from iClientBuf.
-            TBool found( EFalse );
-            for ( TInt j = 0; j < count; j++ )
-                {
-                if ( aClients().iUid[i].iUid == iClientBuf().iUid[j].iUid )
-                    {
-                    found = ETrue;
-                    break;
-                    }
-                }
-
-            if ( !found )
-                {
-                return ret;
-                }
-            }
-
-        // If we reach this point, aClients contents are identical with iClientBuf.
-        ret = ETrue;
-        }
-
-    return ret;
-    }
-
-// ---------------------------------------------------------
-// CConnectionInfoBase::CopyUidsToBuf
-// ---------------------------------------------------------
-//
-void CConnectionInfoBase::CopyUidsToBuf( TConnMonClientEnumBuf& aClients )
-    {
-    TInt count = aClients().iCount;
-
-    for ( TInt i = 0; i < count; i++ )
-        {
-        iClientBuf().iUid[i].iUid = aClients().iUid[i].iUid;
-        }
-    iClientBuf().iCount = count;
-    }
 
 // ---------------------------------------------------------
 // CConnectionInfoBase::ToDetailsListBoxItemTextL
--- a/connectionmonitoring/connectionmonitorui/src/CsdConnectionInfo.cpp	Wed Sep 15 12:38:40 2010 +0300
+++ b/connectionmonitoring/connectionmonitorui/src/CsdConnectionInfo.cpp	Wed Oct 13 14:59:48 2010 +0300
@@ -301,7 +301,7 @@
 
             TInt sharing = RefreshAppNamesL();
 
-            if ( sharing >= 1 )
+            if ( sharing > 1 )
                 {
                 if ( iDetailsArray->Count() > 10 )
                     {
@@ -416,7 +416,7 @@
         {
         TInt sharing = RefreshAppNamesL();
         
-        if ( sharing >= 1 )
+        if ( sharing > 1 )
             {
             for ( TInt i = 0; i < sharing; i++ )
                 {
--- a/connectionmonitoring/connectionmonitorui/src/EasyWLANConnectionInfo.cpp	Wed Sep 15 12:38:40 2010 +0300
+++ b/connectionmonitoring/connectionmonitorui/src/EasyWLANConnectionInfo.cpp	Wed Oct 13 14:59:48 2010 +0300
@@ -210,7 +210,7 @@
 
     TInt sharing = RefreshAppNamesL();
         
-    if ( sharing >= 1 )
+    if ( sharing > 1 )
         {
         for ( TInt i = 0; i < ( sharing ); i++ )
             {
@@ -296,7 +296,7 @@
 
     TInt sharing = RefreshAppNamesL();
 
-    if ( sharing >= 1 )
+    if ( sharing > 1 )
         {
         if ( count >= realElementsMaxCount )
             {  
--- a/connectionmonitoring/connectionmonitorui/src/GprsConnectionInfo.cpp	Wed Sep 15 12:38:40 2010 +0300
+++ b/connectionmonitoring/connectionmonitorui/src/GprsConnectionInfo.cpp	Wed Oct 13 14:59:48 2010 +0300
@@ -302,7 +302,7 @@
             {
             TInt sharing = RefreshAppNamesL();
                 
-            if ( sharing >= 1 )
+            if ( sharing > 1 )
                 {
                 if ( iDetailsArray->Count() > 10 )
                     {                
@@ -399,7 +399,7 @@
         {
         TInt sharing = RefreshAppNamesL();
 
-        if ( sharing >= 1 )
+        if ( sharing > 1 )
             {
             for ( TInt i = 0; i < sharing; i++ )
                 {
--- a/connectionmonitoring/connectionmonitorui/src/WlanConnectionInfo.cpp	Wed Sep 15 12:38:40 2010 +0300
+++ b/connectionmonitoring/connectionmonitorui/src/WlanConnectionInfo.cpp	Wed Oct 13 14:59:48 2010 +0300
@@ -685,7 +685,7 @@
                                  
     TInt sharing = RefreshAppNamesL();
 
-    if ( sharing >= 1 )
+    if ( sharing > 1 )
         {
         for ( TInt i = 0; i < sharing; i++ )
             {
@@ -776,7 +776,7 @@
     
     TInt sharing = RefreshAppNamesL();
 
-    if ( sharing >= 1 )
+    if ( sharing > 1 )
         {
         if ( count >= realElementsMaxCount ) // 15
             {  
Binary file data/cccccc00_emulator.cre has changed
--- a/inc/meshpreface1.cfg	Wed Sep 15 12:38:40 2010 +0300
+++ b/inc/meshpreface1.cfg	Wed Oct 13 14:59:48 2010 +0300
@@ -272,13 +272,6 @@
 	FIELD_COUNT=2
 END_ADD
 
-ADD_SECTION
-# COMMDB_ID = 14
-	Name=tundrivermcpr
-	MCprUid=0x10281E05
-	FIELD_COUNT=2
-END_ADD
-
 ############################################################
 ## CprTable
 ## 
@@ -325,14 +318,6 @@
 	FIELD_COUNT=2
 END_ADD
 
-ADD_SECTION
-# COMMDB_ID = 7
-	Name=pdpcpr
-	CprUid=0x102822E2
-	FIELD_COUNT=2
-END_ADD
-
-
 ############################################################
 ## SCprTable
 ## 
@@ -474,13 +459,6 @@
 	FIELD_COUNT=2
 END_ADD
 
-ADD_SECTION
-# COMMDB_ID = 12
-	Name=tundriverprotocol
-	ProtocolUid=0x10281C3C
-	FIELD_COUNT=2
-END_ADD
-
 ############################################################
 ## BearerTypeTable
 ## 
@@ -567,7 +545,7 @@
 	Name=spud-ppp
 	Tier=Link.TierTable.271064565
 	MCpr=MCprTable.10
-	Cpr=CprTable.7
+	Cpr=CprTable.3
 	SCpr=SCprTable.4
 	Protocol=ProtocolTable.3
 	FIELD_COUNT=6
@@ -578,7 +556,7 @@
 	Name=spud-rawip
 	Tier=Link.TierTable.271064565
 	MCpr=MCprTable.10
-	Cpr=CprTable.7
+	Cpr=CprTable.3
 	SCpr=SCprTable.4
 	Protocol=ProtocolTable.5
 	FIELD_COUNT=6
@@ -624,14 +602,3 @@
 	FIELD_COUNT=6
 END_ADD
 
-ADD_SECTION
-# COMMDB_ID = 13
-	Name=tundriver
-	Tier=Link.TierTable.271064565
-	MCpr=MCprTable.14
-	Cpr=CprTable.3
-	SCpr=SCprTable.3
-	Protocol=ProtocolTable.12
-	FIELD_COUNT=6
-END_ADD
-
--- a/ipcm_plat/extended_connection_settings_api/inc/cmsettingsui.h	Wed Sep 15 12:38:40 2010 +0300
+++ b/ipcm_plat/extended_connection_settings_api/inc/cmsettingsui.h	Wed Oct 13 14:59:48 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -66,23 +66,6 @@
         */
         IMPORT_C TBool SelectDestinationDlgL( TUint32& aDestinationId );
 
-        /**
-        * Launches the dialog for adding connection methods
-        * @since 3.2.3
-        * @param  aDestUid destination id for the new cm
-        * @param  aBearerType bearer type for the new cm
-        * @return TUint32 id of the new cm
-        */
-        IMPORT_C TUint32 AddCmL( TUint32& aDestUid, TUint32 aBearerType );
-
-        /**
-        * Launches the dialog for editing connection methods
-        * @since 3.2.3
-        * @param  aCmId id of the cm to edit
-        * @return TResult - the softkey the user exited with.
-        *                   EBack in case editing is forbidden.
-        */
-        IMPORT_C TResult EditCmL( TUint32 aCmId );        
     private:
 
         /** First stage constructor */
--- a/ipcm_pub/connection_settings_api/group/bld.inf	Wed Sep 15 12:38:40 2010 +0300
+++ b/ipcm_pub/connection_settings_api/group/bld.inf	Wed Oct 13 14:59:48 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -12,7 +12,7 @@
 * Contributors:
 *
 * Description:  File that exports the files belonging to 
-*               Connection Settings API
+:                Connection Settings API
 *
 */
 
@@ -41,4 +41,3 @@
 ../inc/cmmanager.h     MW_LAYER_PUBLIC_EXPORT_PATH(cmmanager.h)
 ../inc/cmsettingsui.h     MW_LAYER_PUBLIC_EXPORT_PATH(cmsettingsui.h)
 ../inc/cmgenconnsettings.h     MW_LAYER_PUBLIC_EXPORT_PATH(cmgenconnsettings.h)
-../inc/cmplugintundriverdef.h     MW_LAYER_PUBLIC_EXPORT_PATH(cmplugintundriverdef.h)
--- a/ipcm_pub/connection_settings_api/inc/cmplugintundriverdef.h	Wed Sep 15 12:38:40 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,148 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Attributes for TUN Driver plug-in.
-*
-*/
-
-
-#ifndef CMPLUGINTUNDRIVER_DEF_H
-#define CMPLUGINTUNDRIVER_DEF_H
-
-#include <cmconnectionmethoddef.h>
-const TUint KPluginTUNDriverBearerTypeUid = 0x20027F3F;
-
-namespace CMManager
-    {
-    /** LAN specific connection method attributes */
-    enum TConnectionMethodTUNDriverSpecificAttributes
-        {
-		ETUNDriverSpecificAttributes = 20000,
-        
-        /**
-        * Comma separated list of network protocols, e.g. "PPP".
-        * ( String - default: None)
-        */
-        ETUNDriverIfNetworks = KLanBaseIfNetworks,
-        
-        /**
-        * IP net mask of interface.
-        * ( String - default: None)
-        */        
-        ETUNDriverIpNetMask,
-
-        /**
-        * IP address of gateway
-        * ( String - default: None)
-        */
-        ETUNDriverIpGateway,
-
-        /**
-        * Get IP addresses (for EPOC) from server?
-        * ( TBool - default: None)
-        */
-        ETUNDriverIpAddrFromServer,
-
-        /**
-        * IP address of EPOC.
-        * ( String - default: None)
-        */
-        ETUNDriverIpAddr,
-
-        /**
-        * Get DNS addresses from server?
-        * ( TBool - default: None)
-        */
-        ETUNDriverIpDNSAddrFromServer,
-
-        /**
-        * IP Address of primary name server.
-        * ( String - default: None)
-        */
-        ETUNDriverIpNameServer1,
-
-        /**
-        * IP Address of secondary name server.
-        * ( String - default: None)
-        */
-        ETUNDriverIpNameServer2,
-
-        /**
-        * Get IP6 DNS addresses from server?
-        * ( TBool - default: None)
-        */
-        ETUNDriverIp6DNSAddrFromServer,
-
-        /**
-        * IP6 Address of primary name server.
-        * ( String - default: None)
-        */
-        ETUNDriverIp6NameServer1,
-
-        /**
-        * IP6 Address of secondary name server.
-        * ( String - default: None)
-        */
-        ETUNDriverIp6NameServer2,
-
-        /**
-        * IP address valid from this time, used to store 
-        * dynamically assigned address lease info.
-        * ( String - default: None)
-        */
-        ETUNDriverIpAddrLeaseValidFrom,
-
-        /**
-        * IP address valid for use until this time, used to store .
-        * dynamically assigned address lease info.
-        * ( String - default: None)
-        */
-        ETUNDriverIpAddrLeaseValidTo,
-
-        /**
-        * Name of the ECOM configuration daemon manager component. 
-        * This component interfaces with the server identified in 
-        * ISP_CONFIG_DAEMON_NAME. If specified, ISP_CONFIG_DAEMON_NAME 
-        * should also be specified. 
-        * ( String - default: None)
-        */
-        ETUNDriverConfigDaemonManagerName,
-
-        /**
-        * Name of the configuration daemon server. 
-        * This server is used to provide further configuration for 
-        * a connection, e.g. dynamic IP address assignment. 
-        * If specified, ISP_CONFIG_DAEMON_MANAGER_NAME should also 
-        * be specified.
-        * ( String - default: None)
-        */
-        ETUNDriverConfigDaemonName,
-
-        /**
-        * Name of the TUN Driver Service Extension table.
-        * ( String - default: None)
-        */
-        ETUNDriverServiceExtensionTableName,
-
-        /**
-        * The record ID of the linked TUN Driver Service Extension record in the
-        * TUN Driver Service Extension table.
-        * ( TUint32 - default: None)
-        */
-        ETUNDriverServiceExtensionTableRecordId,
-
-        ETUNDriverRangeMax = KLanBaseRangeMax
-        };
-    } // namespace CMManager
-
-#endif // CMPLUGINTUNDRIVER_DEF_H