History log of /system/update_engine/update_attempter_android.cc
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
c1a0a40028c997551b774a5c46256df4c9cd3590 19-Oct-2017 Sen Jiang <senj@google.com> Add SafetyNet logging for payload timestamp error.

Bug: 36232423
Test: mma

Merged-In: Ica752e24e78e84350e13c66a2a0a56092f232d0b
Change-Id: Ica752e24e78e84350e13c66a2a0a56092f232d0b
(cherry picked from commit b75539b3ee05aa07b107fd711f010af54a80b0f2)
(cherry picked from commit c2edd69550306c42b8140ffe3035111fcbe52181)
/system/update_engine/update_attempter_android.cc
772470ab385b5f5d748390943e5cc5db18c40374 13-Sep-2017 Sen Jiang <senj@google.com> Error out if SetProcessNetwork fails.

If the network disconnected between when acquireApnNetwork succeeded
and when SetProcessNetwork is called, then the download would have
gone on the system default network.

Bug: 65562632
Test: mma
Change-Id: Ie696c77a33cec1c772650df279e67bf21d4c1b88
(cherry picked from commit cbd37c68ca69ceec25a9609c0c36fa30ee707f6d)
/system/update_engine/update_attempter_android.cc
2d1c87bbd55878c5b4dd93e97a8cc28e715137ec 14-Jul-2017 Sen Jiang <senj@google.com> Fix crash in UpdateAttempterAndroid.

Bug: 63688814
Test: no crash in logcat
Change-Id: Ib98f65d5a3d0a049609f9436532bce376f81c70d
/system/update_engine/update_attempter_android.cc
cdd5206c6507fa5c70344c269053d30777f7d674 19-May-2017 Sen Jiang <senj@google.com> Support IsDeltaPayload per <package>.

Mixed full and delta payloads are now supported for multi-payload.

Bug: 36252799
Test: update_engine_unittests
Change-Id: Ic519f8399579c714a65ba9f9f948a389fcc249ed
(cherry picked from commit 4928112f8635f7a5b583171640aee2bda690ba34)
/system/update_engine/update_attempter_android.cc
5ae865b431cc041feed82f1db28a38e99dbd631f 18-Apr-2017 Sen Jiang <senj@google.com> Resume multiple payloads.

DownloadAction will first go through all the already applied payload
and only downloading the manifest and filling in partitions info in
install plan without applying or downloading any operations.
And then resume the partially applied payload using states in prefs.

Moved constuction of MultiRangeHttpFetcher from UpdateAttempter to
DownloadAction, because we now need to setup the range for every
payload, also reduced code duplication.

Also fixed download progress for multi payload.

Bug: 36252799
Test: stop an update during second payload and resume the update
Change-Id: I9ee54a87d15d88c7a14a13575965b19c1773340b
(cherry picked from commit 7162b666318cdd6c75b73fa6a0b06b23559de3e5)
/system/update_engine/update_attempter_android.cc
0affc2c099fac47b999ba39f8f1bacb418e65a97 11-Feb-2017 Sen Jiang <senj@google.com> Parse multiple packages from Omaha response.

The multi-payload info are stored in OmahaResponse and InstallPlan, but
we still can only apply the first payload for now.

Bug: 36252799
Test: mma -j
Test: update_engine_unittests

Change-Id: I5ca63944ae9082670d0e67888409374f140d4245
(cherry picked from commit 2aba8a87d4fac245a2e2d238b3159f8eabce630f)
/system/update_engine/update_attempter_android.cc
2703ef4466066d64d8021904e233b120f38c0272 16-Mar-2017 Sen Jiang <senj@google.com> Store raw payload hash blob in install plan.

We were using a custom sha256 pair in Omaha response, now that Omaha
has a standard hash_sha256 field in package, we should use that instead.

The difference is that hash_sha256 is encoded in hex instead of base64,
but the android payload property is still using base64, to be backward
compatible, we have to keep accepting base64 there, to avoid decoding
and then re-encoding to another encoding, we store the decoded raw hash.

Also removed the hash() related functions in HashCalculator, since it's
rarely used and the caller should encode it in whatever encoding they
want.
Also make use of RawHashOfBytes to simply code in a few places.

Bug: 36252799
Test: update_engine_unittests
Change-Id: Iaa02611b4c9cda3ead5de51e777e8caba6d99d93
(cherry picked from commit f14d51b6823522f6b2eb834f9e14d72c8363a3ad)
/system/update_engine/update_attempter_android.cc
56db75ded7891f863463def26c938b6eee1b1b6f 19-May-2017 Sen Jiang <senj@google.com> Remove call to cpu limiter in Android.

Bug: 38449575
Test: mma

