The WinRT API, Windows.System.Display.displayRequest.requestActive, is that you use to tell Windows to keep the screen turned on while your app is in the foreground. That is, calling this API prevents Windows from turning off the screen when that app is active, as is appropriate for video players, navigation apps, and so forth.

It’s very important to note, however, that Windows honors the request only when the app is visible (in whatever view state). If an app has made a request but is then hidden, regardless of whether it’s using background tasks or not, Windows will turn off the screen as usual.

Note that if you make a request, call requestRelease when the app is suspended and call requestActive again when it’s resumed. The Display power state sample demonstrates these.

The point here is that requestActive is meant for apps that need to keep the display active, but cannot be used to prevent a device from going into a sleep state, for example, to perform background processing. Background tasks exists for that purpose so that the system can manage their overall impact on battery life.


Comments are closed