commit | 8d2a88c50dcd6f629dbb54f2180e1114494e7da9 | [log] [tgz] |
---|---|---|
author | Chenbo Feng <fengc@google.com> | Wed Apr 10 12:55:07 2019 -0700 |
committer | Chenbo Feng <fengc@google.com> | Wed Apr 10 12:59:18 2019 -0700 |
tree | b6f5c9cc60eec1167995e9aebe3601490648e8d5 | |
parent | 5f8a630da7d5b308c0824a25f6fc1dd4c7552c9f [diff] |
Add a lock to protect persistent stats snapshot Since the network stats could be polled from multiple services at runtime, it is not thread safe for networkStatsFactory to hold a persistent stats snapshot without any protection. Use a internal lock to prevent concurrent modification on mPersistentSnapshot to fix the problem. Bug: 124764595 Test: android.app.usage.cts.NetworkUsageStatsTest android.net.cts.TrafficStatsTest Change-Id: I22afb46f17697e8b6359d4f593802e0f4b95db8b