Change-Id: I1f861c960491c2d0d691f50ef0193d17e33c3b79
/system/update_engine/update_attempter_android.cc
5259033d23938ce3ce20e4a9b599be0eec113610 30-Nov-2016 Alex Deymo <deymo@google.com> Mark current slot successful after cancelling an update.

When cancelling an update that was completed and pending reboot, we
need to rollback the "SetActiveSlot(the_other_slot)" action performed
when the update was applied. We used to just mark the current slot as
active, which should switch the priorities to make the current slot the
priority one.

This patch also marks the current slot as successful after marking it as
active since the action of marking a slot as active in the HAL might
reset the successful bit. The current slot must have already been marked
as successful because an update was applied, so this wouldn't mark a bad
slot successful.

Bug: 33102712
Test: Manual test: deployed an update, cancelled it with --reset_status
and checked that the current slot is still marked as successful.

Change-Id: I0e3296446e811b5efbee7791565710fc1fa3a8dd
/system/update_engine/update_attempter_android.cc
14c0da88a93aa7b1aa71d5e7e923b537f0d419f3 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.

Change-Id: Iffefdb094654f7277dc825c041fe55aac9ee8756
/system/update_engine/update_attempter_android.cc
03a4de7dc77b058987fc0670f4f67ba10ff31bc8 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 ...`

Change-Id: I289a724d013abdc390187d669dccd3edf2fd3434
/system/update_engine/update_attempter_android.cc
87792ea818a63f2d246bbba2b7429b85ee8d669f 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.

Change-Id: I13becdd133cccc912b542d48061fcfe9f566099a
/system/update_engine/update_attempter_android.cc
f1cf34849efdc0158fb1987ba74a51f25016c5bd 19-Jul-2016 Luis Hector Chavez <lhchavez@google.com> update_engine: Update libchrome APIs to r405848

The new libchrome has been ported from Chromium and some APIs have
changed. Make necessary changes at call sites.

Notable changes from libchrome:
- base::Bind() now explicitly disallows captures in lambdas (which was
never allowed in the style guide), so lambdas should now be written in
a way that take the captures as parameters.

Bug: 29104761
Test: All tests in update_engine_unittest pass on dragonboard-eng build
Change-Id: Iec04c126630fd876114076e3cb10cf917c8817b0
/system/update_engine/update_attempter_android.cc
5990bf33b50beec0caf55a97f5ca87608ccbc694 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%).

Change-Id: I35915d04efe5c90d1a7add2e4c2807e2fe19857b
/system/update_engine/update_attempter_android.cc
2c131bbf81d8c02ade163b939c96e44aa93765e9 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.

Change-Id: Ie9d07dda2d773312e55be3c0ab7c9e5b737be18b
/system/update_engine/update_attempter_android.cc
b6eef73e20736b4b6a43611fa732d8bba72ff7ff 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.

Change-Id: Ifd086704d1161f348bf0dd405a6a9d9cb8b69990
/system/update_engine/update_attempter_android.cc
fb905d9b8d49f8fe41297c7aba2dd0942f1be311 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.

Change-Id: If737fd4b9b3e2ed9bce709b3b59f22e9f0a3dc9a
/system/update_engine/update_attempter_android.cc
e6e4bb929acd73e57b68a30d1e3a33d76607aec3 05-Apr-2016 Sen Jiang <senj@google.com> Remove BootControlInterface from FilesystemVerifierAction.

update_engine now only runs FilesystemVerifierAction after DownloadAction,
the partition paths are already set in InstallPlan, so we no longer need
BootControlInterface to get partition paths in FilesystemVerifierAction.

Test: ./update_engine_unittests
Test: applied an update in edison
Bug: 26972259

Change-Id: I9d439688a21e4e42be88a4c5accf731ce64d2d6f
/system/update_engine/update_attempter_android.cc
fef85fd9ece49941db274559a938fe8b2c5157bf 25-Mar-2016 Sen Jiang <senj@google.com> Remove ComputeSourceHash mode in FileSystemVerification action.

This mode was used to calculate the source partition hash before download
the payload, and we will verify it against the hash in the payload.
Now that we are using per-operation source hash, this mode is no longer
needed.

Test: ./update_engine_unittests
Test: cros_workon_make update_engine --test
Bug: 26972259

Change-Id: Ie30a38cfd9f94e4efe02dfc8664e6785018261f6
/system/update_engine/update_attempter_android.cc
0d29854cf5bb05a22cf161b50052539aa420a36e 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.

Change-Id: I35f96b92f090219c54cca48d8ab07c54cf8b4ab1
/system/update_engine/update_attempter_android.cc
fdd6dec9c4be2fbd667cf874c4cc6f4ffecaeef9 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.

Change-Id: Iece7e0ee252349bbaa9fb8545da2c34d2a76ae69
/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