201037_04
authorhgs
Tue, 19 Oct 2010 05:33:24 +0530
changeset 54 e4420734a2a0
parent 50 a003f0e60a07
child 55 36ea1f90a3d8
201037_04
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 03 14:18:25 2010 +0300
+++ b/realtimenetprots/sipfw/ProfileAgent/ApnManager/inc/sipapnconfigurationhandler.h	Tue Oct 19 05:33:24 2010 +0530
@@ -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 03 14:18:25 2010 +0300
+++ b/realtimenetprots/sipfw/ProfileAgent/ApnManager/src/sipapnconfigurationhandler.cpp	Tue Oct 19 05:33:24 2010 +0530
@@ -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 03 14:18:25 2010 +0300
+++ b/realtimenetprots/sipfw/ProfileAgent/IMS_Agent/Src/CSIPRegEventSubscriber.cpp	Tue Oct 19 05:33:24 2010 +0530
@@ -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 03 14:18:25 2010 +0300
+++ b/realtimenetprots/sipfw/ProfileAgent/Server/Src/SipProfileCacheItem.cpp	Tue Oct 19 05:33:24 2010 +0530
@@ -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 03 14:18:25 2010 +0300
+++ b/realtimenetprots/sipfw/ProfileAgent/profile_fsm/src/Sipprofilecontextbase.cpp	Tue Oct 19 05:33:24 2010 +0530
@@ -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 03 14:18:25 2010 +0300
+++ b/realtimenetprots/sipfw/SIP/ConnectionMgr/src/CStateModel.cpp	Tue Oct 19 05:33:24 2010 +0530
@@ -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 03 14:18:25 2010 +0300
+++ b/realtimenetprots/sipfw/SIP/ConnectionMgr/src/CStateModel.h	Tue Oct 19 05:33:24 2010 +0530
@@ -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 03 14:18:25 2010 +0300
+++ b/sipplugins/sippsipadapter/src/CWPSIPAdapter.cpp	Tue Oct 19 05:33:24 2010 +0530
@@ -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 03 14:18:25 2010 +0300
+++ b/sipproviderplugins/sipprovider/sipconnectionplugins/inc/SIP_subconevents.h	Tue Oct 19 05:33:24 2010 +0530
@@ -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 03 14:18:25 2010 +0300
+++ b/sipproviderplugins/sipprovider/sipconnectionplugins/inc/SIP_subconparams.h	Tue Oct 19 05:33:24 2010 +0530
@@ -272,6 +272,6 @@
 	static CSubConExtensionParameterSet* NewL(TAny* aConstructionParameters);
 	};
 
-#include "sip_subconparams.inl"
+#include <sip_subconparams.inl>
 
 #endif // SIP_SUBCONPARAMS_H