W3C home > Mailing lists > Public > public-device-apis-log@w3.org > April 2019

Re: [wake-lock] What do the wakelocks actually do? (#138)

From: Kenneth Rohde Christiansen via GitHub <sysbot+gh@w3.org>
Date: Mon, 01 Apr 2019 11:13:00 +0000
To: public-device-apis-log@w3.org
Message-ID: <issue_comment.created-478537265-1554117179-sysbot+gh@w3.org>

>If you need to keep the CPU running in order to complete some work before the device goes to sleep, you can use a PowerManager system service feature called wake locks. Wake locks allow your application to control the power state of the host device.

>Creating and holding wake locks can have a dramatic impact on the host device's battery life. Thus you should use wake locks only when strictly necessary and hold them for as short a time as possible.


> Android and other mobile OSs have achieved longer battery life by implementing an aggressive power manager. Shortly after using a phone, its display turns off and the CPU goes into a deep power state, thus sipping as little power as possible when not in use. This is how phones, when they are not used, are able to last several days on a single charge. With Android’s power manager, the normal assumption is that when the display is off, so is the CPU.

"screen" wake lock windows:

Windows extended execution:

> Use ExtendedExecutionReason.Unspecified when you create an ExtendedExecutionSession to request additional time before your app moves into the background for scenarios such as media processing, project compilation, or keeping a network connection alive. On desktop devices running Windows 10 for desktop editions (Home, Pro, Enterprise, and Education), this is the approach to use if an app needs to avoid being suspended while it is minimized.

> On desktop devices, extended execution sessions created with ExtendedExecutionReason.Unspecified have a battery-aware time limit. If the device is connected to wall power, there is no limit to the length of the extended execution time period. If the device is on battery power, the extended execution time period can run up to ten minutes in the background.

> Specify ExtendedExecutionReason.LocationTracking when you create an ExtendedExecutionSession if your app needs to regularly log the location from the GeoLocator. Apps for fitness tracking and navigation that need to regularly monitor the user's location and should use this reason.

> A location tracking extended execution session can run as long as needed, including while the screen is locked on a mobile device. However, there can only be one such session running per device. 

GitHub Notification of comment by kenchris
Please view or discuss this issue at https://github.com/w3c/wake-lock/issues/138#issuecomment-478537265 using your GitHub account
Received on Monday, 1 April 2019 11:13:01 UTC

This archive was generated by hypermail 2.3.1 : Monday, 1 April 2019 11:13:02 UTC