UpdateEngine has a feature that verifies
payload without downloading the whole update package.
If UpdateEngine detects invalid payload,
the sample app aborts the update.
No JUnit tests, because it accesses files on the
device and migrating tests to robolectric
is not worth for this sample app.
Bug: 77150191
Test: device
Change-Id: Ib8ce73508a02cf5fdcb326d8ba46c1d05ed5efe5
It's moved from PrepareStreamingService intent service.
Now PrepareUpdateService takes an UpdateConfig and
builds PayloadSpec for UpdateEngine for both streaming
and non-streaming update.
It allows us to do all preparations in intent service's
thread, without blocking UI.
We will also add checksum verification to
PrepareUpdateService.
Test: device, junit
Bug: 77150191
Change-Id: I15c0bc58e3238bea6ea1c4f13063575e2def89c1
Merged-In: Iea69acd9aa41e17538c26aff60f7598093ca7744
It's moved from PrepareStreamingService intent service.
Now PrepareUpdateService takes an UpdateConfig and
builds PayloadSpec for UpdateEngine for both streaming
and non-streaming update.
It allows us to do all preparations in intent service's
thread, without blocking UI.
We will also add checksum verification to
PrepareUpdateService.
Test: device, junit
Bug: 77150191
Change-Id: Iea69acd9aa41e17538c26aff60f7598093ca7744
The instrumentation_for property takes the name a module, not the
name of a class.
Test: m checkbuild
Change-Id: I4671ed7b42696eb023052655c0ce7997d2b754f8
Currently sample app relies on onPayloadApplicationComplete
callback. It might not get invoked when app is unbound and
update is complete.
On the other hand, onStatusUpdate gets invoked always
(except when update_engine fails to init).
It's good to rely on onStatusUpdate callback to
reapply the update if it's IDLE but sample app state
is RUNNING.
- Add methods to ensure correct updater state.
- Update README.md.
BUG: 80205922
Test: on the device
Change-Id: Ic2f390e85af43556e227362321ab69f0ff146188
Signed-off-by: Zhomart Mukhamejanov <zhomart@google.com>
This class allows easily passing update data to
apply payload, re-applying the updata data,
and in the future persisting.
Test: on the device
Change-Id: Ie01c5f3384c421bf1180122f27811c644179e3f5
Signed-off-by: Zhomart Mukhamejanov <zhomart@google.com>
- Add util.UpdaterStates - the state of SystemUpdaterSample.
It's different from status of UpdateEngine;
when UpdateEngine#cancel is used to suspend the update,
UpdateEngine sets status to IDLE, which cannot be used
to track the suspended state.
- UI: Change 'Update status' to 'Engine status'.
- UI: Change 'Update completion' to 'Engine error code'.
- UI: Add 'Updater state'.
Test: manually on the device
Test: using JUnit4
Change-Id: I9c58b5ed0eae3be7ab8b217fc01a621e8fb2f4bf
Signed-off-by: Zhomart Mukhamejanov <zhomart@google.com>
- Add UpdateManager - responsible for the update logic.
Now ui.MainActivity is responsible for only UI.
- Create sample test for UpdateManager
- Remove MainActivityTest - now MainActivity is really simple.
- Add separate callback for progress update.
- MainActivity: UpdateEngine#bind/unbind on pause/resume.
Test: manually on the device
Test: using JUnit4
Change-Id: I1dba7c4ec74b1afb520be762413cfc261ccfbc08
Signed-off-by: Zhomart Mukhamejanov <zhomart@google.com>
PayloadSpecs has complicated methods, which makes hard
to test other dependent classes.
Making it non-static allows mocking it, which makes
testing other classes easier.
Test: manually
Test: using JUnit4
Change-Id: I818dc59c6bb0e7d131439d0d41f88d5cd9a451b4
Signed-off-by: Zhomart Mukhamejanov <zhomart@google.com>
- Add util/UpdateEngineProperties.java
- Set SWITCH_SLOT_ON_REBOOT=0 when update is applied
- Allow user to switch slot to the updated partition manually
- Add config "ab_config.force_switch_slot"
- Add ab_force_switch_slot to tools/gen_update_config.py
Test: manually on the marlin device
Bug: 79492522
Change-Id: I52f818b576d52a052b5427ba3f732cb2371ddb06
Signed-off-by: Zhomart Mukhamejanov <zhomart@google.com>
PayloadSpec
- add streaming generator and tests
- fix sample.json
- fix tests
- rename PackagePropertyFiles to PackageFiles, it has info
not only about property files, and new name is shorter
Bug: 77148467
Test: `mmma -j bootable/recovery/updater_sample`
Change-Id: I9c1206c07c37183f13d3c25940f12981ca85b1b4
Signed-off-by: Zhomart Mukhamejanov <zhomart@google.com>
This resource files are used in tests. ota package zip file
contains only text files.
Config files are generated using tools/gen_update_config.py
Test: N/A
Change-Id: I9d3d0f81472dc20db18b32f4a9445a998b68b0e3
Signed-off-by: Zhomart Mukhamejanov <zhomart@google.com>