Merge "Update interface quota limit when network stats updated"

This commit is contained in:
Junyu Lai
2019-12-19 09:07:54 +00:00
committed by Gerrit Code Review

View File

@@ -873,6 +873,8 @@ public class NetworkStatsService extends INetworkStatsService.Stub {
+ mPersistThreshold); + mPersistThreshold);
} }
final long oldGlobalAlertBytes = mGlobalAlertBytes;
// update and persist if beyond new thresholds // update and persist if beyond new thresholds
final long currentTime = mClock.millis(); final long currentTime = mClock.millis();
synchronized (mStatsLock) { synchronized (mStatsLock) {
@@ -886,9 +888,10 @@ public class NetworkStatsService extends INetworkStatsService.Stub {
mUidTagRecorder.maybePersistLocked(currentTime); mUidTagRecorder.maybePersistLocked(currentTime);
} }
// re-arm global alert if (oldGlobalAlertBytes != mGlobalAlertBytes) {
registerGlobalAlert(); registerGlobalAlert();
} }
}
@Override @Override
public DataUsageRequest registerUsageCallback(String callingPackage, public DataUsageRequest registerUsageCallback(String callingPackage,