telephonyserverplugins/common_tsy/commontsy/src/mmpacket/cmmmbmscontexttsy.cpp
branchRCL_3
changeset 20 07a122eea281
parent 19 630d2f34d719
equal deleted inserted replaced
19:630d2f34d719 20:07a122eea281
     1 // Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2006-2009 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 "cmmmbmscontexttsyTraces.h"
       
    23 #endif
       
    24 
       
    25 #include "cmmmbmscontexttsy.h"
    19 #include "cmmmbmscontexttsy.h"
    26 #include "cmmmbmscontextlist.h"
    20 #include "cmmmbmscontextlist.h"
    27 #include "CMmPacketTsy.h"
    21 #include "CMmPacketTsy.h"
       
    22 #include <ctsy/tflogger.h>
    28 #include "mbmstypes.h"
    23 #include "mbmstypes.h"
    29 #include "MmTsy_timeoutdefs.h"
    24 #include "MmTsy_timeoutdefs.h"
    30 #include "MmTsy_numberOfSlots.h"
    25 #include "MmTsy_numberOfSlots.h"
    31 
    26 
    32 // ============================ MEMBER FUNCTIONS ===============================
    27 // ============================ MEMBER FUNCTIONS ===============================
    38 CMmMBMSContextTsy* CMmMBMSContextTsy::NewL(
    33 CMmMBMSContextTsy* CMmMBMSContextTsy::NewL(
    39         CMmPacketServiceTsy* aMmPacketService,                
    34         CMmPacketServiceTsy* aMmPacketService,                
    40         const TDes& aName,  
    35         const TDes& aName,  
    41         const TUint8 aProxyId  ) 
    36         const TUint8 aProxyId  ) 
    42     {
    37     {
    43 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMMBMSCONTEXTTSY_NEWL_1,  "TSY: CMmMBMSContextTsy::NewL" );
    38 TFLOGSTRING( "TSY: CMmMBMSContextTsy::NewL" );
    44 
    39 
    45     CMmMBMSContextTsy* packetContext = new ( ELeave ) CMmMBMSContextTsy();
    40     CMmMBMSContextTsy* packetContext = new ( ELeave ) CMmMBMSContextTsy();
    46     CleanupClosePushL( *packetContext );    
    41     CleanupClosePushL( *packetContext );    
    47     packetContext->ConstructL( aMmPacketService, aName, aProxyId );
    42     packetContext->ConstructL( aMmPacketService, aName, aProxyId );
    48     CleanupStack::Pop();
    43     CleanupStack::Pop();
    77     iContextStatus = RPacketContext::EStatusUnknown;  
    72     iContextStatus = RPacketContext::EStatusUnknown;  
    78     }
    73     }
    79     
    74     
    80 CMmMBMSContextTsy::~CMmMBMSContextTsy()
    75 CMmMBMSContextTsy::~CMmMBMSContextTsy()
    81     {
    76     {
    82 OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMMBMSCONTEXTTSY_DTOR_1,  "TSY: CMmMBMSContextTsy::~CMmMBMSContextTsy Context name: %S", iContextName );
    77 TFLOGSTRING2( "TSY: CMmMBMSContextTsy::~CMmMBMSContextTsy Context name: %S", &iContextName );
    83 	
    78 	
    84 	if( iMmPacketService )
    79 	if( iMmPacketService )
    85 		{			
    80 		{			
    86 		iMmPacketService->MBMSContextList()->RemoveObject( this );
    81 		iMmPacketService->MBMSContextList()->RemoveObject( this );
    87 
    82 
   118 TInt CMmMBMSContextTsy::ExtFunc( 
   113 TInt CMmMBMSContextTsy::ExtFunc( 
   119         TTsyReqHandle aTsyReqHandle, 
   114         TTsyReqHandle aTsyReqHandle, 
   120         TInt aIpc, 
   115         TInt aIpc, 
   121         const TDataPackage& aPackage )  
   116         const TDataPackage& aPackage )  
   122     {
   117     {
   123 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMMBMSCONTEXTTSY_EXTFUNC_1,  "TSY: CMmMBMSContextTsy::ExtFunc. IPC: %d Context name:%S", aIpc, iContextName );
   118 TFLOGSTRING3( "TSY: CMmMBMSContextTsy::ExtFunc. IPC: %d Context name:%S", aIpc, &iContextName );
   124 
   119 
   125     TInt ret( KErrNone );
   120     TInt ret( KErrNone );
   126     TInt trapError( KErrNone );
   121     TInt trapError( KErrNone );
   127 
   122 
   128     // Reset last tsy request type
   123     // Reset last tsy request type
   164 TInt CMmMBMSContextTsy::DoExtFuncL( 
   159 TInt CMmMBMSContextTsy::DoExtFuncL( 
   165         TTsyReqHandle aTsyReqHandle,      
   160         TTsyReqHandle aTsyReqHandle,      
   166         TInt aIpc,      
   161         TInt aIpc,      
   167         const TDataPackage& aPackage )   
   162         const TDataPackage& aPackage )   
   168     {
   163     {
   169 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMMBMSCONTEXTTSY_DOEXTFUNCL_1,  "TSY: CMmMBMSContextTsy::DoExtFuncL. IPC: %d Handle:%d",aIpc, aTsyReqHandle );
   164 TFLOGSTRING3( "TSY: CMmMBMSContextTsy::DoExtFuncL. IPC: %d Handle:%d",
       
   165                 aIpc, aTsyReqHandle );
   170 
   166 
   171     TInt ret( KErrNotSupported );
   167     TInt ret( KErrNotSupported );
   172 
   168 
   173     TAny* dataPtr = aPackage.Ptr1();
   169     TAny* dataPtr = aPackage.Ptr1();
   174     TAny* dataPtr2 = aPackage.Ptr2();
   170     TAny* dataPtr2 = aPackage.Ptr2();
   257 // ---------------------------------------------------------------------------
   253 // ---------------------------------------------------------------------------
   258 //
   254 //
   259 CTelObject::TReqMode CMmMBMSContextTsy::ReqModeL( 
   255 CTelObject::TReqMode CMmMBMSContextTsy::ReqModeL( 
   260         TInt aIpc ) 
   256         TInt aIpc ) 
   261     {
   257     {
   262 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMMBMSCONTEXTTSY_REQMODEL_1,  "TSY: CMmMBMSContextTsy::ReqModeL. IPC: %d", aIpc );
   258 TFLOGSTRING2( "TSY: CMmMBMSContextTsy::ReqModeL. IPC: %d", aIpc );
   263 
   259 
   264     CTelObject::TReqMode reqMode( 0 );
   260     CTelObject::TReqMode reqMode( 0 );
   265     TBool doLeave( EFalse );
   261     TBool doLeave( EFalse );
   266 
   262 
   267     switch ( aIpc )
   263     switch ( aIpc )
   369             // Unknown or invalid IPC
   365             // Unknown or invalid IPC
   370             User::Leave( KErrNotSupported );
   366             User::Leave( KErrNotSupported );
   371             break;
   367             break;
   372 
   368 
   373         }  
   369         }  
   374 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMMBMSCONTEXTTSY_NUMBEROFSLOTSL_1,  "TSY: CMmMBMSContextTsy::NumberOfSlotsL. IPC: %d Number of slots: %d", aIpc, numberOfSlots );
   370 TFLOGSTRING3( "TSY: CMmMBMSContextTsy::NumberOfSlotsL. IPC: %d Number of slots: %d", aIpc, numberOfSlots );
   375 
   371 
   376     return numberOfSlots;
   372     return numberOfSlots;
   377 
   373 
   378     }
   374     }
   379 
   375 
   391 //
   387 //
   392 TInt CMmMBMSContextTsy::CancelService(    
   388 TInt CMmMBMSContextTsy::CancelService(    
   393         TInt aIpc,                            
   389         TInt aIpc,                            
   394         TTsyReqHandle aTsyReqHandle )         
   390         TTsyReqHandle aTsyReqHandle )         
   395     {
   391     {
   396 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMMBMSCONTEXTTSY_CANCELSERVICE_1,  "TSY: CMmMBMSContextTsy::CancelService. IPC: %d Handle:%d", aIpc, aTsyReqHandle );
   392 TFLOGSTRING3( "TSY: CMmMBMSContextTsy::CancelService. IPC: %d Handle:%d", aIpc, aTsyReqHandle );
   397 
   393 
   398     TInt ret( KErrNone );
   394     TInt ret( KErrNone );
   399 	//TTsyReqHandle reqHandle( NULL );
   395 	//TTsyReqHandle reqHandle( NULL );
   400     // Reset last tsy request type
   396     // Reset last tsy request type
   401     iReqHandleType = EMultimodePacketMbmsReqHandleUnknown;
   397     iReqHandleType = EMultimodePacketMbmsReqHandleUnknown;
   464 // ---------------------------------------------------------------------------
   460 // ---------------------------------------------------------------------------
   465 //
   461 //
   466 TInt CMmMBMSContextTsy::RegisterNotification( 
   462 TInt CMmMBMSContextTsy::RegisterNotification( 
   467         TInt aIpc )              
   463         TInt aIpc )              
   468     {
   464     {
   469 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMMBMSCONTEXTTSY_REGISTERNOTIFICATION_1,  "TSY: CMmMBMSContextTsy::RegisterNotification. IPC: %d", aIpc );
   465 TFLOGSTRING2( "TSY: CMmMBMSContextTsy::RegisterNotification. IPC: %d", aIpc );
   470 
   466 
   471     TInt ret( KErrNone );
   467     TInt ret( KErrNone );
   472 
   468 
   473     switch ( aIpc )
   469     switch ( aIpc )
   474         {
   470         {
   497 // ---------------------------------------------------------------------------
   493 // ---------------------------------------------------------------------------
   498 //
   494 //
   499 TInt CMmMBMSContextTsy::DeregisterNotification(
   495 TInt CMmMBMSContextTsy::DeregisterNotification(
   500         TInt aIpc )                          
   496         TInt aIpc )                          
   501     {
   497     {
   502 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMMBMSCONTEXTTSY_DEREGISTERNOTIFICATION_1,  "TSY: CMmMBMSContextTsy::DeregisterNotification. IPC: %d", aIpc );
   498 TFLOGSTRING2( "TSY: CMmMBMSContextTsy::DeregisterNotification. IPC: %d", aIpc );
   503 
   499 
   504     TInt ret( KErrNone );
   500     TInt ret( KErrNone );
   505 
   501 
   506     switch ( aIpc )
   502     switch ( aIpc )
   507         {
   503         {
   524 // (other items were commented in a header).
   520 // (other items were commented in a header).
   525 // ---------------------------------------------------------------------------
   521 // ---------------------------------------------------------------------------
   526 //
   522 //
   527 TInt CMmMBMSContextTsy::InitialiseContextL( RPacketContext::TDataChannelV2* aDataChannel )
   523 TInt CMmMBMSContextTsy::InitialiseContextL( RPacketContext::TDataChannelV2* aDataChannel )
   528     {
   524     {
   529 OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMMBMSCONTEXTTSY_INITIALISECONTEXTL_1,  "TSY: CMmMBMSContextTsy::InitialiseContextL. %S", iContextName );
   525 TFLOGSTRING2( "TSY: CMmMBMSContextTsy::InitialiseContextL. %S", &iContextName );
   530 
   526 
   531     TInt ret( KErrArgument ); 
   527     TInt ret( KErrArgument ); 
   532    
   528    
   533     if ( iIsInitialiseAllowed )
   529     if ( iIsInitialiseAllowed )
   534        {
   530        {
   563 // ---------------------------------------------------------------------------
   559 // ---------------------------------------------------------------------------
   564 //
   560 //
   565 
   561 
   566 void CMmMBMSContextTsy::CompleteInitialiseContext(TInt aResult, RPacketContext::TDataChannelV2* aDataChannel )     
   562 void CMmMBMSContextTsy::CompleteInitialiseContext(TInt aResult, RPacketContext::TDataChannelV2* aDataChannel )     
   567     {
   563     {
   568 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMMBMSCONTEXTTSY_COMPLETEINITIALISECONTEXT_1,  "TSY: CMmMBMSContextTsy::CompleteInitialiseContext. Error: %d", aResult );
   564 TFLOGSTRING2( "TSY: CMmMBMSContextTsy::CompleteInitialiseContext. Error: %d", aResult );
   569 
   565 
   570     iIsActivateAllowed = ETrue;
   566     iIsActivateAllowed = ETrue;
   571     if (KErrNone == aResult )
   567     if (KErrNone == aResult )
   572         {
   568         {
   573         CompleteNotifyStatusChange( RPacketContext::EStatusInactive );
   569         CompleteNotifyStatusChange( RPacketContext::EStatusInactive );
   603 // (other items were commented in a header).
   599 // (other items were commented in a header).
   604 // ---------------------------------------------------------------------------
   600 // ---------------------------------------------------------------------------
   605 //
   601 //
   606 TInt CMmMBMSContextTsy::ActivateL()
   602 TInt CMmMBMSContextTsy::ActivateL()
   607     {
   603     {
   608 OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMMBMSCONTEXTTSY_ACTIVATEL_1,  "TSY: CMmMBMSContextTsy::ActivateL. Context name:%S", iContextName );
   604 TFLOGSTRING2( "TSY: CMmMBMSContextTsy::ActivateL. Context name:%S", &iContextName );
   609 	
   605 	
   610     TInt ret( KErrNotReady );
   606     TInt ret( KErrNotReady );
   611 
   607 
   612     if ( iIsActivateAllowed )
   608     if ( iIsActivateAllowed )
   613         {        
   609         {        
   649 // (other items were commented in a header).
   645 // (other items were commented in a header).
   650 // ---------------------------------------------------------------------------
   646 // ---------------------------------------------------------------------------
   651 //
   647 //
   652 void CMmMBMSContextTsy::CompleteActivate(TInt aResult)
   648 void CMmMBMSContextTsy::CompleteActivate(TInt aResult)
   653     {
   649     {
   654 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMMBMSCONTEXTTSY_COMPLETEACTIVATE_1,  "TSY: CMmMBMSContextTsy::CompleteActivate. Error: %d", aResult );
   650 TFLOGSTRING2( "TSY: CMmMBMSContextTsy::CompleteActivate. Error: %d", aResult ); 
   655    
   651    
   656     // Reset the req handle. Returns the deleted req handle
   652     // Reset the req handle. Returns the deleted req handle
   657     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
   653     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
   658         EMultimodeMbmsContextActivate );
   654         EMultimodeMbmsContextActivate );
   659         
   655         
   665         // Notify status change
   661         // Notify status change
   666         CompleteNotifyStatusChange( RPacketContext::EStatusActive );
   662         CompleteNotifyStatusChange( RPacketContext::EStatusActive );
   667         }        
   663         }        
   668     else
   664     else
   669         {
   665         {
   670 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMMBMSCONTEXTTSY_COMPLETEACTIVATE_2,  "TSY: CMmMBMSContextTsy::CompleteActivate. ErrorCause: %d",aResult );
   666 TFLOGSTRING2( "TSY: CMmMBMSContextTsy::CompleteActivate. ErrorCause: %d",
       
   667              aResult );
   671         // Re-activation is allowed because activation has not succeeded
   668         // Re-activation is allowed because activation has not succeeded
   672         iIsActivateAllowed = ETrue;
   669         iIsActivateAllowed = ETrue;
   673         }
   670         }
   674 
   671 
   675              
   672              
   688 // (other items were commented in a header).
   685 // (other items were commented in a header).
   689 // ---------------------------------------------------------------------------
   686 // ---------------------------------------------------------------------------
   690 //
   687 //
   691 TInt CMmMBMSContextTsy::DeactivateL()
   688 TInt CMmMBMSContextTsy::DeactivateL()
   692     {
   689     {
   693 OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMMBMSCONTEXTTSY_DEACTIVATEL_1,  "TSY: CMmMBMSContextTsy::DeactivateL. Context name:%S", iContextName );
   690 TFLOGSTRING2( "TSY: CMmMBMSContextTsy::DeactivateL. Context name:%S", &iContextName );
   694 
   691 
   695     TInt ret( KErrArgument );
   692     TInt ret( KErrArgument );
   696 
   693 
   697     CMmDataPackage data;
   694     CMmDataPackage data;
   698     data.PackData( &iContextName, &iServicesArray );
   695     data.PackData( &iContextName, &iServicesArray );
   721 
   718 
   722 void CMmMBMSContextTsy::CompleteDeactivate( 
   719 void CMmMBMSContextTsy::CompleteDeactivate( 
   723         CMmDataPackage* aDataPackage,
   720         CMmDataPackage* aDataPackage,
   724         TInt aResult )    
   721         TInt aResult )    
   725     {
   722     {
   726 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMMBMSCONTEXTTSY_COMPLETEDEACTIVATE_1,  "TSY: CMmMBMSContextTsy::CompleteDeactivate. Error: %d", aResult );
   723 TFLOGSTRING2( "TSY: CMmMBMSContextTsy::CompleteDeactivate. Error: %d", aResult );
   727     // Reset the req handle. Returns the deleted req handle
   724     // Reset the req handle. Returns the deleted req handle
   728     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
   725     TTsyReqHandle reqHandle = iTsyReqHandleStore->ResetTsyReqHandle(
   729         EMultimodeMbmsContextDeactivate );
   726         EMultimodeMbmsContextDeactivate );
   730 
   727 
   731     // Notify status change
   728     // Notify status change
   783 // (other items were commented in a header).
   780 // (other items were commented in a header).
   784 // ---------------------------------------------------------------------------
   781 // ---------------------------------------------------------------------------
   785 //
   782 //
   786 TInt CMmMBMSContextTsy::DeleteL()
   783 TInt CMmMBMSContextTsy::DeleteL()
   787     {
   784     {
   788 OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMMBMSCONTEXTTSY_DELETEL_1,  "TSY: CMmMBMSContextTsy::DeleteL. Context name:%S", iContextName );
   785 TFLOGSTRING2( "TSY: CMmMBMSContextTsy::DeleteL. Context name:%S", &iContextName );
   789 
   786 
   790     TInt ret( KErrNotReady );
   787     TInt ret( KErrNotReady );
   791     if( RPacketContext::EStatusUnknown != ContextStatus() )
   788     if( RPacketContext::EStatusUnknown != ContextStatus() )
   792         {
   789         {
   793         CMmDataPackage data;
   790         CMmDataPackage data;
   815 //
   812 //
   816 
   813 
   817 void CMmMBMSContextTsy::CompleteDelete( 
   814 void CMmMBMSContextTsy::CompleteDelete( 
   818         TInt aResult )        
   815         TInt aResult )        
   819     {
   816     {
   820 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMMBMSCONTEXTTSY_COMPLETEDELETE_1,  "TSY: CMmMBMSContextTsy::CompleteDelete. Error: %d", aResult );
   817 TFLOGSTRING2( "TSY: CMmMBMSContextTsy::CompleteDelete. Error: %d", aResult );
   821 
   818 
   822     if( KErrNone == aResult )
   819     if( KErrNone == aResult )
   823         {
   820         {
   824         iContextStatusBeforeDeactivation = RPacketContext::EStatusDeleted;
   821         iContextStatusBeforeDeactivation = RPacketContext::EStatusDeleted;
   825 
   822 
   849 //
   846 //
   850 TInt CMmMBMSContextTsy::GetConfig(
   847 TInt CMmMBMSContextTsy::GetConfig(
   851         TTsyReqHandle aTsyReqHandle,    
   848         TTsyReqHandle aTsyReqHandle,    
   852         TPacketDataConfigBase* aConfig )  
   849         TPacketDataConfigBase* aConfig )  
   853     {
   850     {
   854 OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMMBMSCONTEXTTSY_GETCONFIG_1,  "TSY: CMmMBMSContextTsy::GetConfig. Context name:%S", iContextName );
   851 TFLOGSTRING2( "TSY: CMmMBMSContextTsy::GetConfig. Context name:%S", &iContextName );
   855     TInt ret( KErrNone );
   852     TInt ret( KErrNone );
   856     
   853     
   857     // Check that the mode given in aConfig is KConfigMBMS
   854     // Check that the mode given in aConfig is KConfigMBMS
   858     if ( TPacketDataConfigBase::KConfigMBMS == aConfig->ExtensionId() )
   855     if ( TPacketDataConfigBase::KConfigMBMS == aConfig->ExtensionId() )
   859         {
   856         {
   881 //
   878 //
   882 TInt CMmMBMSContextTsy::GetLastErrorCause(
   879 TInt CMmMBMSContextTsy::GetLastErrorCause(
   883         TTsyReqHandle aTsyReqHandle,  
   880         TTsyReqHandle aTsyReqHandle,  
   884         TInt* aError )    
   881         TInt* aError )    
   885     {
   882     {
   886 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMMBMSCONTEXTTSY_GETLASTERRORCAUSE_1,  "TSY: CMmMBMSContextTsy::GetLastErrorCause. Context name:%S Last error cause: %d", iContextName, iLastErrorCause );
   883 TFLOGSTRING3( "TSY: CMmMBMSContextTsy::GetLastErrorCause. Context name:%S Last error cause: %d", &iContextName, iLastErrorCause );
   887 
   884 
   888     *aError = iLastErrorCause;
   885     *aError = iLastErrorCause;
   889     CMmMBMSContextTsy::ReqCompleted( aTsyReqHandle, KErrNone );
   886     CMmMBMSContextTsy::ReqCompleted( aTsyReqHandle, KErrNone );
   890 
   887 
   891     return KErrNone;
   888     return KErrNone;
   901         TInt aErrorCause ) 
   898         TInt aErrorCause ) 
   902     {
   899     {
   903     
   900     
   904      iLastErrorCause =  aErrorCause;           
   901      iLastErrorCause =  aErrorCause;           
   905     
   902     
   906 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMMBMSCONTEXTTSY_SETLASTERRORCAUSE_1,  "TSY: CMmMBMSContextTsy::SetLastErrorCause.  aErrorCause: %d iLastErrorCause:%d", aErrorCause, iLastErrorCause );
   903 TFLOGSTRING3( "TSY: CMmMBMSContextTsy::SetLastErrorCause.  aErrorCause: %d iLastErrorCause:%d", 
       
   904              aErrorCause, iLastErrorCause );
   907 
   905 
   908     }
   906     }
   909 
   907 
   910 // ---------------------------------------------------------------------------
   908 // ---------------------------------------------------------------------------
   911 // CMmMBMSContextTsy::GetStatus
   909 // CMmMBMSContextTsy::GetStatus
   915 //
   913 //
   916 TInt CMmMBMSContextTsy::GetStatus(
   914 TInt CMmMBMSContextTsy::GetStatus(
   917         TTsyReqHandle aTsyReqHandle,   
   915         TTsyReqHandle aTsyReqHandle,   
   918         RPacketContext::TContextStatus* aContextStatus )
   916         RPacketContext::TContextStatus* aContextStatus )
   919     {
   917     {
   920 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMMBMSCONTEXTTSY_GETSTATUS_1,  "TSY: CMmMBMSContextTsy::GetStatus. Context name: %S Context Status:%d", iContextName, iContextStatus );
   918 TFLOGSTRING3( "TSY: CMmMBMSContextTsy::GetStatus. Context name: %S Context Status:%d", &iContextName, iContextStatus );
   921     *aContextStatus = iContextStatus;
   919     *aContextStatus = iContextStatus;
   922     CMmMBMSContextTsy::ReqCompleted( aTsyReqHandle, KErrNone );
   920     CMmMBMSContextTsy::ReqCompleted( aTsyReqHandle, KErrNone );
   923 
   921 
   924     return KErrNone;
   922     return KErrNone;
   925     }
   923     }
   931 // ---------------------------------------------------------------------------
   929 // ---------------------------------------------------------------------------
   932 //
   930 //
   933 TInt CMmMBMSContextTsy::NotifyConfigChanged(
   931 TInt CMmMBMSContextTsy::NotifyConfigChanged(
   934         TPacketDataConfigBase* aConfig )  
   932         TPacketDataConfigBase* aConfig )  
   935     {
   933     {
   936 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMMBMSCONTEXTTSY_NOTIFYCONFIGCHANGED_1,  "TSY: CMmMBMSContextTsy::NotifyConfigChanged." );
   934 TFLOGSTRING( "TSY: CMmMBMSContextTsy::NotifyConfigChanged." );
   937 
   935 
   938     // Check that used mode is MBMS
   936     // Check that used mode is MBMS
   939     if (  TPacketDataConfigBase::KConfigMBMS != aConfig->ExtensionId() ) 
   937     if (  TPacketDataConfigBase::KConfigMBMS != aConfig->ExtensionId() ) 
   940         {
   938         {
   941         return KErrArgument;
   939         return KErrArgument;
   956 // ---------------------------------------------------------------------------
   954 // ---------------------------------------------------------------------------
   957 //
   955 //
   958 void CMmMBMSContextTsy::CompleteNotifyConfigChanged(const CMmDataPackage* aDataPackage,
   956 void CMmMBMSContextTsy::CompleteNotifyConfigChanged(const CMmDataPackage* aDataPackage,
   959         TInt aResult)
   957         TInt aResult)
   960     {
   958     {
   961 OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMMBMSCONTEXTTSY_COMPLETENOTIFYCONFIGCHANGED_1,  "TSY: CMmMBMSContextTsy::CompleteNotifyConfigChanged.  Context name:%S",iContextName );
   959 TFLOGSTRING2( "TSY: CMmMBMSContextTsy::CompleteNotifyConfigChanged.  Context name:%S",
       
   960                 &iContextName );
   962 	if(aDataPackage != NULL)
   961 	if(aDataPackage != NULL)
   963 		{
   962 		{
   964 		if ( KErrNone == aResult )
   963 		if ( KErrNone == aResult )
   965 		    {
   964 		    {
   966 		    RPacketMbmsContext::TContextConfigMbmsV1* aConfig = NULL;
   965 		    RPacketMbmsContext::TContextConfigMbmsV1* aConfig = NULL;
  1014 // ---------------------------------------------------------------------------
  1013 // ---------------------------------------------------------------------------
  1015 //
  1014 //
  1016 TInt CMmMBMSContextTsy::NotifyStatusChange(
  1015 TInt CMmMBMSContextTsy::NotifyStatusChange(
  1017         RPacketContext::TContextStatus* aContextStatus )
  1016         RPacketContext::TContextStatus* aContextStatus )
  1018     {
  1017     {
  1019 OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMMBMSCONTEXTTSY_NOTIFYSTATUSCHANGE_1,  "TSY: CMmMBMSContextTsy::NotifyStatusChange. Context name:%S", iContextName );
  1018 TFLOGSTRING2( "TSY: CMmMBMSContextTsy::NotifyStatusChange. Context name:%S", &iContextName );
  1020     iRetNotifyStatus = aContextStatus;
  1019     iRetNotifyStatus = aContextStatus;
  1021     iReqHandleType = EMultimodeMbmsContextNotifyStatusChange;
  1020     iReqHandleType = EMultimodeMbmsContextNotifyStatusChange;
  1022 
  1021 
  1023     return KErrNone;
  1022     return KErrNone;
  1024     }
  1023     }
  1033             RPacketContext::TContextStatus aContextStatus  )
  1032             RPacketContext::TContextStatus aContextStatus  )
  1034     {
  1033     {
  1035     if ( aContextStatus != iContextStatus )
  1034     if ( aContextStatus != iContextStatus )
  1036         {
  1035         {
  1037         iContextStatus = aContextStatus;
  1036         iContextStatus = aContextStatus;
  1038 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMMBMSCONTEXTTSY_COMPLETENOTIFYSTATUSCHANGE_1,  "TSY: CMmMBMSContextTsy::CompleteNotifyStatusChange. Context name: %S  Context status:%d",iContextName, iContextStatus );
  1037 TFLOGSTRING3( "TSY: CMmMBMSContextTsy::CompleteNotifyStatusChange. Context name: %S  Context status:%d",
       
  1038                     &iContextName, iContextStatus );   
  1039                     
  1039                     
  1040         if ( RPacketContext::EStatusActive == iContextStatus ||
  1040         if ( RPacketContext::EStatusActive == iContextStatus ||
  1041              RPacketContext::EStatusInactive == iContextStatus ||
  1041              RPacketContext::EStatusInactive == iContextStatus ||
  1042              RPacketContext::EStatusDeleted == iContextStatus )
  1042              RPacketContext::EStatusDeleted == iContextStatus )
  1043             {
  1043             {
  1112 // ---------------------------------------------------------------------------
  1112 // ---------------------------------------------------------------------------
  1113 //
  1113 //
  1114 TInt CMmMBMSContextTsy::SetConfigL(
  1114 TInt CMmMBMSContextTsy::SetConfigL(
  1115         TPacketDataConfigBase* aConfig ) 
  1115         TPacketDataConfigBase* aConfig ) 
  1116     {
  1116     {
  1117 OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMMBMSCONTEXTTSY_SETCONFIGL_1,  "TSY: CMmMBMSContextTsy::SetConfigL. Context name:%S", iContextName );
  1117 TFLOGSTRING2( "TSY: CMmMBMSContextTsy::SetConfigL. Context name:%S", &iContextName );
  1118 
  1118 
  1119     TInt ret( KErrArgument );
  1119     TInt ret( KErrArgument );
  1120            
  1120            
  1121     if ( TPacketDataConfigBase::KConfigMBMS == aConfig->ExtensionId() )
  1121     if ( TPacketDataConfigBase::KConfigMBMS == aConfig->ExtensionId() )
  1122         {
  1122         {
  1137             *iTempConfig = *configMbms;
  1137             *iTempConfig = *configMbms;
  1138 
  1138 
  1139             CMmDataPackage data;
  1139             CMmDataPackage data;
  1140             data.PackData( &( *aConfig ), &iContextName );
  1140             data.PackData( &( *aConfig ), &iContextName );
  1141 
  1141 
  1142 OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMMBMSCONTEXTTSY_SETCONFIGL_2, "TSY: CMmMBMSContextTsy::SetConfigL. Context: %S", iContextName);
  1142 TFLOGSTRING2("TSY: CMmMBMSContextTsy::SetConfigL. Context: %S", &iContextName);
  1143 
  1143 
  1144             ret = iMmPacketService->MessageManager()->HandleRequestL(
  1144             ret = iMmPacketService->MessageManager()->HandleRequestL(
  1145                 EPacketContextSetConfig, &data ); 
  1145                 EPacketContextSetConfig, &data ); 
  1146     
  1146     
  1147             if ( KErrNone != ret )
  1147             if ( KErrNone != ret )
  1173 // ---------------------------------------------------------------------------
  1173 // ---------------------------------------------------------------------------
  1174 //
  1174 //
  1175 void CMmMBMSContextTsy::CompleteSetConfig( 
  1175 void CMmMBMSContextTsy::CompleteSetConfig( 
  1176         TInt aError )
  1176         TInt aError )
  1177     {
  1177     {
  1178 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMMBMSCONTEXTTSY_COMPLETESETCONFIG_1,  "TSY: CMmMBMSContextTsy::CompleteSetConfig. Error: %d", aError );
  1178 TFLOGSTRING2( "TSY: CMmMBMSContextTsy::CompleteSetConfig. Error: %d", aError );
  1179     
  1179     
  1180     if( (KErrNone == aError) && (iConfig) && (iTempConfig) )
  1180     if( (KErrNone == aError) && (iConfig) && (iTempConfig) )
  1181 	    {
  1181 	    {
  1182 	    *iConfig = *iTempConfig;  
  1182 	    *iConfig = *iTempConfig;  
  1183 	    // Release the memory allocated for iTempConfig
  1183 	    // Release the memory allocated for iTempConfig
  1218 
  1218 
  1219 void CMmMBMSContextTsy::ReqCompleted(
  1219 void CMmMBMSContextTsy::ReqCompleted(
  1220         TTsyReqHandle aTsyReqHandle, 
  1220         TTsyReqHandle aTsyReqHandle, 
  1221         TInt aError )   
  1221         TInt aError )   
  1222     {
  1222     {
  1223 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMMBMSCONTEXTTSY_REQCOMPLETED_1,  "TSY: CMmMBMSContextTsy::ReqCompleted. Handle:%d Error:%d",  aTsyReqHandle, aError );
  1223 TFLOGSTRING3( "TSY: CMmMBMSContextTsy::ReqCompleted. Handle:%d Error:%d",  aTsyReqHandle, aError );
  1224 
  1224 
  1225     // Set last error cause
  1225     // Set last error cause
  1226     if ( KErrNone != aError )
  1226     if ( KErrNone != aError )
  1227         {
  1227         {
  1228         iLastErrorCause = aError;
  1228         iLastErrorCause = aError;
  1298 // 
  1298 // 
  1299 void CMmMBMSContextTsy::Complete(
  1299 void CMmMBMSContextTsy::Complete(
  1300         const TInt aReqHandleType,    
  1300         const TInt aReqHandleType,    
  1301         const TInt aError )        
  1301         const TInt aError )        
  1302     {
  1302     {
  1303 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMMBMSCONTEXTTSY_COMPLETE_1,  "TSY: CMmMBMSContextTsy::Complete. Req type %d", aReqHandleType );
  1303 TFLOGSTRING2( "TSY: CMmMBMSContextTsy::Complete. Req type %d", aReqHandleType );
  1304     
  1304     
  1305     
  1305     
  1306     // All possible TSY req handle types are listed in the
  1306     // All possible TSY req handle types are listed in the
  1307     // switch case below.
  1307     // switch case below.
  1308     switch ( aReqHandleType )
  1308     switch ( aReqHandleType )
  1382 //         
  1382 //         
  1383 TInt CMmMBMSContextTsy::UpdateMbmsSessionList( 
  1383 TInt CMmMBMSContextTsy::UpdateMbmsSessionList( 
  1384     TMbmsAction* aAction,
  1384     TMbmsAction* aAction,
  1385     TMbmsSessionId* aSession ) 
  1385     TMbmsSessionId* aSession ) 
  1386     {
  1386     {
  1387 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMMBMSCONTEXTTSY_UPDATEMBMSSESSIONLIST_1, "TSY: CMmMBMSContextTsy::UpdateMbmsSessionList. Context: %S, action: %d", iContextName, *aAction);
  1387 TFLOGSTRING3("TSY: CMmMBMSContextTsy::UpdateMbmsSessionList. Context: %S, action: %d", &iContextName, aAction);    
  1388     TInt ret( KErrNone );
  1388     TInt ret( KErrNone );
  1389     
  1389     
  1390     if( iConfig->iMbmsSessionFlag )
  1390     if( iConfig->iMbmsSessionFlag )
  1391         {
  1391         {
  1392         iAction = *aAction;
  1392         iAction = *aAction;
  1430 // ---------------------------------------------------------------------------
  1430 // ---------------------------------------------------------------------------
  1431 //         
  1431 //         
  1432 void CMmMBMSContextTsy::CompleteUpdateMbmsSessionList( 
  1432 void CMmMBMSContextTsy::CompleteUpdateMbmsSessionList( 
  1433         const TInt aResult )
  1433         const TInt aResult )
  1434     {
  1434     {
  1435 OstTraceDefExt2(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMMBMSCONTEXTTSY_COMPLETEUPDATEMBMSSESSIONLIST_1, "TSY: CMmMBMSContextTsy::CompleteUpdateMbmsSessionList. Context: %S, result: %d", iContextName, aResult);
  1435 TFLOGSTRING3("TSY: CMmMBMSContextTsy::CompleteUpdateMbmsSessionList. Context: %S, result: %d", &iContextName, aResult);    
  1436     
  1436     
  1437     TInt ret( aResult );
  1437     TInt ret( aResult );
  1438    
  1438    
  1439     if( iMmPacketService->MaximumActiveServices() > iMmPacketService->EnumerateMbmsActiveServices() )  
  1439     if( iMmPacketService->MaximumActiveServices() > iMmPacketService->EnumerateMbmsActiveServices() )  
  1440         {        
  1440         {        
  1524 	        TTsyReqHandle aTsyReqHandle,
  1524 	        TTsyReqHandle aTsyReqHandle,
  1525 	        RMobilePhone::TClientId* aClient,
  1525 	        RMobilePhone::TClientId* aClient,
  1526 	        TInt* aBufSize )
  1526 	        TInt* aBufSize )
  1527     {
  1527     {
  1528     TInt ret( KErrNone );
  1528     TInt ret( KErrNone );
  1529 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMMBMSCONTEXTTSY_GETMBMSACTIVESERVICESPHASE1L_1, "TSY: CMmMBMSContextTsy::GetMbmsActiveServicesPhase1L");
  1529 TFLOGSTRING("TSY: CMmMBMSContextTsy::GetMbmsActiveServicesPhase1L");
  1530   
  1530   
  1531   	if (iServicesArray->iSessionIdList.Count() > 0)
  1531   	if (iServicesArray->iSessionIdList.Count() > 0)
  1532   		{
  1532   		{
  1533   		// Presently internal attribute, used only by this method.
  1533   		// Presently internal attribute, used only by this method.
  1534     	iClientId = *aClient;
  1534     	iClientId = *aClient;
  1558 TInt CMmMBMSContextTsy::GetMbmsActiveServicesPhase2L(
  1558 TInt CMmMBMSContextTsy::GetMbmsActiveServicesPhase2L(
  1559         	TTsyReqHandle aTsyReqHandle,
  1559         	TTsyReqHandle aTsyReqHandle,
  1560         	RMobilePhone::TClientId* aClient,
  1560         	RMobilePhone::TClientId* aClient,
  1561 	        TDes8* aBuffer )   
  1561 	        TDes8* aBuffer )   
  1562     {
  1562     {
  1563 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMMBMSCONTEXTTSY_GETMBMSACTIVESERVICESPHASE2L_1, "TSY: CMmMBMSContextTsy::GetMbmsActiveServicesPhase2L");
  1563 TFLOGSTRING("TSY: CMmMBMSContextTsy::GetMbmsActiveServicesPhase2L");
  1564 	
  1564 	
  1565 	TInt error = KErrNone;
  1565 	TInt error = KErrNone;
  1566 	
  1566 	
  1567 	// Check client id
  1567 	// Check client id
  1568 	if (( aClient->iSessionHandle != iClientId.iSessionHandle 
  1568 	if (( aClient->iSessionHandle != iClientId.iSessionHandle