syncmlfw/dm/provisioningadapter/src/NSmlDmProvisioningAdapter.cpp
branchRCL_3
changeset 34 696f5dd11939
parent 0 b497e44ab2fc
child 61 b183ec05bd8c
--- a/syncmlfw/dm/provisioningadapter/src/NSmlDmProvisioningAdapter.cpp	Tue May 25 13:36:17 2010 +0300
+++ b/syncmlfw/dm/provisioningadapter/src/NSmlDmProvisioningAdapter.cpp	Wed Jun 09 10:37:30 2010 +0300
@@ -59,6 +59,7 @@
 // -----------------------------------------------------------------------------
 void CNSmlDmProvisioningAdapter::ConstructL()
 	{
+    iLock = EFalse;
 	iSession.OpenL();
 	FeatureManager::InitializeLibL();
 	}
@@ -217,9 +218,8 @@
 		TInt isprofilelocked=profile.ProfileLocked(EFalse, EFalse);
 		if (isprofilelocked == 1)
 		 {
-		  
-      profile.Close(); 
-      User::Leave(KErrAccessDenied); 	 	
+            profile.ProfileLocked(ETrue, EFalse);
+            iLock = ETrue;	 	
 		 }
 		
 		}
@@ -259,6 +259,14 @@
 	    }
 		    
 	// creates profile -> must be done before opening the connection
+
+	
+	if(iLock)
+	    {
+      profile.ProfileLocked(ETrue, ETrue);
+      iLock = EFalse;
+	    }
+	    
 	profile.UpdateL();
 	
 	RSyncMLConnection connection;
@@ -426,7 +434,7 @@
 	    
 	    CleanupStack::PopAndDestroy(alertMessage);	    
 	    }
-
+	    
 	CleanupStack::PopAndDestroy( &profile );
 
 	_DBG_FILE("CNSmlDmProvisioningAdapter::SaveL(): end");