History log of /system/update_engine/update_attempter_android.cc
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
8b01f44bf61c5cceb83b2ff4f2c0070a9ab946d7 21-Jul-2016 Alex Deymo <deymo@google.com> Remove libcurl support from update_engine_sideload.

While sideloading an update from recovery we don't need nor want to
download payload from HTTP(S) URLs, only local file:// are supported.
This patch moves libcurl_http_fetcher and certificate_checker files out
of libpayload_consumer dropping the libcurl and libssl dependencies from
it and the update_engine_sideload.

Bug: 27178350
TEST=build UE for Brillo and Android. Unittests still pass and
update_engine_sideload doesn't link to libcurl.

(cherry picked from commit 14c0da88a93aa7b1aa71d5e7e923b537f0d419f3)

Change-Id: I6195fc0a8ceedfc7fd1a92bdd0acc55ace2c1232
/system/update_engine/update_attempter_android.cc
578b787b0b83ae9a93ff77d4cd73d2f5d3e8994d 21-Jul-2016 Alex Deymo <deymo@google.com> Build update_engine_sideload.

Add a new "sideload" executable target that applies an update payload
directly using the UpdateAttempterAndroid.

This initial CL buils a dynamically linked program that's targeted to
run in the system image for now, but will later be transformed into a
static binary to run from the recovery environment.

Bug: 27178350
TEST=Applied a payload directly on a device using:
`update_engine_sideload --payload=file://foo/bar ...`

(cherry picked from commit 03a4de7dc77b058987fc0670f4f67ba10ff31bc8)

Change-Id: Idbde52fff9ace53c03f34103664f51b9db45027d
/system/update_engine/update_attempter_android.cc
b729f5c39691f254beb6fabc185a0db6e47542b9 26-Jul-2016 Alex Deymo <deymo@google.com> Allow to set the network used for an update attempt.

When triggering an update attempt in Android, we can force all the
traffic to go through a given network by passing a NETWORK_ID=<id>
in the extra key-value pair field.

Bug: 29921093
TEST=Called update_engine_client passing NETWORK_ID.

(cherry picked from commit 87792ea818a63f2d246bbba2b7429b85ee8d669f)

Change-Id: I0e8a245961788c75106832e9fea8b07cd894f22d
/system/update_engine/update_attempter_android.cc
01574ac3e9ed3875133c72fbf0140f06aa344ac7 20-Jul-2016 Alex Deymo <deymo@google.com> Reset the update progress when partition verification fails.

When the update completes and there is an error verifying the new
partitions we need to reset the update progress proactivelly to
prevent the update failing repeatedly until we hit the 10 retries
limit. This patch will reset the update progress when the payload
application fails to verify the contents of the newly written
partition.

Bug: 30162558
TEST=Push an update, cancel it at 90%, erase some blocks in system,
continue the update (restarts at 90% and then fails), launch the update
again (restarts from 0%).

(cherry picked from commit 5990bf33b50beec0caf55a97f5ca87608ccbc694)

Change-Id: Ie0b22bb190397aa342ca09d55c2b9dfd6ad5f239
/system/update_engine/update_attempter_android.cc
6e3ffe73d27de744ef494292c003b5ba907799df 27-May-2016 Alex Deymo <deymo@google.com> Fetch local files asynchronously.

This patch implements a new fetcher that only handles local files.
While libcurl supports file:// urls, the stream can't be suspended when
accessing local files.

This new FileFetcher is based on the brillo::FileStream class which
properly handles the asynchronous reads from regular files.

Bug: 28866512
TEST=Added unittest. Deployed an update from a file:// URL.

(cherry picked from commit 2c131bbf81d8c02ade163b939c96e44aa93765e9)

Change-Id: I9949a0f214de992c2fd86c1d73aca1c1792f0de0
/system/update_engine/update_attempter_android.cc
0ee98439a9f4fa1ff7a97050147d49528c99a9b3 10-Jun-2016 Alex Deymo <deymo@google.com> Include the Postinstall delegate in Android.

The UpdateAttempter in Android was missing the delegate setup for the
postinstall action, so the status updates from the postinstall script
were not showing up in the Binder interface.

Bug: 29223204
TEST=deployed an A/B update to an Android device with a postinstall script.

(cherry picked from commit b6eef73e20736b4b6a43611fa732d8bba72ff7ff)

