201027
authorhgs
Fri, 09 Jul 2010 10:25:55 +0300
changeset 44 a0c4ceac30d0
parent 41 bbb64eb3bdee
child 48 69385fa96b48
201027
bearermanagement/mpm/inc/mpmdatausagewatcher.h
bearermanagement/mpm/inc/mpmiapselection.h
bearermanagement/mpm/inc/mpmserver.h
bearermanagement/mpm/inc/mpmserver.inl
bearermanagement/mpm/inc/mpmserversession.h
bearermanagement/mpm/src/mpmdatausagewatcher.cpp
bearermanagement/mpm/src/mpmiapselection.cpp
bearermanagement/mpm/src/mpmserver.cpp
bearermanagement/mpm/src/mpmserversession.cpp
cmmanager/cmmgr/cmmapi/src/cmmanagerapi.cpp
cmmanager/cmmgr/cmmpluginbase/BWinsCw/cmmpluginbaseu.def
cmmanager/cmmgr/cmmpluginbase/EABI/cmmpluginbaseu.def
cmmanager/cmmgr/cmmpluginbase/src/ccmpluginbaseeng.cpp
cmmanager/cmmgr/cmmplugins/cmpluginembdestination/src/cmpluginembdestination.cpp
cmmanager/cmmgr/cmmplugins/cmpluginlan/src/cmpluginlan.cpp
cmmanager/cmmgr/cmmplugins/cmpluginpacketdata/src/cmpluginpacketdata.cpp
cmmanager/cmmgr/cmmplugins/cmpluginwlan/src/cmpluginwlan.cpp
cmmanager/cmmgr/cmmserver/inc/cmmcache.h
cmmanager/cmmgr/cmmserver/inc/cmmconnmethodinstance.h
cmmanager/cmmgr/cmmserver/inc/cmmconnmethodstruct.h
cmmanager/cmmgr/cmmserver/inc/cmmdbchangelistener.h
cmmanager/cmmgr/cmmserver/inc/cmmdestinationstruct.h
cmmanager/cmmgr/cmmserver/inc/cmmlistenermanager.h
cmmanager/cmmgr/cmmserver/src/cmmanagerimpl.cpp
cmmanager/cmmgr/cmmserver/src/cmmcache.cpp
cmmanager/cmmgr/cmmserver/src/cmmconnmethodinstance.cpp
cmmanager/cmmgr/cmmserver/src/cmmconnmethodstruct.cpp
cmmanager/cmmgr/cmmserver/src/cmmdbchangelistener.cpp
cmmanager/cmmgr/cmmserver/src/cmmdestinationinstance.cpp
cmmanager/cmmgr/cmmserver/src/cmmdestinationstruct.cpp
cmmanager/cmmgr/cmmserver/src/cmminstancemapping.cpp
cmmanager/cmmgr/cmmserver/src/cmmlistenermanager.cpp
cmmanager/cmmgr/cmmserver/src/cmmsrvstatic.cpp
cmmanager/cppacketdataapplugin/src/cppacketdataapadvancedview.cpp
cmmanager/cppacketdataapplugin/src/cppacketdataapview.cpp
cmmanager/cpwlanapplugin/src/cpwlanapadvancedview.cpp
cmmanager/cpwlanapplugin/src/cpwlanapview.cpp
connectionmonitoring/cellularindicatorplugin/inc/cellularindicatorplugin.h
connectionmonitoring/cellularindicatorplugin/src/cellularindicatorplugin.cpp
connectionmonitoring/connectionview/inc/connectionview.h
connectionmonitoring/connectionview/src/connectionview.cpp
connectionmonitoring/connmon/connectionmonitor/inc/ConnMonIAP.h
connectionmonitoring/connmon/connectionmonitor/inc/ConnMonNoti.h
connectionmonitoring/connmon/connectionmonitor/src/ConnMonIAP.cpp
connectionmonitoring/connmon/connectionmonitor/src/ConnMonNoti.cpp
connectionutilities/confirmqueries/inc/cellularpromptdialog.h
connectionutilities/confirmqueries/src/cellularpromptdialog.cpp
ipcm_plat/bearer_settings_plugin_api/inc/cmpluginbaseeng.h
ipcm_plat/connection_monitor_extension_api/group/bld.inf
ipcm_plat/connection_monitor_extension_api/inc/connectionmonitorpskeys.h
ipcm_plat/extended_connection_settings_api/inc/cmmanagerkeys.h
--- a/bearermanagement/mpm/inc/mpmdatausagewatcher.h	Thu Jun 24 11:36:05 2010 +0300
+++ b/bearermanagement/mpm/inc/mpmdatausagewatcher.h	Fri Jul 09 10:25:55 2010 +0300
@@ -61,6 +61,12 @@
     * Active object's DoCancel.
     */
     void DoCancel();
+    
+    /**
+    * Current cellular data usage.
+    * See TCmCellularDataUsage
+    */
+    TInt CellularDataUsage() const;
 
 private:
 
--- a/bearermanagement/mpm/inc/mpmiapselection.h	Thu Jun 24 11:36:05 2010 +0300
+++ b/bearermanagement/mpm/inc/mpmiapselection.h	Fri Jul 09 10:25:55 2010 +0300
@@ -244,6 +244,12 @@
      * @since 3.2
      */
     void ImplicitConnectionWlanNoteL();
+
+    /**
+     * Gets current cellular data usage setting
+     * @since 5.2
+     */
+    TInt CurrentCellularDataUsage() const;
     
 private:
 
--- a/bearermanagement/mpm/inc/mpmserver.h	Thu Jun 24 11:36:05 2010 +0300
+++ b/bearermanagement/mpm/inc/mpmserver.h	Fri Jul 09 10:25:55 2010 +0300
@@ -34,6 +34,7 @@
 #include "mpmcommon.h"
 #include "rmpm.h"
 #include "mpmroamingwatcher.h"
+#include "mpmdatausagewatcher.h"
 #include "mpmvpntogglewatcher.h"
 
 
@@ -689,7 +690,14 @@
         * @since 5.2
         */
         inline CMPMRoamingWatcher* RoamingWatcher() const;
-        
+
+        /**
+        * Returns the DataUsageWatcher pointer
+        *
+        * @since 5.2
+        * @return DataUsageWatcher pointer
+        */
+        inline CMpmDataUsageWatcher* DataUsageWatcher() const;        
         
         
     public: // Functions from base classes
--- a/bearermanagement/mpm/inc/mpmserver.inl	Thu Jun 24 11:36:05 2010 +0300
+++ b/bearermanagement/mpm/inc/mpmserver.inl	Fri Jul 09 10:25:55 2010 +0300
@@ -230,4 +230,13 @@
     return iConnUiUtils;
     }
 
+// -----------------------------------------------------------------------------
+// CMPMServer::DataUsageWatcher()
+// -----------------------------------------------------------------------------
+//
+CMpmDataUsageWatcher* CMPMServer::DataUsageWatcher() const
+    {
+    return iMpmDataUsageWatcher;
+    }
+
 // End of File
--- a/bearermanagement/mpm/inc/mpmserversession.h	Thu Jun 24 11:36:05 2010 +0300
+++ b/bearermanagement/mpm/inc/mpmserversession.h	Fri Jul 09 10:25:55 2010 +0300
@@ -958,6 +958,9 @@
         //
         TBool iVpnUserConnectionUsed;        
 
+        // 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/mpmdatausagewatcher.cpp	Thu Jun 24 11:36:05 2010 +0300
+++ b/bearermanagement/mpm/src/mpmdatausagewatcher.cpp	Fri Jul 09 10:25:55 2010 +0300
@@ -182,3 +182,12 @@
         }
     return err;
     }
+
+// -----------------------------------------------------------------------------
+// CMpmDataUsageWatcher::CellularDataUsage
+// -----------------------------------------------------------------------------
+//
+TInt CMpmDataUsageWatcher::CellularDataUsage() const
+    {
+    return iCellularDataUsage;
+    }
--- a/bearermanagement/mpm/src/mpmiapselection.cpp	Thu Jun 24 11:36:05 2010 +0300
+++ b/bearermanagement/mpm/src/mpmiapselection.cpp	Fri Jul 09 10:25:55 2010 +0300
@@ -151,10 +151,13 @@
         MPMLOGSTRING2( "CMPMIapSelection::ChooseIapL: bearerType: %i", bearerType )
 
         // Complete selection with error code if wlan only was set and cellular IAP other 
-        // than MMS IAP was tried to access  
-        if ( wlanOnly && 
-                ( bearerType == EMPMBearerTypePacketData ) && 
-                ( iSession->IsMMSIap( iChooseIapPref.IapId() ) == EFalse ) ) 
+        // than MMS IAP was tried to access
+        // Note that CurrentCellularDataUsage()tells if internal cellular connections are 
+        // temporarily disabled because dial-up connection is prioritized over internal connections.
+        // 
+        if ( ( wlanOnly || CurrentCellularDataUsage() == ECmCellularDataUsageDisabled ) && 
+             ( bearerType == EMPMBearerTypePacketData ) && 
+             ( iSession->IsMMSIap( iChooseIapPref.IapId() ) == EFalse ) ) 
             {            
             ChooseIapComplete( KErrPermissionDenied, NULL );
             return;
@@ -1142,3 +1145,11 @@
     return iChooseIapPref;
     }
 
+// ---------------------------------------------------------------------------
+// Get current cellular data usage setting
+// ---------------------------------------------------------------------------
+//
+TInt CMPMIapSelection::CurrentCellularDataUsage() const
+    {
+    return iSession->MyServer().DataUsageWatcher()->CellularDataUsage();
+    }
--- a/bearermanagement/mpm/src/mpmserver.cpp	Thu Jun 24 11:36:05 2010 +0300
+++ b/bearermanagement/mpm/src/mpmserver.cpp	Fri Jul 09 10:25:55 2010 +0300
@@ -1100,7 +1100,7 @@
 aCategory = %i blacklisted Id count = %d", 
                    aCategory, iBlackListIdList.Count() )
 
-    for( TInt i( 0 ); i < iBlackListIdList.Count(); i++ )
+    for (TInt i = iBlackListIdList.Count()-1; i >= 0; i--)
         {
         // found blacklisted Connection Id
         TMPMBlackListConnId connIdInfo = iBlackListIdList[i];
@@ -1110,7 +1110,7 @@
 aConnId = 0x%x, blacklisted IapId count = %d", connIdInfo.iConnId, 
         connIdInfo.Count() )
         
-        for (TInt j = 0; j < connIdInfo.Count(); j++)
+        for (TInt j = connIdInfo.Count()-1; j >= 0; j--)
             {
             if ( connIdInfo.Category( j ) == aCategory ) 
                 {
--- a/bearermanagement/mpm/src/mpmserversession.cpp	Thu Jun 24 11:36:05 2010 +0300
+++ b/bearermanagement/mpm/src/mpmserversession.cpp	Fri Jul 09 10:25:55 2010 +0300
@@ -81,7 +81,8 @@
       iLastNotifiedIap( 0 ),
       iMigrateIap( 0 ),
       iUserConnection( 0 ),
-      iVpnUserConnectionUsed( EFalse )
+      iVpnUserConnectionUsed( EFalse ),
+      iErrorDiscreetPopupShown( EFalse )
     {
     }
 
@@ -1429,6 +1430,10 @@
         // belongs to the set of errors that are shown to the user.
         // Otherwise the popup is not shown.
         iMyServer.ConnUiUtils()->ConnectionErrorDiscreetPopup( error );
+        
+        // Error discreet popup has been shown. This is needed so that we
+        // dont show it again for SNAP.
+        iErrorDiscreetPopupShown = ETrue;
         }  
 
     TConnMonIapInfo availableIAPs;
@@ -3291,10 +3296,11 @@
         }
 
     // 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 ) 
-			&& ( iIapSelection->MpmConnPref().SnapId() == 0 ) )
+            && ( iErrorDiscreetPopupShown == EFalse ) )
         {
         // Note: Below function shows the discreet popup only if the error code
         // belongs to the set of errors that are shown to the user.
@@ -3314,6 +3320,9 @@
                                                       connectionAlreadyActive );
             }            
         }
+    
+    // Enable showing error discreet popup for SNAP again
+    iErrorDiscreetPopupShown = EFalse;
     }
 
 
