|
Build 1.1_r1 (from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectandroid.os.Power
public class Power
Class that provides access to some of the power management functions.
| Field Summary | |
|---|---|
static int |
ALL_LIGHTS
Flags to turn on and off all the backlights. |
static int |
BRIGHTNESS_DIM
Brightness value for dim backlight |
static int |
BRIGHTNESS_LOW_BATTERY
Brightness value to use when battery is low |
static int |
BRIGHTNESS_OFF
Brightness value for fully off |
static int |
BRIGHTNESS_ON
Brightness value for fully on |
static int |
BUTTON_LIGHT
Flag to turn on and off the button backlight. |
static int |
FULL_WAKE_LOCK
Wake lock that ensures that the screen is on. |
static int |
KEYBOARD_LIGHT
Flag to turn on and off the keyboard light. |
static int |
LOW_BATTERY_THRESHOLD
Threshold for BRIGHTNESS_LOW_BATTERY (percentage) Screen will stay dim if battery level is <= LOW_BATTERY_THRESHOLD |
static int |
PARTIAL_WAKE_LOCK
Wake lock that ensures that the CPU is running. |
static int |
SCREEN_LIGHT
Flag to turn on and off the screen backlight. |
| Method Summary | |
|---|---|
static void |
acquireWakeLock(int lock,
String id)
|
static void |
reboot(String reason)
Reboot the device. |
static void |
releaseWakeLock(String id)
|
static int |
setLastUserActivityTimeout(long ms)
|
static int |
setLightBrightness(int mask,
int brightness)
Set the brightness for one or more lights |
static int |
setScreenState(boolean on)
Turn the screen on or off |
static void |
shutdown()
Deprecated. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int PARTIAL_WAKE_LOCK
public static final int FULL_WAKE_LOCK
public static final int KEYBOARD_LIGHT
public static final int SCREEN_LIGHT
public static final int BUTTON_LIGHT
public static final int ALL_LIGHTS
public static final int BRIGHTNESS_OFF
public static final int BRIGHTNESS_DIM
public static final int BRIGHTNESS_ON
public static final int BRIGHTNESS_LOW_BATTERY
public static final int LOW_BATTERY_THRESHOLD
| Method Detail |
|---|
public static void acquireWakeLock(int lock,
String id)
public static void releaseWakeLock(String id)
public static int setLightBrightness(int mask,
int brightness)
mask - flags indicating which lights to change brightnessbrightness - new brightness value (0 = off, 255 = fully bright)public static int setScreenState(boolean on)
on - Whether you want the screen on or offpublic static int setLastUserActivityTimeout(long ms)
@Deprecated public static void shutdown()
android.policy.ShutdownThread.shutdownAfterDisablingRadio().
public static void reboot(String reason)
throws IOException
reason - code to pass to the kernel (e.g. "recovery"), or null.
IOException - if reboot fails for some reason (eg, lack of
permission)
|
Build 1.1_r1 (from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||