networkhandling/networkhandlingengine/NetworkHandlingSrc/CNWMessageHandler.cpp
changeset 15 d7fc66ccd6fb
parent 0 ff3b6d0fd310
child 27 7eb70891911c
equal deleted inserted replaced
13:e32024264ebb 15:d7fc66ccd6fb
     1 /*
     1 /*
     2 * Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). 
     2 * Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies). 
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    16 */
    16 */
    17 
    17 
    18 
    18 
    19 
    19 
    20 // INCLUDE FILES
    20 // INCLUDE FILES
       
    21 #include    <featmgr.h>
    21 #include    "NWHandlingEngine.h"
    22 #include    "NWHandlingEngine.h"
    22 #include    "CNWMessageHandler.h"
    23 #include    "CNWMessageHandler.h"
    23 #include    "CNWNetworkCurrentNetworkMonitor.h"
    24 #include    "CNWNetworkCurrentNetworkMonitor.h"
    24 #include    "CNWNetworkRegistrationStatusMonitor.h"
    25 #include    "CNWNetworkRegistrationStatusMonitor.h"
    25 #include    "CNWProgrammableOperatorNameCommand.h"
    26 #include    "CNWProgrammableOperatorNameCommand.h"
    29 #include    "CNWSubscriberIdCommand.h"
    30 #include    "CNWSubscriberIdCommand.h"
    30 #include    "NWLogger.h"
    31 #include    "NWLogger.h"
    31 #ifdef RD_PHONE_NG
    32 #ifdef RD_PHONE_NG
    32 #include    "cnwnetworkselectionsettingmonitor.h"
    33 #include    "cnwnetworkselectionsettingmonitor.h"
    33 #endif // RD_PHONE_NG
    34 #endif // RD_PHONE_NG
       
    35 #include    "CNWDynamicCapsMonitor.h"
    34 // CONSTANTS
    36 // CONSTANTS
    35 const TInt KNWNetworkMonitorCurrent = 0;
    37 const TInt KNWNetworkMonitorCurrent = 0;
    36 const TInt KNWNetworkMonitorMode = 1;
    38 const TInt KNWNetworkMonitorMode = 1;
    37 const TInt KNWNetworkMonitorRegistration = 2;
    39 const TInt KNWNetworkMonitorRegistration = 2;
    38 #ifdef RD_PHONE_NG
    40 #ifdef RD_PHONE_NG
    39 const TInt KNWNetworkMonitorSettingSelection = 3;
    41 const TInt KNWNetworkMonitorSettingSelection = 3;
       
    42 const TInt KNWNetworkMonitorDynamicCaps = 4;
       
    43 #else // RD_PHONE_NG
       
    44 const TInt KNWNetworkMonitorDynamicCaps = 3;
    40 #endif // RD_PHONE_NG
    45 #endif // RD_PHONE_NG
    41 
       
    42 
    46 
    43 // ============================ MEMBER FUNCTIONS ==============================
    47 // ============================ MEMBER FUNCTIONS ==============================
    44 
    48 
    45 // ----------------------------------------------------------------------------
    49 // ----------------------------------------------------------------------------
    46 // CNWMessageHandler::CNWMessageHandler
    50 // CNWMessageHandler::CNWMessageHandler
   205         new ( ELeave ) CNWServiceProviderNameCommand( 
   209         new ( ELeave ) CNWServiceProviderNameCommand( 
   206                 *this, iPhone, iNetworkInfo );
   210                 *this, iPhone, iNetworkInfo );
   207 
   211 
   208     // Start initialising network handling module.
   212     // Start initialising network handling module.
   209     iMonitorContainer[ KNWNetworkMonitorRegistration ]->Initialise();
   213     iMonitorContainer[ KNWNetworkMonitorRegistration ]->Initialise();
       
   214 
       
   215     // Create CNWDynamicCapsMonitor object and insert it to monitor container.
       
   216     // Will be used to hide alpha tag when CS registration is unsuccessful
       
   217     FeatureManager::InitializeLibL();
       
   218     TInt err( KErrNone );
       
   219     if( FeatureManager::FeatureSupported( 
       
   220             KFeatureIdFfDisplayNetworkNameAfterCsRegistration ))
       
   221         {
       
   222         TRAP(err, 
       
   223             CNWDynamicCapsMonitor* tempDynamicCapsMonitor =
       
   224                 CNWDynamicCapsMonitor::NewL( *this, iPhone, iNetworkInfo, 
       
   225                                              iCustomAPI );
       
   226             CleanupStack::PushL( tempDynamicCapsMonitor );
       
   227 
       
   228             User::LeaveIfError( iMonitorContainer.Insert( 
       
   229                                         tempDynamicCapsMonitor,
       
   230                                         KNWNetworkMonitorDynamicCaps ) );
       
   231             CleanupStack::Pop( tempDynamicCapsMonitor ); );
       
   232         if( err == KErrNone )
       
   233             {
       
   234             iMonitorContainer
       
   235                 [ KNWNetworkMonitorDynamicCaps ]->Initialise();
       
   236             }
       
   237         }
       
   238     FeatureManager::UnInitializeLib();
       
   239     User::LeaveIfError(err);
   210     
   240     
   211     NWLOGSTRING( KNWOBJECT,
   241     NWLOGSTRING( KNWOBJECT,
   212         "NW: CNWMessageHandler::BaseConstructL() End" );
   242         "NW: CNWMessageHandler::BaseConstructL() End" );
   213     }
   243     }
   214 
   244 
   397             return _L("ENWMessageProgrammableOperatorInfoUpdating"); 
   427             return _L("ENWMessageProgrammableOperatorInfoUpdating"); 
   398         case MNWMessageObserver::ENWMessageNetworkProviderNameUpdating:
   428         case MNWMessageObserver::ENWMessageNetworkProviderNameUpdating:
   399             return _L("ENWMessageNetworkProviderNameUpdating"); 
   429             return _L("ENWMessageNetworkProviderNameUpdating"); 
   400         case MNWMessageObserver::ENWMessageServiceProviderNameUpdating:
   430         case MNWMessageObserver::ENWMessageServiceProviderNameUpdating:
   401             return _L("ENWMessageServiceProviderNameUpdating"); 
   431             return _L("ENWMessageServiceProviderNameUpdating"); 
       
   432         case MNWMessageObserver::ENWMessageDynamicCapsChange:
       
   433             {
       
   434             return _L("ENWMessageDynamicCapsChange");
       
   435             break;
       
   436             }
   402         default:
   437         default:
   403             NWLOGSTRING2( KNWINT, 
   438             NWLOGSTRING2( KNWINT, 
   404                 "NW: CNWMessageHandler::GetNameByMessage, unknown message = %d",
   439                 "NW: CNWMessageHandler::GetNameByMessage, unknown message = %d",
   405                  static_cast<TInt>( aMessage ) );
   440                  static_cast<TInt>( aMessage ) );
   406             return _L("Unknown message");
   441             return _L("Unknown message");