Merge "[SP31] Expose onSetWarningAndLimit System API" into mainline-prod
diff --git a/api/system-current.txt b/api/system-current.txt
index f07ebaf..b08033e 100755
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -6753,9 +6753,11 @@
method public void notifyAlertReached();
method public void notifyLimitReached();
method public void notifyStatsUpdated(int, @NonNull android.net.NetworkStats, @NonNull android.net.NetworkStats);
+ method public void notifyWarningReached();
method public abstract void onRequestStatsUpdate(int);
method public abstract void onSetAlert(long);
method public abstract void onSetLimit(@NonNull String, long);
+ method public void onSetWarningAndLimit(@NonNull String, long, long);
field public static final int QUOTA_UNLIMITED = -1; // 0xffffffff
}
diff --git a/core/java/android/net/netstats/provider/NetworkStatsProvider.java b/core/java/android/net/netstats/provider/NetworkStatsProvider.java
index 65b336a..23fc069 100644
--- a/core/java/android/net/netstats/provider/NetworkStatsProvider.java
+++ b/core/java/android/net/netstats/provider/NetworkStatsProvider.java
@@ -147,10 +147,7 @@
/**
* Notify system that the warning set by {@link #onSetWarningAndLimit} has been reached.
- *
- * @hide
*/
- // TODO: Expose as system API.
public void notifyWarningReached() {
try {
// Reuse the code path to notify warning reached with limit reached
@@ -198,7 +195,6 @@
* @param quotaBytes the quota defined as the number of bytes, starting from zero and counting
* from now. A value of {@link #QUOTA_UNLIMITED} indicates there is no limit.
*/
- // TODO: deprecate this once onSetWarningAndLimit is ready.
public abstract void onSetLimit(@NonNull String iface, long quotaBytes);
/**
@@ -217,10 +213,7 @@
* there is no warning.
* @param limitBytes the limit defined as the number of bytes, starting from zero and counting
* from now. A value of {@link #QUOTA_UNLIMITED} indicates there is no limit.
- *
- * @hide
*/
- // TODO: Expose as system API.
public void onSetWarningAndLimit(@NonNull String iface, long warningBytes, long limitBytes) {
// Backward compatibility for those who didn't override this function.
onSetLimit(iface, limitBytes);
diff --git a/non-updatable-api/system-current.txt b/non-updatable-api/system-current.txt
index 256bf33..834f64b 100644
--- a/non-updatable-api/system-current.txt
+++ b/non-updatable-api/system-current.txt
@@ -6607,9 +6607,11 @@
method public void notifyAlertReached();
method public void notifyLimitReached();
method public void notifyStatsUpdated(int, @NonNull android.net.NetworkStats, @NonNull android.net.NetworkStats);
+ method public void notifyWarningReached();
method public abstract void onRequestStatsUpdate(int);
method public abstract void onSetAlert(long);
method public abstract void onSetLimit(@NonNull String, long);
+ method public void onSetWarningAndLimit(@NonNull String, long, long);
field public static final int QUOTA_UNLIMITED = -1; // 0xffffffff
}