Revision: 201037
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Mon, 04 Oct 2010 00:41:02 +0300
changeset 51 8134400f8f89
parent 48 e3fccba1f02f
Revision: 201037 Kit: 201039
realtimenetprots/sipfw/ProfileAgent/ApnManager/inc/sipapnconfigurationhandler.h
realtimenetprots/sipfw/ProfileAgent/ApnManager/src/sipapnconfigurationhandler.cpp
realtimenetprots/sipfw/ProfileAgent/IMS_Agent/Src/CSIPRegEventSubscriber.cpp
realtimenetprots/sipfw/ProfileAgent/Server/Src/SipProfileCacheItem.cpp
realtimenetprots/sipfw/ProfileAgent/profile_fsm/src/Sipprofilecontextbase.cpp
realtimenetprots/sipfw/SIP/ConnectionMgr/src/CStateModel.cpp
realtimenetprots/sipfw/SIP/ConnectionMgr/src/CStateModel.h
sipplugins/sippsipadapter/src/CWPSIPAdapter.cpp
sipproviderplugins/sipprovider/sipconnectionplugins/inc/SIP_subconevents.h
sipproviderplugins/sipprovider/sipconnectionplugins/inc/SIP_subconparams.h
--- a/realtimenetprots/sipfw/ProfileAgent/ApnManager/inc/sipapnconfigurationhandler.h	Fri Sep 17 08:32:30 2010 +0300
+++ b/realtimenetprots/sipfw/ProfileAgent/ApnManager/inc/sipapnconfigurationhandler.h	Mon Oct 04 00:41:02 2010 +0300
@@ -122,8 +122,6 @@
         void ChangeApnL( const TDesC8& aApn, 
                          TBool aUseSecureAuthentication );
         
-        TBool ClearProtectedRecord( CommsDat::CCDRecordBase& aRecord );
-        
         void SetMonitoringState( TSipApnMonitoringState aMonitoringState );
         
         TSipApnMonitoringState MonitoringState() const;
@@ -157,13 +155,6 @@
 		
 		void AllowCellularDataUsage();
 
-		
-	    /**
-	    * Rollsback db in case of failure      
-	        * @param aDb 
-	    */
-	    static void RollBackDBTransaction(TAny* aDb);
-
 	private: // Data
 	
 		MSIPApnChangeObserver&          iObserver;    
--- a/realtimenetprots/sipfw/ProfileAgent/ApnManager/src/sipapnconfigurationhandler.cpp	Fri Sep 17 08:32:30 2010 +0300
+++ b/realtimenetprots/sipfw/ProfileAgent/ApnManager/src/sipapnconfigurationhandler.cpp	Mon Oct 04 00:41:02 2010 +0300
@@ -579,9 +579,6 @@
 	CMDBSession* db = CMDBSession::NewL( KCDVersion1_1 );
     CleanupStack::PushL( db );
     
-	db->OpenTransactionL();
-    CleanupStack::PushL(TCleanupItem(RollBackDBTransaction, db));
-    
     // Set attributes so that also protected iaps can be accessed
     db->SetAttributeMask( ECDHidden | ECDProtectedWrite ); 
 
@@ -592,8 +589,6 @@
     CleanupStack::PushL( iapRecord );
     
     iapRecord->SetRecordId( iIapId );
-    
-    TBool clearedProtectedIap = ClearProtectedRecord( *iapRecord );
 
     iapRecord->LoadL( *db );
     
@@ -615,8 +610,6 @@
 
     CCDOutgoingGprsRecord* serviceRecord = 
     static_cast<CCDOutgoingGprsRecord*>( iapRecord->iService.iLinkedRecord );  
-    
-    TBool clearedProtectedService = ClearProtectedRecord( *serviceRecord );
         
     PROFILE_DEBUG6( 
             "CSIPApnConfigurationHandler::ChangeApnL() curr apn",
@@ -637,30 +630,17 @@
     PROFILE_DEBUG3( 
             "CSIPApnConfigurationHandler::ChangeApnL() new security",
             aUseSecureAuthentication )
-	                
-    serviceRecord->ModifyL( *db ); 
-    
-    if ( clearedProtectedIap )
+                 
+    TRAPD(err, serviceRecord->ModifyL( *db ));
+    if (err != KErrNone)
         {
-        // Set protection back
-        iapRecord->SetAttributes( ECDProtectedWrite );
-        iapRecord->ModifyL( *db );
-        }
+         PROFILE_DEBUG3( "CSIPApnConfigurationHandler::ChangeApnL,ModifyL leaves",err )
+         User::Leave(err);
+        }        
     
