Merge "[SP28] Add API for set data warning"

This commit is contained in:
Junyu Lai
2021-03-29 11:06:05 +00:00
committed by Gerrit Code Review
4 changed files with 59 additions and 13 deletions

View File

@@ -1695,7 +1695,9 @@ public class NetworkStatsService extends INetworkStatsService.Stub {
@Override
public void setStatsProviderLimitAsync(@NonNull String iface, long quota) {
if (LOGV) Slog.v(TAG, "setStatsProviderLimitAsync(" + iface + "," + quota + ")");
invokeForAllStatsProviderCallbacks((cb) -> cb.mProvider.onSetLimit(iface, quota));
// TODO: Set warning accordingly.
invokeForAllStatsProviderCallbacks((cb) -> cb.mProvider.onSetWarningAndLimit(iface,
NetworkStatsProvider.QUOTA_UNLIMITED, quota));
}
}
@@ -2090,10 +2092,10 @@ public class NetworkStatsService extends INetworkStatsService.Stub {
}
@Override
public void notifyLimitReached() {
Log.d(TAG, mTag + ": onLimitReached");
public void notifyWarningOrLimitReached() {
Log.d(TAG, mTag + ": notifyWarningOrLimitReached");
LocalServices.getService(NetworkPolicyManagerInternal.class)
.onStatsProviderLimitReached(mTag);
.onStatsProviderWarningOrLimitReached(mTag);
}
@Override