Commit Graph

370 Commits

Author SHA1 Message Date
Gabriele M
c13d79b39c Use a Thread instead of an AsyncTask to delete downloads 2017-07-04 19:05:04 +02:00
Gabriele M
4dcf4199f1 Minor code refactoring 2017-07-04 19:05:04 +02:00
Gabriele M
520105284c Rename some constants 2017-07-04 19:05:04 +02:00
Gabriele M
437d4b1913 Don't make UpdaterService sticky
We are using it as non-sticky service, so just declare it as such.
2017-07-04 19:05:04 +02:00
Gabriele M
db3f14832a Replace 'Download' prefix with 'Updater'
These classes do more than controlling the download of the updates.
2017-07-04 19:05:04 +02:00
Gabriele M
21cc96f300 Add missing RECOVERY and REBOOT permissions
And sort alphabetically the list of permissions.
2017-07-04 19:05:04 +02:00
Gabriele M
945e50aad1 Don't crash when requesting non-existing updates 2017-07-03 17:41:34 +02:00
Gabriele M
9b3deda9fa Protect DownloadController instantiation
Enforce the use of DownloadService to create new DownloadController
instaces, but give access to the existing instances to anyone.
2017-07-03 17:41:33 +02:00
Gabriele M
dcbcc759d2 Handle installation requests from DownloadService
This is needed to protect the instantiation of DownloadController,
which will be done with a follow-up change.
2017-07-03 16:08:33 +02:00
Gabriele M
dc95edbf80 Start service to pause/resume downloads from notification
These operations require the service, so it's better to let
DownloadService handle them. This also ensures we always fulfil
the requests, even when sent while the service is not running.
2017-07-03 16:08:33 +02:00
Gabriele M
789dc7d737 Rename DownloadController's newInstance() to getInstance()
Also, make both the instance getters synchronized.
2017-07-03 16:08:32 +02:00
Gabriele M
bda4d2b9b4 Load the updates stored in the database from DownloadController
Also, hide the distinction between local and non-local updates.
Local updates should be handled only by DownloadController.
2017-07-03 16:08:31 +02:00
Gabriele M
4196ccb301 Don't use wakup alarms to check for updates
There's no need to wake the device just to check for new updates.
2017-07-03 16:08:30 +02:00
Gabriele M
f26cb61aa0 Check for new updates every day
Compare the previously downloaded updates list with the current one
and check if the old list includes all the updates of the new list.
If the network is not available at the time of the check, a new
check is scheduled.
2017-07-03 01:18:19 +02:00
Gabriele M
264fb5fc58 Improve notifications
Reorder the content of the notification and add the download
progress as text, the current speed and the ETA.
2017-07-02 22:44:32 +02:00
Gabriele M
a26c03a19a Save download speed in UpdateDownload 2017-07-02 22:26:43 +02:00
Gabriele M
c30940649c Treat major upgrades as a special case
Major upgrades are compatible, but shouldn't be allowed since they
require some manual extra steps.
2017-07-02 22:26:43 +02:00
Gabriele M
13edaf4690 Allow to install updates from the notification 2017-07-02 22:26:43 +02:00
Gabriele M
1e20caffc4 Throw an exception when trying to install unverified downloads
Don't silently ignore the request. This will allow to display some
useful message to the user.
2017-07-02 22:26:43 +02:00
Gabriele M
e7511d0041 Project init 2017-07-02 18:13:34 +02:00