telephonyserverplugins/common_tsy/commontsy/src/mmcustomtsy/CMmSIMTsy.cpp
branchRCL_3
changeset 65 630d2f34d719
parent 16 fe8b59ab9fa0
child 66 07a122eea281
child 73 70d75957b98f
equal deleted inserted replaced
61:17af172ffa5f 65:630d2f34d719
     1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
    14 //
    14 //
    15 
    15 
    16 
    16 
    17 
    17 
    18 //  INCLUDE FILES
    18 //  INCLUDE FILES
       
    19 
       
    20 #include "OstTraceDefinitions.h"
       
    21 #ifdef OST_TRACE_COMPILER_IN_USE
       
    22 #include "CMmSIMTsyTraces.h"
       
    23 #endif
       
    24 
    19 #include "CMmSIMTsy.h"
    25 #include "CMmSIMTsy.h"
    20 #include <ctsy/pluginapi/cmmdatapackage.h>
    26 #include <ctsy/pluginapi/cmmdatapackage.h>
    21 #include <ctsy/tflogger.h>
       
    22 
    27 
    23 // ======== MEMBER FUNCTIONS ========
    28 // ======== MEMBER FUNCTIONS ========
    24 
    29 
    25 CMmSIMTsy::CMmSIMTsy():
    30 CMmSIMTsy::CMmSIMTsy():
    26     iReqHandleType(ESIMTsyReqHandleUnknown)
    31     iReqHandleType(ESIMTsyReqHandleUnknown)
    28     }
    33     }
    29 
    34 
    30 void CMmSIMTsy::ConstructL(
    35 void CMmSIMTsy::ConstructL(
    31     CMmCustomTsy* aMmCustomTsy )
    36     CMmCustomTsy* aMmCustomTsy )
    32     {
    37     {
    33 TFLOGSTRING("TSY: CMmSIMTsy::ConstructL");         
    38 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_CONSTRUCTL_1, "TSY: CMmSIMTsy::ConstructL");
    34     iMmCustomTsy = aMmCustomTsy;
    39     iMmCustomTsy = aMmCustomTsy;
    35 
    40 
    36     // Create req handle store
    41     // Create req handle store
    37 #ifdef REQHANDLE_TIMER
    42 #ifdef REQHANDLE_TIMER
    38     iTsyReqHandleStore = CMmTsyReqHandleStore::NewL( iMmCustomTsy,
    43     iTsyReqHandleStore = CMmTsyReqHandleStore::NewL( iMmCustomTsy,
    57     TRAP( leaveCode, iViagDynamicCache = new ( ELeave )
    62     TRAP( leaveCode, iViagDynamicCache = new ( ELeave )
    58         CArrayFixFlat<RMmCustomAPI::TViagCacheRecordContent>( 
    63         CArrayFixFlat<RMmCustomAPI::TViagCacheRecordContent>( 
    59         ( KPhEngMaxViagHomeZones * KPhEngMaxCacheId ) ); );
    64         ( KPhEngMaxViagHomeZones * KPhEngMaxCacheId ) ); );
    60     if ( leaveCode )
    65     if ( leaveCode )
    61         {
    66         {
    62 TFLOGSTRING2("TSY: CMmSIMTsy::ConstructL: Could not construct o2 HomeZone dynamic cache, error=%d", leaveCode);
    67 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_CONSTRUCTL_2, "TSY: CMmSIMTsy::ConstructL: Could not construct o2 HomeZone dynamic cache, error=%d", leaveCode);
    63         iViagDynamicCache = NULL;
    68         iViagDynamicCache = NULL;
    64         }
    69         }
    65     else
    70     else
    66         {
    71         {
    67         // initialise
    72         // initialise
    69         zero.iLac = 0xFFFF;
    74         zero.iLac = 0xFFFF;
    70         zero.iCellId = 0xFFFF;
    75         zero.iCellId = 0xFFFF;
    71         iViagDynamicCache->AppendL( zero, ( KPhEngMaxViagHomeZones * 
    76         iViagDynamicCache->AppendL( zero, ( KPhEngMaxViagHomeZones * 
    72             KPhEngMaxCacheId ) );
    77             KPhEngMaxCacheId ) );
    73         iViagHomeZoneCacheReady = EFalse;
    78         iViagHomeZoneCacheReady = EFalse;
    74 TFLOGSTRING("TSY: CMmSIMTsy::ConstructL: o2 HomeZone dynamic cache array created.");
    79 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_CONSTRUCTL_3, "TSY: CMmSIMTsy::ConstructL: o2 HomeZone dynamic cache array created.");
    75         }
    80         }
    76     }
    81     }
    77 
    82 
    78 CMmSIMTsy* CMmSIMTsy::NewL(
    83 CMmSIMTsy* CMmSIMTsy::NewL(
    79     CMmCustomTsy* aMmCustomTsy )
    84     CMmCustomTsy* aMmCustomTsy )
    80     {
    85     {
    81 TFLOGSTRING("TSY: CMmSIMTsy::NewL");    
    86 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_NEWL_1, "TSY: CMmSIMTsy::NewL");
    82     CMmSIMTsy* self = new (ELeave) CMmSIMTsy();
    87     CMmSIMTsy* self = new (ELeave) CMmSIMTsy();
    83 
    88 
    84     CleanupStack::PushL( self );
    89     CleanupStack::PushL( self );
    85     self->ConstructL( aMmCustomTsy );
    90     self->ConstructL( aMmCustomTsy );
    86     CleanupStack::Pop( self );
    91     CleanupStack::Pop( self );
    88     return self;
    93     return self;
    89     }
    94     }
    90 
    95 
    91 CMmSIMTsy::~CMmSIMTsy()
    96 CMmSIMTsy::~CMmSIMTsy()
    92     {
    97     {
    93 TFLOGSTRING("TSY: CMmSIMTsy::~CMmSIMTsy()");         
    98 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_DTOR_1, "TSY: CMmSIMTsy::~CMmSIMTsy()");
    94     // delete all CB ID related
    99     // delete all CB ID related
    95     ResetAndDestroySimCbTopics();
   100     ResetAndDestroySimCbTopics();
    96 
   101 
    97     delete iTsyReqHandleStore;
   102     delete iTsyReqHandleStore;
    98     delete iViagDynamicCache; 
   103     delete iViagDynamicCache; 
   148 TInt CMmSIMTsy::DoExtFuncL(
   153 TInt CMmSIMTsy::DoExtFuncL(
   149     const TTsyReqHandle aTsyReqHandle, 
   154     const TTsyReqHandle aTsyReqHandle, 
   150     const TInt aIpc, 
   155     const TInt aIpc, 
   151     const TDataPackage& aPackage )
   156     const TDataPackage& aPackage )
   152     {
   157     {
   153 TFLOGSTRING3("TSY: CMmSIMTsy::DoExtFuncL - IPC:%d Handle:%d", aIpc, aTsyReqHandle);
   158 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_DOEXTFUNCL_1, "TSY: CMmSIMTsy::DoExtFuncL - IPC:%d Handle:%d", aIpc, aTsyReqHandle);
   154     TInt ret( KErrGeneral );
   159     TInt ret( KErrGeneral );
   155 
   160 
   156     // Ensure the ReqHandleType is unset.
   161     // Ensure the ReqHandleType is unset.
   157     // This will detect cases where this method indirectly calls itself
   162     // This will detect cases where this method indirectly calls itself
   158     // (e.g. servicing a client call that causes a self-reposting notification to complete and thus repost).
   163     // (e.g. servicing a client call that causes a self-reposting notification to complete and thus repost).
   368 //
   373 //
   369 TInt CMmSIMTsy::ReadViagHomeZoneParamsL(
   374 TInt CMmSIMTsy::ReadViagHomeZoneParamsL(
   370     RMmCustomAPI::TViagParams* aViagParameters, 
   375     RMmCustomAPI::TViagParams* aViagParameters, 
   371     RMmCustomAPI::TViagElement* aViagElements )
   376     RMmCustomAPI::TViagElement* aViagElements )
   372     {
   377     {
   373 TFLOGSTRING("TSY: CMmSIMTsy::ReadViagHomeZoneParamsL");
   378 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_READVIAGHOMEZONEPARAMSL_1, "TSY: CMmSIMTsy::ReadViagHomeZoneParamsL");
   374     TInt ret( KErrNone);
   379     TInt ret( KErrNone);
   375 
   380 
   376     if ( ESIMTsyReqHandleUnknown != iTsyReqHandleStore->GetTsyReqHandle(
   381     if ( ESIMTsyReqHandleUnknown != iTsyReqHandleStore->GetTsyReqHandle(
   377         ESIMRequestTypeReadParams ) )
   382         ESIMRequestTypeReadParams ) )
   378         {
   383         {
   417 // (other items were commented in a header).
   422 // (other items were commented in a header).
   418 // ---------------------------------------------------------------------------
   423 // ---------------------------------------------------------------------------
   419 //
   424 //
   420 void CMmSIMTsy::CheckViagHomezoneParamsL()
   425 void CMmSIMTsy::CheckViagHomezoneParamsL()
   421     {
   426     {
   422 TFLOGSTRING("TSY: CMmSIMTsy::CheckViagHomezoneParamsL");
   427 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_CHECKVIAGHOMEZONEPARAMSL_1, "TSY: CMmSIMTsy::CheckViagHomezoneParamsL");
   423     // Check if the request is pending
   428     // Check if the request is pending
   424     if ( ESIMTsyReqHandleUnknown != iTsyReqHandleStore->GetTsyReqHandle(
   429     if ( ESIMTsyReqHandleUnknown != iTsyReqHandleStore->GetTsyReqHandle(
   425         ESIMRequestTypeReadParams )  && iViagParamsReadRequested )
   430         ESIMRequestTypeReadParams )  && iViagParamsReadRequested )
   426         {
   431         {
   427         // Ensure that we wont flood SIM with mupltiple VIAG params
   432         // Ensure that we wont flood SIM with mupltiple VIAG params
   428         // read requests, set flag to EFalse.
   433         // read requests, set flag to EFalse.
   429         iViagParamsReadRequested = EFalse;
   434         iViagParamsReadRequested = EFalse;
   430 
   435 
   431 TFLOGSTRING("TSY: CMmSIMTsy::CheckViagHomezoneParamsL - Sending request" );
   436 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_CHECKVIAGHOMEZONEPARAMSL_2, "TSY: CMmSIMTsy::CheckViagHomezoneParamsL - Sending request" );
   432         // send request to DOS (no parameters)
   437         // send request to DOS (no parameters)
   433         // Void return value, there is nothing to be done if request fails.
   438         // Void return value, there is nothing to be done if request fails.
   434         (void) iMmCustomTsy->Phone()->MessageManager()->HandleRequestL(
   439         (void) iMmCustomTsy->Phone()->MessageManager()->HandleRequestL(
   435             EReadViagHomeZoneParamsIPC );
   440             EReadViagHomeZoneParamsIPC );
   436         }
   441         }
   437     else
   442     else
   438         {
   443         {
   439 TFLOGSTRING("TSY: CMmSIMTsy::CheckViagHomezoneParamsL - VIAG homezone params not requested");
   444 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_CHECKVIAGHOMEZONEPARAMSL_3, "TSY: CMmSIMTsy::CheckViagHomezoneParamsL - VIAG homezone params not requested");
   440         }
   445         }
   441 
   446 
   442     StartDynamicCachingL();
   447     StartDynamicCachingL();
   443     }
   448     }
   444 
   449 
   452 void CMmSIMTsy::CompleteReadViagHomeZoneParamsResp(
   457 void CMmSIMTsy::CompleteReadViagHomeZoneParamsResp(
   453     RMmCustomAPI::TViagParams* aParams, 
   458     RMmCustomAPI::TViagParams* aParams, 
   454     RMmCustomAPI::TViagElements* aElems, 
   459     RMmCustomAPI::TViagElements* aElems, 
   455     TInt aError )
   460     TInt aError )
   456     {
   461     {
   457 TFLOGSTRING2("TSY: CMmSIMTsy::CompleteReadViagHomeZoneParamsResp - aError: %d", aError );
   462 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_COMPLETEREADVIAGHOMEZONEPARAMSRESP_1, "TSY: CMmSIMTsy::CompleteReadViagHomeZoneParamsResp - aError: %d", aError );
   458     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
   463     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
   459         ESIMRequestTypeReadParams );
   464         ESIMRequestTypeReadParams );
   460     if ( ESIMTsyReqHandleUnknown != reqHandle )
   465     if ( ESIMTsyReqHandleUnknown != reqHandle )
   461         {
   466         {
   462         if ( aError == KErrNone && iViagParams && iViagElems )
   467         if ( aError == KErrNone && iViagParams && iViagElems )
   463             {
   468             {
   464             *iViagParams = *aParams;
   469             *iViagParams = *aParams;
   465 TFLOGSTRING2("TSY: CMmSIMTsy::CompleteReadViagHomeZoneParamsResp - iSmsC: %S", &iViagParams->iSmsC );
   470 OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_COMPLETEREADVIAGHOMEZONEPARAMSRESP_2, "TSY: CMmSIMTsy::CompleteReadViagHomeZoneParamsResp - iSmsC: %S", iViagParams->iSmsC );
   466 TFLOGSTRING2("TSY: CMmSIMTsy::CompleteReadViagHomeZoneParamsResp - iScp: %S",  &iViagParams->iScp );
   471 OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_COMPLETEREADVIAGHOMEZONEPARAMSRESP_3, "TSY: CMmSIMTsy::CompleteReadViagHomeZoneParamsResp - iScp: %S",  iViagParams->iScp );
   467 TFLOGSTRING2("TSY: CMmSIMTsy::CompleteReadViagHomeZoneParamsResp - iSubscribedZoneAndVersion: %d", iViagParams->iSubscribedZoneAndVersion );
   472 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_COMPLETEREADVIAGHOMEZONEPARAMSRESP_4, "TSY: CMmSIMTsy::CompleteReadViagHomeZoneParamsResp - iSubscribedZoneAndVersion: %d", iViagParams->iSubscribedZoneAndVersion );
   468 
   473 
   469             for ( TUint8 i = 0; i < RMmCustomAPI::KViagElementCount; i++ )
   474             for ( TUint8 i = 0; i < RMmCustomAPI::KViagElementCount; i++ )
   470                 {
   475                 {
   471                 iViagElems[ i ].iCoordinates.iX = aElems->At(i).iCoordinates.iX;
   476                 iViagElems[ i ].iCoordinates.iX = aElems->At(i).iCoordinates.iX;
   472 TFLOGSTRING3("TSY: CMmSIMTsy::CompleteReadViagHomeZoneParamsResp - Element: %d, iX: %d", i, aElems->At(i).iCoordinates.iX );
   477 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_COMPLETEREADVIAGHOMEZONEPARAMSRESP_5, "TSY: CMmSIMTsy::CompleteReadViagHomeZoneParamsResp - Element: %d, iX: %d", i, aElems->At(i).iCoordinates.iX );
   473 
   478 
   474                 iViagElems[ i ].iCoordinates.iY = aElems->At(i).iCoordinates.iY;
   479                 iViagElems[ i ].iCoordinates.iY = aElems->At(i).iCoordinates.iY;
   475 TFLOGSTRING3("TSY: CMmSIMTsy::CompleteReadViagHomeZoneParamsResp - Element: %d, iY: %d", i, aElems->At(i).iCoordinates.iY );
   480 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_COMPLETEREADVIAGHOMEZONEPARAMSRESP_6, "TSY: CMmSIMTsy::CompleteReadViagHomeZoneParamsResp - Element: %d, iY: %d", i, aElems->At(i).iCoordinates.iY );
   476 
   481 
   477                 iViagElems[ i ].iCoordinates.iR2 = aElems->
   482                 iViagElems[ i ].iCoordinates.iR2 = aElems->
   478                     At(i).iCoordinates.iR2;
   483                     At(i).iCoordinates.iR2;
   479 TFLOGSTRING3("TSY: CMmSIMTsy::CompleteReadViagHomeZoneParamsResp - Element: %d, iR2: %d", i, aElems->At(i).iCoordinates.iR2 );
   484 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_COMPLETEREADVIAGHOMEZONEPARAMSRESP_7, "TSY: CMmSIMTsy::CompleteReadViagHomeZoneParamsResp - Element: %d, iR2: %d", i, aElems->At(i).iCoordinates.iR2 );
   480 
   485 
   481                 iViagElems[ i ].iCoordinates.iZoneId = aElems->
   486                 iViagElems[ i ].iCoordinates.iZoneId = aElems->
   482                     At(i).iCoordinates.iZoneId;
   487                     At(i).iCoordinates.iZoneId;
   483 TFLOGSTRING3("TSY: CMmSIMTsy::CompleteReadViagHomeZoneParamsResp - Element: %d, iZoneId: %d", i, aElems->At(i).iCoordinates.iZoneId );
   488 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_COMPLETEREADVIAGHOMEZONEPARAMSRESP_8, "TSY: CMmSIMTsy::CompleteReadViagHomeZoneParamsResp - Element: %d, iZoneId: %d", i, aElems->At(i).iCoordinates.iZoneId );
   484 
   489 
   485                 iViagElems[ i ].iName.Copy( aElems->At(i).iName );
   490                 iViagElems[ i ].iName.Copy( aElems->At(i).iName );
   486                 iViagElems[ i ].iActiveFlag = aElems->At(i).iActiveFlag;
   491                 iViagElems[ i ].iActiveFlag = aElems->At(i).iActiveFlag;
   487 TFLOGSTRING3("TSY: CMmSIMTsy::CompleteReadViagHomeZoneParamsResp - Element: %d, iActiveFlag: %d", i, aElems->At(i).iActiveFlag );
   492 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_COMPLETEREADVIAGHOMEZONEPARAMSRESP_9, "TSY: CMmSIMTsy::CompleteReadViagHomeZoneParamsResp - Element: %d, iActiveFlag: %d", i, aElems->At(i).iActiveFlag );
   488                 }
   493                 }
   489             }
   494             }
   490         iMmCustomTsy->ReqCompleted( reqHandle, aError );
   495         iMmCustomTsy->ReqCompleted( reqHandle, aError );
   491         }
   496         }
   492     }
   497     }
   497 // (other items were commented in a header).
   502 // (other items were commented in a header).
   498 // ---------------------------------------------------------------------------
   503 // ---------------------------------------------------------------------------
   499 //
   504 //
   500 TInt CMmSIMTsy::ReadViagHomeZoneParamsCancel()
   505 TInt CMmSIMTsy::ReadViagHomeZoneParamsCancel()
   501     {
   506     {
   502 TFLOGSTRING("TSY: CMmSIMTsy::ReadViagHomeZoneParamsCancel");
   507 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_READVIAGHOMEZONEPARAMSCANCEL_1, "TSY: CMmSIMTsy::ReadViagHomeZoneParamsCancel");
   503     // reset the pointer to client space
   508     // reset the pointer to client space
   504     iViagParams = NULL;
   509     iViagParams = NULL;
   505     iViagElems = NULL;
   510     iViagElems = NULL;
   506 
   511 
   507     // reset the req handle
   512     // reset the req handle
   525 //
   530 //
   526 TInt CMmSIMTsy::ReadViagHomeZoneCacheL(
   531 TInt CMmSIMTsy::ReadViagHomeZoneCacheL(
   527     RMmCustomAPI::TViagCacheRecordId* aViagRecordId,
   532     RMmCustomAPI::TViagCacheRecordId* aViagRecordId,
   528     RMmCustomAPI::TViagCacheRecordContent* aViagRecordContent )
   533     RMmCustomAPI::TViagCacheRecordContent* aViagRecordContent )
   529     {
   534     {
   530 TFLOGSTRING("TSY: CMmSIMTsy::ReadViagHomeZoneCacheL");
   535 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_READVIAGHOMEZONECACHEL_1, "TSY: CMmSIMTsy::ReadViagHomeZoneCacheL");
   531     TInt ret( KErrGeneral );
   536     TInt ret( KErrGeneral );
   532 
   537 
   533     if ( ESIMTsyReqHandleUnknown != iTsyReqHandleStore->GetTsyReqHandle(
   538     if ( ESIMTsyReqHandleUnknown != iTsyReqHandleStore->GetTsyReqHandle(
   534         ESIMRequestTypeReadCache ) )
   539         ESIMRequestTypeReadCache ) )
   535         {
   540         {
   562 //
   567 //
   563 void CMmSIMTsy::CompleteReadViagHomeZoneCacheRespL(
   568 void CMmSIMTsy::CompleteReadViagHomeZoneCacheRespL(
   564     RMmCustomAPI::TViagCacheRecordContent* aViagRecord,
   569     RMmCustomAPI::TViagCacheRecordContent* aViagRecord,
   565     TInt aError )
   570     TInt aError )
   566     {
   571     {
   567 TFLOGSTRING("TSY: CMmSIMTsy::CompleteReadViagHomeZoneCacheRespL");
   572 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_COMPLETEREADVIAGHOMEZONECACHERESPL_1, "TSY: CMmSIMTsy::CompleteReadViagHomeZoneCacheRespL");
   568     iLastViagHomeZoneCacheError = aError;
   573     iLastViagHomeZoneCacheError = aError;
   569     if (iCurrentlyRetrievedCache == NULL)
   574     if (iCurrentlyRetrievedCache == NULL)
   570         {
   575         {
   571         // Got an unexpected update... ignore!
   576         // Got an unexpected update... ignore!
   572         return;
   577         return;
   584             // ==> A[c][r] = A[((c-1)*rMax)+r]
   589             // ==> A[c][r] = A[((c-1)*rMax)+r]
   585             TInt arrayIndex =
   590             TInt arrayIndex =
   586                 ( ( iCurrentlyRetrievedCache->iCacheId - 1 ) * 21 ) +
   591                 ( ( iCurrentlyRetrievedCache->iCacheId - 1 ) * 21 ) +
   587                 iCurrentlyRetrievedCache->iRecordId;
   592                 iCurrentlyRetrievedCache->iRecordId;
   588             iViagDynamicCache->At( arrayIndex ) = *aViagRecord;
   593             iViagDynamicCache->At( arrayIndex ) = *aViagRecord;
   589 TFLOGSTRING3("TSY: CMmSIMTsy::CompleteReadViagHomeZoneCacheRespL:Entry at cacheId=%d, recordId=%d read.", iCurrentlyRetrievedCache->iCacheId,iCurrentlyRetrievedCache->iRecordId);
   594 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_COMPLETEREADVIAGHOMEZONECACHERESPL_2, "TSY: CMmSIMTsy::CompleteReadViagHomeZoneCacheRespL:Entry at cacheId=%d, recordId=%d read.", iCurrentlyRetrievedCache->iCacheId,iCurrentlyRetrievedCache->iRecordId);
   590 
   595 
   591             TRAP_IGNORE(
   596             TRAP_IGNORE(
   592                 // loop. loop four caches times 21 entries!
   597                 // loop. loop four caches times 21 entries!
   593             if ( 20 > iCurrentlyRetrievedCache->iRecordId )
   598             if ( 20 > iCurrentlyRetrievedCache->iRecordId )
   594                 {
   599                 {
   616                 {
   621                 {
   617                 // caching done
   622                 // caching done
   618                 delete iCurrentlyRetrievedCache;
   623                 delete iCurrentlyRetrievedCache;
   619                 iCurrentlyRetrievedCache = NULL;
   624                 iCurrentlyRetrievedCache = NULL;
   620                 iViagHomeZoneCacheReady = ETrue;
   625                 iViagHomeZoneCacheReady = ETrue;
   621 TFLOGSTRING("TSY: CMmSIMTsy::CompleteReadViagHomeZoneCacheRespL:Caching completed successfully!");
   626 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_COMPLETEREADVIAGHOMEZONECACHERESPL_3, "TSY: CMmSIMTsy::CompleteReadViagHomeZoneCacheRespL:Caching completed successfully!");
   622 
   627 
   623                 if( 0 < iReadViagHomeZoneCacheRequests.Count() )
   628                 if( 0 < iReadViagHomeZoneCacheRequests.Count() )
   624                     {
   629                     {
   625                     
   630                     
   626                     for ( TInt i=0; i <iReadViagHomeZoneCacheRequests.Count() ; i++ )
   631                     for ( TInt i=0; i <iReadViagHomeZoneCacheRequests.Count() ; i++ )
   627                         {
   632                         {
   628 TFLOGSTRING2("TSY: CMmSIMTsy::CompleteReadDynamicViagHomeZoneCacheRespL: for i:%d", i);
   633 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_COMPLETEREADVIAGHOMEZONECACHERESPL_4, "TSY: CMmSIMTsy::CompleteReadDynamicViagHomeZoneCacheRespL: for i:%d", i);
   629                         TReadViagHomeZoneCacheRequest* req = 
   634                         TReadViagHomeZoneCacheRequest* req = 
   630 		  			    iReadViagHomeZoneCacheRequests[ i ];
   635 		  			    iReadViagHomeZoneCacheRequests[ i ];
   631 		  			    
   636 		  			    
   632                         // copy data from dynamic cache to client
   637                         // copy data from dynamic cache to client
   633                         // some arithmetics:
   638                         // some arithmetics:
   653         else
   658         else
   654             {
   659             {
   655             // caching aborted
   660             // caching aborted
   656         delete iCurrentlyRetrievedCache;
   661         delete iCurrentlyRetrievedCache;
   657         iCurrentlyRetrievedCache = NULL;
   662         iCurrentlyRetrievedCache = NULL;
   658 TFLOGSTRING2("TSY: CMmSIMTsy::CompleteReadViagHomeZoneCacheRespL:There was a problem reading cache values from SIM, error=%d", aError);
   663 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_COMPLETEREADVIAGHOMEZONECACHERESPL_5, "TSY: CMmSIMTsy::CompleteReadViagHomeZoneCacheRespL:There was a problem reading cache values from SIM, error=%d", aError);
   659             //iViagHomeZoneCacheReady = ETrue;
   664             //iViagHomeZoneCacheReady = ETrue;
   660 TFLOGSTRING("TSY: CMmSIMTsy::CompleteReadViagHomeZoneCacheRespL: Caching completed unsuccessfully!");
   665 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_COMPLETEREADVIAGHOMEZONECACHERESPL_6, "TSY: CMmSIMTsy::CompleteReadViagHomeZoneCacheRespL: Caching completed unsuccessfully!");
   661 
   666 
   662             for (TInt i = 0; i < iReadViagHomeZoneCacheRequests.Count(); i++)
   667             for (TInt i = 0; i < iReadViagHomeZoneCacheRequests.Count(); i++)
   663                 {
   668                 {
   664 TFLOGSTRING2("TSY: CMmSIMTsy::CompleteReadDynamicViagHomeZoneCacheRespL: for i:%d", i);
   669 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_COMPLETEREADVIAGHOMEZONECACHERESPL_7, "TSY: CMmSIMTsy::CompleteReadDynamicViagHomeZoneCacheRespL: for i:%d", i);
   665                 TReadViagHomeZoneCacheRequest* req =
   670                 TReadViagHomeZoneCacheRequest* req =
   666                         iReadViagHomeZoneCacheRequests[i];
   671                         iReadViagHomeZoneCacheRequests[i];
   667                 iMmCustomTsy->ReqCompleted(req->iReqHandle, aError);
   672                 iMmCustomTsy->ReqCompleted(req->iReqHandle, aError);
   668                 }
   673                 }
   669             iReadViagHomeZoneCacheRequests.ResetAndDestroy();
   674             iReadViagHomeZoneCacheRequests.ResetAndDestroy();
   678 // ---------------------------------------------------------------------------
   683 // ---------------------------------------------------------------------------
   679 //
   684 //
   680 TInt CMmSIMTsy::ReadViagHomeZoneCacheCancel(
   685 TInt CMmSIMTsy::ReadViagHomeZoneCacheCancel(
   681     const TTsyReqHandle aTsyReqHandle )
   686     const TTsyReqHandle aTsyReqHandle )
   682     {
   687     {
   683 TFLOGSTRING("TSY: CMmSIMTsy::ReadViagHomeZoneCacheCancel");
   688 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_READVIAGHOMEZONECACHECANCEL_1, "TSY: CMmSIMTsy::ReadViagHomeZoneCacheCancel");
   684 TFLOGSTRING2("TSY: CMmSIMTsy::ReadViagHomeZoneCacheCancel - Handle:%d",aTsyReqHandle);
   689 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_READVIAGHOMEZONECACHECANCEL_2, "TSY: CMmSIMTsy::ReadViagHomeZoneCacheCancel - Handle:%d",aTsyReqHandle);
   685     // Reset the pointer to client space
   690     // Reset the pointer to client space
   686     iViagReadCacheRecord = NULL;
   691     iViagReadCacheRecord = NULL;
   687 
   692 
   688     // Check if request handle already exists
   693     // Check if request handle already exists
   689     TTsyReqHandle reqHandle = iTsyReqHandleStore->GetTsyReqHandle(
   694     TTsyReqHandle reqHandle = iTsyReqHandleStore->GetTsyReqHandle(
   694 	    // Reset the request handle. Returns the deleted req handle
   699 	    // Reset the request handle. Returns the deleted req handle
   695         reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
   700         reqHandle = iTsyReqHandleStore->ResetTsyReqHandle( 
   696             ESIMRequestTypeReadCache );
   701             ESIMRequestTypeReadCache );
   697         if ( ESIMTsyReqHandleUnknown != reqHandle )
   702         if ( ESIMTsyReqHandleUnknown != reqHandle )
   698         	{
   703         	{
   699 TFLOGSTRING2("TSY: CMmSIMTsy::ReadViagHomeZoneCacheCancel - Completed with Cancel Handle:%d",reqHandle);	
   704 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_READVIAGHOMEZONECACHECANCEL_3, "TSY: CMmSIMTsy::ReadViagHomeZoneCacheCancel - Completed with Cancel Handle:%d",reqHandle);
   700 			// Complete request with cancel
   705 			// Complete request with cancel
   701 			iMmCustomTsy->ReqCompleted( reqHandle, KErrCancel );
   706 			iMmCustomTsy->ReqCompleted( reqHandle, KErrCancel );
   702         	}
   707         	}
   703         }
   708         }
   704 	else
   709 	else
   712                 iReadViagHomeZoneCacheRequests[ i ];
   717                 iReadViagHomeZoneCacheRequests[ i ];
   713                 
   718                 
   714                 if (aTsyReqHandle == req->iReqHandle)
   719                 if (aTsyReqHandle == req->iReqHandle)
   715                 	{
   720                 	{
   716                 	// Complete the request if the request handle is found
   721                 	// Complete the request if the request handle is found
   717 TFLOGSTRING3("TSY: CMmSIMTsy::ReadViagHomeZoneCacheCancel - Complete with Cancel from array Handle:%d Id=%d ", req->iReqHandle,i);
   722 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_READVIAGHOMEZONECACHECANCEL_4, "TSY: CMmSIMTsy::ReadViagHomeZoneCacheCancel - Complete with Cancel from array Handle:%d Id=%d ", req->iReqHandle,i);
   718                     iMmCustomTsy->ReqCompleted( req->iReqHandle, KErrCancel );
   723                     iMmCustomTsy->ReqCompleted( req->iReqHandle, KErrCancel );
   719 	                delete iReadViagHomeZoneCacheRequests[ i ];
   724 	                delete iReadViagHomeZoneCacheRequests[ i ];
   720 	                iReadViagHomeZoneCacheRequests.Remove(i);
   725 	                iReadViagHomeZoneCacheRequests.Remove(i);
   721                     break;                 	
   726                     break;                 	
   722                     }
   727                     }
   735 TInt CMmSIMTsy::ReadDynamicViagHomeZoneCacheL(
   740 TInt CMmSIMTsy::ReadDynamicViagHomeZoneCacheL(
   736     const TTsyReqHandle aTsyReqHandle,
   741     const TTsyReqHandle aTsyReqHandle,
   737     RMmCustomAPI::TViagCacheRecordId* aViagRecordId,
   742     RMmCustomAPI::TViagCacheRecordId* aViagRecordId,
   738     RMmCustomAPI::TViagCacheRecordContent* aViagRecordContent )
   743     RMmCustomAPI::TViagCacheRecordContent* aViagRecordContent )
   739     {
   744     {
   740 TFLOGSTRING2("TSY: CMmSIMTsy::ReadDynamicViagHomeZoneCache:Is ViagHomeZoneCache Ready =%d", iViagHomeZoneCacheReady);
   745 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_READDYNAMICVIAGHOMEZONECACHEL_1, "TSY: CMmSIMTsy::ReadDynamicViagHomeZoneCache:Is ViagHomeZoneCache Ready =%d", iViagHomeZoneCacheReady);
   741 TFLOGSTRING3("TSY: CMmSIMTsy::ReadDynamicViagHomeZoneCache iCacheId %d iRecordId %d",aViagRecordId->iCacheId,aViagRecordId->iRecordId );
   746 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_READDYNAMICVIAGHOMEZONECACHEL_2, "TSY: CMmSIMTsy::ReadDynamicViagHomeZoneCache iCacheId %d iRecordId %d",aViagRecordId->iCacheId,aViagRecordId->iRecordId );
   742     TInt err = KErrNone;
   747     TInt err = KErrNone;
   743 	//  KPhEngMaxViagHomeZones(4) * KPhEngMaxCacheId(21)
   748 	//  KPhEngMaxViagHomeZones(4) * KPhEngMaxCacheId(21)
   744 	if ( 1 > aViagRecordId->iCacheId || 4 < aViagRecordId->iCacheId || 
   749 	if ( 1 > aViagRecordId->iCacheId || 4 < aViagRecordId->iCacheId || 
   745 		 0 > aViagRecordId->iRecordId || 20 < aViagRecordId->iRecordId )
   750 		 0 > aViagRecordId->iRecordId || 20 < aViagRecordId->iRecordId )
   746 		{
   751 		{
   747 		err = KErrArgument;	
   752 		err = KErrArgument;	
   748 		}
   753 		}
   749     else if ( iViagDynamicCache && iViagHomeZoneCacheReady )
   754     else if ( iViagDynamicCache && iViagHomeZoneCacheReady )
   750         {
   755         {
   751 TFLOGSTRING("TSY: CMmSIMTsy::ReadDynamicViagHomeZoneCache: else if : Cache is ready, Reading cache possible");
   756 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_READDYNAMICVIAGHOMEZONECACHEL_3, "TSY: CMmSIMTsy::ReadDynamicViagHomeZoneCache: else if : Cache is ready, Reading cache possible");
   752         // copy data from dynamic cache to client
   757         // copy data from dynamic cache to client
   753         // some arithmetics:
   758         // some arithmetics:
   754         //     cache ids range 1..4
   759         //     cache ids range 1..4
   755         //     record ids range 0..20
   760         //     record ids range 0..20
   756         //     array indexes range 0..83
   761         //     array indexes range 0..83
   759             aViagRecordId->iRecordId;
   764             aViagRecordId->iRecordId;
   760         *aViagRecordContent = iViagDynamicCache->At( arrayIndex );
   765         *aViagRecordContent = iViagDynamicCache->At( arrayIndex );
   761         }
   766         }
   762     else if ( !iViagHomeZoneCacheReady )
   767     else if ( !iViagHomeZoneCacheReady )
   763         {
   768         {
   764  TFLOGSTRING("TSY: CMmSIMTsy::ReadDynamicViagHomeZoneCache: else if : Cache is NOT ready, Reading cache NOT possible");
   769  OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_READDYNAMICVIAGHOMEZONECACHEL_4, "TSY: CMmSIMTsy::ReadDynamicViagHomeZoneCache: else if : Cache is NOT ready, Reading cache NOT possible");
   765         //The request is already in processing because of previous request
   770         //The request is already in processing because of previous request
   766         //Complete request with status value informing the client about
   771         //Complete request with status value informing the client about
   767 		TReadViagHomeZoneCacheRequest* req = 
   772 		TReadViagHomeZoneCacheRequest* req = 
   768                               new (ELeave) TReadViagHomeZoneCacheRequest();
   773                               new (ELeave) TReadViagHomeZoneCacheRequest();
   769 		req->iReqHandle = aTsyReqHandle;
   774 		req->iReqHandle = aTsyReqHandle;
   794 //
   799 //
   795 TInt CMmSIMTsy::WriteViagHomeZoneCacheL(
   800 TInt CMmSIMTsy::WriteViagHomeZoneCacheL(
   796     RMmCustomAPI::TViagCacheRecordId* aViagRecordId,
   801     RMmCustomAPI::TViagCacheRecordId* aViagRecordId,
   797     RMmCustomAPI::TViagCacheRecordContent* aViagRecordContent )
   802     RMmCustomAPI::TViagCacheRecordContent* aViagRecordContent )
   798     {
   803     {
   799 TFLOGSTRING3("TSY: CCMmSIMTsy::WriteViagHomeZoneCacheL iCacheId %d iRecordId %d",aViagRecordId->iCacheId,aViagRecordId->iRecordId );
   804 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_WRITEVIAGHOMEZONECACHEL_1, "TSY: CCMmSIMTsy::WriteViagHomeZoneCacheL iCacheId %d iRecordId %d",aViagRecordId->iCacheId,aViagRecordId->iRecordId );
   800     TInt ret( KErrGeneral );
   805     TInt ret( KErrGeneral );
   801 
   806 
   802     if ( ESIMTsyReqHandleUnknown != iTsyReqHandleStore->GetTsyReqHandle(
   807     if ( ESIMTsyReqHandleUnknown != iTsyReqHandleStore->GetTsyReqHandle(
   803         ESIMRequestTypeWriteCache ) )
   808         ESIMRequestTypeWriteCache ) )
   804         {
   809         {
   846 // ---------------------------------------------------------------------------
   851 // ---------------------------------------------------------------------------
   847 //
   852 //
   848 void CMmSIMTsy::CompleteWriteViagHomeZoneCacheResp(
   853 void CMmSIMTsy::CompleteWriteViagHomeZoneCacheResp(
   849     TInt aError )
   854     TInt aError )
   850     {
   855     {
   851 TFLOGSTRING("TSY: CMmSIMTsy::CompleteWriteViagHomeZoneCacheResp");
   856 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_COMPLETEWRITEVIAGHOMEZONECACHERESP_1, "TSY: CMmSIMTsy::CompleteWriteViagHomeZoneCacheResp");
   852     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
   857     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
   853         ESIMRequestTypeWriteCache );
   858         ESIMRequestTypeWriteCache );
   854 
   859 
   855     if ( ESIMTsyReqHandleUnknown != reqHandle )
   860     if ( ESIMTsyReqHandleUnknown != reqHandle )
   856         {
   861         {
   867 // ----------------------------------------------------------------------------
   872 // ----------------------------------------------------------------------------
   868 //
   873 //
   869 void CMmSIMTsy::CompleteWriteViagHomeZoneUHZIUESettingsResp(
   874 void CMmSIMTsy::CompleteWriteViagHomeZoneUHZIUESettingsResp(
   870     TInt aError )
   875     TInt aError )
   871     {
   876     {
   872 TFLOGSTRING2("TSY: CMmSIMTsy::CompleteWriteViagHomeZoneUHZIUESettingsResp error = %d",aError);
   877 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_COMPLETEWRITEVIAGHOMEZONEUHZIUESETTINGSRESP_1, "TSY: CMmSIMTsy::CompleteWriteViagHomeZoneUHZIUESettingsResp error = %d",aError);
   873     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
   878     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
   874         ESIMRequestTypeWriteSettings );
   879         ESIMRequestTypeWriteSettings );
   875 
   880 
   876     if ( ESIMTsyReqHandleUnknown != reqHandle )
   881     if ( ESIMTsyReqHandleUnknown != reqHandle )
   877         {
   882         {
   906 // (other items were commented in a header).
   911 // (other items were commented in a header).
   907 // ---------------------------------------------------------------------------
   912 // ---------------------------------------------------------------------------
   908 //
   913 //
   909 void CMmSIMTsy::StartDynamicCachingL()
   914 void CMmSIMTsy::StartDynamicCachingL()
   910     {
   915     {
   911 TFLOGSTRING("TSY: CMmSIMTsy::StartDynamicCachingL");
   916 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_STARTDYNAMICCACHINGL_1, "TSY: CMmSIMTsy::StartDynamicCachingL");
   912     iLastViagHomeZoneCacheError = KErrNone;
   917     iLastViagHomeZoneCacheError = KErrNone;
   913 	// Make sure there are no ongoing dynamic caching requests.. 
   918 	// Make sure there are no ongoing dynamic caching requests.. 
   914 	if( iCurrentlyRetrievedCache ) 
   919 	if( iCurrentlyRetrievedCache ) 
   915 		{ 
   920 		{ 
   916 TFLOGSTRING("TSY: CMmSIMTsy::StartDynamicCachingL - iCurrentlyRetrievedCache already exists - no new request done");       
   921 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_STARTDYNAMICCACHINGL_2, "TSY: CMmSIMTsy::StartDynamicCachingL - iCurrentlyRetrievedCache already exists - no new request done");
   917 		return; 
   922 		return; 
   918 		} 
   923 		} 
   919 
   924 
   920     TInt trapError;
   925     TInt trapError;
   921     TRAP( trapError, iCurrentlyRetrievedCache = new (ELeave) 
   926     TRAP( trapError, iCurrentlyRetrievedCache = new (ELeave) 
   922         RMmCustomAPI::TViagCacheRecordId(); );
   927         RMmCustomAPI::TViagCacheRecordId(); );
   923     if ( trapError )
   928     if ( trapError )
   924         {
   929         {
   925 TFLOGSTRING2("TSY: CMmSIMTsy::StartDynamicCachingL:Could not start caching, error=%d", trapError);
   930 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_STARTDYNAMICCACHINGL_3, "TSY: CMmSIMTsy::StartDynamicCachingL:Could not start caching, error=%d", trapError);
   926         return;
   931         return;
   927     }
   932     }
   928 TFLOGSTRING("TSY: CMmSIMTsy::StartDynamicCachingL:Starting caching now.");
   933 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_STARTDYNAMICCACHINGL_4, "TSY: CMmSIMTsy::StartDynamicCachingL:Starting caching now.");
   929     iCurrentlyRetrievedCache->iCacheId = 1;  // caches range from 1 to 4
   934     iCurrentlyRetrievedCache->iCacheId = 1;  // caches range from 1 to 4
   930     iCurrentlyRetrievedCache->iRecordId = 0; // records range from 0 to 20
   935     iCurrentlyRetrievedCache->iRecordId = 0; // records range from 0 to 20
   931     // send request to DOS
   936     // send request to DOS
   932     // packed parameter: RMmCustomAPI::TViagCacheRecordId
   937     // packed parameter: RMmCustomAPI::TViagCacheRecordId
   933     CMmDataPackage dataPackage;
   938     CMmDataPackage dataPackage;
   944 // ----------------------------------------------------------------------------
   949 // ----------------------------------------------------------------------------
   945 //
   950 //
   946 TInt CMmSIMTsy::WriteViagHomeZoneUHZIUESettingsL(
   951 TInt CMmSIMTsy::WriteViagHomeZoneUHZIUESettingsL(
   947     RMmCustomAPI::TViagUHZIUESettings* aSettings )
   952     RMmCustomAPI::TViagUHZIUESettings* aSettings )
   948     {
   953     {
   949 TFLOGSTRING("TSY: CMmSIMTsy::WriteViagHomeZoneUHZIUESettingsL");
   954 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_WRITEVIAGHOMEZONEUHZIUESETTINGSL_1, "TSY: CMmSIMTsy::WriteViagHomeZoneUHZIUESettingsL");
   950     TInt ret( KErrGeneral );
   955     TInt ret( KErrGeneral );
   951 
   956 
   952     if ( ESIMTsyReqHandleUnknown != iTsyReqHandleStore->GetTsyReqHandle(
   957     if ( ESIMTsyReqHandleUnknown != iTsyReqHandleStore->GetTsyReqHandle(
   953         ESIMRequestTypeWriteSettings ) )
   958         ESIMRequestTypeWriteSettings ) )
   954         {
   959         {
   975 // (other items were commented in a header).
   980 // (other items were commented in a header).
   976 // ---------------------------------------------------------------------------
   981 // ---------------------------------------------------------------------------
   977 //
   982 //
   978 TInt CMmSIMTsy::WriteViagHomeZoneUHZIUESettingsCancel()
   983 TInt CMmSIMTsy::WriteViagHomeZoneUHZIUESettingsCancel()
   979     {
   984     {
   980 TFLOGSTRING("TSY: CMmSIMTsy::WriteViagHomeZoneUHZIUESettingsCancel");
   985 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_WRITEVIAGHOMEZONEUHZIUESETTINGSCANCEL_1, "TSY: CMmSIMTsy::WriteViagHomeZoneUHZIUESettingsCancel");
   981     // check if handle is not in use.
   986     // check if handle is not in use.
   982     TTsyReqHandle scFileHandle = 
   987     TTsyReqHandle scFileHandle = 
   983         iTsyReqHandleStore->GetTsyReqHandle( ESIMRequestTypeWriteSettings );
   988         iTsyReqHandleStore->GetTsyReqHandle( ESIMRequestTypeWriteSettings );
   984 
   989 
   985     if( ESIMTsyReqHandleUnknown != scFileHandle )
   990     if( ESIMTsyReqHandleUnknown != scFileHandle )
  1007 // ---------------------------------------------------------------------------
  1012 // ---------------------------------------------------------------------------
  1008 //
  1013 //
  1009 TInt CMmSIMTsy::StartSimCbTopicBrowsingL(
  1014 TInt CMmSIMTsy::StartSimCbTopicBrowsingL(
  1010     const TTsyReqHandle /*aTsyReqHandle */)
  1015     const TTsyReqHandle /*aTsyReqHandle */)
  1011     {
  1016     {
  1012 TFLOGSTRING("TSY: CMmSIMTsy::StartSimCbTopicBrowsingL");
  1017 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_STARTSIMCBTOPICBROWSINGL_1, "TSY: CMmSIMTsy::StartSimCbTopicBrowsingL");
  1013     // reset variables
  1018     // reset variables
  1014     ResetAndDestroySimCbTopics();
  1019     ResetAndDestroySimCbTopics();
  1015     iGetNextSimCbTopicIndex = KNoCbIds;
  1020     iGetNextSimCbTopicIndex = KNoCbIds;
  1016     TInt ret( KErrNone );
  1021     TInt ret( KErrNone );
  1017 
  1022 
  1048 //
  1053 //
  1049 void CMmSIMTsy::CompleteStartSimCbTopicBrowsing(
  1054 void CMmSIMTsy::CompleteStartSimCbTopicBrowsing(
  1050     CArrayFixFlat<RMmCustomAPI::TSimCbTopic>* aTopics, 
  1055     CArrayFixFlat<RMmCustomAPI::TSimCbTopic>* aTopics, 
  1051     TInt aError )
  1056     TInt aError )
  1052     {
  1057     {
  1053 TFLOGSTRING("TSY: CMmSIMTsy::CompleteStartSimCbTopicBrowsing");
  1058 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_COMPLETESTARTSIMCBTOPICBROWSING_1, "TSY: CMmSIMTsy::CompleteStartSimCbTopicBrowsing");
  1054     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
  1059     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
  1055         ESIMRequestTypeStartSimCbTopicBrowsing );
  1060         ESIMRequestTypeStartSimCbTopicBrowsing );
  1056 
  1061 
  1057     if ( ESIMTsyReqHandleUnknown != reqHandle )
  1062     if ( ESIMTsyReqHandleUnknown != reqHandle )
  1058         {
  1063         {
  1091 //
  1096 //
  1092 TInt CMmSIMTsy::GetNextSimCbTopic(
  1097 TInt CMmSIMTsy::GetNextSimCbTopic(
  1093     TTsyReqHandle aTsyReqHandle, 
  1098     TTsyReqHandle aTsyReqHandle, 
  1094     RMmCustomAPI::TSimCbTopic *aSimCbTopic )
  1099     RMmCustomAPI::TSimCbTopic *aSimCbTopic )
  1095     {
  1100     {
  1096 TFLOGSTRING("TSY: CMmSIMTsy::GetNextSimCbTopic");
  1101 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_GETNEXTSIMCBTOPIC_1, "TSY: CMmSIMTsy::GetNextSimCbTopic");
  1097     // initialize ret with KErrNotFound
  1102     // initialize ret with KErrNotFound
  1098     TInt ret ( KErrNotFound );
  1103     TInt ret ( KErrNotFound );
  1099 
  1104 
  1100     if( ( iGetNextSimCbTopicIndex >= 0 ) && iSimCbTopics )
  1105     if( ( iGetNextSimCbTopicIndex >= 0 ) && iSimCbTopics )
  1101         {
  1106         {
  1127 //
  1132 //
  1128 TInt CMmSIMTsy::DeleteSimCbTopicL(
  1133 TInt CMmSIMTsy::DeleteSimCbTopicL(
  1129     const TTsyReqHandle /*aTsyReqHandle */, 
  1134     const TTsyReqHandle /*aTsyReqHandle */, 
  1130     TUint* aSimCbTopicNumber )
  1135     TUint* aSimCbTopicNumber )
  1131     {
  1136     {
  1132 TFLOGSTRING("TSY: CMmSIMTsy::DeleteSimCbTopicL");
  1137 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_DELETESIMCBTOPICL_1, "TSY: CMmSIMTsy::DeleteSimCbTopicL");
  1133     TInt ret( KErrNone );
  1138     TInt ret( KErrNone );
  1134     TBool topicInSimMemoryDelete ( EFalse );
  1139     TBool topicInSimMemoryDelete ( EFalse );
  1135 
  1140 
  1136     // Check that neither browsing nor deleting request is pending
  1141     // Check that neither browsing nor deleting request is pending
  1137     if ( ESIMTsyReqHandleUnknown != iTsyReqHandleStore->GetTsyReqHandle(
  1142     if ( ESIMTsyReqHandleUnknown != iTsyReqHandleStore->GetTsyReqHandle(
  1186 // ---------------------------------------------------------------------------
  1191 // ---------------------------------------------------------------------------
  1187 //
  1192 //
  1188 void CMmSIMTsy::CompleteDeleteSimCbTopic(
  1193 void CMmSIMTsy::CompleteDeleteSimCbTopic(
  1189     TInt aError )
  1194     TInt aError )
  1190     {
  1195     {
  1191 TFLOGSTRING2("TSY: CMmSIMTsy::CompleteDeleteSimCbTopic- aError: %d", aError);
  1196 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_COMPLETEDELETESIMCBTOPIC_1, "TSY: CMmSIMTsy::CompleteDeleteSimCbTopic- aError: %d", aError);
  1192     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
  1197     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
  1193         ESIMRequestTypeDeleteSimCbTopic );
  1198         ESIMRequestTypeDeleteSimCbTopic );
  1194 
  1199 
  1195     if ( ESIMTsyReqHandleUnknown != reqHandle )
  1200     if ( ESIMTsyReqHandleUnknown != reqHandle )
  1196         {
  1201         {
  1296 // ---------------------------------------------------------------------------
  1301 // ---------------------------------------------------------------------------
  1297 void CMmSIMTsy::Complete(
  1302 void CMmSIMTsy::Complete(
  1298     TInt aReqHandleType, 
  1303     TInt aReqHandleType, 
  1299     TInt aError )
  1304     TInt aError )
  1300     {
  1305     {
  1301 TFLOGSTRING3( "CustomTSY: CMmSIMTsy::Complete.\n\t ReqHandleType:%d \n\t Error:%d\n", aReqHandleType, aError );
  1306 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMSIMTSY_COMPLETE_1,  "CustomTSY: CMmSIMTsy::Complete.\n\t ReqHandleType:%d \n\t Error:%d\n", aReqHandleType, aError );
  1302 
  1307 
  1303     // All possible TSY req handle types are listed in the
  1308     // All possible TSY req handle types are listed in the
  1304     // switch case below.
  1309     // switch case below.
  1305     switch ( aReqHandleType )
  1310     switch ( aReqHandleType )
  1306         {
  1311         {