DownloadService

Revision 10 as of 2013-08-09 13:38:28

Clear message

blueprint

Rationale

The goal of the download service is to offer a download API in Ubuntu Touch and then Ubuntu Desktop builds for system services and apps.

This allows:

  • suspending or terminating apps initiating downloads to save/reclaim resources while downloads are ongoing
  • implementing policies such as downloads on wifi mobile data connections centrally

Interface

The service will be exposed over DBus, as most other middlewares and services, which makes it easy to block/allow access via AppArmor sandboxing.

However, apps will either be using QML bindings or a C library wrapping the service.

Initial implementation

This describes the scope of the initial implementation.

Apps may:

  • add downloads
  • specify additional headers
  • specify whether the download may happen over mobile data connection
  • start/pause/resume/cancel downloads
  • get notified on download progress
  • list their own downloads

QML bindings allow registering downloads and showing a progress bar.

Apps need a special permission to access the download service.

TODO: do we need a special permission for mobile data downloads? This might require separate DBus entry points with our current AppArmor DBus implementation.

TODO: are downloads in memory, in an app chosen pathname, in a download service chosen filename? TODO: limits (size of download, timeouts etc.)

Apps may be killed and restarted between the start and the end of a download.

We don't want to remove downloads over a reboot, but it's acceptable to cancel in-progress downloads over a reboot.

Download manager implementation

In a latter iteration, we will add the capability to manage an user-visible central list of downloads. Apps will be able to flag a download as user-visible and users will have a dedicated "Downloads" app to see/open/remove completed downloads.

TODO: do we need a special permission to access the central list of downloads?

Roaming support

In a latter iteration, add API to block/allow downloads on a roaming mobile data connection.