FileDocCategorySizeDatePackage
PowerManagerInternal.javaAPI DocAndroid 5.1 API5196Thu Mar 12 22:22:10 GMT 2015android.os

PowerManagerInternal

public abstract class PowerManagerInternal extends Object
Power manager local system service interface.
hide
Only for use within the system server.

Fields Summary
public static final int
WAKEFULNESS_ASLEEP
Wakefulness: The device is asleep. It can only be awoken by a call to wakeUp(). The screen should be off or in the process of being turned off by the display controller. The device typically passes through the dozing state first.
public static final int
WAKEFULNESS_AWAKE
Wakefulness: The device is fully awake. It can be put to sleep by a call to goToSleep(). When the user activity timeout expires, the device may start dreaming or go to sleep.
public static final int
WAKEFULNESS_DREAMING
Wakefulness: The device is dreaming. It can be awoken by a call to wakeUp(), which ends the dream. The device goes to sleep when goToSleep() is called, when the dream ends or when unplugged. User activity may brighten the screen but does not end the dream.
public static final int
WAKEFULNESS_DOZING
Wakefulness: The device is dozing. It is almost asleep but is allowing a special low-power "doze" dream to run which keeps the display on but lets the application processor be suspended. It can be awoken by a call to wakeUp() which ends the dream. The device fully goes to sleep if the dream cannot be started or ends on its own.
Constructors Summary
Methods Summary
public abstract booleangetLowPowerModeEnabled()

public static booleanisInteractive(int wakefulness)
Returns true if the wakefulness state represents an interactive state as defined by {@link android.os.PowerManager#isInteractive}.

        return wakefulness == WAKEFULNESS_AWAKE || wakefulness == WAKEFULNESS_DREAMING;
    
public abstract voidregisterLowPowerModeObserver(android.os.PowerManagerInternal$LowPowerModeListener listener)

public abstract voidsetButtonBrightnessOverrideFromWindowManager(int brightness)
Used by the window manager to override the button brightness based on the current foreground activity. This method must only be called by the window manager.

param
brightness The overridden brightness, or -1 to disable the override.

public abstract voidsetDozeOverrideFromDreamManager(int screenState, int screenBrightness)
Used by the dream manager to override certain properties while dozing.

param
screenState The overridden screen state, or {@link Display.STATE_UNKNOWN} to disable the override.
param
screenBrightness The overridden screen brightness, or {@link PowerManager#BRIGHTNESS_DEFAULT} to disable the override.

public abstract voidsetMaximumScreenOffTimeoutFromDeviceAdmin(int timeMs)
Used by device administration to set the maximum screen off timeout. This method must only be called by the device administration policy manager.

public abstract voidsetScreenBrightnessOverrideFromWindowManager(int brightness)
Used by the window manager to override the screen brightness based on the current foreground activity. This method must only be called by the window manager.

param
brightness The overridden brightness, or -1 to disable the override.

public abstract voidsetUserActivityTimeoutOverrideFromWindowManager(long timeoutMillis)
Used by the window manager to override the user activity timeout based on the current foreground activity. It can only be used to make the timeout shorter than usual, not longer. This method must only be called by the window manager.

param
timeoutMillis The overridden timeout, or -1 to disable the override.

public static java.lang.StringwakefulnessToString(int wakefulness)


         
        switch (wakefulness) {
            case WAKEFULNESS_ASLEEP:
                return "Asleep";
            case WAKEFULNESS_AWAKE:
                return "Awake";
            case WAKEFULNESS_DREAMING:
                return "Dreaming";
            case WAKEFULNESS_DOZING:
                return "Dozing";
            default:
                return Integer.toString(wakefulness);
        }