telephonyserverplugins/common_tsy/commontsy/src/mmtsy/cmmnettsy.cpp
branchRCL_3
changeset 18 17af172ffa5f
parent 15 8b9e023e329f
child 19 630d2f34d719
equal deleted inserted replaced
17:1ac40e087278 18:17af172ffa5f
  3245 			
  3245 			
  3246 			iMmPhoneTsy->iReqHandleType = CMmPhoneTsy::EMultimodePhoneGetPreferredNetworksPhase1;
  3246 			iMmPhoneTsy->iReqHandleType = CMmPhoneTsy::EMultimodePhoneGetPreferredNetworksPhase1;
  3247 			
  3247 			
  3248 			// if iGetPrefPLMNList, iClientIdGetPrefPLMN, and/or iBufSizeGetPrefPLMN are not NULL, phase 1 is called twice without calling phase 2.
  3248 			// if iGetPrefPLMNList, iClientIdGetPrefPLMN, and/or iBufSizeGetPrefPLMN are not NULL, phase 1 is called twice without calling phase 2.
  3249 			// In this case, we should ignore the previous phase 1 and delete buffers.
  3249 			// In this case, we should ignore the previous phase 1 and delete buffers.
  3250 			if(iGetPrefPLMNList != NULL)
  3250 			delete iGetPrefPLMNList;
  3251 				{
  3251 			iGetPrefPLMNList = NULL;
  3252 				delete iGetPrefPLMNList;
       
  3253 				iGetPrefPLMNList = NULL;
       
  3254 				}
       
  3255 			iBufSizeGetPrefPLMN = aBufSize;
  3252 			iBufSizeGetPrefPLMN = aBufSize;
  3256 			if(iClientIdGetPrefPLMN != NULL)
  3253 			delete iClientIdGetPrefPLMN;
  3257 				{
  3254 			iClientIdGetPrefPLMN = NULL;
  3258 				delete iClientIdGetPrefPLMN;
       
  3259 				iClientIdGetPrefPLMN = NULL;
       
  3260 				}
       
  3261 			// Copy client id (session and subsession handle). it's used for
  3255 			// Copy client id (session and subsession handle). it's used for
  3262             // matching phase 1 and 2 of a request
  3256             // matching phase 1 and 2 of a request
  3263 			iClientIdGetPrefPLMN = new ( ELeave ) RMobilePhone::TClientId( *aId ); 
  3257 			iClientIdGetPrefPLMN = new ( ELeave ) RMobilePhone::TClientId( *aId ); 
  3264 			
  3258 			
  3265 			}
  3259 			}
  3382 	TTsyReqHandle reqHandle = iMmPhoneTsy->iTsyReqHandleStore->ResetTsyReqHandle(CMmPhoneTsy::EMultimodePhoneGetPreferredNetworksPhase1); 
  3376 	TTsyReqHandle reqHandle = iMmPhoneTsy->iTsyReqHandleStore->ResetTsyReqHandle(CMmPhoneTsy::EMultimodePhoneGetPreferredNetworksPhase1); 
  3383 
  3377 
  3384 	if(CMmPhoneTsy::EMultimodePhoneReqHandleUnknown != reqHandle)
  3378 	if(CMmPhoneTsy::EMultimodePhoneReqHandleUnknown != reqHandle)
  3385 		{
  3379 		{
  3386 		iBufSizeGetPrefPLMN = NULL;
  3380 		iBufSizeGetPrefPLMN = NULL;
  3387 		if(iClientIdGetPrefPLMN)
  3381 		delete iClientIdGetPrefPLMN;
  3388 			{
  3382 		iClientIdGetPrefPLMN = NULL;
  3389 			delete iClientIdGetPrefPLMN;
  3383 		delete iGetPrefPLMNList;
  3390 			iClientIdGetPrefPLMN = NULL;
  3384 		iGetPrefPLMNList = NULL;
  3391 			}
       
  3392 		if(iGetPrefPLMNList)
       
  3393 			{
       
  3394 			delete iGetPrefPLMNList;
       
  3395 			iGetPrefPLMNList = NULL;
       
  3396 			}
       
  3397         iMmPhoneTsy->ReqCompleted( reqHandle, KErrCancel );        
  3385         iMmPhoneTsy->ReqCompleted( reqHandle, KErrCancel );        
  3398 		}
  3386 		}
  3399 	//if reqHandle is 0, it means  phase 1 has completed and the list retrieval cannot be cancelled
  3387 	//if reqHandle is 0, it means  phase 1 has completed and the list retrieval cannot be cancelled
  3400 	return KErrNone;
  3388 	return KErrNone;
  3401 	}
  3389 	}
  3450 	TInt completeError = KErrNone;
  3438 	TInt completeError = KErrNone;
  3451 	
  3439 	
  3452 	if(CMmPhoneTsy::EMultimodePhoneReqHandleUnknown == reqHandle)
  3440 	if(CMmPhoneTsy::EMultimodePhoneReqHandleUnknown == reqHandle)
  3453 		{
  3441 		{
  3454 		TFLOGSTRING("TSY CompleteGetPreferredNetworksListPhase1: reqHandle is 0, cannot complete Phase1 list retrieval request!!");
  3442 		TFLOGSTRING("TSY CompleteGetPreferredNetworksListPhase1: reqHandle is 0, cannot complete Phase1 list retrieval request!!");
  3455 		if(iClientIdGetPrefPLMN)
  3443 		delete iClientIdGetPrefPLMN;
  3456 			{
  3444 		iClientIdGetPrefPLMN = NULL;
  3457 			delete iClientIdGetPrefPLMN;
       
  3458 			iClientIdGetPrefPLMN = NULL;
       
  3459 			}
       
  3460 		}
  3445 		}
  3461 	else if(KErrNone == aError)
  3446 	else if(KErrNone == aError)
  3462 		{
  3447 		{
  3463 		if(iGetPrefPLMNList == NULL)
  3448 		if(iGetPrefPLMNList == NULL)
  3464 			{
  3449 			{
  3477 			else
  3462 			else
  3478 				{
  3463 				{
  3479 				TFLOGSTRING2("TSY CompleteGetPreferredNetworksListPhase1: failed to stream the list into the buffer, error = %d!!", trapError);
  3464 				TFLOGSTRING2("TSY CompleteGetPreferredNetworksListPhase1: failed to stream the list into the buffer, error = %d!!", trapError);
  3480 				completeError = trapError;
  3465 				completeError = trapError;
  3481 				}
  3466 				}
  3482 			delete list;
       
  3483 			}
  3467 			}
  3484 		else
  3468 		else
  3485 			{
  3469 			{
  3486 			TFLOGSTRING("TSY CompleteGetPreferredNetworksListPhase1: iGetPrefPLMNList is not null");
  3470 			TFLOGSTRING("TSY CompleteGetPreferredNetworksListPhase1: iGetPrefPLMNList is not null");
  3487 			completeError = KErrServerBusy;
  3471 			completeError = KErrServerBusy;
  3494 		}
  3478 		}
  3495 	
  3479 	
  3496 	if(completeError != KErrNone)
  3480 	if(completeError != KErrNone)
  3497 		{
  3481 		{
  3498 		iMmPhoneTsy->ReqCompleted( reqHandle, aError );
  3482 		iMmPhoneTsy->ReqCompleted( reqHandle, aError );
  3499 		if(iClientIdGetPrefPLMN)
  3483 		delete iClientIdGetPrefPLMN;
  3500 			{
  3484 		iClientIdGetPrefPLMN = NULL;
  3501 			delete iClientIdGetPrefPLMN;
       
  3502 			iClientIdGetPrefPLMN = NULL;
       
  3503 			}
       
  3504 		}
  3485 		}
  3505 	
  3486 	
  3506 	iBufSizeGetPrefPLMN = NULL;
  3487 	iBufSizeGetPrefPLMN = NULL;
  3507 	}
  3488 	}
  3508 
  3489