Background Task Service Augmenting the Application Lifecycle

Registered by Thomas Voß

The application lifecycle for Ubuntu touch as presented and discussed in https://blueprints.launchpad.net/ubuntu/+spec/client-1303-add-app-model-and-lifecycle-to-platform-api does not guarantee applications to be running when they are in the background. However, there are certain long running tasks that might exceed the lifetime of an application in the lifecycle model. To support use-cases like downloads or playing music, a background task service handling execution of certain types of tasks on behalf of the system is envisioned.

Blueprint information

Status:
Not started
Approver:
Thomas Voß
Priority:
Undefined
Drafter:
Thomas Voß
Direction:
Approved
Assignee:
None
Definition:
Discussion
Series goal:
Accepted for saucy
Implementation:
Not started
Milestone target:
None

Related branches

Sprints

Whiteboard

Use-cases:
  * A messaging app exports an action to the indicator messaging menu that should work even when the messaging app is not the focused application anymore.
  * A video player wants to keep playing the sound but stop the video decoding when it is not the focused application anymore.
  * Content viewing app (e.g. newspaper app) needs to download content in the background and notify the user when it is ready and available for offline consumption at any time by the user.
  * A bittorrent app wants to keep downloading when it is not the focused application anymore.
  * A photo gallery application wants to be able to continue its photo upload when it is not the focused application anymore.
  * A mapping/navigation application needs to be notified of GPS events even when in the background (for instance to record the way).
  * A user selects an application from the HUD and executes an action related to a non-foreground app
      * make new note
      * send an e-mail
      * stop download
      * take a screenshot
  * Clock core app sets an alarm that should be triggered even if the app is not running.

* bg<->fg task handling will be token based to allow for persistence of completion events across lifecycle boundaries.

* Arbitrary vs. Generic background tasks
* Leverage indicator services to expose handling of background tasks?

(?)

Work Items

Dependency tree

* Blueprints in grey have been implemented.