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 delete iGetPrefPLMNList; |
3250 if(iGetPrefPLMNList != NULL) |
3251 iGetPrefPLMNList = NULL; |
3251 { |
|
3252 delete iGetPrefPLMNList; |
|
3253 iGetPrefPLMNList = NULL; |
|
3254 } |
3252 iBufSizeGetPrefPLMN = aBufSize; |
3255 iBufSizeGetPrefPLMN = aBufSize; |
3253 delete iClientIdGetPrefPLMN; |
3256 if(iClientIdGetPrefPLMN != NULL) |
3254 iClientIdGetPrefPLMN = NULL; |
3257 { |
|
3258 delete iClientIdGetPrefPLMN; |
|
3259 iClientIdGetPrefPLMN = NULL; |
|
3260 } |
3255 // Copy client id (session and subsession handle). it's used for |
3261 // Copy client id (session and subsession handle). it's used for |
3256 // matching phase 1 and 2 of a request |
3262 // matching phase 1 and 2 of a request |
3257 iClientIdGetPrefPLMN = new ( ELeave ) RMobilePhone::TClientId( *aId ); |
3263 iClientIdGetPrefPLMN = new ( ELeave ) RMobilePhone::TClientId( *aId ); |
3258 |
3264 |
3259 } |
3265 } |
3376 TTsyReqHandle reqHandle = iMmPhoneTsy->iTsyReqHandleStore->ResetTsyReqHandle(CMmPhoneTsy::EMultimodePhoneGetPreferredNetworksPhase1); |
3382 TTsyReqHandle reqHandle = iMmPhoneTsy->iTsyReqHandleStore->ResetTsyReqHandle(CMmPhoneTsy::EMultimodePhoneGetPreferredNetworksPhase1); |
3377 |
3383 |
3378 if(CMmPhoneTsy::EMultimodePhoneReqHandleUnknown != reqHandle) |
3384 if(CMmPhoneTsy::EMultimodePhoneReqHandleUnknown != reqHandle) |
3379 { |
3385 { |
3380 iBufSizeGetPrefPLMN = NULL; |
3386 iBufSizeGetPrefPLMN = NULL; |
3381 delete iClientIdGetPrefPLMN; |
3387 if(iClientIdGetPrefPLMN) |
3382 iClientIdGetPrefPLMN = NULL; |
3388 { |
3383 delete iGetPrefPLMNList; |
3389 delete iClientIdGetPrefPLMN; |
3384 iGetPrefPLMNList = NULL; |
3390 iClientIdGetPrefPLMN = NULL; |
|
3391 } |
|
3392 if(iGetPrefPLMNList) |
|
3393 { |
|
3394 delete iGetPrefPLMNList; |
|
3395 iGetPrefPLMNList = NULL; |
|
3396 } |
3385 iMmPhoneTsy->ReqCompleted( reqHandle, KErrCancel ); |
3397 iMmPhoneTsy->ReqCompleted( reqHandle, KErrCancel ); |
3386 } |
3398 } |
3387 //if reqHandle is 0, it means phase 1 has completed and the list retrieval cannot be cancelled |
3399 //if reqHandle is 0, it means phase 1 has completed and the list retrieval cannot be cancelled |
3388 return KErrNone; |
3400 return KErrNone; |
3389 } |
3401 } |
3438 TInt completeError = KErrNone; |
3450 TInt completeError = KErrNone; |
3439 |
3451 |
3440 if(CMmPhoneTsy::EMultimodePhoneReqHandleUnknown == reqHandle) |
3452 if(CMmPhoneTsy::EMultimodePhoneReqHandleUnknown == reqHandle) |
3441 { |
3453 { |
3442 TFLOGSTRING("TSY CompleteGetPreferredNetworksListPhase1: reqHandle is 0, cannot complete Phase1 list retrieval request!!"); |
3454 TFLOGSTRING("TSY CompleteGetPreferredNetworksListPhase1: reqHandle is 0, cannot complete Phase1 list retrieval request!!"); |
3443 delete iClientIdGetPrefPLMN; |
3455 if(iClientIdGetPrefPLMN) |
3444 iClientIdGetPrefPLMN = NULL; |
3456 { |
|
3457 delete iClientIdGetPrefPLMN; |
|
3458 iClientIdGetPrefPLMN = NULL; |
|
3459 } |
3445 } |
3460 } |
3446 else if(KErrNone == aError) |
3461 else if(KErrNone == aError) |
3447 { |
3462 { |
3448 if(iGetPrefPLMNList == NULL) |
3463 if(iGetPrefPLMNList == NULL) |
3449 { |
3464 { |
3462 else |
3477 else |
3463 { |
3478 { |
3464 TFLOGSTRING2("TSY CompleteGetPreferredNetworksListPhase1: failed to stream the list into the buffer, error = %d!!", trapError); |
3479 TFLOGSTRING2("TSY CompleteGetPreferredNetworksListPhase1: failed to stream the list into the buffer, error = %d!!", trapError); |
3465 completeError = trapError; |
3480 completeError = trapError; |
3466 } |
3481 } |
|
3482 delete list; |
3467 } |
3483 } |
3468 else |
3484 else |
3469 { |
3485 { |
3470 TFLOGSTRING("TSY CompleteGetPreferredNetworksListPhase1: iGetPrefPLMNList is not null"); |
3486 TFLOGSTRING("TSY CompleteGetPreferredNetworksListPhase1: iGetPrefPLMNList is not null"); |
3471 completeError = KErrServerBusy; |
3487 completeError = KErrServerBusy; |
3478 } |
3494 } |
3479 |
3495 |
3480 if(completeError != KErrNone) |
3496 if(completeError != KErrNone) |
3481 { |
3497 { |
3482 iMmPhoneTsy->ReqCompleted( reqHandle, aError ); |
3498 iMmPhoneTsy->ReqCompleted( reqHandle, aError ); |
3483 delete iClientIdGetPrefPLMN; |
3499 if(iClientIdGetPrefPLMN) |
3484 iClientIdGetPrefPLMN = NULL; |
3500 { |
|
3501 delete iClientIdGetPrefPLMN; |
|
3502 iClientIdGetPrefPLMN = NULL; |
|
3503 } |
3485 } |
3504 } |
3486 |
3505 |
3487 iBufSizeGetPrefPLMN = NULL; |
3506 iBufSizeGetPrefPLMN = NULL; |
3488 } |
3507 } |
3489 |
3508 |