Commit Graph

17 Commits

Author SHA1 Message Date
Gabriele M
d327d61cc6 Send an event when update are canceled
This allows to properly update the status of the application.
In particular, when an update is deleted:
 - Cancel the associated notification, if any.
 - Remove the entry from the controller if the update is no longer
   available online.
 - Disable the resume button if download is partially downloaded
   and is no longer available online.
2017-07-07 22:05:22 +02:00
Gabriele M
08a7dfade9 Track "online updates" rather than "local updates"
This is a preparation commit with no actual changes.
2017-07-07 22:05:22 +02:00
Gabriele M
ab9ac395f0 Use deleteUpdateAsync() even if we know the file doesn't exist
deleteUpdateAsync() is safe and it makes the code more readable at
the expense of an extra File.exists() call.
2017-07-07 22:05:22 +02:00
Gabriele M
217f84b57e Simplify handling of intentional download failures 2017-07-05 23:35:14 +02:00
Gabriele M
1795bd8b11 Report if a failure is following a download abort 2017-07-05 23:35:14 +02:00
Gabriele M
e245631b46 Add support for A/B (Seamless) System Updates
Loosely based on:
0465cb691d
2017-07-04 19:36:32 +02:00
Gabriele M
311b2f7cfd Replace DB entries on conflict
In this way we could add previously unknown info such as the size.
2017-07-04 19:05:04 +02:00
Gabriele M
320112dae4 Allow to choose the conflict algorithm when adding DB entries 2017-07-04 19:05:04 +02:00
Gabriele M
1e89ff8f8d Don't assume we always know the final size of the files 2017-07-04 19:05:04 +02:00
Gabriele M
653b577d61 Keep track of the number of updates being verified 2017-07-04 19:05:04 +02:00
Gabriele M
e7923a3d56 Keep track of the number of active downloads 2017-07-04 19:05:04 +02:00
Gabriele M
f0940dafca Verify package when resuming a completed download
It's possible to resume already completed downloads. When this
happens, starts verifying the package. Otherwise we won't be
able to resume the download since the server will likely reply
with 416.
2017-07-04 19:05:04 +02:00
Gabriele M
c4c5a72c75 Perform some database operations in separate threads
These operations shouldn't be frequent enough to require explicit
synchronization.
2017-07-04 19:05:04 +02:00
Gabriele M
fe18add111 Verify downloads in a separate thread 2017-07-04 19:05:04 +02:00
Gabriele M
c13d79b39c Use a Thread instead of an AsyncTask to delete downloads 2017-07-04 19:05:04 +02:00
Gabriele M
520105284c Rename some constants 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