summaryrefslogtreecommitdiffstats
path: root/updater_sample/src/com/example/android/systemupdatersample/UpdateManager.java (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Add PrepareUpdateService.Zhomart Mukhamejanov2018-12-151-49/+30
| | | | | | | | | | | | | | | | | 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
* Move ab_streaming_metadata under ab_config.Zhomart Mukhamejanov2018-08-221-1/+1
| | | | | | | | | Add new config: ab_config.verify_payload_metadata. Change-Id: I521dff92166c33dd9c2efa498dc599fe4bc83fde Signed-off-by: Zhomart Mukhamejanov <zhomart@google.com> Test: mmm, junit Bug: 77150191
* updater_sample: Add suspend/resume updateZhomart Mukhamejanov2018-06-051-9/+19
| | | | | | | | | | | - 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: improve updater state handlingZhomart Mukhamejanov2018-06-041-93/+122
| | | | | | | | | | | | | | | - 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-011-0/+7
| | | | | | Test: on the device Change-Id: I15762dafec1814980e1c2529f5fc2048853c8ff2 Signed-off-by: Zhomart Mukhamejanov <zhomart@google.com>
* updater_sample: Improve update completion handlingZhomart Mukhamejanov2018-05-311-1/+75
| | | | | | | | | | | | | | | | | | | 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-261-13/+20
| | | | | | | | | | - 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>
* updater_sample: add updater stateZhomart Mukhamejanov2018-05-251-2/+51
| | | | | | | | | | | | | | | | - 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-241-0/+345
- 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>