telephonyserverplugins/common_tsy/commontsy/src/mmtsy/cmmphonetsy.cpp
branchRCL_3
changeset 20 07a122eea281
parent 19 630d2f34d719
equal deleted inserted replaced
19:630d2f34d719 20:07a122eea281
    11 // Contributors:
    11 // Contributors:
    12 //
    12 //
    13 // Description:
    13 // Description:
    14 //
    14 //
    15 
    15 
    16 
       
    17 #include "OstTraceDefinitions.h"
       
    18 #ifdef OST_TRACE_COMPILER_IN_USE
       
    19 #include "cmmphonetsyTraces.h"
       
    20 #endif
       
    21 
    16 
    22 
    17 
    23 //INCLUDES
    18 //INCLUDES
    24 #include <etelmm.h>
    19 #include <etelmm.h>
    25 #include <etelmmerr.h>
    20 #include <etelmmerr.h>
    93 EXPORT_C CMmPhoneTsy* CMmPhoneTsy::NewL (
    88 EXPORT_C CMmPhoneTsy* CMmPhoneTsy::NewL (
    94     CMmMessageManagerBase* aMessageManager,
    89     CMmMessageManagerBase* aMessageManager,
    95     CMmPhoneFactoryTsy* aMmPhoneFactoryTsy,
    90     CMmPhoneFactoryTsy* aMmPhoneFactoryTsy,
    96     MLtsyFactoryBase* aFactory )
    91     MLtsyFactoryBase* aFactory )
    97     {
    92     {
    98 OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CMMPHONETSY_NEWL_1, "TSY: CMmPhoneTsy::NewL - Phone model Id: %S", KPhoneModelId);
    93 TFLOGSTRING2("TSY: CMmPhoneTsy::NewL - Phone model Id: %S", &KPhoneModelId);
    99     CleanupStack::PushL( aMessageManager );
    94     CleanupStack::PushL( aMessageManager );
   100     CMmPhoneTsy* mmPhoneTsy = new (ELeave) CMmPhoneTsy();
    95     CMmPhoneTsy* mmPhoneTsy = new (ELeave) CMmPhoneTsy();
   101 
    96 
   102     mmPhoneTsy->iMessageManager = aMessageManager;
    97     mmPhoneTsy->iMessageManager = aMessageManager;
   103     CleanupStack::Pop(aMessageManager);
    98     CleanupStack::Pop(aMessageManager);
   133     {
   128     {
   134     }
   129     }
   135 
   130 
   136 void CMmPhoneTsy::ConstructL()
   131 void CMmPhoneTsy::ConstructL()
   137     {
   132     {
   138 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_CONSTRUCTL_1, "TSY: CMmPhoneTsy::ConstructL");
   133 TFLOGSTRING("TSY: CMmPhoneTsy::ConstructL");
   139 	iCentRep = CRepository::NewL( KCRUidCtsyMEAlsLine );
   134 	iCentRep = CRepository::NewL( KCRUidCtsyMEAlsLine );
   140 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_CONSTRUCTL_2, "TSY: CMmPhoneTsy::ConstructL Central Repository opened successfully");
   135 TFLOGSTRING("TSY: CMmPhoneTsy::ConstructL Central Repository opened successfully");
   141 	
   136 	
   142 	//iPublic Central Repositories
   137 	//iPublic Central Repositories
   143     iMWISCentRep = CRepository::NewL( KCRUidCtsyMessageWaitingIndicator );
   138     iMWISCentRep = CRepository::NewL( KCRUidCtsyMessageWaitingIndicator );
   144     iCFISPrivateCentRep = CRepository::NewL( KCRUidCtsyPrivateCallForwardingIndicator );
   139     iCFISPrivateCentRep = CRepository::NewL( KCRUidCtsyPrivateCallForwardingIndicator );
   145     iCFISCentRep = CRepository::NewL( KCRUidCtsyCallForwardingIndicator );
   140     iCFISCentRep = CRepository::NewL( KCRUidCtsyCallForwardingIndicator );
   185 	iIsInitializationActive = EFalse;
   180 	iIsInitializationActive = EFalse;
   186 
   181 
   187 	// initialize HWRM & its observers
   182 	// initialize HWRM & its observers
   188 	if(IsHWRMSupported())
   183 	if(IsHWRMSupported())
   189 		{
   184 		{
   190 		OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_CONSTRUCTL_3, "TSY: HWRM Battery API is in use.");
   185 		TFLOGSTRING("TSY: HWRM Battery API is in use.");
   191 		iPowerManager = CHWRMPower::NewL();
   186 		iPowerManager = CHWRMPower::NewL();
   192 		iBattery = CBatteryInfoObserver::NewL( *iPowerManager, *this ); 
   187 		iBattery = CBatteryInfoObserver::NewL( *iPowerManager, *this ); 
   193 		iChargingStatus = CChargingStatusObserver::NewL( *this );
   188 		iChargingStatus = CChargingStatusObserver::NewL( *this );
   194 		}
   189 		}
   195     
   190     
   352     iIsModemReady = EFalse;
   347     iIsModemReady = EFalse;
   353     }
   348     }
   354     
   349     
   355 CMmPhoneTsy::~CMmPhoneTsy()
   350 CMmPhoneTsy::~CMmPhoneTsy()
   356     {
   351     {
   357 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_DTOR_1, "TSY: CMmPhoneTsy::~CMmPhoneTsy");
   352 TFLOGSTRING("TSY: CMmPhoneTsy::~CMmPhoneTsy");
   358 
   353 
   359 	if(IsHWRMSupported())
   354 	if(IsHWRMSupported())
   360 		{
   355 		{
   361 		if ( iChargingStatus )
   356 		if ( iChargingStatus )
   362 			{
   357 			{
   562         {
   557         {
   563         iSystemStatePluginHandler->Close();
   558         iSystemStatePluginHandler->Close();
   564         delete iSystemStatePluginHandler;
   559         delete iSystemStatePluginHandler;
   565         }
   560         }
   566     iSystemStatePluginHandler = NULL;
   561     iSystemStatePluginHandler = NULL;
   567 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_DTOR_2, "TSY: CMmPhoneTsy::~CMmPhoneTsy DONE");
   562 TFLOGSTRING("TSY: CMmPhoneTsy::~CMmPhoneTsy DONE");
   568    }
   563    }
   569 
   564 
   570 // ---------------------------------------------------------------------------
   565 // ---------------------------------------------------------------------------
   571 // CMmPhoneTsy::Init
   566 // CMmPhoneTsy::Init
   572 // Initialisation method that is called from ETel Server
   567 // Initialisation method that is called from ETel Server
   586 // (other items were commented in a header).
   581 // (other items were commented in a header).
   587 // ---------------------------------------------------------------------------
   582 // ---------------------------------------------------------------------------
   588 //
   583 //
   589 void CMmPhoneTsy::CompleteNotifyModemStatusReady()
   584 void CMmPhoneTsy::CompleteNotifyModemStatusReady()
   590     {
   585     {
   591 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETENOTIFYMODEMSTATUSREADY_1, "TSY: CMmPhoneTsy::CompleteNotifyModemStatusReady");
   586 TFLOGSTRING("TSY: CMmPhoneTsy::CompleteNotifyModemStatusReady");
   592 
   587 
   593     TRAP_IGNORE(
   588     TRAP_IGNORE(
   594     //update the network registration status
   589     //update the network registration status
   595         iMmPhoneExtInterface->GetNetworkRegistrationStatusL( );
   590         iMmPhoneExtInterface->GetNetworkRegistrationStatusL( );
   596 
   591 
   615 //
   610 //
   616 void CMmPhoneTsy::CompleteNotifySimStatusReadyL()
   611 void CMmPhoneTsy::CompleteNotifySimStatusReadyL()
   617     {
   612     {
   618     if ( !iBootState.iSIMReady )
   613     if ( !iBootState.iSIMReady )
   619         {
   614         {
   620 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETENOTIFYSIMSTATUSREADYL_1, "TSY: CMmPhoneTsy::CompleteNotifySimStatusReadyL - SIM is ready, start initialisations");
   615 TFLOGSTRING("TSY: CMmPhoneTsy::CompleteNotifySimStatusReadyL - SIM is ready, start initialisations");
   621 
   616 
   622         iBootState.iSIMReady = ETrue;
   617         iBootState.iSIMReady = ETrue;
   623         iBootState.iADNReady = ETrue;
   618         iBootState.iADNReady = ETrue;
   624 
   619 
   625         // Might leave, but we want to call also other
   620         // Might leave, but we want to call also other
   660         
   655         
   661         // If Custom TSY is open, check whether we need to read
   656         // If Custom TSY is open, check whether we need to read
   662         // VIAG homezone parameters. 
   657         // VIAG homezone parameters. 
   663         if ( iMmCustomTsy )
   658         if ( iMmCustomTsy )
   664             {
   659             {
   665 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETENOTIFYSIMSTATUSREADYL_2, "TSY: CMmPhoneTsy::CompleteNotifySimStatusReadyL - CustomTSY ready");
   660 TFLOGSTRING("TSY: CMmPhoneTsy::CompleteNotifySimStatusReadyL - CustomTSY ready");
   666             // Get pointer to SIM Custom TSY
   661             // Get pointer to SIM Custom TSY
   667             CMmSIMTsy* simCustomTsy =
   662             CMmSIMTsy* simCustomTsy =
   668                 ( ( CMmSIMTsy* ) iMmCustomTsy->GetSIMTsyPtr() );
   663                 ( ( CMmSIMTsy* ) iMmCustomTsy->GetSIMTsyPtr() );
   669             
   664             
   670             if ( simCustomTsy )
   665             if ( simCustomTsy )
   671                 {
   666                 {
   672 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETENOTIFYSIMSTATUSREADYL_3, "TSY: CMmPhoneTsy::CompleteNotifySimStatusReadyL - CheckViagHomeZoneParamsL()");
   667 TFLOGSTRING("TSY: CMmPhoneTsy::CompleteNotifySimStatusReadyL - CheckViagHomeZoneParamsL()");
   673                 simCustomTsy->CheckViagHomezoneParamsL();
   668                 simCustomTsy->CheckViagHomezoneParamsL();
   674                 iViagHomeZoneParamsChecked = ETrue;
   669                 iViagHomeZoneParamsChecked = ETrue;
   675                 }
   670                 }
   676             }
   671             }
   677         // If not able to read here it's tried again in customtsy    
   672         // If not able to read here it's tried again in customtsy    
   678         else
   673         else
   679         	{
   674         	{
   680         	iViagHomeZoneParamsChecked = EFalse;
   675         	iViagHomeZoneParamsChecked = EFalse;
   681 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETENOTIFYSIMSTATUSREADYL_4, "TSY: CMmPhoneTsy::CompleteNotifySimStatusReadyL - CustomTSY NOT ready");
   676 TFLOGSTRING("TSY: CMmPhoneTsy::CompleteNotifySimStatusReadyL - CustomTSY NOT ready");        		
   682         	}
   677         	}
   683         } 
   678         } 
   684     }
   679     }
   685 
   680 
   686 // ---------------------------------------------------------------------------
   681 // ---------------------------------------------------------------------------
   720 // ---------------------------------------------------------------------------
   715 // ---------------------------------------------------------------------------
   721 //
   716 //
   722 TInt CMmPhoneTsy::NotifyIndicatorChange(
   717 TInt CMmPhoneTsy::NotifyIndicatorChange(
   723     TUint32* aIndicatorState )
   718     TUint32* aIndicatorState )
   724     {
   719     {
   725 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_NOTIFYINDICATORCHANGE_1, "TSY: CMmPhoneTsy::NotifyIndicatorChange");
   720 TFLOGSTRING("TSY: CMmPhoneTsy::NotifyIndicatorChange");
   726 
   721 
   727     // Update indicator state, we don't keep track of it
   722     // Update indicator state, we don't keep track of it
   728     // unless notify is on. So we need to update starting
   723     // unless notify is on. So we need to update starting
   729     // value first..
   724     // value first..
   730     iIndicatorState = GetIndicatorState();
   725     iIndicatorState = GetIndicatorState();
   739 // (other items were commented in a header).
   734 // (other items were commented in a header).
   740 // ---------------------------------------------------------------------------
   735 // ---------------------------------------------------------------------------
   741 //
   736 //
   742 void CMmPhoneTsy::CompleteNotifyIndicatorChange()
   737 void CMmPhoneTsy::CompleteNotifyIndicatorChange()
   743     {
   738     {
   744 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETENOTIFYINDICATORCHANGE_1, "TSY: CMmPhoneTsy::CompleteNotifyIndicatorChange");
   739 TFLOGSTRING("TSY: CMmPhoneTsy::CompleteNotifyIndicatorChange");
   745 
   740 
   746     // first check if this notify is actually requested..
   741     // first check if this notify is actually requested..
   747     if (NULL != iRetIndicatorState)
   742     if (NULL != iRetIndicatorState)
   748         {
   743         {
   749 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETENOTIFYINDICATORCHANGE_2, "TSY: CMmPhoneTsy::CompleteNotifyIndicatorChange -- notify is on");
   744 TFLOGSTRING("TSY: CMmPhoneTsy::CompleteNotifyIndicatorChange -- notify is on");
   750         TUint32 newIndicatorState = GetIndicatorState();
   745         TUint32 newIndicatorState = GetIndicatorState();
   751         if (newIndicatorState != iIndicatorState)
   746         if (newIndicatorState != iIndicatorState)
   752             {
   747             {
   753             iIndicatorState = newIndicatorState;
   748             iIndicatorState = newIndicatorState;
   754 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETENOTIFYINDICATORCHANGE_3, "TSY: CMmPhoneTsy::CompleteNotifyIndicatorChange -- changed to 0x%08x", iIndicatorState);
   749 TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteNotifyIndicatorChange -- changed to 0x%x", iIndicatorState);
   755 
   750 
   756             //reset req handle. Returns the deleted req handle
   751             //reset req handle. Returns the deleted req handle
   757             TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
   752             TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
   758                                 EMultimodePhoneNotifyIndicatorChange );
   753                                 EMultimodePhoneNotifyIndicatorChange );
   759 
   754 
   775 // ---------------------------------------------------------------------------
   770 // ---------------------------------------------------------------------------
   776 //
   771 //
   777 TInt CMmPhoneTsy::NotifyIndicatorChangeCancel(
   772 TInt CMmPhoneTsy::NotifyIndicatorChangeCancel(
   778     const TTsyReqHandle aTsyReqHandle )
   773     const TTsyReqHandle aTsyReqHandle )
   779     {
   774     {
   780 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_NOTIFYINDICATORCHANGECANCEL_1, "TSY: CMmPhoneTsy::NotifyIndicatorChangeCancel");
   775 TFLOGSTRING("TSY: CMmPhoneTsy::NotifyIndicatorChangeCancel");
   781 
   776 
   782     iRetIndicatorState = NULL;
   777     iRetIndicatorState = NULL;
   783     iTsyReqHandleStore->ResetTsyReqHandle( 
   778     iTsyReqHandleStore->ResetTsyReqHandle( 
   784         EMultimodePhoneNotifyIndicatorChange );
   779         EMultimodePhoneNotifyIndicatorChange );
   785 
   780 
  1066 #pragma warning(default : 4127)
  1061 #pragma warning(default : 4127)
  1067 
  1062 
  1068     if ( KErrNone != trapError || KErrNone != addLineSucceeded
  1063     if ( KErrNone != trapError || KErrNone != addLineSucceeded
  1069         || KErrNone != addPBSucceeded )
  1064         || KErrNone != addPBSucceeded )
  1070         {
  1065         {
  1071 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_OPENNEWOBJECTBYNAMEL_1, "TSY: CMmPhoneTsy::OpenNewObjectByNameL - Failed: %d",trapError);
  1066 TFLOGSTRING2("TSY: CMmPhoneTsy::OpenNewObjectByNameL - Failed: %d",
       
  1067     trapError);
  1072 
  1068 
  1073         if ( mmLine )
  1069         if ( mmLine )
  1074             {
  1070             {
  1075             mmLine->Close();
  1071             mmLine->Close();
  1076             mmLine = NULL;
  1072             mmLine = NULL;
  1123 TInt CMmPhoneTsy::ExtFunc(
  1119 TInt CMmPhoneTsy::ExtFunc(
  1124     const TTsyReqHandle aTsyReqHandle,
  1120     const TTsyReqHandle aTsyReqHandle,
  1125     const TInt aIpc,
  1121     const TInt aIpc,
  1126     const TDataPackage& aPackage )
  1122     const TDataPackage& aPackage )
  1127     {
  1123     {
  1128 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_EXTFUNC_1, "TSY: CMmPhoneTsy::ExtFunc, IPC:%d, Handle:%d", aIpc, aTsyReqHandle);
  1124 TFLOGSTRING3("TSY: CMmPhoneTsy::ExtFunc, IPC:%d, Handle:%d", aIpc, aTsyReqHandle);
  1129 
  1125 
  1130     TInt ret = KErrNone;
  1126     TInt ret = KErrNone;
  1131     TInt trapError = KErrNone;
  1127     TInt trapError = KErrNone;
  1132 
  1128 
  1133     // Ensure the ReqHandleType is unset.
  1129     // Ensure the ReqHandleType is unset.
  1141     //before processing further the request, check if offline mode status
  1137     //before processing further the request, check if offline mode status
  1142     //is enabled and if the given request can be perfomed in that case.
  1138     //is enabled and if the given request can be perfomed in that case.
  1143     if ( ERfsStateInfoInactive == iStateInfo &&
  1139     if ( ERfsStateInfoInactive == iStateInfo &&
  1144         !IsRequestPossibleInOffline( aIpc ) )
  1140         !IsRequestPossibleInOffline( aIpc ) )
  1145         {
  1141         {
  1146 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_EXTFUNC_2, "TSY: Offline mode ON, request is not allowed: %d", aIpc );
  1142 TFLOGSTRING2 ("TSY: Offline mode ON, request is not allowed: %d", aIpc );
  1147         ret = CMmCommonStaticUtility::EpocErrorCode( KErrGeneral,
  1143         ret = CMmCommonStaticUtility::EpocErrorCode( KErrGeneral,
  1148                 KErrGsmOfflineOpNotAllowed );
  1144                 KErrGsmOfflineOpNotAllowed );
  1149 
  1145 
  1150         //Complete the request with appropiate error
  1146         //Complete the request with appropiate error
  1151         ReqCompleted ( aTsyReqHandle, ret );
  1147         ReqCompleted ( aTsyReqHandle, ret );
  1193 TInt CMmPhoneTsy::DoExtFuncL(
  1189 TInt CMmPhoneTsy::DoExtFuncL(
  1194     const TTsyReqHandle aTsyReqHandle,
  1190     const TTsyReqHandle aTsyReqHandle,
  1195     const TInt aIpc,
  1191     const TInt aIpc,
  1196     const TDataPackage& aPackage )
  1192     const TDataPackage& aPackage )
  1197     {
  1193     {
  1198 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_DOEXTFUNCL_1, "TSY: CMmPhoneTsy::DoExtFuncL - IPC:%d Handle:%d", aIpc, aTsyReqHandle);
  1194 TFLOGSTRING3("TSY: CMmPhoneTsy::DoExtFuncL - IPC:%d Handle:%d", aIpc, aTsyReqHandle);
  1199 
  1195 
  1200     TInt ret = KErrNone;
  1196     TInt ret = KErrNone;
  1201 
  1197 
  1202     TAny* dataPtr = aPackage.Ptr1();
  1198     TAny* dataPtr = aPackage.Ptr1();
  1203     TAny* dataPtr2 = aPackage.Ptr2();
  1199     TAny* dataPtr2 = aPackage.Ptr2();
  1233         case EMobilePhoneGetCipheringIndicatorStatus:
  1229         case EMobilePhoneGetCipheringIndicatorStatus:
  1234         case EMobilePhoneAuthorizationInfoPhase1:
  1230         case EMobilePhoneAuthorizationInfoPhase1:
  1235         case EMobilePhoneAuthorizationInfoPhase2:
  1231         case EMobilePhoneAuthorizationInfoPhase2:
  1236         case EMobilePhoneGetCellInfo:
  1232         case EMobilePhoneGetCellInfo:
  1237         case EMobilePhoneNotifyCellInfoChange:
  1233         case EMobilePhoneNotifyCellInfoChange:
  1238         case EMobilePhoneGetCurrentActiveUSimApplication:                
  1234         case EMobilePhoneGetCurrentActiveUSimApplication:
       
  1235         case EMobilePhoneGetPreferredNetworksPhase1:
       
  1236         case EMobilePhoneGetPreferredNetworksPhase2:
       
  1237         case EMobilePhoneStorePreferredNetworksList:
       
  1238         case EMobilePhoneNotifyStorePreferredNetworksListChange:
  1239             //direct this request to the net specific DoExtFuncL
  1239             //direct this request to the net specific DoExtFuncL
  1240             ret = iMmNetTsy->DoExtFuncL ( aTsyReqHandle, aIpc, aPackage );
  1240             ret = iMmNetTsy->DoExtFuncL ( aTsyReqHandle, aIpc, aPackage );
  1241             break;
  1241             break;
  1242         // Security and Phone Locks
  1242         // Security and Phone Locks
  1243         case EMobilePhoneGetSecurityCaps:
  1243         case EMobilePhoneGetSecurityCaps:
  1341 			break;
  1341 			break;
  1342 		// All calls termination
  1342 		// All calls termination
  1343         case EMobilePhoneTerminateAllCalls:
  1343         case EMobilePhoneTerminateAllCalls:
  1344             ret = TerminateAllCallsL( aTsyReqHandle );
  1344             ret = TerminateAllCallsL( aTsyReqHandle );
  1345             break;			
  1345             break;			
  1346         // Active calls termination
       
  1347         case EMobilePhoneTerminateActiveCalls:
       
  1348             ret = TerminateActiveCallsL( aTsyReqHandle );
       
  1349             break;          
       
  1350       // DTMF
  1346       // DTMF
  1351 		// forward request to the DTMF-specific Tsy
  1347 		// forward request to the DTMF-specific Tsy
  1352         case EMobilePhoneGetDTMFCaps:
  1348         case EMobilePhoneGetDTMFCaps:
  1353         case EMobilePhoneNotifyDTMFCapsChange:
  1349         case EMobilePhoneNotifyDTMFCapsChange:
  1354         case EMobilePhoneSendDTMFTones:
  1350         case EMobilePhoneSendDTMFTones:
  1616         //flow controlled. Solution: All these methods must check req handle 
  1612         //flow controlled. Solution: All these methods must check req handle 
  1617         //tablebefore handling the request. In case that the request table 
  1613         //tablebefore handling the request. In case that the request table 
  1618         //indicates that same method has been called and has not been 
  1614         //indicates that same method has been called and has not been 
  1619         //completed, the method should return KErrServerBusy.
  1615         //completed, the method should return KErrServerBusy.
  1620         case EMobilePhoneTerminateAllCalls:
  1616         case EMobilePhoneTerminateAllCalls:
  1621         case EMobilePhoneTerminateActiveCalls:
       
  1622         case EMobilePhoneGetFdnStatus:
  1617         case EMobilePhoneGetFdnStatus:
  1623         case EMobilePhoneGetCustomerServiceProfile:
  1618         case EMobilePhoneGetCustomerServiceProfile:
  1624         case EMobilePhoneGetDetectedNetworksV2Phase1:
  1619         case EMobilePhoneGetDetectedNetworksV2Phase1:
  1625         case EMobilePhoneSetLockSetting:
  1620         case EMobilePhoneSetLockSetting:
  1626         case EMobilePhoneVerifySecurityCode:
  1621         case EMobilePhoneVerifySecurityCode:
  1639         case EMobilePhoneGetAPNControlListServiceStatus:
  1634         case EMobilePhoneGetAPNControlListServiceStatus:
  1640         case EMobilePhoneSetAPNControlListServiceStatus:
  1635         case EMobilePhoneSetAPNControlListServiceStatus:
  1641         case EMobilePhoneDeleteAPNName:
  1636         case EMobilePhoneDeleteAPNName:
  1642         case EMobilePhoneAppendAPNName:
  1637         case EMobilePhoneAppendAPNName:
  1643         case EMobilePhoneGetSecurityCodeInfo:
  1638         case EMobilePhoneGetSecurityCodeInfo:
       
  1639 		case EMobilePhoneGetPreferredNetworksPhase1:
       
  1640 		case EMobilePhoneGetPreferredNetworksPhase2:		
       
  1641 		case EMobilePhoneStorePreferredNetworksList:
  1644 
  1642 
  1645         //SS related methods.
  1643         //SS related methods.
  1646         case EMobilePhoneGetCallForwardingStatusPhase1:
  1644         case EMobilePhoneGetCallForwardingStatusPhase1:
  1647         case EMobilePhoneGetBarringStatusPhase1:
  1645         case EMobilePhoneGetBarringStatusPhase1:
  1648         case EMobilePhoneGetWaitingStatusPhase1:
  1646         case EMobilePhoneGetWaitingStatusPhase1:
  1762         case EMobilePhoneNotifyAPNListChanged:
  1760         case EMobilePhoneNotifyAPNListChanged:
  1763         case EMobilePhoneNotifyAPNControlListServiceStatusChange:
  1761         case EMobilePhoneNotifyAPNControlListServiceStatusChange:
  1764         case EMobilePhoneNotifySendNetworkServiceRequest:
  1762         case EMobilePhoneNotifySendNetworkServiceRequest:
  1765         case EMobilePhoneNotifyAllSendNetworkServiceRequest: 
  1763         case EMobilePhoneNotifyAllSendNetworkServiceRequest: 
  1766         case EMobilePhoneNotifyCellInfoChange:
  1764         case EMobilePhoneNotifyCellInfoChange:
       
  1765 		case EMobilePhoneNotifyStorePreferredNetworksListChange:
  1767             ret=KReqModeMultipleCompletionEnabled | KReqModeRePostImmediately;
  1766             ret=KReqModeMultipleCompletionEnabled | KReqModeRePostImmediately;
  1768             break;
  1767             break;
  1769         // Cancel Requests
  1768         // Cancel Requests
  1770         //It is not necessary to include the Cancel methods in ReqModeL at all
  1769         //It is not necessary to include the Cancel methods in ReqModeL at all
  1771         //The ETel server never calls ReqModeL with a Cancel IPC.
  1770         //The ETel server never calls ReqModeL with a Cancel IPC.
  1776         default:
  1775         default:
  1777             ret=CPhoneBase::ReqModeL(aIpc);
  1776             ret=CPhoneBase::ReqModeL(aIpc);
  1778             break;
  1777             break;
  1779 
  1778 
  1780         }
  1779         }
  1781 	OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_REQMODEL_1, "TSY: CMmPhoneTsy::ReqModeL - IPC:%d, Mode:%d", aIpc, ret);
  1780 	TFLOGSTRING3("TSY: CMmPhoneTsy::ReqModeL - IPC:%d, Mode:%d", aIpc, ret);
  1782 
  1781 
  1783     return ret;
  1782     return ret;
  1784     }
  1783     }
  1785 
  1784 
  1786 // ---------------------------------------------------------------------------
  1785 // ---------------------------------------------------------------------------
  1912             numberOfSlots = KMmPhoneAPNControlListServiceStatusChangeSlots;
  1911             numberOfSlots = KMmPhoneAPNControlListServiceStatusChangeSlots;
  1913             break;
  1912             break;
  1914         case EMobilePhoneNotifyCellInfoChange:
  1913         case EMobilePhoneNotifyCellInfoChange:
  1915         	numberOfSlots = KMmPhoneCellInfoChangeSlots;
  1914         	numberOfSlots = KMmPhoneCellInfoChangeSlots;
  1916         	break;
  1915         	break;
       
  1916 		case EMobilePhoneNotifyStorePreferredNetworksListChange:
       
  1917 			numberOfSlots = KMmPhoneStorePreferredNetworksListChangeSlots;
       
  1918             break;
  1917         default:
  1919         default:
  1918             // Unknown or invalid Phone IPC
  1920             // Unknown or invalid Phone IPC
  1919             User::Leave( KErrNotSupported );
  1921             User::Leave( KErrNotSupported );
  1920             break;
  1922             break;
  1921         }
  1923         }
  1931 //
  1933 //
  1932 TInt CMmPhoneTsy::CancelService(
  1934 TInt CMmPhoneTsy::CancelService(
  1933     const TInt aIpc,
  1935     const TInt aIpc,
  1934     const TTsyReqHandle aTsyReqHandle )
  1936     const TTsyReqHandle aTsyReqHandle )
  1935     {
  1937     {
  1936 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_CANCELSERVICE_1, "TSY: CMmPhoneTsy::CancelService - IPC:%d, Handle:%d", aIpc, aTsyReqHandle);
  1938 TFLOGSTRING3("TSY: CMmPhoneTsy::CancelService - IPC:%d, Handle:%d", aIpc, aTsyReqHandle);
  1937 
  1939 
  1938     TInt ret ( KErrNotSupported );
  1940     TInt ret ( KErrNotSupported );
  1939 
  1941 
  1940     // When the clients close their sub-sessions (eg. by calling RLine::Close)
  1942     // When the clients close their sub-sessions (eg. by calling RLine::Close)
  1941     // they may not have cancelled all their outstanding asynchronous requests
  1943     // they may not have cancelled all their outstanding asynchronous requests
  1970         case EMobilePhoneAuthorizationInfoPhase2:
  1972         case EMobilePhoneAuthorizationInfoPhase2:
  1971         case EMobilePhoneNotifyNetworkSecurityLevelChange:
  1973         case EMobilePhoneNotifyNetworkSecurityLevelChange:
  1972         case EMobilePhoneGetCellInfo:
  1974         case EMobilePhoneGetCellInfo:
  1973         case EMobilePhoneNotifyCellInfoChange:
  1975         case EMobilePhoneNotifyCellInfoChange:
  1974         case EMobilePhoneGetCurrentActiveUSimApplication:        
  1976         case EMobilePhoneGetCurrentActiveUSimApplication:        
       
  1977         case EMobilePhoneGetPreferredNetworksPhase1:
       
  1978         case EMobilePhoneStorePreferredNetworksList:
       
  1979         case EMobilePhoneNotifyStorePreferredNetworksListChange:
  1975         	ret = iMmNetTsy->CancelService( aIpc, aTsyReqHandle );
  1980         	ret = iMmNetTsy->CancelService( aIpc, aTsyReqHandle );
  1976             break;
  1981             break;
  1977 		// forward SS cancellations
  1982 		// forward SS cancellations
  1978         case EMobilePhoneNotifyCallForwardingStatusChange:
  1983         case EMobilePhoneNotifyCallForwardingStatusChange:
  1979         case EMobilePhoneNotifyCallForwardingActive:
  1984         case EMobilePhoneNotifyCallForwardingActive:
  2022         case EMobilePhoneSetALSLine:
  2027         case EMobilePhoneSetALSLine:
  2023         case EMobilePhoneSetFdnSetting:
  2028         case EMobilePhoneSetFdnSetting:
  2024         case EMobilePhoneNotifyDefaultPrivacyChange:
  2029         case EMobilePhoneNotifyDefaultPrivacyChange:
  2025         case EMobilePhoneSetDefaultPrivacy:
  2030         case EMobilePhoneSetDefaultPrivacy:
  2026         case EMobilePhoneTerminateAllCalls:
  2031         case EMobilePhoneTerminateAllCalls:
  2027         case EMobilePhoneTerminateActiveCalls:
       
  2028         case EMobilePhoneSetNetworkSelectionSetting:        
  2032         case EMobilePhoneSetNetworkSelectionSetting:        
  2029             ret = KErrNone;
  2033             ret = KErrNone;
  2030             break;
  2034             break;
  2031 
  2035 
  2032         //Cancel methods that are not supported.
  2036         //Cancel methods that are not supported.
  2443 // Terminates all calls simultaneously.
  2447 // Terminates all calls simultaneously.
  2444 // ---------------------------------------------------------------------------
  2448 // ---------------------------------------------------------------------------
  2445 //
  2449 //
  2446 TInt CMmPhoneTsy::TerminateAllCallsL(const TTsyReqHandle aTsyReqHandle)
  2450 TInt CMmPhoneTsy::TerminateAllCallsL(const TTsyReqHandle aTsyReqHandle)
  2447 	{
  2451 	{
  2448 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_TERMINATEALLCALLSL_1, "TSY: CMmPhoneTsy::TerminateAllCalls");
  2452 TFLOGSTRING("TSY: CMmPhoneTsy::TerminateAllCalls");
  2449 
  2453 
  2450 	// Check if some other client has already requested this
  2454 	// Check if some other client has already requested this
  2451 	TTsyReqHandle reqHandle = iTsyReqHandleStore->GetTsyReqHandle(EMultimodePhoneTerminateAllCalls);
  2455 	TTsyReqHandle reqHandle = iTsyReqHandleStore->GetTsyReqHandle(EMultimodePhoneTerminateAllCalls);
  2452 	
  2456 	
  2453 	if (EMultimodePhoneReqHandleUnknown >= reqHandle )
  2457 	if (EMultimodePhoneReqHandleUnknown >= reqHandle )
  2493             ReqCompleted( aTsyReqHandle, KErrNone );
  2497             ReqCompleted( aTsyReqHandle, KErrNone );
  2494             }   
  2498             }   
  2495 		}
  2499 		}
  2496 	else
  2500 	else
  2497 		{
  2501 		{
  2498 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_TERMINATEALLCALLSL_2, "TSY: CMmPhoneTsy::TerminateAllCalls - Already requested");
  2502 TFLOGSTRING("TSY: CMmPhoneTsy::TerminateAllCalls - Already requested");
  2499 		ReqCompleted( aTsyReqHandle, KErrServerBusy );
  2503 		ReqCompleted( aTsyReqHandle, KErrServerBusy );
  2500 		}
  2504 		}
  2501 	return KErrNone;
  2505 	return KErrNone;
  2502 	}
  2506 	}
  2503 
  2507 
  2510 	 if ( EMultimodePhoneReqHandleUnknown != reqHandle )
  2514 	 if ( EMultimodePhoneReqHandleUnknown != reqHandle )
  2511 	     {
  2515 	     {
  2512          ReqCompleted( reqHandle, aErrorCode );
  2516          ReqCompleted( reqHandle, aErrorCode );
  2513 	     }	 
  2517 	     }	 
  2514 	}
  2518 	}
  2515 
       
  2516 
       
  2517 // ---------------------------------------------------------------------------
       
  2518 // CMmPhoneTsy::TerminateActiveCallsL
       
  2519 // Terminates all active calls simultaneously.
       
  2520 // ---------------------------------------------------------------------------
       
  2521 //
       
  2522 TInt CMmPhoneTsy::TerminateActiveCallsL(const TTsyReqHandle aTsyReqHandle)
       
  2523     {
       
  2524 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_TERMINATEACTIVECALLSL_1, "TSY: CMmPhoneTsy::TerminateActiveCalls");
       
  2525 
       
  2526     // Check if some other client has already requested this
       
  2527     TTsyReqHandle reqHandle = iTsyReqHandleStore->GetTsyReqHandle(EMultimodePhoneTerminateActiveCalls);
       
  2528     
       
  2529     if (EMultimodePhoneReqHandleUnknown >= reqHandle )
       
  2530         {
       
  2531         // The request is not already in processing because of a previous request
       
  2532 
       
  2533         TInt err = iMessageManager->HandleRequestL(ECtsyPhoneTerminateActiveCallsReq);
       
  2534         if ( err == KErrNone )
       
  2535             {
       
  2536 #ifdef REQHANDLE_TIMER
       
  2537             SetTypeOfResponse( EMultimodePhoneTerminateActiveCalls, aTsyReqHandle );
       
  2538 #else
       
  2539             iTsyReqHandleStore->SetTsyReqHandle( 
       
  2540                     iReqHandleType, aTsyReqHandle );
       
  2541 #endif //REQHANDLE_TIMER
       
  2542             }
       
  2543         else
       
  2544             {
       
  2545             // request failed, complete with error value
       
  2546             ReqCompleted( aTsyReqHandle, err );
       
  2547             } 
       
  2548         }
       
  2549     else
       
  2550         {
       
  2551 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_TERMINATEACTIVECALLSL_2, "TSY: CMmPhoneTsy::TerminatActiveCalls - Already requested"); 
       
  2552         ReqCompleted( aTsyReqHandle, KErrServerBusy );
       
  2553         }
       
  2554     return KErrNone;
       
  2555     }
       
  2556 // ---------------------------------------------------------------------------
       
  2557 // CMmPhoneTsy::CompleteTerminateActiveCallsReq
       
  2558 // Description: Complete TerminateActiveCallsRequest
       
  2559 // ---------------------------------------------------------------------------
       
  2560 //
       
  2561 void CMmPhoneTsy::CompleteTerminateActiveCallsReq(TInt aErrorCode)
       
  2562     {
       
  2563     // Reset req handle. Returns the deleted req handle
       
  2564      TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
       
  2565          EMultimodePhoneTerminateActiveCalls );
       
  2566     
       
  2567      if ( EMultimodePhoneReqHandleUnknown != reqHandle )
       
  2568          {
       
  2569          ReqCompleted( reqHandle, aErrorCode );
       
  2570          }   
       
  2571     }
       
  2572 
  2519 
  2573 // ---------------------------------------------------------------------------
  2520 // ---------------------------------------------------------------------------
  2574 // CMmPhoneTsy::RegisterNotification
  2521 // CMmPhoneTsy::RegisterNotification
  2575 // This function is used by ETel Server to subscribe
  2522 // This function is used by ETel Server to subscribe
  2576 // notifications from DOS. Currently does not really do anything but returns
  2523 // notifications from DOS. Currently does not really do anything but returns
  2623         case EMobilePhoneNotifyAPNListChanged:
  2570         case EMobilePhoneNotifyAPNListChanged:
  2624         case EMobilePhoneNotifyAPNControlListServiceStatusChange:
  2571         case EMobilePhoneNotifyAPNControlListServiceStatusChange:
  2625         case EMobilePhoneNotifySendNetworkServiceRequest:
  2572         case EMobilePhoneNotifySendNetworkServiceRequest:
  2626         case EMobilePhoneNotifyAllSendNetworkServiceRequest:
  2573         case EMobilePhoneNotifyAllSendNetworkServiceRequest:
  2627         case EMobilePhoneNotifyCellInfoChange:
  2574         case EMobilePhoneNotifyCellInfoChange:
       
  2575         case EMobilePhoneNotifyStorePreferredNetworksListChange:
  2628             ret = KErrNone;
  2576             ret = KErrNone;
  2629             break;
  2577             break;
  2630         default:
  2578         default:
  2631             // Not supported
  2579             // Not supported
  2632             ret = KErrNotSupported;
  2580             ret = KErrNotSupported;
  2688         case EMobilePhoneNotifyAPNListChanged:
  2636         case EMobilePhoneNotifyAPNListChanged:
  2689         case EMobilePhoneNotifyAPNControlListServiceStatusChange:
  2637         case EMobilePhoneNotifyAPNControlListServiceStatusChange:
  2690         case EMobilePhoneNotifySendNetworkServiceRequest:
  2638         case EMobilePhoneNotifySendNetworkServiceRequest:
  2691         case EMobilePhoneNotifyAllSendNetworkServiceRequest:
  2639         case EMobilePhoneNotifyAllSendNetworkServiceRequest:
  2692         case EMobilePhoneNotifyCellInfoChange:
  2640         case EMobilePhoneNotifyCellInfoChange:
       
  2641 		case EMobilePhoneNotifyStorePreferredNetworksListChange:
  2693             ret = KErrNone;
  2642             ret = KErrNone;
  2694             break;
  2643             break;
  2695         default:
  2644         default:
  2696             // Not supported
  2645             // Not supported
  2697             ret = KErrNotSupported;
  2646             ret = KErrNotSupported;
  2780 TInt CMmPhoneTsy::GetPhoneStoreInfoL(
  2729 TInt CMmPhoneTsy::GetPhoneStoreInfoL(
  2781     TDes8* aInfo,
  2730     TDes8* aInfo,
  2782     const RMobilePhone::TMobileName* aStoreName )
  2731     const RMobilePhone::TMobileName* aStoreName )
  2783     {
  2732     {
  2784     TInt ret( KErrArgument );
  2733     TInt ret( KErrArgument );
  2785 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETPHONESTOREINFOL_1, "TSY: CMmPhoneTsy::GetPhoneStoreInfoL" );
  2734 TFLOGSTRING("TSY: CMmPhoneTsy::GetPhoneStoreInfoL" );
  2786     
  2735     
  2787     if(sizeof(RMobilePhoneStore::TMobilePhoneStoreInfoV1) <= aInfo->MaxLength())
  2736     if(sizeof(RMobilePhoneStore::TMobilePhoneStoreInfoV1) <= aInfo->MaxLength())
  2788       	{
  2737       	{
  2789         ret = KErrNone;
  2738         ret = KErrNone;
  2790         
  2739         
  2793           
  2742           
  2794         RMobilePhoneStore::TMobilePhoneStoreInfoV1& storeInfo = ( *info )();
  2743         RMobilePhoneStore::TMobilePhoneStoreInfoV1& storeInfo = ( *info )();
  2795              
  2744              
  2796         if ( KETelExtMultimodeV1 != storeInfo.ExtensionId() )
  2745         if ( KETelExtMultimodeV1 != storeInfo.ExtensionId() )
  2797     		{
  2746     		{
  2798 			OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETPHONESTOREINFOL_2, "TSY: Phonebook not supported. Only KETelExtMultimodeV1 types supported for RMobilePhone::GetPhoneStoreInfo" );
  2747 			TFLOGSTRING("TSY: Phonebook not supported. Only KETelExtMultimodeV1 types supported for RMobilePhone::GetPhoneStoreInfo" );
  2799     		ret = KErrNotSupported;
  2748     		ret = KErrNotSupported;
  2800     		}
  2749     		}
  2801     	else
  2750     	else
  2802     	    {
  2751     	    {
  2803     		// Not supported features
  2752     		// Not supported features
  2808     	         0x0 == aStoreName->Compare( KETelCombinedAdnPhoneBook ) || 
  2757     	         0x0 == aStoreName->Compare( KETelCombinedAdnPhoneBook ) || 
  2809     	         0x0 == aStoreName->Compare( KETelCombinedSmsStore )     || 
  2758     	         0x0 == aStoreName->Compare( KETelCombinedSmsStore )     || 
  2810     	         0x0 == aStoreName->Compare( KETelMeSmsStore )              
  2759     	         0x0 == aStoreName->Compare( KETelMeSmsStore )              
  2811     	       )
  2760     	       )
  2812     	        {
  2761     	        {
  2813 				OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETPHONESTOREINFOL_3, "TSY: Phonebook name is not supported. " );
  2762 				TFLOGSTRING("TSY: Phonebook name is not supported. " );
  2814     	        ret = KErrNotSupported;
  2763     	        ret = KErrNotSupported;
  2815     	        }
  2764     	        }
  2816     	    else
  2765     	    else
  2817     	        {
  2766     	        {
  2818     		    // packed parameter for DOS call: RMobilePhone::TMobileName
  2767     		    // packed parameter for DOS call: RMobilePhone::TMobileName
  2897 //
  2846 //
  2898 TInt CMmPhoneTsy::GetCustomerServiceProfileL(
  2847 TInt CMmPhoneTsy::GetCustomerServiceProfileL(
  2899     const TTsyReqHandle aTsyReqHandle,
  2848     const TTsyReqHandle aTsyReqHandle,
  2900     TDes8* aCspFile )
  2849     TDes8* aCspFile )
  2901     {
  2850     {
  2902 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETCUSTOMERSERVICEPROFILEL_1, "TSY: CMmPhoneTsy::GetCustomerServiceProfileL" );
  2851 TFLOGSTRING("TSY: CMmPhoneTsy::GetCustomerServiceProfileL" );
  2903     
  2852     
  2904     TInt ret = KErrArgument;
  2853     TInt ret = KErrArgument;
  2905     
  2854     
  2906     if ( sizeof( RMobilePhone::TMobilePhoneCspFileV1 ) == 
  2855     if ( sizeof( RMobilePhone::TMobilePhoneCspFileV1 ) == 
  2907          aCspFile->MaxLength() )
  2856          aCspFile->MaxLength() )
  2914         TTsyReqHandle reqHandle = iTsyReqHandleStore->GetTsyReqHandle(
  2863         TTsyReqHandle reqHandle = iTsyReqHandleStore->GetTsyReqHandle(
  2915             EMultimodePhoneGetCustomerServiceProfile );
  2864             EMultimodePhoneGetCustomerServiceProfile );
  2916 
  2865 
  2917         if ( 0 < reqHandle )
  2866         if ( 0 < reqHandle )
  2918             {
  2867             {
  2919  OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETCUSTOMERSERVICEPROFILEL_2, "TSY: CMmPhoneTsy::GetCustomerServiceProfileL one req already ongoing" );
  2868  TFLOGSTRING("TSY: CMmPhoneTsy::GetCustomerServiceProfileL one req already ongoing" );  
  2920             ret = KErrNone;
  2869             ret = KErrNone;
  2921             //The request is already in processing because of previous request
  2870             //The request is already in processing because of previous request
  2922             //Complete request with status value informing the client about
  2871             //Complete request with status value informing the client about
  2923     		TCustomerServiceProfileIdRequest* req = 
  2872     		TCustomerServiceProfileIdRequest* req = 
  2924                 new (ELeave) TCustomerServiceProfileIdRequest();
  2873                 new (ELeave) TCustomerServiceProfileIdRequest();
  2960 void CMmPhoneTsy::CompleteGetCustomerServiceProfile(
  2909 void CMmPhoneTsy::CompleteGetCustomerServiceProfile(
  2961     RMobilePhone::TMobilePhoneCspFileV1 aCspFile,
  2910     RMobilePhone::TMobilePhoneCspFileV1 aCspFile,
  2962     TInt aErrorCode )
  2911     TInt aErrorCode )
  2963     {
  2912     {
  2964 
  2913 
  2965 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETCUSTOMERSERVICEPROFILE_1, "TSY: CMmPhoneTsy::CompleteGetCustomerServiceProfile" );
  2914 TFLOGSTRING("TSY: CMmPhoneTsy::CompleteGetCustomerServiceProfile" );
  2966     
  2915     
  2967     // Check if the get was called internally during boot
  2916     // Check if the get was called internally during boot
  2968     if( iCspFileQueryInBoot )
  2917     if( iCspFileQueryInBoot )
  2969         {
  2918         {
  2970         // Examine Csp file's ALS state
  2919         // Examine Csp file's ALS state
  2993                 iCustomerServiceProfileRequests[ i ];
  2942                 iCustomerServiceProfileRequests[ i ];
  2994             
  2943             
  2995             //set value in client side
  2944             //set value in client side
  2996             *(req->iRetCspFile) = aCspFile;
  2945             *(req->iRetCspFile) = aCspFile;
  2997 			//reset the return pointer
  2946 			//reset the return pointer
  2998 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETCUSTOMERSERVICEPROFILE_2, "TSY: CMmPhoneTsy::CompleteGetCustomerServiceProfile queue handling" );
  2947 TFLOGSTRING("TSY: CMmPhoneTsy::CompleteGetCustomerServiceProfile queue handling" ); 
  2999             ReqCompleted( req->iReqHandle, aErrorCode );
  2948             ReqCompleted( req->iReqHandle, aErrorCode );
  3000 			}
  2949 			}
  3001         // Complete the client request
  2950         // Complete the client request
  3002 		//Destroy Array 
  2951 		//Destroy Array 
  3003  		iCustomerServiceProfileRequests.ResetAndDestroy();
  2952  		iCustomerServiceProfileRequests.ResetAndDestroy();
  3011 // (other items were commented in a header).
  2960 // (other items were commented in a header).
  3012 // ---------------------------------------------------------------------------
  2961 // ---------------------------------------------------------------------------
  3013 //
  2962 //
  3014 TInt CMmPhoneTsy::GetCustomerServiceProfileCancel( const TTsyReqHandle aTsyReqHandle )
  2963 TInt CMmPhoneTsy::GetCustomerServiceProfileCancel( const TTsyReqHandle aTsyReqHandle )
  3015     {
  2964     {
  3016 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETCUSTOMERSERVICEPROFILECANCEL_1, "TSY: CMmPhoneTsy::GetCustomerServiceProfileCancel aTsyReqHandle: %d", aTsyReqHandle);
  2965 TFLOGSTRING2("TSY: CMmPhoneTsy::GetCustomerServiceProfileCancel aTsyReqHandle: %d", aTsyReqHandle);   
  3017 
  2966 
  3018     TInt customerServiceProfileRequestsCount = iCustomerServiceProfileRequests.Count();
  2967     TInt customerServiceProfileRequestsCount = iCustomerServiceProfileRequests.Count();
  3019 
  2968 
  3020     //reset the req handle if only one req remains
  2969     //reset the req handle if only one req remains
  3021     if( 1 == customerServiceProfileRequestsCount )
  2970     if( 1 == customerServiceProfileRequestsCount )
  3022         {
  2971         {
  3023         OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETCUSTOMERSERVICEPROFILECANCEL_2, "TSY: CMmPhoneTsy::GetCustomerServiceProfileCancel - one req");
  2972         TFLOGSTRING("TSY: CMmPhoneTsy::GetCustomerServiceProfileCancel - one req");       
  3024         TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
  2973         TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
  3025                 EMultimodePhoneGetCustomerServiceProfile );       
  2974                 EMultimodePhoneGetCustomerServiceProfile );       
  3026         }
  2975         }
  3027 
  2976 
  3028     // go through array if one or more requests remain and find the correct request handle to cancel
  2977     // go through array if one or more requests remain and find the correct request handle to cancel
  3029     for ( TInt i=0; i < customerServiceProfileRequestsCount ; i++ )
  2978     for ( TInt i=0; i < customerServiceProfileRequestsCount ; i++ )
  3030         {
  2979         {
  3031 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETCUSTOMERSERVICEPROFILECANCEL_3, "TSY: CMmPhoneTsy::GetCustomerServiceProfileCancel - queued requests");
  2980 TFLOGSTRING("TSY: CMmPhoneTsy::GetCustomerServiceProfileCancel - queued requests");
  3032 
  2981 
  3033         TCustomerServiceProfileIdRequest* req =
  2982         TCustomerServiceProfileIdRequest* req =
  3034         iCustomerServiceProfileRequests[ i ];
  2983         iCustomerServiceProfileRequests[ i ];
  3035 
  2984 
  3036         // find correct handle for cancelling
  2985         // find correct handle for cancelling
  3073 //
  3022 //
  3074 TInt CMmPhoneTsy::GetBatteryInfoL(
  3023 TInt CMmPhoneTsy::GetBatteryInfoL(
  3075     const TTsyReqHandle aTsyReqHandle,
  3024     const TTsyReqHandle aTsyReqHandle,
  3076     RMobilePhone::TMobilePhoneBatteryInfoV1* aInfo )
  3025     RMobilePhone::TMobilePhoneBatteryInfoV1* aInfo )
  3077     {
  3026     {
  3078 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETBATTERYINFOL_1, "TSY: CMmPhoneTsy::GetBatteryInfoL");
  3027 TFLOGSTRING("TSY: CMmPhoneTsy::GetBatteryInfoL");
  3079 
  3028 
  3080     // Battery info is requested when phone is booted up and updated when
  3029     // Battery info is requested when phone is booted up and updated when
  3081     // EM server sends indications.
  3030     // EM server sends indications.
  3082     *aInfo = iBatteryInfo;
  3031     *aInfo = iBatteryInfo;
  3083 
  3032 
  3093 // ---------------------------------------------------------------------------
  3042 // ---------------------------------------------------------------------------
  3094 //
  3043 //
  3095 TInt CMmPhoneTsy::NotifyBatteryInfoChange(
  3044 TInt CMmPhoneTsy::NotifyBatteryInfoChange(
  3096     RMobilePhone::TMobilePhoneBatteryInfoV1* aInfo )
  3045     RMobilePhone::TMobilePhoneBatteryInfoV1* aInfo )
  3097     {
  3046     {
  3098 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_NOTIFYBATTERYINFOCHANGE_1, "TSY: CMmPhoneTsy::NotifyBatteryInfoChange");
  3047 TFLOGSTRING("TSY: CMmPhoneTsy::NotifyBatteryInfoChange");
  3099 
  3048 
  3100     iRetBatteryInfo = aInfo;
  3049     iRetBatteryInfo = aInfo;
  3101     iReqHandleType = EMultimodePhoneNotifyBatteryInfoChange;
  3050     iReqHandleType = EMultimodePhoneNotifyBatteryInfoChange;
  3102     return KErrNone;
  3051     return KErrNone;
  3103     }
  3052     }
  3111 //
  3060 //
  3112 void CMmPhoneTsy::CompleteNotifyBatteryInfoChange(
  3061 void CMmPhoneTsy::CompleteNotifyBatteryInfoChange(
  3113     CMmDataPackage* aDataPackage,
  3062     CMmDataPackage* aDataPackage,
  3114     TInt aErrorCode )
  3063     TInt aErrorCode )
  3115     {
  3064     {
  3116 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETENOTIFYBATTERYINFOCHANGE_1, "TSY: CMmPhoneTsy::CompleteNotifyBatteryInfoChange");
  3065 TFLOGSTRING("TSY: CMmPhoneTsy::CompleteNotifyBatteryInfoChange");
  3117 
  3066 
  3118     if ( KErrNone == aErrorCode )
  3067     if ( KErrNone == aErrorCode )
  3119         {
  3068         {
  3120         // unpack data...
  3069         // unpack data...
  3121         RMobilePhone::TMobilePhoneBatteryInfoV1* batteryInfo = NULL;
  3070         RMobilePhone::TMobilePhoneBatteryInfoV1* batteryInfo = NULL;
  3122         aDataPackage->UnPackData(&batteryInfo);
  3071         aDataPackage->UnPackData(&batteryInfo);
  3123         iBatteryInfo = *batteryInfo;
  3072         iBatteryInfo = *batteryInfo;
  3124         }
  3073         }
  3125 
  3074 
  3126 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETENOTIFYBATTERYINFOCHANGE_2, "TSY: CMmPhoneTsy::CompleteNotifyBatteryInfoChange, battery status: %d", (TInt)iBatteryInfo.iStatus);
  3075 TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteNotifyBatteryInfoChange, battery status: %d", (TInt)iBatteryInfo.iStatus);
  3127 
  3076 
  3128     //reset req handle. Returns the deleted req handle
  3077     //reset req handle. Returns the deleted req handle
  3129     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
  3078     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
  3130         EMultimodePhoneNotifyBatteryInfoChange );
  3079         EMultimodePhoneNotifyBatteryInfoChange );
  3131 
  3080 
  3148 // ---------------------------------------------------------------------------
  3097 // ---------------------------------------------------------------------------
  3149 //
  3098 //
  3150 TInt CMmPhoneTsy::NotifyBatteryInfoChangeCancel(
  3099 TInt CMmPhoneTsy::NotifyBatteryInfoChangeCancel(
  3151     const TTsyReqHandle aTsyReqHandle )
  3100     const TTsyReqHandle aTsyReqHandle )
  3152     {
  3101     {
  3153 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_NOTIFYBATTERYINFOCHANGECANCEL_1, "TSY: CMmPhoneTsy::NotifyBatteryInfoChangeCancel");
  3102 TFLOGSTRING("TSY: CMmPhoneTsy::NotifyBatteryInfoChangeCancel");
  3154 
  3103 
  3155     iRetBatteryInfo = NULL;
  3104     iRetBatteryInfo = NULL;
  3156     iTsyReqHandleStore->ResetTsyReqHandle( 
  3105     iTsyReqHandleStore->ResetTsyReqHandle( 
  3157         EMultimodePhoneNotifyBatteryInfoChange );
  3106         EMultimodePhoneNotifyBatteryInfoChange );
  3158 
  3107 
  3233     {
  3182     {
  3234     TInt ret = KErrNone;
  3183     TInt ret = KErrNone;
  3235     
  3184     
  3236     if ( iBootState.iSIMReady )
  3185     if ( iBootState.iSIMReady )
  3237         {
  3186         {
  3238 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETSERVICEPROVIDERNAMEL_1, "TSY: CMmPhoneTsy::GetServiceProviderNameL -Sim ready");
  3187 TFLOGSTRING("TSY: CMmPhoneTsy::GetServiceProviderNameL -Sim ready");
  3239 
  3188 
  3240         if ( sizeof( RMobilePhone::TMobilePhoneServiceProviderNameV2 ) >
  3189         if ( sizeof( RMobilePhone::TMobilePhoneServiceProviderNameV2 ) >
  3241              aName->MaxLength() )
  3190              aName->MaxLength() )
  3242             {
  3191             {
  3243 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETSERVICEPROVIDERNAMEL_2, "TSY: CMmPhoneTsy::GetServiceProviderNameL -Invalid parameter!");
  3192 TFLOGSTRING("TSY: CMmPhoneTsy::GetServiceProviderNameL -Invalid parameter!");        
  3244             ret = KErrArgument;
  3193             ret = KErrArgument;
  3245             }
  3194             }
  3246 		else
  3195 		else
  3247 		    {
  3196 		    {
  3248     	    //Send a request to LTSY if request handle does not exist.
  3197     	    //Send a request to LTSY if request handle does not exist.
  3256     	    }
  3205     	    }
  3257 
  3206 
  3258         if ( KErrNone == ret )
  3207         if ( KErrNone == ret )
  3259             {
  3208             {
  3260             // save reqhandle to queue
  3209             // save reqhandle to queue
  3261 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETSERVICEPROVIDERNAMEL_3, "TSY: CMmPhoneTsy::GetServiceProviderNameL - Client to queue");
  3210 TFLOGSTRING("TSY: CMmPhoneTsy::GetServiceProviderNameL - Client to queue");
  3262             RMobilePhone::TMobilePhoneServiceProviderNameV2Pckg* nameV2Pckg =
  3211             RMobilePhone::TMobilePhoneServiceProviderNameV2Pckg* nameV2Pckg =
  3263                 REINTERPRET_CAST( 
  3212                 REINTERPRET_CAST( 
  3264                     RMobilePhone::TMobilePhoneServiceProviderNameV2Pckg*, 
  3213                     RMobilePhone::TMobilePhoneServiceProviderNameV2Pckg*, 
  3265                         aName );
  3214                         aName );
  3266                     
  3215                     
  3277             iReqHandleType = EMultimodePhoneGetServiceProviderName;
  3226             iReqHandleType = EMultimodePhoneGetServiceProviderName;
  3278             }
  3227             }
  3279          }
  3228          }
  3280      else
  3229      else
  3281         {
  3230         {
  3282 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETSERVICEPROVIDERNAMEL_4, "TSY: CMmPhoneTsy::GetServiceProviderNameL - Sim not ready");
  3231 TFLOGSTRING("TSY: CMmPhoneTsy::GetServiceProviderNameL - Sim not ready");
  3283         ret = KErrNotReady;
  3232         ret = KErrNotReady;
  3284         }
  3233         }
  3285 
  3234 
  3286     return ret;
  3235     return ret;
  3287     }
  3236     }
  3295 //
  3244 //
  3296 void CMmPhoneTsy::CompleteGetServiceProviderName(
  3245 void CMmPhoneTsy::CompleteGetServiceProviderName(
  3297     CMmDataPackage* aDataPackage,
  3246     CMmDataPackage* aDataPackage,
  3298     TInt aErrorCode )
  3247     TInt aErrorCode )
  3299     {
  3248     {
  3300 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETSERVICEPROVIDERNAME_1, "TSY: CMmPhoneTsy::CompleteGetServiceProviderName Error %d", aErrorCode );
  3249 TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteGetServiceProviderName Error %d", aErrorCode );
  3301    
  3250    
  3302     // reset req handle. Returns the deleted req handle
  3251     // reset req handle. Returns the deleted req handle
  3303     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
  3252     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
  3304         EMultimodePhoneGetServiceProviderName );
  3253         EMultimodePhoneGetServiceProviderName );
  3305 
  3254 
  3310         
  3259         
  3311         if ( KErrNone == aErrorCode )
  3260         if ( KErrNone == aErrorCode )
  3312             {
  3261             {
  3313             aDataPackage->UnPackData( &name );
  3262             aDataPackage->UnPackData( &name );
  3314 
  3263 
  3315 OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETSERVICEPROVIDERNAME_2, "TSY: CMmPhoneTsy::CompleteGetServiceProviderName name: %S", name->iSPName );
  3264 TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteGetServiceProviderName name: %S", &name->iSPName );
  3316 		    for ( TInt i=0; i < requestCount ; i++ )
  3265 		    for ( TInt i=0; i < requestCount ; i++ )
  3317 		        {
  3266 		        {
  3318 		        TServiceProviderNameRequest* req = 
  3267 		        TServiceProviderNameRequest* req = 
  3319 		            iServiceProviderNameRequests[ i ];
  3268 		            iServiceProviderNameRequests[ i ];
  3320 		        *(req->iServiceProviderName) = *name;
  3269 		        *(req->iServiceProviderName) = *name;
  3321 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETSERVICEPROVIDERNAME_3, "TSY: CMmPhoneTsy::CompleteGetServiceProviderName client %d", i );
  3270 TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteGetServiceProviderName client %d", i );
  3322 		        ReqCompleted( req->iReqHandle, aErrorCode );
  3271 		        ReqCompleted( req->iReqHandle, aErrorCode );
  3323 		        }
  3272 		        }
  3324             }
  3273             }
  3325         else
  3274         else
  3326         	{
  3275         	{
  3327 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETSERVICEPROVIDERNAME_4, "TSY: CMmPhoneTsy::CompleteGetServiceProviderName Error %d", aErrorCode );
  3276 TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteGetServiceProviderName Error %d", aErrorCode );
  3328         	for ( TInt i=0; i < requestCount ; i++ )
  3277         	for ( TInt i=0; i < requestCount ; i++ )
  3329 		        {
  3278 		        {
  3330 		        TServiceProviderNameRequest* req = 
  3279 		        TServiceProviderNameRequest* req = 
  3331 		            iServiceProviderNameRequests[ i ];
  3280 		            iServiceProviderNameRequests[ i ];
  3332 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETSERVICEPROVIDERNAME_5, "TSY: CMmPhoneTsy::CompleteGetServiceProviderName Error queue: %d", i );
  3281 TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteGetServiceProviderName Error queue: %d", i );
  3333 		        ReqCompleted( req->iReqHandle, aErrorCode );
  3282 		        ReqCompleted( req->iReqHandle, aErrorCode );
  3334 		        }	
  3283 		        }	
  3335         	}
  3284         	}
  3336         //Delete array and it's content	
  3285         //Delete array and it's content	
  3337         iServiceProviderNameRequests.ResetAndDestroy();
  3286         iServiceProviderNameRequests.ResetAndDestroy();
  3346 // (other items were commented in a header).
  3295 // (other items were commented in a header).
  3347 // ---------------------------------------------------------------------------
  3296 // ---------------------------------------------------------------------------
  3348 //
  3297 //
  3349 TInt CMmPhoneTsy::GetServiceProviderNameCancel( const TTsyReqHandle aTsyReqHandle )
  3298 TInt CMmPhoneTsy::GetServiceProviderNameCancel( const TTsyReqHandle aTsyReqHandle )
  3350     {
  3299     {
  3351     OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETSERVICEPROVIDERNAMECANCEL_1, "TSY: CMmPhoneTsy::GetServiceProviderNameCancel aTsyReqHandle: %d", aTsyReqHandle);
  3300     TFLOGSTRING2("TSY: CMmPhoneTsy::GetServiceProviderNameCancel aTsyReqHandle: %d", aTsyReqHandle);   
  3352 
  3301 
  3353     TInt requestCount = iServiceProviderNameRequests.Count();
  3302     TInt requestCount = iServiceProviderNameRequests.Count();
  3354     
  3303     
  3355     //reset the req handle if only one req remains
  3304     //reset the req handle if only one req remains
  3356     if( 1 == requestCount )
  3305     if( 1 == requestCount )
  3357         {
  3306         {
  3358         OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETSERVICEPROVIDERNAMECANCEL_2, "TSY: CMmPhoneTsy::GetCustomerServiceProfileCancel - one req");
  3307         TFLOGSTRING("TSY: CMmPhoneTsy::GetCustomerServiceProfileCancel - one req");       
  3359         TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
  3308         TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
  3360                 EMultimodePhoneGetServiceProviderName );       
  3309                 EMultimodePhoneGetServiceProviderName );       
  3361         }
  3310         }
  3362 
  3311 
  3363     // qo throw array if several requests and find correct reqhandle to cancel
  3312     // qo throw array if several requests and find correct reqhandle to cancel
  3364     for ( TInt i = 0; i < requestCount; i++ )
  3313     for ( TInt i = 0; i < requestCount; i++ )
  3365         {
  3314         {
  3366         OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETSERVICEPROVIDERNAMECANCEL_3, "TSY: CMmPhoneTsy::GetServiceProviderNameCancel - queued requests");
  3315         TFLOGSTRING("TSY: CMmPhoneTsy::GetServiceProviderNameCancel - queued requests");
  3367 
  3316 
  3368         TServiceProviderNameRequest* req =
  3317         TServiceProviderNameRequest* req =
  3369         iServiceProviderNameRequests[i];
  3318         iServiceProviderNameRequests[i];
  3370 
  3319 
  3371         // find correct handle for cancelling
  3320         // find correct handle for cancelling
  3510 	     ReqCompleted( aTsyReqHandle, ret );
  3459 	     ReqCompleted( aTsyReqHandle, ret );
  3511 	     }
  3460 	     }
  3512       }
  3461       }
  3513    else
  3462    else
  3514       {
  3463       {
  3515       OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_DOGETPHONEIDL_1, "TSY: CMmPhoneTsy::GetPhoneIdL - iManufacturer: %S, iModel: %S", iPhoneIdentity.iManufacturer, iPhoneIdentity.iModel );
  3464       TFLOGSTRING3("TSY: CMmPhoneTsy::GetPhoneIdL - iManufacturer: %S, iModel: %S", &iPhoneIdentity.iManufacturer, 
  3516       OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_DOGETPHONEIDL_2, "TSY: CMmPhoneTsy::GetPhoneIdL - iRevision: %S, iSerialNumber: %S", iPhoneIdentity.iRevision, iPhoneIdentity.iSerialNumber);
  3465              		                                                                      &iPhoneIdentity.iModel );             
       
  3466       TFLOGSTRING3("TSY: CMmPhoneTsy::GetPhoneIdL - iRevision: %S, iSerialNumber: %S", &iPhoneIdentity.iRevision, 
       
  3467              		                                                                         &iPhoneIdentity.iSerialNumber);
  3517      	  
  3468      	  
  3518 	  *aId = iPhoneIdentity;
  3469 	  *aId = iPhoneIdentity;
  3519 	  ReqCompleted( aTsyReqHandle, KErrNone );	   
  3470 	  ReqCompleted( aTsyReqHandle, KErrNone );	   
  3520       }	
  3471       }	
  3521    }
  3472    }
  3533 	if ( ( KErrNone == aError ) && ( 0 < aSerialData.Length() ) )
  3484 	if ( ( KErrNone == aError ) && ( 0 < aSerialData.Length() ) )
  3534 		{
  3485 		{
  3535         // Copy serial number
  3486         // Copy serial number
  3536         iPhoneIdentity.iSerialNumber.Copy(aSerialData.Left( aSerialData.Length() ) );
  3487         iPhoneIdentity.iSerialNumber.Copy(aSerialData.Left( aSerialData.Length() ) );
  3537         
  3488         
  3538         OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETPHONEID_1, "TSY: CMmPhoneTsy::CompletePhoneSerialNumber - iSerialNumber: %S", iPhoneIdentity.iSerialNumber );
  3489         TFLOGSTRING2("TSY: CMmPhoneTsy::CompletePhoneSerialNumber - iSerialNumber: %S", &iPhoneIdentity.iSerialNumber );
  3539         }
  3490         }
  3540 
  3491 
  3541     //reset req handle. Returns the deleted req handle
  3492     //reset req handle. Returns the deleted req handle
  3542     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(EMultimodePhoneGetPhoneId );
  3493     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(EMultimodePhoneGetPhoneId );
  3543    
  3494    
  3559 // (other items were commented in a header).
  3510 // (other items were commented in a header).
  3560 // ---------------------------------------------------------------------------
  3511 // ---------------------------------------------------------------------------
  3561 //
  3512 //
  3562 TInt CMmPhoneTsy::MobilePhoneGetPhoneIdCancel(const TTsyReqHandle aTsyReqHandle )
  3513 TInt CMmPhoneTsy::MobilePhoneGetPhoneIdCancel(const TTsyReqHandle aTsyReqHandle )
  3563     {
  3514     {
  3564     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_MOBILEPHONEGETPHONEIDCANCEL_1, "TSY: CMmPhoneTsy::MobilePhoneGetPhoneIdCancel");
  3515     TFLOGSTRING("TSY: CMmPhoneTsy::MobilePhoneGetPhoneIdCancel");    
  3565     
  3516     
  3566     TInt reqCount = iGetPhoneIdRequests.Count();
  3517     TInt reqCount = iGetPhoneIdRequests.Count();
  3567     
  3518     
  3568     // 1 means that last ongoing request is going to be cancelled.
  3519     // 1 means that last ongoing request is going to be cancelled.
  3569     if ( reqCount == 1 )
  3520     if ( reqCount == 1 )
  3633 				ReqCompleted( aTsyReqHandle, ret );
  3584 				ReqCompleted( aTsyReqHandle, ret );
  3634 				}
  3585 				}
  3635 			}
  3586 			}
  3636 		else
  3587 		else
  3637 			{
  3588 			{
  3638 			OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETSUBSCRIBERIDL_1, "TSY: CMmPhoneTsy::GetSubscriberIdL - queued requests add req to queue");
  3589 			TFLOGSTRING("TSY: CMmPhoneTsy::GetSubscriberIdL - queued requests add req to queue");
  3639 			TSubscriberIdRequest* req = new (ELeave) TSubscriberIdRequest();
  3590 			TSubscriberIdRequest* req = new (ELeave) TSubscriberIdRequest();
  3640 			req->iReqHandle = aTsyReqHandle;
  3591 			req->iReqHandle = aTsyReqHandle;
  3641 			req->iRetSubscrId = aId;
  3592 			req->iRetSubscrId = aId;
  3642 			iSubscriberIdRequests.AppendL( req );
  3593 			iSubscriberIdRequests.AppendL( req );
  3643 			}
  3594 			}
  3663     TUint32* aActCaps,
  3614     TUint32* aActCaps,
  3664     TUint32* aIndCaps )
  3615     TUint32* aIndCaps )
  3665     {
  3616     {
  3666     TInt ret( KErrGeneral );
  3617     TInt ret( KErrGeneral );
  3667 
  3618 
  3668 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETINDICATORCAPS_1, "TSY: CMmPhoneTsy::GetIndicatorCaps" );
  3619 TFLOGSTRING("TSY: CMmPhoneTsy::GetIndicatorCaps" );
  3669     if(	 NULL != aActCaps && NULL != aIndCaps )
  3620     if(	 NULL != aActCaps && NULL != aIndCaps )
  3670     	{
  3621     	{
  3671     	*aActCaps = RMobilePhone::KCapsGetIndicator | 
  3622     	*aActCaps = RMobilePhone::KCapsGetIndicator | 
  3672             RMobilePhone::KCapsNotifyIndicatorChange; 
  3623             RMobilePhone::KCapsNotifyIndicatorChange; 
  3673     	*aIndCaps = RMobilePhone::KIndChargerConnected | 
  3624     	*aIndCaps = RMobilePhone::KIndChargerConnected | 
  3689 //
  3640 //
  3690 TInt CMmPhoneTsy::GetIndicators(
  3641 TInt CMmPhoneTsy::GetIndicators(
  3691     const TTsyReqHandle aTsyReqHandle,
  3642     const TTsyReqHandle aTsyReqHandle,
  3692     TUint32* aIndicators )
  3643     TUint32* aIndicators )
  3693     {
  3644     {
  3694 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETINDICATORS_1,  "TSY: CMmPhoneTsy::GetIndicators" );
  3645 TFLOGSTRING( "TSY: CMmPhoneTsy::GetIndicators" );
  3695     TInt ret( KErrGeneral );
  3646     TInt ret( KErrGeneral );
  3696 
  3647 
  3697     if( aIndicators )
  3648     if( aIndicators )
  3698     	{
  3649     	{
  3699     	*aIndicators = GetIndicatorState();
  3650     	*aIndicators = GetIndicatorState();
  3714 TUint32 CMmPhoneTsy::GetIndicatorState()
  3665 TUint32 CMmPhoneTsy::GetIndicatorState()
  3715 	{
  3666 	{
  3716 	TUint32 indicators( 0 );
  3667 	TUint32 indicators( 0 );
  3717 
  3668 
  3718 	//Charger connected?
  3669 	//Charger connected?
  3719 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETINDICATORSTATE_1,  "TSY: CMmPhoneTsy::GetIndicatorState charger: %d", (TInt)iBatteryInfo.iStatus );
  3670 TFLOGSTRING2( "TSY: CMmPhoneTsy::GetIndicatorState charger: %d", (TInt)iBatteryInfo.iStatus );
  3720 	if( RMobilePhone::EBatteryConnectedButExternallyPowered == 
  3671 	if( RMobilePhone::EBatteryConnectedButExternallyPowered == 
  3721         iBatteryInfo.iStatus )
  3672         iBatteryInfo.iStatus )
  3722 		{
  3673 		{
  3723 		indicators |= RMobilePhone::KIndChargerConnected;
  3674 		indicators |= RMobilePhone::KIndChargerConnected;
  3724 		}
  3675 		}
  3731 		if( RMobilePhone::ERegisteredOnHomeNetwork == networkRegStatus || 
  3682 		if( RMobilePhone::ERegisteredOnHomeNetwork == networkRegStatus || 
  3732             RMobilePhone::ERegisteredRoaming == networkRegStatus )
  3683             RMobilePhone::ERegisteredRoaming == networkRegStatus )
  3733 			{
  3684 			{
  3734 			indicators |= RMobilePhone::KIndNetworkAvailable;
  3685 			indicators |= RMobilePhone::KIndNetworkAvailable;
  3735 			}
  3686 			}
  3736 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETINDICATORSTATE_2,  "TSY: CMmPhoneTsy::GetIndicatorState network: %d", (TInt)networkRegStatus );
  3687 TFLOGSTRING2( "TSY: CMmPhoneTsy::GetIndicatorState network: %d", (TInt)networkRegStatus );
  3737 		}
  3688 		}
  3738 
  3689 
  3739 	//Call in progress?
  3690 	//Call in progress?
  3740 	//-Browses through the call list to find any calls that are currently 
  3691 	//-Browses through the call list to find any calls that are currently 
  3741     //connected
  3692     //connected
  3743 	for ( TInt i=0; i<numberOfCallObjects; i++ )
  3694 	for ( TInt i=0; i<numberOfCallObjects; i++ )
  3744     	{
  3695     	{
  3745 		CMmCallTsy* mmCall = CallList()->GetMmCallByIndex( i );
  3696 		CMmCallTsy* mmCall = CallList()->GetMmCallByIndex( i );
  3746 		if ( RMobileCall::EStatusConnected == mmCall->MobileCallStatus() )
  3697 		if ( RMobileCall::EStatusConnected == mmCall->MobileCallStatus() )
  3747 			{
  3698 			{
  3748 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETINDICATORSTATE_3,  "TSY: CMmPhoneTsy::GetIndicatorState call id: %d, status: %d", mmCall->CallId(), (TInt)mmCall->MobileCallStatus() );
  3699 TFLOGSTRING3( "TSY: CMmPhoneTsy::GetIndicatorState call id: %d, status: %d", mmCall->CallId(), (TInt)mmCall->MobileCallStatus() );
  3749 			indicators |= RMobilePhone::KIndCallInProgress;
  3700 			indicators |= RMobilePhone::KIndCallInProgress;
  3750 			break;
  3701 			break;
  3751 			}
  3702 			}
  3752 		}
  3703 		}
  3753 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETINDICATORSTATE_4,  "TSY: CMmPhoneTsy::GetIndicatorState - ok, Indicators: %d", indicators );
  3704 TFLOGSTRING2( "TSY: CMmPhoneTsy::GetIndicatorState - ok, Indicators: %d", indicators );
  3754 
  3705 
  3755     return indicators;
  3706     return indicators;
  3756 	}
  3707 	}
  3757 
  3708 
  3758 // ---------------------------------------------------------------------------
  3709 // ---------------------------------------------------------------------------
  3763 //
  3714 //
  3764 void CMmPhoneTsy::CompleteGetSubscriberIdL(
  3715 void CMmPhoneTsy::CompleteGetSubscriberIdL(
  3765     TBuf8<RMobilePhone::KIMSISize> aImsiData,
  3716     TBuf8<RMobilePhone::KIMSISize> aImsiData,
  3766     TInt aError )
  3717     TInt aError )
  3767     {
  3718     {
  3768 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETSUBSCRIBERIDL_1, "TSY: CMmPhoneTsy::CompleteGetSubscriberIdL, aError=%d", aError );
  3719 TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteGetSubscriberIdL, aError=%d", aError );
  3769 
  3720 
  3770     // Set the flag to EFalse
  3721     // Set the flag to EFalse
  3771     iTSYSubscriberIdReq = EFalse;
  3722     iTSYSubscriberIdReq = EFalse;
  3772     
  3723     
  3773     RMobilePhone::TMobilePhoneSubscriberId subscriberIdTmp;
  3724     RMobilePhone::TMobilePhoneSubscriberId subscriberIdTmp;
  3774     subscriberIdTmp.Zero();  
  3725     subscriberIdTmp.Zero();  
  3775   
  3726   
  3776     // Retrieve previous IMSI value from the Central Repository
  3727     // Retrieve previous IMSI value from the Central Repository
  3777 	iCFISPrivateCentRep->Get( KCtsyIMSI, subscriberIdTmp );
  3728 	iCFISPrivateCentRep->Get( KCtsyIMSI, subscriberIdTmp );
  3778 OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETSUBSCRIBERIDL_2, "TSY: CMmPhoneTsy::CompleteGetSubscriberIdL - Get old IMSI from CenRep: %S", subscriberIdTmp );
  3729 TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteGetSubscriberIdL - Get old IMSI from CenRep: %S", &subscriberIdTmp );
  3779 	
  3730 	
  3780     if ( ( KErrNone == aError ) && ( 0 < aImsiData.Length() ) )
  3731     if ( ( KErrNone == aError ) && ( 0 < aImsiData.Length() ) )
  3781         {
  3732         {
  3782         // Copy new IMSI value to the member variable
  3733         // Copy new IMSI value to the member variable
  3783         iSubscriberId.Copy( aImsiData.Left( aImsiData.Length() ) );
  3734         iSubscriberId.Copy( aImsiData.Left( aImsiData.Length() ) );
  3784 OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETSUBSCRIBERIDL_3, "TSY: CMmPhoneTsy::CompleteGetSubscriberIdL - Copy new IMSI: %S", iSubscriberId );
  3735 TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteGetSubscriberIdL - Copy new IMSI: %S", &iSubscriberId );
  3785         }
  3736         }
  3786     
  3737     
  3787     // check the boot state security, is the security ready (PIN query)
  3738     // check the boot state security, is the security ready (PIN query)
  3788     if ( iBootState.iSecReady )
  3739     if ( iBootState.iSecReady )
  3789         {
  3740         {
  3790 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETSUBSCRIBERIDL_4, "TSY: CMmPhoneTsy::CompleteGetSubscriberIdL - Security ready");
  3741 TFLOGSTRING("TSY: CMmPhoneTsy::CompleteGetSubscriberIdL - Security ready");
  3791   
  3742   
  3792         // Check has the IMSI changed and is there previous info: or an error
  3743         // Check has the IMSI changed and is there previous info: or an error
  3793         if ( KErrNotFound == subscriberIdTmp.Match( iSubscriberId ) && 
  3744         if ( KErrNotFound == subscriberIdTmp.Match( iSubscriberId ) && 
  3794         	subscriberIdTmp.Length() != 0 ||
  3745         	subscriberIdTmp.Length() != 0 ||
  3795         	KErrNone != aError )     
  3746         	KErrNone != aError )     
  3802             iMWISCentRep->Reset();
  3753             iMWISCentRep->Reset();
  3803             //Reset private side CR
  3754             //Reset private side CR
  3804             iCFISPrivateCentRep->Reset();
  3755             iCFISPrivateCentRep->Reset();
  3805             // Reset MWIS support
  3756             // Reset MWIS support
  3806             iMmSupplServTsy->SetIccSupportForMWIS( ETrue );   
  3757             iMmSupplServTsy->SetIccSupportForMWIS( ETrue );   
  3807 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETSUBSCRIBERIDL_5, "TSY: CMmPhoneTsy::CompleteGetSubscriberIdL - Central Repositories have been reseted!");
  3758 TFLOGSTRING("TSY: CMmPhoneTsy::CompleteGetSubscriberIdL - Central Repositories have been reseted!");     
  3808             
  3759             
  3809             // intialize the previous SIM related data
  3760             // intialize the previous SIM related data
  3810             if ( iMmCustomTsy )
  3761             if ( iMmCustomTsy )
  3811                 { 
  3762                 { 
  3812                 iMmCustomTsy->SetIccCfBootUpFlag( ETrue );
  3763                 iMmCustomTsy->SetIccCfBootUpFlag( ETrue );
  3814             iMmSupplServTsy->SetIccMwisBootUpFlag( ETrue );
  3765             iMmSupplServTsy->SetIccMwisBootUpFlag( ETrue );
  3815             
  3766             
  3816             // get new infromation from lower levels, if sim is ready
  3767             // get new infromation from lower levels, if sim is ready
  3817             if ( iBootState.iSIMReady )
  3768             if ( iBootState.iSIMReady )
  3818                 {                       
  3769                 {                       
  3819 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETSUBSCRIBERIDL_6, "TSY: CMmPhoneTsy::CompleteGetSubscriberIdL - SIM ready, retrive intial ICC SIM data.");
  3770 TFLOGSTRING("TSY: CMmPhoneTsy::CompleteGetSubscriberIdL - SIM ready, retrive intial ICC SIM data."); 
  3820 
  3771 
  3821                 // update ALS line information 
  3772                 // update ALS line information 
  3822                 iMessageManager->HandleRequestL( EMobilePhoneGetALSLine );
  3773                 iMessageManager->HandleRequestL( EMobilePhoneGetALSLine );
  3823                 // update call forward information
  3774                 // update call forward information
  3824                 iMessageManager->HandleRequestL( 
  3775                 iMessageManager->HandleRequestL( 
  3837         ( 0 < aImsiData.Length() ) && 
  3788         ( 0 < aImsiData.Length() ) && 
  3838         KErrNotFound == subscriberIdTmp.Match( iSubscriberId ) )
  3789         KErrNotFound == subscriberIdTmp.Match( iSubscriberId ) )
  3839         {    
  3790         {    
  3840     	// Write new IMSI value to the central repository
  3791     	// Write new IMSI value to the central repository
  3841     	iCFISPrivateCentRep->Set( KCtsyIMSI, iSubscriberId );
  3792     	iCFISPrivateCentRep->Set( KCtsyIMSI, iSubscriberId );
  3842 OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETSUBSCRIBERIDL_7, "TSY: CMmPhoneTsy::CompleteGetSubscriberIdL - Write new IMSI to the CenRep: %S", iSubscriberId );
  3793 TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteGetSubscriberIdL - Write new IMSI to the CenRep: %S", &iSubscriberId );
  3843         }
  3794         }
  3844         
  3795         
  3845     //reset req handle. Returns the deleted req handle
  3796     //reset req handle. Returns the deleted req handle
  3846     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
  3797     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
  3847         EMultimodePhoneGetSubscriberId );
  3798         EMultimodePhoneGetSubscriberId );
  3898 //
  3849 //
  3899 TInt CMmPhoneTsy::GetALSLineL(
  3850 TInt CMmPhoneTsy::GetALSLineL(
  3900     const TTsyReqHandle aTsyReqHandle,
  3851     const TTsyReqHandle aTsyReqHandle,
  3901     RMobilePhone::TMobilePhoneALSLine* aALSLine )
  3852     RMobilePhone::TMobilePhoneALSLine* aALSLine )
  3902     {
  3853     {
  3903 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETALSLINEL_1, "TSY: CMmPhoneTsy::GetALSLineL");
  3854 TFLOGSTRING("TSY: CMmPhoneTsy::GetALSLineL");
  3904 	
  3855 	
  3905     TInt ret ( KErrNone );
  3856     TInt ret ( KErrNone );
  3906 	TBool alsSupportedBySim;
  3857 	TBool alsSupportedBySim;
  3907 	
  3858 	
  3908 	//Get als  support info
  3859 	//Get als  support info
  4014 //
  3965 //
  4015 void CMmPhoneTsy::CompleteGetAlsLine(
  3966 void CMmPhoneTsy::CompleteGetAlsLine(
  4016     RMobilePhone::TMobilePhoneALSLine aAlsStatus,
  3967     RMobilePhone::TMobilePhoneALSLine aAlsStatus,
  4017     TInt aErrorCode )
  3968     TInt aErrorCode )
  4018     {
  3969     {
  4019 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETALSLINE_1, "TSY: CMmPhoneTsy::CompleteGetAlsLine - ALS line" );
  3970 TFLOGSTRING("TSY: CMmPhoneTsy::CompleteGetAlsLine - ALS line" );
  4020 
  3971 
  4021     //check if value has been updated
  3972     //check if value has been updated
  4022     if ( aAlsStatus != iAlsLine )
  3973     if ( aAlsStatus != iAlsLine )
  4023         {
  3974         {
  4024         //save value in tsy
  3975         //save value in tsy
  4054 //
  4005 //
  4055 TInt CMmPhoneTsy::SetALSLineL(
  4006 TInt CMmPhoneTsy::SetALSLineL(
  4056     const TTsyReqHandle aTsyReqHandle,
  4007     const TTsyReqHandle aTsyReqHandle,
  4057     RMobilePhone::TMobilePhoneALSLine* aALSLine )
  4008     RMobilePhone::TMobilePhoneALSLine* aALSLine )
  4058     {
  4009     {
  4059 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_SETALSLINEL_1, "TSY: CMmPhoneTsy::SetALSLineL");
  4010 TFLOGSTRING("TSY: CMmPhoneTsy::SetALSLineL");
  4060     TInt ret ( KErrNone );
  4011     TInt ret ( KErrNone );
  4061 	TBool alsSupportedBySim ( EFalse );
  4012 	TBool alsSupportedBySim ( EFalse );
  4062 	
  4013 	
  4063 	//Get als support info
  4014 	//Get als support info
  4064 	iCentRep->Get( KCtsyMEAlsSupported, alsSupportedBySim );
  4015 	iCentRep->Get( KCtsyMEAlsSupported, alsSupportedBySim );
  4127 // ---------------------------------------------------------------------------
  4078 // ---------------------------------------------------------------------------
  4128 //
  4079 //
  4129 void CMmPhoneTsy::CompleteSetAlsLine(
  4080 void CMmPhoneTsy::CompleteSetAlsLine(
  4130     TInt aErrorCode )
  4081     TInt aErrorCode )
  4131     {
  4082     {
  4132 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETESETALSLINE_1, "TSY: CMmPhoneTsy::CompleteSetAlsLine - ALS line: %d", iTempAlsLine );
  4083 TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteSetAlsLine - ALS line: %d", iTempAlsLine );
  4133 
  4084 
  4134     //reset req handle. Returns the deleted req handle
  4085     //reset req handle. Returns the deleted req handle
  4135     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
  4086     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
  4136     	EMultimodePhoneSetAlsLine );
  4087     	EMultimodePhoneSetAlsLine );
  4137 
  4088 
  4216 //
  4167 //
  4217 TInt CMmPhoneTsy::GetFdnStatusL(
  4168 TInt CMmPhoneTsy::GetFdnStatusL(
  4218     const TTsyReqHandle aTsyReqHandle,
  4169     const TTsyReqHandle aTsyReqHandle,
  4219     RMobilePhone::TMobilePhoneFdnStatus* aFdnStatus )
  4170     RMobilePhone::TMobilePhoneFdnStatus* aFdnStatus )
  4220     {
  4171     {
  4221 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETFDNSTATUSL_1,  "TSY: CMmPhoneTsy::GetFdnStatusL" );
  4172 TFLOGSTRING( "TSY: CMmPhoneTsy::GetFdnStatusL" );
  4222 
  4173 
  4223     TInt ret ( KErrServerBusy );
  4174     TInt ret ( KErrServerBusy );
  4224 
  4175 
  4225     //check if handle is not in use already
  4176     //check if handle is not in use already
  4226     TTsyReqHandle phoneSetLockSettingHandle =
  4177     TTsyReqHandle phoneSetLockSettingHandle =
  4260 //
  4211 //
  4261 void CMmPhoneTsy::CompleteGetFdnStatus(
  4212 void CMmPhoneTsy::CompleteGetFdnStatus(
  4262         CMmDataPackage* aDataPackage,
  4213         CMmDataPackage* aDataPackage,
  4263         TInt aErrorCode )
  4214         TInt aErrorCode )
  4264     {
  4215     {
  4265 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETFDNSTATUS_1, "TSY: CMmPhoneTsy::CompleteGetFdnStatus - Error: %d", aErrorCode );
  4216 TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteGetFdnStatus - Error: %d", aErrorCode );
  4266 
  4217 
  4267 
  4218 
  4268     //reset req handle. Returns the deleted req handle
  4219     //reset req handle. Returns the deleted req handle
  4269     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
  4220     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
  4270                                 EMultimodePhoneGetFdnStatus );
  4221                                 EMultimodePhoneGetFdnStatus );
  4293 // ---------------------------------------------------------------------------
  4244 // ---------------------------------------------------------------------------
  4294 //
  4245 //
  4295 TInt CMmPhoneTsy::GetFdnStatusCancel(
  4246 TInt CMmPhoneTsy::GetFdnStatusCancel(
  4296     const TTsyReqHandle aTsyReqHandle )
  4247     const TTsyReqHandle aTsyReqHandle )
  4297     {
  4248     {
  4298 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETFDNSTATUSCANCEL_1,  "TSY: CMmPhoneTsy::GetFdnStatusCancel" );
  4249 TFLOGSTRING( "TSY: CMmPhoneTsy::GetFdnStatusCancel" );
  4299     iRetGetFdnStatus = NULL;
  4250     iRetGetFdnStatus = NULL;
  4300     
  4251     
  4301     iTsyReqHandleStore->ResetTsyReqHandle( EMultimodePhoneGetFdnStatus );
  4252     iTsyReqHandleStore->ResetTsyReqHandle( EMultimodePhoneGetFdnStatus );
  4302     
  4253     
  4303     ReqCompleted( aTsyReqHandle, KErrCancel );
  4254     ReqCompleted( aTsyReqHandle, KErrCancel );
  4343 // ---------------------------------------------------------------------------
  4294 // ---------------------------------------------------------------------------
  4344 //
  4295 //
  4345 void CMmPhoneTsy::CompleteSetFdnSettingL(
  4296 void CMmPhoneTsy::CompleteSetFdnSettingL(
  4346     TInt aErrorCode )
  4297     TInt aErrorCode )
  4347     {
  4298     {
  4348 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETESETFDNSETTINGL_1, "TSY: CMmPhoneTsy::CompleteSetFdnSettingL - Error: %d",aErrorCode);
  4299 TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteSetFdnSettingL - Error: %d",
       
  4300     aErrorCode);
  4349 
  4301 
  4350     //reset req handle. Returns the deleted req handle
  4302     //reset req handle. Returns the deleted req handle
  4351     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
  4303     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
  4352                                 EMultimodePhoneSetFdnSetting );
  4304                                 EMultimodePhoneSetFdnSetting );
  4353 
  4305 
  4600 
  4552 
  4601     // 2G SIM
  4553     // 2G SIM
  4602     if ( CMmPhoneGsmWcdmaExt::EICCTypeSim2GGsm ==  currentIccType)
  4554     if ( CMmPhoneGsmWcdmaExt::EICCTypeSim2GGsm ==  currentIccType)
  4603         {
  4555         {
  4604         *aCaps = RMobilePhone::KCapsSimAccessSupported;
  4556         *aCaps = RMobilePhone::KCapsSimAccessSupported;
  4605 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETICCACCESSCAPS_1, "TSY: CMmPhoneTsy::GetIccAccessCaps: aCaps = KCapsSimAccessSupported.");
  4557 TFLOGSTRING("TSY: CMmPhoneTsy::GetIccAccessCaps: aCaps = KCapsSimAccessSupported.");
  4606         }
  4558         }
  4607     // 3G USIM
  4559     // 3G USIM
  4608     else if ( CMmPhoneGsmWcdmaExt::EICCTypeSim3G == currentIccType )
  4560     else if ( CMmPhoneGsmWcdmaExt::EICCTypeSim3G == currentIccType )
  4609         {
  4561         {
  4610         *aCaps = RMobilePhone::KCapsUSimAccessSupported +
  4562         *aCaps = RMobilePhone::KCapsUSimAccessSupported +
  4611             RMobilePhone::KCapsSimAccessSupported;
  4563             RMobilePhone::KCapsSimAccessSupported;
  4612 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETICCACCESSCAPS_2, "TSY: CMmPhoneTsy::GetIccAccessCaps: aCaps = KCapsUSimAccessSupported + KCapsSimAccessSupported.");
  4564 TFLOGSTRING("TSY: CMmPhoneTsy::GetIccAccessCaps: aCaps = KCapsUSimAccessSupported + KCapsSimAccessSupported.");
  4613         }
  4565         }
  4614     ReqCompleted( aTsyReqHandle, ret );
  4566     ReqCompleted( aTsyReqHandle, ret );
  4615 
  4567 
  4616     return KErrNone;
  4568     return KErrNone;
  4617     }
  4569     }
  4671 
  4623 
  4672         switch ( iMmPhoneExtInterface->CurrentICCType() )
  4624         switch ( iMmPhoneExtInterface->CurrentICCType() )
  4673             {
  4625             {
  4674             case CMmPhoneGsmWcdmaExt::EICCTypeSim2GGsm:     // 2G SIM
  4626             case CMmPhoneGsmWcdmaExt::EICCTypeSim2GGsm:     // 2G SIM
  4675                 *iICCCaps = RMobilePhone::KCapsSimAccessSupported;
  4627                 *iICCCaps = RMobilePhone::KCapsSimAccessSupported;
  4676 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETENOTIFYICCACCESSCAPSCHANGE_1, "TSY: CMmPhoneTsy::CompleteNotifyIccAccessCapsChange: KCapsSimAccessSupported.");
  4628 TFLOGSTRING("TSY: CMmPhoneTsy::CompleteNotifyIccAccessCapsChange: KCapsSimAccessSupported.");
  4677                 break;
  4629                 break;
  4678             case CMmPhoneGsmWcdmaExt::EICCTypeSim3G:   // 3G USIM
  4630             case CMmPhoneGsmWcdmaExt::EICCTypeSim3G:   // 3G USIM
  4679                 *iICCCaps = RMobilePhone::KCapsUSimAccessSupported;
  4631                 *iICCCaps = RMobilePhone::KCapsUSimAccessSupported;
  4680 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETENOTIFYICCACCESSCAPSCHANGE_2, "TSY: CMmPhoneTsy::CompleteNotifyIccAccessCapsChange: KCapsUSimAccessSupported.");
  4632 TFLOGSTRING("TSY: CMmPhoneTsy::CompleteNotifyIccAccessCapsChange: KCapsUSimAccessSupported.");
  4681                 break;
  4633                 break;
  4682 
  4634 
  4683             default:
  4635             default:
  4684                 *iICCCaps = 0x0;
  4636                 *iICCCaps = 0x0;
  4685 
  4637 
  4720             serviceTableV1 = &( ( *serviceTableV1Pckg ) () );
  4672             serviceTableV1 = &( ( *serviceTableV1Pckg ) () );
  4721     
  4673     
  4722         ret = GetServiceTableL( aTsyReqHandle, aTable, serviceTableV1 );
  4674         ret = GetServiceTableL( aTsyReqHandle, aTable, serviceTableV1 );
  4723         }
  4675         }
  4724 
  4676 
  4725 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETSERVICETABLECHECKPARAMETERSL_1, "TSY: CMmPhoneTsy::GetServiceTableCheckParametersL - ret:%d",ret);
  4677 TFLOGSTRING2("TSY: CMmPhoneTsy::GetServiceTableCheckParametersL - ret:%d",ret);
  4726     return ret;
  4678     return ret;
  4727     }        
  4679     }        
  4728 
  4680 
  4729 // ---------------------------------------------------------------------------
  4681 // ---------------------------------------------------------------------------
  4730 // CMmPhoneTsy::GetServiceTableL
  4682 // CMmPhoneTsy::GetServiceTableL
  4735 TInt CMmPhoneTsy::GetServiceTableL(
  4687 TInt CMmPhoneTsy::GetServiceTableL(
  4736     const TTsyReqHandle             aTsyReqHandle,
  4688     const TTsyReqHandle             aTsyReqHandle,
  4737     RMobilePhone::TMobilePhoneServiceTable* aTable,
  4689     RMobilePhone::TMobilePhoneServiceTable* aTable,
  4738     RMobilePhone::TMobilePhoneServiceTableV1* aTableData )
  4690     RMobilePhone::TMobilePhoneServiceTableV1* aTableData )
  4739     {
  4691     {
  4740 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETSERVICETABLEL_1, "TSY: CMmPhoneTsy::GetServiceTableL - Handle:%d", aTsyReqHandle);
  4692 TFLOGSTRING2("TSY: CMmPhoneTsy::GetServiceTableL - Handle:%d", aTsyReqHandle);
  4741     TInt ret( KErrServerBusy );
  4693     TInt ret( KErrServerBusy );
  4742 
  4694 
  4743     TTsyReqHandle serviceTableHandle =
  4695     TTsyReqHandle serviceTableHandle =
  4744         iTsyReqHandleStore->GetTsyReqHandle( EMultimodePhoneGetServiceTable );
  4696         iTsyReqHandleStore->GetTsyReqHandle( EMultimodePhoneGetServiceTable );
  4745 
  4697 
  4790         if ( KErrNone == ret )
  4742         if ( KErrNone == ret )
  4791             {
  4743             {
  4792             // if SIM is not ready, store request and complete it when SIM is ready
  4744             // if SIM is not ready, store request and complete it when SIM is ready
  4793             if ( !iBootState.iSIMReady )
  4745             if ( !iBootState.iSIMReady )
  4794 		        {
  4746 		        {
  4795 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETSERVICETABLEL_2, "TSY: CMmPhoneTsy::GetServiceTableL - request when SIM not ready - store req" );
  4747 TFLOGSTRING("TSY: CMmPhoneTsy::GetServiceTableL - request when SIM not ready - store req" );
  4796 		    	TServiceTableRequests* req = new (ELeave) TServiceTableRequests();
  4748 		    	TServiceTableRequests* req = new (ELeave) TServiceTableRequests();
  4797 		    	req->iReqHandle = aTsyReqHandle;
  4749 		    	req->iReqHandle = aTsyReqHandle;
  4798 		    	req->iTable = aTable;
  4750 		    	req->iTable = aTable;
  4799 		    	req->iTableData = aTableData;
  4751 		    	req->iTableData = aTableData;
  4800 		    	iServiceTableRequests.Append( req );
  4752 		    	iServiceTableRequests.Append( req );
  4802 		    else
  4754 		    else
  4803             {
  4755             {
  4804             if( RMobilePhone::ESIMServiceTable == 
  4756             if( RMobilePhone::ESIMServiceTable == 
  4805                     *aTable && iServiceTableDataCache )
  4757                     *aTable && iServiceTableDataCache )
  4806             	{
  4758             	{
  4807 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETSERVICETABLEL_3, "TSY: CMmPhoneTsy::GetServiceTableL ESIMServiceTable returned from cache");
  4759 TFLOGSTRING("TSY: CMmPhoneTsy::GetServiceTableL ESIMServiceTable returned from cache");
  4808             	*aTableData = *iServiceTableDataCache;
  4760             	*aTableData = *iServiceTableDataCache;
  4809             	ReqCompleted( aTsyReqHandle, ret );
  4761             	ReqCompleted( aTsyReqHandle, ret );
  4810             	return KErrNone;
  4762             	return KErrNone;
  4811             	}
  4763             	}
  4812            	else if ( RMobilePhone::EUSIMServiceTable== 
  4764            	else if ( RMobilePhone::EUSIMServiceTable== 
  4813                           *aTable && iServiceTableUSIMDataCache )
  4765                           *aTable && iServiceTableUSIMDataCache )
  4814            		{
  4766            		{
  4815 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETSERVICETABLEL_4, "TSY: CMmPhoneTsy::GetServiceTableL EUSIMServiceTable returned from cache");
  4767 TFLOGSTRING("TSY: CMmPhoneTsy::GetServiceTableL EUSIMServiceTable returned from cache");
  4816            		*aTableData = *iServiceTableUSIMDataCache;
  4768            		*aTableData = *iServiceTableUSIMDataCache;
  4817             	ReqCompleted( aTsyReqHandle, ret );
  4769             	ReqCompleted( aTsyReqHandle, ret );
  4818             	return KErrNone;
  4770             	return KErrNone;
  4819            		}
  4771            		}
  4820             else
  4772             else
  4821             	{
  4773             	{
  4822             	if( !iSimRefreshRegisterOk && !( iServiceTableReq->iCaching ) )
  4774             	if( !iSimRefreshRegisterOk && !( iServiceTableReq->iCaching ) )
  4823             		{
  4775             		{
  4824 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETSERVICETABLEL_5, "TSY: CMmPhoneTsy::GetServiceTableL sim refresh registration failed - possible old data - cache and complete ");
  4776 TFLOGSTRING("TSY: CMmPhoneTsy::GetServiceTableL sim refresh registration failed - possible old data - cache and complete ");
  4825             		//Store reguest parameters for completion
  4777             		//Store reguest parameters for completion
  4826             		iServiceTableReq->iReqHandle = aTsyReqHandle;
  4778             		iServiceTableReq->iReqHandle = aTsyReqHandle;
  4827             		iServiceTableReq->iTable = aTable;
  4779             		iServiceTableReq->iTable = aTable;
  4828 					iServiceTableReq->iTableData = aTableData;
  4780 					iServiceTableReq->iTableData = aTableData;
  4829 					iServiceTableReq->iCaching = ETrue;
  4781 					iServiceTableReq->iCaching = ETrue;
  4894 // (other items were commented in a header).
  4846 // (other items were commented in a header).
  4895 // ---------------------------------------------------------------------------
  4847 // ---------------------------------------------------------------------------
  4896 //
  4848 //
  4897 void CMmPhoneTsy::CacheServiceTablesL()
  4849 void CMmPhoneTsy::CacheServiceTablesL()
  4898 	{
  4850 	{
  4899 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_CACHESERVICETABLESL_1, "TSY: CMmPhoneTsy::CacheServiceTables.");
  4851 TFLOGSTRING("TSY: CMmPhoneTsy::CacheServiceTables.");
  4900 
  4852 
  4901 	// Start caching if it is not already ongoing
  4853 	// Start caching if it is not already ongoing
  4902 	if ( (((iSimCacheQueue && ( KCacheServiceTable & iSimCacheQueue )) )
  4854 	if ( (((iSimCacheQueue && ( KCacheServiceTable & iSimCacheQueue )) )
  4903 		&& IsRefreshOngoing()) || !IsRefreshOngoing() )
  4855 		&& IsRefreshOngoing()) || !IsRefreshOngoing() )
  4904 		{
  4856 		{
  4923 // (other items were commented in a header).
  4875 // (other items were commented in a header).
  4924 // ---------------------------------------------------------------------------
  4876 // ---------------------------------------------------------------------------
  4925 //
  4877 //
  4926 void CMmPhoneTsy::CompleteCacheServiceTablesL( const TInt aError )
  4878 void CMmPhoneTsy::CompleteCacheServiceTablesL( const TInt aError )
  4927 	{
  4879 	{
  4928 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETECACHESERVICETABLESL_1, "TSY: CMmPhoneTsy::CompleteCacheServiceTablesL Error = %d", aError);
  4880 TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteCacheServiceTablesL Error = %d", aError);
  4929 	if ( ( iSimCacheQueue && ( KCacheServiceTable & iSimCacheQueue ) ) 
  4881 	if ( ( iSimCacheQueue && ( KCacheServiceTable & iSimCacheQueue ) ) 
  4930             && IsRefreshOngoing() )
  4882             && IsRefreshOngoing() )
  4931 		{
  4883 		{
  4932 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETECACHESERVICETABLESL_2, "TSY: CMmPhoneTsy::CompleteCacheServiceTablesL");
  4884 TFLOGSTRING("TSY: CMmPhoneTsy::CompleteCacheServiceTablesL");
  4933 		CompleteCacheSimL( KCacheServiceTable, aError );
  4885 		CompleteCacheSimL( KCacheServiceTable, aError );
  4934 		}
  4886 		}
  4935 		
  4887 		
  4936 	TInt ret = KErrNone;
  4888 	TInt ret = KErrNone;
  4937 		
  4889 		
  4938 	// check pending requests and proceed if any
  4890 	// check pending requests and proceed if any
  4939     TInt serviceTableRequestsCount = iServiceTableRequests.Count();
  4891     TInt serviceTableRequestsCount = iServiceTableRequests.Count();
  4940 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETECACHESERVICETABLESL_3, "TSY: CMmPhoneTsy::CompleteCacheServiceTablesL - serviceTableRequestsCount: %d", serviceTableRequestsCount );
  4892 TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteCacheServiceTablesL - serviceTableRequestsCount: %d", serviceTableRequestsCount );
  4941 
  4893 
  4942 	 if ( serviceTableRequestsCount )
  4894 	 if ( serviceTableRequestsCount )
  4943 	 	{
  4895 	 	{
  4944 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETECACHESERVICETABLESL_4, "TSY: CMmPhoneTsy::CompleteCacheServiceTablesL - Completing pending ServiceTableRequests");
  4896 TFLOGSTRING("TSY: CMmPhoneTsy::CompleteCacheServiceTablesL - Completing pending ServiceTableRequests");
  4945 		// check request type for every pending request and complete
  4897 		// check request type for every pending request and complete
  4946 		for ( TInt i = 0; i < serviceTableRequestsCount; i++ )
  4898 		for ( TInt i = 0; i < serviceTableRequestsCount; i++ )
  4947 			{
  4899 			{
  4948 			TServiceTableRequests* req = iServiceTableRequests[ i ];
  4900 			TServiceTableRequests* req = iServiceTableRequests[ i ];
  4949 			if ( RMobilePhone::ESIMServiceTable == *req->iTable )
  4901 			if ( RMobilePhone::ESIMServiceTable == *req->iTable )
  4950 				{
  4902 				{
  4951 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETECACHESERVICETABLESL_5, "TSY: CMmPhoneTsy::CompleteCacheServiceTablesL - pending ESIMServiceTableRequest");
  4903 TFLOGSTRING("TSY: CMmPhoneTsy::CompleteCacheServiceTablesL - pending ESIMServiceTableRequest");
  4952 				*(req->iTableData) = *iServiceTableDataCache;
  4904 				*(req->iTableData) = *iServiceTableDataCache;
  4953 				}
  4905 				}
  4954 			else if ( RMobilePhone::EUSIMServiceTable == *req->iTable )
  4906 			else if ( RMobilePhone::EUSIMServiceTable == *req->iTable )
  4955 				{
  4907 				{
  4956 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETECACHESERVICETABLESL_6, "TSY: CMmPhoneTsy::CompleteCacheServiceTablesL - pending ESIMServiceTableRequest");
  4908 TFLOGSTRING("TSY: CMmPhoneTsy::CompleteCacheServiceTablesL - pending ESIMServiceTableRequest");
  4957 				*(req->iTableData) = *iServiceTableUSIMDataCache;
  4909 				*(req->iTableData) = *iServiceTableUSIMDataCache;
  4958 				}
  4910 				}
  4959 			else 
  4911 			else 
  4960 				{
  4912 				{
  4961 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETECACHESERVICETABLESL_7, "TSY: CMmPhoneTsy::CompleteCacheServiceTablesL - pending BadRequest - KErrGeneral");
  4913 TFLOGSTRING("TSY: CMmPhoneTsy::CompleteCacheServiceTablesL - pending BadRequest - KErrGeneral");
  4962 				ret = KErrGeneral;	
  4914 				ret = KErrGeneral;	
  4963 				}
  4915 				}
  4964 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETECACHESERVICETABLESL_8, "TSY: CMmPhoneTsy::CompleteCacheServiceTablesL - ReqCompleted for pending req withHandle:%d", req->iReqHandle);
  4916 TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteCacheServiceTablesL - ReqCompleted for pending req withHandle:%d", req->iReqHandle);
  4965 			ReqCompleted(req->iReqHandle, ret);
  4917 			ReqCompleted(req->iReqHandle, ret);
  4966 			}
  4918 			}
  4967 		// Reset req handle
  4919 		// Reset req handle
  4968 		iTsyReqHandleStore->ResetTsyReqHandle( EMultimodePhoneGetServiceTable );
  4920 		iTsyReqHandleStore->ResetTsyReqHandle( EMultimodePhoneGetServiceTable );
  4969 		iServiceTableRequests.ResetAndDestroy();
  4921 		iServiceTableRequests.ResetAndDestroy();
  4970 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETECACHESERVICETABLESL_9, "TSY: CMmPhoneTsy::CompleteCacheServiceTablesL - Reset and ResetAndDestroy!");
  4922 TFLOGSTRING("TSY: CMmPhoneTsy::CompleteCacheServiceTablesL - Reset and ResetAndDestroy!");	
  4971 		}
  4923 		}
  4972 		
  4924 		
  4973 	if ( ENoRequest != iPendingServiceTableReq )
  4925 	if ( ENoRequest != iPendingServiceTableReq )
  4974 		{
  4926 		{
  4975 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETECACHESERVICETABLESL_10, "TSY: CMmPhoneTsy::CompleteCacheServiceTablesL completing client request");
  4927 TFLOGSTRING("TSY: CMmPhoneTsy::CompleteCacheServiceTablesL completing client request");
  4976 		// Complete client request if pending
  4928 		// Complete client request if pending
  4977 		
  4929 		
  4978 		// Reset req handle. Returns the deleted req handle
  4930 		// Reset req handle. Returns the deleted req handle
  4979 	    TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
  4931 	    TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
  4980             EMultimodePhoneGetServiceTable );
  4932             EMultimodePhoneGetServiceTable );
  5006 	    			}
  4958 	    			}
  5007 	        	}
  4959 	        	}
  5008 	     	
  4960 	     	
  5009 	     	if ( iCalledOnGet && ( iServiceTableReq->iCaching ) )
  4961 	     	if ( iCalledOnGet && ( iServiceTableReq->iCaching ) )
  5010 				{
  4962 				{
  5011 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETECACHESERVICETABLESL_11, "TSY: CMmPhoneTsy::CompleteCacheServiceTablesL - Called when reading service tables - ");
  4963 TFLOGSTRING("TSY: CMmPhoneTsy::CompleteCacheServiceTablesL - Called when reading service tables - ");
  5012 				iCalledOnGet = EFalse;
  4964 				iCalledOnGet = EFalse;
  5013 				iSimCacheQueue = 0;
  4965 				iSimCacheQueue = 0;
  5014 				iRefreshOngoing = EFalse;
  4966 				iRefreshOngoing = EFalse;
  5015 				GetServiceTableL( iServiceTableReq->iReqHandle,iServiceTableReq->iTable, 
  4967 				GetServiceTableL( iServiceTableReq->iReqHandle,iServiceTableReq->iTable, 
  5016 					iServiceTableReq->iTableData );
  4968 					iServiceTableReq->iTableData );
  5025 			else
  4977 			else
  5026 				{	   	
  4978 				{	   	
  5027 	        	iPendingServiceTableReq = ENoRequest;
  4979 	        	iPendingServiceTableReq = ENoRequest;
  5028 	        	
  4980 	        	
  5029 	        	// Complete request if error occured
  4981 	        	// Complete request if error occured
  5030 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETECACHESERVICETABLESL_12, "TSY: CMmPhoneTsy::CompleteCacheServiceTablesL - Completing req if error occurred");
  4982 TFLOGSTRING("TSY: CMmPhoneTsy::CompleteCacheServiceTablesL - Completing req if error occurred");
  5031 	        	ReqCompleted( reqHandle, ret );
  4983 	        	ReqCompleted( reqHandle, ret );
  5032 				}
  4984 				}
  5033 	        }	
  4985 	        }	
  5034 		}
  4986 		}
  5035 	}
  4987 	}
  5043 //
  4995 //
  5044 void CMmPhoneTsy::CompleteGetServiceTableL(
  4996 void CMmPhoneTsy::CompleteGetServiceTableL(
  5045     RMobilePhone::TMobilePhoneServiceTableV1 aTableData,
  4997     RMobilePhone::TMobilePhoneServiceTableV1 aTableData,
  5046     TInt aErrorCode )
  4998     TInt aErrorCode )
  5047     {
  4999     {
  5048 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETSERVICETABLEL_1, "TSY: CMmPhoneTsy::CompleteGetServiceTableL Error = %d", aErrorCode);
  5000 TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteGetServiceTableL Error = %d", aErrorCode);
  5049     // Check if timeout has happend, complete to all pending ServiceTable
  5001     // Check if timeout has happend, complete to all pending ServiceTable
  5050     // requests and clear queue
  5002     // requests and clear queue
  5051 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETSERVICETABLEL_2, "TSY: CMmPhoneTsy::CompleteGetServiceTableL");
  5003 TFLOGSTRING("TSY: CMmPhoneTsy::CompleteGetServiceTableL");
  5052 	if ( KErrTimedOut == aErrorCode )
  5004 	if ( KErrTimedOut == aErrorCode )
  5053 		{
  5005 		{
  5054 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETSERVICETABLEL_3, "TSY: CMmPhoneTsy::CompleteGetServiceTableL - Timeout happened");
  5006 TFLOGSTRING("TSY: CMmPhoneTsy::CompleteGetServiceTableL - Timeout happened");
  5055 		// Reset req handle. Returns the deleted req handle
  5007 		// Reset req handle. Returns the deleted req handle
  5056 	    TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
  5008 	    TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
  5057             EMultimodePhoneGetServiceTable );
  5009             EMultimodePhoneGetServiceTable );
  5058 
  5010 
  5059 	    if ( EMultimodePhoneReqHandleUnknown != reqHandle )
  5011 	    if ( EMultimodePhoneReqHandleUnknown != reqHandle )
  5060 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETSERVICETABLEL_4, "TSY: CMmPhoneTsy::CompleteGetServiceTableL - in EMultimodePhoneReqHandleUnknown != reqHandle" );
  5012 TFLOGSTRING("TSY: CMmPhoneTsy::CompleteGetServiceTableL - in EMultimodePhoneReqHandleUnknown != reqHandle" );
  5061 	    	{
  5013 	    	{
  5062 			// count pending requests and proceed if any
  5014 			// count pending requests and proceed if any
  5063 			TInt serviceTableRequestsCount = iServiceTableRequests.Count();
  5015 			TInt serviceTableRequestsCount = iServiceTableRequests.Count();
  5064 
  5016 
  5065 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETSERVICETABLEL_5, "TSY: CMmPhoneTsy::CompleteGetServiceTableL - serviceTableRequestsCount: %d", serviceTableRequestsCount );
  5017 TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteGetServiceTableL - serviceTableRequestsCount: %d", serviceTableRequestsCount );
  5066 	 		if ( serviceTableRequestsCount )
  5018 	 		if ( serviceTableRequestsCount )
  5067 	 			{
  5019 	 			{
  5068 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETSERVICETABLEL_6, "TSY: CMmPhoneTsy::CompleteGetServiceTableL - Completing pending ServiceTableRequests");
  5020 TFLOGSTRING("TSY: CMmPhoneTsy::CompleteGetServiceTableL - Completing pending ServiceTableRequests");
  5069 				// complete pending requests
  5021 				// complete pending requests
  5070 				for ( TInt i = 0; i < serviceTableRequestsCount; i++ )
  5022 				for ( TInt i = 0; i < serviceTableRequestsCount; i++ )
  5071 					{
  5023 					{
  5072 					TServiceTableRequests* req = iServiceTableRequests[ i ];
  5024 					TServiceTableRequests* req = iServiceTableRequests[ i ];
  5073 
  5025 
  5074 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETSERVICETABLEL_7, "TSY: CMmPhoneTsy::CompleteGetServiceTableL - ReqCompleted for pending req withHandle:%d", req->iReqHandle);
  5026 TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteGetServiceTableL - ReqCompleted for pending req withHandle:%d", req->iReqHandle);
  5075 					ReqCompleted(req->iReqHandle, aErrorCode);
  5027 					ReqCompleted(req->iReqHandle, aErrorCode);
  5076 					}
  5028 					}
  5077 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETSERVICETABLEL_8, "TSY: CMmPhoneTsy::CompleteGetServiceTableL - in iServiceTableRequests.ResetAndDestroy()" );
  5029 TFLOGSTRING("TSY: CMmPhoneTsy::CompleteGetServiceTableL - in iServiceTableRequests.ResetAndDestroy()" );
  5078 				iServiceTableRequests.ResetAndDestroy();	
  5030 				iServiceTableRequests.ResetAndDestroy();	
  5079 				}
  5031 				}
  5080 	        }
  5032 	        }
  5081 		}
  5033 		}
  5082 
  5034 
  5083     if ( ESIMRequest == iPendingServiceTableCacheReq )
  5035     if ( ESIMRequest == iPendingServiceTableCacheReq )
  5084 		{
  5036 		{
  5085 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETSERVICETABLEL_9, "TSY: CMmPhoneTsy::CompleteGetServiceTableL got Service Table");
  5037 TFLOGSTRING("TSY: CMmPhoneTsy::CompleteGetServiceTableL got Service Table");
  5086 		
  5038 		
  5087 		delete iServiceTableDataCache;
  5039 		delete iServiceTableDataCache;
  5088 		iServiceTableDataCache = NULL;
  5040 		iServiceTableDataCache = NULL;
  5089 		
  5041 		
  5090 		if ( KErrNone == aErrorCode )
  5042 		if ( KErrNone == aErrorCode )
  5098 		// Request USIM Service Table
  5050 		// Request USIM Service Table
  5099 		if ( ( CMmPhoneGsmWcdmaExt::EICCTypeSim3G  ==
  5051 		if ( ( CMmPhoneGsmWcdmaExt::EICCTypeSim3G  ==
  5100             iMmPhoneExtInterface->CurrentICCType() ) &&
  5052             iMmPhoneExtInterface->CurrentICCType() ) &&
  5101             ENoRequest != iPendingServiceTableCacheReq )
  5053             ENoRequest != iPendingServiceTableCacheReq )
  5102 			{
  5054 			{
  5103 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETSERVICETABLEL_10, "TSY: CMmPhoneTsy::CompleteGetServiceTableL requesting USIM Service Table");
  5055 TFLOGSTRING("TSY: CMmPhoneTsy::CompleteGetServiceTableL requesting USIM Service Table");
  5104 
  5056 
  5105 			RMobilePhone::TMobilePhoneServiceTable serviceTable = 
  5057 			RMobilePhone::TMobilePhoneServiceTable serviceTable = 
  5106 				RMobilePhone::EUSIMServiceTable;
  5058 				RMobilePhone::EUSIMServiceTable;
  5107 				
  5059 				
  5108 			iPendingServiceTableCacheReq = EUSIMRequest;
  5060 			iPendingServiceTableCacheReq = EUSIMRequest;
  5123 			}
  5075 			}
  5124 
  5076 
  5125 		}
  5077 		}
  5126 	else if ( EUSIMRequest == iPendingServiceTableCacheReq )
  5078 	else if ( EUSIMRequest == iPendingServiceTableCacheReq )
  5127 		{
  5079 		{
  5128 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETSERVICETABLEL_11, "TSY: CMmPhoneTsy::CompleteGetServiceTableL got USIM Service Table");
  5080 TFLOGSTRING("TSY: CMmPhoneTsy::CompleteGetServiceTableL got USIM Service Table");
  5129 
  5081 
  5130 		delete iServiceTableUSIMDataCache;
  5082 		delete iServiceTableUSIMDataCache;
  5131 		iServiceTableUSIMDataCache = NULL;
  5083 		iServiceTableUSIMDataCache = NULL;
  5132 		
  5084 		
  5133 		if ( KErrNone == aErrorCode )
  5085 		if ( KErrNone == aErrorCode )
  5147 	// Update data only if caching is not ongoing and client request
  5099 	// Update data only if caching is not ongoing and client request
  5148 	// is pending	
  5100 	// is pending	
  5149 	if ( ENoRequest != iPendingServiceTableReq &&
  5101 	if ( ENoRequest != iPendingServiceTableReq &&
  5150         ENoRequest == iPendingServiceTableCacheReq )
  5102         ENoRequest == iPendingServiceTableCacheReq )
  5151 		{
  5103 		{
  5152 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETSERVICETABLEL_12, "TSY: CMmPhoneTsy::CompleteGetServiceTableL completing client request");
  5104 TFLOGSTRING("TSY: CMmPhoneTsy::CompleteGetServiceTableL completing client request");
  5153 		// Complete client request if pending
  5105 		// Complete client request if pending
  5154 		
  5106 		
  5155 		// Reset req handle. Returns the deleted req handle
  5107 		// Reset req handle. Returns the deleted req handle
  5156 	    TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
  5108 	    TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
  5157             EMultimodePhoneGetServiceTable );
  5109             EMultimodePhoneGetServiceTable );
  5163 	    		delete iServiceTableDataCache;
  5115 	    		delete iServiceTableDataCache;
  5164 				iServiceTableDataCache = NULL;
  5116 				iServiceTableDataCache = NULL;
  5165 		
  5117 		
  5166 	    		if( KErrNone == aErrorCode )
  5118 	    		if( KErrNone == aErrorCode )
  5167 	    			{
  5119 	    			{
  5168 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETSERVICETABLEL_13, "TSY: CMmPhoneTsy::CompleteGetServiceTableL copy SIM ST data to client");
  5120 TFLOGSTRING("TSY: CMmPhoneTsy::CompleteGetServiceTableL copy SIM ST data to client");
  5169 	    			iServiceTableDataCache = new (ELeave) 
  5121 	    			iServiceTableDataCache = new (ELeave) 
  5170 					    RMobilePhone::TMobilePhoneServiceTableV1();
  5122 					    RMobilePhone::TMobilePhoneServiceTableV1();
  5171 	    			*iServiceTableDataCache	= aTableData;
  5123 	    			*iServiceTableDataCache	= aTableData;
  5172 	        		*iRetTableData = aTableData;
  5124 	        		*iRetTableData = aTableData;
  5173 	    			}
  5125 	    			}
  5177 	        	delete iServiceTableUSIMDataCache;
  5129 	        	delete iServiceTableUSIMDataCache;
  5178 				iServiceTableUSIMDataCache = NULL;
  5130 				iServiceTableUSIMDataCache = NULL;
  5179 				
  5131 				
  5180 	        	if( KErrNone == aErrorCode )
  5132 	        	if( KErrNone == aErrorCode )
  5181 	        		{
  5133 	        		{
  5182 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETSERVICETABLEL_14, "TSY: CMmPhoneTsy::CompleteGetServiceTableL copy USIM ST data to client");
  5134 TFLOGSTRING("TSY: CMmPhoneTsy::CompleteGetServiceTableL copy USIM ST data to client");
  5183 	        		iServiceTableUSIMDataCache = new (ELeave) 
  5135 	        		iServiceTableUSIMDataCache = new (ELeave) 
  5184 					    RMobilePhone::TMobilePhoneServiceTableV1();
  5136 					    RMobilePhone::TMobilePhoneServiceTableV1();
  5185 	        		*iServiceTableUSIMDataCache = aTableData;	
  5137 	        		*iServiceTableUSIMDataCache = aTableData;	
  5186 	        		*iRetTableData = aTableData;
  5138 	        		*iRetTableData = aTableData;
  5187 	        		}
  5139 	        		}
  5202 // ---------------------------------------------------------------------------
  5154 // ---------------------------------------------------------------------------
  5203 //
  5155 //
  5204 TInt CMmPhoneTsy::GetServiceTableCancel (
  5156 TInt CMmPhoneTsy::GetServiceTableCancel (
  5205 	const TTsyReqHandle aTsyReqHandle )
  5157 	const TTsyReqHandle aTsyReqHandle )
  5206     {
  5158     {
  5207 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETSERVICETABLECANCEL_1, "TSY: CMmPhoneTsy::GetServiceTableCancel");
  5159 TFLOGSTRING("TSY: CMmPhoneTsy::GetServiceTableCancel");
  5208     iTsyReqHandleStore->ResetTsyReqHandle( EMultimodePhoneGetServiceTable );
  5160     iTsyReqHandleStore->ResetTsyReqHandle( EMultimodePhoneGetServiceTable );
  5209     ReqCompleted( aTsyReqHandle, KErrCancel );
  5161     ReqCompleted( aTsyReqHandle, KErrCancel );
  5210 
  5162 
  5211     return KErrNone;
  5163     return KErrNone;
  5212     }
  5164     }
  5218 // (other items were commented in a header).
  5170 // (other items were commented in a header).
  5219 // ---------------------------------------------------------------------------
  5171 // ---------------------------------------------------------------------------
  5220 //
  5172 //
  5221 TInt CMmPhoneTsy::SimRefreshRegisterL()
  5173 TInt CMmPhoneTsy::SimRefreshRegisterL()
  5222     {
  5174     {
  5223 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_SIMREFRESHREGISTERL_1,  "TSY: CMmPhoneTsy::SimRefreshRegisterL" );
  5175 TFLOGSTRING( "TSY: CMmPhoneTsy::SimRefreshRegisterL" );
  5224 
  5176 
  5225     TInt ret( KErrNone );
  5177     TInt ret( KErrNone );
  5226 
  5178 
  5227     // Add all supported file types to be registered for refresh
  5179     // Add all supported file types to be registered for refresh
  5228     TUint16 filesToRegister = KCacheAdn | KCacheFdn | KCacheServiceTable
  5180     TUint16 filesToRegister = KCacheAdn | KCacheFdn | KCacheServiceTable
  5237         EMmTsySimRefreshRegisterIPC, &dataPackage );
  5189         EMmTsySimRefreshRegisterIPC, &dataPackage );
  5238 
  5190 
  5239     if ( KErrNone != ret )
  5191     if ( KErrNone != ret )
  5240         {
  5192         {
  5241         // the sending has failed
  5193         // the sending has failed
  5242 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_SIMREFRESHREGISTERL_2,  "TSY: CMmPhoneTsy::SimRefreshRegisterL, Registration for Refresh failed" );
  5194 TFLOGSTRING( "TSY: CMmPhoneTsy::SimRefreshRegisterL, Registration for Refresh failed" );
  5243         }
  5195         }
  5244 
  5196 
  5245     return ret;
  5197     return ret;
  5246     }
  5198     }
  5247 
  5199 
  5252 // ---------------------------------------------------------------------------
  5204 // ---------------------------------------------------------------------------
  5253 //
  5205 //
  5254 void CMmPhoneTsy::CompleteSimRefreshRegister(
  5206 void CMmPhoneTsy::CompleteSimRefreshRegister(
  5255      TInt aErrorCode )
  5207      TInt aErrorCode )
  5256     {
  5208     {
  5257 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETESIMREFRESHREGISTER_1, "TSY: CMmPhoneTsy::CompleteSimRefreshRegisterL Error = %d", aErrorCode );
  5209 TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteSimRefreshRegisterL Error = %d", aErrorCode );
  5258 
  5210 
  5259 	if( KErrNone == aErrorCode )
  5211 	if( KErrNone == aErrorCode )
  5260 		{
  5212 		{
  5261 		iSimRefreshRegisterOk = ETrue;		
  5213 		iSimRefreshRegisterOk = ETrue;		
  5262 		}		
  5214 		}		
  5268 // (other items were commented in a header).
  5220 // (other items were commented in a header).
  5269 // ---------------------------------------------------------------------------
  5221 // ---------------------------------------------------------------------------
  5270 //
  5222 //
  5271 TBool CMmPhoneTsy::GetSimRefreshRegister()
  5223 TBool CMmPhoneTsy::GetSimRefreshRegister()
  5272     {
  5224     {
  5273 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETSIMREFRESHREGISTER_1,  "TSY: CMmPhoneTsy::GetSimRefreshRegister iSimRefreshRegisterOk = %d", iSimRefreshRegisterOk );
  5225 TFLOGSTRING2( "TSY: CMmPhoneTsy::GetSimRefreshRegister iSimRefreshRegisterOk = %d", iSimRefreshRegisterOk );
  5274 
  5226 
  5275 	return iSimRefreshRegisterOk;		
  5227 	return iSimRefreshRegisterOk;		
  5276     }
  5228     }
  5277     
  5229     
  5278 // ---------------------------------------------------------------------------
  5230 // ---------------------------------------------------------------------------
  5283 void CMmPhoneTsy::CompleteUpdateLifeTimer(
  5235 void CMmPhoneTsy::CompleteUpdateLifeTimer(
  5284      TInt aErrorCode )
  5236      TInt aErrorCode )
  5285     {
  5237     {
  5286 	if( KErrNone != aErrorCode)
  5238 	if( KErrNone != aErrorCode)
  5287 		{
  5239 		{
  5288 		OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEUPDATELIFETIMER_1, "TSY: CMmPhoneTsy::CompleteUpdateLifeTimer Error = %d", aErrorCode );
  5240 		TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteUpdateLifeTimer Error = %d", aErrorCode );
  5289 		}
  5241 		}
  5290     }    
  5242     }    
  5291 
  5243 
  5292 //---------------------------------------------------------------------------
  5244 //---------------------------------------------------------------------------
  5293 // CMmPhoneTsy::GetSimRefreshRegister
  5245 // CMmPhoneTsy::GetSimRefreshRegister
  5342 // ---------------------------------------------------------------------------
  5294 // ---------------------------------------------------------------------------
  5343 //
  5295 //
  5344 void CMmPhoneTsy::CompleteSimRefreshNowL(
  5296 void CMmPhoneTsy::CompleteSimRefreshNowL(
  5345     TUint16 aFilesToRefresh )
  5297     TUint16 aFilesToRefresh )
  5346     {
  5298     {
  5347 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETESIMREFRESHNOWL_1, "TSY: CMmPhoneTsy::CompleteSimRefreshNowL filemask: %d", aFilesToRefresh);
  5299 TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteSimRefreshNowL filemask: %d", aFilesToRefresh);
  5348 
  5300 
  5349     // Set flag to indicate that refresh has started
  5301     // Set flag to indicate that refresh has started
  5350     iRefreshOngoing = ETrue;
  5302     iRefreshOngoing = ETrue;
  5351 
  5303 
  5352     // Fill cache queue
  5304     // Fill cache queue
  5392         TBool       cacheStarted = EFalse;
  5344         TBool       cacheStarted = EFalse;
  5393 
  5345 
  5394         //FDN requested? (FDN has the first priority)
  5346         //FDN requested? (FDN has the first priority)
  5395         if( KCacheFdn & iSimCacheQueue )
  5347         if( KCacheFdn & iSimCacheQueue )
  5396             {
  5348             {
  5397 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_CACHENEXTL_1,  "TSY: CMmPhoneTsy::CacheNextL - FDN" );
  5349 TFLOGSTRING( "TSY: CMmPhoneTsy::CacheNextL - FDN" );
  5398             pbRequested = KETelIccFdnPhoneBook;
  5350             pbRequested = KETelIccFdnPhoneBook;
  5399             resetFlag = KCacheFdn;
  5351             resetFlag = KCacheFdn;
  5400             }
  5352             }
  5401         else if( KCacheALSline & iSimCacheQueue )
  5353         else if( KCacheALSline & iSimCacheQueue )
  5402             {
  5354             {
  5403 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_CACHENEXTL_2,  "TSY: CMmPhoneTsy::CacheNextL - ALS" );
  5355 TFLOGSTRING( "TSY: CMmPhoneTsy::CacheNextL - ALS" );
  5404 			ResetMEAlsInfo();
  5356 			ResetMEAlsInfo();
  5405 			pbRequested = KNullDesC;
  5357 			pbRequested = KNullDesC;
  5406 			cacheStarted = ETrue;
  5358 			cacheStarted = ETrue;
  5407             }
  5359             }
  5408         //ADN requested?
  5360         //ADN requested?
  5409         else if( KCacheAdn & iSimCacheQueue )
  5361         else if( KCacheAdn & iSimCacheQueue )
  5410             {
  5362             {
  5411 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_CACHENEXTL_3,  "TSY: CMmPhoneTsy::CacheNextL - ADN" );
  5363 TFLOGSTRING( "TSY: CMmPhoneTsy::CacheNextL - ADN" );
  5412             //NOTE: Here should be added the checking of FDN active state
  5364             //NOTE: Here should be added the checking of FDN active state
  5413             pbRequested = KETelIccAdnPhoneBook;
  5365             pbRequested = KETelIccAdnPhoneBook;
  5414             resetFlag = KCacheAdn;
  5366             resetFlag = KCacheAdn;
  5415             }
  5367             }
  5416         //UNKNOWN request (erroneous requests, all valid cases have been 
  5368         //UNKNOWN request (erroneous requests, all valid cases have been 
  5417         //checked and the queue can be reset)
  5369         //checked and the queue can be reset)
  5418         else
  5370         else
  5419             {
  5371             {
  5420 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_CACHENEXTL_4,  "TSY: CMmPhoneTsy::CacheNextL - Unknown" );
  5372 TFLOGSTRING( "TSY: CMmPhoneTsy::CacheNextL - Unknown" );
  5421             pbRequested = KNullDesC;
  5373             pbRequested = KNullDesC;
  5422             resetFlag = iSimCacheQueue;
  5374             resetFlag = iSimCacheQueue;
  5423             }
  5375             }
  5424 
  5376 
  5425         //PHONE BOOK Request: Is there a phonebook available?
  5377         //PHONE BOOK Request: Is there a phonebook available?
  5426         if( (pbRequested!=KNullDesC) && (iPBList) )
  5378         if( (pbRequested!=KNullDesC) && (iPBList) )
  5427             {
  5379             {
  5428             TInt numberOfPBooks = iPBList->GetNumberOfObjects();
  5380             TInt numberOfPBooks = iPBList->GetNumberOfObjects();
  5429 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_CACHENEXTL_5,  "TSY: CMmPhoneTsy::CacheNextL - Num Of PBs: %d", numberOfPBooks );
  5381 TFLOGSTRING2( "TSY: CMmPhoneTsy::CacheNextL - Num Of PBs: %d", numberOfPBooks );
  5430 
  5382 
  5431             //Browse through the phonebook names for the one required
  5383             //Browse through the phonebook names for the one required
  5432             for( TInt i=0; i < numberOfPBooks; i++ )
  5384             for( TInt i=0; i < numberOfPBooks; i++ )
  5433                 {
  5385                 {
  5434                 CMmPhoneBookStoreTsy* pbStore = iPBList->GetMmPBByIndex( i );
  5386                 CMmPhoneBookStoreTsy* pbStore = iPBList->GetMmPBByIndex( i );
  5445                     	// Set package data
  5397                     	// Set package data
  5446                     	package.SetPhoneBookName( pbRequested );
  5398                     	package.SetPhoneBookName( pbRequested );
  5447                     	TRAP_IGNORE( MessageManager()->HandleRequestL( 
  5399                     	TRAP_IGNORE( MessageManager()->HandleRequestL( 
  5448                             EMmTsyPhoneBookStoreCacheCancelIPC, &package ); );
  5400                             EMmTsyPhoneBookStoreCacheCancelIPC, &package ); );
  5449 
  5401 
  5450 
  5402 #if ( TF_LOGGING_METHOD > 0 )
  5451                     	if ( pbRequested == KETelIccFdnPhoneBook ) 
  5403                     	if ( pbRequested == KETelIccFdnPhoneBook ) 
  5452                     	    {
  5404                     	    {
  5453 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_CACHENEXTL_6,  "TSY: CMmPhoneTsy::CacheNextL - CancelCache for : KETelIccFdnPhoneBook" );
  5405 TFLOGSTRING( "TSY: CMmPhoneTsy::CacheNextL - CancelCache for : KETelIccFdnPhoneBook" ); 
  5454                             }
  5406                             }
  5455                     	else 
  5407                     	else 
  5456                     	    {
  5408                     	    {
  5457 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_CACHENEXTL_7,  "TSY: CMmPhoneTsy::CacheNextL - CancelCache for : KETelIccAdnPhoneBook" );
  5409 TFLOGSTRING( "TSY: CMmPhoneTsy::CacheNextL - CancelCache for : KETelIccAdnPhoneBook" ); 
  5458                             }
  5410                             }
       
  5411 #endif // TF_LOGGING_METHOD
  5459                     	}                   
  5412                     	}                   
  5460                     // perform the various stages of phonebook 
  5413                     // perform the various stages of phonebook 
  5461                     // cache re-initialisation
  5414                     // cache re-initialisation
  5462 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_CACHENEXTL_8,  "TSY: CMmPhoneTsy::CacheNextL - Resetting cache.");
  5415 TFLOGSTRING( "TSY: CMmPhoneTsy::CacheNextL - Resetting cache.");
  5463                     pbStore->ResetCacheReady();
  5416                     pbStore->ResetCacheReady();
  5464                     pbStore->ResetInitialisationStatus();
  5417                     pbStore->ResetInitialisationStatus();
  5465                     pbStore->ResetCache();
  5418                     pbStore->ResetCache();
  5466 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_CACHENEXTL_9,  "TSY: CMmPhoneTsy::CacheNextL -> Cache entries" );
  5419 TFLOGSTRING( "TSY: CMmPhoneTsy::CacheNextL -> Cache entries" );
  5467                     pbStore->CacheEntriesL();
  5420                     pbStore->CacheEntriesL();
  5468 
  5421 
  5469                     cacheStarted = ETrue;
  5422                     cacheStarted = ETrue;
  5470                     break;
  5423                     break;
  5471                     }
  5424                     }
  5475         //CACHING not started
  5428         //CACHING not started
  5476         //phonebook does not exist, or unknown request,
  5429         //phonebook does not exist, or unknown request,
  5477         //so the file is removed from the cache queue
  5430         //so the file is removed from the cache queue
  5478         if( !cacheStarted )
  5431         if( !cacheStarted )
  5479             {
  5432             {
  5480 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_CACHENEXTL_10,  "TSY: CMmPhoneTsy::CacheNextL - No PB Could be found, or Unknown request" );
  5433 TFLOGSTRING( "TSY: CMmPhoneTsy::CacheNextL - No PB Could be found, or Unknown request" );
  5481             CompleteCacheSimL( resetFlag, ETrue ); //complete with error
  5434             CompleteCacheSimL( resetFlag, ETrue ); //complete with error
  5482             }
  5435             }
  5483         }
  5436         }
  5484     //more files in the queue?
  5437     //more files in the queue?
  5485     result = ( iSimCacheQueue )? ETrue : EFalse;
  5438     result = ( iSimCacheQueue )? ETrue : EFalse;
  5486 
  5439 
  5487 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_CACHENEXTL_11,  "TSY: CMmPhoneTsy::CacheNextL: (Success/Fail = 1/0) %d",(TInt)result );
  5440 TFLOGSTRING2( "TSY: CMmPhoneTsy::CacheNextL: (Success/Fail = 1/0) %d",(TInt)result );
  5488     return result;
  5441     return result;
  5489     }
  5442     }
  5490 
  5443 
  5491 
  5444 
  5492 // ---------------------------------------------------------------------------
  5445 // ---------------------------------------------------------------------------
  5498 //
  5451 //
  5499 void CMmPhoneTsy::CompleteCacheSimL(
  5452 void CMmPhoneTsy::CompleteCacheSimL(
  5500     TUint8	aFileType,
  5453     TUint8	aFileType,
  5501     TBool	aReadError)
  5454     TBool	aReadError)
  5502     {
  5455     {
  5503 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETECACHESIML_1,  "TSY: CMmPhoneTsy::CompleteCacheSimL, FileType: 0x%x", aFileType );
  5456 TFLOGSTRING2( "TSY: CMmPhoneTsy::CompleteCacheSimL, FileType: 0x%x", aFileType );
  5504 
  5457 
  5505     TBool filesInCacheQueue(EFalse); //By default: "no more files in cache"
  5458     TBool filesInCacheQueue(EFalse); //By default: "no more files in cache"
  5506 
  5459 
  5507     // Remove file from caching queue
  5460     // Remove file from caching queue
  5508     iSimCacheQueue &= ~aFileType;
  5461     iSimCacheQueue &= ~aFileType;
  5534         // Complete the refresh
  5487         // Complete the refresh
  5535         NotifySimRefreshCompletionL( aReadError );
  5488         NotifySimRefreshCompletionL( aReadError );
  5536         }
  5489         }
  5537      else
  5490      else
  5538      	{
  5491      	{
  5539 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETECACHESIML_2,  "TSY: CMmPhoneTsy::CompleteCacheSimL, caching still in progress." );
  5492 TFLOGSTRING( "TSY: CMmPhoneTsy::CompleteCacheSimL, caching still in progress." );
  5540      	}
  5493      	}
  5541     }
  5494     }
  5542 
  5495 
  5543 // ---------------------------------------------------------------------------
  5496 // ---------------------------------------------------------------------------
  5544 // CMmPhoneTsy::NotifySimRefreshCompletionL
  5497 // CMmPhoneTsy::NotifySimRefreshCompletionL
  5547 // ---------------------------------------------------------------------------
  5500 // ---------------------------------------------------------------------------
  5548 //
  5501 //
  5549 void CMmPhoneTsy::NotifySimRefreshCompletionL(
  5502 void CMmPhoneTsy::NotifySimRefreshCompletionL(
  5550     TBool aReadError )
  5503     TBool aReadError )
  5551     {
  5504     {
  5552 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_NOTIFYSIMREFRESHCOMPLETIONL_1,  "TSY: CMmPhoneTsy::NotifySimRefreshCompletionL error = %d",aReadError );
  5505 TFLOGSTRING2( "TSY: CMmPhoneTsy::NotifySimRefreshCompletionL error = %d",aReadError );
  5553 
  5506 
  5554     // Refresh is finished, update flag
  5507     // Refresh is finished, update flag
  5555     iRefreshOngoing = EFalse;
  5508     iRefreshOngoing = EFalse;
  5556 
  5509 
  5557     // Make sure that the list gets empty
  5510     // Make sure that the list gets empty
  5573 // ---------------------------------------------------------------------------
  5526 // ---------------------------------------------------------------------------
  5574 //
  5527 //
  5575 TInt CMmPhoneTsy::ImsAuthenticationL( 
  5528 TInt CMmPhoneTsy::ImsAuthenticationL( 
  5576     TDes8* aAuthenticationData )
  5529     TDes8* aAuthenticationData )
  5577     {
  5530     {
  5578 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_IMSAUTHENTICATIONL_1, "TSY: CMmPhoneTsy::ImsAuthenticationL");
  5531 TFLOGSTRING("TSY: CMmPhoneTsy::ImsAuthenticationL");
  5579 
  5532 
  5580 	TInt ret = KErrServerBusy;
  5533 	TInt ret = KErrServerBusy;
  5581     
  5534     
  5582     // Check if request handle already exists
  5535     // Check if request handle already exists
  5583     TTsyReqHandle reqHandle = iTsyReqHandleStore->GetTsyReqHandle(
  5536     TTsyReqHandle reqHandle = iTsyReqHandleStore->GetTsyReqHandle(
  5626 //
  5579 //
  5627 void CMmPhoneTsy::CompleteImsAuthentication( 
  5580 void CMmPhoneTsy::CompleteImsAuthentication( 
  5628     CMmDataPackage* aDataPackage, 
  5581     CMmDataPackage* aDataPackage, 
  5629     TInt aResult )
  5582     TInt aResult )
  5630     {
  5583     {
  5631 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEIMSAUTHENTICATION_1, "TSY: CMmPhoneTsy::CompleteImsAuthentication");
  5584 TFLOGSTRING("TSY: CMmPhoneTsy::CompleteImsAuthentication");
  5632 
  5585 
  5633     // reset req handle. Returns the deleted req handle
  5586     // reset req handle. Returns the deleted req handle
  5634     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
  5587     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
  5635         EMultimodePhoneIMSAuthenticate );
  5588         EMultimodePhoneIMSAuthenticate );
  5636     if ( KErrNone == aResult )
  5589     if ( KErrNone == aResult )
  5693 // (other items were commented in a header).
  5646 // (other items were commented in a header).
  5694 // ---------------------------------------------------------------------------
  5647 // ---------------------------------------------------------------------------
  5695 //
  5648 //
  5696 TInt CMmPhoneTsy::ImsAuthenticationCancel()
  5649 TInt CMmPhoneTsy::ImsAuthenticationCancel()
  5697     {
  5650     {
  5698 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_IMSAUTHENTICATIONCANCEL_1, "TSY: CMmPhoneTsy::ImsAuthenticationCancel");
  5651 TFLOGSTRING("TSY: CMmPhoneTsy::ImsAuthenticationCancel");
  5699     // reset the reqhandle
  5652     // reset the reqhandle
  5700     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
  5653     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
  5701         EMultimodePhoneIMSAuthenticate );
  5654         EMultimodePhoneIMSAuthenticate );
  5702 
  5655 
  5703     // reset pointer to client data
  5656     // reset pointer to client data
  5719 // ---------------------------------------------------------------------------
  5672 // ---------------------------------------------------------------------------
  5720 //
  5673 //
  5721 TInt CMmPhoneTsy::GetMailboxNumbersL(
  5674 TInt CMmPhoneTsy::GetMailboxNumbersL(
  5722     TDes8* aMailBox )
  5675     TDes8* aMailBox )
  5723     {
  5676     {
  5724 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETMAILBOXNUMBERSL_1, "TSY: CMmPhoneTsy::GetMailboxNumbersL");
  5677 TFLOGSTRING("TSY: CMmPhoneTsy::GetMailboxNumbersL");
  5725     TInt ret = KErrServerBusy;
  5678     TInt ret = KErrServerBusy;
  5726     
  5679     
  5727     // Check if request handle already exists
  5680     // Check if request handle already exists
  5728     TTsyReqHandle reqHandle = iTsyReqHandleStore->GetTsyReqHandle(
  5681     TTsyReqHandle reqHandle = iTsyReqHandleStore->GetTsyReqHandle(
  5729         EMultimodePhoneGetMailboxNumbers );   
  5682         EMultimodePhoneGetMailboxNumbers );   
  5756                     if ( 0 == pbStore->PhoneBookName()->CompareF( KETelIccVoiceMailBox ) )
  5709                     if ( 0 == pbStore->PhoneBookName()->CompareF( KETelIccVoiceMailBox ) )
  5757                         {
  5710                         {
  5758                         found = ETrue;
  5711                         found = ETrue;
  5759                         if( !pbStore->IsPBInitDone() )
  5712                         if( !pbStore->IsPBInitDone() )
  5760                             {
  5713                             {
  5761                             OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETMAILBOXNUMBERSL_2, "TSY: CMmPhoneTsy::GetMailboxNumbersL VoiceMailBox initilizing was not complete... Waiting for completion");
  5714                             TFLOGSTRING("TSY: CMmPhoneTsy::GetMailboxNumbersL VoiceMailBox initilizing was not complete... Waiting for completion");
  5762                             iReqHandleType = EMultimodePhoneGetMailboxNumbers;
  5715                             iReqHandleType = EMultimodePhoneGetMailboxNumbers;
  5763                             return KErrNone;
  5716                             return KErrNone;
  5764                             }
  5717                             }
  5765                         }
  5718                         }
  5766                     }
  5719                     }
  5767                 if(!found)
  5720                 if(!found)
  5768                     {
  5721                     {
  5769                     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETMAILBOXNUMBERSL_3, "TSY: CMmPhoneTsy::GetMailboxNumbersL VoiceMailBox should be created...");
  5722                     TFLOGSTRING("TSY: CMmPhoneTsy::GetMailboxNumbersL VoiceMailBox should be created...");
  5770                     iMmPhoneBookStoreTsy = 
  5723                     iMmPhoneBookStoreTsy = 
  5771                         CMmPhoneBookStoreTsy::NewL( this, KETelIccVoiceMailBox );
  5724                         CMmPhoneBookStoreTsy::NewL( this, KETelIccVoiceMailBox );
  5772                     
  5725                     
  5773                     TInt addPBSucceeded = iPBList->AddObject( iMmPhoneBookStoreTsy );
  5726                     TInt addPBSucceeded = iPBList->AddObject( iMmPhoneBookStoreTsy );
  5774                     if( !iMmPhoneBookStoreTsy->IsPBInitDone() )
  5727                     if( !iMmPhoneBookStoreTsy->IsPBInitDone() )
  5804 //
  5757 //
  5805 void CMmPhoneTsy::CompleteGetMailboxNumbers( 
  5758 void CMmPhoneTsy::CompleteGetMailboxNumbers( 
  5806     CMmDataPackage* aDataPackage, 
  5759     CMmDataPackage* aDataPackage, 
  5807     TInt aResult )
  5760     TInt aResult )
  5808     {
  5761     {
  5809 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETMAILBOXNUMBERS_1, "TSY: CMmPhoneTsy::CompleteGetMailboxNumbers");
  5762 TFLOGSTRING("TSY: CMmPhoneTsy::CompleteGetMailboxNumbers");
  5810 
  5763 
  5811     // reset req handle. Returns the deleted req handle
  5764     // reset req handle. Returns the deleted req handle
  5812     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
  5765     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
  5813         EMultimodePhoneGetMailboxNumbers );
  5766         EMultimodePhoneGetMailboxNumbers );
  5814         
  5767         
  5841 // (other items were commented in a header).
  5794 // (other items were commented in a header).
  5842 // ---------------------------------------------------------------------------
  5795 // ---------------------------------------------------------------------------
  5843 //
  5796 //
  5844 TInt CMmPhoneTsy::GetMailboxNumbersCancel()
  5797 TInt CMmPhoneTsy::GetMailboxNumbersCancel()
  5845     {
  5798     {
  5846 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETMAILBOXNUMBERSCANCEL_1, "TSY: CMmPhoneTsy::GetMailboxNumbersCancel");
  5799 TFLOGSTRING("TSY: CMmPhoneTsy::GetMailboxNumbersCancel");
  5847     // reset the reqhandle
  5800     // reset the reqhandle
  5848     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
  5801     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
  5849         EMultimodePhoneGetMailboxNumbers );
  5802         EMultimodePhoneGetMailboxNumbers );
  5850 
  5803 
  5851     // reset pointer to client data
  5804     // reset pointer to client data
  5976    //Find the correct tsy object and call its' Complete function
  5929    //Find the correct tsy object and call its' Complete function
  5977 
  5930 
  5978     //Check if the object is the Phone object
  5931     //Check if the object is the Phone object
  5979     if( this == aObject )
  5932     if( this == aObject )
  5980         {
  5933         {
  5981 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_TIMEREXPIRED_1, "TSY: CMmPhoneTsy::TimerExpired - this == aObject");
  5934 TFLOGSTRING("TSY: CMmPhoneTsy::TimerExpired - this == aObject");
  5982         //call phone object to complete this request
  5935         //call phone object to complete this request
  5983         this->Complete( aReqHandleType, error );
  5936         this->Complete( aReqHandleType, error );
  5984         }
  5937         }
  5985 
  5938 
  5986     //Line does not require timer
  5939     //Line does not require timer
  5987     TInt i( 0 );
  5940     TInt i( 0 );
  5988 
  5941 
  5989     //Check if the object is a Call object
  5942     //Check if the object is a Call object
  5990     for ( i = 0; i < iCallList->GetNumberOfObjects(); i++ )
  5943     for ( i = 0; i < iCallList->GetNumberOfObjects(); i++ )
  5991         {
  5944         {
  5992 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_TIMEREXPIRED_2, "TSY: CMmPhoneTsy::TimerExpired - iCallList->GetNumberOfObjects()");
  5945 TFLOGSTRING("TSY: CMmPhoneTsy::TimerExpired - iCallList->GetNumberOfObjects()");
  5993         //Get call object
  5946         //Get call object
  5994         CMmCallTsy* call = iCallList->GetMmCallByIndex( i );
  5947         CMmCallTsy* call = iCallList->GetMmCallByIndex( i );
  5995         //check if the current call is the object that we are
  5948         //check if the current call is the object that we are
  5996         //trying to find
  5949         //trying to find
  5997         if( call == aObject )
  5950         if( call == aObject )
  5998             {
  5951             {
  5999 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_TIMEREXPIRED_3, "TSY: CMmPhoneTsy::TimerExpired - call == aObject");
  5952 TFLOGSTRING("TSY: CMmPhoneTsy::TimerExpired - call == aObject");
  6000             //call the complete method
  5953             //call the complete method
  6001             call->Complete( aReqHandleType, error );
  5954             call->Complete( aReqHandleType, error );
  6002             //object found, break
  5955             //object found, break
  6003             break;
  5956             break;
  6004             }
  5957             }
  6005         }
  5958         }
  6006 
  5959 
  6007     // Check if the object is a ConferenceCall object
  5960     // Check if the object is a ConferenceCall object
  6008     if ( iMmConferenceCall == aObject )
  5961     if ( iMmConferenceCall == aObject )
  6009         {
  5962         {
  6010 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_TIMEREXPIRED_4, "TSY: CMmPhoneTsy::TimerExpired - iMmConferenceCall");
  5963 TFLOGSTRING("TSY: CMmPhoneTsy::TimerExpired - iMmConferenceCall");
  6011         iMmConferenceCall->Complete( aReqHandleType, error );
  5964         iMmConferenceCall->Complete( aReqHandleType, error );
  6012         }
  5965         }
  6013     //OTHER MODULES
  5966     //OTHER MODULES
  6014 
  5967 
  6015     //Check if the object is a PBStore object
  5968     //Check if the object is a PBStore object
  6016     for ( i = 0; i < iPBList->GetNumberOfObjects(); i++ )
  5969     for ( i = 0; i < iPBList->GetNumberOfObjects(); i++ )
  6017         {
  5970         {
  6018 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_TIMEREXPIRED_5, "TSY: CMmPhoneTsy::TimerExpired - iPBList->GetNumberOfObjects()");
  5971 TFLOGSTRING("TSY: CMmPhoneTsy::TimerExpired - iPBList->GetNumberOfObjects()");
  6019         //Get PBStore object
  5972         //Get PBStore object
  6020         CMmPhoneBookStoreTsy* pbStore = iPBList->GetMmPBByIndex( i );
  5973         CMmPhoneBookStoreTsy* pbStore = iPBList->GetMmPBByIndex( i );
  6021         //check if the current PB is the object that we are
  5974         //check if the current PB is the object that we are
  6022         //trying to find
  5975         //trying to find
  6023         if ( pbStore == aObject )
  5976         if ( pbStore == aObject )
  6024             {
  5977             {
  6025 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_TIMEREXPIRED_6, "TSY: CMmPhoneTsy::TimerExpired - aPBStore == aObject");
  5978 TFLOGSTRING("TSY: CMmPhoneTsy::TimerExpired - aPBStore == aObject");
  6026             //call the complete method
  5979             //call the complete method
  6027 			pbStore->Complete( aReqHandleType, error );
  5980 			pbStore->Complete( aReqHandleType, error );
  6028             //object found, break
  5981             //object found, break
  6029             break;
  5982             break;
  6030             }
  5983             }
  6031         }
  5984         }
  6032 
  5985 
  6033     // Check if the object is the SMS object
  5986     // Check if the object is the SMS object
  6034     if ( iMmSmsTsy == aObject )
  5987     if ( iMmSmsTsy == aObject )
  6035         {
  5988         {
  6036 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_TIMEREXPIRED_7, "TSY: CMmPhoneTsy::TimerExpired - iMmSmsTsy == aObject");
  5989 TFLOGSTRING("TSY: CMmPhoneTsy::TimerExpired - iMmSmsTsy == aObject");
  6037         //call the complete method
  5990         //call the complete method
  6038         iMmSmsTsy->Complete( aReqHandleType, error );
  5991         iMmSmsTsy->Complete( aReqHandleType, error );
  6039         }
  5992         }
  6040     // Check if the object is the Broadcast object
  5993     // Check if the object is the Broadcast object
  6041     else if ( iMmBroadcastTsy == aObject )
  5994     else if ( iMmBroadcastTsy == aObject )
  6042         {
  5995         {
  6043 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_TIMEREXPIRED_8, "TSY: CMmPhoneTsy::TimerExpired - iMmBroadcastTsy == aObject");
  5996 TFLOGSTRING("TSY: CMmPhoneTsy::TimerExpired - iMmBroadcastTsy == aObject");
  6044         //call the complete method
  5997         //call the complete method
  6045         iMmBroadcastTsy->Complete( aReqHandleType, error );
  5998         iMmBroadcastTsy->Complete( aReqHandleType, error );
  6046         }
  5999         }
  6047     // Check if the object is the USSD object
  6000     // Check if the object is the USSD object
  6048     else if ( iMmUssdTsy == aObject )
  6001     else if ( iMmUssdTsy == aObject )
  6049         {
  6002         {
  6050 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_TIMEREXPIRED_9, "TSY: CMmPhoneTsy::TimerExpired - iMmUssdTsy == aObject");
  6003 TFLOGSTRING("TSY: CMmPhoneTsy::TimerExpired - iMmUssdTsy == aObject");
  6051         //call the complete method
  6004         //call the complete method
  6052         iMmUssdTsy->Complete( aReqHandleType, error );
  6005         iMmUssdTsy->Complete( aReqHandleType, error );
  6053         }
  6006         }
  6054     // Check if the object is the ONstore object
  6007     // Check if the object is the ONstore object
  6055     else if ( iMmONStoreTsy == aObject )
  6008     else if ( iMmONStoreTsy == aObject )
  6056         {
  6009         {
  6057 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_TIMEREXPIRED_10, "TSY: CMmPhoneTsy::TimerExpired - iMmONStoreTsy == aObject");
  6010 TFLOGSTRING("TSY: CMmPhoneTsy::TimerExpired - iMmONStoreTsy == aObject");
  6058         //call the complete method
  6011         //call the complete method
  6059         iMmONStoreTsy->Complete( aReqHandleType, error );
  6012         iMmONStoreTsy->Complete( aReqHandleType, error );
  6060         }
  6013         }
  6061     // Check if the object is the ENstore object
  6014     // Check if the object is the ENstore object
  6062     else if ( iMmENStoreTsy == aObject )
  6015     else if ( iMmENStoreTsy == aObject )
  6063         {
  6016         {
  6064 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_TIMEREXPIRED_11, "TSY: CMmPhoneTsy::TimerExpired - iMmENStoreTsy == aObject");
  6017 TFLOGSTRING("TSY: CMmPhoneTsy::TimerExpired - iMmENStoreTsy == aObject");
  6065         //call the complete method
  6018         //call the complete method
  6066         iMmENStoreTsy->Complete( aReqHandleType, error );
  6019         iMmENStoreTsy->Complete( aReqHandleType, error );
  6067         }
  6020         }
  6068     else if ( iMmCustomTsy == aObject )
  6021     else if ( iMmCustomTsy == aObject )
  6069         {
  6022         {
  6070 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_TIMEREXPIRED_12, "TSY: CMmPhoneTsy::TimerExpired - iMmCustomTsy == aObject");
  6023 TFLOGSTRING("TSY: CMmPhoneTsy::TimerExpired - iMmCustomTsy == aObject");
  6071         iMmCustomTsy->Complete( aReqHandleType, error , aIPC );
  6024         iMmCustomTsy->Complete( aReqHandleType, error , aIPC );
  6072         }
  6025         }
  6073 
  6026 
  6074     //THESE DO NOT USE REQ HANDLE STORE -> CANNOT USE TIMER
  6027     //THESE DO NOT USE REQ HANDLE STORE -> CANNOT USE TIMER
  6075     // SAT
  6028     // SAT
  6077     // If Packet Data is included, complete method from Packet Service TSY
  6030     // If Packet Data is included, complete method from Packet Service TSY
  6078     // must be called to handler completes if aObject is part of Packet
  6031     // must be called to handler completes if aObject is part of Packet
  6079     // Data session
  6032     // Data session
  6080     else if ( NULL != iMmPacketServiceTsy )
  6033     else if ( NULL != iMmPacketServiceTsy )
  6081         {
  6034         {
  6082 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_TIMEREXPIRED_13, "TSY: CMmPhoneTsy::TimerExpired - NULL != iMmPacketServiceTsy");
  6035 TFLOGSTRING("TSY: CMmPhoneTsy::TimerExpired - NULL != iMmPacketServiceTsy");
  6083         //call the complete method
  6036         //call the complete method
  6084         iMmPacketServiceTsy->Complete( aObject, aReqHandleType, error );
  6037         iMmPacketServiceTsy->Complete( aObject, aReqHandleType, error );
  6085         }
  6038         }
  6086     else
  6039     else
  6087     	{
  6040     	{
  6088 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_TIMEREXPIRED_14, "TSY: CMmPhoneTsy::TimerExpired - else");
  6041 TFLOGSTRING("TSY: CMmPhoneTsy::TimerExpired - else");		
  6089         }
  6042         }
  6090     }
  6043     }
  6091 
  6044 
  6092 // ---------------------------------------------------------------------------
  6045 // ---------------------------------------------------------------------------
  6093 // CMmPhoneTsy::SetTypeOfResponse
  6046 // CMmPhoneTsy::SetTypeOfResponse
  6118             timeOut = KMmPhoneStopDTMFToneTimeOut;
  6071             timeOut = KMmPhoneStopDTMFToneTimeOut;
  6119             break;
  6072             break;
  6120       // All Calls Termination
  6073       // All Calls Termination
  6121         case EMultimodePhoneTerminateAllCalls:
  6074         case EMultimodePhoneTerminateAllCalls:
  6122             timeOut = KMmPhoneTerminateAllCallsTimeOut;
  6075             timeOut = KMmPhoneTerminateAllCallsTimeOut;
  6123             break;
       
  6124       // Active Calls Termination
       
  6125         case EMultimodePhoneTerminateActiveCalls:
       
  6126             timeOut = KMmPhoneTerminateActiveCallsTimeOut;
       
  6127             break;
  6076             break;
  6128       //NET
  6077       //NET
  6129         case EMultimodePhoneSelectNetwork:
  6078         case EMultimodePhoneSelectNetwork:
  6130             timeOut = KMmPhoneSelectNetworkTimeOut;
  6079             timeOut = KMmPhoneSelectNetworkTimeOut;
  6131             break;
  6080             break;
  6321 	RMobilePhone::TMobilePhoneLockSetting setting;
  6270 	RMobilePhone::TMobilePhoneLockSetting setting;
  6322 	RMobilePhone::TMobilePhoneCspFileV1 emptyCspFile;
  6271 	RMobilePhone::TMobilePhoneCspFileV1 emptyCspFile;
  6323 	RMobilePhone::TMobilePhoneServiceTableV1 emptyServiceTable;
  6272 	RMobilePhone::TMobilePhoneServiceTableV1 emptyServiceTable;
  6324 	RMobilePhoneStore::TMobilePhoneStoreInfoV1 emptyPhoneStoreInfo;
  6273 	RMobilePhoneStore::TMobilePhoneStoreInfoV1 emptyPhoneStoreInfo;
  6325 	TInt trapError = KErrNone;
  6274 	TInt trapError = KErrNone;
  6326 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETE_1, "TSY: CMmPhoneTsy::Complete - ReqHandleType: %d", aReqHandleType);
  6275 TFLOGSTRING2("TSY: CMmPhoneTsy::Complete - ReqHandleType: %d", aReqHandleType);	
  6327     switch( aReqHandleType )
  6276     switch( aReqHandleType )
  6328         {
  6277         {
  6329         case EMultimodePhoneTerminateAllCalls:
  6278         case EMultimodePhoneTerminateAllCalls:
  6330         	CompleteTerminateAllCallsReq(aError);
  6279         	CompleteTerminateAllCallsReq(aError);
  6331         	break;
  6280         	break;
  6332         case EMultimodePhoneTerminateActiveCalls:
       
  6333             CompleteTerminateActiveCallsReq(aError);
       
  6334             break;
       
  6335       //DTMF
  6281       //DTMF
  6336         case EMultimodePhoneSendDTMFTones:
  6282         case EMultimodePhoneSendDTMFTones:
  6337         case EMultimodePhoneStartDTMFTone:
  6283         case EMultimodePhoneStartDTMFTone:
  6338         case EMultimodePhoneStopDTMFTone:
  6284         case EMultimodePhoneStopDTMFTone:
  6339 			// forward to DTMF Tsy
  6285 			// forward to DTMF Tsy
  6454             break;     
  6400             break;     
  6455         case EMultimodePhoneGetFdnStatus:
  6401         case EMultimodePhoneGetFdnStatus:
  6456             CompleteGetFdnStatus( NULL, aError );
  6402             CompleteGetFdnStatus( NULL, aError );
  6457             break;         
  6403             break;         
  6458         default:
  6404         default:
  6459 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETE_2, "TSY: CMmPhoneTsy::Complete default handle type" );
  6405 TFLOGSTRING("TSY: CMmPhoneTsy::Complete default handle type" );        
  6460             if ( iTsyReqHandleStore->GetTsyReqHandle(
  6406             if ( iTsyReqHandleStore->GetTsyReqHandle(
  6461                     aReqHandleType ))
  6407                     aReqHandleType ))
  6462             	{
  6408             	{
  6463             	ReqCompleted( iTsyReqHandleStore->ResetTsyReqHandle(
  6409             	ReqCompleted( iTsyReqHandleStore->ResetTsyReqHandle(
  6464                     aReqHandleType ), aError );
  6410                     aReqHandleType ), aError );
  6539 //
  6485 //
  6540 void CMmPhoneTsy::ReqCompleted(
  6486 void CMmPhoneTsy::ReqCompleted(
  6541     const TTsyReqHandle aTsyReqHandle,
  6487     const TTsyReqHandle aTsyReqHandle,
  6542     const TInt aError  )
  6488     const TInt aError  )
  6543     {
  6489     {
  6544 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_REQCOMPLETED_1, "TSY: CMmPhoneTsy::Request Completed - Handle:%d Error:%d", aTsyReqHandle, aError);
  6490 TFLOGSTRING3("TSY: CMmPhoneTsy::Request Completed - Handle:%d Error:%d", aTsyReqHandle, aError);
  6545 
  6491 
  6546     CTelObject::ReqCompleted( aTsyReqHandle, aError );
  6492     CTelObject::ReqCompleted( aTsyReqHandle, aError );
  6547 
  6493 
  6548     }
  6494     }
  6549 #endif
  6495 #endif
  6766 //
  6712 //
  6767 CMmSecurityTsy* CMmPhoneTsy::GetSecurityTsy()
  6713 CMmSecurityTsy* CMmPhoneTsy::GetSecurityTsy()
  6768     {
  6714     {
  6769     return iMmSecurityTsy;
  6715     return iMmSecurityTsy;
  6770     }
  6716     }
  6771 
       
  6772 
  6717 
  6773 // ---------------------------------------------------------------------------
  6718 // ---------------------------------------------------------------------------
  6774 // CMmPhoneTsy::IsRequestPossibleInOffLine
  6719 // CMmPhoneTsy::IsRequestPossibleInOffLine
  6775 // Checks wether a ETel request can be performed or not while offline mode is
  6720 // Checks wether a ETel request can be performed or not while offline mode is
  6776 // enabled'
  6721 // enabled'
  6897             
  6842             
  6898         default:
  6843         default:
  6899             break;
  6844             break;
  6900         }
  6845         }
  6901 
  6846 
  6902 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_ISREQUESTPOSSIBLEINOFFLINE_1, "TSY: CMmPhoneTsy::IsRequestPossibleInOffline - IPC:%d, ret:%d", aIpc, isRequestPossible);
  6847 TFLOGSTRING3("TSY: CMmPhoneTsy::IsRequestPossibleInOffline - IPC:%d, ret:%d", aIpc, isRequestPossible);
  6903     return isRequestPossible;
  6848     return isRequestPossible;
  6904     }
  6849     }
  6905 
  6850 
  6906 // ----------------------------------------------------------------------------
  6851 // ----------------------------------------------------------------------------
  6907 // CMmPhoneTsy::CompleteGetCallForwardingNumber
  6852 // CMmPhoneTsy::CompleteGetCallForwardingNumber
  6914     {
  6859     {
  6915     //Copy data from package
  6860     //Copy data from package
  6916     iCallForwardingNumber.Zero();
  6861     iCallForwardingNumber.Zero();
  6917     aDataPackage->UnPackData( iCallForwardingNumber );
  6862     aDataPackage->UnPackData( iCallForwardingNumber );
  6918 
  6863 
  6919 OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETCALLFORWARDINGNUMBER_1, "TSY: CMmPhoneTsy::CompleteGetCallForwardingNumber number = %S ", iCallForwardingNumber);
  6864 TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteGetCallForwardingNumber number = %S ", &iCallForwardingNumber);
  6920 
  6865 
  6921     }
  6866     }
  6922 
  6867 
  6923 // ---------------------------------------------------------------------------
  6868 // ---------------------------------------------------------------------------
  6924 // CMmPhoneTsy::EnumerateAPNEntriesL
  6869 // CMmPhoneTsy::EnumerateAPNEntriesL
  6928 //
  6873 //
  6929 TInt CMmPhoneTsy::EnumerateAPNEntriesL( 
  6874 TInt CMmPhoneTsy::EnumerateAPNEntriesL( 
  6930     const TTsyReqHandle aTsyReqHandle, 
  6875     const TTsyReqHandle aTsyReqHandle, 
  6931     TUint32* aIndex )
  6876     TUint32* aIndex )
  6932     {
  6877     {
  6933 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_ENUMERATEAPNENTRIESL_1, "TSY: CMmPhoneTsy::EnumerateAPNEntries");
  6878 TFLOGSTRING("TSY: CMmPhoneTsy::EnumerateAPNEntries");
  6934 
  6879 
  6935     // Check if request handle already exists
  6880     // Check if request handle already exists
  6936     TTsyReqHandle reqHandle = iTsyReqHandleStore->GetTsyReqHandle( 
  6881     TTsyReqHandle reqHandle = iTsyReqHandleStore->GetTsyReqHandle( 
  6937         EMultimodePhoneEnumerateAPNEntries );
  6882         EMultimodePhoneEnumerateAPNEntries );
  6938     
  6883     
  6980 // (other items were commented in a header).
  6925 // (other items were commented in a header).
  6981 // ---------------------------------------------------------------------------
  6926 // ---------------------------------------------------------------------------
  6982 //
  6927 //
  6983 TInt CMmPhoneTsy::EnumerateAPNEntriesCancel()
  6928 TInt CMmPhoneTsy::EnumerateAPNEntriesCancel()
  6984     {
  6929     {
  6985 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_ENUMERATEAPNENTRIESCANCEL_1, "CMmPhoneTsy::EnumerateAPNEntriesCancel");
  6930 TFLOGSTRING("CMmPhoneTsy::EnumerateAPNEntriesCancel");
  6986     iRetAPNEntries = NULL;
  6931     iRetAPNEntries = NULL;
  6987     
  6932     
  6988     //reset the req handle
  6933     //reset the req handle
  6989     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
  6934     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
  6990         EMultimodePhoneEnumerateAPNEntries );
  6935         EMultimodePhoneEnumerateAPNEntries );
  7006 //
  6951 //
  7007 void CMmPhoneTsy::CompleteEnumerateAPNEntries( 
  6952 void CMmPhoneTsy::CompleteEnumerateAPNEntries( 
  7008     CMmDataPackage* aDataPackage, 
  6953     CMmDataPackage* aDataPackage, 
  7009     TInt aErrorCode )
  6954     TInt aErrorCode )
  7010     {
  6955     {
  7011 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEENUMERATEAPNENTRIES_1, "TSY: CMmPhoneTsy::CompleteEnumerateAPNEntries Error: %d", aErrorCode);
  6956 TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteEnumerateAPNEntries Error: %d", aErrorCode);
  7012 
  6957 
  7013     //reset req handle. Returns the deleted req handle
  6958     //reset req handle. Returns the deleted req handle
  7014     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
  6959     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
  7015         EMultimodePhoneEnumerateAPNEntries );
  6960         EMultimodePhoneEnumerateAPNEntries );
  7016 
  6961 
  7042 TInt CMmPhoneTsy::GetAPNnameL( 
  6987 TInt CMmPhoneTsy::GetAPNnameL( 
  7043     const TTsyReqHandle aTsyReqHandle, 
  6988     const TTsyReqHandle aTsyReqHandle, 
  7044     TUint32* aIndex, 
  6989     TUint32* aIndex, 
  7045     TDes8* aAPN )
  6990     TDes8* aAPN )
  7046     {
  6991     {
  7047 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETAPNNAMEL_1, "TSY: CMmPhoneTsy::GetAPNnameL");
  6992 TFLOGSTRING("TSY: CMmPhoneTsy::GetAPNnameL");    
  7048 
  6993 
  7049     TInt ret = KErrServerBusy;
  6994     TInt ret = KErrServerBusy;
  7050     
  6995     
  7051     // Check if request handle already exists
  6996     // Check if request handle already exists
  7052     TTsyReqHandle reqHandle = iTsyReqHandleStore->GetTsyReqHandle( 
  6997     TTsyReqHandle reqHandle = iTsyReqHandleStore->GetTsyReqHandle( 
  7096 // (other items were commented in a header).
  7041 // (other items were commented in a header).
  7097 // ---------------------------------------------------------------------------
  7042 // ---------------------------------------------------------------------------
  7098 //
  7043 //
  7099 TInt CMmPhoneTsy::GetAPNnameCancel()
  7044 TInt CMmPhoneTsy::GetAPNnameCancel()
  7100     {
  7045     {
  7101 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETAPNNAMECANCEL_1, "CMmPhoneTsy::GetAPNnameCancel");
  7046 TFLOGSTRING("CMmPhoneTsy::GetAPNnameCancel");
  7102     iRetAPNname = NULL;
  7047     iRetAPNname = NULL;
  7103     
  7048     
  7104     //reset the req handle
  7049     //reset the req handle
  7105     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
  7050     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
  7106         EMultimodePhoneGetAPNname );
  7051         EMultimodePhoneGetAPNname );
  7122 //
  7067 //
  7123 void CMmPhoneTsy::CompleteGetAPNname( 
  7068 void CMmPhoneTsy::CompleteGetAPNname( 
  7124     CMmDataPackage* aDataPackage, 
  7069     CMmDataPackage* aDataPackage, 
  7125     TInt aErrorCode )
  7070     TInt aErrorCode )
  7126     {
  7071     {
  7127 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETAPNNAME_1, "TSY: CMmPhoneTsy::CompleteGetAPNname Error: %d", aErrorCode);
  7072 TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteGetAPNname Error: %d", aErrorCode);
  7128     
  7073     
  7129     //reset req handle. Returns the deleted req handle
  7074     //reset req handle. Returns the deleted req handle
  7130     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
  7075     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
  7131         EMultimodePhoneGetAPNname );
  7076         EMultimodePhoneGetAPNname );
  7132 
  7077 
  7164 // ---------------------------------------------------------------------------
  7109 // ---------------------------------------------------------------------------
  7165 //
  7110 //
  7166 void CMmPhoneTsy::SetAlsState( 
  7111 void CMmPhoneTsy::SetAlsState( 
  7167 	TBool aState )
  7112 	TBool aState )
  7168 	{
  7113 	{
  7169 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_SETALSSTATE_1, "TSY: CMmPhoneTsy::SetAlsState Error: %d", aState);
  7114 TFLOGSTRING2("TSY: CMmPhoneTsy::SetAlsState Error: %d", aState);
  7170 	
  7115 	
  7171 	// Check where set was called
  7116 	// Check where set was called
  7172 	if( iCspFileAlsSet )
  7117 	if( iCspFileAlsSet )
  7173 	    {
  7118 	    {
  7174 	    // Set Csp file's ALS state
  7119 	    // Set Csp file's ALS state
  7201 // ---------------------------------------------------------------------------
  7146 // ---------------------------------------------------------------------------
  7202 //
  7147 //
  7203 RMobilePhone::TMobilePhoneALSLine CMmPhoneTsy::MapMEALSLine( 
  7148 RMobilePhone::TMobilePhoneALSLine CMmPhoneTsy::MapMEALSLine( 
  7204 	TInt aAlsLineInfo )
  7149 	TInt aAlsLineInfo )
  7205 	{
  7150 	{
  7206 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_MAPMEALSLINE_1, "TSY: CMmPhoneTsy::MapMEALSLine");
  7151 TFLOGSTRING("TSY: CMmPhoneTsy::MapMEALSLine");
  7207 
  7152 
  7208 	RMobilePhone::TMobilePhoneALSLine lineInfo;
  7153 	RMobilePhone::TMobilePhoneALSLine lineInfo;
  7209 	
  7154 	
  7210 	switch ( aAlsLineInfo )
  7155 	switch ( aAlsLineInfo )
  7211 		{
  7156 		{
  7212 		case 0://TInt from CentRep
  7157 		case 0://TInt from CentRep
  7213 			lineInfo = RMobilePhone::EAlternateLinePrimary;
  7158 			lineInfo = RMobilePhone::EAlternateLinePrimary;
  7214 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_MAPMEALSLINE_2, "TSY: CMmPhoneTsy::MapMEALSInfo Line line = EAlternateLinePrimary");
  7159 TFLOGSTRING("TSY: CMmPhoneTsy::MapMEALSInfo Line line = EAlternateLinePrimary");
  7215 			break;
  7160 			break;
  7216 		case 1://TInt from CentRep
  7161 		case 1://TInt from CentRep
  7217 			lineInfo = RMobilePhone::EAlternateLineAuxiliary;
  7162 			lineInfo = RMobilePhone::EAlternateLineAuxiliary;
  7218 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_MAPMEALSLINE_3, "TSY: CMmPhoneTsy::MapMEALSLine line = EAlternateLineAuxiliary");
  7163 TFLOGSTRING("TSY: CMmPhoneTsy::MapMEALSLine line = EAlternateLineAuxiliary");
  7219 			break;
  7164 			break;
  7220 		case 2://TInt from CentRep
  7165 		case 2://TInt from CentRep
  7221 			lineInfo = RMobilePhone::EAlternateLineUnknown;
  7166 			lineInfo = RMobilePhone::EAlternateLineUnknown;
  7222 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_MAPMEALSLINE_4, "TSY: CMmPhoneTsy::MapMEALSLine line = EAlternateLineUnknown");
  7167 TFLOGSTRING("TSY: CMmPhoneTsy::MapMEALSLine line = EAlternateLineUnknown");
  7223 			break;
  7168 			break;
  7224 		case 3://TInt from CentRep
  7169 		case 3://TInt from CentRep
  7225 			lineInfo = RMobilePhone::EAlternateLineNotAvailable;
  7170 			lineInfo = RMobilePhone::EAlternateLineNotAvailable;
  7226 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_MAPMEALSLINE_5, "TSY: CMmPhoneTsy::MapMEALSLine line = EAlternateLineNotAvailable");
  7171 TFLOGSTRING("TSY: CMmPhoneTsy::MapMEALSLine line = EAlternateLineNotAvailable");
  7227 			break;
  7172 			break;
  7228 		default:
  7173 		default:
  7229 			lineInfo = RMobilePhone::EAlternateLineUnknown;
  7174 			lineInfo = RMobilePhone::EAlternateLineUnknown;
  7230 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_MAPMEALSLINE_6, "TSY: CMmPhoneTsy::MapMEALSLine line = EAlternateLineUnknown");
  7175 TFLOGSTRING("TSY: CMmPhoneTsy::MapMEALSLine line = EAlternateLineUnknown");
  7231 			break;
  7176 			break;
  7232 		}
  7177 		}
  7233 		
  7178 		
  7234 	return lineInfo;
  7179 	return lineInfo;
  7235 	}
  7180 	}
  7241 // ---------------------------------------------------------------------------
  7186 // ---------------------------------------------------------------------------
  7242 //
  7187 //
  7243 void CMmPhoneTsy::ResetMEAlsInfo()
  7188 void CMmPhoneTsy::ResetMEAlsInfo()
  7244 	{
  7189 	{
  7245 	
  7190 	
  7246 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_RESETMEALSINFO_1, "TSY: CMmPhoneTsy::ResetMEAlsInfo");
  7191 TFLOGSTRING("TSY: CMmPhoneTsy::ResetMEAlsInfo");
  7247 	
  7192 	
  7248 	iCentRep->Reset();
  7193 	iCentRep->Reset();
  7249 	
  7194 	
  7250 	if( iSimCacheQueue && ( KCacheALSline & iSimCacheQueue ) )
  7195 	if( iSimCacheQueue && ( KCacheALSline & iSimCacheQueue ) )
  7251 	    { 
  7196 	    { 
  7252 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_RESETMEALSINFO_2, "TSY: CMmPhoneTsy::ResetMEAlsInfo -> CompleteCacheSimL");
  7197 TFLOGSTRING("TSY: CMmPhoneTsy::ResetMEAlsInfo -> CompleteCacheSimL");
  7253         // function can leave, so there for it must be trapped, the error 
  7198         // function can leave, so there for it must be trapped, the error 
  7254         // value is ingnored, because the functionality doesn't depend on it
  7199         // value is ingnored, because the functionality doesn't depend on it
  7255 	    TRAP_IGNORE( CompleteCacheSimL( KCacheALSline, EFalse ) );	
  7200 	    TRAP_IGNORE( CompleteCacheSimL( KCacheALSline, EFalse ) );	
  7256 	    }
  7201 	    }
  7257 	
  7202 	
  7263 // (other items were commented in a header).
  7208 // (other items were commented in a header).
  7264 // ---------------------------------------------------------------------------
  7209 // ---------------------------------------------------------------------------
  7265 //
  7210 //
  7266 CRepository* CMmPhoneTsy::GetCfisCenRep()
  7211 CRepository* CMmPhoneTsy::GetCfisCenRep()
  7267 	{
  7212 	{
  7268 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETCFISCENREP_1, "TSY: CMmPhoneTsy::GetCfisCenRep");
  7213 TFLOGSTRING("TSY: CMmPhoneTsy::GetCfisCenRep");
  7269 
  7214 
  7270 	if( iCFISCentRep )
  7215 	if( iCFISCentRep )
  7271 		{
  7216 		{
  7272 		return iCFISCentRep;
  7217 		return iCFISCentRep;
  7273 		}
  7218 		}
  7281 // (other items were commented in a header).
  7226 // (other items were commented in a header).
  7282 // ---------------------------------------------------------------------------
  7227 // ---------------------------------------------------------------------------
  7283 //
  7228 //
  7284 CRepository* CMmPhoneTsy::GetMwisCenRep()
  7229 CRepository* CMmPhoneTsy::GetMwisCenRep()
  7285 	{
  7230 	{
  7286 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETMWISCENREP_1, "TSY: CMmPhoneTsy::GetMwisCenRep");
  7231 TFLOGSTRING("TSY: CMmPhoneTsy::GetMwisCenRep");
  7287 
  7232 
  7288 	if( iMWISCentRep )
  7233 	if( iMWISCentRep )
  7289 		{
  7234 		{
  7290 		return iMWISCentRep;
  7235 		return iMWISCentRep;
  7291 		}
  7236 		}
  7299 // (other items were commented in a header).
  7244 // (other items were commented in a header).
  7300 // ---------------------------------------------------------------------------
  7245 // ---------------------------------------------------------------------------
  7301 //
  7246 //
  7302 CRepository* CMmPhoneTsy::GetCfisPRCenRep()
  7247 CRepository* CMmPhoneTsy::GetCfisPRCenRep()
  7303 	{
  7248 	{
  7304 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETCFISPRCENREP_1, "TSY: CMmPhoneTsy::GetCfisPRCenRep");
  7249 TFLOGSTRING("TSY: CMmPhoneTsy::GetCfisPRCenRep");
  7305 
  7250 
  7306 	if( iCFISPrivateCentRep )
  7251 	if( iCFISPrivateCentRep )
  7307 		{
  7252 		{
  7308 		return iCFISPrivateCentRep;
  7253 		return iCFISPrivateCentRep;
  7309 		}
  7254 		}
  7317 // (other items were commented in a header).
  7262 // (other items were commented in a header).
  7318 // ---------------------------------------------------------------------------
  7263 // ---------------------------------------------------------------------------
  7319 //
  7264 //
  7320 void CMmPhoneTsy::GetSubscriberIdForTSYL()
  7265 void CMmPhoneTsy::GetSubscriberIdForTSYL()
  7321     {
  7266     {
  7322 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETSUBSCRIBERIDFORTSYL_1, "TSY: CMmPhoneTsy::GetSubscriberIdForTSYL");
  7267 TFLOGSTRING("TSY: CMmPhoneTsy::GetSubscriberIdForTSYL");
  7323     
  7268     
  7324     // Check if some client has already requested this
  7269     // Check if some client has already requested this
  7325     TTsyReqHandle reqHandle = iTsyReqHandleStore->GetTsyReqHandle( 
  7270     TTsyReqHandle reqHandle = iTsyReqHandleStore->GetTsyReqHandle( 
  7326         EMultimodePhoneGetSubscriberId );
  7271         EMultimodePhoneGetSubscriberId );
  7327     
  7272     
  7331         iTSYSubscriberIdReq = ETrue;
  7276         iTSYSubscriberIdReq = ETrue;
  7332         iMessageManager->HandleRequestL( EMobilePhoneGetSubscriberId );
  7277         iMessageManager->HandleRequestL( EMobilePhoneGetSubscriberId );
  7333         }
  7278         }
  7334     else
  7279     else
  7335         {
  7280         {
  7336 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETSUBSCRIBERIDFORTSYL_2, "TSY: CMmPhoneTsy::GetSubscriberIdForTSYL - Already requested");
  7281 TFLOGSTRING("TSY: CMmPhoneTsy::GetSubscriberIdForTSYL - Already requested");
  7337         }
  7282         }
  7338     }
  7283     }
  7339 	
  7284 	
  7340 // ---------------------------------------------------------------------------
  7285 // ---------------------------------------------------------------------------
  7341 // CMmPhoneTsy::AppendAPNNameL
  7286 // CMmPhoneTsy::AppendAPNNameL
  7344 // ---------------------------------------------------------------------------
  7289 // ---------------------------------------------------------------------------
  7345 //
  7290 //
  7346 TInt CMmPhoneTsy::AppendAPNNameL( 
  7291 TInt CMmPhoneTsy::AppendAPNNameL( 
  7347     RMobilePhone::TAPNEntryV3* aAPNEntry )
  7292     RMobilePhone::TAPNEntryV3* aAPNEntry )
  7348     {
  7293     {
  7349 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_APPENDAPNNAMEL_1, "TSY: CMmPhoneTsy::AppendAPNNameL");
  7294 TFLOGSTRING("TSY: CMmPhoneTsy::AppendAPNNameL");
  7350 
  7295 
  7351     TInt ret ( KErrServerBusy );
  7296     TInt ret ( KErrServerBusy );
  7352 
  7297 
  7353     //check if handle is not in use already
  7298     //check if handle is not in use already
  7354     TTsyReqHandle phoneAppendAPNNameHandle =
  7299     TTsyReqHandle phoneAppendAPNNameHandle =
  7377 // (other items were commented in a header).
  7322 // (other items were commented in a header).
  7378 // ---------------------------------------------------------------------------
  7323 // ---------------------------------------------------------------------------
  7379 //
  7324 //
  7380 TInt CMmPhoneTsy::AppendAPNNameCancel()
  7325 TInt CMmPhoneTsy::AppendAPNNameCancel()
  7381     {
  7326     {
  7382 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_APPENDAPNNAMECANCEL_1, "TSY: CMmPhoneTsy::AppendAPNNameCancel");
  7327 TFLOGSTRING("TSY: CMmPhoneTsy::AppendAPNNameCancel");
  7383     // reset the reqhandle
  7328     // reset the reqhandle
  7384     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
  7329     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
  7385         EMultimodePhoneAppendAPNName );
  7330         EMultimodePhoneAppendAPNName );
  7386     
  7331     
  7387     if ( EMultimodePhoneReqHandleUnknown != reqHandle )
  7332     if ( EMultimodePhoneReqHandleUnknown != reqHandle )
  7400 // ---------------------------------------------------------------------------
  7345 // ---------------------------------------------------------------------------
  7401 //
  7346 //
  7402 void CMmPhoneTsy::CompleteAppendAPNName( 
  7347 void CMmPhoneTsy::CompleteAppendAPNName( 
  7403     TInt aErrorCode )
  7348     TInt aErrorCode )
  7404     {
  7349     {
  7405 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEAPPENDAPNNAME_1, "TSY: CMmPhoneTsy::CompleteAppendAPNName. Error: %d", aErrorCode);
  7350 TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteAppendAPNName. Error: %d", aErrorCode);
  7406     
  7351     
  7407     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
  7352     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
  7408         EMultimodePhoneAppendAPNName );
  7353         EMultimodePhoneAppendAPNName );
  7409     
  7354     
  7410     if ( EMultimodePhoneReqHandleUnknown != reqHandle )
  7355     if ( EMultimodePhoneReqHandleUnknown != reqHandle )
  7421 //
  7366 //
  7422 TInt CMmPhoneTsy::DeleteAPNNameL( 
  7367 TInt CMmPhoneTsy::DeleteAPNNameL( 
  7423     const TTsyReqHandle aTsyReqHandle, 
  7368     const TTsyReqHandle aTsyReqHandle, 
  7424     TUint32* aIndex )
  7369     TUint32* aIndex )
  7425     {
  7370     {
  7426 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_DELETEAPNNAMEL_1, "TSY: CMmPhoneTsy::DeleteAPNNameL, index = %d", aIndex);
  7371 TFLOGSTRING2("TSY: CMmPhoneTsy::DeleteAPNNameL, index = %d", aIndex);
  7427 
  7372 
  7428     // get the handle
  7373     // get the handle
  7429     TTsyReqHandle reqHandle = iTsyReqHandleStore->GetTsyReqHandle( 
  7374     TTsyReqHandle reqHandle = iTsyReqHandleStore->GetTsyReqHandle( 
  7430         EMultimodePhoneDeleteAPNName );
  7375         EMultimodePhoneDeleteAPNName );
  7431 
  7376 
  7461 // (other items were commented in a header).
  7406 // (other items were commented in a header).
  7462 // ---------------------------------------------------------------------------
  7407 // ---------------------------------------------------------------------------
  7463 //
  7408 //
  7464 TInt CMmPhoneTsy::DeleteAPNNameCancel()
  7409 TInt CMmPhoneTsy::DeleteAPNNameCancel()
  7465     {
  7410     {
  7466 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_DELETEAPNNAMECANCEL_1, "TSY: CMmPhoneTsy::DeleteAPNNameCancel");
  7411 TFLOGSTRING("TSY: CMmPhoneTsy::DeleteAPNNameCancel");
  7467     // reset the reqhandle
  7412     // reset the reqhandle
  7468     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
  7413     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
  7469         EMultimodePhoneDeleteAPNName );
  7414         EMultimodePhoneDeleteAPNName );
  7470 
  7415 
  7471     if ( EMultimodePhoneReqHandleUnknown != reqHandle )
  7416     if ( EMultimodePhoneReqHandleUnknown != reqHandle )
  7483 // ---------------------------------------------------------------------------
  7428 // ---------------------------------------------------------------------------
  7484 //
  7429 //
  7485 void CMmPhoneTsy::CompleteDeleteAPNName( 
  7430 void CMmPhoneTsy::CompleteDeleteAPNName( 
  7486     TInt aErrorCode )
  7431     TInt aErrorCode )
  7487     {
  7432     {
  7488 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEDELETEAPNNAME_1, "TSY: CMmPhoneTsy::CompleteDeleteAPNName. Error: %d", aErrorCode);
  7433 TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteDeleteAPNName. Error: %d", aErrorCode);
  7489 
  7434 
  7490     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
  7435     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
  7491         EMultimodePhoneDeleteAPNName );
  7436         EMultimodePhoneDeleteAPNName );
  7492     
  7437     
  7493     if ( EMultimodePhoneReqHandleUnknown != reqHandle )
  7438     if ( EMultimodePhoneReqHandleUnknown != reqHandle )
  7503 // (other items were commented in a header).
  7448 // (other items were commented in a header).
  7504 // ---------------------------------------------------------------------------
  7449 // ---------------------------------------------------------------------------
  7505 //
  7450 //
  7506 TInt CMmPhoneTsy::NotifyAPNListChanged()
  7451 TInt CMmPhoneTsy::NotifyAPNListChanged()
  7507     {
  7452     {
  7508 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_NOTIFYAPNLISTCHANGED_1, "TSY: CMmPhoneTsy::NotifyAPNListChanged");
  7453 TFLOGSTRING("TSY: CMmPhoneTsy::NotifyAPNListChanged");
  7509 
  7454 
  7510     iReqHandleType = EMultimodePhoneNotifyAPNListChange;
  7455     iReqHandleType = EMultimodePhoneNotifyAPNListChange;
  7511     
  7456     
  7512     return KErrNone;
  7457     return KErrNone;
  7513     }
  7458     }
  7519 // (other items were commented in a header).
  7464 // (other items were commented in a header).
  7520 // ---------------------------------------------------------------------------
  7465 // ---------------------------------------------------------------------------
  7521 //
  7466 //
  7522 TInt CMmPhoneTsy::NotifyAPNListChangedCancel()
  7467 TInt CMmPhoneTsy::NotifyAPNListChangedCancel()
  7523     {
  7468     {
  7524 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_NOTIFYAPNLISTCHANGEDCANCEL_1, "TSY: CMmPhoneTsy::NotifyAPNListChangedCancel");
  7469 TFLOGSTRING("TSY: CMmPhoneTsy::NotifyAPNListChangedCancel");
  7525     
  7470     
  7526     TTsyReqHandle reqHandle = iTsyReqHandleStore->
  7471     TTsyReqHandle reqHandle = iTsyReqHandleStore->
  7527         ResetTsyReqHandle( EMultimodePhoneNotifyAPNListChange );
  7472         ResetTsyReqHandle( EMultimodePhoneNotifyAPNListChange );
  7528 
  7473 
  7529      if ( EMultimodePhoneReqHandleUnknown != reqHandle )
  7474      if ( EMultimodePhoneReqHandleUnknown != reqHandle )
  7541 // ---------------------------------------------------------------------------
  7486 // ---------------------------------------------------------------------------
  7542 //
  7487 //
  7543 void CMmPhoneTsy::CompleteNotifyAPNListChanged( 
  7488 void CMmPhoneTsy::CompleteNotifyAPNListChanged( 
  7544     TInt aErrorCode )
  7489     TInt aErrorCode )
  7545     {
  7490     {
  7546 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETENOTIFYAPNLISTCHANGED_1, "TSY: CMmPhoneTsy::CompleteNotifyAPNListChanged");
  7491 TFLOGSTRING("TSY: CMmPhoneTsy::CompleteNotifyAPNListChanged");
  7547 
  7492 
  7548     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
  7493     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
  7549         EMultimodePhoneNotifyAPNListChange );
  7494         EMultimodePhoneNotifyAPNListChange );
  7550 
  7495 
  7551     if( EMultimodePhoneReqHandleUnknown != reqHandle )
  7496     if( EMultimodePhoneReqHandleUnknown != reqHandle )
  7563 //
  7508 //
  7564 TInt CMmPhoneTsy::SetAPNControlListServiceStatusL( 
  7509 TInt CMmPhoneTsy::SetAPNControlListServiceStatusL( 
  7565     const TTsyReqHandle aTsyReqHandle, 
  7510     const TTsyReqHandle aTsyReqHandle, 
  7566     RMobilePhone::TAPNControlListServiceStatus* aAPNControlListServiceStatus )
  7511     RMobilePhone::TAPNControlListServiceStatus* aAPNControlListServiceStatus )
  7567     {
  7512     {
  7568 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_SETAPNCONTROLLISTSERVICESTATUSL_1, "TSY: CMmPhoneTsy::SetAPNControlListServiceStatusL.");
  7513 TFLOGSTRING("TSY: CMmPhoneTsy::SetAPNControlListServiceStatusL.");
  7569 
  7514 
  7570     iSetAclStatus = aAPNControlListServiceStatus;
  7515     iSetAclStatus = aAPNControlListServiceStatus;
  7571     
  7516     
  7572     // get the handle
  7517     // get the handle
  7573     TTsyReqHandle reqHandle = iTsyReqHandleStore->GetTsyReqHandle( 
  7518     TTsyReqHandle reqHandle = iTsyReqHandleStore->GetTsyReqHandle( 
  7605 // (other items were commented in a header).
  7550 // (other items were commented in a header).
  7606 // ---------------------------------------------------------------------------
  7551 // ---------------------------------------------------------------------------
  7607 //
  7552 //
  7608 TInt CMmPhoneTsy::SetAPNControlListServiceStatusCancel()
  7553 TInt CMmPhoneTsy::SetAPNControlListServiceStatusCancel()
  7609     {
  7554     {
  7610 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_SETAPNCONTROLLISTSERVICESTATUSCANCEL_1, "TSY: CMmPhoneTsy::SetAPNControlListServiceStatusCancel");
  7555 TFLOGSTRING("TSY: CMmPhoneTsy::SetAPNControlListServiceStatusCancel");
  7611     
  7556     
  7612     // erase pointer to client data
  7557     // erase pointer to client data
  7613     iSetAclStatus = NULL;
  7558     iSetAclStatus = NULL;
  7614 
  7559 
  7615     // reset the reqhandle
  7560     // reset the reqhandle
  7631 // ---------------------------------------------------------------------------
  7576 // ---------------------------------------------------------------------------
  7632 //
  7577 //
  7633 void CMmPhoneTsy::CompleteSetAPNControlListServiceStatus( 
  7578 void CMmPhoneTsy::CompleteSetAPNControlListServiceStatus( 
  7634     TInt aErrorCode )
  7579     TInt aErrorCode )
  7635     {
  7580     {
  7636 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETESETAPNCONTROLLISTSERVICESTATUS_1, "TSY: CMmPhoneTsy::CompleteSetAPNControlListServiceStatus. Error: %d", aErrorCode);
  7581 TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteSetAPNControlListServiceStatus. Error: %d", aErrorCode);
  7637 
  7582 
  7638     //reset req handle. Returns the deleted req handle
  7583     //reset req handle. Returns the deleted req handle
  7639     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
  7584     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
  7640         EMultimodePhoneSetAPNControlListServiceStatus );
  7585         EMultimodePhoneSetAPNControlListServiceStatus );
  7641 
  7586 
  7654 //
  7599 //
  7655 TInt CMmPhoneTsy::GetAPNControlListServiceStatusL( 
  7600 TInt CMmPhoneTsy::GetAPNControlListServiceStatusL( 
  7656     const TTsyReqHandle aTsyReqHandle, 
  7601     const TTsyReqHandle aTsyReqHandle, 
  7657     RMobilePhone::TAPNControlListServiceStatus* aAPNControlListServiceStatus )
  7602     RMobilePhone::TAPNControlListServiceStatus* aAPNControlListServiceStatus )
  7658     {
  7603     {
  7659 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETAPNCONTROLLISTSERVICESTATUSL_1, "TSY: CMmPhoneTsy::GetAPNControlListServiceStatusL");
  7604 TFLOGSTRING("TSY: CMmPhoneTsy::GetAPNControlListServiceStatusL");
  7660 
  7605 
  7661     TTsyReqHandle reqHandle = iTsyReqHandleStore->GetTsyReqHandle( 
  7606     TTsyReqHandle reqHandle = iTsyReqHandleStore->GetTsyReqHandle( 
  7662         EMultimodePhoneGetAPNControlListServiceStatus );
  7607         EMultimodePhoneGetAPNControlListServiceStatus );
  7663 
  7608 
  7664     if ( EMultimodePhoneReqHandleUnknown != reqHandle )
  7609     if ( EMultimodePhoneReqHandleUnknown != reqHandle )
  7695 // (other items were commented in a header).
  7640 // (other items were commented in a header).
  7696 // ---------------------------------------------------------------------------
  7641 // ---------------------------------------------------------------------------
  7697 //
  7642 //
  7698 TInt CMmPhoneTsy::GetAPNControlListServiceStatusCancel()
  7643 TInt CMmPhoneTsy::GetAPNControlListServiceStatusCancel()
  7699     {
  7644     {
  7700 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_GETAPNCONTROLLISTSERVICESTATUSCANCEL_1, "TSY: CMmPhoneTsy::GetAPNControlListServiceStatusCancel");
  7645 TFLOGSTRING("TSY: CMmPhoneTsy::GetAPNControlListServiceStatusCancel");
  7701     // reset the reqhandle
  7646     // reset the reqhandle
  7702     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
  7647     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
  7703         EMultimodePhoneGetAPNControlListServiceStatus );
  7648         EMultimodePhoneGetAPNControlListServiceStatus );
  7704 
  7649 
  7705     if ( EMultimodePhoneReqHandleUnknown != reqHandle )
  7650     if ( EMultimodePhoneReqHandleUnknown != reqHandle )
  7718 //
  7663 //
  7719 void CMmPhoneTsy::CompleteGetAPNControlListServiceStatus( 
  7664 void CMmPhoneTsy::CompleteGetAPNControlListServiceStatus( 
  7720     CMmDataPackage* aDataPackage, 
  7665     CMmDataPackage* aDataPackage, 
  7721     TInt aErrorCode )
  7666     TInt aErrorCode )
  7722     {
  7667     {
  7723 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETEGETAPNCONTROLLISTSERVICESTATUS_1, "TSY: CMmPhoneTsy::CompleteGetAPNControlListServiceStatus. Error %d", aErrorCode);
  7668 TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteGetAPNControlListServiceStatus. Error %d", aErrorCode);
  7724     
  7669     
  7725     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
  7670     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
  7726         EMultimodePhoneGetAPNControlListServiceStatus );
  7671         EMultimodePhoneGetAPNControlListServiceStatus );
  7727     
  7672     
  7728     if( EMultimodePhoneReqHandleUnknown != reqHandle )
  7673     if( EMultimodePhoneReqHandleUnknown != reqHandle )
  7757 // ---------------------------------------------------------------------------
  7702 // ---------------------------------------------------------------------------
  7758 //
  7703 //
  7759 TInt CMmPhoneTsy::NotifyAPNControlListServiceStatusChange( 
  7704 TInt CMmPhoneTsy::NotifyAPNControlListServiceStatusChange( 
  7760     RMobilePhone::TAPNControlListServiceStatus* aAPNControlListServiceStatus )
  7705     RMobilePhone::TAPNControlListServiceStatus* aAPNControlListServiceStatus )
  7761     {
  7706     {
  7762 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_NOTIFYAPNCONTROLLISTSERVICESTATUSCHANGE_1, "TSY: CMmPhoneTsy::NotifyAPNControlListServiceStatusChange");
  7707 TFLOGSTRING("TSY: CMmPhoneTsy::NotifyAPNControlListServiceStatusChange");
  7763     
  7708     
  7764     iRetNotifyAclStatus = aAPNControlListServiceStatus;
  7709     iRetNotifyAclStatus = aAPNControlListServiceStatus;
  7765     iReqHandleType = EMultimodePhoneNotifyAPNControlListServiceStatusChange;
  7710     iReqHandleType = EMultimodePhoneNotifyAPNControlListServiceStatusChange;
  7766     
  7711     
  7767     return KErrNone;
  7712     return KErrNone;
  7774 // (other items were commented in a header).
  7719 // (other items were commented in a header).
  7775 // ---------------------------------------------------------------------------
  7720 // ---------------------------------------------------------------------------
  7776 //
  7721 //
  7777 TInt CMmPhoneTsy::NotifyAPNControlListServiceStatusChangeCancel()
  7722 TInt CMmPhoneTsy::NotifyAPNControlListServiceStatusChangeCancel()
  7778     {
  7723     {
  7779 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_NOTIFYAPNCONTROLLISTSERVICESTATUSCHANGECANCEL_1, "TSY: CMmPhoneTsy::NotifyAPNControlListServiceStatusChangeCancel");
  7724 TFLOGSTRING("TSY: CMmPhoneTsy::NotifyAPNControlListServiceStatusChangeCancel");
  7780 
  7725 
  7781     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
  7726     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
  7782         EMultimodePhoneNotifyAPNControlListServiceStatusChange );
  7727         EMultimodePhoneNotifyAPNControlListServiceStatusChange );
  7783     
  7728     
  7784     
  7729     
  7799 //
  7744 //
  7800 void CMmPhoneTsy::CompleteNotifyAPNControlListServiceStatusChange( 
  7745 void CMmPhoneTsy::CompleteNotifyAPNControlListServiceStatusChange( 
  7801     CMmDataPackage* aDataPackage, 
  7746     CMmDataPackage* aDataPackage, 
  7802     TInt aErrorCode )
  7747     TInt aErrorCode )
  7803     {
  7748     {
  7804 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETENOTIFYAPNCONTROLLISTSERVICESTATUSCHANGE_1, "TSY: CMmPhoneTsy::CompleteNotifyAPNControlListServiceStatusChange");
  7749 TFLOGSTRING("TSY: CMmPhoneTsy::CompleteNotifyAPNControlListServiceStatusChange");
  7805 
  7750 
  7806     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
  7751     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
  7807         EMultimodePhoneNotifyAPNControlListServiceStatusChange );
  7752         EMultimodePhoneNotifyAPNControlListServiceStatusChange );
  7808 
  7753 
  7809     if( EMultimodePhoneReqHandleUnknown != reqHandle )
  7754     if( EMultimodePhoneReqHandleUnknown != reqHandle )
  7885     {
  7830     {
  7886 	TUint32 duration = KLifeTimeUpdateInterval;		
  7831 	TUint32 duration = KLifeTimeUpdateInterval;		
  7887     CMmDataPackage dataPackage;
  7832     CMmDataPackage dataPackage;
  7888     dataPackage.PackData( &duration );
  7833     dataPackage.PackData( &duration );
  7889 
  7834 
  7890     OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_COMPLETENOTIFYCALLDURATIONCHANGE_1, "TSY: CMmPhoneTsy::CompleteNotifyCallDurationChange - \duration: %d", duration);
  7835     TFLOGSTRING2("TSY: CMmPhoneTsy::CompleteNotifyCallDurationChange - \
       
  7836          duration: %d", duration);
  7891 
  7837 
  7892 #ifdef USING_CTSY_DISPATCHER	
  7838 #ifdef USING_CTSY_DISPATCHER	
  7893     TRAP_IGNORE(iMessageManager->HandleRequestL( 
  7839     TRAP_IGNORE(iMessageManager->HandleRequestL( 
  7894     				ECtsyUpdateLifeTimeReq, &dataPackage );
  7840     				ECtsyUpdateLifeTimeReq, &dataPackage );
  7895         ); 
  7841         ); 
  7903 // ---------------------------------------------------------------------------
  7849 // ---------------------------------------------------------------------------
  7904 // CMmPhoneTsy::NotifyTelephonyAudioControlError
  7850 // CMmPhoneTsy::NotifyTelephonyAudioControlError
  7905 // Receives error notifications from Telephony audio control
  7851 // Receives error notifications from Telephony audio control
  7906 // ---------------------------------------------------------------------------
  7852 // ---------------------------------------------------------------------------
  7907 //
  7853 //
  7908 #if (OST_TRACE_CATEGORY & OST_TRACE_CATEGORY_DEBUG)
  7854 #if TF_LOGGING_METHOD == 1
  7909 void CMmPhoneTsy::NotifyTelephonyAudioControlError( const TName& aCallName, 
  7855 void CMmPhoneTsy::NotifyTelephonyAudioControlError( const TName& aCallName, 
  7910                                                     const TInt& aError )
  7856                                                     const TInt& aError )
  7911     {       
  7857     {       
  7912     OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_NOTIFYTELEPHONYAUDIOCONTROLERROR_1, "TSY: CMmPhoneTsy::NotifyAudioControlError. Call name:%S, Error code %d", aCallName, aError );
  7858     TFLOGSTRING3("TSY: CMmPhoneTsy::NotifyAudioControlError. Call name:%S, Error code %d", &aCallName, aError );
  7913 #else
  7859 #else
  7914 void CMmPhoneTsy::NotifyTelephonyAudioControlError( const TName& /*aCallName*/, 
  7860 void CMmPhoneTsy::NotifyTelephonyAudioControlError( const TName& /*aCallName*/, 
  7915                                                     const TInt& /*aError*/ )
  7861                                                     const TInt& /*aError*/ )
  7916     {
  7862     {
  7917 #endif // 
  7863 #endif // TF_LOGGING_METHOD
  7918     
  7864     
  7919     TInt callCount( iCallList->GetNumberOfObjects() );
  7865     TInt callCount( iCallList->GetNumberOfObjects() );
  7920     // find all the audio calls and hang up them all
  7866     // find all the audio calls and hang up them all
  7921     for ( TInt i = callCount; 0 < i; i-- )
  7867     for ( TInt i = callCount; 0 < i; i-- )
  7922         {
  7868         {
  7939 // (other items were commented in a header).
  7885 // (other items were commented in a header).
  7940 // ---------------------------------------------------------------------------
  7886 // ---------------------------------------------------------------------------
  7941 //    
  7887 //    
  7942 void CMmPhoneTsy::SetPBInitActiveStatus( TBool aIsInitializationActive )
  7888 void CMmPhoneTsy::SetPBInitActiveStatus( TBool aIsInitializationActive )
  7943     {
  7889     {
  7944 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_SETPBINITACTIVESTATUS_1, "TSY: CMmPhoneTsy::SetPBInitActiveStatus: - prev.status %u", (TUint)iIsInitializationActive);
  7890 TFLOGSTRING2("TSY: CMmPhoneTsy::SetPBInitActiveStatus: - prev.status %i", iIsInitializationActive);    
  7945 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_SETPBINITACTIVESTATUS_2, "TSY: CMmPhoneTsy::SetPBInitActiveStatus: %u", (TUint)aIsInitializationActive);
  7891 TFLOGSTRING2("TSY: CMmPhoneTsy::SetPBInitActiveStatus: %i", aIsInitializationActive);
  7946     
  7892     
  7947     iIsInitializationActive = aIsInitializationActive;
  7893     iIsInitializationActive = aIsInitializationActive;
  7948     }
  7894     }
  7949 
  7895 
  7950 // ---------------------------------------------------------------------------
  7896 // ---------------------------------------------------------------------------
  7953 // (other items were commented in a header).
  7899 // (other items were commented in a header).
  7954 // ---------------------------------------------------------------------------
  7900 // ---------------------------------------------------------------------------
  7955 //    
  7901 //    
  7956 TBool CMmPhoneTsy::IsPBInitActive()
  7902 TBool CMmPhoneTsy::IsPBInitActive()
  7957     {   
  7903     {   
  7958 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_ISPBINITACTIVE_1, "TSY: CMmPhoneTsy::IsPBInitActive: %x", (TUint)iIsInitializationActive);
  7904 TFLOGSTRING2("TSY: CMmPhoneTsy::IsPBInitActive: %i", iIsInitializationActive);
  7959     
  7905     
  7960     return iIsInitializationActive;
  7906     return iIsInitializationActive;
  7961     }
  7907     }
  7962 
  7908 
  7963 // ---------------------------------------------------------------------------
  7909 // ---------------------------------------------------------------------------
  7986 // (other items were commented in a header).
  7932 // (other items were commented in a header).
  7987 // ---------------------------------------------------------------------------
  7933 // ---------------------------------------------------------------------------
  7988 //
  7934 //
  7989 TBool CMmPhoneTsy::IsSIMReady()
  7935 TBool CMmPhoneTsy::IsSIMReady()
  7990 	{
  7936 	{
  7991 	OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_ISSIMREADY_1, "TSY: CMmPhoneTsy::IsSIMReady: %u", (TUint)iBootState.iSIMReady);
  7937 	TFLOGSTRING2("TSY: CMmPhoneTsy::IsSIMReady: %i", iBootState.iSIMReady);
  7992 	return iBootState.iSIMReady;
  7938 	return iBootState.iSIMReady;
  7993 	}
  7939 	}
  7994 
  7940 
  7995 // ---------------------------------------------------------------------------
  7941 // ---------------------------------------------------------------------------
  7996 // CMmPhoneTsy::SaveFdnInfoDetails
  7942 // CMmPhoneTsy::SaveFdnInfoDetails
  7998 // (other items were commented in a header).
  7944 // (other items were commented in a header).
  7999 // ---------------------------------------------------------------------------
  7945 // ---------------------------------------------------------------------------
  8000 //   
  7946 //   
  8001 void CMmPhoneTsy::SaveFdnInfoDetails( TInt aResult, CMmDataPackage* aDataPackage )
  7947 void CMmPhoneTsy::SaveFdnInfoDetails( TInt aResult, CMmDataPackage* aDataPackage )
  8002     {
  7948     {
  8003 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_SAVEFDNINFODETAILS_1, "TSY: CMmPhoneTsy::SaveFdnInfoDetails aResult:  %d", aResult );
  7949 TFLOGSTRING2("TSY: CMmPhoneTsy::SaveFdnInfoDetails aResult:  %d", aResult );
  8004 
  7950 
  8005    // Store FDN info only in successfull case
  7951    // Store FDN info only in successfull case
  8006     if ( KErrNone == aResult )
  7952     if ( KErrNone == aResult )
  8007        {
  7953        {
  8008        TPBFdnInfo pbFdnInfo;
  7954        TPBFdnInfo pbFdnInfo;
  8009        aDataPackage->UnPackData( pbFdnInfo );
  7955        aDataPackage->UnPackData( pbFdnInfo );
  8010        iPhoneBookState->iFDNNumOfEntries = pbFdnInfo.iFDNNumOfEntries;
  7956        iPhoneBookState->iFDNNumOfEntries = pbFdnInfo.iFDNNumOfEntries;
  8011        iPhoneBookState->iFDNNumberLengthMax = pbFdnInfo.iFDNNumberLengthMax;
  7957        iPhoneBookState->iFDNNumberLengthMax = pbFdnInfo.iFDNNumberLengthMax;
  8012        iPhoneBookState->iFDNTextLengthMax = pbFdnInfo.iFDNTextLengthMax;
  7958        iPhoneBookState->iFDNTextLengthMax = pbFdnInfo.iFDNTextLengthMax;
  8013 
  7959 
  8014 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_SAVEFDNINFODETAILS_2, "TSY: CMmPhoneTsy::SaveFdnInfoDetails - iFDNNumOfEntries: %d",iPhoneBookState->iFDNNumOfEntries );
  7960 TFLOGSTRING2("TSY: CMmPhoneTsy::SaveFdnInfoDetails - iFDNNumOfEntries: %i",iPhoneBookState->iFDNNumOfEntries );
  8015 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_SAVEFDNINFODETAILS_3, "TSY: CMmPhoneTsy::SaveFdnInfoDetails - iFDNNumberLengthMax: %d",iPhoneBookState->iFDNNumberLengthMax );
  7961 TFLOGSTRING2("TSY: CMmPhoneTsy::SaveFdnInfoDetails - iFDNNumberLengthMax: %i",iPhoneBookState->iFDNNumberLengthMax );
  8016 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_SAVEFDNINFODETAILS_4, "TSY: CMmPhoneTsy::SaveFdnInfoDetails - iFDNTextLengthMax: %d",iPhoneBookState->iFDNTextLengthMax );
  7962 TFLOGSTRING2("TSY: CMmPhoneTsy::SaveFdnInfoDetails - iFDNTextLengthMax: %i",iPhoneBookState->iFDNTextLengthMax );
  8017        }
  7963        }
  8018     }
  7964     }
  8019 
  7965 
  8020 // ---------------------------------------------------------------------------
  7966 // ---------------------------------------------------------------------------
  8021 // CMmPhoneTsy::IsModemStatusReady
  7967 // CMmPhoneTsy::IsModemStatusReady
  8023 // (other items were commented in a header).
  7969 // (other items were commented in a header).
  8024 // ---------------------------------------------------------------------------
  7970 // ---------------------------------------------------------------------------
  8025 //    
  7971 //    
  8026 TBool CMmPhoneTsy::IsModemStatusReady() const
  7972 TBool CMmPhoneTsy::IsModemStatusReady() const
  8027     {   
  7973     {   
  8028 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_ISMODEMSTATUSREADY_1, "TSY: CMmPhoneTsy::IsModemStatusReady: %u", (TUint)iIsModemReady );
  7974 TFLOGSTRING2("TSY: CMmPhoneTsy::IsModemStatusReady: %i", iIsModemReady );
  8029     
  7975     
  8030     return iIsModemReady;
  7976     return iIsModemReady;
  8031     }
  7977     }
  8032 	
  7978 	
  8033 // ---------------------------------------------------------------------------
  7979 // ---------------------------------------------------------------------------
  8036 // (other items were commented in a header).
  7982 // (other items were commented in a header).
  8037 // ---------------------------------------------------------------------------
  7983 // ---------------------------------------------------------------------------
  8038 //    
  7984 //    
  8039 void CMmPhoneTsy::PhoneBookStoreInitCompleteL(TInt aError)
  7985 void CMmPhoneTsy::PhoneBookStoreInitCompleteL(TInt aError)
  8040     {
  7986     {
  8041     OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONETSY_PHONEBOOKSTOREINITCOMPLETEL_1, "TSY: CMmPhoneTsy::PhoneBookStoreInitCompleteL ");
  7987     TFLOGSTRING("TSY: CMmPhoneTsy::PhoneBookStoreInitCompleteL ");
  8042     TTsyReqHandle reqHandle = iTsyReqHandleStore->GetTsyReqHandle(
  7988     TTsyReqHandle reqHandle = iTsyReqHandleStore->GetTsyReqHandle(
  8043         EMultimodePhoneGetMailboxNumbers );   
  7989         EMultimodePhoneGetMailboxNumbers );   
  8044     if( EMultimodePhoneReqHandleUnknown != reqHandle )
  7990     if( EMultimodePhoneReqHandleUnknown != reqHandle )
  8045         {
  7991         {
  8046         if( KErrNone != aError )
  7992         if( KErrNone != aError )