networkprotocolmodules/privacyprotocolmodule/PrivacyProtocolModule/src/privacymodule.cpp
changeset 0 9cfd9a3ee49c
equal deleted inserted replaced
-1:000000000000 0:9cfd9a3ee49c
       
     1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // privacymodule.h
       
    15 // This file provides the class implementation of the ECOM plug-in 
       
    16 // interface for the LBS Privacy Protocol Module.
       
    17 // 
       
    18 //
       
    19 
       
    20 #include <ecom/implementationproxy.h>
       
    21 #include "lbsdevloggermacros.h"
       
    22 #include <lbs/lbsadmin.h>
       
    23 #include "privacymodule.h"
       
    24 #include "lbsprivacyserverreturncodes.h"
       
    25 
       
    26 
       
    27 /** The unique ID of this plug-in implementation.
       
    28 This corresponds to the implementation UID specified in the .rss file
       
    29 for this protocol module.
       
    30 */
       
    31 const TInt KPluginUidValue = 0x1028373C;
       
    32 
       
    33 
       
    34 /** 
       
    35 Static public constructor.
       
    36 
       
    37 @param aObserver Plug-in parameters, which includes a reference to this protocol module's observer.
       
    38 @return A new instance of the CPrivacyProtocol class.
       
    39 */  
       
    40 CPrivacyProtocol* CPrivacyProtocol::NewL(TAny* aParam)
       
    41 	{
       
    42 	LBSLOG(ELogP1, "CPrivacyProtocol::NewL() Begin\n");
       
    43 	LBSLOG(ELogP2, "CPrivacyProtocol::NewL");
       
    44 
       
    45 	TLbsNetProtocolModuleParams* param = reinterpret_cast<TLbsNetProtocolModuleParams*>(aParam);
       
    46 	CPrivacyProtocol* self = new (ELeave) CPrivacyProtocol(param->Observer());
       
    47 	CleanupStack::PushL(self);
       
    48 	self->ConstructL();
       
    49 	CleanupStack::Pop(self);
       
    50 	LBSLOG(ELogP1, "CPrivacyProtocol::NewL() End\n");
       
    51 	return self;
       
    52 	}
       
    53 
       
    54 
       
    55 /** 
       
    56 Standard destructor.
       
    57 */  
       
    58 CPrivacyProtocol::~CPrivacyProtocol()
       
    59 	{
       
    60 	LBSLOG(ELogP1, "CPrivacyProtocol::~CPrivacyProtocol() Begin\n");
       
    61 	LBSLOG(ELogP2, "CPrivacyProtocol::~CPrivacyProtocol");
       
    62 	delete iRequestBuffer;
       
    63 	delete iServer;	
       
    64 	LBSLOG(ELogP1, "CPrivacyProtocol::~CPrivacyProtocol() End\n");
       
    65 	}
       
    66 
       
    67 
       
    68 /** 
       
    69 Request to cancel a previous privacy verification request.
       
    70 
       
    71 @param aCancelInfo The information required to cancel the request.
       
    72 */	
       
    73 void CPrivacyProtocol::CancelVerifyLocationRequest(CCancelPrivacyRequestInfo* aCancelInfo)
       
    74 	{
       
    75 	LBSLOG(ELogP1, "CPrivacyProtocol::CancelVerifyLocationRequest() Begin\n");
       
    76 	TInt requestId = aCancelInfo->GetRequestId();
       
    77 	TInt cancelReason = aCancelInfo->CancelReason();
       
    78 
       
    79 	// Complete the session
       
    80 	CPrivacyRequestInfo* request = iRequestBuffer->FindRequest(requestId);
       
    81 	if (request)
       
    82 		{
       
    83 		TLbsNetSessionId sessionId(TUid::Uid(KPluginUidValue),requestId);
       
    84 		iObserver.ProcessSessionComplete(sessionId,cancelReason);
       
    85 		request->SetIsSessionCompleteAutomatic(EFalse);
       
    86 		}
       
    87 	
       
    88 	// Cancel any waiting requests with this ID in the buffer
       
    89 	iRequestBuffer->CancelAnyOutstandingRequestById(requestId, cancelReason);
       
    90 
       
    91 	// We're done with this now, so delete
       
    92 	delete aCancelInfo;
       
    93 	
       
    94 	LBSLOG(ELogP1, "CPrivacyProtocol::CancelVerifyLocationRequest() End\n");
       
    95 	}
       
    96 
       
    97 
       
    98 /** 
       
    99 Request to get the next session ID to use for a new privacy request.
       
   100 
       
   101 @param aSessionId Reference to a TLbsNetSessionId to populate with the new session ID.
       
   102 */	
       
   103 void CPrivacyProtocol::GetNextSessionId(TLbsNetSessionId& aSessionId)
       
   104 	{
       
   105 	LBSLOG(ELogP1, "CPrivacyProtocol::GetNextSessionId() Begin\n");
       
   106 	aSessionId = iNextSessionId;
       
   107 	if (iNextSessionId.SessionNum() == KMaxTInt)
       
   108 		{
       
   109 		iNextSessionId.SetSessionNum(0);
       
   110 		}
       
   111 	iNextSessionId.IncrSession();
       
   112 	LBSLOG(ELogP1, "CPrivacyProtocol::GetNextSessionId() End\n");
       
   113 	}
       
   114 
       
   115 
       
   116 /** 
       
   117 Send a privacy notification request to the LBS sub-system.
       
   118 
       
   119 @param aRequestInfo The information about this request.
       
   120 */	
       
   121 void CPrivacyProtocol::NotifyLocationRequest(CPrivacyRequestInfo* aRequestInfo)
       
   122 	{
       
   123 	LBSLOG(ELogP1, "CPrivacyProtocol::NotifyLocationRequest() Begin\n");
       
   124 	ProcessRequest(aRequestInfo);
       
   125 	LBSLOG(ELogP1, "CPrivacyProtocol::NotifyLocationRequest() End\n");
       
   126 	}
       
   127 
       
   128 
       
   129 /** 
       
   130 Notifies the LBS sub-system that a previous privacy verification request timed out in the network.
       
   131 
       
   132 @param aRequestInfo The information about this request.
       
   133 */	
       
   134 void CPrivacyProtocol::NotifyVerificationTimeout(CPrivacyRequestInfo* aRequestInfo)
       
   135 	{
       
   136 	LBSLOG(ELogP1, "CPrivacyProtocol::NotifyVerificationTimeout() Begin\n");
       
   137 	ProcessRequest(aRequestInfo);
       
   138 	LBSLOG(ELogP1, "CPrivacyProtocol::NotifyVerificationTimeout() End\n");
       
   139 	}
       
   140 
       
   141 
       
   142 /** 
       
   143 Sends a privacy verification request to the LBS sub-system.
       
   144 
       
   145 @param aRequestInfo The information about this request.
       
   146 */	
       
   147 void CPrivacyProtocol::VerifyLocationRequest(CPrivacyRequestInfo* aRequestInfo)
       
   148 	{
       
   149 	LBSLOG(ELogP1, "CPrivacyProtocol::VerifyLocationRequest() Begin\n");
       
   150 	ProcessRequest(aRequestInfo);
       
   151 	LBSLOG(ELogP1, "CPrivacyProtocol::VerifyLocationRequest() End\n");
       
   152 	}
       
   153 
       
   154 /** 
       
   155 Sends a privacy request to the LBS sub-system.
       
   156 
       
   157 @param aRequestInfo The information about this request.
       
   158 */	
       
   159 void CPrivacyProtocol::PrivacyLocationRequest(CPrivacyRequestInfo* aRequestInfo)
       
   160 	{
       
   161     LBSLOG(ELogP7, "<-S CPrivacyProtocol::PrivacyLocationRequest(aRequestInfo)\n");
       
   162 	ProcessRequest(aRequestInfo);
       
   163 	}
       
   164 
       
   165 /**
       
   166 Completes the privacy request session. This is part of the call made from the client side, so 
       
   167 The client gets notified of this.
       
   168 
       
   169 @param aRequestId The session of the privacy request to be completed
       
   170 @param aReason The reason for which is completed
       
   171 */
       
   172 void CPrivacyProtocol::CompletePrivacyRequest(TUint32 aRequestId, TInt aReason)
       
   173 	{
       
   174     LBSLOG(ELogP7, "<-S CPrivacyProtocol::CompletePrivacyRequest(aRequestId, aReason)\n");
       
   175     LBSLOG2(ELogP7, "\t > TLbsPrivacyRequestId aRequestId = %d\n", aRequestId);
       
   176     LBSLOG2(ELogP7, "\t > TLbsPrivacyRequestId aReason = %d\n", aReason);
       
   177 	
       
   178 	CPrivacyRequestInfo* request = iRequestBuffer->FindRequest(aRequestId);
       
   179 	if (request)
       
   180 		{
       
   181 		// Need to complete the message for LBS
       
   182 		TLbsNetSessionId sessionId(TUid::Uid(KPluginUidValue),aRequestId);
       
   183 		iObserver.ProcessSessionComplete(sessionId,aReason);
       
   184 		request->SetIsSessionCompleteAutomatic(EFalse);
       
   185 
       
   186 		// Complete the request if it is awaiting a response.
       
   187 		if (request->IsResponseRequired())
       
   188 			{
       
   189 		    LBSLOG(ELogP7, "->A Client::RunL(aResponse)\n");
       
   190 		    LBSLOG2(ELogP7, "\t < TInt aResponse = %d\n", KRequestCancelledByClient);
       
   191 			request->CompleteRequest(KRequestCancelledByClient);
       
   192 			}
       
   193 		
       
   194 		// Remove the request and delete
       
   195 		iRequestBuffer->RemoveRequest(request);
       
   196 		delete request;
       
   197 		}
       
   198 
       
   199 	LBSLOG(ELogP1, "CPrivacyProtocol::CompletePrivacyRequest() End\n");
       
   200 	}
       
   201 
       
   202 /**
       
   203 Signals that a client has disconnected from the server.
       
   204 
       
   205 Normally the disconnect will be because the client has closed
       
   206 the session, but it may also be because the client panicked. 
       
   207 
       
   208 We must clean up any outstanding requests the client had here.
       
   209 
       
   210 @param aSession Session object for the client that disconnected.
       
   211 */
       
   212 void CPrivacyProtocol::SessionDisconnected(const CSession2* aSession)
       
   213 	{
       
   214 	LBSLOG(ELogP1, "CPrivacyProtocol::SessionDisconnected() Begin\n");
       
   215 
       
   216 	// Complete the session
       
   217 	CPrivacyRequestInfo* request = iRequestBuffer->FindRequest(aSession);
       
   218 	if (request)
       
   219 		{
       
   220 		TLbsNetSessionId sessionId(TUid::Uid(KPluginUidValue),request->GetRequestId());
       
   221 		iObserver.ProcessSessionComplete(sessionId,KErrCancel);
       
   222 		request->SetIsSessionCompleteAutomatic(EFalse);
       
   223 		
       
   224 		// Remove the request and delete
       
   225 		iRequestBuffer->RemoveRequest(request);
       
   226 		delete request;
       
   227 		}
       
   228 	
       
   229 	// Check if any buffered requests need to cancelled
       
   230 	iRequestBuffer->CancelAnyOutstandingRequestBySession(aSession);
       
   231 
       
   232 	LBSLOG(ELogP1, "CPrivacyProtocol::SessionDisconnected() End\n");	
       
   233 	}
       
   234 
       
   235 
       
   236 /** 
       
   237 Called by the Network Gateway in response to our privacy requests.
       
   238 
       
   239 @param aSessionId The ID of the session.
       
   240 @param aResponse Response information for this privacy session.
       
   241 */	
       
   242 void CPrivacyProtocol::RespondPrivacyRequest(const TLbsNetSessionId& aSessionId, const TLbsPrivacyResponse& aResponse)
       
   243 	{
       
   244 	// Locate the request in the buffer
       
   245 	CPrivacyRequestInfo* request = iRequestBuffer->FindRequest(aSessionId.SessionNum());
       
   246 	if (request)
       
   247 		{
       
   248 		// Complete the active request if it is awaiting a response
       
   249 		if (request->IsResponseRequired())
       
   250 			{
       
   251 			if(request->ConvertResponseCode())
       
   252 				{
       
   253 				request->CompleteRequest((aResponse == EPrivacyResponseAccepted) ? KErrNone : KErrAccessDenied);
       
   254 				}
       
   255 			else
       
   256 				{
       
   257 				request->CompleteRequest(aResponse);
       
   258 				}
       
   259 			// Only need to respond once, so clear the flag.
       
   260 			request->SetIsResponseRequired(EFalse);
       
   261 			}
       
   262 		
       
   263 		if(request->IsSessionCompleteAutomatic())
       
   264 			{
       
   265 			// Notify network gateway that this session is complete
       
   266 			iObserver.ProcessSessionComplete(aSessionId,KErrNone);
       
   267 			request->SetIsSessionCompleteAutomatic(EFalse);
       
   268 
       
   269 			// Remove the request and delete
       
   270 			iRequestBuffer->RemoveRequest(request);
       
   271 			delete request;
       
   272 			}
       
   273 		}
       
   274 	else
       
   275 		{
       
   276 		LBSLOG(ELogP2, "CPrivacyProtocol::RespondPrivacyRequest() Unexpected response\n");
       
   277 		}
       
   278 	}
       
   279 
       
   280 
       
   281 //---------------------------------------------------------------------------
       
   282 // The following Network Protocol Module SPI methods are are not supported, 
       
   283 // as this module is only concerned with privacy requests:
       
   284 //---------------------------------------------------------------------------
       
   285 
       
   286 
       
   287 /**
       
   288 Send a response to a location request to the network.
       
   289 @see CLbsNetworkProtocolBase::RespondLocationRequest()
       
   290 */
       
   291 void CPrivacyProtocol::RespondLocationRequest(const TLbsNetSessionId& /*aSessionId*/, TInt /*aReason*/, 
       
   292 												const TPositionInfoBase& /*aPosInfo*/)
       
   293 	{
       
   294 	LBSLOG(ELogP1, "CPrivacyProtocol::RespondPrivacyRequest()\n");
       
   295 	}
       
   296 
       
   297 
       
   298 /**
       
   299 Send a request for GPS assistance data to the network.
       
   300 @see CLbsNetworkProtocolBase::RequestAssistanceData()
       
   301 */
       
   302 void CPrivacyProtocol::RequestAssistanceData(TLbsAsistanceDataGroup /*aDataRequestMask*/)
       
   303 	{
       
   304 	LBSLOG(ELogP1, "CPrivacyProtocol::RespondPrivacyRequest()\n");
       
   305 	}
       
   306 
       
   307 
       
   308 /**
       
   309 Send a request for an approximate location based on the current network cell to the network.
       
   310 @see CLbsNetworkProtocolBase::RequestNetworkLocation()
       
   311 */
       
   312 void CPrivacyProtocol::RequestNetworkLocation(const TLbsNetSessionId& /*aSessionId*/,
       
   313 							const TLbsNetPosRequestOptionsBase& /*aOptions*/)
       
   314 	{
       
   315 	LBSLOG(ELogP1, "CPrivacyProtocol::RespondPrivacyRequest()\n");
       
   316 	}
       
   317 
       
   318 
       
   319 /**
       
   320 Tell the protocol module to finish the current network based location request.
       
   321 @see CLbsNetworkProtocolBase::CancelNetworkLocation()
       
   322 */
       
   323 void CPrivacyProtocol::CancelNetworkLocation(const TLbsNetSessionId& /*aSessionId*/,
       
   324 							TInt /*aReason*/)
       
   325 	{
       
   326 	LBSLOG(ELogP1, "CPrivacyProtocol::RespondPrivacyRequest()\n");
       
   327 	}
       
   328 
       
   329 
       
   330 /** 
       
   331 Request self locate.
       
   332 @see CLbsNetworkProtocolBase::RequestSelfLocation()
       
   333 */
       
   334 void CPrivacyProtocol::RequestSelfLocation(const TLbsNetSessionId& /*aSessionId*/,
       
   335 							const TLbsNetPosRequestOptionsBase& /*aOptions*/)	
       
   336 	{
       
   337 	LBSLOG(ELogP1, "CPrivacyProtocol::RespondPrivacyRequest()\n");
       
   338 	}
       
   339 
       
   340 
       
   341 /**
       
   342 Cancel request for self locate.
       
   343 @see CLbsNetworkProtocolBase::CancelSelfLocation()
       
   344 */
       
   345 void CPrivacyProtocol::CancelSelfLocation(const TLbsNetSessionId& /*aSessionId*/,
       
   346 							TInt /*aReason*/)
       
   347 	{
       
   348 	LBSLOG(ELogP1, "CPrivacyProtocol::RespondPrivacyRequest()\n");
       
   349 	}
       
   350 
       
   351 
       
   352 /**
       
   353 Lbs System Status information.
       
   354 @see CLbsNetworkProtocolBase::AdviceSystemStatus()
       
   355 */
       
   356 void CPrivacyProtocol::AdviceSystemStatus(TLbsSystemStatus /*aStatus*/)
       
   357 	{
       
   358 	LBSLOG(ELogP1, "CPrivacyProtocol::RespondPrivacyRequest()\n");
       
   359 	}
       
   360 
       
   361 
       
   362 /**
       
   363 Send a request to send the handsets location to a third party to the network.
       
   364 @see CLbsNetworkProtocolBase::RequestTransmitLocation()
       
   365 */
       
   366 void CPrivacyProtocol::RequestTransmitLocation(const TLbsNetSessionId& /*aSessionId*/,
       
   367 								const TDesC& /*aDestination*/, TInt /*aPriority*/)
       
   368 	{
       
   369 	LBSLOG(ELogP1, "CPrivacyProtocol::RespondPrivacyRequest()\n");
       
   370 	}
       
   371 
       
   372 
       
   373 /**
       
   374 Tell the protocol module to end the current send location to third party request.
       
   375 @see CLbsNetworkProtocolBase::CancelTransmitLocation()
       
   376 */
       
   377 void CPrivacyProtocol::CancelTransmitLocation(const TLbsNetSessionId& /*aSessionId*/, TInt /*aReason*/)
       
   378 	{
       
   379 	LBSLOG(ELogP1, "CPrivacyProtocol::RespondPrivacyRequest()\n");
       
   380 	}
       
   381 
       
   382 
       
   383 /** 
       
   384 Default constructor.
       
   385 
       
   386 @param aObserver Reference to this protocol module's observer.
       
   387 */
       
   388 CPrivacyProtocol::CPrivacyProtocol(MLbsNetworkProtocolObserver& aObserver) : 
       
   389 	iObserver(aObserver)
       
   390 	{
       
   391 	LBSLOG(ELogP2, "CPrivacyProtocol::CPrivacyProtocol Begin");
       
   392 	
       
   393 	// Seed the intial requestId from the current time.
       
   394 	TTime now;
       
   395     now.UniversalTime();
       
   396     const TInt KPosRequestIdShift = 14;
       
   397     TInt64 requestId64 = now.Int64() >> KPosRequestIdShift;
       
   398     TUint low = I64LOW(requestId64);
       
   399     TInt requestId = ~(~low | 0x80000000);
       
   400     iNextSessionId = TLbsNetSessionId(TUid::Uid(KPluginUidValue),
       
   401     								  requestId);
       
   402     
       
   403     LBSLOG(ELogP2, "CPrivacyProtocol::CPrivacyProtocol End");
       
   404 	}
       
   405 
       
   406 
       
   407 /** 
       
   408 Second stage private constructor.
       
   409 */  
       
   410 void CPrivacyProtocol::ConstructL()
       
   411 	{
       
   412 	LBSLOG(ELogP1, "CPrivacyProtocol::ConstructL() Begin\n");
       
   413 	iRequestBuffer = CPrivacyRequestBuffer::NewL();
       
   414 
       
   415 	iServer = CPrivacyServer::NewL(*this);
       
   416 	
       
   417 	CLbsAdmin* admin = CLbsAdmin::NewL();
       
   418 	CleanupStack::PushL(admin);
       
   419 	
       
   420 	
       
   421 	// Read admin setting for maximum number of external locate requests
       
   422 	TUint maxExternalLocateRequests = KLbsDefaultMaximumExternalLocateRequests;
       
   423 	TInt err = admin->Get(KLbsSettingMaximumExternalLocateRequests, maxExternalLocateRequests);
       
   424 	if (err != KErrNone)
       
   425 		{
       
   426 		LBSLOG_ERR2(ELogP4, "Failed to get KLbsSettingMaximumExternalLocateRequests (err %d)", err);
       
   427 		}
       
   428 	iMaxSimultaneousActiveRequests = maxExternalLocateRequests;	
       
   429 	LBSLOG2(ELogP1, "Using KLbsSettingMaximumExternalLocateRequests = %d", iMaxSimultaneousActiveRequests);
       
   430 
       
   431 	
       
   432 	// Read admin setting for shutdown delay
       
   433 	TUint shutdownDelay = KLbsDefaultPrivacyShutdownDelay;
       
   434 	err = admin->Get(KLbsSettingPrivacyShutdownDelay, shutdownDelay);
       
   435 	if (err != KErrNone)
       
   436 		{
       
   437 		LBSLOG_ERR2(ELogP4, "Failed to get KLbsSettingPrivacyShutdownDelay (err %d)", err);
       
   438 		}
       
   439 	LBSLOG2(ELogP1, "Using KLbsSettingPrivacyShutdownDelay = %d", shutdownDelay);
       
   440 	iServer->SetShutdownDelay(shutdownDelay);
       
   441 	
       
   442 	
       
   443 	// Read admin setting for maximum number of network sessions
       
   444 	TUint maxNetworkSessions = KLbsDefaultPrivacyMaxNetworkSessions;
       
   445 	err = admin->Get(KLbsSettingPrivacyMaxNetworkSessions, maxNetworkSessions);
       
   446 	if (err != KErrNone)
       
   447 		{
       
   448 		LBSLOG_ERR2(ELogP4, "Failed to get KLbsSettingPrivacyMaxNetworkSessions (err %d)", err);
       
   449 		}
       
   450 	LBSLOG2(ELogP1, "Using KLbsSettingPrivacyMaxNetworkSessions = %d", maxNetworkSessions);
       
   451 	iServer->SetMaxNetworkSessions(maxNetworkSessions);
       
   452 	
       
   453 	
       
   454 	CleanupStack::PopAndDestroy(admin);
       
   455 	LBSLOG(ELogP1, "CPrivacyProtocol::ConstructL() End\n");
       
   456 	}
       
   457 
       
   458 
       
   459 /** 
       
   460 Submit a privacy request for processing.
       
   461 
       
   462 Adds the request to the buffer, and starts processing it if possible.
       
   463 
       
   464 Note: There may be a limit on the number of requests allowed to be active simultaneously, if this
       
   465 limit is reached then the request will be buffered for processing later.
       
   466 
       
   467 @param aRequest The request info to process.
       
   468 */	
       
   469 void CPrivacyProtocol::ProcessRequest(CPrivacyRequestInfo* aRequest)
       
   470 	{
       
   471 	LBSLOG(ELogP1, "CPrivacyProtocol::ProcessRequest() Begin\n");
       
   472 
       
   473 	if (iRequestBuffer->NumRequests() >= iMaxSimultaneousActiveRequests)
       
   474 		{
       
   475 		// Maximum number of requests has been reached
       
   476 		LBSLOG_WARN(ELogP1, "CPrivacyProtocol::ProcessRequest() Request limit reached\n");
       
   477 		if (aRequest->IsResponseRequired())
       
   478 			{
       
   479 			aRequest->CompleteRequest(KErrServerBusy);
       
   480 			}
       
   481 		delete aRequest;
       
   482 		return;
       
   483 		}
       
   484 
       
   485 	// Add the request to the buffer
       
   486 	TRAPD(err, iRequestBuffer->AddRequestL(aRequest));
       
   487 	if (err != KErrNone)
       
   488 		{
       
   489 		// A problem occured and the request could not be added to the buffer
       
   490 		LBSLOG_WARN2(ELogP1, "CPrivacyProtocol::ProcessRequest() Error buffering request (%d)\n", err);
       
   491 		if (aRequest->IsResponseRequired())
       
   492 			{
       
   493 			aRequest->CompleteRequest(err);
       
   494 			}
       
   495 		delete aRequest;
       
   496 		return;
       
   497 		}
       
   498 
       
   499 	// Send the request to the network gateway
       
   500 	LBSLOG(ELogP1, "CPrivacyProtocol::ProcessRequest() Sending request\n");
       
   501 
       
   502 	TLbsNetSessionId sessionId(TUid::Uid(KPluginUidValue),aRequest->GetRequestId());
       
   503 	
       
   504 	TLbsNetPosRequestPrivacy requestPrivacy;
       
   505 	aRequest->GetRequestPrivacy(requestPrivacy);
       
   506 			
       
   507 	TLbsExternalRequestInfo2 requestInfo;
       
   508 	aRequest->GetRequestInfo(requestInfo);
       
   509 	
       
   510 #ifdef ENABLE_LBS_DEV_LOGGER
       
   511     LBSLOG(ELogP7, "->A MLbsNetworkProtocolObserver::ProcessPrivacyRequest(sessionId, EFalse, requestPrivacy, requestInfo) LbsPrivacyProtocolModule\n");
       
   512     LBSLOG2(ELogP7, "\t < TLbsPrivacyRequestId sessionId = %d\n", aRequest->GetRequestId());
       
   513     LBSLOG(ELogP7, "\t < TLbsNetPosRequestPrivacy requestPrivacy = \n");
       
   514     LBSLOG2(ELogP7, "\t\t < TLbsRequestAdvice iAdvice = %d\n", requestPrivacy.RequestAdvice());
       
   515     LBSLOG2(ELogP7, "\t\t < TLbsRequestAction iAction = %d\n", requestPrivacy.RequestAction());
       
   516     LBSLOG(ELogP7, "\t < TLbsExternalRequestInfo2 requestInfo = \n");
       
   517 
       
   518     TBuf16<KLbsMaxRequesterIdSize2 - KLbsMaxRequesterIdSize/2> requesterId; // Same length as TLbsExternalRequestInfo2::iRequesterIdExt
       
   519     requestInfo.GetRequesterId(requesterId);
       
   520     LBSLOG2(ELogP7, "\t\t < TLbsRequesterId iRequesterId = %S\n", &requesterId);
       
   521        
       
   522     TBuf16<KLbsMaxClientNameSize2 - KLbsMaxClientNameSize/2> clientName; // / Same length as TLbsExternalRequestInfo2::iClientNameExt
       
   523     requestInfo.GetClientName(clientName);
       
   524     LBSLOG2(ELogP7, "\t\t < TLbsClientName iClientName = %S\n", &clientName);
       
   525 
       
   526     TBuf8<KLbsMaxClientExternalIdSize> clientExternalId;
       
   527     requestInfo.GetClientExternalId(clientExternalId);
       
   528     LBSLOG2(ELogP7, "\t\t < TLbsClientExternalId iClientExternalId = %S\n", &clientExternalId);
       
   529     
       
   530     LBSLOG2(ELogP7, "\t\t < TRequestType iRequestType = %d\n", requestInfo.RequestType());
       
   531     LBSLOG2(ELogP7, "\t\t < TRequestSource iRequestSource = %d\n", requestInfo.RequestSource());
       
   532     LBSLOG2(ELogP7, "\t\t < TNetworkType iNetworkType = %d\n", requestInfo.NetworkType());
       
   533     LBSLOG2(ELogP7, "\t\t < TFormatIndicator iRequesterFormat = %d\n", requestInfo.RequesterIdFormat());
       
   534     LBSLOG2(ELogP7, "\t\t < TFormatIndicator iClientFormat = %d\n", requestInfo.ClientNameFormat());
       
   535 //  LBSLOG2(ELogP7, "\t\t < TCodingScheme iRequesterCoding = %d\n", requestInfo.RequesterIdCodingScheme());
       
   536 //  LBSLOG2(ELogP7, "\t\t < TCodingScheme iClientCoding = %d\n", requestInfo.ClientNameCodingScheme());
       
   537 #endif
       
   538 
       
   539     iObserver.ProcessPrivacyRequest(sessionId, EFalse, requestPrivacy, requestInfo);
       
   540     
       
   541     LBSLOG(ELogP1, "CPrivacyProtocol::ProcessRequest() End\n");
       
   542 	}
       
   543 
       
   544 /** 
       
   545 Defines the plug-in interface implementation UIDs, required by ECOM.
       
   546 */
       
   547 const TImplementationProxy ImplementationTable[] = 
       
   548     {
       
   549     IMPLEMENTATION_PROXY_ENTRY(KPluginUidValue, CPrivacyProtocol::NewL)
       
   550     };
       
   551 
       
   552 
       
   553 /** 
       
   554 Exported function for ECOM to retrieve implementations table.
       
   555 */
       
   556 EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
       
   557     {
       
   558     aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
       
   559 
       
   560     return ImplementationTable;
       
   561     }
       
   562 
       
   563 
       
   564