--- a/cmmanager/cmmgr/cmmapi/src/cmmanagerapi.cpp	Thu Jun 24 11:36:05 2010 +0300
+++ b/cmmanager/cmmgr/cmmapi/src/cmmanagerapi.cpp	Fri Jul 09 10:25:55 2010 +0300
@@ -356,7 +356,7 @@
     {
     OstTraceFunctionEntry0( RCMMANAGERAPI_GETCONNECTIONMETHODINFOBOOL_ENTRY );
 
-    TPckg<TUint32> pckg( aValue );
+    TPckg<TBool> pckg( aValue );
     TIpcArgs args( aIapId, aAttribute, &pckg );
     TInt err = SendReceive( ECmmGetConnMethodInfoBool, args );
 
--- a/cmmanager/cmmgr/cmmpluginbase/BWinsCw/cmmpluginbaseu.def	Thu Jun 24 11:36:05 2010 +0300
+++ b/cmmanager/cmmgr/cmmpluginbase/BWinsCw/cmmpluginbaseu.def	Fri Jul 09 10:25:55 2010 +0300
@@ -2,14 +2,14 @@
 	?GetBoolAttributeL@CCmPluginBaseEng@@QAEHKPAVCCmClientPluginInstance@@@Z @ 1 NONAME ; int CCmPluginBaseEng::GetBoolAttributeL(unsigned long, class CCmClientPluginInstance *)
 	?CreateNewL@CCmPluginBaseEng@@QAEXK@Z @ 2 NONAME ; void CCmPluginBaseEng::CreateNewL(unsigned long)
 	?SetStringAttributeL@CCmPluginBaseEng@@QAEXKABVTDesC16@@PAVCCmClientPluginInstance@@@Z @ 3 NONAME ; void CCmPluginBaseEng::SetStringAttributeL(unsigned long, class TDesC16 const &, class CCmClientPluginInstance *)
-	?GetGenericTableIdsToBeObserved@CCmPluginBaseEng@@QBEXAAV?$RArray@K@@@Z @ 4 NONAME ; void CCmPluginBaseEng::GetGenericTableIdsToBeObserved(class RArray<unsigned long> &) const
-	?GetPluginDataL@CCmPluginBaseEng@@QAEXPAVCCmClientPluginInstance@@@Z @ 5 NONAME ; void CCmPluginBaseEng::GetPluginDataL(class CCmClientPluginInstance *)
-	?SetString8AttributeL@CCmPluginBaseEng@@QAEXKABVTDesC8@@PAVCCmClientPluginInstance@@@Z @ 6 NONAME ; void CCmPluginBaseEng::SetString8AttributeL(unsigned long, class TDesC8 const &, class CCmClientPluginInstance *)
-	?GetIntAttributeL@CCmPluginBaseEng@@QAEKKPAVCCmClientPluginInstance@@@Z @ 7 NONAME ; unsigned long CCmPluginBaseEng::GetIntAttributeL(unsigned long, class CCmClientPluginInstance *)
-	?CheckIfNameModifiedL@CCmPluginBaseEng@@IBEXPAVCCDRecordBase@CommsDat@@0@Z @ 8 NONAME ; void CCmPluginBaseEng::CheckIfNameModifiedL(class CommsDat::CCDRecordBase *, class CommsDat::CCDRecordBase *) const
+	?GetPluginDataL@CCmPluginBaseEng@@QAEXPAVCCmClientPluginInstance@@@Z @ 4 NONAME ; void CCmPluginBaseEng::GetPluginDataL(class CCmClientPluginInstance *)
+	?SetString8AttributeL@CCmPluginBaseEng@@QAEXKABVTDesC8@@PAVCCmClientPluginInstance@@@Z @ 5 NONAME ; void CCmPluginBaseEng::SetString8AttributeL(unsigned long, class TDesC8 const &, class CCmClientPluginInstance *)
+	?GetIntAttributeL@CCmPluginBaseEng@@QAEKKPAVCCmClientPluginInstance@@@Z @ 6 NONAME ; unsigned long CCmPluginBaseEng::GetIntAttributeL(unsigned long, class CCmClientPluginInstance *)
+	?CheckIfNameModifiedL@CCmPluginBaseEng@@IBEXPAVCCDRecordBase@CommsDat@@0@Z @ 7 NONAME ; void CCmPluginBaseEng::CheckIfNameModifiedL(class CommsDat::CCDRecordBase *, class CommsDat::CCDRecordBase *) const
+	?CreateCopyL@CCmPluginBaseEng@@QAEPAV1@PAVCCmClientPluginInstance@@@Z @ 8 NONAME ; class CCmPluginBaseEng * CCmPluginBaseEng::CreateCopyL(class CCmClientPluginInstance *)
 	??1CCmPluginBaseEng@@UAE@XZ @ 9 NONAME ; CCmPluginBaseEng::~CCmPluginBaseEng(void)
-	?CreateCopyL@CCmPluginBaseEng@@QAEPAV1@PAVCCmClientPluginInstance@@@Z @ 10 NONAME ; class CCmPluginBaseEng * CCmPluginBaseEng::CreateCopyL(class CCmClientPluginInstance *)
-	?SetIntAttributeL@CCmPluginBaseEng@@QAEXKKPAVCCmClientPluginInstance@@@Z @ 11 NONAME ; void CCmPluginBaseEng::SetIntAttributeL(unsigned long, unsigned long, class CCmClientPluginInstance *)
+	?SetIntAttributeL@CCmPluginBaseEng@@QAEXKKPAVCCmClientPluginInstance@@@Z @ 10 NONAME ; void CCmPluginBaseEng::SetIntAttributeL(unsigned long, unsigned long, class CCmClientPluginInstance *)
+	?CopyRecordFieldsL@CCmPluginBaseEng@@IAEXAAVCMDBRecordBase@CommsDat@@0@Z @ 11 NONAME ; void CCmPluginBaseEng::CopyRecordFieldsL(class CommsDat::CMDBRecordBase &, class CommsDat::CMDBRecordBase &)
 	?ReLoadL@CCmPluginBaseEng@@QAEXXZ @ 12 NONAME ; void CCmPluginBaseEng::ReLoadL(void)
 	?NewL@CCmClientPluginInstance@@SAPAV1@XZ @ 13 NONAME ; class CCmClientPluginInstance * CCmClientPluginInstance::NewL(void)
 	?ConstructL@CCmPluginBaseEng@@MAEXXZ @ 14 NONAME ; void CCmPluginBaseEng::ConstructL(void)
@@ -17,12 +17,12 @@
 	?NewLC@CCmClientPluginInstance@@SAPAV1@XZ @ 16 NONAME ; class CCmClientPluginInstance * CCmClientPluginInstance::NewLC(void)
 	?SetBoolAttributeL@CCmPluginBaseEng@@QAEXKHPAVCCmClientPluginInstance@@@Z @ 17 NONAME ; void CCmPluginBaseEng::SetBoolAttributeL(unsigned long, int, class CCmClientPluginInstance *)
 	?LoadL@CCmPluginBaseEng@@QAEXK@Z @ 18 NONAME ; void CCmPluginBaseEng::LoadL(unsigned long)
-	?DeleteL@CCmPluginBaseEng@@UAEXXZ @ 19 NONAME ; void CCmPluginBaseEng::DeleteL(void)
-	?CheckDNSServerAddressL@CCmPluginBaseEng@@IAEXHAAV?$CMDBField@VTDesC16@@@CommsDat@@0AAV?$CMDBField@H@3@@Z @ 20 NONAME ; void CCmPluginBaseEng::CheckDNSServerAddressL(int, class CommsDat::CMDBField<class TDesC16> &, class CommsDat::CMDBField<class TDesC16> &, class CommsDat::CMDBField<int> &)
-	??0TCmPluginInitParam@@QAE@AAVCMDBSession@CommsDat@@@Z @ 21 NONAME ; TCmPluginInitParam::TCmPluginInitParam(class CommsDat::CMDBSession &)
+	?CheckDNSServerAddressL@CCmPluginBaseEng@@IAEXHAAV?$CMDBField@VTDesC16@@@CommsDat@@0AAV?$CMDBField@H@3@@Z @ 19 NONAME ; void CCmPluginBaseEng::CheckDNSServerAddressL(int, class CommsDat::CMDBField<class TDesC16> &, class CommsDat::CMDBField<class TDesC16> &, class CommsDat::CMDBField<int> &)
+	??0TCmPluginInitParam@@QAE@AAVCMDBSession@CommsDat@@@Z @ 20 NONAME ; TCmPluginInitParam::TCmPluginInitParam(class CommsDat::CMDBSession &)
+	?DeleteL@CCmPluginBaseEng@@UAEXXZ @ 21 NONAME ; void CCmPluginBaseEng::DeleteL(void)
 	?GetString8AttributeL@CCmPluginBaseEng@@QAEPAVHBufC8@@KPAVCCmClientPluginInstance@@@Z @ 22 NONAME ; class HBufC8 * CCmPluginBaseEng::GetString8AttributeL(unsigned long, class CCmClientPluginInstance *)
 	?UpdateL@CCmPluginBaseEng@@UAEXPAVCCmClientPluginInstance@@@Z @ 23 NONAME ; void CCmPluginBaseEng::UpdateL(class CCmClientPluginInstance *)
-	?GetStringAttributeL@CCmPluginBaseEng@@QAEPAVHBufC16@@KPAVCCmClientPluginInstance@@@Z @ 24 NONAME ; class HBufC16 * CCmPluginBaseEng::GetStringAttributeL(unsigned long, class CCmClientPluginInstance *)
-	??1CCmClientPluginInstance@@UAE@XZ @ 25 NONAME ; CCmClientPluginInstance::~CCmClientPluginInstance(void)
-	?CopyRecordFieldsL@CCmPluginBaseEng@@IAEXAAVCMDBRecordBase@CommsDat@@0@Z @ 26 NONAME ; void CCmPluginBaseEng::CopyRecordFieldsL(class CommsDat::CMDBRecordBase &, class CommsDat::CMDBRecordBase &)
+	?GetGenericTableIdsToBeObservedL@CCmPluginBaseEng@@QBEXAAV?$RArray@K@@@Z @ 24 NONAME ; void CCmPluginBaseEng::GetGenericTableIdsToBeObservedL(class RArray<unsigned long> &) const
+	?GetStringAttributeL@CCmPluginBaseEng@@QAEPAVHBufC16@@KPAVCCmClientPluginInstance@@@Z @ 25 NONAME ; class HBufC16 * CCmPluginBaseEng::GetStringAttributeL(unsigned long, class CCmClientPluginInstance *)
+	??1CCmClientPluginInstance@@UAE@XZ @ 26 NONAME ; CCmClientPluginInstance::~CCmClientPluginInstance(void)
 
--- a/cmmanager/cmmgr/cmmpluginbase/EABI/cmmpluginbaseu.def	Thu Jun 24 11:36:05 2010 +0300
+++ b/cmmanager/cmmgr/cmmpluginbase/EABI/cmmpluginbaseu.def	Fri Jul 09 10:25:55 2010 +0300
@@ -5,31 +5,31 @@
 	_ZN16CCmPluginBaseEng14GetPluginDataLEP23CCmClientPluginInstance @ 4 NONAME
 	_ZN16CCmPluginBaseEng16GetIntAttributeLEmP23CCmClientPluginInstance @ 5 NONAME
 	_ZN16CCmPluginBaseEng16SetIntAttributeLEmmP23CCmClientPluginInstance @ 6 NONAME
-	_ZN16CCmPluginBaseEng17GetBoolAttributeLEmP23CCmClientPluginInstance @ 7 NONAME
-	_ZN16CCmPluginBaseEng17SetBoolAttributeLEmiP23CCmClientPluginInstance @ 8 NONAME
-	_ZN16CCmPluginBaseEng19GetStringAttributeLEmP23CCmClientPluginInstance @ 9 NONAME
-	_ZN16CCmPluginBaseEng19SetStringAttributeLEmRK7TDesC16P23CCmClientPluginInstance @ 10 NONAME
-	_ZN16CCmPluginBaseEng20GetString8AttributeLEmP23CCmClientPluginInstance @ 11 NONAME
-	_ZN16CCmPluginBaseEng20SetString8AttributeLEmRK6TDesC8P23CCmClientPluginInstance @ 12 NONAME
-	_ZN16CCmPluginBaseEng22CheckDNSServerAddressLEiRN8CommsDat9CMDBFieldI7TDesC16EES4_RNS1_IiEE @ 13 NONAME
-	_ZN16CCmPluginBaseEng5LoadLEm @ 14 NONAME
-	_ZN16CCmPluginBaseEng7DeleteLEv @ 15 NONAME
-	_ZN16CCmPluginBaseEng7ReLoadLEv @ 16 NONAME
-	_ZN16CCmPluginBaseEng7UpdateLEP23CCmClientPluginInstance @ 17 NONAME
-	_ZN16CCmPluginBaseEngC2EP18TCmPluginInitParam @ 18 NONAME
-	_ZN16CCmPluginBaseEngD0Ev @ 19 NONAME
-	_ZN16CCmPluginBaseEngD1Ev @ 20 NONAME
-	_ZN16CCmPluginBaseEngD2Ev @ 21 NONAME
-	_ZN18TCmPluginInitParamC1ERN8CommsDat11CMDBSessionE @ 22 NONAME
-	_ZN18TCmPluginInitParamC2ERN8CommsDat11CMDBSessionE @ 23 NONAME
-	_ZN23CCmClientPluginInstance4NewLEv @ 24 NONAME
-	_ZN23CCmClientPluginInstance5NewLCEv @ 25 NONAME
-	_ZN23CCmClientPluginInstanceD0Ev @ 26 NONAME
-	_ZN23CCmClientPluginInstanceD1Ev @ 27 NONAME
-	_ZN23CCmClientPluginInstanceD2Ev @ 28 NONAME
-	_ZNK16CCmPluginBaseEng20CheckIfNameModifiedLEPN8CommsDat13CCDRecordBaseES2_ @ 29 NONAME
-	_ZNK16CCmPluginBaseEng30GetGenericTableIdsToBeObservedER6RArrayImE @ 30 NONAME
-	_ZTI16CCmPluginBaseEng @ 31 NONAME
-	_ZTV16CCmPluginBaseEng @ 32 NONAME
-	_ZN16CCmPluginBaseEng17CopyRecordFieldsLERN8CommsDat14CMDBRecordBaseES2_ @ 33 NONAME
+	_ZN16CCmPluginBaseEng17CopyRecordFieldsLERN8CommsDat14CMDBRecordBaseES2_ @ 7 NONAME
+	_ZN16CCmPluginBaseEng17GetBoolAttributeLEmP23CCmClientPluginInstance @ 8 NONAME
+	_ZN16CCmPluginBaseEng17SetBoolAttributeLEmiP23CCmClientPluginInstance @ 9 NONAME
+	_ZN16CCmPluginBaseEng19GetStringAttributeLEmP23CCmClientPluginInstance @ 10 NONAME
+	_ZN16CCmPluginBaseEng19SetStringAttributeLEmRK7TDesC16P23CCmClientPluginInstance @ 11 NONAME
+	_ZN16CCmPluginBaseEng20GetString8AttributeLEmP23CCmClientPluginInstance @ 12 NONAME
+	_ZN16CCmPluginBaseEng20SetString8AttributeLEmRK6TDesC8P23CCmClientPluginInstance @ 13 NONAME
+	_ZN16CCmPluginBaseEng22CheckDNSServerAddressLEiRN8CommsDat9CMDBFieldI7TDesC16EES4_RNS1_IiEE @ 14 NONAME
+	_ZN16CCmPluginBaseEng5LoadLEm @ 15 NONAME
+	_ZN16CCmPluginBaseEng7DeleteLEv @ 16 NONAME
+	_ZN16CCmPluginBaseEng7ReLoadLEv @ 17 NONAME
+	_ZN16CCmPluginBaseEng7UpdateLEP23CCmClientPluginInstance @ 18 NONAME
+	_ZN16CCmPluginBaseEngC2EP18TCmPluginInitParam @ 19 NONAME
+	_ZN16CCmPluginBaseEngD0Ev @ 20 NONAME
+	_ZN16CCmPluginBaseEngD1Ev @ 21 NONAME
+	_ZN16CCmPluginBaseEngD2Ev @ 22 NONAME
+	_ZN18TCmPluginInitParamC1ERN8CommsDat11CMDBSessionE @ 23 NONAME
+	_ZN18TCmPluginInitParamC2ERN8CommsDat11CMDBSessionE @ 24 NONAME
+	_ZN23CCmClientPluginInstance4NewLEv @ 25 NONAME
+	_ZN23CCmClientPluginInstance5NewLCEv @ 26 NONAME
+	_ZN23CCmClientPluginInstanceD0Ev @ 27 NONAME
+	_ZN23CCmClientPluginInstanceD1Ev @ 28 NONAME
+	_ZN23CCmClientPluginInstanceD2Ev @ 29 NONAME
+	_ZNK16CCmPluginBaseEng20CheckIfNameModifiedLEPN8CommsDat13CCDRecordBaseES2_ @ 30 NONAME
+	_ZNK16CCmPluginBaseEng31GetGenericTableIdsToBeObservedLER6RArrayImE @ 31 NONAME
+	_ZTI16CCmPluginBaseEng @ 32 NONAME
+	_ZTV16CCmPluginBaseEng @ 33 NONAME
 
--- a/cmmanager/cmmgr/cmmpluginbase/src/ccmpluginbaseeng.cpp	Thu Jun 24 11:36:05 2010 +0300
+++ b/cmmanager/cmmgr/cmmpluginbase/src/ccmpluginbaseeng.cpp	Fri Jul 09 10:25:55 2010 +0300
@@ -427,15 +427,19 @@
 // CCmPluginBaseEng::GetGenericTableIdsToBeObserved
 // ---------------------------------------------------------------------------
 //
-EXPORT_C void CCmPluginBaseEng::GetGenericTableIdsToBeObserved(
+EXPORT_C void CCmPluginBaseEng::GetGenericTableIdsToBeObservedL(
         RArray<TUint32>& aTableIdArray ) const
     {
+    OstTraceFunctionEntry0( CCMPLUGINBASEENG_GETGENERICTABLEIDSTOBEOBSERVED_ENTRY );
+
     // Service and bearer records should be added by plugins.
-
-    aTableIdArray.Append( KCDTIdIAPRecord );
-    aTableIdArray.Append( KCDTIdWAPAccessPointRecord );
-    aTableIdArray.Append( KCDTIdProxiesRecord );
-    aTableIdArray.Append( iMetadataTableId );
+    aTableIdArray.AppendL( KCDTIdIAPRecord );
+    aTableIdArray.AppendL( KCDTIdWAPAccessPointRecord );
+    aTableIdArray.AppendL( KCDTIdWAPIPBearerRecord );
+    aTableIdArray.AppendL( KCDTIdProxiesRecord );
+    aTableIdArray.AppendL( iMetadataTableId );
+
+    OstTraceFunctionExit0( CCMPLUGINBASEENG_GETGENERICTABLEIDSTOBEOBSERVED_EXIT );
     }
 
 // ---------------------------------------------------------------------------
@@ -495,12 +499,9 @@
         {
         case KIapRecordIndex:
             {
-            CCDIAPRecord* iapRecord = static_cast<CCDIAPRecord*>(
+            aCopyInstance->iIapRecord = static_cast<CCDIAPRecord*>(
                     CCDRecordBase::RecordFactoryL( KCDTIdIAPRecord ) );
-            CleanupStack::PushL( iapRecord );
-            CopyRecordFieldsL( *iIapRecord, *iapRecord );
-            CleanupStack::Pop( iapRecord );
-            aCopyInstance->iIapRecord = iapRecord;
+            CopyRecordFieldsL( *iIapRecord, *aCopyInstance->iIapRecord );
             }
             break;
         case KServiceRecordIndex:
@@ -512,46 +513,39 @@
             break;
         case KNetworkRecordIndex:
             {
-            CCDNetworkRecord* networkRecord = static_cast<CCDNetworkRecord*>(
+            aCopyInstance->iNetworkRecord = static_cast<CCDNetworkRecord*>(
                     CCDRecordBase::RecordFactoryL( KCDTIdNetworkRecord ) );
-            CleanupStack::PushL( networkRecord );
-            CopyRecordFieldsL( *iNetworkRecord, *networkRecord );
-            CleanupStack::Pop( networkRecord );
-            aCopyInstance->iNetworkRecord = networkRecord;
+            CopyRecordFieldsL( *iNetworkRecord, *aCopyInstance->iNetworkRecord );
             }
             break;
         case KWAPAPRecordIndex:
             {
             aCopyInstance->iWapAPRecord = static_cast<CCDWAPAccessPointRecord*>(
-                    CCDRecordBase::CreateCopyRecordL( *iWapAPRecord ) );//TODO, convert to generic copy
+                    CCDRecordBase::RecordFactoryL( KCDTIdWAPAccessPointRecord ) );
+            CopyRecordFieldsL( *iWapAPRecord, *aCopyInstance->iWapAPRecord );
             }
             break;
         case KWAPBearerRecordIndex:
             {
             aCopyInstance->iWapIPBearerRecord = static_cast<CCDWAPIPBearerRecord*>(
-                    CCDRecordBase::CreateCopyRecordL( *iWapIPBearerRecord ) );//TODO, convert to generic copy
+                    CCDRecordBase::RecordFactoryL( KCDTIdWAPIPBearerRecord ) );
+            CopyRecordFieldsL( *iWapIPBearerRecord, *aCopyInstance->iWapIPBearerRecord );
             }
             break;
         case KMetaDataRecordIndex:
             {
-            CCDIAPMetadataRecord* metadataRecord =
-                    new( ELeave ) CCDIAPMetadataRecord( iMetadataTableId );
-            CleanupStack::PushL( metadataRecord );
-            CopyRecordFieldsL( *iMetaDataRecord, *metadataRecord );
-            CleanupStack::Pop( metadataRecord );
-            aCopyInstance->iMetaDataRecord = metadataRecord;
+            aCopyInstance->iMetaDataRecord = new( ELeave ) CCDIAPMetadataRecord( 
+                    iMetadataTableId );
+            CopyRecordFieldsL( *iMetaDataRecord, *aCopyInstance->iMetaDataRecord );
             }
             break;
         case KProxyRecordIndex:
             {
             if ( iProxyRecord )
                 {
-                CCDProxiesRecord* proxyRecord = static_cast<CCDProxiesRecord*>(
+                aCopyInstance->iProxyRecord = static_cast<CCDProxiesRecord*>(
                         CCDRecordBase::RecordFactoryL( KCDTIdProxiesRecord ) );
-                CleanupStack::PushL( proxyRecord );
-                CopyRecordFieldsL( *iProxyRecord, *proxyRecord );
-                CleanupStack::Pop( proxyRecord );
-                aCopyInstance->iProxyRecord = proxyRecord;
+                CopyRecordFieldsL( *iProxyRecord, *aCopyInstance->iProxyRecord );
                 }
             }
             break;
@@ -591,57 +585,49 @@
         ptrSource = aSource.GetFieldByIdL( recordInfo->iTypeId );
         ptrDest = aDestination.GetFieldByIdL( recordInfo->iTypeId );
 
-        // Make sure we see only basic type info. Masks out any additional info
-        // on links (CommsDat internal stuff).
-        switch ( recordInfo->iValType & 0x000000ff )
+        if ( !( ptrSource->IsNull() ) )
             {
-            case CommsDat::EInt:
-            case CommsDat::EBool:
+            // Make sure we see only basic type info. Masks out any additional info
+            // on links (CommsDat internal stuff).
+            switch ( recordInfo->iValType & 0x000000ff )
                 {
-                if ( !( ptrSource->IsNull() ) )
+                case CommsDat::EInt:
+                case CommsDat::EBool:
                     {
                     static_cast<CMDBField<TInt>&>( *ptrDest ).SetL(
                             static_cast<CMDBField<TInt>&>( *ptrSource ) );
                     }
-                }
-                break;
-            case CommsDat::EUint32:
-            case CommsDat::ELink:
-                {
-                if ( !( ptrSource->IsNull() ) )
+                    break;
+                case CommsDat::EUint32:
+                case CommsDat::ELink:
                     {
                     static_cast<CMDBField<TUint32>&>( *ptrDest ).SetL(
                             static_cast<CMDBField<TUint32>&>( *ptrSource ) );
                     }
-                }
-                break;
-            case CommsDat::EDesC8:
-                {
-                if ( !( ptrSource->IsNull() ) )
+                    break;
+                case CommsDat::EDesC8:
                     {
                     static_cast<CMDBField<TDesC8>&>( *ptrDest ).SetL(
                             static_cast<CMDBField<TDesC8>&>( *ptrSource ) );
                     }
-                }
-                break;
-            case CommsDat::EText:
-            case CommsDat::EMedText:
-            case CommsDat::ELongText:
-                {
-                if ( !( ptrSource->IsNull() ) )
+                    break;
+                case CommsDat::EText:
+                case CommsDat::EMedText:
+                case CommsDat::ELongText:
                     {
                     static_cast<CMDBField<TDesC>&>( *ptrDest ).SetL(
                             static_cast<CMDBField<TDesC>&>( *ptrSource ) );
                     }
+                    break;
+                default:
+                    {
+                    User::Leave( KErrCorrupt );
+                    }
+                    break;
                 }
-                break;
-            default:
-                {
-                User::Leave( KErrCorrupt );
-                }
-                break;
+            ptrDest->ClearAttributes( ptrDest->Attributes() );
+            ptrDest->SetAttributes( ptrSource->Attributes() );
             }
-        ptrDest->SetAttributes( ptrSource->Attributes() );
         recordInfo++;
         }
 
@@ -663,13 +649,8 @@
     LoadMetadataRecordL();
     LoadNetworkRecordL();
 
-    // This is a connectionmethodinfo instance, that has no
-    // service and proxy setting.
-    if ( KDummyBearerType != iBearerType )
-        {
-        LoadServiceRecordL();
-        LoadProxyRecordL();
-        }
+    LoadServiceRecordL();
+    LoadProxyRecordL();
 
     LoadBearerRecordsL();
 
@@ -895,6 +876,9 @@
         CheckIfNameModifiedL( iapRecord, iIapRecord );
 
         iIapRecord->StoreL( iSession );
+        // Have to be "reloaded" to get possible default values 
+        // from template records.
+        iIapRecord->LoadL( iSession );
 
         iCmId = iIapRecord->RecordId();
         aClientPluginInstance->iIapId = iCmId;
@@ -974,7 +958,9 @@
 
         iProxyRecord->SetRecordId( KCDNewRecordRequest );
         iProxyRecord->StoreL( iSession );
-        CopyRecordFieldsL( *iProxyRecord, *proxyRecord );
+        // Have to be "reloaded" to get possible default values from template records.
+        iProxyRecord->LoadL( iSession );
+
         proxyRecord->SetElementId( iProxyRecord->ElementId() );
         }
     else
@@ -982,6 +968,7 @@
         {
         iProxyRecord->ModifyL( iSession );
         }
+    CopyRecordFieldsL( *iProxyRecord, *proxyRecord );
 
     OstTraceFunctionExit0( CCMPLUGINBASEENG_UPDATEPROXYRECORDL_EXIT );
     }
@@ -1009,7 +996,9 @@
     delete iMetaDataRecord;
     iMetaDataRecord = NULL;
     iMetaDataRecord = new( ELeave ) CCDIAPMetadataRecord( iMetadataTableId );
+
     CopyRecordFieldsL( *clientMetadataRecord, *iMetaDataRecord );
+
     iMetaDataRecord->SetElementId( clientMetadataRecord->ElementId() );
 
     if ( !iMetaDataRecord->RecordId() )
@@ -1017,12 +1006,16 @@
         iMetaDataRecord->iIAP = IAPRecordElementId();
         iMetaDataRecord->SetRecordId( KCDNewRecordRequest );
         iMetaDataRecord->StoreL( iSession );
+        // Have to be "reloaded" to get possible default values from template records.
+        iMetaDataRecord->LoadL( iSession );
+
         clientMetadataRecord->SetElementId( iMetaDataRecord->ElementId() );
         }
     else
         {
         iMetaDataRecord->ModifyL( iSession );
         }
+    CopyRecordFieldsL( *iMetaDataRecord, *clientMetadataRecord );
 
     OstTraceFunctionExit0( CCMPLUGINBASEENG_UPDATEMETADATARECORDL_EXIT );
     }
@@ -1083,12 +1076,16 @@
         {
         iNetworkRecord->SetRecordId( KCDNewRecordRequest );
         iNetworkRecord->StoreL( iSession );
+        // Have to be "reloaded" to get possible default values from template records.
+        iNetworkRecord->LoadL( iSession );
+
         networkRecord->SetElementId( iNetworkRecord->ElementId() );
         }
     else
         {
         iNetworkRecord->ModifyL( iSession );
         }
