[MS35] Remove getNetwork[Total|Uid]Bytes dependencies from NPMS
1. getNetworkTotalBytes was used for querying overall statistics
that regards of the NetworkPolicy to calculate the remaining
data warning/limit quota that needs to be send to the lower layer.
2. getNetworkUidBytes was used for querying overall statistics of
apps to find out the rapid traffic that caused by an abnormal
app behavior.
This change replaces getNetwork[Total|Uid]Bytes with APIs that are
about to expose, and introduces a dependencies object for better
unit test injection.
Test: atest NetworkPolicyManagerServiceTest
Bug: 204830222
Change-Id: I802d2316fb22886e951456df0941c09176c981f8
diff --git a/framework-t/src/android/app/usage/NetworkStatsManager.java b/framework-t/src/android/app/usage/NetworkStatsManager.java
index cc7b2a5..f0af42d 100644
--- a/framework-t/src/android/app/usage/NetworkStatsManager.java
+++ b/framework-t/src/android/app/usage/NetworkStatsManager.java
@@ -142,7 +142,15 @@
setAugmentWithSubscriptionPlan(true);
}
- /** @hide */
+ /**
+ * Set poll on open flag to indicate the poll is needed before service gets statistics
+ * result. This is default enabled. However, for any non-privileged caller, the poll might
+ * be omitted in case of rate limiting.
+ *
+ * @param pollOnOpen true if poll is needed.
+ * @hide
+ */
+ // @SystemApi(client = MODULE_LIBRARIES)
public void setPollOnOpen(boolean pollOnOpen) {
if (pollOnOpen) {
mFlags |= FLAG_POLL_ON_OPEN;