135 TFLOGSTRING("TSY: CMmPhoneBookOperationCache::CreateReq"); |
140 TFLOGSTRING("TSY: CMmPhoneBookOperationCache::CreateReq"); |
136 OstTrace0( TRACE_NORMAL, CMMPHONEBOOKOPERATIONCACHE_CREATEREQ, "CMmPhoneBookOperationCache::CreateReq" ); |
141 OstTrace0( TRACE_NORMAL, CMMPHONEBOOKOPERATIONCACHE_CREATEREQ, "CMmPhoneBookOperationCache::CreateReq" ); |
137 |
142 |
138 TInt ret( KErrNotSupported ); |
143 TInt ret( KErrNotSupported ); |
139 |
144 |
|
145 // Transaction ID is saved to separate EMmTsyONStoreGetInfoIPC handling |
|
146 // from other PB handling. Also it can be used for any separation purpose. |
|
147 iSavedIPC = aIpc; |
|
148 |
140 switch( aIpc ) |
149 switch( aIpc ) |
141 { |
150 { |
142 case EMmTsyPhoneBookStoreGetInfoIPC: |
151 case EMmTsyPhoneBookStoreGetInfoIPC: |
143 { |
152 { |
144 iNumOfUsedSDNEntries = 0; |
153 iNumOfUsedSDNEntries = 0; |
145 iNumOfUsedVMBXEntries = 0; |
154 iNumOfUsedVMBXEntries = 0; |
146 break; |
155 break; |
147 } |
156 } |
|
157 case EMmTsyONStoreGetInfoIPC: |
|
158 { |
|
159 iFileId = PB_MSISDN_FID; |
|
160 iExtFileId = PB_EXT1_FID; |
|
161 iArrayIndex = EPhonebookTypeMSISDN; |
|
162 |
|
163 TInt recordId( 0 ); |
|
164 iEXTNumberLen = 0; |
|
165 iTypeOfReading = EFileInfoRead; |
|
166 aDataPackage->UnPackData( recordId ); |
|
167 ret = UiccReadApplFileInfo( PB_MSISDN_FID, |
|
168 recordId, |
|
169 aTransId ); |
|
170 break; |
|
171 } |
148 case EMmTsyPhoneBookStoreCacheIPC: |
172 case EMmTsyPhoneBookStoreCacheIPC: |
149 { |
173 { |
|
174 // Convert Phone Book name to file id |
|
175 iExtFileId = UICC_ILLEGAL_FILE_ID; |
|
176 iFileId = ConvertToPBfileId( iPhoneBookTypeName, |
|
177 iExtFileId, |
|
178 iMmUiccMessHandler->GetCardType()); |
|
179 iArrayIndex = ConvertToConfArrayIndex( iFileId ); |
|
180 |
150 const CPhoneBookDataPackage* phoneBookData( |
181 const CPhoneBookDataPackage* phoneBookData( |
151 static_cast<const CPhoneBookDataPackage*>( aDataPackage ) ); |
182 static_cast<const CPhoneBookDataPackage*>( aDataPackage ) ); |
152 |
183 |
153 CArrayPtrSeg<CPhoneBookStoreEntry>* prtToCacheArray; |
184 CArrayPtrSeg<CPhoneBookStoreEntry>* prtToCacheArray; |
154 phoneBookData->UnPackData( prtToCacheArray ); |
185 phoneBookData->UnPackData( prtToCacheArray ); |
207 |
238 |
208 ret = CMmStaticUtility::UICCCSCauseToEpocError( aStatus ); |
239 ret = CMmStaticUtility::UICCCSCauseToEpocError( aStatus ); |
209 } |
240 } |
210 |
241 |
211 |
242 |
212 if( !iCancelOperation ) |
243 if ( ( !iCancelOperation ) && |
213 { |
244 ( EMmTsyONStoreGetInfoIPC != iSavedIPC ) ) |
214 // Convert Phone Book name to file id |
245 { |
215 TUint16 fileIdExt ( UICC_ILLEGAL_FILE_ID ); |
246 switch(iFileId) |
216 TUint16 pbFileId = ConvertToPBfileId( iPhoneBookTypeName, fileIdExt, iMmUiccMessHandler->GetCardType()); |
|
217 TUint8 pbArrayIndex = ConvertToConfArrayIndex( pbFileId ); |
|
218 |
|
219 switch(pbFileId) |
|
220 { |
247 { |
221 case PB_ADN_FID: |
248 case PB_ADN_FID: |
222 case PB_FDN_FID: |
249 case PB_FDN_FID: |
223 case PB_SDN_FID: |
250 case PB_SDN_FID: |
224 { |
251 { |
225 // Start Caching for ADN Phone Book |
252 // Start Caching for ADN Phone Book |
226 if(!iExtensionToRead) |
253 if(!iExtensionToRead) |
227 { |
254 { |
228 // Check for UICC_SERVER_OK |
255 // Check for UICC_SERVER_OK |
229 if( UICC_STATUS_OK == aStatus) |
256 if( UICC_STATUS_OK == aStatus) |
230 { |
257 { |
231 iStoreEntry = new ( ELeave ) TPBEntry(); |
258 iStoreEntry = new ( ELeave ) TPBEntry(); |
232 // update Entry Data |
259 // update Entry Data |
233 iStoreEntry->iEntryIndex = iIndexToRead; |
260 iStoreEntry->iEntryIndex = iIndexToRead; |
234 |
261 |
235 // check if Entry is valid Entry or Empty Entry |
262 // check if Entry is valid Entry or Empty Entry |
236 TInt retval = EmptyEntryCheck(aFileData); |
263 TInt retval = EmptyEntryCheck(aFileData); |
237 |
264 |
238 // if Entry is not empty |
265 // if Entry is not empty |
239 if( KErrNone == retval) |
266 if( KErrNone == retval) |
240 { |
267 { |
241 // Update Entry Status |
268 // Update Entry Status |
242 iStoreEntry->iEntryPresent = ETrue; |
269 iStoreEntry->iEntryPresent = ETrue; |
243 // Seperate Entry data form UICC Server response message |
270 // Seperate Entry data form UICC Server response message |
244 // Case: <Data available to be filled into array> |
271 // Case: <Data available to be filled into array> |
245 iMmPhoneBookStoreMessHandler-> |
272 iMmPhoneBookStoreMessHandler-> |
246 iPBStoreConf[pbArrayIndex]. |
273 iPBStoreConf[iArrayIndex]. |
247 GetPBEntryFromUICCData( |
274 GetPBEntryFromUICCData( |
248 aFileData, |
275 aFileData, |
249 iNumberBuf, |
276 iNumberBuf, |
250 iNameBuf); |
277 iNameBuf); |
251 |
278 |
252 // Check for Is there any extension data |
279 // Check for Is there any extension data |
253 // And the Extension data record number is valid |
280 // And the Extension data record number is valid |
254 // Index to read Extension file Data is Alpha string |
281 // Index to read Extension file Data is Alpha string |
255 // Length + 14 , minus 1 is for Array index Calculation |
282 // Length + 14 , minus 1 is for Array index Calculation |
256 //(it starts from 0) |
283 //(it starts from 0) |
257 if ( 0xFF == aFileData[iMmPhoneBookStoreMessHandler-> |
284 if ( 0xFF == aFileData[iMmPhoneBookStoreMessHandler-> |
258 iPBStoreConf[pbArrayIndex]. |
285 iPBStoreConf[iArrayIndex]. |
259 iAlphaStringlength + 13] ) |
286 iAlphaStringlength + 13] ) |
260 { |
287 { |
261 // Append Entry to list |
288 // Append Entry to list |
262 iMmPhoneBookStoreMessHandler->StoreEntryToPhoneBookList( |
289 iMmPhoneBookStoreMessHandler->StoreEntryToPhoneBookList( |
263 iStoreEntry, |
290 iStoreEntry, |
264 pbArrayIndex ); |
291 iArrayIndex ); |
265 |
292 |
266 // the there is no extension data |
293 // the there is no extension data |
267 CPhoneBookStoreEntry* phoneBookStoreMsg = |
294 CPhoneBookStoreEntry* phoneBookStoreMsg = |
268 new( ELeave ) CPhoneBookStoreEntry; |
295 new( ELeave ) CPhoneBookStoreEntry; |
269 CleanupStack::PushL( phoneBookStoreMsg ); |
296 CleanupStack::PushL( phoneBookStoreMsg ); |
270 phoneBookStoreMsg->ConstructL(); |
297 phoneBookStoreMsg->ConstructL(); |
271 |
298 |
272 iMmPhoneBookStoreMessHandler->StorePhonebookEntryL( |
299 iMmPhoneBookStoreMessHandler->StorePhonebookEntryL( |
273 iNameBuf, |
300 iNameBuf, |
274 iNumberBuf, |
301 iNumberBuf, |
275 *phoneBookStoreMsg, |
302 *phoneBookStoreMsg, |
276 pbFileId, |
303 iFileId, |
277 iIndexToRead, |
304 iIndexToRead ); |
278 EFalse ); |
|
279 TF_ASSERT( NULL != iPhoneBookStoreCacheArray ); |
305 TF_ASSERT( NULL != iPhoneBookStoreCacheArray ); |
280 iPhoneBookStoreCacheArray->AppendL( phoneBookStoreMsg ); |
306 iPhoneBookStoreCacheArray->AppendL( phoneBookStoreMsg ); |
281 CleanupStack::Pop( phoneBookStoreMsg ); |
307 CleanupStack::Pop( phoneBookStoreMsg ); |
282 iNumOfEntriesFilled++; |
308 iNumOfEntriesFilled++; |
283 TFLOGSTRING2("TSY: CMmPhoneBookOperationCache::HandleUICCPbRespL - Append entries into array %d",iNumOfEntriesFilled); |
309 TFLOGSTRING2("TSY: CMmPhoneBookOperationCache::HandleUICCPbRespL - Append entries into array %d",iNumOfEntriesFilled); |
284 OstTraceExt1( TRACE_NORMAL, DUP6_CMMPHONEBOOKOPERATIONCACHE_HANDLEUICCPBRESPL, "CMmPhoneBookOperationCache::HandleUICCPbRespL;iNumOfEntriesFilled=%hd", iNumOfEntriesFilled ); |
310 OstTraceExt1( TRACE_NORMAL, DUP3_CMMPHONEBOOKOPERATIONCACHE_HANDLEUICCPBRESPL, "CMmPhoneBookOperationCache::HandleUICCPbRespL; - Append entries into array iNumOfEntriesFilled=%hhu", iNumOfEntriesFilled ); |
285 |
311 |
286 } // End of if Ext Data is not Present |
312 } // End of if Ext Data is not Present |
287 else |
313 else |
288 { |
314 { |
289 iExtensionToRead = ETrue; |
315 iExtensionToRead = ETrue; |
290 // Record no to be read from EXT File |
316 // Record no to be read from EXT File |
291 TInt recordNo = aFileData[iMmPhoneBookStoreMessHandler-> |
317 TInt recordNo = aFileData[iMmPhoneBookStoreMessHandler-> |
292 iPBStoreConf[pbArrayIndex]. |
318 iPBStoreConf[iArrayIndex]. |
293 iAlphaStringlength + 13]; |
319 iAlphaStringlength + 13]; |
294 |
320 |
295 // Append EXT record no. |
321 // Append EXT record no. |
296 iStoreEntry->PBEntryExtRecord.Append( recordNo ); |
322 iStoreEntry->PBEntryExtRecord.Append( recordNo ); |
297 |
323 |
298 retExt = USimPbReqRead( recordNo, aTransId ); |
324 retExt = USimPbReqRead( recordNo, aTransId ); |
299 // if while reading EXT error comes |
325 // if while reading EXT error comes |
300 //(for invalid Entry)than read next entry |
326 //(for invalid Entry)than read next entry |
301 if(( KErrNone != retExt )) |
327 if(( KErrNone != retExt )) |
302 { |
328 { |
303 iExtensionToRead = EFalse; |
329 iExtensionToRead = EFalse; |
304 } |
330 } |
344 else |
370 else |
345 { |
371 { |
346 // Append Entry to list and reset all the EXT data |
372 // Append Entry to list and reset all the EXT data |
347 iMmPhoneBookStoreMessHandler->StoreEntryToPhoneBookList( |
373 iMmPhoneBookStoreMessHandler->StoreEntryToPhoneBookList( |
348 iStoreEntry, |
374 iStoreEntry, |
349 pbArrayIndex ); |
375 iArrayIndex ); |
350 // Reset Extension File record |
376 // Reset Extension File record |
351 iExtensionToRead = EFalse; |
377 iExtensionToRead = EFalse; |
352 |
378 |
353 // Check for Extended Data is Addition number |
379 // Check for Extended Data is Addition number |
354 if( 0x02 == aFileData[0]) |
380 if( 0x02 == aFileData[0]) |
355 { |
381 { |
356 // Check for length upto which no is stored |
382 // Check for length upto which no is stored |
357 TInt offset = aFileData.Find(&KTagUnusedbyte,1); |
383 TInt offset = aFileData.Find(&KTagUnusedbyte,1); |
358 // store Data |
384 // store Data |
359 iNumberBuf.Append(aFileData.Mid(1,( offset - 1 ))); |
385 iNumberBuf.Append(aFileData.Mid(1,( offset - 1 ))); |
360 |
386 |
361 // the there is extension data |
387 // the there is extension data |
362 CPhoneBookStoreEntry* phoneBookStoreMsg = |
388 CPhoneBookStoreEntry* phoneBookStoreMsg = |
363 new( ELeave ) CPhoneBookStoreEntry; |
389 new( ELeave ) CPhoneBookStoreEntry; |
364 CleanupStack::PushL( phoneBookStoreMsg ); |
390 CleanupStack::PushL( phoneBookStoreMsg ); |
365 phoneBookStoreMsg->ConstructL(); |
391 phoneBookStoreMsg->ConstructL(); |
366 |
392 |
367 iMmPhoneBookStoreMessHandler->StorePhonebookEntryL( |
393 iMmPhoneBookStoreMessHandler->StorePhonebookEntryL( |
368 iNameBuf, |
394 iNameBuf, |
369 iNumberBuf, |
395 iNumberBuf, |
370 *phoneBookStoreMsg, |
396 *phoneBookStoreMsg, |
371 pbFileId, |
397 iFileId, |
372 iIndexToRead, |
398 iIndexToRead ); |
373 EFalse ); |
|
374 TF_ASSERT( NULL != iPhoneBookStoreCacheArray ); |
399 TF_ASSERT( NULL != iPhoneBookStoreCacheArray ); |
375 iPhoneBookStoreCacheArray->AppendL( |
400 iPhoneBookStoreCacheArray->AppendL( |
376 phoneBookStoreMsg ); |
401 phoneBookStoreMsg ); |
377 CleanupStack::Pop( phoneBookStoreMsg ); |
402 CleanupStack::Pop( phoneBookStoreMsg ); |
378 iNumOfEntriesFilled++; |
403 iNumOfEntriesFilled++; |
379 TFLOGSTRING2("TSY: CMmPhoneBookOperationCache::HandleUSimPbRespL - Append entries into array %d",iNumOfEntriesFilled); |
404 TFLOGSTRING2("TSY: CMmPhoneBookOperationCache::HandleUSimPbRespL - Append entries into array %d",iNumOfEntriesFilled); |
380 OstTraceExt1( TRACE_NORMAL, DUP3_CMMPHONEBOOKOPERATIONCACHE_HANDLEUICCPBRESPL, "CMmPhoneBookOperationCache::HandleUICCPbRespL;iNumOfEntriesFilled=%hd", iNumOfEntriesFilled ); |
405 OstTraceExt1( TRACE_NORMAL, DUP5_CMMPHONEBOOKOPERATIONCACHE_HANDLEUICCPBRESPL, "CMmPhoneBookOperationCache::HandleUICCPbRespL; - Append entries into array iNumOfEntriesFilled=%hhu", iNumOfEntriesFilled ); |
381 } // end for checking Data type in EXT |
406 } // end for checking Data type in EXT |
382 } // end for Entry store |
407 } // end for Entry store |
383 } |
408 } |
384 else |
409 else |
385 { |
410 { |
459 |
492 |
460 TInt ret( KErrNone ); |
493 TInt ret( KErrNone ); |
461 TInt appFileID ( APPL_FILE_ID ); // Application File id for DFphonebook |
494 TInt appFileID ( APPL_FILE_ID ); // Application File id for DFphonebook |
462 |
495 |
463 TUiccReadLinearFixed cmdParams; |
496 TUiccReadLinearFixed cmdParams; |
464 cmdParams.messHandlerPtr = static_cast<MUiccOperationBase*> |
497 cmdParams.messHandlerPtr = static_cast<MUiccOperationBase*> |
465 ( iMmPhoneBookStoreMessHandler ); |
498 ( iMmPhoneBookStoreMessHandler ); |
466 |
499 |
467 cmdParams.filePath.Append( static_cast<TUint8>( MF_FILE >> 8 )); |
500 cmdParams.filePath.Append( static_cast<TUint8>( MF_FILE >> 8 )); |
468 cmdParams.filePath.Append( static_cast<TUint8>( MF_FILE )); |
501 cmdParams.filePath.Append( static_cast<TUint8>( MF_FILE )); |
469 cmdParams.filePath.Append( appFileID>>8); |
502 cmdParams.filePath.Append( appFileID>>8); |
470 cmdParams.filePath.Append( appFileID); |
503 cmdParams.filePath.Append( appFileID); |
471 |
504 |
472 if( UICC_CARD_TYPE_UICC == iMmUiccMessHandler->GetCardType()) |
505 if( UICC_CARD_TYPE_UICC == iMmUiccMessHandler->GetCardType()) |
473 { |
506 { |
474 cmdParams.filePath.Append( static_cast<TUint8>( DF_PHONEBOOK >> 8 )); |
507 cmdParams.filePath.Append( static_cast<TUint8>( DF_PHONEBOOK >> 8 )); |
475 cmdParams.filePath.Append( static_cast<TUint8>( DF_PHONEBOOK )); |
508 cmdParams.filePath.Append( static_cast<TUint8>( DF_PHONEBOOK )); |
476 } |
509 } |
477 |
510 |
478 // Convert Phone Book name to file id |
511 switch( iFileId ) |
479 TUint16 fileIdExt ( 0x0000 ); |
|
480 TUint16 pbFileId = ConvertToPBfileId( iPhoneBookTypeName, fileIdExt, iMmUiccMessHandler->GetCardType() ); |
|
481 TUint8 pbArrayIndex = ConvertToConfArrayIndex( pbFileId ); |
|
482 |
|
483 switch( pbFileId ) |
|
484 { |
512 { |
485 case PB_ADN_FID: |
513 case PB_ADN_FID: |
486 case PB_FDN_FID: |
514 case PB_FDN_FID: |
487 case PB_SDN_FID: |
515 case PB_SDN_FID: |
488 { |
516 { |
489 // For 2G ADN Phonebook EXT1 will be the extension number store |
517 // For 2G ADN Phonebook EXT1 will be the extension number store |
490 cmdParams.trId = static_cast<TUiccTrId> ( aTransId ); |
518 cmdParams.trId = static_cast<TUiccTrId> ( aTransId ); |
491 cmdParams.serviceType = UICC_APPL_READ_LINEAR_FIXED; |
519 cmdParams.serviceType = UICC_APPL_READ_LINEAR_FIXED; |
492 cmdParams.record = aRecordNo; |
520 cmdParams.record = aRecordNo; |
493 |
521 |
494 // Check for Extension Data is Present or not |
522 // Check for Extension Data is Present or not |
495 if(!iExtensionToRead) |
523 if(!iExtensionToRead) |
496 { |
524 { |
497 // Check for the record Number to be |
525 // Check for the record Number to be |
498 //read is valid record number |
526 //read is valid record number |
499 if( iIndexToRead <= iMmPhoneBookStoreMessHandler-> |
527 if( iIndexToRead <= iMmPhoneBookStoreMessHandler-> |
500 iPBStoreConf[pbArrayIndex].iNoOfRecords) |
528 iPBStoreConf[iArrayIndex].iNoOfRecords) |
501 { |
529 { |
502 // Start from first location and Search for First Valid |
530 // Start from first location and Search for First Valid |
503 //Entry in the Stored List And if some Entry is invalid |
531 //Entry in the Stored List And if some Entry is invalid |
504 // then Read From Sim and Check the Staus its Free |
532 // then Read From Sim and Check the Staus its Free |
505 // or not till end of the records |
533 // or not till end of the records |
506 |
534 |
507 cmdParams.fileId = pbFileId; |
535 cmdParams.fileId = iFileId; |
508 cmdParams.serviceType = UICC_APPL_READ_LINEAR_FIXED; |
536 cmdParams.serviceType = UICC_APPL_READ_LINEAR_FIXED; |
509 cmdParams.record = aRecordNo; |
537 cmdParams.record = aRecordNo; |
510 // till End of Record |
538 // till End of Record |
511 cmdParams.dataAmount = 0; |
539 cmdParams.dataAmount = 0; |
512 // Start from begining of record |
540 // Start from begining of record |
584 iPhoneBookStoreCacheArray = NULL; |
612 iPhoneBookStoreCacheArray = NULL; |
585 iCancelOperation = ETrue; |
613 iCancelOperation = ETrue; |
586 } |
614 } |
587 } |
615 } |
588 |
616 |
|
617 // ----------------------------------------------------------------------------- |
|
618 // CMmPhoneBookOperationCache::UiccReadApplFileInfo |
|
619 // Read application file info |
|
620 // ----------------------------------------------------------------------------- |
|
621 // |
|
622 TInt CMmPhoneBookOperationCache::UiccReadApplFileInfo( |
|
623 const TInt aFileId, |
|
624 const TInt aRecordId, |
|
625 const TUint8 aTrId ) |
|
626 { |
|
627 TFLOGSTRING3("TSY: CMmPhoneBookOperationCache::UiccReadApplFileInfo, aTraId: %d, aRecordId: %d", aTrId, aRecordId ); |
|
628 OstTraceExt2( TRACE_NORMAL, CMMPHONEBOOKOPERATIONCACHE_UICCREADAPPLFILEINFO, "CMmPhoneBookOperationCache::UiccReadApplFileInfo;aFileId=%d;aRecordId=%d", aFileId, aRecordId ); |
|
629 |
|
630 TInt ret( KErrNone ); |
|
631 |
|
632 iRecordId = aRecordId; |
|
633 |
|
634 // Check wheter MSIDN is supported at all |
|
635 ret = CheckMSISDNSupport(); |
|
636 |
|
637 if ( KErrNone == ret ) |
|
638 { |
|
639 // Set parameters for UICC_APPL_CMD_REQ message |
|
640 TUiccReadLinearFixed params; |
|
641 params.messHandlerPtr = static_cast<MUiccOperationBase*> |
|
642 ( iMmPhoneBookStoreMessHandler ); |
|
643 params.trId = static_cast<TUiccTrId> ( aTrId ); |
|
644 params.dataOffset = 0; |
|
645 params.dataAmount = 0; |
|
646 params.record = iRecordId; |
|
647 |
|
648 params.fileId = aFileId; |
|
649 params.fileIdSfi = UICC_SFI_NOT_PRESENT; |
|
650 params.serviceType = UICC_APPL_FILE_INFO; |
|
651 |
|
652 // File id path |
|
653 params.filePath.Append( KMasterFileId >> 8 ); |
|
654 params.filePath.Append( KMasterFileId ); |
|
655 params.filePath.Append( APPL_FILE_ID>>8); |
|
656 params.filePath.Append( APPL_FILE_ID); |
|
657 |
|
658 ret = iMmPhoneBookStoreMessHandler->UiccMessHandler()-> |
|
659 CreateUiccApplCmdReq( params ); |
|
660 } |
|
661 else |
|
662 { |
|
663 TFLOGSTRING("TSY: CMmPhoneBookOperationCache::UiccReadApplFileInfo MSISDN is not activated on SIM" ); |
|
664 OstTrace0( TRACE_NORMAL, DUP1_CMMPHONEBOOKOPERATIONCACHE_UICCREADAPPLFILEINFO, "CMmPhoneBookOperationCache::UiccReadApplFileInfo MSISDN is not activated on SIM" ); |
|
665 } |
|
666 return ret; |
|
667 } |
|
668 |
|
669 // ----------------------------------------------------------------------------- |
|
670 // CMmPhoneBookOperationCache::HandleUiccReadApplFileInfoResp |
|
671 // Read application file info |
|
672 // ----------------------------------------------------------------------------- |
|
673 // |
|
674 TBool CMmPhoneBookOperationCache::HandleUiccReadApplFileInfoResp( |
|
675 TInt aTransId, |
|
676 TInt aStatus, |
|
677 const TDesC8 &aFileData ) |
|
678 { |
|
679 TFLOGSTRING2("TSY: CMmPhoneBookOperationCache::HandleUiccReadApplFileInfoResp, aStatus: %d", aStatus ); |
|
680 OstTrace1( TRACE_NORMAL, CMMPHONEBOOKOPERATIONCACHE_HANDLEUICCREADAPPLFILEINFORESP, "CMmPhoneBookOperationCache::HandleUiccReadApplFileInfoResp;aStatus=%d", aStatus ); |
|
681 |
|
682 TInt ret( KErrNone ); |
|
683 TBool completed( EFalse ); |
|
684 |
|
685 CMmDataPackage numberData; |
|
686 |
|
687 if ( ( UICC_STATUS_OK != aStatus ) || ( 0 == aFileData.Length() ) ) |
|
688 { |
|
689 // Complete response with the array of ON entries with ret |
|
690 // Pack the data for sending to the manager |
|
691 ret = CMmStaticUtility::UICCCSCauseToEpocError( aStatus ); |
|
692 TInt numofEntry( -1 ); |
|
693 numberData.PackData( &numofEntry ); |
|
694 CompleteThisIPC( EMmTsyONStoreGetInfoIPC, &numberData, ret ); |
|
695 completed = ETrue; |
|
696 } |
|
697 else |
|
698 { |
|
699 switch ( iTypeOfReading ) |
|
700 { |
|
701 case EFileInfoRead: |
|
702 { |
|
703 TFci fci( aFileData ); |
|
704 // Number of entries and name length can be fetched here. |
|
705 // Number length and number of used entries will be updated |
|
706 // during next sequences. |
|
707 iServiceType.iNumOfEntries = fci.GetNumberOfRecords(); |
|
708 iServiceType.iNameLen = fci.GetRecordLength() - KEFBasicLength; |
|
709 |
|
710 iTypeOfReading = EBasicEfRead; |
|
711 |
|
712 // Start from the 1st record |
|
713 iRecordId = KStartRecord; |
|
714 |
|
715 UiccReadApplFileData( |
|
716 PB_MSISDN_FID, |
|
717 iRecordId, |
|
718 aTransId ); |
|
719 break; |
|
720 } |
|
721 |
|
722 case EBasicEfRead: |
|
723 { |
|
724 // Check for Is there any extension data |
|
725 // And the Extension data record number is valid |
|
726 // Index to read Extension file Data is Alpha string Length + |
|
727 // basic EF length minus 1 is for Array index Calculation |
|
728 // (it starts from 0) |
|
729 |
|
730 iServiceType.iNumLen = UICC_NO_EXT_MAX_NUM_LEN; |
|
731 TInt fileId( iExtFileId ); |
|
732 iRecordId = |
|
733 aFileData[iServiceType.iNameLen + KEFBasicLength - 1]; |
|
734 if ( 0xFF == iRecordId ) |
|
735 { |
|
736 iServiceType.iNumLen = |
|
737 UICC_NO_EXT_MAX_NUM_LEN; |
|
738 |
|
739 // No extension. Continue with file count reading. |
|
740 iTypeOfReading = EBasicEfReadToGetUsedFileCount; |
|
741 |
|
742 // EFSMS file id is used for file count reading. |
|
743 fileId = iFileId; |
|
744 |
|
745 // Start from the 1st record |
|
746 iRecordId = KStartRecord; |
|
747 } |
|
748 else |
|
749 { |
|
750 iTypeOfReading = EExtensionRead; |
|
751 } |
|
752 |
|
753 UiccReadApplFileData( |
|
754 fileId, |
|
755 iRecordId, |
|
756 aTransId ); |
|
757 break; |
|
758 } |
|
759 |
|
760 case EExtensionRead: |
|
761 { |
|
762 // If current record number is the same as the next record |
|
763 // number in the extension file complete the whole session |
|
764 // with cause KErrArgument. |
|
765 if ( iRecordId == |
|
766 aFileData[UICC_EXT_REC_NO_OFFSET] ) |
|
767 { |
|
768 TInt numofEntry( -1 ); |
|
769 numberData.PackData( &numofEntry ); |
|
770 CompleteThisIPC( EMmTsyONStoreGetInfoIPC, |
|
771 &numberData, |
|
772 KErrCorrupt ); |
|
773 completed = ETrue; |
|
774 } |
|
775 else |
|
776 { |
|
777 iServiceType.iNumLen += KEFExtensionLength; |
|
778 iRecordId = aFileData[UICC_EXT_REC_NO_OFFSET]; |
|
779 |
|
780 // In case of ICC EXT1 is used, but in UICC case it is EXT5 |
|
781 TInt fileId( iExtFileId ); |
|
782 if ( 0xFF == iRecordId ) |
|
783 { |
|
784 // The last record found. Check count of used entires |
|
785 iTypeOfReading = EBasicEfReadToGetUsedFileCount; |
|
786 // EFMSISDN file id is used for file count reading. |
|
787 fileId = PB_MSISDN_FID; |
|
788 // Start from the 1st record |
|
789 iRecordId = 1; |
|
790 } |
|
791 else |
|
792 { |
|
793 iTypeOfReading = EExtensionRead; |
|
794 } |
|
795 |
|
796 UiccReadApplFileData( |
|
797 fileId, |
|
798 iRecordId, |
|
799 aTransId ); |
|
800 } |
|
801 break; |
|
802 } |
|
803 |
|
804 case EBasicEfReadToGetUsedFileCount: |
|
805 { |
|
806 TInt retval( EmptyEntryCheck( aFileData ) ); |
|
807 if ( KErrNone == retval ) |
|
808 { |
|
809 iServiceType.iUsedEntries++; |
|
810 } |
|
811 // No else, because used entries counter is increased only when |
|
812 // there is data in the record. |
|
813 iRecordId++; |
|
814 if ( iRecordId > iServiceType.iNumOfEntries ) |
|
815 { |
|
816 numberData.PackData( &iServiceType ); |
|
817 CompleteThisIPC( EMmTsyONStoreGetInfoIPC, |
|
818 &numberData, |
|
819 ret ); |
|
820 completed = ETrue; |
|
821 } |
|
822 else |
|
823 { |
|
824 UiccReadApplFileData( |
|
825 PB_MSISDN_FID, |
|
826 iRecordId, |
|
827 aTransId ); |
|
828 } |
|
829 break; |
|
830 } |
|
831 |
|
832 default: |
|
833 { |
|
834 TFLOGSTRING2("TSY: CMmPhoneBookOperationCache::HandleUiccReadApplFileInfoResp - Unknown iTypeOfReading: %d", iTypeOfReading); |
|
835 OstTraceExt1( TRACE_NORMAL, DUP1_CMMPHONEBOOKOPERATIONCACHE_HANDLEUICCREADAPPLFILEINFORESP, "CMmPhoneBookOperationCache::HandleUiccReadApplFileInfoResp;Unknown iTypeOfReading=%hhu", iTypeOfReading ); |
|
836 completed = ETrue; |
|
837 break; |
|
838 } |
|
839 } |
|
840 } |
|
841 return completed; |
|
842 } |
|
843 |
|
844 // ----------------------------------------------------------------------------- |
|
845 // CMmPhoneBookOperationCache::HandleUiccReadApplFileInfoResp |
|
846 // Read application file info |
|
847 // ----------------------------------------------------------------------------- |
|
848 // |
|
849 TInt CMmPhoneBookOperationCache::CheckMSISDNSupport |
|
850 ( |
|
851 // None |
|
852 ) |
|
853 { |
|
854 TFLOGSTRING("TSY: CMmPhoneBookOperationCache::CheckMSISDNSupport" ); |
|
855 OstTrace0( TRACE_NORMAL, CMMPHONEBOOKOPERATIONCACHE_CHECKMSISDNSUPPORT, "CMmPhoneBookOperationCache::CheckMSISDNSupport" ); |
|
856 |
|
857 TInt ret( KErrNotSupported ); |
|
858 |
|
859 if ( iMmUiccMessHandler->GetServiceStatus( UICC_MSISDN_SERVICE_NUM ) ) |
|
860 { |
|
861 ret = KErrNone; |
|
862 } |
|
863 // No else |
|
864 |
|
865 return ret; |
|
866 } |
|
867 |
|
868 // ----------------------------------------------------------------------------- |
|
869 // CMmPhoneBookOperationCache::CompleteThisIPC |
|
870 // Read application file info |
|
871 // ----------------------------------------------------------------------------- |
|
872 // |
|
873 void CMmPhoneBookOperationCache::CompleteThisIPC |
|
874 ( |
|
875 TInt aIPCToBeCompleted, |
|
876 CMmDataPackage* aDataPackage, |
|
877 TInt ret |
|
878 ) |
|
879 { |
|
880 TFLOGSTRING("TSY: CMmPhoneBookOperationCache::CompleteThisIPC" ); |
|
881 OstTrace0( TRACE_NORMAL, DUP1_CMMPHONEBOOKOPERATIONCACHE_CHECKMSISDNSUPPORT, "CMmPhoneBookOperationCache::CheckMSISDNSupport" ); |
|
882 |
|
883 iMmPhoneBookStoreMessHandler->MessageRouter()->Complete( |
|
884 aIPCToBeCompleted, |
|
885 aDataPackage, |
|
886 ret ); |
|
887 } |
|
888 |
|
889 // ----------------------------------------------------------------------------- |
|
890 // CMmPhoneBookOperationCache::UiccReadApplFileData |
|
891 // Read application file info |
|
892 // ----------------------------------------------------------------------------- |
|
893 // |
|
894 TInt CMmPhoneBookOperationCache::UiccReadApplFileData( |
|
895 const TInt aFileId, |
|
896 const TInt aRecordId, |
|
897 const TUint8 aTrId ) |
|
898 { |
|
899 TFLOGSTRING3("TSY: CMmPhoneBookOperationCache::UiccReadApplFileData, aTraId: %d, aRecordId: %d", aTrId, aRecordId ); |
|
900 OstTraceExt2( TRACE_NORMAL, CMMPHONEBOOKOPERATIONCACHE_UICCREADAPPLFILEDATA, "CMmPhoneBookOperationCache::UiccReadApplFileData;aTrId=%d;aRecordId=%d", aTrId, aRecordId ); |
|
901 |
|
902 TInt ret( KErrNone ); |
|
903 |
|
904 TUiccReadLinearFixed cmdParams; |
|
905 cmdParams.messHandlerPtr = static_cast<MUiccOperationBase*> |
|
906 ( iMmPhoneBookStoreMessHandler ); |
|
907 cmdParams.filePath.Append( static_cast<TUint8>( MF_FILE >> 8 )); |
|
908 cmdParams.filePath.Append( static_cast<TUint8>( MF_FILE )); |
|
909 cmdParams.filePath.Append( APPL_FILE_ID>>8); |
|
910 cmdParams.filePath.Append( APPL_FILE_ID); |
|
911 |
|
912 if( UICC_CARD_TYPE_UICC == iMmUiccMessHandler->GetCardType() ) |
|
913 { |
|
914 cmdParams.filePath.Append( static_cast<TUint8>( DF_PHONEBOOK >> 8 )); |
|
915 cmdParams.filePath.Append( static_cast<TUint8>( DF_PHONEBOOK )); |
|
916 } |
|
917 |
|
918 cmdParams.trId = static_cast<TUiccTrId>( aTrId ); |
|
919 cmdParams.serviceType = UICC_APPL_READ_LINEAR_FIXED; |
|
920 cmdParams.record = aRecordId; |
|
921 cmdParams.fileId = aFileId; |
|
922 cmdParams.dataAmount = 0; |
|
923 cmdParams.dataOffset = 0; |
|
924 |
|
925 ret = iMmPhoneBookStoreMessHandler->UiccMessHandler()-> |
|
926 CreateUiccApplCmdReq( cmdParams ); |
|
927 |
|
928 return ret; |
|
929 } |
|
930 |
589 // End of file |
931 // End of file |