+    CopyRecordFieldsL( *iNetworkRecord, *networkRecord );
 
     OstTraceFunctionExit0( CCMPLUGINBASEENG_UPDATENETWORKRECORDL_EXIT );
     }
@@ -1238,24 +1235,32 @@
     CheckIfNameModifiedL( iapRecord, wapAPRecord );
     CheckIfNameModifiedL( iapRecord, wapIPBearerRecord );
 
+    // WAP AP record
     iWapAPRecord = static_cast<CCDWAPAccessPointRecord*>(
-            CCDRecordBase::CreateCopyRecordL( *wapAPRecord ) );//TODO, convert to generic copy
+            CCDRecordBase::RecordFactoryL( KCDTIdWAPAccessPointRecord ) );
+    CopyRecordFieldsL( *wapAPRecord, *iWapAPRecord );
     iWapAPRecord->SetElementId( wapAPRecord->ElementId() );
 
-    iWapIPBearerRecord = static_cast<CCDWAPIPBearerRecord*>(
-            CCDRecordBase::CreateCopyRecordL( *wapIPBearerRecord ) );//TODO, convert to generic copy
+    // WAP IP Bearer record
+    iWapIPBearerRecord =static_cast<CCDWAPIPBearerRecord*>(
+            CCDRecordBase::RecordFactoryL( KCDTIdWAPIPBearerRecord ) );
+    CopyRecordFieldsL( *wapIPBearerRecord, *iWapIPBearerRecord );
     iWapIPBearerRecord->SetElementId( wapIPBearerRecord->ElementId() );
 
     if ( !iWapAPRecord->RecordId() )
         {
         iWapAPRecord->SetRecordId( KCDNewRecordRequest );
         iWapAPRecord->StoreL(iSession );
+        // Have to be "reloaded" to get possible default values from template records.
+        iWapAPRecord->LoadL(iSession );
+
         wapAPRecord->SetElementId( iWapAPRecord->ElementId() );
         }
     else
         {
         iWapAPRecord->ModifyL( iSession );
         }
+    CopyRecordFieldsL( *iWapAPRecord, *wapAPRecord );
 
     if ( !iWapIPBearerRecord->RecordId() )
         {
@@ -1264,15 +1269,16 @@
 
         iWapIPBearerRecord->SetRecordId( KCDNewRecordRequest );
         iWapIPBearerRecord->StoreL( iSession );
+        // Have to be "reloaded" to get possible default values from template records.
+        iWapIPBearerRecord->LoadL( iSession );
+
         wapIPBearerRecord->SetElementId( iWapIPBearerRecord->ElementId() );
-
-        wapIPBearerRecord->iWAPAccessPointId = iWapAPRecord->RecordId();
-        wapIPBearerRecord->iWAPIAP = iapRecord->RecordId();
         }
     else
         {
         iWapIPBearerRecord->ModifyL( iSession );
         }
+    CopyRecordFieldsL( *iWapIPBearerRecord, *wapIPBearerRecord );
 
     OstTraceFunctionExit0( DUP1_CCMPLUGINBASEENG_UPDATEWAPRECORDL_EXIT );
     }
@@ -2107,9 +2113,10 @@
     if ( iWapAPRecord )
         {
         CCDWAPAccessPointRecord* wapAPRecord = static_cast<CCDWAPAccessPointRecord*>(
-                CCDRecordBase::CreateCopyRecordL( *iWapAPRecord ) );//TODO, convert to generic copy
+                CCDRecordBase::RecordFactoryL( KCDTIdWAPAccessPointRecord ) );
+        CleanupStack::PushL( wapAPRecord );
+        CopyRecordFieldsL( *iWapAPRecord, *wapAPRecord );
         wapAPRecord->SetElementId( iWapAPRecord->ElementId() );
-        CleanupStack::PushL( wapAPRecord );
         aClientPluginInstance->iGenRecordArray.AppendL(
                 static_cast<CommsDat::CCDRecordBase*>( wapAPRecord ) );
         CleanupStack::Pop( wapAPRecord );
@@ -2122,9 +2129,10 @@
     if ( iWapIPBearerRecord )
         {
         CCDWAPIPBearerRecord* wapIPBearerRecord = static_cast<CCDWAPIPBearerRecord*>(
-                CCDRecordBase::CreateCopyRecordL( *iWapIPBearerRecord ) );//TODO, convert to generic copy
+                CCDRecordBase::RecordFactoryL( KCDTIdWAPIPBearerRecord ) );
+        CleanupStack::PushL( wapIPBearerRecord );
+        CopyRecordFieldsL( *iWapIPBearerRecord, *wapIPBearerRecord );
         wapIPBearerRecord->SetElementId( iWapIPBearerRecord->ElementId() );
-        CleanupStack::PushL( wapIPBearerRecord );
         aClientPluginInstance->iGenRecordArray.AppendL(
                 static_cast<CommsDat::CCDRecordBase*>( wapIPBearerRecord ) );
         CleanupStack::Pop( wapIPBearerRecord );
@@ -2339,7 +2347,9 @@
                 }
             else
                 {
-                retVal = IsProtected();
+                CCDIAPRecord* iapRecord = static_cast<CCDIAPRecord*>(
+                        aClientPluginInstance->iGenRecordArray[KIapRecordIndex] );
+                retVal = iapRecord->Attributes() & ECDProtectedWrite;
                 }
             }
             break;
--- a/cmmanager/cmmgr/cmmplugins/cmpluginembdestination/src/cmpluginembdestination.cpp	Thu Jun 24 11:36:05 2010 +0300
+++ b/cmmanager/cmmgr/cmmplugins/cmpluginembdestination/src/cmpluginembdestination.cpp	Fri Jul 09 10:25:55 2010 +0300
@@ -83,6 +83,7 @@
         CCmPluginBaseEng( aInitParam )
 	{
 	iBearerType = KUidEmbeddedDestination;
+	iDestMetadataTableId = 0;
 	}
 
 // ---------------------------------------------------------------------------
--- a/cmmanager/cmmgr/cmmplugins/cmpluginlan/src/cmpluginlan.cpp	Thu Jun 24 11:36:05 2010 +0300
+++ b/cmmanager/cmmgr/cmmplugins/cmpluginlan/src/cmpluginlan.cpp	Fri Jul 09 10:25:55 2010 +0300
@@ -117,6 +117,7 @@
 
     iBearerType = KUidLanBearerType;
     iBearerRecord = NULL;
+    iBearerPriorityTableId = 0;
 
     OstTraceFunctionExit0( DUP1_CCMPLUGINLAN_CCMPLUGINLAN_EXIT );
     }
@@ -477,108 +478,7 @@
     CCDLANServiceRecord* clientServiceRecordCopy =
             static_cast<CCDLANServiceRecord*>( aGenRecordArray[KServiceRecordIndex] );
 
-    // LAN Service copy does not work so we have to copy it manually.
-
-    if ( !clientServiceRecordCopy->iRecordTag.IsNull() )
-        {
-        origServiceRecord->iRecordTag.SetL(
-                clientServiceRecordCopy->iRecordTag );
-        }
-    if ( !clientServiceRecordCopy->iRecordName.IsNull() )
-        {
-        origServiceRecord->iRecordName.SetL(
-                clientServiceRecordCopy->iRecordName );
-        }
-    if ( !clientServiceRecordCopy->iServiceEnableLlmnr.IsNull() )
-        {
-        origServiceRecord->iServiceEnableLlmnr.SetL(
-                clientServiceRecordCopy->iServiceEnableLlmnr );
-        }
-    if ( !clientServiceRecordCopy->iIfNetworks.IsNull() )
-        {
-        origServiceRecord->iIfNetworks.SetL(
-                clientServiceRecordCopy->iIfNetworks );
-        }
-    if ( !clientServiceRecordCopy->iIpNetmask.IsNull() )
-        {
-        origServiceRecord->iIpNetmask.SetL(
-                clientServiceRecordCopy->iIpNetmask );
-        }
-    if ( !clientServiceRecordCopy->iIpGateway.IsNull() )
-        {
-        origServiceRecord->iIpGateway.SetL(
-                clientServiceRecordCopy->iIpGateway );
-        }
-    if ( !clientServiceRecordCopy->iIpAddrFromServer.IsNull() )
-        {
-        origServiceRecord->iIpAddrFromServer.SetL(
-                clientServiceRecordCopy->iIpAddrFromServer );
-        }
-    if ( !clientServiceRecordCopy->iIpAddr.IsNull() )
-        {
-        origServiceRecord->iIpAddr.SetL(
-                clientServiceRecordCopy->iIpAddr );
-        }
-    if ( !clientServiceRecordCopy->iIpDnsAddrFromServer.IsNull() )
-        {
-        origServiceRecord->iIpDnsAddrFromServer.SetL(
-                clientServiceRecordCopy->iIpDnsAddrFromServer );
-        }
-    if ( !clientServiceRecordCopy->iIpNameServer1.IsNull() )
-        {
-        origServiceRecord->iIpNameServer1.SetL(
-                clientServiceRecordCopy->iIpNameServer1 );
-        }
-    if ( !clientServiceRecordCopy->iIpNameServer2.IsNull() )
-        {
-        origServiceRecord->iIpNameServer2.SetL(
-                clientServiceRecordCopy->iIpNameServer2 );
-        }
-    if ( !clientServiceRecordCopy->iIp6DnsAddrFromServer.IsNull() )
-        {
-        origServiceRecord->iIp6DnsAddrFromServer.SetL(
-                clientServiceRecordCopy->iIp6DnsAddrFromServer );
-        }
-    if ( !clientServiceRecordCopy->iIp6NameServer1.IsNull() )
-        {
-        origServiceRecord->iIp6NameServer1.SetL(
-                clientServiceRecordCopy->iIp6NameServer1 );
-        }
-    if ( !clientServiceRecordCopy->iIp6NameServer2.IsNull() )
-        {
-        origServiceRecord->iIp6NameServer2.SetL(
-                clientServiceRecordCopy->iIp6NameServer2 );
-        }
-    if ( !clientServiceRecordCopy->iIpAddrLeaseValidFrom.IsNull() )
-        {
-        origServiceRecord->iIpAddrLeaseValidFrom.SetL(
-                clientServiceRecordCopy->iIpAddrLeaseValidFrom );
-        }
-    if ( !clientServiceRecordCopy->iIpAddrLeaseValidTo.IsNull() )
-        {
-        origServiceRecord->iIpAddrLeaseValidTo.SetL(
-                clientServiceRecordCopy->iIpAddrLeaseValidTo );
-        }
-    if ( !clientServiceRecordCopy->iConfigDaemonManagerName.IsNull() )
-        {
-        origServiceRecord->iConfigDaemonManagerName.SetL(
-                clientServiceRecordCopy->iConfigDaemonManagerName );
-        }
-    if ( !clientServiceRecordCopy->iConfigDaemonName.IsNull() )
-        {
-        origServiceRecord->iConfigDaemonName.SetL(
-                clientServiceRecordCopy->iConfigDaemonName );
-        }
-    if ( !clientServiceRecordCopy->iServiceExtensionTableName.IsNull() )
-        {
-        origServiceRecord->iServiceExtensionTableName.SetL(
-                clientServiceRecordCopy->iServiceExtensionTableName );
-        }
-    if ( !clientServiceRecordCopy->iServiceExtensionTableRecordId.IsNull() )
-        {
-        origServiceRecord->iServiceExtensionTableRecordId.SetL(
-                clientServiceRecordCopy->iServiceExtensionTableRecordId ); //TODO, check this works ok.
-        }
+    CopyRecordFieldsL( *clientServiceRecordCopy, *origServiceRecord );
 
     origServiceRecord->SetElementId( clientServiceRecordCopy->ElementId() );
 
@@ -587,6 +487,9 @@
         origServiceRecord->SetRecordId( KCDNewRecordRequest );
         origServiceRecord->StoreL( iSession );
 
+        // Have to be "reloaded" to get possible default values from template records.
+        origServiceRecord->LoadL( iSession );
+
         // Update received element ID to client's copy too.
         clientServiceRecordCopy->SetElementId( origServiceRecord->ElementId() );
         }
@@ -595,6 +498,9 @@
         origServiceRecord->ModifyL( iSession );
         }
 
+    CCmPluginBaseEng::CopyRecordFieldsL( *origServiceRecord,
+            *clientServiceRecordCopy );
+
     OstTraceFunctionExit0( CCMPLUGINLAN_UPDATESERVICERECORDL_EXIT );
     }
 
--- a/cmmanager/cmmgr/cmmplugins/cmpluginpacketdata/src/cmpluginpacketdata.cpp	Thu Jun 24 11:36:05 2010 +0300
+++ b/cmmanager/cmmgr/cmmplugins/cmpluginpacketdata/src/cmpluginpacketdata.cpp	Fri Jul 09 10:25:55 2010 +0300
@@ -295,6 +295,7 @@
     iBearerRecordId = 0;
     iBearerRecordName = NULL;
     iPacketDataQoSRecord = NULL;
+    iBearerPriorityTableId = 0;
 
     OstTraceFunctionExit0( DUP1_CCMPLUGINPACKETDATA_CCMPLUGINPACKETDATA_EXIT );
     }
@@ -813,250 +814,10 @@
 
     // Client's copy of packet service record.
     CCDWCDMAPacketServiceRecord* clientServiceRecordCopy =
-            static_cast<CCDWCDMAPacketServiceRecord*>( aGenRecordArray[KServiceRecordIndex] );
-
-    if ( !clientServiceRecordCopy->iRecordTag.IsNull() )
-        {
-        origServiceRecord->iRecordTag.SetL(
-                clientServiceRecordCopy->iRecordTag );
-        }
-    if ( !clientServiceRecordCopy->iRecordName.IsNull() )
-        {
-        origServiceRecord->iRecordName.SetL(
-                clientServiceRecordCopy->iRecordName );
-        }
-
-    if ( !clientServiceRecordCopy->iServiceEnableLlmnr.IsNull() )
-        {
-        origServiceRecord->iServiceEnableLlmnr.SetL(
-                clientServiceRecordCopy->iServiceEnableLlmnr );
-        }
-
-    if ( !clientServiceRecordCopy->iGPRSAPN.IsNull() )
-        {
-        origServiceRecord->iGPRSAPN.SetL(
-                clientServiceRecordCopy->iGPRSAPN );
-        }
-    if ( !clientServiceRecordCopy->iGPRSPDPType.IsNull() )
-        {
-        origServiceRecord->iGPRSPDPType.SetL(
-                clientServiceRecordCopy->iGPRSPDPType );
-        }
-    if ( !clientServiceRecordCopy->iGPRSPDPAddress.IsNull() )
-        {
-        origServiceRecord->iGPRSPDPAddress.SetL(
-                clientServiceRecordCopy->iGPRSPDPAddress );
-        }
-    if ( !clientServiceRecordCopy->iGPRSReqPrecedence.IsNull() )
-        {
-        origServiceRecord->iGPRSReqPrecedence.SetL(
-                clientServiceRecordCopy->iGPRSReqPrecedence );
-        }
-    if ( !clientServiceRecordCopy->iGPRSReqDelay.IsNull() )
-        {
-        origServiceRecord->iGPRSReqDelay.SetL(
-                clientServiceRecordCopy->iGPRSReqDelay );
-        }
-    if ( !clientServiceRecordCopy->iGPRSReqReliability.IsNull() )
-        {
-        origServiceRecord->iGPRSReqReliability.SetL(
-                clientServiceRecordCopy->iGPRSReqReliability );
-        }
-    if ( !clientServiceRecordCopy->iGPRSReqPeakThroughput.IsNull() )
-        {
-        origServiceRecord->iGPRSReqPeakThroughput.SetL(
-                clientServiceRecordCopy->iGPRSReqPeakThroughput );
-        }
-    if ( !clientServiceRecordCopy->iGPRSReqMeanThroughput.IsNull() )
-        {
-        origServiceRecord->iGPRSReqMeanThroughput.SetL(
-                clientServiceRecordCopy->iGPRSReqMeanThroughput );
-        }
-    if ( !clientServiceRecordCopy->iGPRSMinPrecedence.IsNull() )
-        {
-        origServiceRecord->iGPRSMinPrecedence.SetL(
-                clientServiceRecordCopy->iGPRSMinPrecedence );
-        }
-    if ( !clientServiceRecordCopy->iGPRSMinDelay.IsNull() )
-        {
-        origServiceRecord->iGPRSMinDelay.SetL(
-                clientServiceRecordCopy->iGPRSMinDelay );
-        }
-    if ( !clientServiceRecordCopy->iGPRSMinReliability.IsNull() )
-        {
-        origServiceRecord->iGPRSMinReliability.SetL(
-                clientServiceRecordCopy->iGPRSMinReliability );
-        }
-    if ( !clientServiceRecordCopy->iGPRSMinPeakThroughput.IsNull() )
-        {
-        origServiceRecord->iGPRSMinPeakThroughput.SetL(
-                clientServiceRecordCopy->iGPRSMinPeakThroughput );
-        }
-    if ( !clientServiceRecordCopy->iGPRSMinMeanThroughput.IsNull() )
-        {
-        origServiceRecord->iGPRSMinMeanThroughput.SetL(
-                clientServiceRecordCopy->iGPRSMinMeanThroughput );
-        }
-    if ( !clientServiceRecordCopy->iGPRSDataCompression.IsNull() )
-        {
-        origServiceRecord->iGPRSDataCompression.SetL(
-                clientServiceRecordCopy->iGPRSDataCompression );
-        }
-    if ( !clientServiceRecordCopy->iGPRSHeaderCompression.IsNull() )
-        {
-        origServiceRecord->iGPRSHeaderCompression.SetL(
-                clientServiceRecordCopy->iGPRSHeaderCompression );
-        }
-    if ( !clientServiceRecordCopy->iGPRSUseEdge.IsNull() )
-        {
-        origServiceRecord->iGPRSUseEdge.SetL(
-                clientServiceRecordCopy->iGPRSUseEdge );
-        }
-    if ( !clientServiceRecordCopy->iGPRSAnonymousAccess.IsNull() )
-        {
-        origServiceRecord->iGPRSAnonymousAccess.SetL(
-                clientServiceRecordCopy->iGPRSAnonymousAccess );
-        }
-    if ( !clientServiceRecordCopy->iGPRSIfParams.IsNull() )
-        {
-        origServiceRecord->iGPRSIfParams.SetL(
-                clientServiceRecordCopy->iGPRSIfParams );
-        }
-    if ( !clientServiceRecordCopy->iGPRSIfNetworks.IsNull() )
-        {
-        origServiceRecord->iGPRSIfNetworks.SetL(
-                clientServiceRecordCopy->iGPRSIfNetworks );
-        }
-    if ( !clientServiceRecordCopy->iGPRSIfPromptForAuth.IsNull() )
-        {
-        origServiceRecord->iGPRSIfPromptForAuth.SetL(
-                clientServiceRecordCopy->iGPRSIfPromptForAuth );
-        }
-    if ( !clientServiceRecordCopy->iGPRSIfAuthName.IsNull() )
-        {
-        origServiceRecord->iGPRSIfAuthName.SetL(
-                clientServiceRecordCopy->iGPRSIfAuthName );
-        }
-    if ( !clientServiceRecordCopy->iGPRSIfAuthPass.IsNull() )
-        {
-        origServiceRecord->iGPRSIfAuthPass.SetL(
-                clientServiceRecordCopy->iGPRSIfAuthPass );
-        }
-    if ( !clientServiceRecordCopy->iGPRSIfAuthRetries.IsNull() )
-        {
-        origServiceRecord->iGPRSIfAuthRetries.SetL(
-                clientServiceRecordCopy->iGPRSIfAuthRetries );
-        }
-    if ( !clientServiceRecordCopy->iGPRSIPNetMask.IsNull() )
-        {
-        origServiceRecord->iGPRSIPNetMask.SetL(
-                clientServiceRecordCopy->iGPRSIPNetMask );
-        }
-    if ( !clientServiceRecordCopy->iGPRSIPGateway.IsNull() )
-        {
-        origServiceRecord->iGPRSIPGateway.SetL(
-                clientServiceRecordCopy->iGPRSIPGateway );
-        }
-    if ( !clientServiceRecordCopy->iGPRSIPAddrFromServer.IsNull() )
-        {
-        origServiceRecord->iGPRSIPAddrFromServer.SetL(
-                clientServiceRecordCopy->iGPRSIPAddrFromServer );
-        }
-    if ( !clientServiceRecordCopy->iGPRSIPAddr.IsNull() )
-        {
-        origServiceRecord->iGPRSIPAddr.SetL(
-                clientServiceRecordCopy->iGPRSIPAddr );
-        }
-    if ( !clientServiceRecordCopy->iGPRSIPDNSAddrFromServer.IsNull() )
-        {
-        origServiceRecord->iGPRSIPDNSAddrFromServer.SetL(
-                clientServiceRecordCopy->iGPRSIPDNSAddrFromServer );
-        }
-    if ( !clientServiceRecordCopy->iGPRSIPNameServer1.IsNull() )
-        {
-        origServiceRecord->iGPRSIPNameServer1.SetL(
-                clientServiceRecordCopy->iGPRSIPNameServer1 );
-        }
-    if ( !clientServiceRecordCopy->iGPRSIPNameServer2.IsNull() )
-        {
-        origServiceRecord->iGPRSIPNameServer2.SetL(
-                clientServiceRecordCopy->iGPRSIPNameServer2 );
-        }
-    if ( !clientServiceRecordCopy->iGPRSIP6DNSAddrFromServer.IsNull() )
-        {
-        origServiceRecord->iGPRSIP6DNSAddrFromServer.SetL(
-                clientServiceRecordCopy->iGPRSIP6DNSAddrFromServer );
-        }
-    if ( !clientServiceRecordCopy->iGPRSIP6NameServer1.IsNull() )
-        {
-        origServiceRecord->iGPRSIP6NameServer1.SetL(
-                clientServiceRecordCopy->iGPRSIP6NameServer1 );
-        }
-    if ( !clientServiceRecordCopy->iGPRSIP6NameServer2.IsNull() )
-        {
-        origServiceRecord->iGPRSIP6NameServer2.SetL(
-                clientServiceRecordCopy->iGPRSIP6NameServer2 );
-        }
-    if ( !clientServiceRecordCopy->iGPRSIPAddrLeaseValidFrom.IsNull() )
-        {
-        origServiceRecord->iGPRSIPAddrLeaseValidFrom.SetL(
-                clientServiceRecordCopy->iGPRSIPAddrLeaseValidFrom );
-        }
-    if ( !clientServiceRecordCopy->iGPRSIPAddrLeaseValidTo.IsNull() )
-        {
-        origServiceRecord->iGPRSIPAddrLeaseValidTo.SetL(
-                clientServiceRecordCopy->iGPRSIPAddrLeaseValidTo );
-        }
-    if ( !clientServiceRecordCopy->iGPRSConfigDaemonManagerName.IsNull() )
-        {
-        origServiceRecord->iGPRSConfigDaemonManagerName.SetL(
-                clientServiceRecordCopy->iGPRSConfigDaemonManagerName );
-        }
-    if ( !clientServiceRecordCopy->iGPRSConfigDaemonName.IsNull() )
-        {
-        origServiceRecord->iGPRSConfigDaemonName.SetL(
-                clientServiceRecordCopy->iGPRSConfigDaemonName );
-        }
-    if ( !clientServiceRecordCopy->iGPRSEnableLCPExtension.IsNull() )
-        {
-        origServiceRecord->iGPRSEnableLCPExtension.SetL(
-                clientServiceRecordCopy->iGPRSEnableLCPExtension );
-        }
-    if ( !clientServiceRecordCopy->iGPRSDisablePlainTextAuth.IsNull() )
-        {
-        origServiceRecord->iGPRSDisablePlainTextAuth.SetL(
-                clientServiceRecordCopy->iGPRSDisablePlainTextAuth );
-        }
-    if ( !clientServiceRecordCopy->iGPRSAPType.IsNull() )
-        {
-        origServiceRecord->iGPRSAPType.SetL(
-                clientServiceRecordCopy->iGPRSAPType );
-        }
-    if ( !clientServiceRecordCopy->iGPRSQOSWarningTimeOut.IsNull() )
-        {
-        origServiceRecord->iGPRSQOSWarningTimeOut.SetL(
-                clientServiceRecordCopy->iGPRSQOSWarningTimeOut );
-        }
-    if ( !clientServiceRecordCopy->iGPRSR5DataCompression.IsNull() )
-        {
-        origServiceRecord->iGPRSR5DataCompression.SetL(
-                clientServiceRecordCopy->iGPRSR5DataCompression );
-        }
-    if ( !clientServiceRecordCopy->iGPRSR5HeaderCompression.IsNull() )
-        {
-        origServiceRecord->iGPRSR5HeaderCompression.SetL(
-                clientServiceRecordCopy->iGPRSR5HeaderCompression );
-        }
-    if ( !clientServiceRecordCopy->iGPRSPacketFlowIdentifier.IsNull() )
-        {
-        origServiceRecord->iGPRSPacketFlowIdentifier.SetL(
-                clientServiceRecordCopy->iGPRSPacketFlowIdentifier );
-        }
-    if ( !clientServiceRecordCopy->iGPRSUmtsGprsRelease.IsNull() )
-        {
-        origServiceRecord->iGPRSUmtsGprsRelease.SetL(
-                clientServiceRecordCopy->iGPRSUmtsGprsRelease );
-        }
+            static_cast<CCDWCDMAPacketServiceRecord*>(
+                    aGenRecordArray[KServiceRecordIndex] );
+
+    CopyRecordFieldsL( *clientServiceRecordCopy, *origServiceRecord );
 
     if ( iPacketDataQoSRecord )
         {
@@ -1069,6 +830,8 @@
         {
         origServiceRecord->SetRecordId( KCDNewRecordRequest );
         origServiceRecord->StoreL( iSession );
+        // Have to be "reloaded" to get possible default values from template records.
+        origServiceRecord->LoadL( iSession );
 
         // Update received element ID to client's copy too.
         clientServiceRecordCopy->SetElementId( origServiceRecord->ElementId() );
@@ -1078,6 +841,8 @@
         origServiceRecord->ModifyL( iSession );
         }
 
+    CopyRecordFieldsL( *origServiceRecord, *clientServiceRecordCopy );
+
     OstTraceFunctionExit0( CCMPLUGINPACKETDATA_UPDATESERVICERECORDL_EXIT );
     }
 
