From 16db994fad2b898c542214a3056a790d79e390f2 Mon Sep 17 00:00:00 2001
From: Zhomart Mukhamejanov
Date: Thu, 31 May 2018 10:47:09 -0700
Subject: 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 +++++++++++++++
.../android/systemupdatersample/UpdateManager.java | 28 ++++++++++++------
.../android/systemupdatersample/UpdaterState.java | 8 ++---
.../systemupdatersample/ui/MainActivity.java | 34 ++++++++++++++++++++++
4 files changed, 80 insertions(+), 13 deletions(-)
(limited to 'updater_sample')
diff --git a/updater_sample/res/layout/activity_main.xml b/updater_sample/res/layout/activity_main.xml
index 7cde42cec..b560827d8 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.