Commit graph

21 commits

Author SHA1 Message Date
Tao Bao
d2be7fc29a updater_sample: Move to Soong.
Test: Follow the steps in "Running tests" in updater_sample/README.md.
Change-Id: I70c3239e3daea0dcdadf02f68abe7d6aafa67a2e
2018-08-10 09:05:56 -07:00
Zhomart Mukhamejanov
65dcf32274 updater_sample: add privileged system app docs
README.md: add instructions

Test: on device
Bug: 80250430
Change-Id: I2e04fdefda2b73d01dfa0a8e684542feb2ed6c61
Signed-off-by: Zhomart Mukhamejanov <zhomart@google.com>
2018-06-18 10:31:18 -07:00
Zhomart Mukhamejanov
aa7abc0359 updater_sample: add proguard.flags
Test: on device
Change-Id: Ia8582053b7330d06e618f2555332cfb2a89b3df8
Signed-off-by: Zhomart Mukhamejanov <zhomart@google.com>
2018-06-18 10:16:19 -07:00
Ian Pedowitz
c02fb99e1d Revert "updater_sample: add proguard.flags"
This reverts commit 8c3af4aa8c.

Reason for revert: Broke Master

Change-Id: I37bceeea630fb7db39efa25d03ababe3d84cdfbf
2018-06-14 06:35:18 +00:00
Zhomart Mukhamejanov
8c3af4aa8c updater_sample: add proguard.flags
Test: junit
Change-Id: I0175271935fdd87dd49ad9936d0e1b550d164e05
Signed-off-by: Zhomart Mukhamejanov <zhomart@google.com>
2018-06-13 09:53:29 -07:00
Zhomart Mukhamejanov
8a6a86a101 updater_sample: fix payload spec tests
Test: junit4
Change-Id: Ia2f7475cfba01a65486bb0e5d0f3976304ca0969
Signed-off-by: Zhomart Mukhamejanov <zhomart@google.com>
2018-06-07 12:07:20 -07:00
Zhomart Mukhamejanov
469b35a457 updater_sample: improve updater state handling
- Enable more UpdaterState transitions.
- MainActivity: Improve UI states.
- UpdateManager: fix status handling errors, add
  suspend/resume methods.
  Add "synchronize this" to public control (suspend, cancel, ..)
  methods.
- Add several UpdateManager tests.

Test: on device
Test: JUnit4
Change-Id: Id7f85dfaa466fa0d6136eee39e9fd7658278c616
Signed-off-by: Zhomart Mukhamejanov <zhomart@google.com>
2018-06-04 14:23:37 -07:00
Zhomart Mukhamejanov
6f26e71263 updater_sample: create UpdateManager
- 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>
2018-05-23 15:37:43 -07:00
Zhomart Mukhamejanov
b0361ffa3e updater_config: make utils/PayloadSpecs non-static
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>
2018-05-18 10:38:33 -07:00
Zhomart Mukhamejanov
238beb7373 updater_sample: add switch slot demo
- 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>
2018-05-17 16:29:57 +00:00
Zhomart Mukhamejanov
bb8a215138 updater_sample: fix UpdateConfig
- fix UpdateConfig
- fix smaple.json
- fix FileDownloaderTest

Test: manually
Change-Id: I09d272f77c89a02f54a24cf753fdfda4ce243927
Signed-off-by: Zhomart Mukhamejanov <zhomart@google.com>
2018-05-10 12:19:16 -07:00
Zhomart Mukhamejanov
96eb59e4b1 updater_sample: update tools
- Allow gen_update_config.py to use ota_from_target_files from
  $ANDROID_BUILD_TOP/build/make/tools/releasetools/
- tests/res/raw/ota_002_package.zip re-generated using functions from
  $ANDROID_BUILD_TOP/build/make/tools/releasetools/test_ota_from_target_files.py
- sample app tests updated

Test: ./tools/gen_update_config_test.py
Change-Id: I5c492ec22782ba54fe481f592a44e797c695684e
Signed-off-by: Zhomart Mukhamejanov <zhomart@google.com>
2018-05-08 21:13:34 +00:00
Zhomart Mukhamejanov
e606f6d3ff updater_sample: update tests
- fix tools/gen_update_config.py
- add tests for PayloadSpecs#forStreaming

Test: junit4
Change-Id: Ife1980c5f72944ed35500aa820b30031fc99e820
Signed-off-by: Zhomart Mukhamejanov <zhomart@google.com>
2018-05-03 14:04:16 -07:00
Zhomart Mukhamejanov
f7a70388ee updater_sample: update ui and README, clean-up
- ui: add text view for latest completion (error) code
- update README.md
- update MainActivity.java
- remove AbNonStreamingUpdate

Test: mmma bootable/recovery/updater_sample
Change-Id: Ie9bb64211c57d536036b04f13896e4937c392b6e
Signed-off-by: Zhomart Mukhamejanov <zhomart@google.com>
2018-05-03 14:59:45 +00:00
Zhomart Mukhamejanov
da7e237596 updater_sample: Add streaming to PayloadSpec
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>
2018-05-02 12:40:49 -07:00
Zhomart Mukhamejanov
93535dd033 updater_sample: add FileDownloader
Test: unit tests

Change-Id: I10933e7172d7ebc34c7cf5e4274625d7b8399246
Signed-off-by: Zhomart Mukhamejanov <zhomart@google.com>
2018-05-01 12:08:18 -07:00
Zhomart Mukhamejanov
963e3eeb00 updater_sample: Improve UpdateConfig
UpdateConfig:
- constant names changed
- added parsing streaming metadata
- added InnerFile to describe a file in zip

Android.mk
- added guava

tests fixed

Test: using junit4

Change-Id: Ibe3c8a3bde20259b0eea9a79aca4b22ed7b048f4
Signed-off-by: Zhomart Mukhamejanov <zhomart@google.com>
2018-05-01 10:24:57 -07:00
Zhomart Mukhamejanov
72a4d465bf updater_sample: fix gen_update_config.py
Fix gen_update_config.py.
And add tests for gen_update_config.py.

Test: python3 updater_sample/tools/gen_update_config_test.py

Change-Id: I0d270f1d5d7635855ee9acb0dd094e083cd33e3a
Signed-off-by: Zhomart Mukhamejanov <zhomart@google.com>
2018-04-26 19:40:48 -07:00
Zhomart Mukhamejanov
02e912c235 sample_updater: add tests resources
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>
2018-04-25 18:18:46 -07:00
Tao Bao
daa65aed99 updater_sample: Use stubs libs for android.test.base / runner.
To address the warning below (which will be disallowed):
bootable/recovery/updater_sample/tests/Android.mk: warning:
SystemUpdaterSampleTests (java:system) should not link to
android.test.runner (java:platform)

(See b/69899800 or the commit message in [1] for detailed discussions.)

[1]: https://android-review.googlesource.com/c/platform/frameworks/ml/+/666428

Test: `mmma -j bootable/recovery` gives no warning.
Test: Install and run SystemUpdaterSampleTests on device.
Change-Id: I12a1556d572d9f332fcf43dc84cbe8fd1b6df89b
2018-04-25 15:59:53 -07:00
Tao Bao
32118f6690 Rename the dir for SystemUpdaterSample.
Also replace the occurrence in README.md and PREUPLOAD.cfg.

Test: mmma -j bootable/recovery
Change-Id: I04c0ef00dd64f49e008ad2a4a2c1e8eaed76bf8d
2018-04-25 15:34:37 -07:00