telephonyserverplugins/common_tsy/phonetsy/src/cmmphonefactorytsy.cpp
changeset 42 3adadc800673
parent 20 244d7c5f118e
child 49 f50f4094acd7
equal deleted inserted replaced
31:8ab6687fb94c 42:3adadc800673
     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".
    13 // Description:
    13 // Description:
    14 // INCLUDE FILES
    14 // INCLUDE FILES
    15 //
    15 //
    16 
    16 
    17 
    17 
       
    18 
       
    19 
       
    20 #include "OstTraceDefinitions.h"
       
    21 #ifdef OST_TRACE_COMPILER_IN_USE
       
    22 #include "cmmphonefactorytsyTraces.h"
       
    23 #endif
    18 
    24 
    19 #include <featmgr/featurecontrol.h>
    25 #include <featmgr/featurecontrol.h>
    20 #include <featureuids.h>
    26 #include <featureuids.h>
    21 
    27 
    22 #include "cmmphonefactorytsy.h"
    28 #include "cmmphonefactorytsy.h"
    73 // (other items were commented in a header).
    79 // (other items were commented in a header).
    74 // ---------------------------------------------------------------------------
    80 // ---------------------------------------------------------------------------
    75 //
    81 //
    76 CPhoneBase* CMmPhoneFactoryTsy::NewPhoneL( const TDesC& aName )
    82 CPhoneBase* CMmPhoneFactoryTsy::NewPhoneL( const TDesC& aName )
    77     {
    83     {
    78 TFLOGSTRING("TSY: CMmPhoneFactoryTsy::NewL - NEW LOG");
    84 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONEFACTORYTSY_NEWPHONEL_1, "TSY: CMmPhoneFactoryTsy::NewL - NEW LOG");
    79 
    85 
    80     iPhoneTsy = NULL;
    86     iPhoneTsy = NULL;
    81 
    87 
    82     // In case of debug build, print flag info.
    88     // In case of debug build, print flag info.
    83 #ifdef TF_LOGGING_ENABLED
    89 #ifdef TF_LOGGING_ENABLED
    84     
    90     
    85 	RFeatureControl featureControl;
    91 	RFeatureControl featureControl;
    86 	TInt err = featureControl.Open();
    92 	TInt err = featureControl.Open();
    87 	if (err != KErrNone)
    93 	if (err != KErrNone)
    88 		{
    94 		{
    89 TFLOGSTRING("CMmPhoneFactoryTsy::NewPhoneL - failed to connect to FeatMgr");
    95 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONEFACTORYTSY_NEWPHONEL_2, "CMmPhoneFactoryTsy::NewPhoneL - failed to connect to FeatMgr");
    90 		}
    96 		}
    91 	else if (featureControl.FeatureSupported(NFeature::KCsVideoTelephony) == KFeatureSupported) 
    97 	else if (featureControl.FeatureSupported(NFeature::KCsVideoTelephony) == KFeatureSupported) 
    92         {
    98         {
    93 TFLOGSTRING("TSY: __CS_VIDEO_TELEPHONY -flag is on");
    99 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONEFACTORYTSY_NEWPHONEL_3, "TSY: __CS_VIDEO_TELEPHONY -flag is on");
    94         }
   100         }
    95 	else if (featureControl.FeatureSupported(NFeature::KEmergencyCallsEnabledInOfflineMode) == KFeatureSupported)
   101 	else if (featureControl.FeatureSupported(NFeature::KEmergencyCallsEnabledInOfflineMode) == KFeatureSupported)
    96         {
   102         {
    97 TFLOGSTRING("TSY: __COMMON_TSY__EMERGENCY_CALLS_ENABLED_IN_OFFLINE_MODE -flag is on");
   103 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONEFACTORYTSY_NEWPHONEL_4, "TSY: __COMMON_TSY__EMERGENCY_CALLS_ENABLED_IN_OFFLINE_MODE -flag is on");
    98         }
   104         }
    99 
   105 
   100 	featureControl.Close();
   106 	featureControl.Close();
   101 #endif
   107 #endif
   102 	
   108 	
   110         if ( messageManager )
   116         if ( messageManager )
   111             {
   117             {
   112 	        CleanupStack::PushL( messageManager );
   118 	        CleanupStack::PushL( messageManager );
   113         
   119         
   114             // LTSY Plug-in API successfully created
   120             // LTSY Plug-in API successfully created
   115 TFLOGSTRING("TSY: CMmPhoneFactoryTsy::NewL - Starting to open LicenceeTSY");
   121 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONEFACTORYTSY_NEWPHONEL_5, "TSY: CMmPhoneFactoryTsy::NewL - Starting to open LicenceeTSY");
   116             
   122             
   117             // get TSY message manager callback object
   123             // get TSY message manager callback object
   118             MmMessageManagerCallback* callBack = 
   124             MmMessageManagerCallback* callBack = 
   119                 messageManager->GetMessageManagerCallback();
   125                 messageManager->GetMessageManagerCallback();
   120             
   126             
   135                         
   141                         
   136                 iMessageRouter = ptr_v1->GetMessageRouter( *callBack );
   142                 iMessageRouter = ptr_v1->GetMessageRouter( *callBack );
   137 		        User::LeaveIfNull( iMessageRouter );
   143 		        User::LeaveIfNull( iMessageRouter );
   138         
   144         
   139 		        // Licencee Tsy successfully created
   145 		        // Licencee Tsy successfully created
   140 TFLOGSTRING("TSY: CMmPhoneFactoryTsy::NewL -  LicenceeTSY successfully opened");
   146 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONEFACTORYTSY_NEWPHONEL_6, "TSY: CMmPhoneFactoryTsy::NewL -  LicenceeTSY successfully opened");
   141 
   147 
   142 	            // set the pointer to the message router object
   148 	            // set the pointer to the message router object
   143 	            messageManager->SetMessageRouter( iMessageRouter );
   149 	            messageManager->SetMessageRouter( iMessageRouter );
   144 
   150 
   145 	            // Ownership of messageManager passed to iPhoneTsy.
   151 	            // Ownership of messageManager passed to iPhoneTsy.
   146                 CleanupStack::Pop( messageManager );
   152                 CleanupStack::Pop( messageManager );
   147 	            // Create Phone Tsy (which creates the whole Common TSY)
   153 	            // Create Phone Tsy (which creates the whole Common TSY)
   148 TFLOGSTRING("TSY: CMmPhoneFactoryTsy::NewL - Starting to open CommonTSY");
   154 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONEFACTORYTSY_NEWPHONEL_7, "TSY: CMmPhoneFactoryTsy::NewL - Starting to open CommonTSY");
   149 	            iPhoneTsy = CMmPhoneTsy::NewL( 
   155 	            iPhoneTsy = CMmPhoneTsy::NewL( 
   150 	                messageManager, this, iLtsyFactory );
   156 	                messageManager, this, iLtsyFactory );
   151 
   157 
   152 	            if ( iPhoneTsy )
   158 	            if ( iPhoneTsy )
   153 	                {
   159 	                {
   154 TFLOGSTRING("TSY: CMmPhoneFactoryTsy::NewL - CommonTSY successfully opened");
   160 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONEFACTORYTSY_NEWPHONEL_8, "TSY: CMmPhoneFactoryTsy::NewL - CommonTSY successfully opened");
   155 	                messageManager->SetPhoneTsy( iPhoneTsy );
   161 	                messageManager->SetPhoneTsy( iPhoneTsy );
   156 	                }
   162 	                }
   157                 }
   163                 }
   158             else
   164             else
   159             	{
   165             	{
   285     {
   291     {
   286     CTsySatMessagingBase* satMessaging = NULL;
   292     CTsySatMessagingBase* satMessaging = NULL;
   287     
   293     
   288     if ( KErrNone == aName.CompareF( KSatToolkit ) )
   294     if ( KErrNone == aName.CompareF( KSatToolkit ) )
   289         {
   295         {
   290 TFLOGSTRING("TSY: CMmPhoneFactoryTsy::NewSimAtk - Starting to open SimAtkTSY");
   296 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONEFACTORYTSY_NEWSIMATK_1, "TSY: CMmPhoneFactoryTsy::NewSimAtk - Starting to open SimAtkTSY");
   291 
   297 
   292         if( iLtsyFactory )
   298         if( iLtsyFactory )
   293             {
   299             {
   294             // Get SIM ATK TSY messaging service from LicenseeTsy
   300             // Get SIM ATK TSY messaging service from LicenseeTsy
   295             MLtsyFactoryV1* ptr_v1 = 
   301             MLtsyFactoryV1* ptr_v1 = 
   327 // Returns: CPhoneFactoryBase*: Pointer to CMmPhoneFactoryTsy class
   333 // Returns: CPhoneFactoryBase*: Pointer to CMmPhoneFactoryTsy class
   328 // ---------------------------------------------------------------------------
   334 // ---------------------------------------------------------------------------
   329 //
   335 //
   330 EXPORT_C CPhoneFactoryBase* LibEntry()
   336 EXPORT_C CPhoneFactoryBase* LibEntry()
   331     {
   337     {
   332 TFLOGSTRING("TSY: CPhoneFactoryBase::LibEntry()...");
   338 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, LIBENTRY_1, "TSY: CPhoneFactoryBase::LibEntry()...");
   333     // return NULL if instantiation fails
   339     // return NULL if instantiation fails
   334     CMmPhoneFactoryTsy* factory(NULL);
   340     CMmPhoneFactoryTsy* factory(NULL);
   335     TRAP_IGNORE(factory = CMmPhoneFactoryTsy::NewL()); 
   341     TRAP_IGNORE(factory = CMmPhoneFactoryTsy::NewL()); 
   336     return factory; 
   342     return factory; 
   337     }
   343     }
   361 		{
   367 		{
   362 		dllname.Set(KLicenseeTsyDllName);
   368 		dllname.Set(KLicenseeTsyDllName);
   363 		uid3_int = KLicenseeTsyUID3;
   369 		uid3_int = KLicenseeTsyUID3;
   364 		}
   370 		}
   365 	
   371 	
   366 	TFLOGSTRING3("TSY: CMmPhoneFactoryTsy::LoadLibraryL - Loading Dll=%S, UID3=0x%x", &dllname, uid3_int);
   372 	OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMPHONEFACTORYTSY_LOADLIBRARYL_1, "TSY: CMmPhoneFactoryTsy::LoadLibraryL - Loading Dll=%S, UID3=0x%8X", dllname, (TUint)uid3_int);
   367 	
   373 	
   368 	TUidType uid(KNullUid, KNullUid, TUid::Uid(uid3_int));
   374 	TUidType uid(KNullUid, KNullUid, TUid::Uid(uid3_int));
   369 	
   375 	
   370 	User::LeaveIfError(iLoadedLib.Load(dllname));
   376 	User::LeaveIfError(iLoadedLib.Load(dllname));
   371 	
   377