Change-Id: I0bf421e2b8367c9672a89a872999a0c26b418293
/system/update_engine/update_attempter_android.cc
a918f9daede277d043e5b3b8443d712c88c949da 04-Jun-2016 Alex Deymo <deymo@google.com> Implement powerwash on Android.

Powerwash, the name for the equivalent of a factory reset or /data wipe,
can be triggered in Android by writing the desired command to the
recovery command file and rebooting into recovery.

This patch moves the powerwash scheduling/canceling logic to the
HardwareInterface and implements it on Android.

Bug: 28700985
TEST=Called update_engine_client passing POWERWASH=1, BCB is stored up
to offset 832.

(cherry picked from commit fb905d9b8d49f8fe41297c7aba2dd0942f1be311)

Change-Id: I66f9473c10fbe8f56e9000ce3e605b2bee345db8
/system/update_engine/update_attempter_android.cc
72ea95ab7705448b044cafc6b8cf2a2f4d929bd9 31-Mar-2016 Alex Deymo <deymo@google.com> Parse postinstall program progress updates.

In Android postinstall is expected to take a long time in common cases.
This patch allows the postinstall program to report back to the updater
a progress indication, which will then be forwarded to all the clients
listening. These progress updates are part of the FINALIZING status.

Bug: 27880754
TEST=Added unittests. Deployed an update to an edison-eng and post-install reported progress back with the postinstall_example.

(cherry picked from commit 0d29854cf5bb05a22cf161b50052539aa420a36e)

Change-Id: I003e996bd5a9acccfc83012345351174d269107c
/system/update_engine/update_attempter_android.cc
db13980bb42e544e3d19ef2b33ca02791abe2f6c 08-Mar-2016 Alex Deymo <deymo@google.com> Merge "Parse and use extra HTTP headers when downloading the payload." into nyc-dev
6f10c5f7c550b1bd6df1d9a04b5e75e03f943639 04-Mar-2016 Alex Deymo <deymo@google.com> Parse and use extra HTTP headers when downloading the payload.

Android OTA backend requires to pass an Authorization HTTP header in
order to download some payload. This patch allows to specify such
header when initiating a payload download from Android.

Bug: 27047110
TEST=Added unittests to check the headers sent.

(cherry picked from commit fdd6dec9c4be2fbd667cf874c4cc6f4ffecaeef9)

Change-Id: I59d38d79a7b7a8975d105c611c692522b6c33707
/system/update_engine/update_attempter_android.cc
f28585764e91b7c25a7c2856ff645c8bb22d64a9 25-Feb-2016 Alex Deymo <deymo@google.com> Implement suspend, resume and cancel the download.

The DownloadAction can now be suspended and resumed, using the existing
libcurl hooks to pause the download. For canceling an ongoing update,
this patch leverages the existing StopProcessing method previously used
in unittest only with a slight change: Stopping the ActionProcessor
also removes all the pending actions.

The LibcurlHttpFetcher Pause/Unpause methods where improved to support
(not crash) if paused in circumstances where there isn't a current
connection, like when waiting for the proxy resolver and when trying to
reconnect.

Finally, the value of ongoing_update_ is now properly set in the
UpdateAttempter.

Bug: 27047026
TEST=Tested suspending, resuming and canceling the update on a device.
TEST=Added unittest for the Pause/Unpause logic.

Change-Id: I0df1e1a8cf70a3b736bc9cd4899d37813f381b94
/system/update_engine/update_attempter_android.cc
f25eb491ff60f21659a7e2b230ee1c83957034c7 26-Feb-2016 Alex Deymo <deymo@google.com> Fix resuming canceled updates.

Resuming an interrupted update was broken in several ways. First,
DeltaPerformer::CanResumeUpdate was checking for the number of
resume-failures to be more than the limit, not less. Then, the
resume logic didn't work for payload v2 when there was a
metadata signature included in the payload. Finally, resuming an
update after reading the payload signature (in payload v2) was not
updating the checkpoint, but storing the signature causing it to
attempt to parse it again and fail.

Bug: 27047026
Bug: chromium:590410
TEST=Manual procedure:
1. Start an update: update_engine_client --update ...
2. Cancel the update: update_engine_client --cancel
3. Re-start the same update: update_engine_client --update ...
-> The update should resume from the previous point.

