Addressing API council comments on NetworkStatsManager.
Callbacks
- DataUsageCallback renamed to UsageCallback
- DataUsagePolicy removed; passing in params directly to register method
- making it an abstract class
- passing in (networkType, subscriberId) that reached its threshold
- renaming onLimitReached to onThresholdReached to match existing naming
- only monitor single network,subscriberId
- no monitoring of specific uids; using device or user wide instead
Tags
- only owner uid can read its tags
- exposing only TAG_NONE to match service side
BUG: 27530098
Change-Id: I2b2664da71806868a1e937d2bf4d1f234637509b
diff --git a/api/removed.txt b/api/removed.txt
index f9fce40..2673a82 100644
--- a/api/removed.txt
+++ b/api/removed.txt
@@ -17,6 +17,37 @@
}
+package android.app.usage {
+
+ public class DataUsagePolicy {
+ field public final int networkType;
+ field public final java.lang.String[] subscriberIds;
+ field public final long thresholdInBytes;
+ field public final int[] uids;
+ }
+
+ public static class DataUsagePolicy.Builder {
+ ctor public DataUsagePolicy.Builder();
+ method public android.app.usage.DataUsagePolicy.Builder addSubscriberId(java.lang.String);
+ method public android.app.usage.DataUsagePolicy.Builder addUid(int);
+ method public android.app.usage.DataUsagePolicy build();
+ method public android.app.usage.DataUsagePolicy.Builder setNetworkType(int);
+ method public android.app.usage.DataUsagePolicy.Builder setThreshold(long);
+ }
+
+ public class NetworkStatsManager {
+ method public void registerDataUsageCallback(android.app.usage.DataUsagePolicy, android.app.usage.NetworkStatsManager.DataUsageCallback, android.os.Handler);
+ method public void registerDataUsageCallback(android.app.usage.DataUsagePolicy, android.app.usage.NetworkStatsManager.UsageCallback, android.os.Handler);
+ method public void unregisterDataUsageCallback(android.app.usage.NetworkStatsManager.DataUsageCallback);
+ }
+
+ public static abstract class NetworkStatsManager.DataUsageCallback {
+ ctor public NetworkStatsManager.DataUsageCallback();
+ method public deprecated void onLimitReached();
+ }
+
+}
+
package android.content {
public abstract class Context {