Alert user on rapid/heavy data usage.
Now that we have accurate information about a user's carrier data
plan, we can alert them if the current usage patterns would end up
with a nasty surprise towards the end of the current billing cycle.
For example, a single abusive app could use 90% of the user's budget
within the first few days of a billing cycle, leaving the user to
limp along for the remainder of the month.
The simple algorithm here extrapolates to see if the average usage
over the last 4 days would be more than 150% of the data limit for
the full billing cycle. This period is short enough to catch rapid
recent usage, but long enough to smooth over short-term habit
changes, such as a weekend getaway. This was chosen after
backtesting the proposed algorithm against real-world data usage
from a handful of internal users.
Fix NPMS unit tests, and write new ones, but leave the existing
@Ignored annotation intact for now.
Test: bit FrameworksServicesTests:com.android.server.NetworkPolicyManagerServiceTest
Bug: 64133169
Change-Id: I0d394b133257e8569a9aa2631b57638839d870ce
diff --git a/proto/src/system_messages.proto b/proto/src/system_messages.proto
index d817da5..7c6019e 100644
--- a/proto/src/system_messages.proto
+++ b/proto/src/system_messages.proto
@@ -193,6 +193,9 @@
// Inform the user that Wifi Wake has automatically re-enabled Wifi
NOTE_WIFI_WAKE_TURNED_BACK_ON = 44;
+ // Inform the user that unexpectedly rapid network usage is happening
+ NOTE_NET_RAPID = 45;
+
// ADD_NEW_IDS_ABOVE_THIS_LINE
// Legacy IDs with arbitrary values appear below
// Legacy IDs existed as stable non-conflicting constants prior to the O release