networkprotocolmodules/privacyprotocolmodule/ClientAPI/PrivacyRequestAPI/src/lbsprivacyrequestimpl.cpp
changeset 0 9cfd9a3ee49c
equal deleted inserted replaced
-1:000000000000 0:9cfd9a3ee49c
       
     1  //lbsprivacyrequestimpl.cpp
       
     2 
       
     3 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     4 // All rights reserved.
       
     5 // This component and the accompanying materials are made available
       
     6 // under the terms of "Eclipse Public License v1.0"
       
     7 // which accompanies this distribution, and is available
       
     8 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     9 //
       
    10 // Initial Contributors:
       
    11 // Nokia Corporation - initial contribution.
       
    12 //
       
    13 // Contributors:
       
    14 //
       
    15 // Description:
       
    16 //
       
    17 
       
    18 #include    "lbsprivacyrequestimpl.h"
       
    19 #include    "lbsprivacyrequestresponsehandler.h"
       
    20 #include <lbs/lbsnetcommon.h>
       
    21 
       
    22 
       
    23 /*
       
    24 * Default constructor.
       
    25 */
       
    26 CLbsPrivacyRequestImpl::CLbsPrivacyRequestImpl(MLbsPrivacyRequestObserver& aObserver)
       
    27    :iObserver(aObserver)
       
    28     {
       
    29         
       
    30     }
       
    31 
       
    32 /**
       
    33  * Standard ConstructL
       
    34  */
       
    35 void CLbsPrivacyRequestImpl::ConstructL()
       
    36     {
       
    37 	User::LeaveIfError(iServer.Connect(ELbsProxyApiTypeLocal));
       
    38     }
       
    39 
       
    40 /**
       
    41  * Standard Symbian OS two-phase constructor.
       
    42  * @return A new instance of this class.
       
    43  */
       
    44 CLbsPrivacyRequestImpl* CLbsPrivacyRequestImpl::NewL(MLbsPrivacyRequestObserver& aObserver)
       
    45     {
       
    46     CLbsPrivacyRequestImpl* self = new (ELeave) CLbsPrivacyRequestImpl(aObserver);
       
    47     CleanupStack::PushL(self);
       
    48     self->ConstructL();
       
    49     CleanupStack::Pop(self);
       
    50     return self;
       
    51     }
       
    52 
       
    53 /**
       
    54 * Destructor
       
    55 */
       
    56 CLbsPrivacyRequestImpl::~CLbsPrivacyRequestImpl()
       
    57     {
       
    58     iResponseHandler.ResetAndDestroy();
       
    59     iServer.Close();
       
    60 	}
       
    61 
       
    62 TInt CLbsPrivacyRequestImpl::NewPrivacyRequest(TLbsPrivacyRequestId& aRequestId, /*out*/
       
    63 		 const TLbsPrivacyRequest& aPrivacy,/*in*/
       
    64 		 const TLbsExternalRequestInfo& aRequestInfo/*in*/)
       
    65 	{
       
    66 	TInt validation = ValidateNewPrivReqArguments(aPrivacy, aRequestInfo);
       
    67 	if(KErrNone != validation)
       
    68 		{
       
    69 		return validation;
       
    70 		}
       
    71 
       
    72 	TLbsNetPosRequestPrivacy netPosRequestPrivacy;
       
    73 	netPosRequestPrivacy.SetRequestAction(static_cast<TLbsNetPosRequestPrivacy::TLbsRequestAction>(aPrivacy.RequestAction()));
       
    74 	netPosRequestPrivacy.SetRequestAdvice(static_cast<TLbsNetPosRequestPrivacy::TLbsRequestAdvice>(aPrivacy.RequestAdvice()));
       
    75 
       
    76 	CPrivacyRequestResponseHandler* newResponseHandler = NULL;
       
    77 	TRAPD(err, newResponseHandler = CPrivacyRequestResponseHandler::NewLC(*this, iServer, iObserver);
       
    78                 iResponseHandler.AppendL(newResponseHandler);
       
    79                 CleanupStack::Pop(newResponseHandler);
       
    80           );
       
    81 	newResponseHandler->NewPrivacyRequest(aRequestId, aRequestInfo, netPosRequestPrivacy);
       
    82 	return err;
       
    83 	}
       
    84 
       
    85 TInt CLbsPrivacyRequestImpl::RepeatPrivacyRequest(const TLbsPrivacyRequestId aRequestId, /*in*/
       
    86 		 const TLbsPrivacyRequest& aPrivacy,/*in*/
       
    87 		 const TLbsExternalRequestInfo& aRequestInfo/*in*/)
       
    88 	{
       
    89 	TInt validation = ValidateRepeatPrivReqArguments(aRequestId, aPrivacy, aRequestInfo);
       
    90 	if(KErrNone != validation)
       
    91 		{
       
    92 		return validation;
       
    93 		}
       
    94 	
       
    95 	TLbsNetPosRequestPrivacy netPosRequestPrivacy;
       
    96 	netPosRequestPrivacy.SetRequestAction(static_cast<TLbsNetPosRequestPrivacy::TLbsRequestAction>(aPrivacy.RequestAction()));
       
    97 	netPosRequestPrivacy.SetRequestAdvice(static_cast<TLbsNetPosRequestPrivacy::TLbsRequestAdvice>(aPrivacy.RequestAdvice()));
       
    98 
       
    99 	CPrivacyRequestResponseHandler* newResponseHandler = NULL;
       
   100 	TRAPD(err, newResponseHandler = CPrivacyRequestResponseHandler::NewLC(*this, iServer, iObserver);
       
   101                 iResponseHandler.AppendL(newResponseHandler);
       
   102                 CleanupStack::Pop(newResponseHandler);
       
   103          );
       
   104 	newResponseHandler->RepeatPrivacyRequest(aRequestId, aRequestInfo, netPosRequestPrivacy);
       
   105 
       
   106 	return err;
       
   107 	}
       
   108 
       
   109 TInt CLbsPrivacyRequestImpl::CompleteRequest(TLbsPrivacyRequestId aRequestId/*in*/,
       
   110 		  TInt aReason/*in*/)
       
   111 	{
       
   112 	return iServer.CompleteRequest(aRequestId, aReason);
       
   113 	}
       
   114 
       
   115 TInt CLbsPrivacyRequestImpl::ValidateNewPrivReqArguments(const TLbsPrivacyRequest& aPrivacy, const TLbsExternalRequestInfo& aRequestInfo)
       
   116 	{
       
   117 	TLbsPrivacyRequest::TLbsRequestAdvice requestAdvice(aPrivacy.RequestAdvice());
       
   118 	switch(requestAdvice)
       
   119 		{
       
   120 		case TLbsPrivacyRequest::ERequestAdviceNotify:
       
   121 		case TLbsPrivacyRequest::ERequestAdviceVerify:
       
   122 		case TLbsPrivacyRequest::ERequestAdviceSilent:
       
   123 			break; // do nothing for good value(s)
       
   124 		case TLbsPrivacyRequest::ERequestAdviceNotUsed:
       
   125 			{
       
   126 			return KErrArgument;
       
   127 			}
       
   128 		case TLbsPrivacyRequest::ERequestAdviceStealth:
       
   129 
       
   130 			{
       
   131 			return KErrNotSupported;
       
   132 			}
       
   133 		default:
       
   134 			{
       
   135 			return KErrArgument;
       
   136 			}
       
   137 		}
       
   138 
       
   139 	TLbsPrivacyRequest::TLbsRequestAction requestAction(aPrivacy.RequestAction());
       
   140 	switch(requestAction)
       
   141 		{
       
   142 		case TLbsPrivacyRequest::ERequestActionAllow:
       
   143 		case TLbsPrivacyRequest::ERequestActionReject:
       
   144 			break; // do nothing for good value(s)
       
   145 		case TLbsPrivacyRequest::ERequestActionNotUsed:
       
   146 			{
       
   147 			return KErrArgument;
       
   148 			}
       
   149 		default:
       
   150 			{
       
   151 			return KErrArgument;
       
   152 			}
       
   153 		}
       
   154 
       
   155 	TLbsExternalRequestInfo::TRequestSource requestSource(aRequestInfo.RequestSource());
       
   156 	TLbsExternalRequestInfo::TRequestType requestType(aRequestInfo.RequestType());
       
   157 	TLbsExternalRequestInfo::TNetworkType networkType(aRequestInfo.NetworkType());
       
   158 	TLbsExternalRequestInfo::TFormatIndicator requesterIdFormatIndicator(aRequestInfo.RequesterIdFormat());
       
   159 	TLbsExternalRequestInfo::TFormatIndicator clientFormatIndicator(aRequestInfo.ClientNameFormat());
       
   160 
       
   161 	switch(requestSource)
       
   162 		{
       
   163 		case TLbsExternalRequestInfo::ERequestSourceLocal:
       
   164 			{
       
   165 			switch(requestType)
       
   166 				{
       
   167 				case TLbsExternalRequestInfo::ERequestSingleShot:
       
   168 				case TLbsExternalRequestInfo::ERequestPeriodic:
       
   169 				case TLbsExternalRequestInfo::ERequestSingleShotSilent:
       
   170 				case TLbsExternalRequestInfo::ERequestPeriodicSilent:
       
   171 					break; // do nothing for good value(s)
       
   172 				case TLbsExternalRequestInfo::ERequestAreaEvent:
       
   173 				case TLbsExternalRequestInfo::ERequestAreaEventSilent:
       
   174 					{
       
   175 					return KErrNotSupported;
       
   176 					}
       
   177 				case TLbsExternalRequestInfo::ERequestTypeUnknown:
       
   178 					{
       
   179 					return KErrArgument;
       
   180 					}
       
   181 				default:
       
   182 					{
       
   183 					return KErrArgument;
       
   184 					}
       
   185 				}
       
   186 
       
   187 			switch(networkType)
       
   188 				{
       
   189 				case TLbsExternalRequestInfo::ENetworkTypeUnknown:
       
   190 					break; // do nothing for good value(s)
       
   191 				case TLbsExternalRequestInfo::ENetworkGSM:
       
   192 				case TLbsExternalRequestInfo::ENetworkSUPL:
       
   193 				case TLbsExternalRequestInfo::ENetworkWCDMA:
       
   194 					{
       
   195 					return KErrArgument;
       
   196 					}
       
   197 				default:
       
   198 					{
       
   199 					return KErrArgument;
       
   200 					}
       
   201 				}
       
   202 
       
   203 			// Return KErrArgument if both formatIndicators are EFormatUnknown
       
   204 			if((requesterIdFormatIndicator == TLbsExternalRequestInfo::EFormatUnknown)&&
       
   205 					(clientFormatIndicator == TLbsExternalRequestInfo::EFormatUnknown))
       
   206 				{
       
   207 				return KErrArgument;
       
   208 				}
       
   209 			if(requesterIdFormatIndicator != TLbsExternalRequestInfo::EFormatUnknown)
       
   210 				{
       
   211 				switch(requesterIdFormatIndicator)
       
   212 					{
       
   213 					case TLbsExternalRequestInfo::EFormatLogicalName:
       
   214 					case TLbsExternalRequestInfo::EFormatEmailAddress:
       
   215 					case TLbsExternalRequestInfo::EFormatMSISDN:
       
   216 					case TLbsExternalRequestInfo::EFormatURL:
       
   217 					case TLbsExternalRequestInfo::EFormatSIPURL	:
       
   218 					case TLbsExternalRequestInfo::EFormatIMSPublicIdentity:
       
   219 					case TLbsExternalRequestInfo::EFormatMIN:
       
   220 					case TLbsExternalRequestInfo::EFormatMDN:
       
   221 					case TLbsExternalRequestInfo::EFormatAppUID:
       
   222 						break; // do nothing for good value(s)
       
   223 					default:
       
   224 						{
       
   225 						return KErrArgument;
       
   226 						}
       
   227 					}
       
   228 				}
       
   229 			if(clientFormatIndicator != TLbsExternalRequestInfo::EFormatUnknown)
       
   230 				{
       
   231 				switch(clientFormatIndicator)
       
   232 					{
       
   233 					case TLbsExternalRequestInfo::EFormatLogicalName:
       
   234 					case TLbsExternalRequestInfo::EFormatEmailAddress:
       
   235 					case TLbsExternalRequestInfo::EFormatMSISDN:
       
   236 					case TLbsExternalRequestInfo::EFormatURL:
       
   237 					case TLbsExternalRequestInfo::EFormatSIPURL	:
       
   238 					case TLbsExternalRequestInfo::EFormatIMSPublicIdentity:
       
   239 					case TLbsExternalRequestInfo::EFormatMIN:
       
   240 					case TLbsExternalRequestInfo::EFormatMDN:
       
   241 					case TLbsExternalRequestInfo::EFormatAppUID:
       
   242 						break; // do nothing for good value(s)
       
   243 					default:
       
   244 						{
       
   245 						return KErrArgument;
       
   246 						}
       
   247 					}
       
   248 				}
       
   249 			break;
       
   250 			}
       
   251 		
       
   252 		case TLbsExternalRequestInfo::ERequestSourceNetwork:
       
   253 			{
       
   254 			switch(requestType)
       
   255 				{
       
   256 				case TLbsExternalRequestInfo::ERequestSingleShot:
       
   257 				case TLbsExternalRequestInfo::ERequestPeriodic:
       
   258 				case TLbsExternalRequestInfo::ERequestAreaEvent:
       
   259                 case TLbsExternalRequestInfo::ERequestSingleShotSilent:
       
   260                 case TLbsExternalRequestInfo::ERequestPeriodicSilent:
       
   261                 case TLbsExternalRequestInfo::ERequestAreaEventSilent:
       
   262 					break; // do nothing for good value(s)
       
   263 				case TLbsExternalRequestInfo::ERequestTypeUnknown:
       
   264 					{
       
   265 					return KErrArgument;
       
   266 					}
       
   267 				default:
       
   268 					{
       
   269 					return KErrArgument;
       
   270 					}
       
   271 				}
       
   272 
       
   273 			switch(networkType)
       
   274 				{
       
   275 				case TLbsExternalRequestInfo::ENetworkGSM:
       
   276 				case TLbsExternalRequestInfo::ENetworkSUPL:
       
   277 				case TLbsExternalRequestInfo::ENetworkWCDMA:
       
   278 					break; // do nothing for good value(s)
       
   279 				case TLbsExternalRequestInfo::ENetworkTypeUnknown:
       
   280 					{
       
   281 					return KErrArgument;
       
   282 					}
       
   283 				default:
       
   284 					{
       
   285 					return KErrArgument;
       
   286 					}
       
   287 				}
       
   288 			// Return KErrArgument if both formatIndicators are EFormatUnknown
       
   289 			if((requesterIdFormatIndicator == TLbsExternalRequestInfo::EFormatUnknown)&&
       
   290 					(clientFormatIndicator == TLbsExternalRequestInfo::EFormatUnknown))
       
   291 				{
       
   292 				return KErrArgument;
       
   293 				}
       
   294 			if(requesterIdFormatIndicator != TLbsExternalRequestInfo::EFormatUnknown)
       
   295 				{
       
   296 				switch(requesterIdFormatIndicator)
       
   297 					{
       
   298 					case TLbsExternalRequestInfo::EFormatLogicalName:
       
   299 					case TLbsExternalRequestInfo::EFormatEmailAddress:
       
   300 					case TLbsExternalRequestInfo::EFormatMSISDN:
       
   301 					case TLbsExternalRequestInfo::EFormatURL:
       
   302 					case TLbsExternalRequestInfo::EFormatSIPURL	:
       
   303 					case TLbsExternalRequestInfo::EFormatIMSPublicIdentity:
       
   304 						break; // do nothing for good value(s)
       
   305 					case TLbsExternalRequestInfo::EFormatMIN:
       
   306 					case TLbsExternalRequestInfo::EFormatMDN:
       
   307 						{
       
   308 						if (networkType != TLbsExternalRequestInfo::ENetworkSUPL)
       
   309 							{
       
   310 							return KErrArgument;
       
   311 							}
       
   312 						}
       
   313 						break;
       
   314 					case TLbsExternalRequestInfo::EFormatAppUID:
       
   315 						{
       
   316 						return KErrArgument;
       
   317 						}
       
   318 					default:
       
   319 						{
       
   320 						return KErrArgument;
       
   321 						}
       
   322 					}
       
   323 				}
       
   324 			if(clientFormatIndicator != TLbsExternalRequestInfo::EFormatUnknown)
       
   325 				{
       
   326 				switch(clientFormatIndicator)
       
   327 					{
       
   328 					case TLbsExternalRequestInfo::EFormatLogicalName:
       
   329 					case TLbsExternalRequestInfo::EFormatEmailAddress:
       
   330 					case TLbsExternalRequestInfo::EFormatMSISDN:
       
   331 					case TLbsExternalRequestInfo::EFormatURL:
       
   332 					case TLbsExternalRequestInfo::EFormatSIPURL	:
       
   333 					case TLbsExternalRequestInfo::EFormatIMSPublicIdentity:
       
   334 						break; // do nothing for good value(s)
       
   335 					case TLbsExternalRequestInfo::EFormatMIN:
       
   336 					case TLbsExternalRequestInfo::EFormatMDN:
       
   337 						{
       
   338 						if (networkType != TLbsExternalRequestInfo::ENetworkSUPL)
       
   339 							{
       
   340 							return KErrArgument;
       
   341 							}
       
   342 						}
       
   343 						break;
       
   344 					case TLbsExternalRequestInfo::EFormatAppUID:
       
   345 						{
       
   346 						return KErrArgument;
       
   347 						}
       
   348 					default:
       
   349 						{
       
   350 						return KErrArgument;
       
   351 						}
       
   352 					}
       
   353 				}
       
   354 			break;
       
   355 			}
       
   356 
       
   357 		case TLbsExternalRequestInfo::ERequestSourceUnknown:
       
   358 			{
       
   359 			return KErrArgument;
       
   360 			}
       
   361 		default:
       
   362 			{
       
   363 			return KErrArgument;
       
   364 			}
       
   365 		}
       
   366 	return KErrNone;
       
   367 	}
       
   368 
       
   369 TInt CLbsPrivacyRequestImpl::ValidateRepeatPrivReqArguments(const TLbsPrivacyRequestId aRequestId, const TLbsPrivacyRequest& aPrivacy, const TLbsExternalRequestInfo& aRequestInfo)
       
   370 	{
       
   371 	if((aRequestId == 0) || (aRequestId > KMaxTInt))
       
   372 		{
       
   373 		return KErrArgument;
       
   374 		}
       
   375 	
       
   376 	TLbsPrivacyRequest::TLbsRequestAdvice requestAdvice(aPrivacy.RequestAdvice());
       
   377 	switch(requestAdvice)
       
   378 		{
       
   379 		case TLbsPrivacyRequest::ERequestAdviceNotify:
       
   380 			break; // do nothing for good value(s)
       
   381 		case TLbsPrivacyRequest::ERequestAdviceVerify:
       
   382 		case TLbsPrivacyRequest::ERequestAdviceSilent:
       
   383 		case TLbsPrivacyRequest::ERequestAdviceNotUsed:
       
   384 			{
       
   385 			return KErrArgument;
       
   386 			}
       
   387 		case TLbsPrivacyRequest::ERequestAdviceStealth:
       
   388 			{
       
   389 			return KErrNotSupported;
       
   390 			}
       
   391 		default:
       
   392 			{
       
   393 			return KErrArgument;
       
   394 			}
       
   395 		}
       
   396 
       
   397 	TLbsPrivacyRequest::TLbsRequestAction requestAction(aPrivacy.RequestAction());
       
   398 	switch(requestAction)
       
   399 		{
       
   400 		case TLbsPrivacyRequest::ERequestActionAllow:
       
   401 		case TLbsPrivacyRequest::ERequestActionReject:
       
   402 			break; // do nothing for good value(s)
       
   403 		case TLbsPrivacyRequest::ERequestActionNotUsed:
       
   404 			{
       
   405 			return KErrArgument;
       
   406 			}
       
   407 		default:
       
   408 			{
       
   409 			return KErrArgument;
       
   410 			}
       
   411 		}
       
   412 
       
   413 	TLbsExternalRequestInfo::TRequestSource requestSource(aRequestInfo.RequestSource());
       
   414 	TLbsExternalRequestInfo::TRequestType requestType(aRequestInfo.RequestType());
       
   415 	TLbsExternalRequestInfo::TNetworkType networkType(aRequestInfo.NetworkType());
       
   416 	TLbsExternalRequestInfo::TFormatIndicator requesterIdFormatIndicator(aRequestInfo.RequesterIdFormat());
       
   417 	TLbsExternalRequestInfo::TFormatIndicator clientFormatIndicator(aRequestInfo.ClientNameFormat());
       
   418 
       
   419 	switch(requestSource)
       
   420 		{
       
   421 		case TLbsExternalRequestInfo::ERequestSourceNetwork:
       
   422 			{
       
   423 			switch(requestType)
       
   424 				{
       
   425 				case TLbsExternalRequestInfo::ERequestSingleShot:
       
   426 				case TLbsExternalRequestInfo::ERequestPeriodic:
       
   427 				case TLbsExternalRequestInfo::ERequestAreaEvent:
       
   428                 case TLbsExternalRequestInfo::ERequestSingleShotSilent:
       
   429                 case TLbsExternalRequestInfo::ERequestPeriodicSilent:
       
   430                 case TLbsExternalRequestInfo::ERequestAreaEventSilent:
       
   431 					break; // do nothing for good value(s)
       
   432 				case TLbsExternalRequestInfo::ERequestTypeUnknown:
       
   433 					{
       
   434 					return KErrArgument;
       
   435 					}
       
   436 				default:
       
   437 					{
       
   438 					return KErrArgument;
       
   439 					}
       
   440 				}
       
   441 
       
   442 			switch(networkType)
       
   443 				{
       
   444 				case TLbsExternalRequestInfo::ENetworkGSM:
       
   445 				case TLbsExternalRequestInfo::ENetworkSUPL:
       
   446 				case TLbsExternalRequestInfo::ENetworkWCDMA:
       
   447 					break; // do nothing for good value(s)
       
   448 				case TLbsExternalRequestInfo::ENetworkTypeUnknown:
       
   449 					{
       
   450 					return KErrArgument;
       
   451 					}
       
   452 				default:
       
   453 					{
       
   454 					return KErrArgument;
       
   455 					}
       
   456 				}
       
   457 			// Return KErrArgument if both formatIndicators are EFormatUnknown
       
   458 			if((requesterIdFormatIndicator == TLbsExternalRequestInfo::EFormatUnknown)&&
       
   459 					(clientFormatIndicator == TLbsExternalRequestInfo::EFormatUnknown))
       
   460 				{
       
   461 				return KErrArgument;
       
   462 				}
       
   463 			if(requesterIdFormatIndicator != TLbsExternalRequestInfo::EFormatUnknown)
       
   464 				{
       
   465 				switch(requesterIdFormatIndicator)
       
   466 					{
       
   467 					case TLbsExternalRequestInfo::EFormatLogicalName:
       
   468 					case TLbsExternalRequestInfo::EFormatEmailAddress:
       
   469 					case TLbsExternalRequestInfo::EFormatMSISDN:
       
   470 					case TLbsExternalRequestInfo::EFormatURL:
       
   471 					case TLbsExternalRequestInfo::EFormatSIPURL	:
       
   472 					case TLbsExternalRequestInfo::EFormatIMSPublicIdentity:
       
   473 						break; // do nothing for good value(s)
       
   474 					case TLbsExternalRequestInfo::EFormatMIN:
       
   475 					case TLbsExternalRequestInfo::EFormatMDN:
       
   476 						{
       
   477 						if (networkType != TLbsExternalRequestInfo::ENetworkSUPL)
       
   478 							{
       
   479 							return KErrArgument;
       
   480 							}
       
   481 						}
       
   482 						break;
       
   483 					case TLbsExternalRequestInfo::EFormatAppUID:
       
   484 						{
       
   485 						return KErrArgument;
       
   486 						}
       
   487 					default:
       
   488 						{
       
   489 						return KErrArgument;
       
   490 						}
       
   491 					}
       
   492 				}
       
   493 			if(clientFormatIndicator != TLbsExternalRequestInfo::EFormatUnknown)
       
   494 				{
       
   495 				switch(clientFormatIndicator)
       
   496 					{
       
   497 					case TLbsExternalRequestInfo::EFormatLogicalName:
       
   498 					case TLbsExternalRequestInfo::EFormatEmailAddress:
       
   499 					case TLbsExternalRequestInfo::EFormatMSISDN:
       
   500 					case TLbsExternalRequestInfo::EFormatURL:
       
   501 					case TLbsExternalRequestInfo::EFormatSIPURL	:
       
   502 					case TLbsExternalRequestInfo::EFormatIMSPublicIdentity:
       
   503 						break; // do nothing for good value(s)
       
   504 					case TLbsExternalRequestInfo::EFormatMIN:
       
   505 					case TLbsExternalRequestInfo::EFormatMDN:
       
   506 						{
       
   507 						if (networkType != TLbsExternalRequestInfo::ENetworkSUPL)
       
   508 							{
       
   509 							return KErrArgument;
       
   510 							}
       
   511 						}
       
   512 						break;
       
   513 					case TLbsExternalRequestInfo::EFormatAppUID:
       
   514 						{
       
   515 						return KErrArgument;
       
   516 						}
       
   517 					default:
       
   518 						{
       
   519 						return KErrArgument;
       
   520 						}
       
   521 					}
       
   522 				}
       
   523 			break;
       
   524 			}
       
   525 
       
   526 		case TLbsExternalRequestInfo::ERequestSourceLocal:
       
   527 		case TLbsExternalRequestInfo::ERequestSourceUnknown:
       
   528 			{
       
   529 			return KErrArgument;
       
   530 			}
       
   531 		default:
       
   532 			{
       
   533 			return KErrArgument;
       
   534 			}
       
   535 		}
       
   536 	return KErrNone;
       
   537 	}
       
   538 
       
   539 void CLbsPrivacyRequestImpl::RemoveHandler(CPrivacyRequestResponseHandler* aHandler)
       
   540 	{
       
   541 	for(TUint index = 0; index < iResponseHandler.Count();  ++index)
       
   542 		{
       
   543 		if(iResponseHandler[index] == aHandler)
       
   544 			{
       
   545 			iResponseHandler.Remove(index);
       
   546 			break;
       
   547 			}
       
   548 		}
       
   549 	}