@@ -1105,6 +870,7 @@
         {
         iPacketDataQoSRecord->SetRecordId( KCDNewRecordRequest );
         iPacketDataQoSRecord->StoreL( iSession );
+        iPacketDataQoSRecord->LoadL( iSession );
         packetDataQoSRecord->SetElementId( iPacketDataQoSRecord->ElementId() );
 
         // Set service record to point to QoS record.
@@ -1120,6 +886,8 @@
         iPacketDataQoSRecord->ModifyL( iSession );
         }
 
+    CopyRecordFieldsL( *iPacketDataQoSRecord, *packetDataQoSRecord );
+
     OstTraceFunctionExit0( CCMPLUGINPACKETDATA_UPDATEBEARERRECORDSL_EXIT );
     }
 
--- a/cmmanager/cmmgr/cmmplugins/cmpluginwlan/src/cmpluginwlan.cpp	Thu Jun 24 11:36:05 2010 +0300
+++ b/cmmanager/cmmgr/cmmplugins/cmpluginwlan/src/cmpluginwlan.cpp	Fri Jul 09 10:25:55 2010 +0300
@@ -130,6 +130,7 @@
     iWlanServiceRecord = NULL;
     iWlanTableId = 0;
     iWAPISupported = EFalse;
+    iBearerPriorityTableId = 0;
 
     OstTraceFunctionExit0( DUP1_CCMPLUGINWLAN_CCMPLUGINWLAN_EXIT );
     }
@@ -1297,14 +1298,14 @@
     {
     OstTraceFunctionEntry0( CCMPLUGINWLAN_DELETEBEARERRECORDSL_ENTRY );
 
-    // Save the wlan service record id for the EAP settings deletion 
+    // Save the wlan service record id for the EAP settings deletion.
     TUint wlanServiceRecordId = iWlanServiceRecord->RecordId();
-    
+
     // As base class deletes service record, in this case LAN, only WLAN
     // related stuff needs to be deleted.
     iWlanServiceRecord->DeleteL( iSession );
-    
-    // Delete EAP specific
+
+    // Delete EAP specific.
     CEapGeneralSettings* eapSettings( NULL );
     TRAPD( err, eapSettings = CEapGeneralSettings::NewL( ELan, wlanServiceRecordId ) );
     if ( err == KErrNone )
@@ -1520,95 +1521,15 @@
     iServiceRecord = static_cast<CCDLANServiceRecord *>(
             CCDRecordBase::RecordFactoryL( KCDTIdLANServiceRecord ) );
 
-    // LAN Service copy does not work so we have to copy it manually.
-
     // Plugin's commsdat copy.
-    CCDLANServiceRecord* origServiceRecord = static_cast<CCDLANServiceRecord*>( iServiceRecord );
+    CCDLANServiceRecord* origServiceRecord =
+            static_cast<CCDLANServiceRecord*>( iServiceRecord );
 
     // Client's copy of lan service record.
     CCDLANServiceRecord* clientServiceRecordCopy =
             static_cast<CCDLANServiceRecord*>( aGenRecordArray[KServiceRecordIndex] );
 
-    if ( !clientServiceRecordCopy->iRecordTag.IsNull() )
-        {
-        origServiceRecord->iRecordTag.SetL( clientServiceRecordCopy->iRecordTag );
-        }
-    if ( !clientServiceRecordCopy->iRecordName.IsNull() )
-        {
-        origServiceRecord->iRecordName.SetL( clientServiceRecordCopy->iRecordName );
-        }
-    if ( !clientServiceRecordCopy->iServiceEnableLlmnr.IsNull() )
-        {
-        origServiceRecord->iServiceEnableLlmnr.SetL( clientServiceRecordCopy->iServiceEnableLlmnr );
-        }
-    if ( !clientServiceRecordCopy->iIfNetworks.IsNull() )
-        {
-        origServiceRecord->iIfNetworks.SetL( clientServiceRecordCopy->iIfNetworks );
-        }
-    if ( !clientServiceRecordCopy->iIpNetmask.IsNull() )
-        {
-        origServiceRecord->iIpNetmask.SetL( clientServiceRecordCopy->iIpNetmask );
-        }
-    if ( !clientServiceRecordCopy->iIpGateway.IsNull() )
-        {
-        origServiceRecord->iIpGateway.SetL( clientServiceRecordCopy->iIpGateway );
-        }
-    if ( !clientServiceRecordCopy->iIpAddrFromServer.IsNull() )
-        {
-        origServiceRecord->iIpAddrFromServer.SetL( clientServiceRecordCopy->iIpAddrFromServer );
-        }
-    if ( !clientServiceRecordCopy->iIpAddr.IsNull() )
-        {
-        origServiceRecord->iIpAddr.SetL( clientServiceRecordCopy->iIpAddr );
-        }
-    if ( !clientServiceRecordCopy->iIpDnsAddrFromServer.IsNull() )
-        {
-        origServiceRecord->iIpDnsAddrFromServer.SetL( clientServiceRecordCopy->iIpDnsAddrFromServer );
-        }
-    if ( !clientServiceRecordCopy->iIpNameServer1.IsNull() )
-        {
-        origServiceRecord->iIpNameServer1.SetL( clientServiceRecordCopy->iIpNameServer1 );
-        }
-    if ( !clientServiceRecordCopy->iIpNameServer2.IsNull() )
-        {
-        origServiceRecord->iIpNameServer2.SetL( clientServiceRecordCopy->iIpNameServer2 );
-        }
-    if ( !clientServiceRecordCopy->iIp6DnsAddrFromServer.IsNull() )
-        {
-        origServiceRecord->iIp6DnsAddrFromServer.SetL( clientServiceRecordCopy->iIp6DnsAddrFromServer );
-        }
-    if ( !clientServiceRecordCopy->iIp6NameServer1.IsNull() )
-        {
-        origServiceRecord->iIp6NameServer1.SetL( clientServiceRecordCopy->iIp6NameServer1 );
-        }
-    if ( !clientServiceRecordCopy->iIp6NameServer2.IsNull() )
-        {
-        origServiceRecord->iIp6NameServer2.SetL( clientServiceRecordCopy->iIp6NameServer2 );
-        }
-    if ( !clientServiceRecordCopy->iIpAddrLeaseValidFrom.IsNull() )
-        {
-        origServiceRecord->iIpAddrLeaseValidFrom.SetL( clientServiceRecordCopy->iIpAddrLeaseValidFrom );
-        }
-    if ( !clientServiceRecordCopy->iIpAddrLeaseValidTo.IsNull() )
-        {
-        origServiceRecord->iIpAddrLeaseValidTo.SetL( clientServiceRecordCopy->iIpAddrLeaseValidTo );
-        }
-    if ( !clientServiceRecordCopy->iConfigDaemonManagerName.IsNull() )
-        {
-        origServiceRecord->iConfigDaemonManagerName.SetL( clientServiceRecordCopy->iConfigDaemonManagerName );
-        }
-    if ( !clientServiceRecordCopy->iConfigDaemonName.IsNull() )
-        {
-        origServiceRecord->iConfigDaemonName.SetL( clientServiceRecordCopy->iConfigDaemonName );
-        }
-    if ( !clientServiceRecordCopy->iServiceExtensionTableName.IsNull() )
-        {
-        origServiceRecord->iServiceExtensionTableName.SetL( clientServiceRecordCopy->iServiceExtensionTableName );
-        }
-    if ( !clientServiceRecordCopy->iServiceExtensionTableRecordId.IsNull() )
-        {
-        origServiceRecord->iServiceExtensionTableRecordId.SetL( clientServiceRecordCopy->iServiceExtensionTableRecordId ); //TODO, check this works ok.
-        }
+    CopyRecordFieldsL( *clientServiceRecordCopy, *origServiceRecord );
 
     origServiceRecord->SetElementId( clientServiceRecordCopy->ElementId() );
 
@@ -1616,17 +1537,28 @@
         {
         origServiceRecord->SetRecordId( KCDNewRecordRequest );
         origServiceRecord->StoreL( iSession );
+        // Have to be "reloaded" to get possible default values from template records.
+        origServiceRecord->LoadL( iSession );
 
         // Update received element ID to client's copy too.
         clientServiceRecordCopy->SetElementId( origServiceRecord->ElementId() );
+
+        // Copy record back to client's copy to be exactly same as in database.
+        CCmPluginBaseEng::CopyRecordFieldsL( *origServiceRecord,
+                *clientServiceRecordCopy );
+
         // Update needed values to other table records too (wlanservice).
-        CCDWlanServiceRecord* wlanServiceRecord = static_cast<CCDWlanServiceRecord *>(
-                aBearerSpecRecordArray[KWlanServiceRecordIndex] );
+        CCDWlanServiceRecord* wlanServiceRecord =
+                static_cast<CCDWlanServiceRecord *>(
+                        aBearerSpecRecordArray[KWlanServiceRecordIndex] );
         wlanServiceRecord->iWlanServiceId.SetL( origServiceRecord->RecordId() );
         }
     else
         {
         origServiceRecord->ModifyL( iSession );
+
+        CCmPluginBaseEng::CopyRecordFieldsL( *origServiceRecord,
+                *clientServiceRecordCopy );
         }
 
     OstTraceFunctionExit0( CCMPLUGINWLAN_UPDATESERVICERECORDL_EXIT );
@@ -1649,139 +1581,11 @@
     iWlanServiceRecord = new( ELeave ) CCDWlanServiceRecord( iWlanTableId );
 
     // Client's copy of wlan service record.
-    CCDWlanServiceRecord* clientWlanServiceRecord = static_cast<CCDWlanServiceRecord*>(
-            aBearerSpecRecordArray[KWlanServiceRecordIndex] );
+    CCDWlanServiceRecord* clientWlanServiceRecord =
+            static_cast<CCDWlanServiceRecord*>(
+                    aBearerSpecRecordArray[KWlanServiceRecordIndex] );
 
-    if ( !clientWlanServiceRecord->iRecordTag.IsNull() )
-        {
-        iWlanServiceRecord->iRecordTag.SetL(
-                clientWlanServiceRecord->iRecordTag );
-        }
-    if ( !clientWlanServiceRecord->iRecordName.IsNull() )
-        {
-        iWlanServiceRecord->iRecordName.SetL(
-                clientWlanServiceRecord->iRecordName );
-        }
-    if ( !clientWlanServiceRecord->iWlanServiceId.IsNull() )
-        {
-        iWlanServiceRecord->iWlanServiceId.SetL(
-                clientWlanServiceRecord->iWlanServiceId );
-        }
-    if ( !clientWlanServiceRecord->iWlanConnMode.IsNull() )
-        {
-        iWlanServiceRecord->iWlanConnMode.SetL(
-                clientWlanServiceRecord->iWlanConnMode );
-        }
-    if ( !clientWlanServiceRecord->iWLanSSID.IsNull() )
-        {
-        iWlanServiceRecord->iWLanSSID.SetL(
-                clientWlanServiceRecord->iWLanSSID );
-        }
-    if ( !clientWlanServiceRecord->iWLanUsedSSID.IsNull() )
-        {
-        iWlanServiceRecord->iWLanUsedSSID.SetL(
-                clientWlanServiceRecord->iWLanUsedSSID );
-        }
-    if ( !clientWlanServiceRecord->iWLanWepKey1.IsNull() )
-        {
-        iWlanServiceRecord->iWLanWepKey1.SetL(
-                clientWlanServiceRecord->iWLanWepKey1 );
-        }
-    if ( !clientWlanServiceRecord->iWLanWepKey2.IsNull() )
-        {
-        iWlanServiceRecord->iWLanWepKey2.SetL(
-                clientWlanServiceRecord->iWLanWepKey2 );
-        }
-    if ( !clientWlanServiceRecord->iWLanWepKey3.IsNull() )
-        {
-        iWlanServiceRecord->iWLanWepKey3.SetL(
-                clientWlanServiceRecord->iWLanWepKey3 );
-        }
-    if ( !clientWlanServiceRecord->iWLanWepKey4.IsNull() )
-        {
-        iWlanServiceRecord->iWLanWepKey4.SetL(
-                clientWlanServiceRecord->iWLanWepKey4 );
-        }
-    if ( !clientWlanServiceRecord->iWlanWepIndex.IsNull() )
-        {
-        iWlanServiceRecord->iWlanWepIndex.SetL(
-                clientWlanServiceRecord->iWlanWepIndex );
-        }
-    if ( !clientWlanServiceRecord->iWlanSecMode.IsNull() )
-        {
-        iWlanServiceRecord->iWlanSecMode.SetL(
-                clientWlanServiceRecord->iWlanSecMode );
-        }
-    if ( !clientWlanServiceRecord->iWlanAuthMode.IsNull() )
-        {
-        iWlanServiceRecord->iWlanAuthMode.SetL(
-                clientWlanServiceRecord->iWlanAuthMode );
-        }
-    if ( !clientWlanServiceRecord->iWlanEnableWpaPsk.IsNull() )
-        {
-        iWlanServiceRecord->iWlanEnableWpaPsk.SetL(
-                clientWlanServiceRecord->iWlanEnableWpaPsk );
-        }
-    if ( !clientWlanServiceRecord->iWLanWpaPreSharedKey.IsNull() )
-        {
-        iWlanServiceRecord->iWLanWpaPreSharedKey.SetL(
-                clientWlanServiceRecord->iWLanWpaPreSharedKey );
-        }
-    if ( !clientWlanServiceRecord->iWlanWpaKeyLength.IsNull() )
-        {
-        iWlanServiceRecord->iWlanWpaKeyLength.SetL(
-                clientWlanServiceRecord->iWlanWpaKeyLength );
-        }
-    if ( !clientWlanServiceRecord->iWLanEaps.IsNull() )
-        {
-        iWlanServiceRecord->iWLanEaps.SetL(
-                clientWlanServiceRecord->iWLanEaps );
-        }
-    if ( !clientWlanServiceRecord->iWlanScanSSID.IsNull() )
-        {
-        iWlanServiceRecord->iWlanScanSSID.SetL(
-                clientWlanServiceRecord->iWlanScanSSID );
-        }
-    if ( !clientWlanServiceRecord->iWlanChannelID.IsNull() )
-        {
-        iWlanServiceRecord->iWlanChannelID.SetL(
-                clientWlanServiceRecord->iWlanChannelID );
-        }
-    if ( !clientWlanServiceRecord->iWlanFormatKey1.IsNull() )
-        {
-        iWlanServiceRecord->iWlanFormatKey1.SetL(
-                clientWlanServiceRecord->iWlanFormatKey1 );
-        }
-    if ( !clientWlanServiceRecord->iWlanFormatKey2.IsNull() )
-        {
-        iWlanServiceRecord->iWlanFormatKey2.SetL(
-                clientWlanServiceRecord->iWlanFormatKey2 );
-        }
-    if ( !clientWlanServiceRecord->iWlanFormatKey3.IsNull() )
-        {
-        iWlanServiceRecord->iWlanFormatKey3.SetL(
-                clientWlanServiceRecord->iWlanFormatKey3 );
-        }
-    if ( !clientWlanServiceRecord->iWlanFormatKey4.IsNull() )
-        {
-        iWlanServiceRecord->iWlanFormatKey4.SetL(
-                clientWlanServiceRecord->iWlanFormatKey4 );
-        }
-    if ( !clientWlanServiceRecord->iWlanAllowSSIDRoaming.IsNull() )
-        {
-        iWlanServiceRecord->iWlanAllowSSIDRoaming.SetL(
-                clientWlanServiceRecord->iWlanAllowSSIDRoaming );
-        }
-    if ( !clientWlanServiceRecord->iWLanEnabledEaps.IsNull() )
-        {
-        iWlanServiceRecord->iWLanEnabledEaps.SetL(
-                clientWlanServiceRecord->iWLanEnabledEaps );
-        }
-    if ( !clientWlanServiceRecord->iWLanDisabledEaps.IsNull() )
-        {
-        iWlanServiceRecord->iWLanDisabledEaps.SetL(
-                clientWlanServiceRecord->iWLanDisabledEaps );
-        }
+    CopyRecordFieldsL( *clientWlanServiceRecord, *iWlanServiceRecord );
 
     iWlanServiceRecord->SetElementId( clientWlanServiceRecord->ElementId() );
 
@@ -1789,6 +1593,8 @@
         {
         iWlanServiceRecord->SetRecordId( KCDNewRecordRequest );
         iWlanServiceRecord->StoreL( iSession );
+        // Have to be "reloaded" to get possible default values from template records.
+        iWlanServiceRecord->LoadL( iSession );
 
         // Update received element ID to client's copy too.
         clientWlanServiceRecord->SetElementId( iWlanServiceRecord->ElementId() );
@@ -1798,6 +1604,10 @@
         iWlanServiceRecord->ModifyL( iSession );
         }
 
+    // Copy record back to client's copy to be exactly same as in database.
+    CCmPluginBaseEng::CopyRecordFieldsL( *iWlanServiceRecord,
+            *clientWlanServiceRecord );
+
     OstTraceFunctionExit0( CCMPLUGINWLAN_UPDATEBEARERRECORDSL_EXIT );
     }
 
