Synchronize the NetworkStatsFactory constructor.
This ensures the constructor takes the necessary lock before accessing memmber variables. Bug: 113122541 Test: atest FrameworksNetTests Change-Id: Ibd324ed922c738b8d77d4eb74f45b75c6645bdc7
This commit is contained in:
@@ -179,8 +179,10 @@ public class NetworkStatsFactory {
|
||||
mStatsXtIfaceFmt = new File(procRoot, "net/xt_qtaguid/iface_stat_fmt");
|
||||
mStatsXtUid = new File(procRoot, "net/xt_qtaguid/stats");
|
||||
mUseBpfStats = useBpfStats;
|
||||
mPersistSnapshot = new NetworkStats(SystemClock.elapsedRealtime(), -1);
|
||||
mTunAnd464xlatAdjustedStats = new NetworkStats(SystemClock.elapsedRealtime(), -1);
|
||||
synchronized (sPersistentDataLock) {
|
||||
mPersistSnapshot = new NetworkStats(SystemClock.elapsedRealtime(), -1);
|
||||
mTunAnd464xlatAdjustedStats = new NetworkStats(SystemClock.elapsedRealtime(), -1);
|
||||
}
|
||||
}
|
||||
|
||||
public NetworkStats readBpfNetworkStatsDev() throws IOException {
|
||||
|
||||
Reference in New Issue
Block a user