commit | a61c36281278e282ac53f5ba91b73748374e192f | [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 | 792e931ef0da9690fecbffeefdb30bf2b3d21898 | |
parent | 54496af119a2c34f953cb38870483e2099a6c90e [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