summaryrefslogtreecommitdiff
path: root/src/org/lineageos/updater/controller/UpdaterService.java
AgeCommit message (Collapse)Author
2022-06-29Updater: Show update's version on AlertDialog and NotificationAayush Gupta
Currently at most of the places, build version is obtained from BuildInfoUtils.getBuildVersion() method. This method obtains build version from the current running system's property. However, in case there is a version bump on OTA, this logic results in wrong version being shown to the user while updating/upgrading the system. Get the version from the update itself to show the proper version in update notification and pre-install warning. Signed-off-by: Aayush Gupta <theimpulson@e.email> Change-Id: Ia74085d8d7c067c408e7cfce1de90d49dcc68307
2022-02-10Updater: The great cleanupMichael W
* Make final where possible * Remove unused casts, imports, methods, enums and constructors * Add null checks Change-Id: Idd1a16426dd1928e2ed9922f5a35ba32ce4f808b
2021-10-11Updater: Add FLAG_IMMUTABLE flag to PendingIntentMichael Bestas
Fixes: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent. Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles. Change-Id: I63b25512d3bf6e0d3b0cc95d91295f4065175848
2020-04-11Only cancel notification if update isn't installedLuca Stefani
* Even if the package is removed on A/B devices we still want to show the reboot notification Change-Id: I980d36766a1427874b65b11674a8f0ae4ce1db88
2020-04-02Updater: Delete updates only after refreshing the notificationMichael W
* Looks like we first need to process the notification before we can delete an update Change-Id: I49f6c03a109f908e8a7b01f02b821a68ab273af3
2019-09-07Updater: Move to AndroidXLuca Stefani
Change-Id: I7bd67915638db5330b854f66f9fc1adb864b64be
2019-04-10Updater: Allow to suspend A/B updatesLuca Stefani
Change-Id: I0387fd491a07a2214e4331a2cfe25988e0016a61
2018-07-14Don't use one shot PendingIntents for the notification actionsGabriele M
FLAG_ONE_SHOT doesn't make so much sense here, the intents are generic and can be repeated. Change-Id: Ib457d975387dfd838372639e2aaa40a3df6f4d15
2018-06-13Minor app notification improvementsGabriele M
- Don't use BigTextStyle if we only need to show a single line of text, but keep using it if the progressbar is visible. - Change the icon to reflect the currrent state. - Use android.R.drawable instead of com.android.internal.R.drawable Change-Id: I0f69fe5f4fa63cdec180e89afa098d27819f33fd
2018-06-13Turn UpdateInstaller into a singletonGabriele M
For symmetry with ABUpdateInstaller. Change-Id: I9b61ed286c91f10140705e7b3e24b0eab0c75f49
2018-06-13Remove Controller interfaceGabriele M
This is just useless as is. Change-Id: I957ea3bda4097ccb8d730943639cd5e74b1b2440
2018-04-21Allow to properly translate the download ETA stringGabriele M
Change-Id: Ie6bbbddbbd9fd7adbc16472ad9c42c1d257413a1
2018-04-05Use single return statement in onStartCommand()Gabriele M
This should prevent future changes from accidentally turning a sticky service into a not sticky one. Change-Id: I89f172626a98635149441a63536e0aa5a27f8280
2018-04-05Prevent NPE on A/B devicesGabriele M
The NPE shouldn't happen as we get a null intent only when the service is sticky (i.e., isInstallingUpdate() is true), so this is currently not a problem. Change-Id: I8647498d9a1022f5c7207a2da3e42cf57d9ee030
2018-04-05Don't register multiple UpdateEngine callbacksGabriele M
We are loosely tied to UpdateEngine and have no way to know whether we are bound or not without keeping track of the connection manually. Since UpdaterService is for both A/B and legacy updates, turn ABUpdateInstaller into a singleton to keep the code simple while ensuring that a single callback is registered. Change-Id: Ib4e9ad1413ba96bf5ed59cc3383741b5c9bac427
2018-01-23Updater: Add notification channelsHarry Youd
Change-Id: I2f538fb47fe90e1008bf286739d33c829123353a
2018-01-23Remove progress from notification when doneGabriele M
Change-Id: If49c8d0ca2270f22dcc5350379f1bb1f34f02041
2018-01-23Report installation failuresGabriele M
Change-Id: I5e11db1e6e338a510b3c1c7d16f8c085d874a9db
2018-01-23Copy the updates for uncrypt using a ServiceGabriele M
Same as change I488018d01c0baf74660362a384e53bfe5d85de2b ("Use a service to export the updates"). While at it, move the code out of UpdaterService to better separate the code that deal with AB updates and regular updates. Change-Id: I2bc3e78e80f5e63c57303cbbcdc0353dbab0f67f
2018-01-23Keep track of the installation status of AB updatesGabriele M
This allows to show the correct labels. Change-Id: I52f42e042af0df2d091d786c03102cec352b3a5b
2018-01-23Allow to cancel ongoing installationsGabriele M
Change-Id: I46884b42b6e3f87fbee99a23f538cec990b3b873
2018-01-23Allow service restarts while installing AB updatesGabriele M
The update engine service is independent and once started doesn't need our service to install updates. Therefore we can't assume that our service will stay up as long as the installation is being performed. If the service gets terminated while an update is being installed, we simply lose our connection to the update engine service and stop receiving notifications, the installation itself won't stop. Keep track of ongoing installations using a shared preference and use a sticky service when installing updates. The service will try to re-connect to the update engine service and determine if the installation is still ongoing. Change-Id: Id2fc11cab51610d04bf41a0927824bb8c0c94d71
2018-01-23Show progress when installing AB updatesGabriele M
Change-Id: If8cd2e2da1f15a4af415aa35ccf61052c318333f
2018-01-23Stop service when pausing downloadsGabriele M
Change-Id: Ibb77c7f0d4309874fcfa591d12b5e6ce4a6d6abc
2018-01-18Use the right preference for the auto-delete optionGabriele M
Change-Id: Iac7e838e8ecf1e5ed27bb0c9587442aa2ec8ffec (cherry picked from commit 8ff6f57e7bb353e9daeb2cfa279b349a8b560538)
2017-11-12Don't stop service while installing AB updatesGabriele M
Change-Id: I2e5eaffa2b64ce8d387958b070a23f393f827c5e
2017-08-08Dismiss some notifications when clickedGabriele M
2017-08-07Remove duplicate iconGabriele M
ic_tab_install is basically the same as ic_system_update. The only difference is the color, but that doesn't really matter.
2017-07-26Actually check if an OTA is encryptedGabriele M
2017-07-22Add option to delete updates when installedGabriele M
This is mostly useful on encrypted devices since it allows to not copy the update before installing it.
2017-07-21Create a copy of the zips on encrypted devicesGabriele M
On encrypted devices, uncrypt modifies the zip so that it can be read without mounting the filesystem. Instead of installing the zip downloaded, create a copy of it which will be deleted. This will allow to re-install the zip multiple times or export it after installing it.
2017-07-21Define interfaces with only getters for the updatesGabriele M
This also changes the code to use the new interfaces wherever the update is not supposed to change.
2017-07-21Reorder includes directivesGabriele M
These went out of order moving some stuff around. Reorder them so that there won't be unnecessary line changes in future.
2017-07-18Rename UpdaterControllerInt to ControllerGabriele M
2017-07-18Remove a couple of extra semicolonsGabriele M
2017-07-18Add own formatDuration() methodGabriele M
DateUtils.formatDuration() is not public, so create our own version.
2017-07-18Create model packageGabriele M
2017-07-18Use UTC timezone for the build datesGabriele M
2017-07-17Don't use the filename as notification titleGabriele M
Be consistent with the rest of the app and use "version - date".
2017-07-16Ask for confirmation before installing updatesGabriele M
Since there's no quick and clean way to show a dialog from a serivice, don't allow to install updates from the notification.
2017-07-16Allow to check if an update is of type AB from anywhereGabriele M
2017-07-16Install updates from UpdaterServiceGabriele M
This allows to easily handle AB updates.
2017-07-07Send an event when update are canceledGabriele M
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-04Add support for A/B (Seamless) System UpdatesGabriele M
Loosely based on: https://github.com/LineageOS/android_packages_apps_CMUpdater/commit/0465cb691de5acd2f459ce0687b988ddf050b354
2017-07-04Disable indeterminate progressbar in case of download errorGabriele M
Similar to the 'paused' case, but take into account that the error can happen when the progress is 0, in which case we just hide the progress bar.
2017-07-04Minor code refactoringGabriele M
2017-07-04Rename some constantsGabriele M
2017-07-04Don't make UpdaterService stickyGabriele M
We are using it as non-sticky service, so just declare it as such.
2017-07-04Replace 'Download' prefix with 'Updater'Gabriele M
These classes do more than controlling the download of the updates.