Merge "updater_sample: Add @GuardedBy" am: 2759733136

am: a37a085a11

Change-Id: I14c6cf3602233e29a8da9790cb4d0f37f10a59ca
This commit is contained in:
Zhomart Mukhamejanov
2018-05-31 17:19:55 -07:00
committed by android-build-merger
2 changed files with 8 additions and 1 deletions
+1 -1
View File
@@ -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
@@ -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();