Fix the race condition for b/11458382

Change-Id: I862da57a70283a2afd5d67751aec87fb808760d2
This commit is contained in:
Ashish Sharma
2013-11-01 14:57:30 -07:00
parent 9a101919d9
commit cbfd66262e

View File

@@ -464,22 +464,22 @@ public class NetworkStatsService extends INetworkStatsService.Stub {
private NetworkStatsCollection mUidTagComplete;
private NetworkStatsCollection getUidComplete() {
if (mUidComplete == null) {
synchronized (mStatsLock) {
if (mUidComplete == null) {
mUidComplete = mUidRecorder.getOrLoadCompleteLocked();
}
}
return mUidComplete;
}
}
private NetworkStatsCollection getUidTagComplete() {
if (mUidTagComplete == null) {
synchronized (mStatsLock) {
if (mUidTagComplete == null) {
mUidTagComplete = mUidTagRecorder.getOrLoadCompleteLocked();
}
}
return mUidTagComplete;
}
}
@Override
public NetworkStats getSummaryForNetwork(