* This replaces auto update check switch with a dropdown with 4 options:
* Never
* Once a day
* Once a week (default)
* Once a month
Change-Id: I4bcae4c013a5d44958f9c54d641e64aac3062a8b
This was meant to provide an upgrade path from the old app. It's
been almost a year now, this class is no longer needed.
Change-Id: I17c82e5877b275c5ceb3caefa28066abc170f095
Multiple update list downloads can happen simultaneously. Use
unique file names for the temporary jsons to avoid conflicts.
Change-Id: I751c9838394e1f5aebbe359f61532947b429f39b
Menu is not a good place to store preferences that have long strings
Change-Id: I84e782af33b2452c15998f7266c57d681dc8a377
Signed-off-by: Joey <joey@lineageos.org>
The version of OkHttp used in AOSP doesn't handle dynamic table size
updates [1] properly [2]. Instead of fixing OkHttp or importing a
prebuilt updated version, implement a new download client only using
HttpURLConnection, which seems to work properly.
[1] https://tools.ietf.org/html/rfc7541#section-6.3
[2] https://trac.nginx.org/nginx/ticket/1397
Change-Id: I3eedf7326f2017812c4a12d41f9ea028d255f7a8
The builds for each device are released more or less at the same
time of the day, so check when the last build was released and
schedule the next check accordingly. Also, allow multiple automatic
updates check in the same day. There's no need to limit the number
of checks since they are not frequent and this can affect negatively
the effectiveness of the new algorithm. In addition to that, remove
any pending oneshot alarm in case a subsequent check succeeds and
log every new alarm.
Change-Id: I4668f2e342e51d3578992eec6d8c270065d9aa21
Instead of disabling the action button, keep it enabled and make it
show a snackbar to inform the user about the impossibility of
installing the selected update.
The current argument is unused and it should have been removed
with commit 81229329f1
("Generate download clients using a builder class"). Instead of
removing it completely, use it to pass the File of the download.
This change allows to define a proper interface for the download
client and keep its implementation completely separate. It also
allows to create clients without starting the download right away,
which could be useful when defining callbacks that require a
reference to the client.
Note that this change also drops the unused methods of DownloadClient.
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.