From 16db994fad2b898c542214a3056a790d79e390f2 Mon Sep 17 00:00:00 2001
From: Zhomart Mukhamejanov
Date: Thu, 31 May 2018 10:47:09 -0700
Subject: [PATCH] updater_sample: Add suspend/resume update
- 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
---
updater_sample/res/layout/activity_main.xml | 23 +++++++++++++
.../systemupdatersample/UpdateManager.java | 28 ++++++++++-----
.../systemupdatersample/UpdaterState.java | 10 +++---
.../systemupdatersample/ui/MainActivity.java | 34 +++++++++++++++++++
4 files changed, 81 insertions(+), 14 deletions(-)
diff --git a/updater_sample/res/layout/activity_main.xml b/updater_sample/res/layout/activity_main.xml
index 7cde42ce..b560827d 100644
--- a/updater_sample/res/layout/activity_main.xml
+++ b/updater_sample/res/layout/activity_main.xml
@@ -197,6 +197,29 @@
android:text="Reset" />
+
+
+
+
+
+
+
Sometimes it's possible that the
- * update engine would throw an error when the method is called, and the only way to
- * handle it is to catch the exception.
*/
public synchronized void cancelRunningUpdate() throws UpdaterState.InvalidTransitionException {
Log.d(TAG, "cancelRunningUpdate invoked");
@@ -250,10 +264,6 @@ public class UpdateManager {
/**
* Resets update engine to IDLE state. If an update has been applied it reverts it.
- *
- *
Sometimes it's possible that the
- * update engine would throw an error when the method is called, and the only way to
- * handle it is to catch the exception.