Fix the race condition for b/11458382
Change-Id: I862da57a70283a2afd5d67751aec87fb808760d2
This commit is contained in:
@@ -464,22 +464,22 @@ public class NetworkStatsService extends INetworkStatsService.Stub {
|
|||||||
private NetworkStatsCollection mUidTagComplete;
|
private NetworkStatsCollection mUidTagComplete;
|
||||||
|
|
||||||
private NetworkStatsCollection getUidComplete() {
|
private NetworkStatsCollection getUidComplete() {
|
||||||
if (mUidComplete == null) {
|
|
||||||
synchronized (mStatsLock) {
|
synchronized (mStatsLock) {
|
||||||
|
if (mUidComplete == null) {
|
||||||
mUidComplete = mUidRecorder.getOrLoadCompleteLocked();
|
mUidComplete = mUidRecorder.getOrLoadCompleteLocked();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return mUidComplete;
|
return mUidComplete;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private NetworkStatsCollection getUidTagComplete() {
|
private NetworkStatsCollection getUidTagComplete() {
|
||||||
if (mUidTagComplete == null) {
|
|
||||||
synchronized (mStatsLock) {
|
synchronized (mStatsLock) {
|
||||||
|
if (mUidTagComplete == null) {
|
||||||
mUidTagComplete = mUidTagRecorder.getOrLoadCompleteLocked();
|
mUidTagComplete = mUidTagRecorder.getOrLoadCompleteLocked();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return mUidTagComplete;
|
return mUidTagComplete;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public NetworkStats getSummaryForNetwork(
|
public NetworkStats getSummaryForNetwork(
|
||||||
|
|||||||
Reference in New Issue
Block a user