summaryrefslogtreecommitdiffstats
path: root/updater_sample (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Move ab_streaming_metadata under ab_config.Zhomart Mukhamejanov2018-08-2211-103/+115
| | | | | | | | | Add new config: ab_config.verify_payload_metadata. Change-Id: I521dff92166c33dd9c2efa498dc599fe4bc83fde Signed-off-by: Zhomart Mukhamejanov <zhomart@google.com> Test: mmm, junit Bug: 77150191
* Remove TODO for b/112462307Colin Cross2018-08-131-5/+3
| | | | | | | | b/112462307 is fixed now, remove the TODO. Bug: 112462307 Test: dexlist out/soong/.intermediates/bootable/recovery/updater_sample/SystemUpdaterSample/android_common/dex/classes.dex | grep getUpdaterState Change-Id: I19cb93a74b714967e4bab2964e229a0ab0a15676
* updater_sample: Move to Soong.Tao Bao2018-08-105-72/+76
| | | | | Test: Follow the steps in "Running tests" in updater_sample/README.md. Change-Id: I70c3239e3daea0dcdadf02f68abe7d6aafa67a2e
* Remove non-A/B mention from README.Zhomart Mukhamejanov2018-08-021-6/+6
| | | | | Test: N/A Change-Id: I8622733d0a23ff062031a67efd0e32480a297322
* updater_sample: add privileged system app docsZhomart Mukhamejanov2018-06-183-29/+57
| | | | | | | | | README.md: add instructions Test: on device Bug: 80250430 Change-Id: I2e04fdefda2b73d01dfa0a8e684542feb2ed6c61 Signed-off-by: Zhomart Mukhamejanov <zhomart@google.com>
* updater_sample: run as a systemp appZhomart Mukhamejanov2018-06-182-1/+3
| | | | | | | | | | Android.mk: remove local tags, make privileged module AndroidManifest.xml: add access cache filesystem Test: on device Test: junit4 Change-Id: I611970747b7b630520249dd53105b9a2f7f76355 Signed-off-by: Zhomart Mukhamejanov <zhomart@google.com>
* updater_sample: add proguard.flagsZhomart Mukhamejanov2018-06-183-5/+28
| | | | | | Test: on device Change-Id: Ia8582053b7330d06e618f2555332cfb2a89b3df8 Signed-off-by: Zhomart Mukhamejanov <zhomart@google.com>
* Merge "updater_sample: add metadata mismatch error code"Zhomart Mukhamejanov2018-06-141-0/+1
|\
| * updater_sample: add metadata mismatch error codeZhomart Mukhamejanov2018-06-141-0/+1
| | | | | | | | | | | | | | | | Update util/UpdateEngineErrorCodes.java Test: n/a Change-Id: I7250b1198b1d5ff0e38b7d4effe61eebd114a44f Signed-off-by: Zhomart Mukhamejanov <zhomart@google.com>
* | Revert "updater_sample: add proguard.flags"Ian Pedowitz2018-06-143-28/+6
|/ | | | | | | | This reverts commit 8c3af4aa8c35b9fdeb5c2b350098c20202fd3830. Reason for revert: Broke Master Change-Id: I37bceeea630fb7db39efa25d03ababe3d84cdfbf
* updater_sample: add proguard.flagsZhomart Mukhamejanov2018-06-133-6/+28
| | | | | | Test: junit Change-Id: I0175271935fdd87dd49ad9936d0e1b550d164e05 Signed-off-by: Zhomart Mukhamejanov <zhomart@google.com>
* updater_sample: update README.mdZhomart Mukhamejanov2018-06-081-3/+5
| | | | | | Test: n/a Change-Id: I0b488ca9fe628c3614c203ab9264175f291f49db Signed-off-by: Zhomart Mukhamejanov <zhomart@google.com>
* updater_sample: fix payload spec testsZhomart Mukhamejanov2018-06-071-1/+1
| | | | | | Test: junit4 Change-Id: Ia2f7475cfba01a65486bb0e5d0f3976304ca0969 Signed-off-by: Zhomart Mukhamejanov <zhomart@google.com>
* updater_sample: change gen_update_config argsZhomart Mukhamejanov2018-06-071-3/+3
| | | | | | | | | Change gen_update_config arg '--ab_force_switch_slot' from 'bool' to 'store_action'. Test: manually Change-Id: Ic65ac9ca3feb99b3a1751a44dec038d49c2b446a Signed-off-by: Zhomart Mukhamejanov <zhomart@google.com>
* updater_sample: Add suspend/resume updateZhomart Mukhamejanov2018-06-054-13/+80
| | | | | | | | | | | - Add suspend/resume buttons. - UpdateManager: add suspend/resume control methods. - UpdaterState: fix transitions. Test: on the device Bug: 77150010 Change-Id: I174edd32401f8232b5071eb1a2758a4704779801 Signed-off-by: Zhomart Mukhamejanov <zhomart@google.com>
* updater_sample: Add UI docs to READMEZhomart Mukhamejanov2018-06-051-0/+25
| | | | | | Test: N/A Change-Id: Idc0a4fa778c23c503162337a682c872644e5419c Signed-off-by: Zhomart Mukhamejanov <zhomart@google.com>
* updater_sample: improve updater state handlingZhomart Mukhamejanov2018-06-048-167/+307
| | | | | | | | | | | | | | | - 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>
* updater_sample: validate state only onceZhomart Mukhamejanov2018-06-011-1/+8
| | | | | | Test: on device Change-Id: I0a8a87d7b69f0efdcbd17facbf42cb94fb96fe51 Signed-off-by: Zhomart Mukhamejanov <zhomart@google.com>
* updater_sample: Add @GuardedByZhomart Mukhamejanov2018-06-012-1/+8
| | | | | | Test: on the device Change-Id: I15762dafec1814980e1c2529f5fc2048853c8ff2 Signed-off-by: Zhomart Mukhamejanov <zhomart@google.com>
* updater_sample: Improve update completion handlingZhomart Mukhamejanov2018-05-313-1/+147
| | | | | | | | | | | | | | | | | | | 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>
* updater_sample: add UpdaterStateZhomart Mukhamejanov2018-05-264-68/+128
| | | | | | | | | | - Add UpdaterState - atomic class, handles proper state changes. - Remove util.UpdaterStates. Test: compiled and ran on the device Change-Id: I7fa87bbf09f8289632e8de1f26654365f4891700 Signed-off-by: Zhomart Mukhamejanov <zhomart@google.com>
* updater_sample: add UpdateDataZhomart Mukhamejanov2018-05-261-29/+121
| | | | | | | | | | 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>
* Merge "updater_sample: Add OWNERS."Treehugger Robot2018-05-251-0/+2
|\
| * updater_sample: Add OWNERS.Tao Bao2018-05-251-0/+2
| | | | | | | | | | Test: N/A Change-Id: I519a0fa38b87c7d826ed07414d14a4f7a858aeb4
* | updater_sample: add updater stateZhomart Mukhamejanov2018-05-255-43/+186
|/ | | | | | | | | | | | | | | | - 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>
* updater_sample: create UpdateManagerZhomart Mukhamejanov2018-05-249-243/+492
| | | | | | | | | | | | | | - 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>
* updater_config: make utils/PayloadSpecs non-staticZhomart Mukhamejanov2018-05-184-13/+17
| | | | | | | | | | | | 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>
* updater_sample: add switch slot demoZhomart Mukhamejanov2018-05-1711-16/+210
| | | | | | | | | | | | | - 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>
* updater_sample: add HAL compatibility checkZhomart Mukhamejanov2018-05-102-27/+60
| | | | | | | | | | | - Refactor PrepareStreamingService#onHandleIntent - Add PrepareStreamingService#verifyPackageCompatibility Test: on the device Bug: 79471299 Signed-off-by: Zhomart Mukhamejanov <zhomart@google.com> Change-Id: I1b18502f0638d66810a3f7ada582e4c7cea20cdb
* updater_sample: fix UpdateConfigZhomart Mukhamejanov2018-05-103-4/+8
| | | | | | | | | | - fix UpdateConfig - fix smaple.json - fix FileDownloaderTest Test: manually Change-Id: I09d272f77c89a02f54a24cf753fdfda4ce243927 Signed-off-by: Zhomart Mukhamejanov <zhomart@google.com>
* updater_sample: add http header demoZhomart Mukhamejanov2018-05-104-13/+51
| | | | | | | | | Added demo passing http headers to UpdateEngine#applyPayload. Bug: 79483768 Test: manually Change-Id: I3e9c812dba2066acadbcea8d07c933368806e20c Signed-off-by: Zhomart Mukhamejanov <zhomart@google.com>
* Merge "updater_sample: update tools"Zhomart Mukhamejanov2018-05-097-93/+74
|\
| * updater_sample: update toolsZhomart Mukhamejanov2018-05-087-93/+74
| | | | | | | | | | | | | | | | | | | | | | | | - 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>
* | updater_sample: add streaming supportZhomart Mukhamejanov2018-05-086-20/+266
|/ | | | | | | | | - UpdateConfigs: add helper methods for streaming - add PrepareStreamingService intent service Test: manually and junit4 Bug: 77148143 Change-Id: I61711eb9abe051987e725fbd94f8cd029ff21dd3
* updater_sample: update testsZhomart Mukhamejanov2018-05-033-15/+29
| | | | | | | | | - fix tools/gen_update_config.py - add tests for PayloadSpecs#forStreaming Test: junit4 Change-Id: Ife1980c5f72944ed35500aa820b30031fc99e820 Signed-off-by: Zhomart Mukhamejanov <zhomart@google.com>
* updater_sample: update ui and README, clean-upZhomart Mukhamejanov2018-05-037-98/+151
| | | | | | | | | | | - 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>
* updater_sample: Add streaming to PayloadSpecZhomart Mukhamejanov2018-05-029-26/+56
| | | | | | | | | | | | | | 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>
* updater_sample: add FileDownloaderZhomart Mukhamejanov2018-05-012-0/+173
| | | | | | | Test: unit tests Change-Id: I10933e7172d7ebc34c7cf5e4274625d7b8399246 Signed-off-by: Zhomart Mukhamejanov <zhomart@google.com>
* updater_sample: Improve UpdateConfigZhomart Mukhamejanov2018-05-019-47/+140
| | | | | | | | | | | | | | | | | 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>
* updater_sample: fix gen_update_config.pyZhomart Mukhamejanov2018-04-274-27/+89
| | | | | | | | | | 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>
* Merge "sample_updater: create tools/gen_update_config.py"Zhomart Mukhamejanov2018-04-263-8/+189
|\
| * sample_updater: create tools/gen_update_config.pyZhomart Mukhamejanov2018-04-263-8/+189
| | | | | | | | | | | | | | | | | | | | | | | | gen_update_config.py generates JSON config files from given OTA image zip files. README.md is updated. Test: manually Change-Id: Ifd09b49a73983a42752ee3842a566cecedb9cae0 Signed-off-by: Zhomart Mukhamejanov <zhomart@google.com>
* | sample_updater: add tests resourcesZhomart Mukhamejanov2018-04-263-0/+49
|/ | | | | | | | | | | 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>
* updater_sample: Use stubs libs for android.test.base / runner.Tao Bao2018-04-261-2/+2
| | | | | | | | | | | | | | | 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
* Rename the dir for SystemUpdaterSample.Tao Bao2018-04-2625-0/+1773
Also replace the occurrence in README.md and PREUPLOAD.cfg. Test: mmma -j bootable/recovery Change-Id: I04c0ef00dd64f49e008ad2a4a2c1e8eaed76bf8d