Avoid updating thresholds during shutdown.
Bug: 6472388 Change-Id: I70e1ed5dc75056840f2f0b130ce0dfecb06f385e
This commit is contained in:
@@ -608,17 +608,19 @@ public class NetworkStatsService extends INetworkStatsService.Stub {
|
|||||||
|
|
||||||
// clamp threshold into safe range
|
// clamp threshold into safe range
|
||||||
mPersistThreshold = MathUtils.constrain(thresholdBytes, 128 * KB_IN_BYTES, 2 * MB_IN_BYTES);
|
mPersistThreshold = MathUtils.constrain(thresholdBytes, 128 * KB_IN_BYTES, 2 * MB_IN_BYTES);
|
||||||
updatePersistThresholds();
|
|
||||||
|
|
||||||
if (LOGV) {
|
if (LOGV) {
|
||||||
Slog.v(TAG, "advisePersistThreshold() given " + thresholdBytes + ", clamped to "
|
Slog.v(TAG, "advisePersistThreshold() given " + thresholdBytes + ", clamped to "
|
||||||
+ mPersistThreshold);
|
+ mPersistThreshold);
|
||||||
}
|
}
|
||||||
|
|
||||||
// persist if beyond new thresholds
|
// update and persist if beyond new thresholds
|
||||||
final long currentTime = mTime.hasCache() ? mTime.currentTimeMillis()
|
final long currentTime = mTime.hasCache() ? mTime.currentTimeMillis()
|
||||||
: System.currentTimeMillis();
|
: System.currentTimeMillis();
|
||||||
synchronized (mStatsLock) {
|
synchronized (mStatsLock) {
|
||||||
|
if (!mSystemReady) return;
|
||||||
|
|
||||||
|
updatePersistThresholds();
|
||||||
|
|
||||||
mDevRecorder.maybePersistLocked(currentTime);
|
mDevRecorder.maybePersistLocked(currentTime);
|
||||||
mXtRecorder.maybePersistLocked(currentTime);
|
mXtRecorder.maybePersistLocked(currentTime);
|
||||||
mUidRecorder.maybePersistLocked(currentTime);
|
mUidRecorder.maybePersistLocked(currentTime);
|
||||||
|
|||||||
Reference in New Issue
Block a user