How to check if the backlight is off and how to turn it on
Article Metadata
Tested with
Devices(s): N78
Compatibility
Platform(s): S60 3rd Edition (initial release), FP1, FP2
Article
Keywords: keywords=HAL::Get(),User::ResetInactivityTime()
Created: lming
(01 Nov 2008)
Last edited: hamishwillee
(06 May 2013)
Contents |
Overview
This snippet demonstrates how to check whether the screen backlight is off and how to turn it on. This snippet can be self-signed.
Use case
If the phone is inactive for a certain period, the backlight will turn off automatically to save battery power. In some cases, this operation could be disturbing, for example, during navigation.
Source file
//necessary library
LIBRARY HAL.LIB
LIBRARY euser.lib
//necessary header file
#include <HAL.h>
#include <hal_data.h>
#include <e32std.h>
TBool backlightState;
//retrieve EBacklightState value
HAL::Get( HALData::EBacklightState, backlightState );
if(backlightState)
{
//backlight is ON now.
.......
}
else
{
//backlight is Off now.
//ResetInactivityTime will reset all user inactivity timers and backlight
//will be turn on
User::ResetInactivityTime()
}
Postconditions
Screen backlight will be turned on.


(no comments yet)