coreapplicationuis/SysAp/Src/SysApLightsController.cpp
branchRCL_3
changeset 17 5e7d68cc22e0
parent 15 312d2b433792
child 19 924385140d98
equal deleted inserted replaced
15:312d2b433792 17:5e7d68cc22e0
    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 #include <hal.h>
       
    34 #include <hwrmpowerstatesdkpskeys.h>
    34 
    35 
    35 // CONSTANTS
    36 // CONSTANTS
    36 
    37 
    37 const TInt KLightsOffPeriodLockJustActivated ( 5 ); // 5 sec
    38 const TInt KLightsOffPeriodLockJustActivated ( 5 ); // 5 sec
    38 const TInt KMaxLightsOffPeriodForScreenSaverAnimation ( 30 ); // 30 sec
    39 const TInt KMaxLightsOffPeriodForScreenSaverAnimation ( 30 ); // 30 sec
  1101 				
  1102 				
  1102 			TInt state( 0 );
  1103 			TInt state( 0 );
  1103 			TInt error = RProperty::Get( KPSUidStartup, KPSGlobalSystemState, state );
  1104 			TInt error = RProperty::Get( KPSUidStartup, KPSGlobalSystemState, state );
  1104     		if ( error == KErrNone && state == ESwStateCharging ) 
  1105     		if ( error == KErrNone && state == ESwStateCharging ) 
  1105 				{
  1106 				{
  1106 				iSysApAppUi.StartChargingBatteryL();
  1107 				TInt value = iSysApAppUi.StateOfProperty( KPSUidHWRMPowerState, KHWRMChargingStatus );
  1107 				//To switch on the display 
  1108 				if (value == EChargingStatusChargingComplete )
  1108 				TInt result = HAL::Set( HALData::EDisplayState, 1 );
  1109 					{
       
  1110 					iSysApAppUi.StopChargingBatteryL();
       
  1111 					}
       
  1112 				else
       
  1113 					{
       
  1114 					iSysApAppUi.StartChargingBatteryL();
       
  1115 					//To switch on the display 
       
  1116 					TInt result = HAL::Set( HALData::EDisplayState, 1 );
       
  1117 					}
  1109 				}	
  1118 				}	
  1110             }
  1119             }
  1111         else
  1120         else
  1112             {
  1121             {
  1113             TRACES( RDebug::Print( _L( "CSysApLightsController::SetLightsOnL - LIGHTS ON denied - Not necessary" ) ) );
  1122             TRACES( RDebug::Print( _L( "CSysApLightsController::SetLightsOnL - LIGHTS ON denied - Not necessary" ) ) );