idlefw/src/framework/aifw.cpp
branchRCL_3
changeset 15 a0713522ab97
parent 11 bd874ee5e5e2
child 19 edd621764147
equal deleted inserted replaced
14:15e4dd19031c 15:a0713522ab97
    30 #include "aiwspluginmanager.h"
    30 #include "aiwspluginmanager.h"
    31 #include "aiidleappregister.h"
    31 #include "aiidleappregister.h"
    32 
    32 
    33 #include <activeidle2domaincrkeys.h>
    33 #include <activeidle2domaincrkeys.h>
    34 #include <activeidle2domainpskeys.h>
    34 #include <activeidle2domainpskeys.h>
    35 #include <activeidle2internalpskeys.h>
       
    36 #include <aipspropertyobserver.h>
    35 #include <aipspropertyobserver.h>
    37 #include <aisystemuids.hrh>
    36 #include <aisystemuids.hrh>
    38 
    37 
    39 #include "aiutility.h"
    38 #include "aiutility.h"
    40 #include "aifwpanic.h"
    39 #include "aifwpanic.h"
   153         iNotifyHandlerESS->StopListening();
   152         iNotifyHandlerESS->StopListening();
   154         }
   153         }
   155 
   154 
   156     delete iNotifyHandlerESS;
   155     delete iNotifyHandlerESS;
   157     iNotifyHandlerESS = NULL;
   156     iNotifyHandlerESS = NULL;
   158    
       
   159     Release( iIdleRestartObserver );
       
   160     iIdleRestartObserver = NULL;
       
   161         
   157         
   162     delete iWsPluginManager;
   158     delete iWsPluginManager;
   163     iWsPluginManager = NULL;
   159     iWsPluginManager = NULL;
   164     
   160     
   165     delete iEventHandler;
   161     delete iEventHandler;
   241     // Cenrep notifier to listen ESS changes in cenrep    
   237     // Cenrep notifier to listen ESS changes in cenrep    
   242     iNotifyHandlerESS = CCenRepNotifyHandler::NewL( *this, *iRepository,                                                    
   238     iNotifyHandlerESS = CCenRepNotifyHandler::NewL( *this, *iRepository,                                                    
   243          CCenRepNotifyHandler::EIntKey, KAIExternalStatusScreen );
   239          CCenRepNotifyHandler::EIntKey, KAIExternalStatusScreen );
   244                                                      
   240                                                      
   245     iNotifyHandlerESS->StartListeningL();
   241     iNotifyHandlerESS->StartListeningL();
   246 
       
   247     iIdleRestartObserver = AiUtility::CreatePSPropertyObserverL(
       
   248         TCallBack( HandleRestartEvent, this ), 
       
   249         KPSUidAiInformation, KActiveIdleRestartAI2 );
       
   250     
   242     
   251     __PRINTS( "*** CAiFw::AppEnvReadyL - done" );
   243     __PRINTS( "*** CAiFw::AppEnvReadyL - done" );
   252     }
   244     }
   253 
   245 
   254 // ----------------------------------------------------------------------------
   246 // ----------------------------------------------------------------------------
   339         
   331         
   340         iUiControllerManager->DestroySecondaryUiControllers();
   332         iUiControllerManager->DestroySecondaryUiControllers();
   341 
   333 
   342         delete iWsPluginManager;
   334         delete iWsPluginManager;
   343         iWsPluginManager = NULL;
   335         iWsPluginManager = NULL;
   344         
       
   345         Release( iIdleRestartObserver );
       
   346         iIdleRestartObserver = NULL;
       
   347         
   336         
   348         iStateProvider->Stop();
   337         iStateProvider->Stop();
   349         }
   338         }
   350     }
   339     }
   351 
   340 
   496     // Restart
   485     // Restart
   497     iUiControllerManager->ExitMainController();
   486     iUiControllerManager->ExitMainController();
   498     }
   487     }
   499 
   488 
   500 // ----------------------------------------------------------------------------
   489 // ----------------------------------------------------------------------------
   501 // CAiFw::HandleRestartEvent()
       
   502 //
       
   503 // ----------------------------------------------------------------------------
       
   504 //
       
   505 TInt CAiFw::HandleRestartEvent( TAny* aSelf )
       
   506     {
       
   507     CAiFw* self = static_cast<CAiFw*>( aSelf );
       
   508     
       
   509     TInt value( 0 );
       
   510     
       
   511     if ( self->iIdleRestartObserver )
       
   512         {
       
   513         TInt err( self->iIdleRestartObserver->Get( value ) );
       
   514 
       
   515         if ( err == KErrNone && value == KActiveIdleRestartCode )
       
   516             {
       
   517             self->iUiControllerManager->ExitMainController();
       
   518             }
       
   519         }
       
   520     
       
   521     return KErrNone;
       
   522     }
       
   523 
       
   524 // ----------------------------------------------------------------------------
       
   525 // CAiFw::Repository()
   490 // CAiFw::Repository()
   526 //
   491 //
   527 // ----------------------------------------------------------------------------
   492 // ----------------------------------------------------------------------------
   528 //
   493 //
   529 CRepository& CAiFw::Repository() const
   494 CRepository& CAiFw::Repository() const