When we switch to another network (or even just lose mobile data) the mobile
interface is either brought down or destroyed altogether. That means any
throttling rules we've told the kernel about get lost.
This change notices when our interface comes up and reinstates throttling
if needed.
bug:2660287
Change-Id: I4c6ebf78acc59ed66b95984a1e8b7c2ffbc22dcb
The start and end times were precisely the same so, a ">" check needed to be ">=".
Also removed useless code and removed the potential problem where continuous gradual
advancement of your start and end times would prevent resets.
bug:2629717
Change-Id: Ieced1965a5611a9b555e92bcf924ec350f2a80db
We were updating limits and such before, but we were not applying them
to the current situation if we were already throttled. Now it can result in
us throttling or changing our throttle rate or unthrottling or even making
the ui come or go (disabling/enable throttling)
bug:2622543
bug:2619879
Change-Id: I64a62634d54f4768ab8625f8d72f9f66a239cb19
Throttle is useless when ntp and imsi are not yet ready. In the real world
the second check won't happen for 10 minutes letting people do what they want
for 10 minutes each boot. Trim this down with a quicker first check.
bug:2614247
Change-Id: I84ec33f31e8fed37b3933482fbc187b8e9e94e79
Cleanup of duplicate code
Caching Ntp data so we don't hit the network as often
Clearing out of MRU data when we switch to a new sim
Sending notification after we reset byte counts
bug:2605277
bug:2605272
bug:2597530
bug:2576057
Change-Id: I3df526bae6374f6ae56fed67b0defad2b4fabefd
Use elapsed time not wall time for alarms so users can't play with the
system time to get around things.
Also using NTP servers to pull in an authoritative time - if we the build
is configured with an NTP server we will not advance to the next cycle
without it, but we also will not trottle - rather not throttle users
on an error.
Note that the poll alarm is just relative to the last poll time and real
time doesn't matter.
Defining the time-fetching API's as returning time in the system wallclock
range (correcting if we are using NTP time internally).
bug:2597530
Change-Id: I1c0ac0923314c2f8a04edd0b36c4845352eae99a
Uses the last used data until the SIM is available (if ever). Supports data from
several SIMs for all the world travelers out there.
bug: 2576057
Change-Id: I70e34a51f1c2ccda41a480652b0233b68ff3f538
The byte counter for the iface goes to zero when it comes back. Catch that and
do the complex math to correct.
Also add a log entry telling us our desired throttle index.
Lastly, reset the sec/msec part of our reset time so that one calc will == another and not
be off by little bits.
bug:25494925
Change-Id: I99525b72a76316a8e601ceb457ca202fae040bae
Never got SharedPreferences working for this system service. Didn't really need it anyway.
Using a straight up file now.
bug:2576057
Change-Id: Idad926e8242a85e22718c25f3f6c03e5749badac
Don't use hard coded defaults - use build configs instead.
Iface is now ONLY set by config so gservices doesn't need to.
bug:2576057
Change-Id: I8f9e3bc51af3b1cdf8bb4290a43197d9c01e2a14
Currently warns if you exceed more than 25% and 2*100%*timeUsed/(timeUsed+totalTime)
The formula means that imagining you've got half of the remaining time that you really have,
we will warn you if you would exceed the quota given your rate so far. It's generous during the
early to mid-life and converges back to the limit as your timeUsed approaches totalTime.
bug:2576057
Change-Id: Id189de5b026f927ef478fd212d61d9e4ab5239e6
Added ContentObserver to watch relevant Secure Settings.
Also added new policy-change broadcast to let settings know.
Lastly reorged things a bit so that all of our broadcasts are sent at boot so the sticky ones
are populated.
bug:2576057
Change-Id: Ie11ffb057de9c801a5088612cd464ea062f3a666