Merge "updater_sample: Add @GuardedBy"
This commit is contained in:
@@ -18,8 +18,8 @@ LOCAL_PATH := $(call my-dir)
|
|||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
|
|
||||||
LOCAL_PACKAGE_NAME := SystemUpdaterSample
|
LOCAL_PACKAGE_NAME := SystemUpdaterSample
|
||||||
LOCAL_SDK_VERSION := system_current
|
|
||||||
LOCAL_MODULE_TAGS := samples
|
LOCAL_MODULE_TAGS := samples
|
||||||
|
LOCAL_SDK_VERSION := system_current
|
||||||
|
|
||||||
# TODO: enable proguard and use proguard.flags file
|
# TODO: enable proguard and use proguard.flags file
|
||||||
LOCAL_PROGUARD_ENABLED := disabled
|
LOCAL_PROGUARD_ENABLED := disabled
|
||||||
|
|||||||
@@ -39,6 +39,8 @@ import java.util.concurrent.atomic.AtomicInteger;
|
|||||||
import java.util.function.DoubleConsumer;
|
import java.util.function.DoubleConsumer;
|
||||||
import java.util.function.IntConsumer;
|
import java.util.function.IntConsumer;
|
||||||
|
|
||||||
|
import javax.annotation.concurrent.GuardedBy;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Manages the update flow. It has its own state (in memory), separate from
|
* Manages the update flow. It has its own state (in memory), separate from
|
||||||
* {@link UpdateEngine}'s state. Asynchronously interacts with the {@link UpdateEngine}.
|
* {@link UpdateEngine}'s state. Asynchronously interacts with the {@link UpdateEngine}.
|
||||||
@@ -62,11 +64,16 @@ public class UpdateManager {
|
|||||||
|
|
||||||
private AtomicBoolean mManualSwitchSlotRequired = new AtomicBoolean(true);
|
private AtomicBoolean mManualSwitchSlotRequired = new AtomicBoolean(true);
|
||||||
|
|
||||||
|
@GuardedBy("mLock")
|
||||||
private UpdateData mLastUpdateData = null;
|
private UpdateData mLastUpdateData = null;
|
||||||
|
|
||||||
|
@GuardedBy("mLock")
|
||||||
private IntConsumer mOnStateChangeCallback = null;
|
private IntConsumer mOnStateChangeCallback = null;
|
||||||
|
@GuardedBy("mLock")
|
||||||
private IntConsumer mOnEngineStatusUpdateCallback = null;
|
private IntConsumer mOnEngineStatusUpdateCallback = null;
|
||||||
|
@GuardedBy("mLock")
|
||||||
private DoubleConsumer mOnProgressUpdateCallback = null;
|
private DoubleConsumer mOnProgressUpdateCallback = null;
|
||||||
|
@GuardedBy("mLock")
|
||||||
private IntConsumer mOnEngineCompleteCallback = null;
|
private IntConsumer mOnEngineCompleteCallback = null;
|
||||||
|
|
||||||
private final Object mLock = new Object();
|
private final Object mLock = new Object();
|
||||||
|
|||||||
Reference in New Issue
Block a user