vtengines/vtmediatorplugin/src/cvtmediatorplugin.cpp
branchRCL_3
changeset 15 3e521e99f813
parent 3 b1602a5ab0a3
child 34 f15ac8e65a02
equal deleted inserted replaced
13:50bbdc59f9c4 15:3e521e99f813
   152            
   152            
   153     if( iAppDeathActive )
   153     if( iAppDeathActive )
   154         {
   154         {
   155         delete iAppDeathActive;
   155         delete iAppDeathActive;
   156         iAppThread.Close();
   156         iAppThread.Close();
   157         iWsSession.Close();
       
   158         
       
   159         }
   157         }
   160 
   158 
   161     TRACE("CVtMediatorPlugin::~CVtMediatorPlugin>")
   159     TRACE("CVtMediatorPlugin::~CVtMediatorPlugin>")
   162 	}
   160 	}
   163 
   161 
   526         return;
   524         return;
   527         }
   525         }
   528 
   526 
   529     iAppDeathActive = new ( ELeave ) CAppDeathActive( *this, iAppThread );
   527     iAppDeathActive = new ( ELeave ) CAppDeathActive( *this, iAppThread );
   530        
   528        
   531     User::LeaveIfError( iWsSession.Connect() );
   529     RWsSession wsSession;
       
   530     User::LeaveIfError( wsSession.Connect() );
       
   531     CleanupClosePushL( wsSession );
   532 
   532 
   533     TInt wgId = 0;
   533     TInt wgId = 0;
   534     TBool found = EFalse;
   534     TBool found = EFalse;
   535 
   535 
   536     // Check if there is already application running. Then we do not 
   536     // Check if there is already application running. Then we do not 
   537     // start new one - rather we just monitor the existing one.
   537     // start new one - rather we just monitor the existing one.
   538     while ( ( wgId != KErrNotFound ) && !found )
   538     while ( ( wgId != KErrNotFound ) && !found )
   539         {
   539         {
   540         CApaWindowGroupName::FindByAppUid( 
   540         CApaWindowGroupName::FindByAppUid( 
   541             KVtCmVideoTelUiUid, 
   541             KVtCmVideoTelUiUid, 
   542             iWsSession, 
   542             wsSession, 
   543             wgId );
   543             wgId );
   544 
   544 
   545         TApaTask task( iWsSession );
   545         TApaTask task( wsSession );
   546         task.SetWgId( wgId );
   546         task.SetWgId( wgId );
   547         if ( task.Exists() )
   547         if ( task.Exists() )
   548             {
   548             {
   549             if ( iAppThread.Open( task.ThreadId() ) == KErrNone )
   549             if ( iAppThread.Open( task.ThreadId() ) == KErrNone )
   550                 {
   550                 {
   561         if ( !found )
   561         if ( !found )
   562             {
   562             {
   563             iAppThread.Close();
   563             iAppThread.Close();
   564              }
   564              }
   565         }
   565         }
   566 
   566     CleanupStack::PopAndDestroy(); // CleanupClosePushL
       
   567     
   567     // If application was not found, then launch new application.
   568     // If application was not found, then launch new application.
   568     if ( !found )
   569     if ( !found )
   569         {
   570         {
   570         TThreadId threadId;
   571         TThreadId threadId;
   571 #ifndef SYMBIAN_SUPPORT_UI_FRAMEWORKS_V1
   572 #ifndef SYMBIAN_SUPPORT_UI_FRAMEWORKS_V1
   929 void CVtMediatorPlugin::StopDeathActiveL()
   930 void CVtMediatorPlugin::StopDeathActiveL()
   930     {
   931     {
   931     TRACE("CVtMediatorPlugin.StopDeathActive<")
   932     TRACE("CVtMediatorPlugin.StopDeathActive<")
   932     delete iAppDeathActive;
   933     delete iAppDeathActive;
   933     iAppThread.Close();
   934     iAppThread.Close();
   934     iWsSession.Close();
       
   935     //if there is a waiting call, check if we need to launch it
   935     //if there is a waiting call, check if we need to launch it
   936     TRACE2("CVtMediatorPlugin.StopDeathActive WaitintCallID=%d>",
   936     TRACE2("CVtMediatorPlugin.StopDeathActive WaitintCallID=%d>",
   937             iWaitingVideoCallInfo.iCallId)
   937             iWaitingVideoCallInfo.iCallId)
   938     if ( iWaitingVideoCallInfo.iCallId != KVtInitCallId )
   938     if ( iWaitingVideoCallInfo.iCallId != KVtInitCallId )
   939         {
   939         {