public class PowerManager
extends java.lang.Object
| Constructor and Description |
|---|
PowerManager()
This is the constructor of PowerManager.
|
| Modifier and Type | Method and Description |
|---|---|
int |
activateWakeup(WakeupSource source)
This function allows setting a wakeup source.
|
int |
clearWakeup(WakeupSource source)
This function allows clearing a wakeup source from those previously set.
|
RebootReason |
getRebootReason()
This function allows to know the reason of last device power-off.
|
SuspendTimeout |
getSuspendTimeout(boolean externalPower)
This function allows to get the device screen off timeout before automatic
suspension.
|
WakeupSource |
getWakeupReason()
This function allows to know the source of the last wakeup.
|
boolean |
isWakeupActive(WakeupSource source)
This function allows to know if a wakeup source is currently active.
|
boolean |
isWakeupSupported(WakeupSource source)
This function allows to know if a wakeup source is configurable on a target device.
|
int |
reboot(BootType resetType)
Reset the device.
|
int |
setSuspendTimeout(SuspendTimeout timeout,
boolean externalPower)
This function allows to set the device timeout before automatic
suspension.
|
public PowerManager()
DeviceException - in case of error.public int setSuspendTimeout(SuspendTimeout timeout, boolean externalPower)
timeout - The SuspendTimeout value of the timeout.externalPower - The boolean value indicating if the timeout is meant for external AC
power or for internal battery.int DeviceException.SUCCESS in case of success,
otherwise a possible error code, matching one of the DeviceException error constants.DeviceException - in case of error, when exceptions are enabled through the ErrorManager singleton.public SuspendTimeout getSuspendTimeout(boolean externalPower)
externalPower - The boolean value indicating if the requested timeout is the one running while
powered externally or while the only power source is the internal battery.SuspendTimeout representing the active timeout.DeviceException - in case of error, when exceptions are enabled through the ErrorManager singleton.public int reboot(BootType resetType)
resetType - The BootType type of reboot to perform.int DeviceException.SUCCESS in case of success,
otherwise a possible error code, matching one of the DeviceException error constants.DeviceException - in case of error, when exceptions are enabled through the ErrorManager singleton.BootTypepublic int activateWakeup(WakeupSource source)
source - The WakeupSource that should activate the device from sleep and needs to be enabled.int DeviceException.SUCCESS in case of success,
otherwise a possible error code, matching one of the DeviceException error constants.DeviceException - in case of error, when exceptions are enabled through the ErrorManager singleton.WakeupSourcepublic int clearWakeup(WakeupSource source)
source - The WakeupSource that should no longer wake up the device anymore.int DeviceException.SUCCESS in case of success,
otherwise a possible error code, matching one of the DeviceException error constants.DeviceException - in case of error, when exceptions are enabled through the ErrorManager singleton.WakeupSourcepublic boolean isWakeupActive(WakeupSource source)
source - The WakeupSource that should be checked, whether is currently active or not.boolean true if the source is active, false otherwise.DeviceException - in case of error, when exceptions are enabled through the ErrorManager singleton.WakeupSourcepublic boolean isWakeupSupported(WakeupSource source)
source - The WakeupSource that should be checked, whether is supported or not.boolean true if the source can be enabled or disabled, false otherwise.WakeupSourcepublic WakeupSource getWakeupReason()
WakeupSource, null in case no wake up source woke up the device.DeviceException - in case of error, when exceptions are enabled through the ErrorManager singleton.WakeupSourcepublic RebootReason getRebootReason()
RebootReason related to the reason of last device power-off event.