installationservices/swinstallationfw/source/siftransportserver.cpp
changeset 33 8110bf1194d1
parent 24 84a16765cd86
--- a/installationservices/swinstallationfw/source/siftransportserver.cpp	Mon May 03 12:38:03 2010 +0300
+++ b/installationservices/swinstallationfw/source/siftransportserver.cpp	Fri May 14 15:58:48 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2008 - 2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of the License "Eclipse Public License v1.0"
@@ -20,6 +20,8 @@
 #include "siftransportserver.h"
 #include "siftransportcommon.h"
 #include <e32property.h>
+#include "sifnotification_internal.h"
+#include "scrclient.inl"
 
 using namespace Usif;
 
@@ -53,8 +55,26 @@
 	starts the server.
  */
 	{
-	CScsServer::ConstructL(aShutdownPeriodUs);
+	// Define a key (KSifOperationKey) which would be used to notify the client of any new operations.
+    TInt ret = RProperty::Define(KUidSystemCategory, KSifOperationKey, RProperty::EByteArray, KSecurityPolicyWDD, KSecurityPolicyNone,(sizeof(TInt) * KMaxNumberOfOperations));
+    if (ret != KErrAlreadyExists && ret != KErrNone)
+        {
+        User::Leave(ret);
+        }
 
+    if(ret == KErrNone)
+        {
+        // Create a empty CSifOperationKey object and publish it.
+        CSifOperationKey* nullKey = CSifOperationKey::NewL();
+        CleanupStack::PushL(nullKey);
+        RBuf8 nullKeyBuffer;
+        nullKeyBuffer.CleanupClosePushL();
+        ExternalizeRefObjectL(*nullKey, nullKeyBuffer);
+        User::LeaveIfError(RProperty::Set(KUidSystemCategory, KSifOperationKey, nullKeyBuffer));
+		CleanupStack::PopAndDestroy(2, nullKey);
+        }
+    
+    CScsServer::ConstructL(aShutdownPeriodUs);
 	StartL(aServerName);
 	}
 
@@ -64,6 +84,7 @@
 	Cleanup the server, in particular close the RFs session.
  */
 	{
+	RProperty::Delete(Usif::KSifOperationKey);
 	}
 
 CScsSession* CSifTransportServer::DoNewSessionL(const RMessage2& /*aMessage*/)