@@ -2528,7 +2338,6 @@
     OstTraceFunctionEntry0( CCMPLUGINWLAN_GETBEARERTABLEIDSTOBEOBSERVEDL_ENTRY );
 
     aTableIdArray.AppendL( KCDTIdLANServiceRecord );
-    aTableIdArray.AppendL( KCDTIdLANBearerRecord );
     aTableIdArray.AppendL( iWlanTableId );
 
     OstTraceFunctionExit0( CCMPLUGINWLAN_GETBEARERTABLEIDSTOBEOBSERVEDL_EXIT );
--- a/cmmanager/cmmgr/cmmserver/inc/cmmcache.h	Thu Jun 24 11:36:05 2010 +0300
+++ b/cmmanager/cmmgr/cmmserver/inc/cmmcache.h	Fri Jul 09 10:25:55 2010 +0300
@@ -167,7 +167,7 @@
             CCmmConnMethodInstance& aConnMethodInstance );
 
     /**
-     * Re-loads a destination record if needed and copies the latest version to
+     * Reloads a destination record if needed and copies the latest version to
      * the session instance given as parameter.
      */
     void LoadDestinationRecordL(
@@ -237,7 +237,7 @@
             CCmmDestinationInstance& aDestinationInstance,
             const TUint32 aValue );
 
-    void DbChangeDetected( const TUint32 aTableId );
+    void DbChangeDetectedL( const TUint32 aTableId );
     void DbChangeError( const TUint32 aTableId );
 
     void CloseDestination( CCmmDestinationInstance& aDestinationInstance );
@@ -582,6 +582,12 @@
      */
     void DeleteDestinationForcedL( CCmmDestinationInstance& aDestinationInstance );
 
+    /**
+     * Informs all the loaded iaps if something related to their tables
+     * changed in commsdat.
+     */
+    void NotifyPluginsForTableChangesL( const TUint32 aTableId );
+
 private:
     // Monitors changes in the database.
     CCmmListenerManager* iListenerManager; // Owned.
@@ -627,6 +633,11 @@
     // Counter to generate new unique IDs. These are used to link new objects
     // without valid IDs between session side and cache.
     TUint32 iCurrentTemporaryId;
+
+    // Destination network table ID.
+    CommsDat::TMDBElementId iSnapTableId;
+    // Destination metadata table ID.
+    CommsDat::TMDBElementId iSnapMetadataTableId;
     };
 
 #endif // CMMCACHE_H_
--- a/cmmanager/cmmgr/cmmserver/inc/cmmconnmethodinstance.h	Thu Jun 24 11:36:05 2010 +0300
+++ b/cmmanager/cmmgr/cmmserver/inc/cmmconnmethodinstance.h	Fri Jul 09 10:25:55 2010 +0300
@@ -190,9 +190,14 @@
             const TDesC8& aValue );
 
     /**
+     * Gets the current status value.
+     */
+    TCmmConnMethodStatus GetStatus() const;
+
+    /**
      * Sets a new status value.
      */
-    void SetStatus( const TCmmConnMethodStatus& aStatus );
+    void SetStatus( const TCmmConnMethodStatus aStatus );
 
     /*
      * Called after this connection method has been updated and database
@@ -243,6 +248,9 @@
     // Connection method handle status.
     TCmmConnMethodStatus iStatus;
 
+    // Current status of the loaded commsdat records of this connection method.
+    TCmmRecordStatus iRecordStatus;
+
     // Subsession handle ID.
     TInt iHandle;
     };
--- a/cmmanager/cmmgr/cmmserver/inc/cmmconnmethodstruct.h	Thu Jun 24 11:36:05 2010 +0300
+++ b/cmmanager/cmmgr/cmmserver/inc/cmmconnmethodstruct.h	Fri Jul 09 10:25:55 2010 +0300
@@ -75,17 +75,20 @@
     TCmmConnMethodStatus GetStatus() const;
 
     /**
+     * Gets the current record status of this connection method struct.
+     */
+    TCmmRecordStatus GetRecordStatus() const;
+
+    /**
      * Sets a new status value.
      */
     void SetStatus( const TCmmConnMethodStatus& aStatus );
 
     /**
-     * Refresh the connection method data in this cache side object to be in
-     * synch with the database and copy that data back to the session side
-     * connection method instance given as parameter.
+     * Reload the connection method data in this cache side object to be in
+     * synch with the database(only if needed).
      */
-    void RefreshConnMethodInstanceL(
-            CCmmConnMethodInstance& aConnMethodInstance );
+    void ReloadPluginDataIfNeededL();
 
     /**
      * Decrease the reference counter by one. Return the remaining number of
@@ -120,6 +123,17 @@
      */
     void DeleteSuccessful( const TUint32 aNewSecondaryId );
 
+    /**
+     * Notify about a possible change in database on specified record table.
+     */
+    void NotifyRecordChange( const TUint32 aRecordType );
+
+private:
+    /**
+     * Set the record status.
+     */
+    void SetRecordStatus( const TCmmRecordStatus aStatus );
+
 private:
     // The connection method plugin.
     CCmPluginBaseEng* iConnMethodPlugin; // Owned.
@@ -139,8 +153,8 @@
     // Current status of this connection method.
     TCmmConnMethodStatus iStatus;
 
-    //TODO
-    //TCmmRecordStatus iRecordStatus;
+    // Current status of the loaded commsdat records of this connection method.
+    TCmmRecordStatus iRecordStatus;
     };
 
 #endif // CMMCONNMETHODSTRUCT_H_
--- a/cmmanager/cmmgr/cmmserver/inc/cmmdbchangelistener.h	Thu Jun 24 11:36:05 2010 +0300
+++ b/cmmanager/cmmgr/cmmserver/inc/cmmdbchangelistener.h	Fri Jul 09 10:25:55 2010 +0300
@@ -55,7 +55,13 @@
 
 private: // Methods from base class
     void DoCancel();
-    void RunL(); // Don't leave, or implement RunError() //TODO, implement RunError()
+    void RunL();
+
+    /**
+     * From CActive, handles leaves from RunL.
+     * @param aLeaveCode The leave code.
+     */
+    TInt RunError( TInt aLeaveCode );
 
 private:
     TInt RequestNotification();
--- a/cmmanager/cmmgr/cmmserver/inc/cmmdestinationstruct.h	Thu Jun 24 11:36:05 2010 +0300
+++ b/cmmanager/cmmgr/cmmserver/inc/cmmdestinationstruct.h	Fri Jul 09 10:25:55 2010 +0300
@@ -97,10 +97,14 @@
     void SetStatus( const TCmmDestinationStatus& aStatus );
 
     /**
+     * Notify about a possible change in database on specified record table.
+     */
+    void NotifyRecordChange( const TCmmDbRecords aRecordType );
+
+    /**
      * Set the record status for all records.
      */
-    void SetStatusForAllRecords( const TCmmRecordStatus& aStatus );
-
+    void SetStatusForAllRecords( const TCmmRecordStatus aStatus );
 
     /**
      * Copies the data for this destination to a session instance and
@@ -118,7 +122,7 @@
             CCmmDestinationInstance& aDestinationInstance );
 
     /**
-     * Re-loads a destination record if needed and copies the latest version to
+     * Reloads a destination record if needed and copies the latest version to
      * the session instance given as parameter.
      */
     void LoadRecordL(
--- a/cmmanager/cmmgr/cmmserver/inc/cmmlistenermanager.h	Thu Jun 24 11:36:05 2010 +0300
+++ b/cmmanager/cmmgr/cmmserver/inc/cmmlistenermanager.h	Fri Jul 09 10:25:55 2010 +0300
@@ -62,7 +62,7 @@
 public:
     void AddListenerL( TUint32 aIdentifier );
     TInt RemoveListener( TUint32 aIdentifier );
-    void DbChangeDetected( TUint32 aIdentifier );
+    void DbChangeDetectedL( TUint32 aIdentifier );
     void DbChangeError( TUint32 aIdentifier );
 
 private:
--- a/cmmanager/cmmgr/cmmserver/src/cmmanagerimpl.cpp	Thu Jun 24 11:36:05 2010 +0300
+++ b/cmmanager/cmmgr/cmmserver/src/cmmanagerimpl.cpp	Fri Jul 09 10:25:55 2010 +0300
@@ -209,6 +209,7 @@
 //
 CommsDat::TMDBElementId CCmManagerImpl::TableId( TCmmDbRecords aRecord )
     {
+    // No traces.
     CommsDat::TMDBElementId tableId( 0 );
     switch ( aRecord )
         {
@@ -260,7 +261,6 @@
 //
 CommsDat::CMDBSession& CCmManagerImpl::Session() const
     {
-    OstTraceFunctionEntry0( CCMMANAGERIMPL_SESSION_ENTRY );
     return iTrans->Session();
     }
 
--- a/cmmanager/cmmgr/cmmserver/src/cmmcache.cpp	Thu Jun 24 11:36:05 2010 +0300
+++ b/cmmanager/cmmgr/cmmserver/src/cmmcache.cpp	Fri Jul 09 10:25:55 2010 +0300
@@ -125,6 +125,9 @@
     iBearerPriorityCache = NULL;
     iCurrentTemporaryId = KTemporaryIdCounterStart;
 
+    iSnapTableId = 0;
+    iSnapMetadataTableId = 0;
+
     OstTraceFunctionExit0( DUP1_CCMMCACHE_CCMMCACHE_EXIT );
     }
 
@@ -144,6 +147,41 @@
     iListenerManager = CCmmListenerManager::NewL( this );
     iInstanceMapping = CCmmInstanceMapping::NewL( *this );
 
+    // Create CommsDat listeners to detect changes to the database from external sources.
+    RArray<TUint32> tableIdArray;
+    CleanupClosePushL( tableIdArray );
+
+    iSnapTableId = iCmManagerImpl->TableId( ECmmDbSnapRecord );
+    iSnapMetadataTableId = iCmManagerImpl->TableId( ECmmDestMetadataRecord );
+
+    // Instancemapping needs notifications on following tables.
+    tableIdArray.Append( CommsDat::KCDTIdIAPRecord );
+    tableIdArray.Append( CommsDat::KCDTIdVPNServiceRecord );
+    tableIdArray.Append( iSnapTableId );
+    tableIdArray.Append( iSnapMetadataTableId );
+
+    // Destinations need notifications on following tables.
+    tableIdArray.Append( CommsDat::KCDTIdNetworkRecord );
+    tableIdArray.Append( CommsDat::KCDTIdAccessPointRecord );
+    // Destination metadata table was already added.
+
+    // Connection methods need notifications on following tables.
+    TInt pluginCount( iPlugins->Count() );
+    if ( pluginCount )
+        {
+        ( *iPlugins )[0]->GetGenericTableIdsToBeObservedL( tableIdArray );
+        for( TInt i = 0; i < pluginCount; i++ )
+            {
+            ( *iPlugins )[i]->GetBearerTableIdsToBeObservedL( tableIdArray );
+            }
+        }
+
+    for ( TInt i = 0; i < tableIdArray.Count(); i++ )
+        {
+        iListenerManager->AddListenerL( tableIdArray[i] );
+        }
+    CleanupStack::PopAndDestroy( &tableIdArray );
+
     OstTraceFunctionExit0( CCMMCACHE_CONSTRUCTL_EXIT );
     }
 
@@ -270,14 +308,17 @@
     if ( !aDestinationInstance )
         {
         // Check connection method exists in database.
-        validAttributes = iInstanceMapping->ValidConnMethodId( aConnMethodId ); // Embedded destinations not included.
+        // Embedded destinations not included.
+        validAttributes = iInstanceMapping->ValidConnMethodId( aConnMethodId );
         }
     else
         {
         // Check connection method is inside the destination.
-        if ( aDestinationInstance->ValidConnMethodIdInDestinationIncludeEmbedded( aConnMethodId ) )
+        if ( aDestinationInstance->
+                ValidConnMethodIdInDestinationIncludeEmbedded( aConnMethodId ) )
             {
-            // Check connection method (can be embedded destination too) exists in database.
+            // Check connection method (can be embedded destination too)
+            // exists in database.
             if ( iInstanceMapping->ValidConnMethodId( aConnMethodId ) ||
                     iInstanceMapping->ValidDestinationId( aConnMethodId ) )
                 {
@@ -296,9 +337,17 @@
     TInt index = FindConnMethodFromCache( aConnMethodId );
     if ( index != KErrNotFound )
         {
+        // Update data from commsdat if necessary.
+        if ( iConnMethodArray[index]->GetRecordStatus() == ECmmRecordStatusExpired )
+            {
+            iConnMethodArray[index]->ReloadPluginDataIfNeededL();
+            // CopyDataL() will set the internal state of aConnMethodInstance.
+            }
+
         // Already open in cache. Copy the connection method data to session
         // instance.
-        aConnMethodInstance.CopyDataL( iConnMethodArray[index] ); // Will increase reference counter.
+        // Will increase reference counter.
+        aConnMethodInstance.CopyDataL( iConnMethodArray[index] );
         }
     else
         {
@@ -339,7 +388,15 @@
         return;
         }
 
-    iConnMethodArray[index]->RefreshConnMethodInstanceL( aConnMethodInstance );
+    iConnMethodArray[index]->ReloadPluginDataIfNeededL();
+    if ( iConnMethodArray[index]->GetStatus() == ECmmConnMethodStatusValid
+            || iConnMethodArray[index]->GetStatus() == ECmmConnMethodStatusToBeDeleted )
+        {
+        iConnMethodArray[index]->GetPlugin()->GetPluginDataL( 
+                aConnMethodInstance.GetPluginDataInstance() );
+        }
+    // Internal state need to be set to the same state as after a successfull update.
+    aConnMethodInstance.UpdateSuccessful();
 
     OstTraceFunctionExit0( DUP1_CCMMCACHE_REFRESHCONNMETHODL_EXIT );
     }
@@ -475,7 +532,7 @@
     }
 
 // ---------------------------------------------------------------------------
-// Re-loads a destination record if needed and copies the latest version to
+// Reloads a destination record if needed and copies the latest version to
 // the session instance given as parameter.
 // ---------------------------------------------------------------------------
 //
@@ -1618,16 +1675,120 @@
 // needed.
 // ---------------------------------------------------------------------------
 //
-void CCmmCache::DbChangeDetected( const TUint32 aTableId )
+void CCmmCache::DbChangeDetectedL( const TUint32 aTableId )
     {
     OstTraceFunctionEntry0( CCMMCACHE_DBCHANGEDETECTED_ENTRY );
 
-    (void)aTableId; //TODO
-    // Flag the table as: currently not up-to-date
+    if ( aTableId == iSnapMetadataTableId )
+        {
+        for ( TInt i = 0; i < iDestinationArray.Count(); i++ )
+            {
+            iDestinationArray[i]->NotifyRecordChange( ECmmDestMetadataRecord );
+            }
+        }
+    else if ( aTableId == CommsDat::KCDTIdNetworkRecord )
+        {
+        // Affects destinations.
+        for ( TInt i = 0; i < iDestinationArray.Count(); i++ )
+            {
+            iDestinationArray[i]->NotifyRecordChange( ECmmDestNetworkRecord );
+            }
+        }
+    else if ( aTableId == CommsDat::KCDTIdAccessPointRecord )
+        {
+        // Affects destinations.
+        for ( TInt i = 0; i < iDestinationArray.Count(); i++ )
+            {
+            iDestinationArray[i]->NotifyRecordChange( ECmmDestApRecord );
+            }
+        }
+
+    // Notify Connection Methods about the table changes in CommsDat.
+    NotifyPluginsForTableChangesL( aTableId );
+
+    // Update instancemapping.
+    iInstanceMapping->RefreshL();
+
     OstTraceFunctionExit0( CCMMCACHE_DBCHANGEDETECTED_EXIT );
     }
 
 // ---------------------------------------------------------------------------
+// Informs all the loaded iaps if something related to their tables
+// changed in commsdat.
+// ---------------------------------------------------------------------------
+//
+void CCmmCache::NotifyPluginsForTableChangesL( const TUint32 aTableId )
+    {
+    OstTraceFunctionEntry0( CCMMCACHE_NOTIFYPLUGINSFORTABLECHANGESL_ENTRY );
+
+    if ( iConnMethodArray.Count() )
+        {
+        RArray<TUint32> tableIdArray;
+        CleanupClosePushL( tableIdArray );
+
+        // Check if change concerns some table generic for all iaps
+        ( *iPlugins )[0]->GetGenericTableIdsToBeObservedL( tableIdArray );
+        TBool generic( EFalse );
+        for( TInt i = 0; i < tableIdArray.Count(); i++ )
+            {
+            if ( aTableId == tableIdArray[i] )
+                {
+                generic = ETrue;
+                break;
+                }
+            }
+
+        if ( generic )
+            {
+            // generic-->Notify all iaps
+            for( TInt i = 0; i < iConnMethodArray.Count(); i++ )
+                {
+                iConnMethodArray[i]->NotifyRecordChange( aTableId );
+                }
+            }
+        else
+            {
+            // Not generic: Check bearer specific tables
+            RArray<TUint32> affectedBearersArray;
+            CleanupClosePushL( affectedBearersArray );
+            for( TInt i = 0; i < iPlugins->Count(); i++ )
+                {
+                tableIdArray.Reset();
+                ( *iPlugins )[i]->GetBearerTableIdsToBeObservedL( tableIdArray );
+                TInt idCount = tableIdArray.Count();
+                for( TInt j = 0; j < idCount; j++ )
+                    {
+                    if ( aTableId == tableIdArray[j] )
+                        {
+                        // Save the bearer type id which is affected
+                        affectedBearersArray.AppendL(
+                                ( *iPlugins )[i]->GetBearerInfoIntL(
+                                        CMManager::ECmBearerType ) );
+                        }
+                    }
+                }
+
+            // Go through all the loaded iaps and notify all the iaps
+            // which have the same bearer type saved above
+            for( TInt i = 0; i < iConnMethodArray.Count(); i++ )
+                {
+                for( TInt j = 0; j < affectedBearersArray.Count(); j++ )
+                    {
+                    if ( iConnMethodArray[i]->GetBearerType() == affectedBearersArray[j] )
+                        {
+                        iConnMethodArray[i]->NotifyRecordChange( aTableId );
+                        break;
+                        }
+                    }
+                }
+            CleanupStack::PopAndDestroy( &affectedBearersArray );
+            }
+        CleanupStack::PopAndDestroy( &tableIdArray );
+        }
+    OstTraceFunctionExit0( CCMMCACHE_NOTIFYPLUGINSFORTABLECHANGESL_EXIT );
+    }
+
+// ---------------------------------------------------------------------------
 // Tells the cache that an error has occured with a database listener. Any
 // reads to this table need go through the database, since cache can't know if
 // it has up-to-date information.
@@ -1639,6 +1800,15 @@
 
     (void)aTableId; //TODO
     // Flag the table as: permanently not up-to-date
+
+    //TODO, How to do this?
+    // Implement some 'status locked' flags that are always checked before changing status back to 'loaded' after reading database?
+    // Or move record status info to CCmmCache-class?
+    // What about plugins?
+	// Or just ignore errors with notifiers?
+
+    // For now, just ignore errors.
+
     OstTraceFunctionExit0( CCMMCACHE_DBCHANGEERROR_EXIT );
     }
 
@@ -2128,13 +2298,15 @@
 
     // Find out the connection method bearer type.
     TUint32 bearerType( 0 );
-    User::LeaveIfError( iInstanceMapping->GetConnMethodBearerType( aConnMethodId, bearerType ) );
+    User::LeaveIfError( iInstanceMapping->
+            GetConnMethodBearerType( aConnMethodId, bearerType ) );
 
     // Check bearer type support and create plugin instance.
     CCmPluginBaseEng* plugin = NULL;
     for ( TInt i = 0; i < iPlugins->Count(); i++ )
         {
-        if ( ( *iPlugins )[i]->GetBearerInfoIntL( CMManager::ECmBearerType ) == bearerType )
+        if ( ( *iPlugins )[i]->GetBearerInfoIntL(
+                CMManager::ECmBearerType ) == bearerType )
             {
             TCmPluginInitParam pluginParams( Session() );
             plugin = ( *iPlugins )[i]->CreateInstanceL( pluginParams );
@@ -2181,7 +2353,8 @@
     if ( index != KErrNotFound )
         {
         // Already open in cache. Copy the connection method to session instance.
-        cmInstance->CopyDataL( iConnMethodArray[index] ); // Will increase reference counter.
+        // Will increase reference counter.
+        cmInstance->CopyDataL( iConnMethodArray[index] );
         }
     else
         {
@@ -2215,7 +2388,8 @@
     if ( index != KErrNotFound )
         {
         // Already open in cache. Copy the connection method to session instance.
-        cmInstance->CopyDataL( iConnMethodArray[index] ); // Will increase reference counter.
+        // Will increase reference counter.
+        cmInstance->CopyDataL( iConnMethodArray[index] );
         }
     else
         {
@@ -2249,7 +2423,8 @@
     if ( index != KErrNotFound )
         {
         // Already open in cache. Copy the connection method to session instance.
-        cmInstance->CopyDataL( iConnMethodArray[index] ); // Will increase reference counter.
+        // Will increase reference counter.
+        cmInstance->CopyDataL( iConnMethodArray[index] );
         }
     else
         {
--- a/cmmanager/cmmgr/cmmserver/src/cmmconnmethodinstance.cpp	Thu Jun 24 11:36:05 2010 +0300
+++ b/cmmanager/cmmgr/cmmserver/src/cmmconnmethodinstance.cpp	Fri Jul 09 10:25:55 2010 +0300
@@ -104,6 +104,7 @@
     iConnMethodId = 0;
     iBearerType = 0;
     iStatus = ECmmConnMethodStatusChanged;
+    iRecordStatus = ECmmRecordStatusBlank;
     iHandle = 0;
 
     OstTraceFunctionExit0( DUP1_CCMMCONNMETHODINSTANCE_CCMMCONNMETHODINSTANCE_EXIT );
@@ -256,11 +257,13 @@
         case ECmmConnMethodStatusToBeDeleted:
             {
             iStatus = ECmmConnMethodStatusChanged;
+            iRecordStatus = ECmmRecordStatusUnsaved;
             }
             break;
         case ECmmConnMethodStatusValid:
             {
             iStatus = ECmmConnMethodStatusValid;
+            iRecordStatus = ECmmRecordStatusLoaded;
             }
             break;
         case ECmmConnMethodStatusChanged:
@@ -466,6 +469,8 @@
 
     iPlugin->SetIntAttributeL( aAttribute, aValue, iPluginDataInstance );
 
+    iRecordStatus = ECmmRecordStatusModified;
+
     OstTraceFunctionExit0( CCMMCONNMETHODINSTANCE_SETINTATTRIBUTEL_EXIT );
     }
 
@@ -486,6 +491,8 @@
 
     iPlugin->SetBoolAttributeL( aAttribute, aValue, iPluginDataInstance );
 
+    iRecordStatus = ECmmRecordStatusModified;
+
     OstTraceFunctionExit0( CCMMCONNMETHODINSTANCE_SETBOOLATTRIBUTEL_EXIT );
     }
 
@@ -506,6 +513,8 @@
 
     iPlugin->SetStringAttributeL( aAttribute, aValue, iPluginDataInstance );
 
+    iRecordStatus = ECmmRecordStatusModified;
+
     OstTraceFunctionExit0( CCMMCONNMETHODINSTANCE_SETSTRINGATTRIBUTEL_EXIT );
     }
 
@@ -526,6 +535,8 @@
 
     iPlugin->SetString8AttributeL( aAttribute, aValue, iPluginDataInstance );
 
+    iRecordStatus = ECmmRecordStatusModified;
+
     OstTraceFunctionExit0( CCMMCONNMETHODINSTANCE_SETSTRING8ATTRIBUTEL_EXIT );
     }
 
@@ -533,7 +544,7 @@
 // Sets a new status value.
 // ---------------------------------------------------------------------------
 //
-void CCmmConnMethodInstance::SetStatus( const TCmmConnMethodStatus& aStatus )
+void CCmmConnMethodInstance::SetStatus( const TCmmConnMethodStatus aStatus )
     {
     OstTraceFunctionEntry0( CCMMCONNMETHODINSTANCE_SETSTATUS_ENTRY );
 
@@ -553,6 +564,7 @@
     OstTraceFunctionEntry0( CCMMCONNMETHODINSTANCE_UPDATESUCCESSFUL_ENTRY );
 
     SetStatus( ECmmConnMethodStatusValid );
+    iRecordStatus = ECmmRecordStatusLoaded;
 
     OstTraceFunctionExit0( CCMMCONNMETHODINSTANCE_UPDATESUCCESSFUL_EXIT );
     }
@@ -568,6 +580,7 @@
     OstTraceFunctionEntry0( CCMMCONNMETHODINSTANCE_DELETESUCCESSFUL_ENTRY );
 
     SetStatus( ECmmConnMethodStatusChanged );
+    iRecordStatus = ECmmRecordStatusModified;
     SetId( aNewSecondaryId );
 
     OstTraceFunctionExit0( CCMMCONNMETHODINSTANCE_DELETESUCCESSFUL_EXIT );
@@ -606,4 +619,13 @@
         }
     }
 