-    if ( clearedProtectedService )
-        {
-        // Set protection back
-        serviceRecord->SetAttributes( ECDProtectedWrite );
-        serviceRecord->ModifyL( *db );
-        }
-        
     db->ClearAttributeMask( ECDHidden | ECDProtectedWrite );
     
     CleanupStack::PopAndDestroy( iapRecord );
-    
-    db->CommitTransactionL();
-    
-	CleanupStack::Pop(); //cleanup item
 	
     CleanupStack::PopAndDestroy( db );
     
@@ -676,22 +656,6 @@
     }
 
 // -----------------------------------------------------------------------------
-// CSIPApnConfigurationHandler::ClearProtectedRecord
-// -----------------------------------------------------------------------------
-//
-TBool CSIPApnConfigurationHandler::ClearProtectedRecord( 
-    CommsDat::CCDRecordBase& aRecord )
-    {
-    TBool cleared( EFalse );
-    if ( aRecord.IsSetAttribute( CommsDat::ECDProtectedWrite ) )
-        {
-        aRecord.ClearAttributes( CommsDat::ECDProtectedWrite );
-        cleared = ETrue;
-        }
-    return cleared;
-    }
-
-// -----------------------------------------------------------------------------
 // CSIPApnConfigurationHandler::SetMonitoringState
 // -----------------------------------------------------------------------------
 //
@@ -936,14 +900,4 @@
     PROFILE_DEBUG1("DatabaseMonitoringCompletedL::AllowCellularDataUsage Exit" );
     }
 
-// -----------------------------------------------------------------------------
-// CSIPApnConfigurationHandler::RollBackDBTransaction
-// -----------------------------------------------------------------------------
-//
-void CSIPApnConfigurationHandler::RollBackDBTransaction(TAny* aDb)
-    {
-    CMDBSession* db = static_cast<CMDBSession*>(aDb);
-    TRAP_IGNORE(db->RollbackTransactionL());
-    }
-
 // End of file
--- a/realtimenetprots/sipfw/ProfileAgent/IMS_Agent/Src/CSIPRegEventSubscriber.cpp	Fri Sep 17 08:32:30 2010 +0300
+++ b/realtimenetprots/sipfw/ProfileAgent/IMS_Agent/Src/CSIPRegEventSubscriber.cpp	Mon Oct 04 00:41:02 2010 +0300
@@ -21,13 +21,7 @@
 
 
 // INCLUDE FILES
-#include "CSIPRegEventSubscriber.h"
-#include "CSIPNotifyXmlBodyParser.h"
-#include "sipreginfoelement.h"
-#include "TSIPRegEventStateNotSubscribed.h"
-#include "TSIPRegEventStateSubscribing.h"
-#include "TSIPRegEventStateSubscribed.h"
-#include "TSIPRegEventStateReSubscribing.h"
+#include <sipprofileagentextensionparams.h>
 #include "sipfromheader.h"
 #include "siptoheader.h"
 #include "sipeventheader.h"
@@ -42,7 +36,14 @@
 #include "siperr.h"
 #include "sipstrings.h"
 #include "sipstrconsts.h"
-#include <sipprofileagentextensionparams.h>
+#include "CSIPRegEventSubscriber.h"
+#include "CSIPNotifyXmlBodyParser.h"
+#include "sipreginfoelement.h"
+#include "TSIPRegEventStateNotSubscribed.h"
+#include "TSIPRegEventStateSubscribing.h"
+#include "TSIPRegEventStateSubscribed.h"
+#include "TSIPRegEventStateReSubscribing.h"
+
 
 
 _LIT8(KRegEventName, "reg");
