idlefw/src/framework/aistatemanager.cpp
branchRCL_3
changeset 18 bd874ee5e5e2
parent 9 d0529222e3f0
child 51 15e4dd19031c
equal deleted inserted replaced
9:d0529222e3f0 18:bd874ee5e5e2
   368 // ----------------------------------------------------------------------------
   368 // ----------------------------------------------------------------------------
   369 //
   369 //
   370 void CAiStateManager::ProcessStateChange( TState aNextState )
   370 void CAiStateManager::ProcessStateChange( TState aNextState )
   371     {
   371     {
   372     __PRINT( __DBG_FORMAT( 
   372     __PRINT( __DBG_FORMAT( 
   373         "CAiStateManager::ProcessStateChange: current state: %d, next state: %d, halt: &d" ), 
   373         "CAiStateManager::ProcessStateChange: current state: %d, next state: %d, halt: %d" ), 
   374             (TInt)iCurrentState, (TInt)aNextState, iHalt );     
   374             (TInt)iCurrentState, (TInt)aNextState, iHalt );     
   375         
   375         
   376     __TIME_MARK( time );
   376     __TIME_MARK( time );
   377     
   377     
   378     if ( aNextState != iCurrentState )
   378     if ( aNextState != iCurrentState )
   508 // 
   508 // 
   509 // ----------------------------------------------------------------------------
   509 // ----------------------------------------------------------------------------
   510 //
   510 //
   511 void CAiStateManager::StartPlugin( CHsContentPublisher& aPlugin,
   511 void CAiStateManager::StartPlugin( CHsContentPublisher& aPlugin,
   512     CHsContentPublisher::TStartReason aReason )
   512     CHsContentPublisher::TStartReason aReason )
   513     {
   513     {    
   514     __PRINTS( "CAiStateManager::StartPlugin" );
   514     const THsPublisherInfo& info( aPlugin.PublisherInfo() );
       
   515     
       
   516     __PRINT( __DBG_FORMAT( 
       
   517         "CAiStateManager::StartPlugin: name: %S, reason: %d" ), &info.Name(), (TInt)aReason ); 
   515     
   518     
   516     aPlugin.Start( aReason );
   519     aPlugin.Start( aReason );
   517     
   520     
   518     if ( iCurrentState == EAlive )
   521     if ( iCurrentState == EAlive )
   519         {
   522         {
   520         aPlugin.Resume( CHsContentPublisher::EForeground );
   523         __TIME( "CAiStateManager::StartPlugin, enter EAlive",
       
   524                 
       
   525         aPlugin.Resume( CHsContentPublisher::EForeground ) );
   521         }
   526         }
   522     else if ( iCurrentState == ESuspended )
   527     else if ( iCurrentState == ESuspended )
   523         {
   528         {
   524         aPlugin.Suspend( CHsContentPublisher::EBackground );
   529         __TIME( "CAiStateManager::StartPlugin, enter ESuspended",
       
   530                 
       
   531         aPlugin.Suspend( CHsContentPublisher::EBackground ) );
   525         }    
   532         }    
   526     
   533     
   527     if ( iFlags.IsSet( EIsOnline ) )
   534     if ( iFlags.IsSet( EIsOnline ) )
   528         {
   535         {
   529         aPlugin.SetOnline();
   536         __TIME( "CAiStateManager::StartPlugin, Set Online",
       
   537             
       
   538         aPlugin.SetOnline() );
   530         }
   539         }
   531     else
   540     else
   532         {
   541         {
   533         aPlugin.SetOffline();
   542         __TIME( "CAiStateManager::StartPlugin, Set Offline",
   534         }
   543             
       
   544         aPlugin.SetOffline() );
       
   545         }
       
   546     
       
   547     __PRINTS( "CAiStateManager::StartPlugin - done" );
   535     }
   548     }
   536 
   549 
   537 // ----------------------------------------------------------------------------
   550 // ----------------------------------------------------------------------------
   538 // CAiStateManager::StopPlugin()
   551 // CAiStateManager::StopPlugin()
   539 // 
   552 // 
   540 // ----------------------------------------------------------------------------
   553 // ----------------------------------------------------------------------------
   541 //
   554 //
   542 void CAiStateManager::StopPlugin( CHsContentPublisher& aPlugin,
   555 void CAiStateManager::StopPlugin( CHsContentPublisher& aPlugin,
   543     CHsContentPublisher::TStopReason aReason )
   556     CHsContentPublisher::TStopReason aReason )
   544     {
   557     {
   545     __PRINTS( "CAiStateManager::StopPlugin" );
   558     const THsPublisherInfo& info( aPlugin.PublisherInfo() );
       
   559     
       
   560     __PRINT( __DBG_FORMAT( 
       
   561         "CAiStateManager::StopPlugin: name: %S, reason: %d" ), &info.Name(), (TInt)aReason ); 
       
   562                       
       
   563     if ( iCurrentState == EAlive )
       
   564         {
       
   565         __TIME( "CAiStateManager::StopPlugin, enter ESuspended", 
   546                 
   566                 
   547     if ( iCurrentState == EAlive )
   567         aPlugin.Suspend( CHsContentPublisher::EBackground ) );
   548         {
   568         }
   549         aPlugin.Suspend( CHsContentPublisher::EBackground );
   569     
   550         }
   570     aPlugin.Stop( aReason );   
   551     
   571     
   552     aPlugin.Stop( aReason );                    
   572     __PRINTS( "CAiStateManager::StopPlugin - done" );
   553     }
   573     }
   554 
   574 
   555 // ----------------------------------------------------------------------------
   575 // ----------------------------------------------------------------------------
   556 // CAiStateManager::DestroyPlugins()
   576 // CAiStateManager::DestroyPlugins()
   557 // 
   577 //