Fields Summary |
---|
public static final int | WAKEFULNESS_ASLEEPWakefulness: 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_AWAKEWakefulness: 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_DREAMINGWakefulness: 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_DOZINGWakefulness: 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. |
Methods Summary |
---|
public abstract boolean | getLowPowerModeEnabled()
|
public static boolean | isInteractive(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 void | registerLowPowerModeObserver(android.os.PowerManagerInternal$LowPowerModeListener listener)
|
public abstract void | setButtonBrightnessOverrideFromWindowManager(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.
|
public abstract void | setDozeOverrideFromDreamManager(int screenState, int screenBrightness)Used by the dream manager to override certain properties while dozing.
|
public abstract void | setMaximumScreenOffTimeoutFromDeviceAdmin(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 void | setScreenBrightnessOverrideFromWindowManager(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.
|
public abstract void | setUserActivityTimeoutOverrideFromWindowManager(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.
|
public static java.lang.String | wakefulnessToString(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);
}
|