diff -r fa67e03b87df -r 6295dc2169f3 adaptationlayer/tsy/nokiatsy_dll/src/cmmphonebookoperationinit3g_adn.cpp --- a/adaptationlayer/tsy/nokiatsy_dll/src/cmmphonebookoperationinit3g_adn.cpp Wed Feb 17 13:58:55 2010 +0200 +++ b/adaptationlayer/tsy/nokiatsy_dll/src/cmmphonebookoperationinit3g_adn.cpp Wed Apr 21 14:29:55 2010 +0300 @@ -85,7 +85,6 @@ { TFLOGSTRING("TSY: CMmPhoneBookOperationInit3G_adn::CMmPhoneBookOperationInit3G_adn"); OstTrace0( TRACE_NORMAL, DUP1_CMMPHONEBOOKOPERATIONINIT3G_ADN_CMMPHONEBOOKOPERATIONINIT3G_ADN, "CMmPhoneBookOperationInit3G_adn::~CMmPhoneBookOperationInit3G_adn" ); - } // ----------------------------------------------------------------------------- @@ -162,17 +161,6 @@ iIniPhase = 0; iServiceType = 0; iNumOfPBRRecords = 0; - -#ifdef INTERNAL_RD_USIM_PHONEBOOK_GAS_AND_AAS - TFLOGSTRING("TSY: CMmPhoneBookStoreMessHandler. \ - INTERNAL_RD_USIM_PHONEBOOK_GAS_AND_AAS is ON."); - - iMmPhoneBookStoreMessHandler->SetMaxNumOfAasEntries( 0 ); - iMmPhoneBookStoreMessHandler->SetMaxNumberOfGAS( 0 ); -#else - TFLOGSTRING("TSY: CMmPhoneBookStoreMessHandler. \ - INTERNAL_RD_USIM_PHONEBOOK_GAS_AND_AAS is OFF."); -#endif // INTERNAL_RD_USIM_PHONEBOOK_GAS_AND_AAS } @@ -266,7 +254,7 @@ cmdParams.fileId = PB_PBR_FID; cmdParams.serviceType = iServiceType; - cmdParams.record = 0; + cmdParams.record = KStartRecord; break; } case EPBInitPhase_3GADN_Type1: @@ -317,7 +305,7 @@ // TInt CMmPhoneBookOperationInit3G_adn::CreateReqFetchTypeFile( TUiccReadLinearFixed & aparams, - const TUint8 aFileType) + const TUint8 aFileType ) { TFLOGSTRING("TSY: CMmPhoneBookOperationInit3G_adn::CreateReqFetchTypeFile"); OstTrace0( TRACE_NORMAL, CMMPHONEBOOKOPERATIONINIT3G_ADN_CREATEREQFETCHTYPEFILE, "CMmPhoneBookOperationInit3G_adn::CreateReqFetchTypeFile" ); @@ -398,7 +386,7 @@ iInternalInit = EFalse; complete = ETrue; return KErrNone; - } + } // no else switch(iIniPhase) { @@ -441,7 +429,7 @@ if ( UICC_STATUS_OK != aStatus ) { ret = CMmStaticUtility::UICCCSCauseToEpocError( aStatus ); - } + } // no else iMmPhoneBookStoreMessHandler->MessageRouter()->Complete( EMmTsyPhoneBookStoreInitIPC, @@ -449,7 +437,7 @@ ret ); complete = ETrue; - } + } // no else return complete; } @@ -482,6 +470,10 @@ { TFci fci( aFileData ); iNumOfPBRRecords = fci.GetNumberOfRecords(); + // Store PBR record no in internal conf list + iMmPhoneBookStoreMessHandler-> + iPBStoreConf[EPhonebookTypeAdn]. + iPBRNoOfRecords = iNumOfPBRRecords; ret = KErrNone; iServiceType = UICC_APPL_READ_LINEAR_FIXED; @@ -517,12 +509,12 @@ iServiceType = UICC_APPL_FILE_INFO; iIniPhase = EPBInitPhase_3GADN_Type1; - } + } // no else ... } else { iADNPbInitilized = EFalse; - GetNextPhoneBookInitPhase(iIniPhase); + GetNextPhoneBookInitPhase( iIniPhase ); } break; } @@ -571,7 +563,7 @@ // Call Create request for next phase ret = UICCInitializeReq3GADN( aTransId ); } - } + } // no else return ret; } @@ -606,8 +598,8 @@ if( UICC_EF_ADN_TAG != tagValue ) { ret = CheckForNoOfRecords( noOfRecords ); - } - } + } // no else + } // no else if( iCurrentArrayCounter < iType1FileArray.Count() ) { @@ -646,7 +638,7 @@ { // Check for if No of records for this File is same as ADN // phonebook no of records - if(KErrNone == ret) + if( KErrNone == ret ) { // Check for fixed size record length ret = CheckRecordSizeForFixedLength( @@ -670,8 +662,8 @@ iMmPhoneBookStoreMessHandler-> iPBStoreConf[EPhonebookTypeAdn].iANRNoOfRecords = iPBStoreInfoData->iANRNumOfEntries; - } - } + } // no else + } // no else break; } case UICC_EF_EMAIL_TAG: @@ -698,7 +690,7 @@ iMmPhoneBookStoreMessHandler-> iPBStoreConf[EPhonebookTypeAdn].iEmailStringLength = iPBStoreInfoData->iEmailTextLengthMax; - } + } // no else break; } @@ -709,7 +701,7 @@ // get the record record no from file info data iPBStoreInfoData->iGRPNumOfEntriesPerEntry = noOfRecords; - } + } // no else break; } case UICC_EF_IAP_TAG: @@ -718,14 +710,14 @@ if( iType2FileArray.Count()== 0 ) { ret = KErrGeneral; - } + } // no else if( KErrNone == ret ) { // Store IAP record record length in internal buffer iMmPhoneBookStoreMessHandler-> iPBStoreConf[EPhonebookTypeAdn].iIAPRecordLength = recordLength; - } + } // no else break; } case UICC_EF_PBC_TAG: @@ -740,10 +732,9 @@ // remove this entry from Array iType1FileArray[iCurrentArrayCounter].tagFID = 0x00; iType1FileArray[iCurrentArrayCounter].tagSFI = 0x00; - iType1FileArray[iCurrentArrayCounter].tagValue = - 0x00; - } - } + iType1FileArray[iCurrentArrayCounter].tagValue = 0x00; + } // no else + } // no else break; } case UICC_EF_SNE_TAG: @@ -764,7 +755,7 @@ iMmPhoneBookStoreMessHandler-> iPBStoreConf[EPhonebookTypeAdn].iSNEStringLength = iPBStoreInfoData->iSNETextLengthMax; - } + } // no else break; } case UICC_EF_UID_TAG: @@ -781,7 +772,7 @@ // iType1FileArray if( KErrNone != ret ) { - iType1FileArray.Remove(iCurrentArrayCounter); + iType1FileArray.Remove( iCurrentArrayCounter ); } else { @@ -798,7 +789,7 @@ // parameters iIniPhase = EPBIniPhase_3GADNDone; return; - } + } // no else iCurrentArrayCounter++; } @@ -809,7 +800,9 @@ // Change Phase to read other Files if( 0 != iType2FileArray.Count() ) + { iIniPhase = EPBInitPhase_3GADN_Type2; + } else if( 0 != iType3FileArray.Count() ) { @@ -819,7 +812,7 @@ { iIniPhase = EPBIniPhase_3GADNDone; } - } + } // no else } // End of Type 1 file array handling } @@ -831,14 +824,14 @@ // void CMmPhoneBookOperationInit3G_adn::HandleType2FileResp( const TDesC8 &aFileData, - TInt aStatus) + TInt aStatus ) { TFLOGSTRING("TSY: CMmPhoneBookOperationInit3G_adn::HandleType2FileResp"); OstTrace0( TRACE_NORMAL, CMMPHONEBOOKOPERATIONINIT3G_ADN_HANDLETYPE2FILERESP, "CMmPhoneBookOperationInit3G_adn::HandleType2FileResp" ); TInt ret(KErrNone); TInt recordLength( 0 ); - TInt noOfRecords(0); + TInt noOfRecords( 0 ); if( UICC_STATUS_OK == aStatus ) { @@ -846,7 +839,7 @@ TFci fci( aFileData ); recordLength = fci.GetRecordLength(); noOfRecords = fci.GetNumberOfRecords(); - } + } // no else // Get the tag value for current File TUint tagValue = iType2FileArray[iCurrentArrayCounter].tagValue; @@ -855,7 +848,7 @@ { if( UICC_STATUS_OK == aStatus ) { - switch(tagValue) + switch( tagValue ) { case UICC_EF_ANR_TAG: { @@ -863,7 +856,7 @@ UICC_TYPE2_FILE, UICC_EF_ANR_TAG,recordLength ); - if(KErrNone == ret) + if( KErrNone == ret ) { // total no of entries in all ANR files iPBStoreInfoData->iANRNumOfEntries = @@ -880,7 +873,7 @@ iMmPhoneBookStoreMessHandler-> iPBStoreConf[EPhonebookTypeAdn].iANRNoOfRecords = iPBStoreInfoData->iANRNumOfEntries; - } + } // KErrNone break; } case UICC_EF_EMAIL_TAG: @@ -901,6 +894,10 @@ iMmPhoneBookStoreMessHandler-> iPBStoreConf[EPhonebookTypeAdn].iEmailNoOfRecords = iPBStoreInfoData->iEmailNumOfEntries; + + iMmPhoneBookStoreMessHandler-> + iPBStoreConf[EPhonebookTypeAdn].iEmailStringLength = + recordLength - 2; break; } case UICC_EF_SNE_TAG: @@ -919,6 +916,11 @@ iMmPhoneBookStoreMessHandler-> iPBStoreConf[EPhonebookTypeAdn].iSNENoOfRecords = iPBStoreInfoData->iSNENumOfEntries; + + iMmPhoneBookStoreMessHandler-> + iPBStoreConf[EPhonebookTypeAdn].iSNEStringLength = + iPBStoreInfoData->iSNETextLengthMax; + break; } default: @@ -945,11 +947,15 @@ { iCurrentArrayCounter = 0; if( 0 != iType3FileArray.Count() ) + { iIniPhase = EPBInitPhase_3GADN_Type3; + } else + { iIniPhase = EPBIniPhase_3GADNDone; - } - } + } + } // no else + } // no else } @@ -974,7 +980,7 @@ TFci fci( aFileData ); recordLength = fci.GetRecordLength(); noOfRecords = fci.GetNumberOfRecords(); - } + } // no else // Get the tag value for current File TUint tagValue ( iType3FileArray[iCurrentArrayCounter].tagValue ); @@ -993,8 +999,8 @@ { // Check for Fixed record length ret = CheckRecordSizeForFixedLength( - 3, - UICC_EF_EXT1_TAG,recordLength ); + UICC_TYPE3_FILE, + UICC_EF_EXT1_TAG,recordLength ); // check for Error if Length doesn'nt match if( KErrNone == ret ) @@ -1003,15 +1009,15 @@ // (remove record type and Identifier 2 bytes) TInt fileLength ( ( recordLength - 2 ) * noOfRecords ); iPBStoreInfoData->iADNNumberLengthMax = - UICC_NO_EXT_MAX_NUM_LEN+(2*fileLength); + UICC_NO_EXT_MAX_NUM_LEN+( 2*fileLength ); // Check file is not invalid if( UICC_NO_EXT_MAX_NUM_LEN == iPBStoreInfoData->iANRNumLengthMax ) { iPBStoreInfoData->iANRNumLengthMax = - UICC_NO_EXT_MAX_NUM_LEN+(2*fileLength); - } + UICC_NO_EXT_MAX_NUM_LEN+( 2*fileLength ); + } // no else iMmPhoneBookStoreMessHandler-> iPBStoreConf[EPhonebookTypeAdn].iNumlength = @@ -1019,7 +1025,7 @@ iMmPhoneBookStoreMessHandler-> iPBStoreConf[EPhonebookTypeAdn].iExtNoOfRec = ( noOfRecords * iNumOfPBRRecords ); - } + } // no else break; } case UICC_EF_GAS_TAG: @@ -1035,12 +1041,12 @@ break; } } - } + } // no else if( KErrNone != ret ) { // remove from teh Array - iType3FileArray.Remove(iCurrentArrayCounter); + iType3FileArray.Remove( iCurrentArrayCounter ); } else { @@ -1052,8 +1058,8 @@ { iCurrentArrayCounter = 0; iIniPhase = EPBIniPhase_3GADNDone; - } - } + } // no else + } // no else } @@ -1076,20 +1082,22 @@ for( TInt j=0; j < iType1FileArray.Count(); j++ ) { // Check for Type 1 files - for( TInt i = (j+1); i< (iType1FileArray.Count()-j); i++ ) + for( TInt i = ( j+1 ); i< ( iType1FileArray.Count()-j ); i++ ) { if( iType1FileArray[i].tagFID == iType1FileArray[j].tagFID ) { // Check if it is a ADN EF then it will be a failure case if( iType1FileArray[i].tagValue == UICC_ADN_PRIM_TAG ) - ret = KErrGeneral; + { + ret = KErrGeneral; + } else { // remove Entry iType1FileArray.Remove(i); iType1FileArray.Remove(j); } - } + } // no else } // Check for Type2 file id's for(TInt i=0; iiADNNumOfEntries != aNoOfRecord ) + // get the no of records in one ADN Ef + TInt maxNoOfRecInOneAdnEf = ( ( iMmPhoneBookStoreMessHandler-> + iPBStoreConf[EPhonebookTypeAdn].iNoOfRecords ) / + ( iMmPhoneBookStoreMessHandler-> + iPBStoreConf[EPhonebookTypeAdn].iPBRNoOfRecords ) ); + if( maxNoOfRecInOneAdnEf != aNoOfRecord ) { ret = KErrGeneral; - } + } // no else return ret; } @@ -1213,10 +1230,10 @@ } else { - iType1FileArray.Remove(i); - iType2FileArray.Remove(j); + iType1FileArray.Remove( i ); + iType2FileArray.Remove( j ); } - } + } // no else } } return ret; @@ -1253,7 +1270,7 @@ if( ( 2== aFileType )&& ( 17!=aRecordLength ) ) { ret =KErrNone; - } + } // no else } break; } @@ -1262,7 +1279,7 @@ if( 2!=aRecordLength ) { ret = KErrGeneral; - } + } // no else break; } case UICC_EF_UID_TAG: @@ -1270,7 +1287,7 @@ if( 2!= aRecordLength ) { ret = KErrGeneral; - } + } // no else break; } case UICC_EF_EXT1_TAG: @@ -1278,7 +1295,7 @@ if( 13 != aRecordLength ) { ret = KErrGeneral; - } + } // no else break; } }