+// ---------------------------------------------------------------------------
+// Gets the current status value.
+// ---------------------------------------------------------------------------
+//
+TCmmConnMethodStatus CCmmConnMethodInstance::GetStatus() const
+    {
+    return iStatus;
+    }
+
 // End of file
--- a/cmmanager/cmmgr/cmmserver/src/cmmconnmethodstruct.cpp	Thu Jun 24 11:36:05 2010 +0300
+++ b/cmmanager/cmmgr/cmmserver/src/cmmconnmethodstruct.cpp	Fri Jul 09 10:25:55 2010 +0300
@@ -90,9 +90,10 @@
     OstTraceFunctionEntry0( DUP1_CCMMCONNMETHODSTRUCT_CCMMCONNMETHODSTRUCT_ENTRY );
 
     iConnMethodPlugin = NULL;
+    iReferenceCounter = 0;
     iBearerType = 0;
     iStatus = ECmmConnMethodStatusNotSaved;
-    iReferenceCounter = 0;
+    iRecordStatus = ECmmRecordStatusBlank;
 
     OstTraceFunctionExit0( DUP1_CCMMCONNMETHODSTRUCT_CCMMCONNMETHODSTRUCT_EXIT );
     }
@@ -172,13 +173,11 @@
     }
 
 // ---------------------------------------------------------------------------
-// Refresh the connection method data in this cache side object to be in synch
-// with the database and copy that data back to the session side connection
-// method instance given as parameter.
+// Reload the connection method data in this cache side object to be in synch
+// with the database(only if needed).
 // ---------------------------------------------------------------------------
 //
-void CCmmConnMethodStruct::RefreshConnMethodInstanceL(
-        CCmmConnMethodInstance& aConnMethodInstance )
+void CCmmConnMethodStruct::ReloadPluginDataIfNeededL()
     {
     OstTraceFunctionEntry0( CCMMCONNMETHODSTRUCT_REFRESHCONNMETHODINSTANCEL_ENTRY );
 
@@ -192,12 +191,11 @@
         case ECmmConnMethodStatusValid:
         case ECmmConnMethodStatusToBeDeleted:
             {
-            //TODO, add record status check later and only call Reload() if necessary. TCmmRecordStatus
-            //if ( !aConnMethodStruct->UpToDate() )
-            //    {
+            if ( iRecordStatus == ECmmRecordStatusExpired )
+                {
                 iConnMethodPlugin->ReLoadL();
-            //    }
-            iConnMethodPlugin->GetPluginDataL( aConnMethodInstance.GetPluginDataInstance() );
+                SetRecordStatus( ECmmRecordStatusLoaded );
+                }
             }
             break;
         case ECmmConnMethodStatusNotSaved: // This is checked before.
@@ -207,9 +205,6 @@
             break;
         }
 
-    // Internal state need to be set to the same state as after a successfull update.
-    aConnMethodInstance.UpdateSuccessful();
-
     OstTraceFunctionExit0( CCMMCONNMETHODSTRUCT_REFRESHCONNMETHODINSTANCEL_EXIT );
     }
 
@@ -256,16 +251,26 @@
 
     switch ( aStatus )
         {
-        // Fallthrough intended
         case ECmmConnMethodStatusNotSaved:
+            {
+            iStatus = aStatus;
+            iRecordStatus = ECmmRecordStatusUnsaved;
+            }
+            break;
         case ECmmConnMethodStatusValid:
+            {
             iStatus = aStatus;
+            iRecordStatus = ECmmRecordStatusLoaded;
+            }
             break;
         case ECmmConnMethodStatusChanged:
         case ECmmConnMethodStatusToBeDeleted:
+        // Fallthrough intended.
         default:
+            {
             iStatus = ECmmConnMethodStatusChanged;
             ASSERT( 0 ); // Error, invalid status as argument.
+            }
             break;
         }
 
@@ -307,7 +312,40 @@
     {
     OstTraceFunctionEntry0( CCMMCONNMETHODSTRUCT_UPDATESUCCESSFUL_ENTRY );
     iStatus = ECmmConnMethodStatusValid;
+    SetRecordStatus( ECmmRecordStatusLoaded );
+
     OstTraceFunctionExit0( CCMMCONNMETHODSTRUCT_UPDATESUCCESSFUL_EXIT );
     }
 
+// ---------------------------------------------------------------------------
+// Set the record status.
+// ---------------------------------------------------------------------------
+//
+void CCmmConnMethodStruct::SetRecordStatus( const TCmmRecordStatus aStatus )
+    {
+    iRecordStatus = aStatus;
+    }
+
+// ---------------------------------------------------------------------------
+// Notify about a possible change in database on specified record table.
+// ---------------------------------------------------------------------------
+//
+void CCmmConnMethodStruct::NotifyRecordChange( const TUint32 /*aRecordType*/ )
+    {
+    // Only change status if it is currently ECmmRecordStatusLoaded.
+    if ( iRecordStatus == ECmmRecordStatusLoaded )
+        {
+        iRecordStatus = ECmmRecordStatusExpired;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Return the status of the records.
+// ---------------------------------------------------------------------------
+//
+TCmmRecordStatus CCmmConnMethodStruct::GetRecordStatus() const
+    {
+    return iRecordStatus;
+    }
+
 // End of file
--- a/cmmanager/cmmgr/cmmserver/src/cmmdbchangelistener.cpp	Thu Jun 24 11:36:05 2010 +0300
+++ b/cmmanager/cmmgr/cmmserver/src/cmmdbchangelistener.cpp	Fri Jul 09 10:25:55 2010 +0300
@@ -122,9 +122,7 @@
 //
 TUint32 CCmmDbChangeListener::GetTableId()
     {
-    OstTraceFunctionEntry0( CCMMDBCHANGELISTENER_GETTABLEID_ENTRY );
-    OstTraceFunctionExit0( CCMMDBCHANGELISTENER_GETTABLEID_EXIT );
-
+    // No traces.
     return iTableId;
     }
 
@@ -188,7 +186,7 @@
     TInt err = RequestNotification(); // Start to listen for next change.
 
     // React to current change notification
-    iListenerManager->DbChangeDetected( iTableId );
+    iListenerManager->DbChangeDetectedL( iTableId );
 
     if ( err )
         {
@@ -217,4 +215,15 @@
     return err;
     }
 
+// -----------------------------------------------------------------------------
+// Handles the leave from the RunL()
+// -----------------------------------------------------------------------------
+//
+TInt CCmmDbChangeListener::RunError( TInt /*aLeaveCode*/ )
+    {
+    OstTrace0( TRACE_ERROR, CCMMDBCHANGELISTENER_RUNERROR, "CCmmDbChangeListener::RunError" );
+
+    return KErrNone;
+    }
+
 // End of file
--- a/cmmanager/cmmgr/cmmserver/src/cmmdestinationinstance.cpp	Thu Jun 24 11:36:05 2010 +0300
+++ b/cmmanager/cmmgr/cmmserver/src/cmmdestinationinstance.cpp	Fri Jul 09 10:25:55 2010 +0300
@@ -469,7 +469,7 @@
             break;
         }
 
-    // Not Internet, operator or intranet, or something went wrong. 
+    // Not Internet, operator or intranet, or something went wrong.
     if ( !isLocalised || ( isLocalised && !resolvedText ) )
         {
         resolvedText = TPtrC( iNetworkRecord->iRecordName ).AllocL();
@@ -710,7 +710,7 @@
     }
 
 // ---------------------------------------------------------------------------
-// Return true if protection level has been changed. 
+// Return true if protection level has been changed.
 // ---------------------------------------------------------------------------
 //
 TBool CCmmDestinationInstance::ProtectionChanged()
@@ -813,24 +813,21 @@
     // The final position will be between 0 and relevantCount.
     TInt index( relevantCount );
 
-    // If this is a virtual IAP that doesn't point to an IAP, position it at
-    // the end of the list.
+    TBool positionFound( EFalse );
     TBool connMethodIsVirtual = aConnMethodInstance.GetBoolAttributeL( CMManager::ECmVirtual );
-    TUint32 linkedIapId( 0 );
     if ( connMethodIsVirtual )
         {
         // Ask link information only if this is a virtual IAP.
-        linkedIapId = aConnMethodInstance.GetIntAttributeL( CMManager::ECmNextLayerIapId );
+        TUint32 linkedIapId = aConnMethodInstance.GetIntAttributeL( CMManager::ECmNextLayerIapId );
         if ( linkedIapId == 0 )
             {
+            // If this is a virtual IAP that doesn't point to an IAP, position it at
+            // the end of the list.
             item.iPriority = CMManager::KDataMobilitySelectionPolicyPriorityWildCard;
             index = relevantCount;
+            positionFound = ETrue;
             }
-        }
-    else
-        {
-        TBool positionFound( EFalse );
-        if ( connMethodIsVirtual )
+        else
             {
             // If this is a virtual IAP that links to another IAP, position it
             // as if it was that IAP.
@@ -849,31 +846,31 @@
             bearerType = linkedItem.iBearerType;
             bearerPriority = linkedItem.iBearerPriority;
             }
+        }
 
-        if ( !positionFound )
+    if ( !positionFound )
+        {
+        // Search for any connection methods with the same bearer type.
+        for ( TInt i = 0; i < relevantCount; i++ )
             {
-            // Search for any connection methods with the same bearer type.
-            for ( TInt i = 0; i < relevantCount; i++ )
+            if ( iConnMethodItemArray[i].iBearerType == bearerType )
                 {
-                if ( iConnMethodItemArray[i].iBearerType == bearerType )
-                    {
-                    index = i + 1;
-                    positionFound = ETrue;
-                    // Don't break, need find last item.
-                    }
+                index = i + 1;
+                positionFound = ETrue;
+                // Don't break, need find last item.
                 }
             }
-        if ( !positionFound )
+        }
+    if ( !positionFound )
+        {
+        // No connection method found with the same bearer type. Position
+        // the connection method according to bearer priority.
+        for ( TInt i = 0; i < relevantCount; i++ )
             {
-            // No connection method found with the same bearer type. Position
-            // the connection method according to bearer priority.
-            for ( TInt i = 0; i < relevantCount; i++ )
+            if ( iConnMethodItemArray[i].iBearerPriority >= bearerPriority )
                 {
-                if ( iConnMethodItemArray[i].iBearerPriority >= bearerPriority )
-                    {
-                    index = i;
-                    break;
-                    }
+                index = i;
+                break;
                 }
             }
         }
--- a/cmmanager/cmmgr/cmmserver/src/cmmdestinationstruct.cpp	Thu Jun 24 11:36:05 2010 +0300
+++ b/cmmanager/cmmgr/cmmserver/src/cmmdestinationstruct.cpp	Fri Jul 09 10:25:55 2010 +0300
@@ -406,10 +406,57 @@
     }
 
 // ---------------------------------------------------------------------------
+// Notify about a possible change in database on specified record table.
+// ---------------------------------------------------------------------------
+//
+void CCmmDestinationStruct::NotifyRecordChange( const TCmmDbRecords aRecordType )
+    {
+    OstTraceFunctionEntry0( CCMMDESTINATIONSTRUCT_NOTIFYRECORDCHANGE_ENTRY );
+
+    // Only change status if it is currently ECmmRecordStatusLoaded.
+    switch ( aRecordType )
+        {
+        case ECmmDestNetworkRecord:
+            {
+            if ( iNetworkRecordStatus == ECmmRecordStatusLoaded )
+                {
+                iNetworkRecordStatus = ECmmRecordStatusExpired;
+                }
+            }
+            break;
+        case ECmmDestApRecord:
+            {
+            if ( iDestApRecordStatus == ECmmRecordStatusLoaded )
+                {
+                iDestApRecordStatus = ECmmRecordStatusExpired;
+                }
+            }
+            break;
+        case ECmmDestMetadataRecord:
+            {
+            if ( iMetadataRecordStatus == ECmmRecordStatusLoaded )
+                {
+                iMetadataRecordStatus = ECmmRecordStatusExpired;
+                }
+            }
+            break;
+        case ECmmDbSnapRecord:
+        case ECmmDbBearerPriorityRecord:
+        case ECmmDbDefConnRecord:
+        // Fallthrough intended.
+        default:
+            // The record table doesn't affect destinations, just ignore it.
+            break;
+        }
+
+    OstTraceFunctionExit0( CCMMDESTINATIONSTRUCT_NOTIFYRECORDCHANGE_EXIT );
+    }
+
+// ---------------------------------------------------------------------------
 // Set the record status for all records.
 // ---------------------------------------------------------------------------
 //
-void CCmmDestinationStruct::SetStatusForAllRecords( const TCmmRecordStatus& aStatus )
+void CCmmDestinationStruct::SetStatusForAllRecords( const TCmmRecordStatus aStatus )
     {
     OstTraceFunctionEntry0( CCMMDESTINATIONSTRUCT_SETSTATUSFORALLRECORDS_ENTRY );
 
@@ -527,7 +574,7 @@
     }
 
 // ---------------------------------------------------------------------------
-// Re-loads a destination record if needed and copies the latest version to
+// Reloads a destination record if needed and copies the latest version to
 // the session instance given as parameter.
 // ---------------------------------------------------------------------------
 //
