FileDocCategorySizeDatePackage
Power.javaAPI DocAndroid 1.5 API2717Wed May 06 22:41:56 BST 2009android.os

Power

public class Power extends Object
Class that provides access to some of the power management functions. {@hide}

Fields Summary
public static final int
PARTIAL_WAKE_LOCK
Wake lock that ensures that the CPU is running. The screen might not be on.
public static final int
FULL_WAKE_LOCK
Wake lock that ensures that the screen is on.
public static final int
BRIGHTNESS_OFF
Brightness value for fully off
public static final int
BRIGHTNESS_DIM
Brightness value for dim backlight
public static final int
BRIGHTNESS_ON
Brightness value for fully on
public static final int
BRIGHTNESS_LOW_BATTERY
Brightness value to use when battery is low
public static final int
LOW_BATTERY_THRESHOLD
Threshold for BRIGHTNESS_LOW_BATTERY (percentage) Screen will stay dim if battery level is <= LOW_BATTERY_THRESHOLD
Constructors Summary
private Power()

    
Methods Summary
public static native voidacquireWakeLock(int lock, java.lang.String id)

public static native voidreboot(java.lang.String reason)
Reboot the device.

param
reason code to pass to the kernel (e.g. "recovery"), or null.
throws
IOException if reboot fails for some reason (eg, lack of permission)

public static native voidreleaseWakeLock(java.lang.String id)

public static native intsetLastUserActivityTimeout(long ms)

public static native intsetScreenState(boolean on)
Turn the screen on or off

param
on Whether you want the screen on or off

public static native voidshutdown()
Turn the device off. This method is considered deprecated in favor of {@link android.policy.ShutdownThread.shutdownAfterDisablingRadio()}.

deprecated
hide