PowerManager

Class of android.os · PowerManager.java · Android's reference

public final class PowerManager

Power: the screen is on, nothing saves power, and wake locks hold nothing.

Nested types

Fields

public static final int PARTIAL_WAKE_LOCK = 0x00000001 source
public static final int SCREEN_DIM_WAKE_LOCK = 0x00000006 source
public static final int SCREEN_BRIGHT_WAKE_LOCK = 0x0000000a source
public static final int FULL_WAKE_LOCK = 0x0000001a source
public static final int ACQUIRE_CAUSES_WAKEUP = 0x10000000 source
public static final int ON_AFTER_RELEASE = 0x20000000 source
public static final int THERMAL_STATUS_NONE = 0 source
public static final String ACTION_POWER_SAVE_MODE_CHANGED = "android.os.action.POWER_SAVE_MODE_CHANGED" source
public static final String ACTION_DEVICE_IDLE_MODE_CHANGED = "android.os.action.DEVICE_IDLE_MODE_CHANGED" source

Constructors

public PowerManager() empty body source

Methods

public WakeLock newWakeLock(int levelAndFlags, String tag) source
public boolean isScreenOn() source
public boolean isInteractive() source
public boolean isPowerSaveMode() source
public boolean isDeviceIdleMode() source
public boolean isLowPowerStandbyEnabled() source
public boolean isIgnoringBatteryOptimizations(String packageName) source
public boolean isSustainedPerformanceModeSupported() source
public int getCurrentThermalStatus() source
public float getThermalHeadroom(int forecastSeconds) source
public void addThermalStatusListener(OnThermalStatusChangedListener listener) source

The status never changes from none, so the listener hears it once, as Android calls a new listener.

public void addThermalStatusListener(java.util.concurrent.Executor executor, OnThermalStatusChangedListener listener) source
public void removeThermalStatusListener(OnThermalStatusChangedListener listener) empty body source

Made from ScarletNX's Sail at 166ad3910f80. The framework is ScarletNX's (GPL-3.0-or-later); the parts that follow the Android Open Source Project's sources (Apache-2.0) say so in their files.