Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0af3e957 authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Android Git Automerger
Browse files

am ca90d6da: Merge "Avoid updating thresholds during shutdown." into jb-dev

* commit 'ca90d6da':
  Avoid updating thresholds during shutdown.
parents bf1b5fa9 ca90d6da
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -608,17 +608,19 @@ public class NetworkStatsService extends INetworkStatsService.Stub {

        // clamp threshold into safe range
        mPersistThreshold = MathUtils.constrain(thresholdBytes, 128 * KB_IN_BYTES, 2 * MB_IN_BYTES);
        updatePersistThresholds();

        if (LOGV) {
            Slog.v(TAG, "advisePersistThreshold() given " + thresholdBytes + ", clamped to "
                    + mPersistThreshold);
        }

        // persist if beyond new thresholds
        // update and persist if beyond new thresholds
        final long currentTime = mTime.hasCache() ? mTime.currentTimeMillis()
                : System.currentTimeMillis();
        synchronized (mStatsLock) {
            if (!mSystemReady) return;

            updatePersistThresholds();

            mDevRecorder.maybePersistLocked(currentTime);
            mXtRecorder.maybePersistLocked(currentTime);
            mUidRecorder.maybePersistLocked(currentTime);