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
- 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
This should prevent future changes from accidentally turning a
sticky service into a not sticky one.
Change-Id: I89f172626a98635149441a63536e0aa5a27f8280
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
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
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
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
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.
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.