coreapplicationuis/SysAp/Src/SysApLightsController.cpp
branchRCL_3
changeset 15 312d2b433792
parent 10 469fa8a78de7
child 17 5e7d68cc22e0
equal deleted inserted replaced
10:469fa8a78de7 15:312d2b433792
    28 #include "sysaplightpluginhandler.h"
    28 #include "sysaplightpluginhandler.h"
    29 #endif // RD_LIGHT_CONTROL_CHANGE
    29 #endif // RD_LIGHT_CONTROL_CHANGE
    30 
    30 
    31 #include "SysApFeatureManager.h"
    31 #include "SysApFeatureManager.h"
    32 #include "startupdomainpskeys.h"
    32 #include "startupdomainpskeys.h"
       
    33 #include <hal.h>
    33 
    34 
    34 // CONSTANTS
    35 // CONSTANTS
    35 
    36 
    36 const TInt KLightsOffPeriodLockJustActivated ( 5 ); // 5 sec
    37 const TInt KLightsOffPeriodLockJustActivated ( 5 ); // 5 sec
    37 const TInt KMaxLightsOffPeriodForScreenSaverAnimation ( 30 ); // 30 sec
    38 const TInt KMaxLightsOffPeriodForScreenSaverAnimation ( 30 ); // 30 sec
   993 		}
   994 		}
   994 	else
   995 	else
   995 		{
   996 		{
   996 		TRAP(err, iLight->LightOffL(CHWRMLight::ESystemTarget));
   997 		TRAP(err, iLight->LightOffL(CHWRMLight::ESystemTarget));
   997 		iSysApAppUi.StopChargingBatteryL();
   998 		iSysApAppUi.StopChargingBatteryL();
       
   999 		//To switch off the display 
       
  1000 		TInt result = HAL::Set( HALData::EDisplayState, 0 );
   998 		}            
  1001 		}            
   999     // Ignore unreserved in use warnings.
  1002     // Ignore unreserved in use warnings.
  1000     if ( err != KErrNone && err != KErrInUse )
  1003     if ( err != KErrNone && err != KErrInUse )
  1001         {
  1004         {
  1002         // Only trace as leaving here accomplishes nothing.
  1005         // Only trace as leaving here accomplishes nothing.
  1099 			TInt state( 0 );
  1102 			TInt state( 0 );
  1100 			TInt error = RProperty::Get( KPSUidStartup, KPSGlobalSystemState, state );
  1103 			TInt error = RProperty::Get( KPSUidStartup, KPSGlobalSystemState, state );
  1101     		if ( error == KErrNone && state == ESwStateCharging ) 
  1104     		if ( error == KErrNone && state == ESwStateCharging ) 
  1102 				{
  1105 				{
  1103 				iSysApAppUi.StartChargingBatteryL();
  1106 				iSysApAppUi.StartChargingBatteryL();
       
  1107 				//To switch on the display 
       
  1108 				TInt result = HAL::Set( HALData::EDisplayState, 1 );
  1104 				}	
  1109 				}	
  1105             }
  1110             }
  1106         else
  1111         else
  1107             {
  1112             {
  1108             TRACES( RDebug::Print( _L( "CSysApLightsController::SetLightsOnL - LIGHTS ON denied - Not necessary" ) ) );
  1113             TRACES( RDebug::Print( _L( "CSysApLightsController::SetLightsOnL - LIGHTS ON denied - Not necessary" ) ) );