adaptationlayer/tsy/nokiatsy_dll/src/cmmnetoperatornamehandler.cpp
changeset 5 8ccc39f9d787
parent 0 63b37f68c1ce
child 8 6295dc2169f3
equal deleted inserted replaced
4:510c70acdbf6 5:8ccc39f9d787
     9 * Initial Contributors:
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    10 * Nokia Corporation - initial contribution.
    11 *
    11 *
    12 * Contributors:
    12 * Contributors:
    13 *
    13 *
    14 * Description: 
    14 * Description:
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 
    18 
    19 
    19 
    32 #include <infoisi.h>
    32 #include <infoisi.h>
    33 #include <product_profile_definitions.h>
    33 #include <product_profile_definitions.h>
    34 #include <tisi.h>
    34 #include <tisi.h>
    35 //#include <permisi.h> To be done in CPS
    35 //#include <permisi.h> To be done in CPS
    36 
    36 
    37 #include "osttracedefinitions.h"
    37 #include "OstTraceDefinitions.h"
    38 #ifdef OST_TRACE_COMPILER_IN_USE
    38 #ifdef OST_TRACE_COMPILER_IN_USE
    39 #include "cmmnetoperatornamehandlertraces.h"
    39 #include "cmmnetoperatornamehandlerTraces.h"
    40 #endif
    40 #endif
    41 
    41 
    42 // EXTERNAL DATA STRUCTURES
    42 // EXTERNAL DATA STRUCTURES
    43     //None
    43     //None
    44 
    44 
   148 // Two-phased constructor.
   148 // Two-phased constructor.
   149 // -----------------------------------------------------------------------------
   149 // -----------------------------------------------------------------------------
   150 //
   150 //
   151 CMmNetOperatorNameHandler* CMmNetOperatorNameHandler::NewL
   151 CMmNetOperatorNameHandler* CMmNetOperatorNameHandler::NewL
   152         (
   152         (
   153         CMmNetMessHandler* aNetMessHandler // Pointer to the NetMessHandler.
   153         CMmNetMessHandler* aNetMessHandler, // Pointer to the NetMessHandler.
       
   154         CMmUiccMessHandler* aUiccMessHandler
   154         )
   155         )
   155     {
   156     {
   156 TFLOGSTRING("TSY: CMmNetOperatorNameHandler::NewL");
   157 TFLOGSTRING("TSY: CMmNetOperatorNameHandler::NewL");
   157 OstTrace0( TRACE_NORMAL, CMMNETOPERATORNAMEHANDLER_NEWL, "CMmNetOperatorNameHandler::NewL" );
   158 OstTrace0( TRACE_NORMAL, CMMNETOPERATORNAMEHANDLER_NEWL, "CMmNetOperatorNameHandler::NewL" );
   158 
   159 
   160         new ( ELeave ) CMmNetOperatorNameHandler();
   161         new ( ELeave ) CMmNetOperatorNameHandler();
   161 
   162 
   162     CleanupStack::PushL( netOperatorNameHandler );
   163     CleanupStack::PushL( netOperatorNameHandler );
   163 
   164 
   164     netOperatorNameHandler->iNetMessHandler = aNetMessHandler;
   165     netOperatorNameHandler->iNetMessHandler = aNetMessHandler;
       
   166     netOperatorNameHandler->iMmUiccMessHandler = aUiccMessHandler;
   165     netOperatorNameHandler->ConstructL();
   167     netOperatorNameHandler->ConstructL();
   166 
   168 
   167     CleanupStack::Pop( netOperatorNameHandler );
   169     CleanupStack::Pop( netOperatorNameHandler );
   168 
   170 
   169     return netOperatorNameHandler;
   171     return netOperatorNameHandler;
   217     // Initialize.
   219     // Initialize.
   218     iFromGetOperatorName = EFalse;
   220     iFromGetOperatorName = EFalse;
   219     iFromGetManualSearchOperatorName = EFalse;
   221     iFromGetManualSearchOperatorName = EFalse;
   220 
   222 
   221     iManualSearchIndexValue = 0;
   223     iManualSearchIndexValue = 0;
       
   224     iOplRecordCount = 0;
       
   225     iOplRecordNumber = 1; //Reading starts from record 1
   222 
   226 
   223     // Initialization of PP bit value, initialized to non used value.
   227     // Initialization of PP bit value, initialized to non used value.
   224 #ifdef INTERNAL_TESTING_OLD_IMPLEMENTATION_FOR_UICC_TESTING
   228 #ifdef INTERNAL_TESTING_OLD_IMPLEMENTATION_FOR_UICC_TESTING
   225     iInfoPpEonsFeatValue = 0xFF;
   229     iInfoPpEonsFeatValue = 0xFF;
   226 #endif /* INTERNAL_TESTING_OLD_IMPLEMENTATION_FOR_UICC_TESTING */
   230 #endif /* INTERNAL_TESTING_OLD_IMPLEMENTATION_FOR_UICC_TESTING */
   227     // TO BE DONE WITH INFO_PP_DATA_READ_RESP
   231     // TO BE DONE WITH INFO_PP_DATA_READ_RESP
   228     iInfoPpEonsFeatValue = INFO_PP_EONS_FEAT_0;
   232     iInfoPpEonsFeatValue = INFO_PP_EONS_FEAT_0;
   229     
   233 
   230     // Read INFO_PP_EONS_FEAT PP bit value.
   234     // Read INFO_PP_EONS_FEAT PP bit value.
   231     InfoPpReadReq();
   235     InfoPpReadReq();
   232 
   236 
   233     // Read NITZ data from PMM.
   237     // Read NITZ data from PMM.
   234     PermPmRecordReadReq();
   238     PermPmRecordReadReq();
   661                 // SimOperatorReqReadPnn request is sended from
   665                 // SimOperatorReqReadPnn request is sended from
   662                 // GetOperatorName method.
   666                 // GetOperatorName method.
   663                 // This flag is needed to handle correct IPC value.
   667                 // This flag is needed to handle correct IPC value.
   664                 iFromGetOperatorName = ETrue;
   668                 iFromGetOperatorName = ETrue;
   665 
   669 
       
   670                 // This PNN record has not been read earlier.
       
   671                 SendReadPnnReq(
       
   672                     tempMCC,
       
   673                     tempMNC,
       
   674                     tempPnnIdentifier,
       
   675                     aLocationArea,
       
   676                     aNetworkName );
       
   677 
   666                 // No need to check NITZ.
   678                 // No need to check NITZ.
   667                 checkNitzName = EFalse;
   679                 checkNitzName = EFalse;
   668 
   680 
   669                 // Set EFalse as completing will be done after
   681                 // Set EFalse as completing will be done after
   670                 // SimOperatorRespReadPnn message is handled.
   682                 // UiccOperatorRespReadPnn message is handled.
   671                 // completeNow = EFalse;
   683                 completeNow = EFalse;
   672                 }
   684                 }
   673             }
   685             }
   674         }
   686         }
   675     else
   687     else
   676         {
   688         {
   726                     // SimOperatorReqReadPnn request is sended from
   738                     // SimOperatorReqReadPnn request is sended from
   727                     // GetOperatorName method.
   739                     // GetOperatorName method.
   728                     // This flag is needed to handle correct IPC value.
   740                     // This flag is needed to handle correct IPC value.
   729                     iFromGetOperatorName = ETrue;
   741                     iFromGetOperatorName = ETrue;
   730 
   742 
       
   743                     // This PNN record has not been read earlier.
       
   744                     SendReadPnnReq(
       
   745                         tempMCC,
       
   746                         tempMNC,
       
   747                         tempPnnIdentifier,
       
   748                         aLocationArea,
       
   749                         aNetworkName );
       
   750 
   731                     // No need to check NITZ.
   751                     // No need to check NITZ.
   732                     checkNitzName = EFalse;
   752                     checkNitzName = EFalse;
   733 
   753 
   734                     // Set EFalse as completing will be done after
   754                     // Set EFalse as completing will be done after
   735                     // SimOperatorRespReadPnn message is handled.
   755                     // UiccOperatorRespReadPnn message is handled.
   736                     completeNow = EFalse;
   756                     completeNow = EFalse;
   737                     }
   757                     }
   738                 }
   758                 }
   739             }
   759             }
   740         }
   760         }
  1177                     // ETrue as SimOperatorReqReadPnn request is sended
  1197                     // ETrue as SimOperatorReqReadPnn request is sended
  1178                     // from GetManualSearchOperatorName method.
  1198                     // from GetManualSearchOperatorName method.
  1179                     // This flag is needed to handle correct IPC value.
  1199                     // This flag is needed to handle correct IPC value.
  1180                     iFromGetManualSearchOperatorName = ETrue;
  1200                     iFromGetManualSearchOperatorName = ETrue;
  1181 
  1201 
       
  1202                     // This PNN record has not read been earlier.
       
  1203                     SendReadPnnReq(
       
  1204                         mcc,
       
  1205                         mnc,
       
  1206                         tempPnnIdentifier,
       
  1207                         locationArea,
       
  1208                         networkName );
       
  1209 
  1182                     // Set EFalse as completing will be done after
  1210                     // Set EFalse as completing will be done after
  1183                     // SimOperatorRespReadPnn message is handled.
  1211                     // UiccOperatorRespReadPnn message is handled.
  1184                     // completeNow = EFalse;
  1212                     completeNow = EFalse;
  1185                     }
  1213                     }
  1186                 }
  1214                 }
  1187             // No else.
  1215             // No else.
  1188             }
  1216             }
  1189         else
  1217         else
  1236                         // ETrue as SimOperatorReqReadPnn request is sended
  1264                         // ETrue as SimOperatorReqReadPnn request is sended
  1237                         // from GetManualSearchOperatorName method.
  1265                         // from GetManualSearchOperatorName method.
  1238                         // This flag is needed to handle correct IPC value.
  1266                         // This flag is needed to handle correct IPC value.
  1239                         iFromGetManualSearchOperatorName = ETrue;
  1267                         iFromGetManualSearchOperatorName = ETrue;
  1240 
  1268 
       
  1269                         // This PNN record has not been read earlier.
       
  1270                         SendReadPnnReq(
       
  1271                             mcc,
       
  1272                             mnc,
       
  1273                             tempPnnIdentifier,
       
  1274                             locationArea,
       
  1275                             networkName );
       
  1276 
  1241                         // Set EFalse as completing will be done after
  1277                         // Set EFalse as completing will be done after
  1242                         // SimOperatorRespReadPnn message is handled.
  1278                         // UiccOperatorRespReadPnn message is handled.
  1243                         // completeNow = EFalse;
  1279                         completeNow = EFalse;
  1244                         }
  1280                         }
  1245                     }
  1281                     }
  1246                 // No else.
  1282                 // No else.
  1247                 }
  1283                 }
  1248             // No else.
  1284             // No else.
  1392         const TIsiReceiveC& aIsiMessage
  1428         const TIsiReceiveC& aIsiMessage
  1393         )
  1429         )
  1394     {
  1430     {
  1395     // Get status.
  1431     // Get status.
  1396 #ifdef INTERNAL_TESTING_OLD_IMPLEMENTATION_FOR_UICC_TESTING
  1432 #ifdef INTERNAL_TESTING_OLD_IMPLEMENTATION_FOR_UICC_TESTING
  1397 // TO BE DONE WITH INFO_PP_DATA_READ_RESP  
  1433 // TO BE DONE WITH INFO_PP_DATA_READ_RESP
  1398     TUint8 status( aIsiMessage.Get8bit(
  1434     TUint8 status( aIsiMessage.Get8bit(
  1399         ISI_HEADER_SIZE + INFO_PP_READ_RESP_OFFSET_STATUS ) );
  1435         ISI_HEADER_SIZE + INFO_PP_READ_RESP_OFFSET_STATUS ) );
  1400 
  1436 
  1401 TFLOGSTRING2("TSY: CMmNetOperatorNameHandler::InfoPpReadResp - Status: %d", status);
  1437 TFLOGSTRING2("TSY: CMmNetOperatorNameHandler::InfoPpReadResp - Status: %d", status);
  1402 OstTraceExt1( TRACE_NORMAL, CMMNETOPERATORNAMEHANDLER_INFOPPREADRESP, "CMmNetOperatorNameHandler::InfoPpReadResp;status=%hhu", status );
  1438 OstTraceExt1( TRACE_NORMAL, CMMNETOPERATORNAMEHANDLER_INFOPPREADRESP, "CMmNetOperatorNameHandler::InfoPpReadResp;status=%hhu", status );
  2132         // Set iOplRuleMatch value to EFalse.
  2168         // Set iOplRuleMatch value to EFalse.
  2133         // This informs that OPL record didn't match.
  2169         // This informs that OPL record didn't match.
  2134         iOplRuleMatch = EFalse;
  2170         iOplRuleMatch = EFalse;
  2135         }
  2171         }
  2136 TFLOGSTRING2("TSY: CMmNetOperatorNameHandler::OplRuleRecordChecker - OPL Rule Match value T/F: %d", iOplRuleMatch);
  2172 TFLOGSTRING2("TSY: CMmNetOperatorNameHandler::OplRuleRecordChecker - OPL Rule Match value T/F: %d", iOplRuleMatch);
  2137 OstTraceExt1( TRACE_NORMAL, DUP5_CMMNETOPERATORNAMEHANDLER_OPLRULERECORDCHECKER, "CMmNetOperatorNameHandler::OplRuleRecordChecker - OPL Rule Match value T/F=%hhu", iOplRuleMatch );
  2173 OstTrace1( TRACE_NORMAL, DUP6_CMMNETOPERATORNAMEHANDLER_OPLRULERECORDCHECKER, "CMmNetOperatorNameHandler::OplRuleRecordChecker;iOplRuleMatch=%d", iOplRuleMatch );
  2138     }
  2174     }
  2139 
  2175 
  2140 // -----------------------------------------------------------------------------
  2176 // -----------------------------------------------------------------------------
  2141 // CMmNetOperatorNameHandler::BCDCharChecker
  2177 // CMmNetOperatorNameHandler::BCDCharChecker
  2142 // Check BCD char against rule to find out is that matching with OPL list.
  2178 // Check BCD char against rule to find out is that matching with OPL list.
  2574 TFLOGSTRING("TSY: CMmNetOperatorNameHandler::GetPnnRecordIdentifierValue");
  2610 TFLOGSTRING("TSY: CMmNetOperatorNameHandler::GetPnnRecordIdentifierValue");
  2575 OstTrace0( TRACE_NORMAL, CMMNETOPERATORNAMEHANDLER_GETPNNRECORDIDENTIFIERVALUE, "CMmNetOperatorNameHandler::GetPnnRecordIdentifierValue" );
  2611 OstTrace0( TRACE_NORMAL, CMMNETOPERATORNAMEHANDLER_GETPNNRECORDIDENTIFIERVALUE, "CMmNetOperatorNameHandler::GetPnnRecordIdentifierValue" );
  2576     return iEonsName.iPNNIdentifier;
  2612     return iEonsName.iPNNIdentifier;
  2577     }
  2613     }
  2578 
  2614 
       
  2615 // -----------------------------------------------------------------------------
       
  2616 // CMmNetOperatorNameHandler::UiccReadOplRecordCount
       
  2617 // Reads record count of EFopl
       
  2618 // -----------------------------------------------------------------------------
       
  2619 //
       
  2620 void CMmNetOperatorNameHandler::UiccReadOplRecordCount()
       
  2621     {
       
  2622 TFLOGSTRING("TSY: CMmNetOperatorNameHandler::UiccReadOplRecordCount");
       
  2623 OstTrace0( TRACE_NORMAL, CMMNETOPERATORNAMEHANDLER_UICCREADOPLRECORDCOUNT, "CMmNetOperatorNameHandler::UiccReadOplRecordCount" );
       
  2624     // Initialize to default value
       
  2625     iOplListAvailable = EFalse;
       
  2626 
       
  2627     TUint8 fileIdSfi( 0x1A ); // Default value for 3G
       
  2628     // Get card type to define SFI
       
  2629     TUint8 cardType( iMmUiccMessHandler->GetCardType() );
       
  2630     if ( UICC_CARD_TYPE_ICC == cardType )
       
  2631         {
       
  2632         fileIdSfi = UICC_SFI_NOT_PRESENT;
       
  2633         }
       
  2634 
       
  2635     // Set parameters for UICC_APPL_CMD_REQ message
       
  2636     TUiccParamsBase params;
       
  2637     params.messHandlerPtr = static_cast<MUiccOperationBase*>( this );
       
  2638     params.trId = ETrIdReadOplRecordCount;
       
  2639     params.fileId = KElemFileOpl;
       
  2640     params.fileIdSfi = fileIdSfi;
       
  2641     params.serviceType = UICC_APPL_FILE_INFO;
       
  2642 
       
  2643     // File path
       
  2644     params.filePath.Append( KMasterFileId >> 8 );
       
  2645     params.filePath.Append( KMasterFileId );
       
  2646     params.filePath.Append( iMmUiccMessHandler->GetApplicationFileId() );
       
  2647 
       
  2648     iMmUiccMessHandler->CreateUiccApplCmdReq( params );
       
  2649     }
       
  2650 
       
  2651 // -----------------------------------------------------------------------------
       
  2652 // CMmNetOperatorNameHandler::UiccOplRecordCountResponse
       
  2653 // Response handling for record count of EFopl
       
  2654 // -----------------------------------------------------------------------------
       
  2655 //
       
  2656 void CMmNetOperatorNameHandler::UiccOplRecordCountResponse(
       
  2657     TInt aStatus,
       
  2658     const TDesC8& aFileData )
       
  2659     {
       
  2660 TFLOGSTRING("TSY: CMmNetOperatorNameHandler::UiccOplRecordCountResponse");
       
  2661 OstTrace0( TRACE_NORMAL, CMMNETOPERATORNAMEHANDLER_UICCOPLRECORDCOUNTRESPONSE, "CMmNetOperatorNameHandler::UiccOplRecordCountResponse" );
       
  2662 
       
  2663     TBool checkRefresh( ETrue );
       
  2664     if ( UICC_STATUS_OK == aStatus )
       
  2665         {
       
  2666         TFci fci( aFileData );
       
  2667         iOplRecordCount = fci.GetNumberOfRecords();
       
  2668 
       
  2669         // If there is at least one record, start to read EFopl records
       
  2670         if ( 0 < iOplRecordCount )
       
  2671             {
       
  2672             // Reset array that it can be reused.
       
  2673             iOperatorPlmnListTable.Reset();
       
  2674             // Start reading from the first record
       
  2675             UiccReadOplReq();
       
  2676             // Don't check refresh yet because reading continues
       
  2677             checkRefresh = EFalse;
       
  2678             }
       
  2679         else
       
  2680             {
       
  2681 TFLOGSTRING("TSY: CMmNetOperatorNameHandler::UiccOplRecordCountResponse - No OPL records on (U)SIM");
       
  2682 OstTrace0( TRACE_NORMAL, DUP1_CMMNETOPERATORNAMEHANDLER_UICCOPLRECORDCOUNTRESPONSE, "CMmNetOperatorNameHandler::UiccOplRecordCountResponse - No OPL records on (U)SIM" );
       
  2683             }
       
  2684         }
       
  2685     else
       
  2686         {
       
  2687 TFLOGSTRING("TSY: CMmNetOperatorNameHandler::UiccOplRecordCountResponse - Reading of OPL record count failed");
       
  2688 OstTrace0( TRACE_NORMAL, DUP2_CMMNETOPERATORNAMEHANDLER_UICCOPLRECORDCOUNTRESPONSE, "CMmNetOperatorNameHandler::UiccOplRecordCountResponse - Reading of OPL record count failed" );
       
  2689         }
       
  2690 
       
  2691     // There was error reading OPL or record number was zero.
       
  2692     if ( checkRefresh )
       
  2693         {
       
  2694         // Complete refresh. Refresh status is checked in complete.
       
  2695         TBool retOplRefreshOngoing = iNetMessHandler->
       
  2696             GetMessageRouter()->
       
  2697             GetPhoneMessHandler()->
       
  2698             OplRulesCachingCompleted( KErrNotFound );
       
  2699 
       
  2700         // If OPL request is done in boot phase we need handle possible
       
  2701         // queued Net messages. In refresh situation this is not
       
  2702         // allowed to call.
       
  2703         if ( !retOplRefreshOngoing )
       
  2704             {
       
  2705             // OPL Rules read in boot, start handle queued messsages.
       
  2706             iNetMessHandler->ContinueHandlingNetModemRegStatusMessages();
       
  2707             }
       
  2708         }
       
  2709     }
       
  2710 
       
  2711 // -----------------------------------------------------------------------------
       
  2712 // CMmNetOperatorNameHandler::UiccReadOplReq
       
  2713 // Request ro read a record of EFopl
       
  2714 // -----------------------------------------------------------------------------
       
  2715 //
       
  2716 void CMmNetOperatorNameHandler::UiccReadOplReq()
       
  2717     {
       
  2718 TFLOGSTRING("TSY: CMmNetOperatorNameHandler::UiccReadOplResp");
       
  2719 OstTrace0( TRACE_NORMAL, CMMNETOPERATORNAMEHANDLER_UICCREADOPLREQ, "CMmNetOperatorNameHandler::UiccReadOplReq" );
       
  2720 
       
  2721     TUint8 fileIdSfi( 0x1A ); // Default value for 3G
       
  2722     // Get card type to define SFI
       
  2723     TUint8 cardType( iMmUiccMessHandler->GetCardType() );
       
  2724     if ( UICC_CARD_TYPE_ICC == cardType )
       
  2725         {
       
  2726         fileIdSfi = UICC_SFI_NOT_PRESENT;
       
  2727         }
       
  2728 
       
  2729     // Set parameters for UICC_APPL_CMD_REQ message
       
  2730     TUiccReadLinearFixed params;
       
  2731     params.messHandlerPtr = static_cast<MUiccOperationBase*>( this );
       
  2732     params.trId = ETrIdReadOplRecord;
       
  2733     params.dataOffset = 0;
       
  2734     params.dataAmount = 0;
       
  2735     params.record = iOplRecordNumber;
       
  2736     params.fileId = KElemFileOpl;
       
  2737     params.fileIdSfi = fileIdSfi;
       
  2738     params.serviceType = UICC_APPL_READ_LINEAR_FIXED;
       
  2739 
       
  2740     // File path
       
  2741     params.filePath.Append( KMasterFileId >> 8 );
       
  2742     params.filePath.Append( KMasterFileId );
       
  2743     params.filePath.Append( iMmUiccMessHandler->GetApplicationFileId() );
       
  2744 
       
  2745     iMmUiccMessHandler->CreateUiccApplCmdReq( params );
       
  2746     }
       
  2747 
       
  2748 // -----------------------------------------------------------------------------
       
  2749 // CMmNetOperatorNameHandler::UiccReadOplResp
       
  2750 // Request ro read a record of EFopl
       
  2751 // -----------------------------------------------------------------------------
       
  2752 //
       
  2753 void CMmNetOperatorNameHandler::UiccReadOplResp( const TDesC8& aFileData )
       
  2754     {
       
  2755 TFLOGSTRING("TSY: CMmNetOperatorNameHandler::UiccReadOplResp");
       
  2756 OstTrace0( TRACE_NORMAL, CMMNETOPERATORNAMEHANDLER_UICCREADOPLRESP, "CMmNetOperatorNameHandler::UiccReadOplResp" );
       
  2757     if ( 8 == aFileData.Length() )
       
  2758         {
       
  2759         // Temp data
       
  2760         TOperatorPLMNList tempOperatorPlmnList;
       
  2761 
       
  2762         // See structure of EFopl from 3GPP TS 31.102 V8.3.0
       
  2763         // Chapter 4.2.59   EFOPL (Operator PLMN List)
       
  2764         // Get the operator code BCD string. Length is 3 bytes.
       
  2765         tempOperatorPlmnList.iOperCodeBCD = aFileData.Mid( 0, 3 );
       
  2766 
       
  2767         // Get the lower limit of location area code.
       
  2768         tempOperatorPlmnList.iLACLowerLimit =
       
  2769             ( aFileData[3] << 8 ) | aFileData[4];
       
  2770 
       
  2771         // Get the upper limit of location area code.
       
  2772         tempOperatorPlmnList.iLACUpperLimit =
       
  2773             ( aFileData[5] << 8 ) | aFileData[6];
       
  2774 
       
  2775         // Get the PNN Identifier.
       
  2776         tempOperatorPlmnList.iPNNIdentifier = aFileData[7];
       
  2777 
       
  2778         // Add operator PLMN list data to record list.
       
  2779         iOperatorPlmnListTable.Append( tempOperatorPlmnList );
       
  2780 
       
  2781 TFLOGSTRING2("TSY: CMmNetOperatorNameHandler::SimOperatorRespReadOpl, OPL Record saved to OPL List index: %d", (iOplRecordNumber - 2 ) );
       
  2782 TFLOGSTRING4("TSY: CMmNetOperatorNameHandler::SimOperatorRespReadOpl, Operator Code BCD string: %02X %02X %02X", tempOperatorPlmnList.iOperCodeBCD[0], tempOperatorPlmnList.iOperCodeBCD[1], tempOperatorPlmnList.iOperCodeBCD[2]);
       
  2783 TFLOGSTRING3("TSY: CMmNetOperatorNameHandler::SimOperatorRespReadOpl, LAC between: %d - %d", tempOperatorPlmnList.iLACUpperLimit, tempOperatorPlmnList.iLACLowerLimit);
       
  2784 TFLOGSTRING2("TSY: CMmNetOperatorNameHandler::SimOperatorRespReadOpl, PNN Identifier: %d", tempOperatorPlmnList.iPNNIdentifier);
       
  2785 OstTraceExt1( TRACE_NORMAL, DUP1_CMMNETOPERATORNAMEHANDLER_UICCREADOPLRESP, "CMmNetOperatorNameHandler::UiccReadOplResp;iOplRecordNumber=%hhu", iOplRecordNumber );
       
  2786 OstTraceExt3( TRACE_NORMAL, DUP2_CMMNETOPERATORNAMEHANDLER_UICCREADOPLRESP, "CMmNetOperatorNameHandler::UiccReadOplResp;tempOperatorPlmnList.iOperCodeBCD[0]=%hhx;tempOperatorPlmnList.iOperCodeBCD[1]=%hhx;tempOperatorPlmnList.iOperCodeBCD[2]=%hhx", tempOperatorPlmnList.iOperCodeBCD[0], tempOperatorPlmnList.iOperCodeBCD[1], tempOperatorPlmnList.iOperCodeBCD[2] );
       
  2787 OstTraceExt2( TRACE_NORMAL, DUP3_CMMNETOPERATORNAMEHANDLER_UICCREADOPLRESP, "CMmNetOperatorNameHandler::UiccReadOplResp;tempOperatorPlmnList.iLACUpperLimit=%u;tempOperatorPlmnList.iLACLowerLimit=%u", tempOperatorPlmnList.iLACUpperLimit, tempOperatorPlmnList.iLACLowerLimit );
       
  2788 OstTraceExt1( TRACE_NORMAL, DUP4_CMMNETOPERATORNAMEHANDLER_UICCREADOPLRESP, "CMmNetOperatorNameHandler::UiccReadOplResp;tempOperatorPlmnList.iPNNIdentifier=%hhd", tempOperatorPlmnList.iPNNIdentifier );
       
  2789 
       
  2790         // Clear buffer before next round
       
  2791         tempOperatorPlmnList.iOperCodeBCD.Zero();
       
  2792 
       
  2793         // At least one record was saved successfully
       
  2794         iOplListAvailable = ETrue;
       
  2795         }
       
  2796     else
       
  2797         {
       
  2798 TFLOGSTRING("TSY: CMmNetOperatorNameHandler::UiccReadOplResp - Invalid data in OPL record");
       
  2799 OstTrace0( TRACE_NORMAL, DUP5_CMMNETOPERATORNAMEHANDLER_UICCREADOPLRESP, "CMmNetOperatorNameHandler::UiccReadOplResp - Invalid data in OPL record" );
       
  2800         }
       
  2801     }
       
  2802 
       
  2803 // -----------------------------------------------------------------------------
       
  2804 // CMmNetOperatorNameHandler::UiccOperatorReq
       
  2805 // Read operator name from (U)SIM
       
  2806 // -----------------------------------------------------------------------------
       
  2807 //
       
  2808 void CMmNetOperatorNameHandler::UiccOperatorReq()
       
  2809     {
       
  2810 TFLOGSTRING("TSY: CMmNetOperatorNameHandler::UiccOperatorReq" );
       
  2811 OstTrace0( TRACE_NORMAL, CMMNETOPERATORNAMEHANDLER_UICCOPERATORREQ, "CMmNetOperatorNameHandler::UiccOperatorReq" );
       
  2812 
       
  2813     // Set parameters for UICC_APPL_CMD_REQ message
       
  2814     TUiccReadTransparent params;
       
  2815     params.messHandlerPtr = static_cast<MUiccOperationBase*>( this );
       
  2816     params.trId = ETrIdReadOperatorName;
       
  2817     params.dataOffset = 0;
       
  2818     params.dataAmount = 0;
       
  2819     params.fileId = KElemFileOperatorName;
       
  2820     params.fileIdSfi = UICC_SFI_NOT_PRESENT;
       
  2821     params.serviceType = UICC_APPL_READ_TRANSPARENT;
       
  2822 
       
  2823     // File id path
       
  2824     params.filePath.Append( KMasterFileId >> 8 );
       
  2825     params.filePath.Append( KMasterFileId );
       
  2826     params.filePath.Append( iMmUiccMessHandler->GetApplicationFileId() );
       
  2827 
       
  2828     iMmUiccMessHandler->CreateUiccApplCmdReq( params );
       
  2829     }
       
  2830 
       
  2831 // -----------------------------------------------------------------------------
       
  2832 // CMmNetOperatorNameHandler::UiccOperatorResp
       
  2833 // Handle response for operator neme reading
       
  2834 // -----------------------------------------------------------------------------
       
  2835 //
       
  2836 void CMmNetOperatorNameHandler::UiccOperatorResp(
       
  2837     TInt aStatus,
       
  2838     const TDesC8& aFileData
       
  2839     )
       
  2840     {
       
  2841 TFLOGSTRING("TSY: CMmNetOperatorNameHandler::UiccOperatorResp");
       
  2842 OstTrace0( TRACE_NORMAL, CMMNETOPERATORNAMEHANDLER_UICCOPERATORRESP, "CMmNetOperatorNameHandler::UiccOperatorResp" );
       
  2843 
       
  2844     if ( UICC_STATUS_OK == aStatus )
       
  2845         {
       
  2846         // Reset ONS name.
       
  2847         iOperatorNameString.Zero();
       
  2848 
       
  2849         // Get length of operator name. Coded as SMS default 7-bit coded alphabet
       
  2850         // as defined in GSM 03.38 with bit 8 set to 0
       
  2851         TInt nameLength( aFileData.Length() );
       
  2852         if ( KOnsNameMaxLength < nameLength )
       
  2853             {
       
  2854             nameLength = KOnsNameMaxLength;
       
  2855             }
       
  2856 
       
  2857         // Save operator name string to internal buffer as 16-bit
       
  2858         for ( TUint8 i( 0 ); i < nameLength; i++ )
       
  2859             {
       
  2860             iOperatorNameString.Append( static_cast<TUint16> ( aFileData[i] ) );
       
  2861             }
       
  2862 TFLOGSTRING2("TSY: CMmNetOperatorNameHandler::UiccOperatorResp, ONS Name: %S", &iOperatorNameString);
       
  2863 OstTraceExt1( TRACE_NORMAL, DUP1_CMMNETOPERATORNAMEHANDLER_UICCOPERATORRESP, "CMmNetOperatorNameHandler::UiccOperatorResp;iOperatorNameString=%S", iOperatorNameString );
       
  2864         }
       
  2865     else
       
  2866         {
       
  2867 TFLOGSTRING("TSY: CMmNetOperatorNameHandler::UiccOperatorResp - Error occured, data not available");
       
  2868 OstTrace0( TRACE_NORMAL, DUP2_CMMNETOPERATORNAMEHANDLER_UICCOPERATORRESP, "CMmNetOperatorNameHandler::UiccOperatorResp- Error occured, data not available" );
       
  2869         // Data not available.
       
  2870         iOperatorNameString.Zero();
       
  2871         }
       
  2872 
       
  2873     // Complete refresh.
       
  2874     // Refresh status is checked in complete.
       
  2875     iNetMessHandler->
       
  2876         GetMessageRouter()->
       
  2877         GetPhoneMessHandler()->
       
  2878         OnsNameCachingCompleted( aStatus );
       
  2879     }
       
  2880 
       
  2881 // -----------------------------------------------------------------------------
       
  2882 // CMmNetOperatorNameHandler::ProcessUiccMsg
       
  2883 // Handles data received from UICC server
       
  2884 // -----------------------------------------------------------------------------
       
  2885 //
       
  2886 TInt CMmNetOperatorNameHandler::ProcessUiccMsg(
       
  2887     TInt aTraId,
       
  2888     TInt aStatus,
       
  2889     TUint8 /*aDetails*/,
       
  2890     const TDesC8& aFileData )
       
  2891     {
       
  2892 TFLOGSTRING3("TSY:CMmNetOperatorNameHandler::ProcessUiccMsg, aTraId: %d, status: %d", aTraId, aStatus );
       
  2893 OstTraceExt2( TRACE_NORMAL, CMMNETOPERATORNAMEHANDLER_PROCESSUICCMSG, "CMmNetOperatorNameHandler::ProcessUiccMsg;aTraId=%d;aStatus=%d", aTraId, aStatus );
       
  2894 
       
  2895     TInt ret( KErrNone );
       
  2896     TInt status( KErrNone );
       
  2897 
       
  2898     switch ( aTraId )
       
  2899         {
       
  2900         case ETrIdReadOplRecordCount:
       
  2901             {
       
  2902             UiccOplRecordCountResponse( aStatus, aFileData );
       
  2903             break;
       
  2904             }
       
  2905         case ETrIdReadOplRecord:
       
  2906             {
       
  2907             // Decrease amount of records left and increase record number
       
  2908             // to be read next
       
  2909             iOplRecordCount--;
       
  2910             iOplRecordNumber++;
       
  2911 
       
  2912             // OPL record was read successfully, handle response data
       
  2913             if ( UICC_STATUS_OK == aStatus )
       
  2914                 {
       
  2915                 UiccReadOplResp( aFileData );
       
  2916                 }
       
  2917             else
       
  2918                 {
       
  2919 TFLOGSTRING("TSY: CMmNetOperatorNameHandler::ProcessUiccMsg(ETrIdReadOplRecord) - Error occured when reading OPL record");
       
  2920 OstTrace0( TRACE_NORMAL, DUP3_CMMNETOPERATORNAMEHANDLER_PROCESSUICCMSG, "CMmNetOperatorNameHandler::ProcessUiccMsg - - Error occured when reading OPL record" );
       
  2921                 }
       
  2922 
       
  2923             // There are still records left. Continue reading regardless of
       
  2924             // the previous read was failed or not
       
  2925             if ( 0 < iOplRecordCount)
       
  2926                 {
       
  2927                 UiccReadOplReq();
       
  2928                 }
       
  2929             else // All records were read
       
  2930                 {
       
  2931                 iOplRulesRead = ETrue;
       
  2932                 iOplRecordNumber = 1; // Default value
       
  2933 
       
  2934                 // None of the records was read successfully
       
  2935                 if ( ! iOplListAvailable )
       
  2936                     {
       
  2937 TFLOGSTRING("TSY: CMmNetOperatorNameHandler::ProcessUiccMsg(ETrIdReadOplRecord) - No OPL records available");
       
  2938 OstTrace0( TRACE_NORMAL, DUP2_CMMNETOPERATORNAMEHANDLER_PROCESSUICCMSG, "CMmNetOperatorNameHandler::ProcessUiccMsg - No OPL records available" );
       
  2939                     // Reset array
       
  2940                     iOperatorPlmnListTable.Reset();
       
  2941                     status = KErrNotFound;
       
  2942                     }
       
  2943 
       
  2944                 // Complete refresh. Refresh status is checked in complete.
       
  2945                 TBool retOplRefreshOngoing = iNetMessHandler->
       
  2946                     GetMessageRouter()->
       
  2947                     GetPhoneMessHandler()->
       
  2948                     OplRulesCachingCompleted( status );
       
  2949 
       
  2950                 // If OPL request is done in boot phase we need handle possible
       
  2951                 // queued Net messages. In refresh situation this is not
       
  2952                 // allowed to call.
       
  2953                 if ( !retOplRefreshOngoing )
       
  2954                     {
       
  2955                     // OPL Rules read in boot, start handle queued messsages.
       
  2956                     iNetMessHandler->ContinueHandlingNetModemRegStatusMessages();
       
  2957                     }
       
  2958                 }
       
  2959             break;
       
  2960             }
       
  2961         case ETrIdReadOperatorName:
       
  2962             {
       
  2963             UiccOperatorResp( aStatus, aFileData );
       
  2964             break;
       
  2965             }
       
  2966         case ETrIdReadPnn:
       
  2967             {
       
  2968             UiccOperatorRespReadPnnL( aStatus, aFileData );
       
  2969             break;
       
  2970             }
       
  2971         default:
       
  2972             {
       
  2973 TFLOGSTRING("TSY:CMmNetOperatorNameHandler::ProcessUiccMsg - unknown transaction ID" );
       
  2974 OstTrace0( TRACE_NORMAL, DUP1_CMMNETOPERATORNAMEHANDLER_PROCESSUICCMSG, "CMmNetOperatorNameHandler::ProcessUiccMsg - unknown transaction ID" );
       
  2975             break;
       
  2976             }
       
  2977         }
       
  2978     return ret;
       
  2979     }
       
  2980 
       
  2981 // -----------------------------------------------------------------------------
       
  2982 // CMmNetOperatorNameHandler::SendReadPnnReq
       
  2983 //
       
  2984 // -----------------------------------------------------------------------------
       
  2985 //
       
  2986 void CMmNetOperatorNameHandler::SendReadPnnReq
       
  2987         (
       
  2988         TUint aMCC, // Mobile Country Code
       
  2989         TUint aMNC, // Mobile Network Code
       
  2990         TUint8 aPnnIdentifier, // PNN record identifier
       
  2991         const RMobilePhone::TMobilePhoneLocationAreaV1& aLocationAreaData, // LAC
       
  2992         const RMobilePhone::TMobilePhoneNetworkInfoV5& aNetworkData // Network data
       
  2993         )
       
  2994     {
       
  2995 TFLOGSTRING("TSY: CMmNetOperatorNameHandler::SendReadPnnReq");
       
  2996 OstTrace0( TRACE_NORMAL, CMMNETOPERATORNAMEHANDLER_SENDREADPNNREQ, "CMmNetOperatorNameHandler::SendReadPnnReq" );
       
  2997 
       
  2998     // Store Country code and Network code.
       
  2999     iEonsName.iMCC = aMCC;
       
  3000     iEonsName.iMNC = aMNC;
       
  3001     // Store PNN record number.
       
  3002     iEonsName.iPNNIdentifier = aPnnIdentifier;
       
  3003 
       
  3004     // Storing Location Area data for later use.
       
  3005     iLocationAreaData = aLocationAreaData;
       
  3006 
       
  3007     // Storing Network data for later use.
       
  3008     iNetworkData = aNetworkData;
       
  3009 
       
  3010     // Read PNN record from (U)SIM for getting EONS name
       
  3011     // for network.
       
  3012     UiccOperatorReqReadPnn( iEonsName.iPNNIdentifier );
       
  3013     }
       
  3014 
       
  3015 // -----------------------------------------------------------------------------
       
  3016 // CMmNetOperatorNameHandler::UiccOperatorReqReadPnn
       
  3017 // Creates UICC_APPL_CMD_REQ ISI message and sends it through phonet.
       
  3018 // This request is used to read the PLMN Network Name from EFpnn on (U)SIM.
       
  3019 // -----------------------------------------------------------------------------
       
  3020 //
       
  3021 void CMmNetOperatorNameHandler::UiccOperatorReqReadPnn( TUint8 aPnnIdentifier )
       
  3022     {
       
  3023 TFLOGSTRING2("TSY: CMmNetOperatorNameHandler::UiccOperatorReqReadPnn, PNN Identifier: %d", aPnnIdentifier);
       
  3024 OstTraceExt1( TRACE_NORMAL, CMMNETOPERATORNAMEHANDLER_UICCOPERATORREQREADPNN, "CMmNetOperatorNameHandler::UiccOperatorReqReadPnn;aPnnIdentifier=%hhu", aPnnIdentifier );
       
  3025 
       
  3026     TUint8 fileIdSfi( 0x19 ); // Default value for 3G
       
  3027     // Get card type to define SFI
       
  3028     TUint8 cardType( iMmUiccMessHandler->GetCardType() );
       
  3029     if ( UICC_CARD_TYPE_ICC == cardType )
       
  3030         {
       
  3031         fileIdSfi = UICC_SFI_NOT_PRESENT;
       
  3032         }
       
  3033 
       
  3034     // Set parameters for UICC_APPL_CMD_REQ message
       
  3035     TUiccReadLinearFixed params;
       
  3036     params.messHandlerPtr = static_cast<MUiccOperationBase*>( this );
       
  3037     params.trId = ETrIdReadPnn;
       
  3038     params.dataOffset = 0;
       
  3039     params.dataAmount = 0;
       
  3040     params.record = aPnnIdentifier;
       
  3041     params.fileId = KElemFilePlmnNetworkName;
       
  3042     params.fileIdSfi = fileIdSfi;
       
  3043     params.serviceType = UICC_APPL_READ_LINEAR_FIXED;
       
  3044 
       
  3045     // File path
       
  3046     params.filePath.Append( KMasterFileId >> 8 );
       
  3047     params.filePath.Append( KMasterFileId );
       
  3048     params.filePath.Append( iMmUiccMessHandler->GetApplicationFileId() );
       
  3049 
       
  3050     iMmUiccMessHandler->CreateUiccApplCmdReq( params );
       
  3051     }
       
  3052 
       
  3053 // -----------------------------------------------------------------------------
       
  3054 // CMmNetOperatorNameHandler::UiccOperatorRespReadPnnL
       
  3055 // Handles the PLMN Network Name from EFpnn on (U)SIM.
       
  3056 // -----------------------------------------------------------------------------
       
  3057 //
       
  3058 void CMmNetOperatorNameHandler::UiccOperatorRespReadPnnL(
       
  3059     TInt aStatus,
       
  3060     const TDesC8& aFileData )
       
  3061     {
       
  3062 TFLOGSTRING2("TSY: CMmNetOperatorNameHandler::UiccOperatorRespReadPnnL - Status value: %d", aStatus);
       
  3063 OstTrace1( TRACE_NORMAL, DUP1_CMMNETOPERATORNAMEHANDLER_UICCOPERATORREQREADPNN, "CMmNetOperatorNameHandler::UiccOperatorReqReadPnn;aStatus=%d", aStatus );
       
  3064 
       
  3065     // Is there PNN record available. Value initialize to EFalse.
       
  3066     TBool pnnRecordAvailable( EFalse );
       
  3067 
       
  3068     // Get length of the record.
       
  3069     TInt dataLength( aFileData.Length() );
       
  3070 
       
  3071     // See structure of EF 6FC5 from 3GPP TS 31.102 V8.3.0 Chapter 4.2.58.
       
  3072     if ( UICC_STATUS_OK == aStatus && dataLength > 2 && aFileData[0] == 0x43 )
       
  3073         {
       
  3074         // Reset EONS names.
       
  3075         iEonsName.iLongName.Zero();
       
  3076         iEonsName.iShortName.Zero();
       
  3077 
       
  3078         // Temporary buffer for full EONS name. Full name is mandatory.
       
  3079         TBuf<KMaxLengthOfOperatorName> longEonsName;
       
  3080         // Get the length of full EONS name
       
  3081         TUint8 lengthOfFullName( aFileData[1] );
       
  3082         // Get full EONS name from the record. Name string starts from index 2
       
  3083         TPtrC8 eonsFullNameData( aFileData.Mid( 2, lengthOfFullName ) );
       
  3084         // Convert EONS data field to EONS operator name.
       
  3085         ConvertOperatorName(
       
  3086             ENetEonsName,
       
  3087             iEonsName.iMCC,
       
  3088             eonsFullNameData,
       
  3089             longEonsName );
       
  3090         // Store EONS long name.
       
  3091         iEonsName.iLongName.Copy( longEonsName.Left(
       
  3092             iEonsName.iLongName.MaxLength() ) );
       
  3093         // Check if long name was read succesfully.
       
  3094         if ( 0 < iEonsName.iLongName.Length() )
       
  3095             {
       
  3096             // PNN record read successfully.
       
  3097             pnnRecordAvailable = ETrue;
       
  3098             }
       
  3099 
       
  3100         // Short name is optional. If it exists file data length is more
       
  3101         // than full name bytes
       
  3102         TUint8 fullNameBytes( lengthOfFullName + 2 );
       
  3103         if ( dataLength > fullNameBytes && aFileData[fullNameBytes] == 0x45 )
       
  3104             {
       
  3105             // Temporary buffer for short EONS name.
       
  3106             TBuf<KMaxLengthOfOperatorName> shortEonsName;
       
  3107             // Get length of short EONS name.
       
  3108             TUint8 lengthOfShortName( aFileData[fullNameBytes + 1] );
       
  3109             // Get EONS short name string from the record.
       
  3110             TPtrC8 eonsShortNameData(
       
  3111                 aFileData.Mid( fullNameBytes + 2, lengthOfShortName ) );
       
  3112             // Convert EONS data field to EONS operator name.
       
  3113             ConvertOperatorName(
       
  3114                 ENetEonsName,
       
  3115                 iEonsName.iMCC,
       
  3116                 eonsShortNameData,
       
  3117                 shortEonsName );
       
  3118             // Store EONS Short name.
       
  3119             iEonsName.iShortName.Copy( shortEonsName.Left(
       
  3120                 iEonsName.iShortName.MaxLength() ) );
       
  3121             }
       
  3122 
       
  3123 TFLOGSTRING2("TSY: CMmNetOperatorNameHandler::UiccOperatorRespReadPnnL - iEonsName.iMCC: %d", iEonsName.iMCC);
       
  3124 TFLOGSTRING2("TSY: CMmNetOperatorNameHandler::UiccOperatorRespReadPnnL - iEonsName.iMNC: %d", iEonsName.iMNC);
       
  3125 TFLOGSTRING2("TSY: CMmNetOperatorNameHandler::UiccOperatorRespReadPnnL - iEonsName.iLongName: %S", &iEonsName.iLongName);
       
  3126 TFLOGSTRING2("TSY: CMmNetOperatorNameHandler::UiccOperatorRespReadPnnL - iEonsName.iShortName: %S", &iEonsName.iShortName);
       
  3127 TFLOGSTRING2("TSY: CMmNetOperatorNameHandler::UiccOperatorRespReadPnnL - iEonsName.iPNNIdentifier: %d", iEonsName.iPNNIdentifier);
       
  3128 OstTrace1( TRACE_NORMAL, CMMNETOPERATORNAMEHANDLER_UICCOPERATORRESPREADPNNL, "CMmNetOperatorNameHandler::UiccOperatorRespReadPnnL;iEonsName.iMCC=%u", iEonsName.iMCC );
       
  3129 OstTrace1( TRACE_NORMAL, DUP1_CMMNETOPERATORNAMEHANDLER_UICCOPERATORRESPREADPNNL, "CMmNetOperatorNameHandler::UiccOperatorRespReadPnnL;iEonsName.iMNC=%u", iEonsName.iMNC );
       
  3130 OstTraceExt1( TRACE_NORMAL, DUP2_CMMNETOPERATORNAMEHANDLER_UICCOPERATORRESPREADPNNL, "CMmNetOperatorNameHandler::UiccOperatorRespReadPnnL;iEonsName.iLongName=%S", iEonsName.iLongName );
       
  3131 OstTraceExt1( TRACE_NORMAL, DUP3_CMMNETOPERATORNAMEHANDLER_UICCOPERATORRESPREADPNNL, "CMmNetOperatorNameHandler::UiccOperatorRespReadPnnL;iEonsName.iShortName=%S", iEonsName.iShortName );
       
  3132 OstTraceExt1( TRACE_NORMAL, DUP4_CMMNETOPERATORNAMEHANDLER_UICCOPERATORRESPREADPNNL, "CMmNetOperatorNameHandler::UiccOperatorRespReadPnnL;iEonsName.iPNNIdentifier=%hhu", iEonsName.iPNNIdentifier );
       
  3133         }
       
  3134     else
       
  3135         {
       
  3136 TFLOGSTRING("TSY: CMmNetOperatorNameHandler::UiccOperatorRespReadPnnL - Error occured, data not available");
       
  3137 OstTrace0( TRACE_NORMAL, DUP5_CMMNETOPERATORNAMEHANDLER_UICCOPERATORRESPREADPNNL, "CMmNetOperatorNameHandler::UiccOperatorRespReadPnnL- Error occured, data not available" );
       
  3138 
       
  3139         // Data not available. Cause may be that file does not exist
       
  3140         // on (U)SIM card, or requested record does not exist in file.
       
  3141         // Reset EONS names.
       
  3142         iEonsName.iLongName.Zero();
       
  3143         iEonsName.iShortName.Zero();
       
  3144         }
       
  3145 
       
  3146     // This completes NetModemRegStatusInd method IPC
       
  3147     // EMobilePhoneNotifyCurrentNetworkChange value with EONS name.
       
  3148     if ( iFromGetOperatorName )
       
  3149         {
       
  3150 TFLOGSTRING("TSY: CMmNetOperatorNameHandler::UiccOperatorRespReadPnnL, continue to complete NotifyCurrentNetworkChange");
       
  3151 OstTrace0( TRACE_NORMAL, DUP6_CMMNETOPERATORNAMEHANDLER_UICCOPERATORRESPREADPNNL, "CMmNetOperatorNameHandler::UiccOperatorRespReadPnnLcontinue to complete NotifyCurrentNetworkChange" );
       
  3152 
       
  3153         // Set flag back to EFalse.
       
  3154         iFromGetOperatorName = EFalse;
       
  3155 
       
  3156         // If the EONS long or/and short names doesn't exist
       
  3157         // then NITZ long or/and short names will be added if
       
  3158         // NITZ data match current network.
       
  3159         // Otherwise long and short names will be left empty as
       
  3160         // there are no names for them. Only hard coded name
       
  3161         // will be sent (iDisplayTag).
       
  3162 
       
  3163         // Is PNN record available.
       
  3164         if ( pnnRecordAvailable )
       
  3165             {
       
  3166 TFLOGSTRING("TSY: CMmNetOperatorNameHandler::UiccOperatorRespReadPnnL - EONS name available");
       
  3167 OstTrace0( TRACE_NORMAL, DUP7_CMMNETOPERATORNAMEHANDLER_UICCOPERATORRESPREADPNNL, "CMmNetOperatorNameHandler::UiccOperatorRespReadPnnL- EONS name available" );
       
  3168             // EONS names found.
       
  3169             CopyEonsName( iNetworkData );
       
  3170             }
       
  3171         else
       
  3172             {
       
  3173 TFLOGSTRING("TSY: CMmNetOperatorNameHandler::UiccOperatorRespReadPnnL - EONS name not available, NITZ name will checked");
       
  3174 OstTrace0( TRACE_NORMAL, DUP8_CMMNETOPERATORNAMEHANDLER_UICCOPERATORRESPREADPNNL, "CMmNetOperatorNameHandler::UiccOperatorRespReadPnnL- EONS name not available, NITZ name will checked" );
       
  3175 
       
  3176             // Need to check NITZ name as EONS name not available.
       
  3177 
       
  3178             // Initialize.
       
  3179             TUint tempMCC( 0 ); // Country Code.
       
  3180             TUint tempMNC( 0 ); // Network Code.
       
  3181             // Convert descriptor contained number to integer.
       
  3182             CMmStaticUtility::GetIntFromDescriptor(
       
  3183                 tempMCC,
       
  3184                 iNetworkData.iCountryCode );
       
  3185             CMmStaticUtility::GetIntFromDescriptor(
       
  3186                 tempMNC,
       
  3187                 iNetworkData.iNetworkId );
       
  3188 
       
  3189             // Check if NITZ long/short name exist and will match for
       
  3190             // current Country and Network codes.
       
  3191             NitzNameChecker( tempMCC, tempMNC, iNetworkData );
       
  3192             }
       
  3193 
       
  3194 TFLOGSTRING("TSY: CMmNetOperatorNameHandler::UiccOperatorRespReadPnnL - Completing");
       
  3195 TFLOGSTRING2("TSY: CMmNetOperatorNameHandler::UiccOperatorRespReadPnnL, Operator display tag: %S", &iNetworkData.iDisplayTag);
       
  3196 TFLOGSTRING2("TSY: CMmNetOperatorNameHandler::UiccOperatorRespReadPnnL, Operator long name: %S", &iNetworkData.iLongName);
       
  3197 TFLOGSTRING2("TSY: CMmNetOperatorNameHandler::UiccOperatorRespReadPnnL, Operator short name: %S", &iNetworkData.iShortName);
       
  3198 TFLOGSTRING2("TSY: CMmNetOperatorNameHandler::UiccOperatorRespReadPnnL, RMmCustomAPI::TOperatorNameInfo, Name: %S", &iOperNameInfo.iName);
       
  3199 TFLOGSTRING2("TSY: CMmNetOperatorNameHandler::UiccOperatorRespReadPnnL, RMmCustomAPI::TOperatorNameInfo, Type: %d", iOperNameInfo.iType);
       
  3200 OstTrace0( TRACE_NORMAL, DUP9_CMMNETOPERATORNAMEHANDLER_UICCOPERATORRESPREADPNNL, "CMmNetOperatorNameHandler::UiccOperatorRespReadPnnL - Completing" );
       
  3201 OstTraceExt1( TRACE_NORMAL, DUP10_CMMNETOPERATORNAMEHANDLER_UICCOPERATORRESPREADPNNL, "CMmNetOperatorNameHandler::UiccOperatorRespReadPnnL;iNetworkData.iDisplayTag=%S", iNetworkData.iDisplayTag );
       
  3202 OstTraceExt1( TRACE_NORMAL, DUP11_CMMNETOPERATORNAMEHANDLER_UICCOPERATORRESPREADPNNL, "CMmNetOperatorNameHandler::UiccOperatorRespReadPnnL;iNetworkData.iLongName=%S", iNetworkData.iLongName );
       
  3203 OstTraceExt1( TRACE_NORMAL, DUP12_CMMNETOPERATORNAMEHANDLER_UICCOPERATORRESPREADPNNL, "CMmNetOperatorNameHandler::UiccOperatorRespReadPnnL;iNetworkData.iShortName=%S", iNetworkData.iShortName );
       
  3204 OstTraceExt1( TRACE_NORMAL, DUP13_CMMNETOPERATORNAMEHANDLER_UICCOPERATORRESPREADPNNL, "CMmNetOperatorNameHandler::UiccOperatorRespReadPnnL;iOperNameInfo.iName=%S", iOperNameInfo.iName );
       
  3205 OstTrace1( TRACE_NORMAL, DUP14_CMMNETOPERATORNAMEHANDLER_UICCOPERATORRESPREADPNNL, "CMmNetOperatorNameHandler::UiccOperatorRespReadPnnL;iOperNameInfo.iType=%d", iOperNameInfo.iType );
       
  3206 
       
  3207         // Complete ECustomGetOperatorNameIPC.
       
  3208         // Packed parameter: a RMmCustomAPI::TOperatorNameInfo.
       
  3209         CMmDataPackage dataPackage;
       
  3210         dataPackage.PackData( &iOperNameInfo );
       
  3211 
       
  3212         iNetMessHandler->GetMessageRouter()->Complete(
       
  3213             ECustomGetOperatorNameIPC,
       
  3214             &dataPackage,
       
  3215             KErrNone );
       
  3216 
       
  3217         // Complete EMobilePhoneNotifyCurrentNetworkChange with
       
  3218         // operator names.
       
  3219         iNetMessHandler->CompleteMobilePhoneNotifyCurrentNetworkChange(
       
  3220             iLocationAreaData,
       
  3221             iNetworkData );
       
  3222 
       
  3223         // Reset operator name info data as these are completed.
       
  3224         iOperNameInfo.iType = RMmCustomAPI::EOperatorNameFlexiblePlmn;
       
  3225         iOperNameInfo.iName.Zero();
       
  3226         }
       
  3227 
       
  3228     // Add EONS names to correct index and then continue
       
  3229     // handling of manual network search list.
       
  3230     if ( iFromGetManualSearchOperatorName )
       
  3231         {
       
  3232 TFLOGSTRING2("TSY: CMmNetOperatorNameHandler::UiccOperatorRespReadPnnL, continue handling Manual Network search - Index value: %d", iManualSearchIndexValue);
       
  3233 OstTraceExt1( TRACE_NORMAL, DUP15_CMMNETOPERATORNAMEHANDLER_UICCOPERATORRESPREADPNNL, "CMmNetOperatorNameHandler::UiccOperatorRespReadPnnL;iManualSearchIndexValue=%hhu", iManualSearchIndexValue );
       
  3234 TFLOGSTRING2("TSY: CMmNetOperatorNameHandler::UiccOperatorRespReadPnnL - Operator display tag: %S", &iNetworkData.iDisplayTag);
       
  3235 OstTraceExt1( TRACE_NORMAL, DUP16_CMMNETOPERATORNAMEHANDLER_UICCOPERATORRESPREADPNNL, "CMmNetOperatorNameHandler::UiccOperatorRespReadPnnL - Operator display tag;iNetworkData.iDisplayTag=%S", iNetworkData.iDisplayTag );
       
  3236 
       
  3237         // Set flag back to EFalse.
       
  3238         iFromGetManualSearchOperatorName = EFalse;
       
  3239 
       
  3240         // Is PNN record available.
       
  3241         if ( pnnRecordAvailable )
       
  3242             {
       
  3243 TFLOGSTRING("TSY: CMmNetOperatorNameHandler::UiccOperatorRespReadPnnL - Manual search - EONS name available");
       
  3244 OstTrace0( TRACE_NORMAL, DUP17_CMMNETOPERATORNAMEHANDLER_UICCOPERATORRESPREADPNNL, "CMmNetOperatorNameHandler::UiccOperatorRespReadPnnL- Manual search - EONS name available" );
       
  3245 
       
  3246             // Check is EONS Long name exist.
       
  3247             // If no Long EONS name there is no short EONS name either.
       
  3248             if ( 0 < iEonsName.iLongName.Length() )
       
  3249                 {
       
  3250                 // Copy EONS Long name to correct index.
       
  3251                 iManualSearchNetworkList[iManualSearchIndexValue].iLongName.Copy(
       
  3252                     iEonsName.iLongName );
       
  3253 TFLOGSTRING2("TSY: CMmNetOperatorNameHandler::UiccOperatorRespReadPnnL - Operator long name: %S", &iEonsName.iLongName);
       
  3254 OstTraceExt1( TRACE_NORMAL, DUP18_CMMNETOPERATORNAMEHANDLER_UICCOPERATORRESPREADPNNL, "CMmNetOperatorNameHandler::UiccOperatorRespReadPnnL- Operator long name;iEonsName.iLongName=%S", iEonsName.iLongName );
       
  3255 
       
  3256 
       
  3257                 // Check is EONS Short name exist.
       
  3258                 if ( 0 < iEonsName.iShortName.Length() )
       
  3259                     {
       
  3260                     // Copy EONS Short name to correct index.
       
  3261                     iManualSearchNetworkList[iManualSearchIndexValue].iShortName.Copy(
       
  3262                         iEonsName.iShortName );
       
  3263 TFLOGSTRING2("TSY: CMmNetOperatorNameHandler::UiccOperatorRespReadPnnL - Operator short name: %S", &iEonsName.iShortName);
       
  3264 OstTraceExt1( TRACE_NORMAL, DUP19_CMMNETOPERATORNAMEHANDLER_UICCOPERATORRESPREADPNNL, "CMmNetOperatorNameHandler::UiccOperatorRespReadPnnL;iEonsName.iShortName=%S", iEonsName.iShortName );
       
  3265                     }
       
  3266                 }
       
  3267             }
       
  3268         else
       
  3269             {
       
  3270 TFLOGSTRING("TSY: CMmNetOperatorNameHandler::UiccOperatorRespReadPnnL - Manual search, No EONS name available, DisplayTag name added to Long and Short names");
       
  3271 OstTrace0( TRACE_NORMAL, DUP20_CMMNETOPERATORNAMEHANDLER_UICCOPERATORRESPREADPNNL, "CMmNetOperatorNameHandler::UiccOperatorRespReadPnnL- Manual search, No EONS name available, DisplayTag name added to Long and Short names" );
       
  3272 
       
  3273             // If no EONS name, copy DisplayTag to long and short name
       
  3274             // buffers.
       
  3275             iNetworkData.iLongName.Copy(
       
  3276                 iNetworkData.iDisplayTag.Left(
       
  3277                 iNetworkData.iLongName.MaxLength() ) );
       
  3278             iNetworkData.iShortName.Copy(
       
  3279                 iNetworkData.iDisplayTag.Left(
       
  3280                 iNetworkData.iShortName.MaxLength() ) );
       
  3281 
       
  3282             iManualSearchNetworkList[iManualSearchIndexValue].iLongName.Copy(
       
  3283                 iNetworkData.iLongName );
       
  3284             iManualSearchNetworkList[iManualSearchIndexValue].iShortName.Copy(
       
  3285                 iNetworkData.iShortName );
       
  3286 
       
  3287 TFLOGSTRING2("TSY: CMmNetOperatorNameHandler::UiccOperatorRespReadPnnL - Operator long name: %S", &iNetworkData.iLongName);
       
  3288 TFLOGSTRING2("TSY: CMmNetOperatorNameHandler::UiccOperatorRespReadPnnL - Operator short name: %S", &iNetworkData.iShortName);
       
  3289 OstTraceExt1( TRACE_NORMAL, DUP21_CMMNETOPERATORNAMEHANDLER_UICCOPERATORRESPREADPNNL, "CMmNetOperatorNameHandler::UiccOperatorRespReadPnnL;iNetworkData.iLongName=%S", iNetworkData.iLongName );
       
  3290 OstTraceExt1( TRACE_NORMAL, DUP22_CMMNETOPERATORNAMEHANDLER_UICCOPERATORRESPREADPNNL, "CMmNetOperatorNameHandler::UiccOperatorRespReadPnnL;iNetworkData.iLongName=%S", iNetworkData.iLongName );
       
  3291             }
       
  3292 
       
  3293         // Update index value.
       
  3294         iManualSearchIndexValue++;
       
  3295 
       
  3296         // Continue handling of Manual network search list.
       
  3297         GetManualSearchOperatorNameL();
       
  3298         }
       
  3299 
       
  3300     // Complete refresh.
       
  3301     // Refresh status is checked in complete.
       
  3302     iNetMessHandler->
       
  3303         GetMessageRouter()->
       
  3304         GetPhoneMessHandler()->
       
  3305         PnnRecordCachingCompleted( aStatus );
       
  3306     }
       
  3307 
       
  3308 
  2579 // ========================== OTHER EXPORTED FUNCTIONS =========================
  3309 // ========================== OTHER EXPORTED FUNCTIONS =========================
  2580     //None
  3310     //None
  2581 
  3311 
  2582 //  End of File
  3312 //  End of File