diff options
author | android-build-prod (mdb) <android-build-team-robot@google.com> | 2018-04-26 02:26:33 +0200 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2018-04-26 02:26:33 +0200 |
commit | cf277abb8f554e78f63208c968051c90bc8b3a6c (patch) | |
tree | 67faa232f6086a2256d0fbb0ebf4ea473f031420 /updater_sample/README.md | |
parent | Merge "sample_updater: add non-streaming demo" am: 4816fc1c46 (diff) | |
parent | Merge "Rename the dir for SystemUpdaterSample." (diff) | |
download | android_bootable_recovery-cf277abb8f554e78f63208c968051c90bc8b3a6c.tar android_bootable_recovery-cf277abb8f554e78f63208c968051c90bc8b3a6c.tar.gz android_bootable_recovery-cf277abb8f554e78f63208c968051c90bc8b3a6c.tar.bz2 android_bootable_recovery-cf277abb8f554e78f63208c968051c90bc8b3a6c.tar.lz android_bootable_recovery-cf277abb8f554e78f63208c968051c90bc8b3a6c.tar.xz android_bootable_recovery-cf277abb8f554e78f63208c968051c90bc8b3a6c.tar.zst android_bootable_recovery-cf277abb8f554e78f63208c968051c90bc8b3a6c.zip |
Diffstat (limited to 'updater_sample/README.md')
-rw-r--r-- | updater_sample/README.md | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/updater_sample/README.md b/updater_sample/README.md new file mode 100644 index 000000000..d9864b472 --- /dev/null +++ b/updater_sample/README.md @@ -0,0 +1,72 @@ +# SystemUpdaterSample + +This app demonstrates how to use Android system updates APIs to install +[OTA updates](https://source.android.com/devices/tech/ota/). It contains a sample +client for `update_engine` to install A/B (seamless) updates and a sample of +applying non-A/B updates using `recovery`. + +A/B (seamless) update is available since Android Nougat (API 24), but this sample +targets the latest android. + + +## Running on a device + +The commands expected to be run from `$ANDROID_BUILD_TOP`. + +1. Compile the app `$ mmma bootable/recovery/updater_sample`. +2. Install the app to the device using `$ adb install <APK_PATH>`. +3. Add update config files. + + +## Update Config file + +Directory can be found in logs or on UI. Usually json config files are located in +`/data/user/0/com.example.android.systemupdatersample/files/configs/`. Example file +is located at `res/raw/sample.json`. + + +## Development + +- [x] Create a UI with list of configs, current version, + control buttons, progress bar and log viewer +- [x] Add `PayloadSpec` and `PayloadSpecs` for working with + update zip file +- [x] Add `UpdateConfig` for working with json config files +- [x] Add applying non-streaming update +- [ ] Add applying streaming update +- [ ] Prepare streaming update (partially downloading package) +- [ ] Add tests for `MainActivity` +- [ ] Add stop/reset the update +- [ ] Verify system partition checksum for package +- [ ] HAL compatibility check +- [ ] Change partition demo +- [ ] Add non-A/B updates demo + + +## Running tests + +1. Build `$ mmma bootable/recovery/updater_sample/` +2. Install app + `$ adb install $OUT/system/app/SystemUpdaterSample/SystemUpdaterSample.apk` +3. Install tests + `$ adb install $OUT/testcases/SystemUpdaterSampleTests/SystemUpdaterSampleTests.apk` +4. Run tests + `$ adb shell am instrument -w com.example.android.systemupdatersample.tests/android.support.test.runner.AndroidJUnitRunner` +5. Run a test file + ``` + $ adb shell am instrument \ + -w com.example.android.systemupdatersample.tests/android.support.test.runner.AndroidJUnitRunner \ + -c com.example.android.systemupdatersample.util.PayloadSpecsTest + ``` + + +## Getting access to `update_engine` API and read/write access to `/data` + +Run adb shell as a root, and set SELinux mode to permissive (0): + +```txt +$ adb root +$ adb shell +# setenforce 0 +# getenforce +``` |