Namespaces
Variants
Actions

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

Jump to: navigation, search
MultiMediaTile.png
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.

This page was last modified on 6 May 2013, at 13:55.
126 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved