469 RMobileONStore::TMobileONEntryV1Pckg* entryPckg = |
469 RMobileONStore::TMobileONEntryV1Pckg* entryPckg = |
470 REINTERPRET_CAST |
470 REINTERPRET_CAST |
471 ( RMobileONStore::TMobileONEntryV1Pckg*, aEntry ); |
471 ( RMobileONStore::TMobileONEntryV1Pckg*, aEntry ); |
472 RMobileONStore::TMobileONEntryV1& entry = ( *entryPckg )(); |
472 RMobileONStore::TMobileONEntryV1& entry = ( *entryPckg )(); |
473 |
473 |
474 // Save entry pointer |
474 // Check index |
475 iReadONStoreEntryPtr = aEntry; |
475 if ( (-1) <= entry.iIndex ) |
476 |
476 { |
477 // Forward request to GSM Extension |
477 // Forward request to GSM Extension |
478 ret = iMmONStoreExtInterface->ReadL( EMmTsyONStoreReadIPC, entry.iIndex ); |
478 ret = iMmONStoreExtInterface->ReadL( EMmTsyONStoreReadIPC, entry.iIndex ); |
|
479 } |
479 |
480 |
480 if ( KErrNone == ret ) |
481 if ( KErrNone == ret ) |
481 { |
482 { |
|
483 // Save entry pointer |
|
484 iReadONStoreEntryPtr = aEntry; |
|
485 |
482 // Save tsy req handle type |
486 // Save tsy req handle type |
483 iReqHandleType = EMultimodeONStoreRead; |
487 iReqHandleType = EMultimodeONStoreRead; |
484 } |
488 } |
485 } |
489 } |
486 |
490 |
598 TInt CMmONStoreTsy::WriteL( |
602 TInt CMmONStoreTsy::WriteL( |
599 const TTsyReqHandle aTsyReqHandle, |
603 const TTsyReqHandle aTsyReqHandle, |
600 TDesC8* aEntry ) |
604 TDesC8* aEntry ) |
601 { |
605 { |
602 TFLOGSTRING("TSY: CMmONStoreTsy::WriteL"); |
606 TFLOGSTRING("TSY: CMmONStoreTsy::WriteL"); |
603 // Save tsy req handle type |
|
604 iReqHandleType = EMultimodeONStoreWrite; |
|
605 |
607 |
606 // Unpack entry param to get the location |
608 // Unpack entry param to get the location |
607 RMobileONStore::TMobileONEntryV1Pckg* entryPckg = |
609 RMobileONStore::TMobileONEntryV1Pckg* entryPckg = |
608 REINTERPRET_CAST |
610 REINTERPRET_CAST |
609 ( RMobileONStore::TMobileONEntryV1Pckg*, aEntry ); |
611 ( RMobileONStore::TMobileONEntryV1Pckg*, aEntry ); |
610 RMobileONStore::TMobileONEntryV1& entry = ( *entryPckg )(); |
612 RMobileONStore::TMobileONEntryV1& entry = ( *entryPckg )(); |
611 |
613 |
|
614 // Return value |
|
615 TInt ret( KErrArgument ); |
|
616 |
|
617 // Check Parameters |
|
618 if( (-1) > entry.iIndex || sizeof( RMobileONStore::TMobileONEntryV1 ) != aEntry->Size() ) |
|
619 { |
|
620 return ret; |
|
621 } |
|
622 |
|
623 // Save tsy req handle type |
|
624 iReqHandleType = EMultimodeONStoreWrite; |
|
625 |
612 iWriteONStoreEntryPtr = aEntry; |
626 iWriteONStoreEntryPtr = aEntry; |
613 iWriteIndexToReturn = entry.iIndex; |
627 iWriteIndexToReturn = entry.iIndex; |
614 |
628 |
615 // It is not possible to cancel write request anymore... |
629 // It is not possible to cancel write request anymore... |
616 iIsWriteCancellingPossible = EFalse; |
630 iIsWriteCancellingPossible = EFalse; |
617 |
631 |
618 // Return value |
|
619 TInt ret( KErrNone ); |
|
620 |
632 |
621 ret = iMmONStoreExtInterface-> |
633 ret = iMmONStoreExtInterface-> |
622 WriteL( |
634 WriteL( |
623 EMmTsyONStoreWriteIPC, |
635 EMmTsyONStoreWriteIPC, |
624 aEntry ); |
636 aEntry ); |
957 { |
969 { |
958 TFLOGSTRING("TSY: CMmONStoreTsy::GetInfoL"); |
970 TFLOGSTRING("TSY: CMmONStoreTsy::GetInfoL"); |
959 |
971 |
960 TInt ret( KErrNone ); |
972 TInt ret( KErrNone ); |
961 |
973 |
|
974 TTsyReqHandle reqHandle = iTsyReqHandleStore->GetTsyReqHandle( |
|
975 EMultimodeONStoreGetInfo ); |
|
976 if(reqHandle != EMultimodeONStoreReqHandleUnknown) |
|
977 { |
|
978 ReqCompleted( aTsyReqHandle, KErrServerBusy ); |
|
979 return ret; |
|
980 } |
962 // if aInfo is not correct type, send KErrArgument to client and return |
981 // if aInfo is not correct type, send KErrArgument to client and return |
963 if( RMobilePhoneStore::KETelMobileONStoreV1 != aInfo->ExtensionId() ) |
982 if( RMobilePhoneStore::KETelMobileONStoreV1 != aInfo->ExtensionId() ) |
964 { |
983 { |
965 ReqCompleted( aTsyReqHandle, KErrArgument ); |
984 ReqCompleted( aTsyReqHandle, KErrArgument ); |
966 return ret; |
985 return ret; |
967 } |
986 } |
968 |
987 |
969 // Don't send request if pb init is still ongoing |
988 // Don't send request if pb init is still ongoing |
970 // instead send KErrNotReady to client |
989 // instead create an ADN book store and wait for it to initilize |
971 TBool done ( ETrue ); |
990 |
972 TFLOGSTRING2( "TSY: CMmONStoreTsy::GetInfoL iPBList->GetNumberOfObjects() = %d", iMmPhone->PBList()->GetNumberOfObjects()); |
991 TFLOGSTRING2( "TSY: CMmONStoreTsy::GetInfoL iPBList->GetNumberOfObjects() = %d", iMmPhone->PBList()->GetNumberOfObjects()); |
973 |
992 CMmPhoneBookStoreTsy* pbStore = NULL; |
974 for( TInt i = 0; i < iMmPhone->PBList()->GetNumberOfObjects(); i++ ) |
993 for( TInt i = 0; (i < iMmPhone->PBList()->GetNumberOfObjects()) && (NULL == pbStore) ; i++ ) |
975 { |
994 { |
976 CMmPhoneBookStoreTsy* pbStore = iMmPhone->PBList()-> |
995 pbStore = iMmPhone->PBList()->GetMmPBByIndex( i ); |
977 GetMmPBByIndex( i ); |
|
978 TFLOGSTRING2( "TSY: CMmONStoreTsy::GetInfoL index = %d", i); |
996 TFLOGSTRING2( "TSY: CMmONStoreTsy::GetInfoL index = %d", i); |
979 |
997 if( (pbStore->GetPhonebookType() != KADNPhoneBook) && (pbStore->GetPhonebookType() != KFDNPhoneBook ) ) |
980 if ( !pbStore->IsPBInitDone() |
998 { |
981 && ( pbStore->GetPhonebookType() == KADNPhoneBook |
999 pbStore = NULL; |
982 || pbStore->GetPhonebookType() == KFDNPhoneBook ) ) |
1000 } |
983 { |
1001 else |
984 TFLOGSTRING("TSY: CMmONStoreTsy::GetInfoL - ADN or FDN init not done"); |
1002 { |
985 TFLOGSTRING("TSY: CMmONStoreTsy::GetInfoL - in !pbStore->IsPBInitDone()"); |
1003 |
986 // init still ongoing |
1004 TFLOGSTRING("TSY: CMmONStoreTsy::GetInfoL - found ADN or FDN store"); |
987 done = EFalse; |
|
988 } |
1005 } |
989 } |
1006 } |
990 |
1007 if(NULL == pbStore) |
991 // Check if some PB is not initialized, if so send KErrNotReady to client |
1008 { |
992 if ( !done ) |
1009 TFLOGSTRING("TSY: CMmONStoreTsy::GetInfoL - no ADN nor FDN store- creating ADN"); |
993 { |
1010 pbStore = CMmPhoneBookStoreTsy::NewL( iMmPhone, KETelIccAdnPhoneBook ); |
994 TFLOGSTRING("TSY: CMmONStoreTsy::GetInfoL - PBInit not done, return KErrNotReady"); |
1011 TInt addPBSucceeded = iMmPhone->PBList()->AddObject( pbStore ); |
995 ReqCompleted( aTsyReqHandle, KErrNotReady ); |
1012 if(addPBSucceeded != KErrNone) |
996 } |
1013 { |
997 |
1014 delete pbStore; |
998 else |
1015 ReqCompleted( aTsyReqHandle, addPBSucceeded ); |
999 { |
1016 return KErrNone; |
|
1017 } |
|
1018 } |
|
1019 |
|
1020 // Set get info internal pointer |
|
1021 iONStoreInfoChanged = aInfo; |
|
1022 |
|
1023 if ( !pbStore->IsPBInitDone()) |
|
1024 { |
|
1025 TFLOGSTRING("TSY: CMmONStoreTsy::GetInfoL - waiting for phone book to be initilized"); |
|
1026 // Save tsy req handle type |
|
1027 iReqHandleType = EMultimodeONStoreGetInfo; |
|
1028 return KErrNone; |
|
1029 } |
|
1030 |
1000 TFLOGSTRING("TSY: CMmONStoreTsy::GetInfoL - PBInit done, complete"); |
1031 TFLOGSTRING("TSY: CMmONStoreTsy::GetInfoL - PBInit done, complete"); |
1001 // Set get info internal pointer |
|
1002 iONStoreInfoChanged = aInfo; |
|
1003 |
1032 |
1004 // Request to GSM extension, get used entries, |
1033 // Request to GSM extension, get used entries, |
1005 // -1 as a index param-> specified location param not needed |
1034 // -1 as a index param-> specified location param not needed |
1006 ret = iMmONStoreExtInterface->ReadL( EMmTsyONStoreGetInfoIPC, -1 ); |
1035 ret = iMmONStoreExtInterface->ReadL(EMmTsyONStoreGetInfoIPC, -1); |
1007 |
1036 |
1008 if ( KErrNone != ret ) // Message sending failed |
1037 if (KErrNone != ret) // Message sending failed |
1009 { |
1038 { |
1010 ReqCompleted( aTsyReqHandle, ret ); |
1039 ReqCompleted(aTsyReqHandle, ret); |
1011 } |
1040 } |
1012 else |
1041 else |
1013 { |
1042 { |
1014 iIsGetInfoActive = ETrue; |
1043 // Save tsy req handle type |
1015 // Save tsy req handle type |
1044 iReqHandleType = EMultimodeONStoreGetInfo; |
1016 iReqHandleType = EMultimodeONStoreGetInfo; |
1045 } |
1017 } |
|
1018 } |
|
1019 |
1046 |
1020 return KErrNone; |
1047 return KErrNone; |
1021 } |
1048 } |
1022 |
1049 |
1023 // --------------------------------------------------------------------------- |
1050 // --------------------------------------------------------------------------- |
2003 } |
2029 } |
2004 } |
2030 } |
2005 |
2031 |
2006 #endif |
2032 #endif |
2007 |
2033 |
|
2034 // --------------------------------------------------------------------------- |
|
2035 // CMmONStoreTsy::PhoneBookStoreInitCompleteL |
|
2036 // Phone book store initilization was complete |
|
2037 // (other items were commented in a header). |
|
2038 // --------------------------------------------------------------------------- |
|
2039 // |
|
2040 void CMmONStoreTsy::PhoneBookStoreInitCompleteL(TInt aError) |
|
2041 { |
|
2042 TFLOGSTRING("TSY: CMmONStoreTsy::PhoneBookStoreInitCompleteL "); |
|
2043 TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( EMultimodeONStoreGetInfo ); |
|
2044 if( EMultimodeONStoreReqHandleUnknown != reqHandle ) |
|
2045 { |
|
2046 if( KErrNone != aError ) |
|
2047 { |
|
2048 |
|
2049 ReqCompleted(reqHandle, aError); |
|
2050 return; |
|
2051 } |
|
2052 iReqHandleType = EMultimodeONStoreReqHandleUnknown; |
|
2053 TInt ret = GetInfoL(reqHandle, iONStoreInfoChanged); |
|
2054 if (ret == KErrNone) |
|
2055 { |
|
2056 if (iReqHandleType != EMultimodeONStoreReqHandleUnknown) |
|
2057 { |
|
2058 #ifdef REQHANDLE_TIMER |
|
2059 SetTypeOfResponse(iReqHandleType, reqHandle); |
|
2060 #else // REQHANDLE_TIMER |
|
2061 iTsyReqHandleStore->SetTsyReqHandle( iReqHandleType, reqHandle ); |
|
2062 #endif // REQHANDLE_TIMER |
|
2063 } |
|
2064 } |
|
2065 else |
|
2066 { |
|
2067 ReqCompleted(reqHandle, ret); |
|
2068 } |
|
2069 } |
|
2070 |
|
2071 } |
|
2072 |
2008 // End of File |
2073 // End of File |