--- a/realtimenetprots/sipfw/ProfileAgent/Server/Src/SipProfileCacheItem.cpp	Fri Sep 17 08:32:30 2010 +0300
+++ b/realtimenetprots/sipfw/ProfileAgent/Server/Src/SipProfileCacheItem.cpp	Mon Oct 04 00:41:02 2010 +0300
@@ -765,10 +765,23 @@
 	{
 	PROFILE_DEBUG4("ProfileCacheItem::HandleError id,err", ProfileId(), aError)
 
+    TBool updateProfile(HasProfileUpdate() && iCurrentState->Name() == 
+            CSIPConcreteProfile::EUnregistrationInProgress);
 	if (iCurrentState->ErrorOccurred(*this, aError))
 		{
 		PROFILE_DEBUG1("ProfileCacheItem::HandleError go unregistered")
-		        
+		    
+        if(updateProfile)
+            {
+            PROFILE_DEBUG1("CSIPProfileCacheItem::HandleError ChangeStateL")
+            StopSnapMonitoring();
+            TRAPD(err, ChangeStateL(&iServerCore.UnregisteredState()));
+            if (err == KErrNone)
+                {                 
+                return EFalse;
+                }
+            }
+        PROFILE_DEBUG1("CSIPProfileCacheItem::HandleError SwitchToUnregisteredState")
         if(SwitchToUnregisteredState(ETrue))
             {
             return EFalse;
--- a/realtimenetprots/sipfw/ProfileAgent/profile_fsm/src/Sipprofilecontextbase.cpp	Fri Sep 17 08:32:30 2010 +0300
+++ b/realtimenetprots/sipfw/ProfileAgent/profile_fsm/src/Sipprofilecontextbase.cpp	Mon Oct 04 00:41:02 2010 +0300
@@ -21,6 +21,7 @@
 
 // INCLUDE FILES
 #include <bamdesca.h>
+#include <uri8.h>
 #include "sipprofilecontextbase.h"
 #include "sipgendefs.h"
 #include "SipProfileLog.h"
@@ -41,7 +42,8 @@
 #include "sipstrconsts.h"
 #include "sipmanagedprofile.h"
 #include "sip.h"
-#include <uri8.h>
+
+
 
 const TInt KMicroSecsInSec = 1000000;
 _LIT8(KTmpSipUri, "sip:tmp");
--- a/realtimenetprots/sipfw/SIP/ConnectionMgr/src/CStateModel.cpp	Fri Sep 17 08:32:30 2010 +0300
+++ b/realtimenetprots/sipfw/SIP/ConnectionMgr/src/CStateModel.cpp	Mon Oct 04 00:41:02 2010 +0300
@@ -129,15 +129,6 @@
 	}
 
 // ----------------------------------------------------------------------------
-// CStateModel::State
-// ----------------------------------------------------------------------------
-//
-TStateBase& CStateModel::State() const
-	{
-	return const_cast< TStateBase& >( iStates.At( iStateValue ) );
-	}
-
-// ----------------------------------------------------------------------------
 // CStateModel::Error
 // ----------------------------------------------------------------------------
 //
--- a/realtimenetprots/sipfw/SIP/ConnectionMgr/src/CStateModel.h	Fri Sep 17 08:32:30 2010 +0300
+++ b/realtimenetprots/sipfw/SIP/ConnectionMgr/src/CStateModel.h	Mon Oct 04 00:41:02 2010 +0300
@@ -89,7 +89,10 @@
 	private: // New methods
 
 		/// @return Reference to the active state instance.
-		inline TStateBase& State() const;
+		inline TStateBase& State() const 
+            {
+		    return const_cast< TStateBase& >( iStates.At( iStateValue ) );
+		    }
 
 	private: // Constructors
 
--- a/sipplugins/sippsipadapter/src/CWPSIPAdapter.cpp	Fri Sep 17 08:32:30 2010 +0300
+++ b/sipplugins/sippsipadapter/src/CWPSIPAdapter.cpp	Mon Oct 04 00:41:02 2010 +0300
@@ -840,11 +840,22 @@
                     CSIPProfile* profile = NULL;
                     profile = registry->ProfileL( 
                         iDatas[counter]->GetProfileId() );
+                    CleanupStack::PushL( profile );
                     CSIPManagedProfile* managedProfile = 
                         static_cast<CSIPManagedProfile*>( profile );
+                    
+                    CleanupStack::PushL( managedProfile ); 
+                    
                     managedProfile->SetParameter( 
                         KSIPSnapId, (TUint32)snapId );
                     registry->SaveL( *managedProfile );
+                    
+                    CleanupStack::PopAndDestroy(managedProfile);
+                        
+                    CleanupStack::Pop( profile );
+                    profile = NULL;
+                       
+                    
                     CleanupStack::PopAndDestroy( 2, observer ); // CS:0
                     }
                 else
--- a/sipproviderplugins/sipprovider/sipconnectionplugins/inc/SIP_subconevents.h	Fri Sep 17 08:32:30 2010 +0300
+++ b/sipproviderplugins/sipprovider/sipconnectionplugins/inc/SIP_subconevents.h	Mon Oct 04 00:41:02 2010 +0300
@@ -137,6 +137,6 @@
 	static CSubConNotificationEvent* NewL(TAny* aConstructionParameters);
 	};
 
-#include "sip_subconevents.inl"
+#include <sip_subconevents.inl>
 
 #endif // SIPSCPR_SUBCONEVENTS_H
--- a/sipproviderplugins/sipprovider/sipconnectionplugins/inc/SIP_subconparams.h	Fri Sep 17 08:32:30 2010 +0300
+++ b/sipproviderplugins/sipprovider/sipconnectionplugins/inc/SIP_subconparams.h	Mon Oct 04 00:41:02 2010 +0300
@@ -272,6 +272,6 @@
 	static CSubConExtensionParameterSet* NewL(TAny* aConstructionParameters);
 	};
 
-#include "sip_subconparams.inl"
+#include <sip_subconparams.inl>
 
 #endif // SIP_SUBCONPARAMS_H