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