×
Namespaces

Variants
Actions

How to check if the backlight is off and how to turn it on

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Tested with
Devices(s): N78
Compatibility
Platform(s): S60 3rd Edition (initial release), FP1, FP2
S60 3rd Edition FP2
S60 3rd Edition FP1
S60 3rd Edition (initial release)
Platform Security
Signing Required: Self-Signed
Article
Keywords: keywords=HAL::Get(),User::ResetInactivityTime()
Created: lming (01 Nov 2008)
Last edited: hamishwillee (14 Jun 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.

This page was last modified on 14 June 2013, at 10:40.
99 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×