@@ -551,23 +598,6 @@
     // ECmmRecordStatusModified  Error, session side only status
     // ECmmRecordStatusUnsaved   Skip load, not in database
 
-    //TODO, temporary block start
-    // Remove this codeblock after database change listeners are in place. This
-    // will force a database reload.
-    if ( iNetworkRecordStatus == ECmmRecordStatusLoaded )
-        {
-        iNetworkRecordStatus = ECmmRecordStatusExpired;
-        }
-    if ( iDestApRecordStatus == ECmmRecordStatusLoaded )
-        {
-        iDestApRecordStatus = ECmmRecordStatusExpired;
-        }
-    if ( iMetadataRecordStatus == ECmmRecordStatusLoaded )
-        {
-        iMetadataRecordStatus = ECmmRecordStatusExpired;
-        }
-    //TODO, temporary block end
-
     CommsDat::CCDRecordBase* aRecordPointer;
 
     switch ( aRecordType )
@@ -661,7 +691,7 @@
         {
         case ECmmDestinationStatusValid:
             {
-            if ( iStatus != ECmmDestinationStatusValid ) //TODO, how will external db changes affect this?
+            if ( iStatus != ECmmDestinationStatusValid )
                 {
                 // Error, a 'valid'-status on session side implies a 'valid'-status on cache side.
                 User::Leave( KErrCorrupt );
--- a/cmmanager/cmmgr/cmmserver/src/cmminstancemapping.cpp	Thu Jun 24 11:36:05 2010 +0300
+++ b/cmmanager/cmmgr/cmmserver/src/cmminstancemapping.cpp	Fri Jul 09 10:25:55 2010 +0300
@@ -87,6 +87,7 @@
     OstTraceFunctionEntry0( DUP1_CDESTINATION_CDESTINATION_ENTRY );
 
     iId = 0;
+    iMetadata = 0;
 
     OstTraceFunctionExit0( DUP1_CDESTINATION_CDESTINATION_EXIT );
     }
@@ -523,10 +524,10 @@
         RArray<TUint32>& aDestinationIds ) const
     {
     OstTraceFunctionEntry0( CCMMINSTANCEMAPPING_DESTINATIONSCONTAININGCONNMETHODL_ENTRY );
-    
+
     aDestinationIds.Reset();
     TInt count( 0 );
-    
+
     // Go through each destination.
     for ( TInt i = 0; i < iDestinations.Count(); i++ )
         {
@@ -558,7 +559,7 @@
                 }
             }
         }
-    
+
     OstTraceFunctionExit0( CCMMINSTANCEMAPPING_DESTINATIONSCONTAININGCONNMETHODL_EXIT );
     }
 
@@ -1354,7 +1355,7 @@
                 }
             }
         }
-    
+
     OstTraceFunctionExit0( DUP1_CCMMINSTANCEMAPPING_REMOVECONNMETHOD_EXIT );
     }
 
@@ -1426,11 +1427,11 @@
     }
 
 // ---------------------------------------------------------------------------
-// Iterate through destinations to find the one identified with parameter
-// and returns its metadata mask.
+// Iterate through destinations to find the one identified with provided ID
+// and return its metadata.
 // ---------------------------------------------------------------------------
 //
-TUint32 CCmmInstanceMapping::DestinationMetadata( 
+TUint32 CCmmInstanceMapping::DestinationMetadata(
         const TUint32 aDestinationId ) const
     {
     OstTraceFunctionEntry0( CCMMINSTANCEMAPPING_DESTINATIONMETADATA_ENTRY );
--- a/cmmanager/cmmgr/cmmserver/src/cmmlistenermanager.cpp	Thu Jun 24 11:36:05 2010 +0300
+++ b/cmmanager/cmmgr/cmmserver/src/cmmlistenermanager.cpp	Fri Jul 09 10:25:55 2010 +0300
@@ -88,9 +88,6 @@
 void CCmmListenerManager::ConstructL()
     {
     OstTraceFunctionEntry0( CCMMLISTENERMANAGER_CONSTRUCTL_ENTRY );
-
-    // Create the basic set of listeners, start them if necessary and store them in iListeners-array.
-
     OstTraceFunctionExit0( CCMMLISTENERMANAGER_CONSTRUCTL_EXIT );
     }
 
@@ -156,11 +153,11 @@
 // database table.
 // ---------------------------------------------------------------------------
 //
-void CCmmListenerManager::DbChangeDetected( TUint32 aIdentifier )
+void CCmmListenerManager::DbChangeDetectedL( TUint32 aIdentifier )
     {
     OstTraceFunctionEntry0( CCMMLISTENERMANAGER_DBCHANGEDETECTED_ENTRY );
 
-    iCache->DbChangeDetected( aIdentifier );
+    iCache->DbChangeDetectedL( aIdentifier );
 
     OstTraceFunctionExit0( CCMMLISTENERMANAGER_DBCHANGEDETECTED_EXIT );
     }
--- a/cmmanager/cmmgr/cmmserver/src/cmmsrvstatic.cpp	Thu Jun 24 11:36:05 2010 +0300
+++ b/cmmanager/cmmgr/cmmserver/src/cmmsrvstatic.cpp	Fri Jul 09 10:25:55 2010 +0300
@@ -41,7 +41,8 @@
     // Initialisation complete, now signal the client.
     RProcess::Rendezvous( KErrNone );
 
-    // Ready to run.
+    // Ready to run. This will return only when CCmmDelayedShutdown calls
+    // CActiveScheduler::Stop().
     CActiveScheduler::Start();
 
     // Cleanup the server and scheduler.
--- a/cmmanager/cppacketdataapplugin/src/cppacketdataapadvancedview.cpp	Thu Jun 24 11:36:05 2010 +0300
+++ b/cmmanager/cppacketdataapplugin/src/cppacketdataapadvancedview.cpp	Fri Jul 09 10:25:55 2010 +0300
@@ -165,6 +165,7 @@
             SIGNAL(currentIndexChanged(int)),
             this,
             SLOT(changeNetworkType(int)));
+        mNetworkType->setContentWidgetData("objectName", "networkTypeCB");
         mIpGroup->appendChild(mNetworkType);
         
         mCurrentNetworkType = getNetworkType();
@@ -305,6 +306,7 @@
         SIGNAL(stateChanged(int)),
         this,
         SLOT(changeIpv4AddressMode(int)));
+    mIpv4Automatic->setContentWidgetData("objectName", "ipv4AutomaticCB");
     mIpGroup->appendChild(mIpv4Automatic);
     
     // Phone IP address
@@ -316,6 +318,7 @@
         SIGNAL(editingFinished()),
         this,
         SLOT(changeIpv4Address()));
+    mIpv4Address->setContentWidgetData("objectName", "ipv4AddressEdit");
     mIpGroup->appendChild(mIpv4Address);
     
     // DNS addresses
@@ -331,6 +334,7 @@
         SIGNAL(stateChanged(int)), 
         this,
         SLOT(changeIpv4DnsMode(int)));
+    mIpv4DnsAutomatic->setContentWidgetData("objectName", "ipv4DnsAutomaticCB");
     mIpGroup->appendChild(mIpv4DnsAutomatic);
     
     // Primary DNS address
@@ -342,6 +346,7 @@
         SIGNAL(editingFinished()), 
         this,
         SLOT(changeIpv4PrimaryDnsAddress()));
+    mIpv4DnsAddress1->setContentWidgetData("objectName", "ipv4DnsAddress1Edit");
     mIpGroup->appendChild(mIpv4DnsAddress1);
     
     // Secondary DNS address
@@ -353,6 +358,7 @@
         SIGNAL(editingFinished()), 
         this,
         SLOT(changeIpv4SecondaryDnsAddress()));
+    mIpv4DnsAddress2->setContentWidgetData("objectName", "ipv4DnsAddress2Edit");
     mIpGroup->appendChild(mIpv4DnsAddress2);
     
     OstTraceFunctionExit0(CPPACKETDATAAPADVANCEDVIEW_CREATEIPV4SETTINGITEMS_EXIT);
@@ -424,6 +430,7 @@
         SIGNAL(currentIndexChanged(int)),
         this,
         SLOT(changeIpv6DnsMode(int)));
+    mIpv6DnsAutomatic->setContentWidgetData("objectName", "ipv6DnsAutomaticCB");
     mIpGroup->appendChild(mIpv6DnsAutomatic);
     
     // Primary DNS address
@@ -435,6 +442,7 @@
         SIGNAL(editingFinished()),
         this,
         SLOT(changeIpv6PrimaryDnsAddress()));
+    mIpv6DnsAddress1->setContentWidgetData("objectName", "ipv6DnsAddress1Edit");
     mIpGroup->appendChild(mIpv6DnsAddress1);
     
     // Secondary DNS address
@@ -445,7 +453,8 @@
         mIpv6DnsAddress2,
         SIGNAL(editingFinished()),
         this,
-        SLOT(changeIpv6SecondaryDnsAddress()));  
+        SLOT(changeIpv6SecondaryDnsAddress()));
+    mIpv6DnsAddress2->setContentWidgetData("objectName", "ipv6DnsAddress2Edit");
     mIpGroup->appendChild(mIpv6DnsAddress2);
     
     OstTraceFunctionExit0(CPPACKETDATAAPADVANCEDVIEW_CREATEIPV6SETTINGITEMS_EXIT);
@@ -502,6 +511,7 @@
         SIGNAL(editingFinished()),
         this,
         SLOT(changeProxyServer()));
+    mProxyServer->setContentWidgetData("objectName", "proxyServerEdit");
     mProxyGroup->appendChild(mProxyServer);
     
     // Proxy port number
@@ -513,6 +523,7 @@
         SIGNAL(editingFinished()),
         this,
         SLOT(changeProxyPort()));
+    mProxyPort->setContentWidgetData("objectName", "proxyPortEdit");
     mProxyGroup->appendChild(mProxyPort);
     
     OstTraceFunctionExit0(CPPACKETDATAAPADVANCEDVIEW_CREATEPROXYGROUP_EXIT);
--- a/cmmanager/cppacketdataapplugin/src/cppacketdataapview.cpp	Thu Jun 24 11:36:05 2010 +0300
+++ b/cmmanager/cppacketdataapplugin/src/cppacketdataapview.cpp	Fri Jul 09 10:25:55 2010 +0300
@@ -143,6 +143,7 @@
         SIGNAL(editingFinished()),
         this,
         SLOT(connectionNameChanged()));
+    mConnectionNameItem->setContentWidgetData("objectName", "connectionNameEdit");
     mApSettingsGroupItem->appendChild(mConnectionNameItem);
     
     // Access point name
@@ -155,6 +156,7 @@
         SIGNAL(editingFinished()),
         this,
         SLOT(accessPointNameChanged()));
+    mAccessPointNameItem->setContentWidgetData("objectName", "accessPointNameEdit");
     mApSettingsGroupItem->appendChild(mAccessPointNameItem);
     
     // User name
@@ -167,19 +169,21 @@
         SIGNAL(editingFinished()),
         this,
         SLOT(userNameChanged()));
+    mUserNameItem->setContentWidgetData("objectName", "userNameEdit");
     mApSettingsGroupItem->appendChild(mUserNameItem);
     
     // Password
     mPasswordItem = new CpSettingFormItemData(
         HbDataFormModelItem::TextItem,
         hbTrId("txt_occ_setlabel_password"));
-    mPasswordItem->setContentWidgetData("echoMode", "Password");
+    mPasswordItem->setContentWidgetData("echoMode", "PasswordEchoOnEdit");
     // Connect signal and add item to group
     mForm->addConnection(
         mPasswordItem,
         SIGNAL(editingFinished()),
         this,
         SLOT(passwordChanged()));
+    mPasswordItem->setContentWidgetData("objectName", "passwordEdit");
     mApSettingsGroupItem->appendChild(mPasswordItem);
     
     // Authentication
@@ -201,6 +205,7 @@
         SIGNAL(currentIndexChanged(int)),
         this,
         SLOT(authenticationChanged(int)));
+    mAuthenticationItem->setContentWidgetData("objectName", "authenticationCB");
     mApSettingsGroupItem->appendChild(mAuthenticationItem);
     
     // Homepage
@@ -213,6 +218,7 @@
         SIGNAL(editingFinished()),
         this,
         SLOT(homepageChanged()));
+    mHomepageItem->setContentWidgetData("objectName", "homePageEdit");
     mApSettingsGroupItem->appendChild(mHomepageItem);
     
     // Read settings from CommsDat and update widgets
--- a/cmmanager/cpwlanapplugin/src/cpwlanapadvancedview.cpp	Thu Jun 24 11:36:05 2010 +0300
+++ b/cmmanager/cpwlanapplugin/src/cpwlanapadvancedview.cpp	Fri Jul 09 10:25:55 2010 +0300
@@ -168,6 +168,7 @@
         SIGNAL(stateChanged(int)),
         this,
         SLOT(changeIpv4AddressMode(int)));
+    mIpv4Automatic->setContentWidgetData("objectName", "ipv4AutomaticCB");
     mIpv4Group->appendChild(mIpv4Automatic);
     
     // Phone IP address
@@ -179,6 +180,7 @@
         SIGNAL(editingFinished()),
         this,
         SLOT(changeIpv4Address()));
+    mIpv4Address->setContentWidgetData("objectName", "ipv4AddressEdit");
     mIpv4Group->appendChild(mIpv4Address);
     
     // Subnet mask
@@ -190,6 +192,7 @@
         SIGNAL(editingFinished()),
         this,
         SLOT(changeIpv4SubnetMask()));
+    mIpv4SubnetMask->setContentWidgetData("objectName", "ipv4SubnetmaskEdit");
     mIpv4Group->appendChild(mIpv4SubnetMask);
     
     // Gateway
@@ -201,6 +204,7 @@
         SIGNAL(editingFinished()),
         this,
         SLOT(changeIpv4Gateway()));
+    mIpv4Gateway->setContentWidgetData("objectName", "ipv4GatewayEdit");
     mIpv4Group->appendChild(mIpv4Gateway);
     
     // DNS addresses
@@ -216,6 +220,7 @@
         SIGNAL(stateChanged(int)), 
         this,
         SLOT(changeIpv4DnsMode(int)));
+    mIpv4DnsAutomatic->setContentWidgetData("objectName", "ipv4DnsAutomaticCB");
     mIpv4Group->appendChild(mIpv4DnsAutomatic);
     
     // Primary DNS address
@@ -227,6 +232,7 @@
         SIGNAL(editingFinished()), 
         this,
         SLOT(changeIpv4PrimaryDnsAddress()));
+    mIpv4DnsAddress1->setContentWidgetData("objectName", "ipv4DnsAddress1Edit");
     mIpv4Group->appendChild(mIpv4DnsAddress1);
     
     // Secondary DNS address
@@ -238,6 +244,7 @@
         SIGNAL(editingFinished()), 
         this,
         SLOT(changeIpv4SecondaryDnsAddress()));
+    mIpv4DnsAddress2->setContentWidgetData("objectName", "ipv4DnsAddress2Edit");
     mIpv4Group->appendChild(mIpv4DnsAddress2);
     
     OstTraceFunctionExit0(CPWLANAPADVANCEDVIEW_CREATEIPV4GROUP_EXIT);
@@ -328,6 +335,7 @@
         SIGNAL(currentIndexChanged(int)),
         this,
         SLOT(changeIpv6DnsMode(int)));
+    mIpv6DnsAutomatic->setContentWidgetData("objectName", "ipv6DnsAutomaticCB");
     mIpv6Group->appendChild(mIpv6DnsAutomatic);
     
     // Primary DNS address
@@ -339,6 +347,7 @@
         SIGNAL(editingFinished()),
         this,
         SLOT(changeIpv6PrimaryDnsAddress()));
+    mIpv6DnsAddress1->setContentWidgetData("objectName", "ipv6DnsAddress1Edit");
     mIpv6Group->appendChild(mIpv6DnsAddress1);
     
     // Secondary DNS address
@@ -349,7 +358,8 @@
         mIpv6DnsAddress2,
         SIGNAL(editingFinished()),
         this,
-        SLOT(changeIpv6SecondaryDnsAddress()));  
+        SLOT(changeIpv6SecondaryDnsAddress()));
+    mIpv6DnsAddress2->setContentWidgetData("objectName", "ipv6DnsAddress2Edit");
     mIpv6Group->appendChild(mIpv6DnsAddress2);
     
     OstTraceFunctionExit0(CPWLANAPADVANCEDVIEW_CREATEIPV6GROUP_EXIT);
@@ -403,6 +413,7 @@
         SIGNAL(editingFinished()),
         this,
         SLOT(changeProxyServer()));
+    mProxyServer->setContentWidgetData("objectName", "proxyServerEdit");
     mProxyGroup->appendChild(mProxyServer);
     
     // Proxy port number
@@ -414,6 +425,7 @@
         SIGNAL(editingFinished()),
         this,
         SLOT(changeProxyPort()));
+    mProxyPort->setContentWidgetData("objectName", "proxyPortEdit");
     mProxyGroup->appendChild(mProxyPort);
     
     OstTraceFunctionExit0(CPWLANAPADVANCEDVIEW_CREATEPROXYGROUP_EXIT);
--- a/cmmanager/cpwlanapplugin/src/cpwlanapview.cpp	Thu Jun 24 11:36:05 2010 +0300
+++ b/cmmanager/cpwlanapplugin/src/cpwlanapview.cpp	Fri Jul 09 10:25:55 2010 +0300
@@ -167,7 +167,8 @@
         SIGNAL(editingFinished()),
         this,
         SLOT(connectionNameChanged()));
-    mApSettingsGroupItem->appendChild(mConnectionNameItem);
+    mConnectionNameItem->setContentWidgetData("objectName", "connectionNameEdit");
+    mApSettingsGroupItem->appendChild(mConnectionNameItem); 
     
     // WLAN network name
     mWlanNetworkNameItem = new CpSettingFormItemData(
@@ -179,6 +180,7 @@
         SIGNAL(editingFinished()),
         this,
         SLOT(wlanNetworkNameChanged()));
+    mWlanNetworkNameItem->setContentWidgetData("objectName", "wlanNetworkNameEdit");
     mApSettingsGroupItem->appendChild(mWlanNetworkNameItem);
     
     // Network status
@@ -200,6 +202,7 @@
         SIGNAL(currentIndexChanged(int)),
         this,
         SLOT(networkStatusChanged(int)));
+    mNetworkStatusItem->setContentWidgetData("objectName", "networkStatusCB");
     mApSettingsGroupItem->appendChild(mNetworkStatusItem);
     
     // Network mode
@@ -221,6 +224,7 @@
         SIGNAL(currentIndexChanged(int)),
         this,
         SLOT(networkModeChanged(int)));
+    mNetworkModeItem->setContentWidgetData("objectName", "networkModeCB");
     mApSettingsGroupItem->appendChild(mNetworkModeItem);
     
     // Ad-hoc channel
@@ -238,6 +242,7 @@
         SIGNAL(currentIndexChanged(int)),
         this,
         SLOT(securityModeChanged(int)));
+    mSecurityModeItem->setContentWidgetData("objectName", "securityModeCB");
     mApSettingsGroupItem->appendChild(mSecurityModeItem);
     
     // Homepage
@@ -250,6 +255,7 @@
         SIGNAL(editingFinished()),
         this,
         SLOT(homepageChanged()));
+    mHomepageItem->setContentWidgetData("objectName", "homepageEdit");
     mApSettingsGroupItem->appendChild(mHomepageItem);
     
     // Read settings from CommsDat and update widgets
@@ -616,7 +622,7 @@
             CMManagerShim::CmName);
         mConnectionNameItem->setContentWidgetData("text", connectionName);
     }
-    
+
     OstTraceFunctionExit0(CPWLANAPVIEW_CONNECTIONNAMECHANGED_EXIT);
 }
 
--- a/connectionmonitoring/cellularindicatorplugin/inc/cellularindicatorplugin.h	Thu Jun 24 11:36:05 2010 +0300
+++ b/connectionmonitoring/cellularindicatorplugin/inc/cellularindicatorplugin.h	Fri Jul 09 10:25:55 2010 +0300
@@ -22,7 +22,10 @@
 #include <hbindicatorinterface.h>
 #include <QtCore/QProcess>
 #include <QtCore/QVariant>
+#include <QSharedPointer>
 
