summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhomart Mukhamejanov <zhomart@google.com>2018-06-01 02:19:55 +0200
committerandroid-build-merger <android-build-merger@google.com>2018-06-01 02:19:55 +0200
commit7d5746309b5c41a708cdb4d5dba201a5d24e3dd1 (patch)
tree34e6d82f5727345ceecbb5b3ea7a8a1efd8577f6
parentMerge "updater_sample: Improve update completion handling" am: 9455173f87 (diff)
parentMerge "updater_sample: Add @GuardedBy" (diff)
downloadandroid_bootable_recovery-7d5746309b5c41a708cdb4d5dba201a5d24e3dd1.tar
android_bootable_recovery-7d5746309b5c41a708cdb4d5dba201a5d24e3dd1.tar.gz
android_bootable_recovery-7d5746309b5c41a708cdb4d5dba201a5d24e3dd1.tar.bz2
android_bootable_recovery-7d5746309b5c41a708cdb4d5dba201a5d24e3dd1.tar.lz
android_bootable_recovery-7d5746309b5c41a708cdb4d5dba201a5d24e3dd1.tar.xz
android_bootable_recovery-7d5746309b5c41a708cdb4d5dba201a5d24e3dd1.tar.zst
android_bootable_recovery-7d5746309b5c41a708cdb4d5dba201a5d24e3dd1.zip
-rw-r--r--updater_sample/Android.mk2
-rw-r--r--updater_sample/src/com/example/android/systemupdatersample/UpdateManager.java7
2 files changed, 8 insertions, 1 deletions
diff --git a/updater_sample/Android.mk b/updater_sample/Android.mk
index 056ad66be..7662111b7 100644
--- a/updater_sample/Android.mk
+++ b/updater_sample/Android.mk
@@ -18,8 +18,8 @@ LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_PACKAGE_NAME := SystemUpdaterSample
-LOCAL_SDK_VERSION := system_current
LOCAL_MODULE_TAGS := samples
+LOCAL_SDK_VERSION := system_current
# TODO: enable proguard and use proguard.flags file
LOCAL_PROGUARD_ENABLED := disabled
diff --git a/updater_sample/src/com/example/android/systemupdatersample/UpdateManager.java b/updater_sample/src/com/example/android/systemupdatersample/UpdateManager.java
index f5c2ea5ab..145cc83b1 100644
--- a/updater_sample/src/com/example/android/systemupdatersample/UpdateManager.java
+++ b/updater_sample/src/com/example/android/systemupdatersample/UpdateManager.java
@@ -39,6 +39,8 @@ import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.DoubleConsumer;
import java.util.function.IntConsumer;
+import javax.annotation.concurrent.GuardedBy;
+
/**
* Manages the update flow. It has its own state (in memory), separate from
* {@link UpdateEngine}'s state. Asynchronously interacts with the {@link UpdateEngine}.
@@ -62,11 +64,16 @@ public class UpdateManager {
private AtomicBoolean mManualSwitchSlotRequired = new AtomicBoolean(true);
+ @GuardedBy("mLock")
private UpdateData mLastUpdateData = null;
+ @GuardedBy("mLock")
private IntConsumer mOnStateChangeCallback = null;
+ @GuardedBy("mLock")
private IntConsumer mOnEngineStatusUpdateCallback = null;
+ @GuardedBy("mLock")
private DoubleConsumer mOnProgressUpdateCallback = null;
+ @GuardedBy("mLock")
private IntConsumer mOnEngineCompleteCallback = null;
private final Object mLock = new Object();