Commit Graph

22 Commits

Author SHA1 Message Date
Gabriele M
ce4b02697f Show in app reboot button
Change-Id: I8d65746b58c16a7cf4a430ea29bb7b0fba1802d5
2018-06-13 23:30:08 +02:00
Gabriele M
4d5e82b885 Handle install errors from onPayloadApplicationComplete()
When the installation terminates because of an error, update_engine
sets the status to IDLE and sends a notification. Thus, we might
miss the error report and never update the status of the update.

Change-Id: Ic1536b1c157c4dab0128f039f9512f2fb734287d
2018-04-05 16:37:49 +02:00
Gabriele M
a409a4a03d Clear NEEDS_REBOOT preference on reboot
UpdateEngine doesn't send an initial notification to bound client
if the last status is not known, so clear the preference when we
detect that the device has been rebooted.

Change-Id: Ib15dff5fa8ac9ec07a68018a83683cc561fd3e85
2018-04-05 16:37:49 +02:00
Gabriele M
eecdf389ef Set status to INSTALLING when reconnecting to the service
Otherwise the service won't run in foreground after restarting
the app while an update is being installed.

Change-Id: I8a75d206ead2945e7326c144b0b4354fbb2accb4
2018-04-05 16:37:49 +02:00
Gabriele M
28644b3491 Don't register multiple UpdateEngine callbacks
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-04-05 16:37:49 +02:00
Gabriele M
69e65ca4bf Remove duplicate INSTALLING notification
Change-Id: Ia1515aef1a24a5d54143e1423ae96f09163625bc
2018-04-05 16:37:46 +02:00
Roman Birg
31057295dc Updater: fix wrong preference key in A/B installer
We are referencing the wrong key for deciding whether to delete the
update on reboot.

Change-Id: If83d278259291b61c26302bdd59c2774901b18ca
Signed-off-by: Roman Birg <romanbirg@gmail.com>
2018-03-07 02:55:32 +00:00
Gabriele M
63f6fd1a70 Report installation failures
Change-Id: I5e11db1e6e338a510b3c1c7d16f8c085d874a9db
2018-01-23 22:41:40 +01:00
Gabriele M
e66a8fa53a Keep track of the installation status of AB updates
This allows to show the correct labels.

Change-Id: I52f42e042af0df2d091d786c03102cec352b3a5b
2018-01-23 22:41:40 +01:00
Gabriele M
c5f36ee047 Don't allow any operation if a reboot is needed
Change-Id: I175525071faa44f30b8f2bbf36da56a2e6f2dd1b
2018-01-23 22:41:40 +01:00
Gabriele M
8e369117bf Allow to cancel ongoing installations
Change-Id: I46884b42b6e3f87fbee99a23f538cec990b3b873
2018-01-23 22:41:40 +01:00
Gabriele M
f3d9b3f1b2 Allow service restarts while installing AB updates
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-23 22:41:40 +01:00
Gabriele M
6088f26f53 Wait for the UPDATED_NEED_REBOOT status
Consider an update as installed only when update engine reports that
the device needs to be rebooted. This change also move the entire
logic in onStatusUpdate(), which reports all we need to properly
track the progress of the installation.

Change-Id: Ic8db00cccdd19fd62ba4dee31fd1dccc9037193d
2018-01-23 22:41:40 +01:00
Gabriele M
8768daddf0 Add option to delete updates when installed
This is mostly useful on encrypted devices since it allows to not
copy the update before installing it.
2017-07-22 20:38:20 +02:00
Gabriele M
1e2f353b55 Rename UpdateDownload and Update classes 2017-07-21 17:04:12 +02:00
Gabriele M
11f82cfb87 Reorder includes directives
These went out of order moving some stuff around. Reorder them so
that there won't be unnecessary line changes in future.
2017-07-21 01:17:19 +02:00
Gabriele M
82dbc8fde3 Remove a couple of extra semicolons 2017-07-18 22:17:29 +02:00
Gabriele M
af1e9c4478 Create model package 2017-07-18 22:15:13 +02:00
Gabriele M
12688ba761 Allow to check if an update is of type AB from anywhere 2017-07-16 22:52:45 +02:00
Gabriele M
f94846674f Allow to check if an AB update is being installed 2017-07-16 21:24:07 +02:00
Gabriele M
1c1bac67b4 Protect the data of UpdaterController
Create copies of the objects not to allow other classes change them,
excluding those of controller package.
2017-07-08 22:10:59 +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