Change-Id: I60134de155aa073a7ba91174cceea7297e5f8d17
/system/update_engine/update_attempter_android.cc
64d9878470aa7b388e971862181daf6260851602 06-Feb-2016 Alex Deymo <deymo@google.com> Replace is_full_update boolean with a payload_state enum.

The "is_full_update" flag in the InstallPlan is required to decide
whether we should run a FilesystemVerification step before start
downloading the payload (for delta payloads) or not (for full payloads).
This step is done before start downloading the payload and not after
downloading the metadata to avoid long delays in the connection which
would then drop and require a retry.

Since the not so recent inclusion of the source_data_hash field in the
delta operations, the source data is verified on each operation, so the
install plan field and the pre-download FilesystemVerification is not
needed anymore.

To help deprecate this process, which is not included in the non-Brillo
version, this patch changes the is_full_update field to a payload_state
enum with a third "unknown" state that will be changed to delta or full
once the payload metadata is parsed.

Bug: 25631949
TEST=unittests updated.
TEST=Pushed a delta update to edison-eng and a non-Brillo target.

Change-Id: I17d8bf58990d8465bb8487adc66601f1c1dfca6d
/system/update_engine/update_attempter_android.cc
3b678db2e7fd4baa38c6d6b8bb8334f7d88b8682 09-Feb-2016 Alex Deymo <deymo@google.com> Implement a new resetStatus() method in Android interface.

When an alredy applied update is deleted from the server (normally
because is was detected to be a bad update), we need to go back to
the idle state and remove the update to prevent it from breaking
more devices.

This patch allows the application side to reset the applied update
back to idle.

Bug: 27081760
TEST=Deployed on a non-Brillo device, sent resetStatus.

Change-Id: I1bf5a141388250d225515e40f13bc3564fa5d957
/system/update_engine/update_attempter_android.cc
0e061aebc651e041b6d1d8a3a91834feb87e0d62 10-Feb-2016 Alex Deymo <deymo@google.com> Send an initial status update notification on bind().

When the client calls bind(), this patch now sends an initial status
update so the client can react to the status update that could have
been sent before it called bind().

Bug: 27108108
TEST=`update_engine_client --follow` shows the initial status.

Change-Id: Ifbf056ebb66da17c9e60244561340b3e1ccd4232
/system/update_engine/update_attempter_android.cc
218397ff42cbef9f1b95fdfe30e8e82145ba9908 05-Feb-2016 Alex Deymo <deymo@google.com> Android: Parse extra properties passed to applyPayload().

The Android binder interface allows to pass extra key-value pairs with
the payload hash and size and the metadata size. This patch now parses
these values from the passed parameters.

Bug: 26991255
TEST=`update_engine_client --update --headers="FILE_SIZE=1234
METADATA_SIZE=123
"`

Change-Id: I5206511701a07c6f659c84aa77c4ebe3f213e4c3
/system/update_engine/update_attempter_android.cc
0fd51ff8fd200aab7f9ab930b47736505a7b59c3 03-Feb-2016 Alex Deymo <deymo@google.com> Android: Support offset different from 0.

The non-Brillo update workflow expects to pass an offset that can be
different from 0. This patch uses this base offset to fetch the right
subset of the paylod URL.

Bug: 25631949
TEST=Deployed on a device. Passing --offset to udpate_engine_client makes the HTTP request include the offset.

Change-Id: I8f37907fff6feb8d9e654cb1cbcf7b9dac3217e2
/system/update_engine/update_attempter_android.cc
5e3ea278d9e771be3b51bd72985ad582678baddc 28-Jan-2016 Alex Deymo <deymo@google.com> Android: Implement the update attempter for Android.

This patch implements the update workflow for non-Brillo targets. Only
the applyPayload() method is implemented here with a minimal subset of
functionally implemented in it. This new class acts as the service
delegate, handling all the binder service method calls for non-Brillo
targets.

Bug: 25631949
TEST=FEATURES=test emerge-link update_engine
TEST=`mmma system/update_engine` on aosp_arm-eng and edison-eng
TEST=Deployed on a non-Brillo device and tested with update_engine_client

Change-Id: I678cd141633bc2c0920a09ef27a02d53682d5330
/system/update_engine/update_attempter_android.cc