0
votes

I have a Windows Phone 8.1 Runtime app which has a background task triggered by a DeviceUseTrigger. In the runtime policy checks for this trigger type mentioned on MSDN, it says that the task will be terminated automatically by the OS if an I/O operation from the relevant device isn't performed in more than 5 seconds. The thing is, this doesn't seem to be happening, at least not in debug mode.

While this is actually a good thing for me, I'm not sure if this behavior will persist when I actually deploy the app to the phone in release mode, and since its rather hard to get notified about background task cancellation without the debugger, I want to be sure about it before proceeding. Having worked on the background media player previous, I know for a fact that the debugger sometimes wreaks havoc with the life cycle of a background task.

1

1 Answers

0
votes

The behavior won't persist. To ease debugging, when the debugger is attached, the time and memory limits are lifted. Before publishing you app on the store, make sure to test by compiling in release mode and executing it without debugger.

As to know whether your task has been cancelled or not, you should be able to find out just by checking whether your app has the normal behavior or not. Otherwise, you could log a value on the phone at the end of the task execution and check at application startup whether it has been set.