Merge "updater_sample: Add @GuardedBy"

This commit is contained in:
Zhomart Mukhamejanov
2018-05-31 23:12:34 +00:00
committed by Gerrit Code Review
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();