updater_sample: Add @GuardedBy

Test: on the device
Change-Id: I15762dafec1814980e1c2529f5fc2048853c8ff2
Signed-off-by: Zhomart Mukhamejanov <zhomart@google.com>
This commit is contained in:
Zhomart Mukhamejanov
2018-05-24 09:11:47 -07:00
parent 9455173f87
commit f6522eba71
2 changed files with 8 additions and 1 deletions
@@ -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();