installationservices/swinstallationfw/source/siftransportserver.cpp
changeset 33 8110bf1194d1
parent 24 84a16765cd86
equal deleted inserted replaced
29:26b6f0522fd8 33:8110bf1194d1
     1 /*
     1 /*
     2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2008 - 2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of the License "Eclipse Public License v1.0"
     5 * under the terms of the License "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    18 
    18 
    19 
    19 
    20 #include "siftransportserver.h"
    20 #include "siftransportserver.h"
    21 #include "siftransportcommon.h"
    21 #include "siftransportcommon.h"
    22 #include <e32property.h>
    22 #include <e32property.h>
       
    23 #include "sifnotification_internal.h"
       
    24 #include "scrclient.inl"
    23 
    25 
    24 using namespace Usif;
    26 using namespace Usif;
    25 
    27 
    26 CSifTransportServer* CSifTransportServer::NewLC(const TDesC& aServerName, const TVersion& aVersion,
    28 CSifTransportServer* CSifTransportServer::NewLC(const TDesC& aServerName, const TVersion& aVersion,
    27 									TransportTaskFactory::GenerateTask aTaskFactory, TInt aShutdownPeriodUs)
    29 									TransportTaskFactory::GenerateTask aTaskFactory, TInt aShutdownPeriodUs)
    51 /**
    53 /**
    52 	Second-phase construction initializes the superclass and
    54 	Second-phase construction initializes the superclass and
    53 	starts the server.
    55 	starts the server.
    54  */
    56  */
    55 	{
    57 	{
    56 	CScsServer::ConstructL(aShutdownPeriodUs);
    58 	// Define a key (KSifOperationKey) which would be used to notify the client of any new operations.
       
    59     TInt ret = RProperty::Define(KUidSystemCategory, KSifOperationKey, RProperty::EByteArray, KSecurityPolicyWDD, KSecurityPolicyNone,(sizeof(TInt) * KMaxNumberOfOperations));
       
    60     if (ret != KErrAlreadyExists && ret != KErrNone)
       
    61         {
       
    62         User::Leave(ret);
       
    63         }
    57 
    64 
       
    65     if(ret == KErrNone)
       
    66         {
       
    67         // Create a empty CSifOperationKey object and publish it.
       
    68         CSifOperationKey* nullKey = CSifOperationKey::NewL();
       
    69         CleanupStack::PushL(nullKey);
       
    70         RBuf8 nullKeyBuffer;
       
    71         nullKeyBuffer.CleanupClosePushL();
       
    72         ExternalizeRefObjectL(*nullKey, nullKeyBuffer);
       
    73         User::LeaveIfError(RProperty::Set(KUidSystemCategory, KSifOperationKey, nullKeyBuffer));
       
    74 		CleanupStack::PopAndDestroy(2, nullKey);
       
    75         }
       
    76     
       
    77     CScsServer::ConstructL(aShutdownPeriodUs);
    58 	StartL(aServerName);
    78 	StartL(aServerName);
    59 	}
    79 	}
    60 
    80 
    61 
    81 
    62 CSifTransportServer::~CSifTransportServer()
    82 CSifTransportServer::~CSifTransportServer()
    63 /**
    83 /**
    64 	Cleanup the server, in particular close the RFs session.
    84 	Cleanup the server, in particular close the RFs session.
    65  */
    85  */
    66 	{
    86 	{
       
    87 	RProperty::Delete(Usif::KSifOperationKey);
    67 	}
    88 	}
    68 
    89 
    69 CScsSession* CSifTransportServer::DoNewSessionL(const RMessage2& /*aMessage*/)
    90 CScsSession* CSifTransportServer::DoNewSessionL(const RMessage2& /*aMessage*/)
    70 /**
    91 /**
    71 	Implement CScsServer by allocating a new instance of CSifSession.
    92 	Implement CScsServer by allocating a new instance of CSifSession.