+// Forward declarations
+class HbTranslator;
 
 /**
  * This class describes cellular indicator plug-in
@@ -81,6 +84,10 @@
     QVariant mParameter;
     // Process to start external programs
     QProcess process;
+    
+    // Translator for the localisation Text Id's
+    QSharedPointer<HbTranslator> mTranslator;
+
 };
 
 
--- a/connectionmonitoring/cellularindicatorplugin/src/cellularindicatorplugin.cpp	Thu Jun 24 11:36:05 2010 +0300
+++ b/connectionmonitoring/cellularindicatorplugin/src/cellularindicatorplugin.cpp	Fri Jul 09 10:25:55 2010 +0300
@@ -94,8 +94,8 @@
     Q_UNUSED(indicatorType)
     
     // Install localization
-    HbTranslator *translator(new HbTranslator("cellularindicatorplugin"));
-    
+    mTranslator = QSharedPointer<HbTranslator>(new HbTranslator("cellularindicatorplugin"));
+        
     OstTraceFunctionExit0( CELLULARINDICATORPLUGIN_CREATEINDICATOR_EXIT );
     return this;
 }
--- a/connectionmonitoring/connectionview/inc/connectionview.h	Thu Jun 24 11:36:05 2010 +0300
+++ b/connectionmonitoring/connectionview/inc/connectionview.h	Fri Jul 09 10:25:55 2010 +0300
@@ -19,6 +19,7 @@
 #define __CONNECTIONVIEW_H__
 
 #include <QObject>
+#include <QSharedPointer>
 #include <HbMainWindow>
 #include <HbDialog>
 #include <QStringList>
@@ -32,6 +33,10 @@
 #include <qnetworksession.h>
 #include <qnetworkconfigmanager.h>
 
+// Forward declarations
+class HbTranslator;
+
+
 QTM_USE_NAMESPACE
 
 class QSignalMapper;
@@ -138,6 +143,9 @@
         /* The id of the timer used to close the application */
         int mClosingTimer;
         
+        /* Translator for the localisation Text Id's */
+        QSharedPointer<HbTranslator> mTranslator;
+        
         /* definition for unit test purposes */
         friend class TestConnectionView;
     
--- a/connectionmonitoring/connectionview/src/connectionview.cpp	Thu Jun 24 11:36:05 2010 +0300
+++ b/connectionmonitoring/connectionview/src/connectionview.cpp	Fri Jul 09 10:25:55 2010 +0300
@@ -41,11 +41,10 @@
 #endif
 
 
-
 QTM_USE_NAMESPACE
 
-
 const qreal typeLabelWidth = 18.0;
+const QString iapIdentifierPrefix = "I_";
 
 ConnectionView::ConnectionView():
     mNetConfigurationManager(new QNetworkConfigurationManager(this)),
@@ -55,8 +54,8 @@
 {
     OstTraceFunctionEntry0( CONNECTIONVIEW_CONNECTIONVIEW_ENTRY );
     // Install localization
-    HbTranslator *translator(new HbTranslator("connectionview"));
-    
+    mTranslator = QSharedPointer<HbTranslator>(new HbTranslator("connectionview"));
+   
     // Register custom layout location
     bool registerStatus = HbStyleLoader::registerFilePath(":/layout/");
     Q_ASSERT(registerStatus);
@@ -190,7 +189,7 @@
         for (int i=0; i<mConnectionCount; i++) {
             // Get the iap id and the iap name for the UI construction
             bool ok = true;
-            int iapId = activeConfigurations[i].identifier().toInt(&ok);
+            int iapId = activeConfigurations[i].identifier().remove(iapIdentifierPrefix).toInt(&ok);
             QString iapName = activeConfigurations[i].name();
 
             if (ok) {
@@ -379,7 +378,7 @@
             
     for (int i=0; i < count; i++) {
         bool ok = true;
-        int loopedIapId = activeConfigurations[i].identifier().toInt(&ok);
+        int loopedIapId = activeConfigurations[i].identifier().remove(iapIdentifierPrefix).toInt(&ok);
         
         // if the looped iap matches the iap, stop the connection
         if (loopedIapId == iapId) {
--- a/connectionmonitoring/connmon/connectionmonitor/inc/ConnMonIAP.h	Thu Jun 24 11:36:05 2010 +0300
+++ b/connectionmonitoring/connmon/connectionmonitor/inc/ConnMonIAP.h	Fri Jul 09 10:25:55 2010 +0300
@@ -401,10 +401,9 @@
          * closed event.
          * @since
          * @param aConnection The connection info. On return, will contain connection id.
-         * @param aSent On return, value is ETrue if event has been sent, EFalse otherwise.
          * @return KErrNone if successfull, otherwise a system wide error code.
          */
-        TBool GetDeleteNotifyStatus( TConnInfo& aConnection, TBool& aSent );
+        TBool GetDeleteNotifyStatus( TConnInfo& aConnection );
 
         /**
          * Gets a pointer to the activity notifier object for the given connection id.
--- a/connectionmonitoring/connmon/connectionmonitor/inc/ConnMonNoti.h	Thu Jun 24 11:36:05 2010 +0300
+++ b/connectionmonitoring/connmon/connectionmonitor/inc/ConnMonNoti.h	Fri Jul 09 10:25:55 2010 +0300
@@ -673,6 +673,35 @@
         * @return void.
         */
         void SetInterfaceClosed();
+        
+        /**
+        * Tells whether interface has been closed or not.
+        * @since
+        * @return ETrue if interface has been closed, otherwise EFalse.
+        */
+        TBool InterfaceClosed();
+
+        /**
+        * Sets link layer status to closed.
+        * @since
+        * @return void.
+        */
+        void SetLinkLayerClosed();
+        
+        /**
+        * Sets link layer status to NOT closed.
+        * @since
+        * @return void.
+        */
+        void SetLinkLayerOpen();
+        
+        /**
+        * Return ETrue if KLinkLayerClosed has been received.
+        * @since
+        * @return ETrue if KLinkLayerClosed has been received, otherwise returns EFalse.
+        */
+        TBool LinkLayerClosed();
+
 
     private: // Methods from base classes
          /**
@@ -700,6 +729,7 @@
         TUint                         iTotalUplinkDataVolume;
         TBool                         iDeleteSent;
         TBool                         iInterfaceClosed;
+        TBool                         iLinkLayerClosed;
     };
 
 /**
--- a/connectionmonitoring/connmon/connectionmonitor/src/ConnMonIAP.cpp	Thu Jun 24 11:36:05 2010 +0300
+++ b/connectionmonitoring/connmon/connectionmonitor/src/ConnMonIAP.cpp	Fri Jul 09 10:25:55 2010 +0300
@@ -2979,7 +2979,7 @@
 // CConnMonIAP::GetDeleteNotifyStatus
 // -----------------------------------------------------------------------------------
 //
-TInt CConnMonIAP::GetDeleteNotifyStatus( TConnInfo& aConnection, TBool& aSent )
+TInt CConnMonIAP::GetDeleteNotifyStatus( TConnInfo& aConnection )
     {
     TInt index( KErrNotFound );
 
@@ -2998,29 +2998,6 @@
     aConnection.iConnectionId = iConnInfos[index].iConnectionId;
     aConnection.iBearer = iConnInfos[index].iBearer;
 
-    TInt connectionStatus( 0 );
-    GetConnectionStatus( index, connectionStatus );
-
-    if ( ( iConnInfos[index].iConnDownNotifier != 0 ) &&
-         ( iConnInfos[index].iProgressNotifier != 0 ) )
-        {
-        if ( !iConnInfos[index].iConnDownNotifier->DeleteSent() &&
-             !iConnInfos[index].iConnDownNotifier->IsActive() &&
-             ( !iConnInfos[index].iProgressNotifier->IsActive() ||
-               ( connectionStatus != KLinkLayerOpen ) ) )
-            {
-            aSent = EFalse;
-            }
-        else
-            {
-            aSent = ETrue;
-            }
-        }
-    else
-        {
-        aSent = EFalse;
-        }
-
     return KErrNone;
     }
 
--- a/connectionmonitoring/connmon/connectionmonitor/src/ConnMonNoti.cpp	Thu Jun 24 11:36:05 2010 +0300
+++ b/connectionmonitoring/connmon/connectionmonitor/src/ConnMonNoti.cpp	Fri Jul 09 10:25:55 2010 +0300
@@ -170,10 +170,8 @@
                 }
             else
                 {
-                TBool alreadyNotified( EFalse );
-
                 // This updates the correct 'iConnectionId' and 'iBearer' to connInfo
-                TInt ret = iServer->Iap()->GetDeleteNotifyStatus( connInfo, alreadyNotified );
+                TInt ret = iServer->Iap()->GetDeleteNotifyStatus( connInfo );
 
                 if ( ret == KErrNone )
                     {
@@ -202,8 +200,11 @@
                                 iServer->Iap()->EnableWlanScan();
                                 }
 
-                            // Progress and subconn notifiers have died and no delete has been sent
-                            subConnUpDownNotifier->SendDeletedEvent();
+                            if ( subConnUpDownNotifier->LinkLayerClosed() )
+                                { 
+                                // KLinkLayerClosed already received, finish with this connection
+                                subConnUpDownNotifier->SendDeletedEvent();
+                                }
                             }
                         else
                             {
@@ -598,6 +599,7 @@
                         if ( !subConnUpDownNotifier->IsActive() )
                             {
                             subConnUpDownNotifier->Receive();
+                            subConnUpDownNotifier->SetLinkLayerOpen();
                             }
                         }
 
@@ -631,8 +633,30 @@
                         {
                         LOGIT("CProgressNotifier::RunL triggered HandleAvailabilityChange()")
                         iServer->AvailabilityManager()->HandleAvailabilityChange();	
-                        }	    
+                        }
+                        	    
                     }
+                else if ( iInfoBuf().iStage == KLinkLayerClosed )
+                    {
+                    CSubConnUpDownNotifier* subConnUpDownNotifier = 0;
+
+                    TInt err = iServer->Iap()->GetSubConnUpDownNotifier(
+                               iConnectionId,
+                               &subConnUpDownNotifier );
+
+                    if ( KErrNone == err )
+                        {
+                        subConnUpDownNotifier->SetLinkLayerClosed();
+                        	
+                        if ( subConnUpDownNotifier->InterfaceClosed() )
+                            {
+                            // EInterfaceDown has arrived before KLinkLayerClosed
+                            // Let's finish with this connection.	
+                            subConnUpDownNotifier->SendDeletedEvent();
+                            return;
+                            }
+                        }	
+                    }		    
 
                 iFilter = KNoFiltering;
                 }
@@ -2116,6 +2140,8 @@
     {
     if ( !iDeleteSent )
         {
+        LOGIT("CSubConnUpDownNotifier::SendDeletedEvent")
+        	
         iEventInfo.Reset();
 
         iEventInfo.iEventType       = EConnMonDeleteConnection;
@@ -2176,6 +2202,41 @@
     iInterfaceClosed = ETrue;
     }
 
+// -----------------------------------------------------------------------------
+// CSubConnUpDownNotifier::InterfaceClosed
+// -----------------------------------------------------------------------------
+//
+TBool CSubConnUpDownNotifier::InterfaceClosed()
+    {
+    return iInterfaceClosed;
+    }
+
+// -----------------------------------------------------------------------------
+// CSubConnUpDownNotifier::SetLinkLayerClosed
+// -----------------------------------------------------------------------------
+//
+void CSubConnUpDownNotifier::SetLinkLayerClosed()
+    {
+    iLinkLayerClosed = ETrue;
+    }
+
+// -----------------------------------------------------------------------------
+// CSubConnUpDownNotifier::SetLinkLayerOpen
+// -----------------------------------------------------------------------------
+//
+void CSubConnUpDownNotifier::SetLinkLayerOpen()
+    {
+    iLinkLayerClosed = EFalse;
+    }
+
+// -----------------------------------------------------------------------------
+// CSubConnUpDownNotifier::LinkLayerClosed
+// -----------------------------------------------------------------------------
+//
+TBool CSubConnUpDownNotifier::LinkLayerClosed()
+    {
+    return iLinkLayerClosed;
+    }
 
 // -----------------------------------------------------------------------------
 // CSubConnUpDownNotifier::DoCancel
@@ -2219,7 +2280,10 @@
                 // Is progress notifier still alive
                 if ( !progressNotifier->IsActive() )
                     {
+                    iStatus = KErrDied;
+                    // might delete this object                     	
                     SendDeletedEvent();
+                    return;
                     }
                 }
             }
@@ -2240,6 +2304,8 @@
             LOGIT3("SERVER: EVENT -> Connection %d closed, u: %d, d: %d",
                     iConnectionId, iTotalUplinkDataVolume, iTotalDownlinkDataVolume)
 
+            iStatus = KErrDisconnected;
+ 
             CProgressNotifier* progressNotifier = 0;
             TInt err = iServer->Iap()->GetProgressNotifier( iConnectionId, &progressNotifier );
             if ( err == KErrNone )
@@ -2247,15 +2313,17 @@
                 // Progess notifier has stopped and allinterface closed event has arrived
                 if ( !progressNotifier->IsActive() )
                     {
+                    // might delete this object
                     SendDeletedEvent();
+                    return;
                     }
                 }
             else
                 {
+                // might delete this object                	
                 SendDeletedEvent();
+                return;
                 }
-
-            iStatus = KErrDisconnected;
             }
         else if ( ( event.iSubConnectionUniqueId == 0 ) &&
                   ( event.iEventType == ESubConnectionOpened ) )
--- a/connectionutilities/confirmqueries/inc/cellularpromptdialog.h	Thu Jun 24 11:36:05 2010 +0300
+++ b/connectionutilities/confirmqueries/inc/cellularpromptdialog.h	Fri Jul 09 10:25:55 2010 +0300
@@ -22,6 +22,10 @@
 #include <QObject>
 #include <HbDialog>
 #include <hbdevicedialoginterface.h>
+#include <QSharedPointer>
+
+// Forward declarations
+class HbTranslator;
 
 class CellularPromptDialog: public HbDialog, public HbDeviceDialogInterface
     {
@@ -79,6 +83,9 @@
         
         /* Tells whether close has already been called for the dialog */
         bool mClose;
+
+        /* Translator for the localisation Text Id's */
+        QSharedPointer<HbTranslator> mTranslator;
     };
 
 
--- a/connectionutilities/confirmqueries/src/cellularpromptdialog.cpp	Thu Jun 24 11:36:05 2010 +0300
+++ b/connectionutilities/confirmqueries/src/cellularpromptdialog.cpp	Fri Jul 09 10:25:55 2010 +0300
@@ -45,7 +45,7 @@
     OstTraceFunctionEntry0( CELLULARPROMPTDIALOG_CELLULARPROMPTDIALOG_ENTRY );
 
     // Install localization
-    HbTranslator *translator(new HbTranslator("cellularpromptdialog"));
+    mTranslator = QSharedPointer<HbTranslator>(new HbTranslator("cellularpromptdialog"));
 
     createDialog(parameters);
     mClose = false;
--- a/ipcm_plat/bearer_settings_plugin_api/inc/cmpluginbaseeng.h	Thu Jun 24 11:36:05 2010 +0300
+++ b/ipcm_plat/bearer_settings_plugin_api/inc/cmpluginbaseeng.h	Fri Jul 09 10:25:55 2010 +0300
@@ -387,18 +387,7 @@
          * @param aTableIdArray A reference to an array where iap related generic
          * table ids are added.
          */
-        IMPORT_C void GetGenericTableIdsToBeObserved( RArray<TUint32>& aTableIdArray ) const;
-
-        /**
-         * Requests CommsDat table ids to be observed for changes by the cmm
-         * server. If a table used is not mentioned to be modified a bearer
-         * shouldn't return this. Bearers do not reset the array before adding
-         * ids.
-         * @param aTableIdArray A reference to an array where plugin must add
-         * the ids of the tables it want's to be observed.
-         */
-        IMPORT_C virtual void GetBearerTableIdsToBeObservedL(
-                RArray<TUint32>& aTableIdArray ) const = 0;
+        IMPORT_C void GetGenericTableIdsToBeObservedL( RArray<TUint32>& aTableIdArray ) const;
 
     public: // plugin interface
         /**
@@ -609,6 +598,17 @@
          */
         virtual void BearerRecordNameLC( HBufC* &aBearerName ) = 0;
 
+        /**
+         * Requests CommsDat table ids to be observed for changes by the cmm
+         * server. If a table used is not mentioned to be modified a bearer
+         * shouldn't return this. Bearers do not reset the array before adding
+         * ids.
+         * @param aTableIdArray A reference to an array where plugin must add
+         * the ids of the tables it want's to be observed.
+         */
+        IMPORT_C virtual void GetBearerTableIdsToBeObservedL(
+                RArray<TUint32>& aTableIdArray ) const = 0;
+
     protected:
         /**
          * Constructor
--- a/ipcm_plat/connection_monitor_extension_api/group/bld.inf	Thu Jun 24 11:36:05 2010 +0300
+++ b/ipcm_plat/connection_monitor_extension_api/group/bld.inf	Fri Jul 09 10:25:55 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-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"
@@ -11,8 +11,8 @@
 *
 * Contributors:
 *
-* Description:  File that exports the files belonging to Connection
-*                Monitor Extension API.
+* Description:
+* File that exports the files belonging to Connection Monitor Extension API.
 *
 */
 
@@ -23,4 +23,5 @@
 
 PRJ_EXPORTS
 
-../inc/ConnMonExt.h     MW_LAYER_PLATFORM_EXPORT_PATH(ConnMonExt.h)
+../inc/ConnMonExt.h                 MW_LAYER_PLATFORM_EXPORT_PATH(ConnMonExt.h)
+../inc/connectionmonitorpskeys.h    MW_LAYER_PLATFORM_EXPORT_PATH(connectionmonitorpskeys.h)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ipcm_plat/connection_monitor_extension_api/inc/connectionmonitorpskeys.h	Fri Jul 09 10:25:55 2010 +0300
@@ -0,0 +1,61 @@
+/*
+* 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:  Connection Monitor Publish & Subscribe keys.
+*
+*/
+
+
+#ifndef CONNECTIONMONITORPSKEYS_H
+#define CONNECTIONMONITORPSKEYS_H
+
+/**
+ * Connection Monitor RProperty category.
+ */
+const TUid KConnectionMonitorPS = {0x101F6CF0};
+
+/**
+ * Dial-Up override key.
+ * Used only when dial-up override feature is enabled. The purpose for this
+ * feature is to stop and block any packetdata connections while a dial-up
+ * connection is beeing established in single PDP context networks.
+ */
+const TUint KDialUpConnection = 0x00000001;
+
+/**
+ * Values for KDialUpConnection key.
+ */
+enum TDialUpStates
+    {
+    /**
+     * Can be used to indicate to Connection Monitor Server that a dial-up
+     * connection has ended. If the dial-up connection setup fails, this can be
+     * used to restore normal packetdata connectivity a little faster in some
+     * error situations.
+     */
+    EConnMonDialUpClosed,
+    /**
+     * Indicates to Connection Monitor Server that a Dial-Up connection is
+     * starting. Connection Monitor will stop any active packetdata connection
+     * and block further packetdata connections during the dial-up connection
+     * setup.
+     */
+    EConnMonDialUpInit,
+    /**
+     * Connection Monitor Server will indicate with this value that any
+     * preparations for an upcoming dial-up connection are completed.
+     */
+    EConnMonReady
+    };
+
+#endif // CONNECTIONMONITORPSKEYS_H
--- a/ipcm_plat/extended_connection_settings_api/inc/cmmanagerkeys.h	Thu Jun 24 11:36:05 2010 +0300
+++ b/ipcm_plat/extended_connection_settings_api/inc/cmmanagerkeys.h	Fri Jul 09 10:25:55 2010 +0300
@@ -21,7 +21,7 @@
 /**
  * UID of CmManager repository
  *
- * @since S60 5.1
+ * @since S60 5.2
  */
 const TUid KCRUidCmManager = {0x10207376}; 
 
@@ -33,8 +33,19 @@
  * but the value is provided for the country the device is at the moment.
  * See TCmCellularDataUsage in cmgenconnsettings.h for more info.
  *
- * @since S60 5.1
+ * @since S60 5.2
  */
 const TUint32 KCurrentCellularDataUsage  = 0x00000001;
+
+/**
+ * Dial-up override setting.
+ *
+ * When this key is enabled dial-up connection overrides all
+ * internal cellular connections. Internal cellular connections 
+ * are automatically disconnected when dial-up connection starts.
+ *
+ * @since S60 5.2
+ */
+const TUint32 KDialUpOverride  = 0x00000002;
     
 #endif // CMMANAGERKEYS_H