Tag for Android PowerManager questions - class, that gives you control of the power state of the device.
This class gives you control of the power state of the device.
Device battery life will be significantly affected by the use of this API. Do not acquire PowerManager.WakeLocks unless you really need them, use the minimum levels possible, and be sure to release them as soon as possible.
You can obtain an instance of this class by calling Context.getSystemService()
.
The primary API you'll use is newWakeLock()
. This will create a PowerManager.WakeLock object. You can then use methods on the wake lock object to control the power state of the device.