summaryrefslogtreecommitdiffstats
path: root/updater_sample/src/com/example/android/systemupdatersample/UpdaterState.java
diff options
context:
space:
mode:
authorZhomart Mukhamejanov <zhomart@google.com>2018-06-01 21:41:20 +0200
committerZhomart Mukhamejanov <zhomart@google.com>2018-06-04 23:23:37 +0200
commit469b35a4576a0398f62440383b520d091c90edb1 (patch)
treee24302c89b566cce468109fdeb0dc3ab45f74fd9 /updater_sample/src/com/example/android/systemupdatersample/UpdaterState.java
parentMerge "updater_sample: validate state only once" (diff)
downloadandroid_bootable_recovery-469b35a4576a0398f62440383b520d091c90edb1.tar
android_bootable_recovery-469b35a4576a0398f62440383b520d091c90edb1.tar.gz
android_bootable_recovery-469b35a4576a0398f62440383b520d091c90edb1.tar.bz2
android_bootable_recovery-469b35a4576a0398f62440383b520d091c90edb1.tar.lz
android_bootable_recovery-469b35a4576a0398f62440383b520d091c90edb1.tar.xz
android_bootable_recovery-469b35a4576a0398f62440383b520d091c90edb1.tar.zst
android_bootable_recovery-469b35a4576a0398f62440383b520d091c90edb1.zip
Diffstat (limited to 'updater_sample/src/com/example/android/systemupdatersample/UpdaterState.java')
-rw-r--r--updater_sample/src/com/example/android/systemupdatersample/UpdaterState.java15
1 files changed, 9 insertions, 6 deletions
diff --git a/updater_sample/src/com/example/android/systemupdatersample/UpdaterState.java b/updater_sample/src/com/example/android/systemupdatersample/UpdaterState.java
index 36a90982e..573d336e9 100644
--- a/updater_sample/src/com/example/android/systemupdatersample/UpdaterState.java
+++ b/updater_sample/src/com/example/android/systemupdatersample/UpdaterState.java
@@ -51,12 +51,15 @@ public class UpdaterState {
* are allowed to transition to from key.
*/
private static final ImmutableMap<Integer, ImmutableSet<Integer>> TRANSITIONS =
- ImmutableMap.of(
- IDLE, ImmutableSet.of(RUNNING),
- RUNNING, ImmutableSet.of(ERROR, PAUSED, REBOOT_REQUIRED, SLOT_SWITCH_REQUIRED),
- PAUSED, ImmutableSet.of(RUNNING),
- SLOT_SWITCH_REQUIRED, ImmutableSet.of(ERROR)
- );
+ ImmutableMap.<Integer, ImmutableSet<Integer>>builder()
+ .put(IDLE, ImmutableSet.of(ERROR, RUNNING))
+ .put(RUNNING, ImmutableSet.of(
+ ERROR, PAUSED, REBOOT_REQUIRED, SLOT_SWITCH_REQUIRED))
+ .put(PAUSED, ImmutableSet.of(ERROR, RUNNING, IDLE))
+ .put(SLOT_SWITCH_REQUIRED, ImmutableSet.of(ERROR, IDLE))
+ .put(ERROR, ImmutableSet.of(IDLE))
+ .put(REBOOT_REQUIRED, ImmutableSet.of(IDLE))
+ .build();
private AtomicInteger mState;