Fix 2 instances of buggy double check locking on non-volatile fields.

Bug caught by Error Prone:
http://errorprone.info/bugpattern/DoubleCheckedLocking

Bug: 27723540
Change-Id: I0b0c06ce4ae1ffb668e8ab3a7fe07706df173f18
This commit is contained in:
Ian Rogers
2016-05-18 19:58:56 -07:00
parent 84a92fd256
commit 92a0487493

View File

@@ -68,7 +68,7 @@ class NetworkStatsObservers {
private final AtomicInteger mNextDataUsageRequestId = new AtomicInteger();
// Lazily instantiated when an observer is registered.
private Handler mHandler;
private volatile Handler mHandler;
/**
* Creates a wrapper that contains the caller context and a normalized request.