summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorRobert Greenwalt <robdroid@android.com>2010-04-22 15:39:38 -0700
committerRobert Greenwalt <robdroid@android.com>2010-04-22 15:39:38 -0700
commitfb9896b5cdb149594fa1b36ac77038d90091a957 (patch)
treed228c1a0908aab6ce5365b483dc733072afe25db /services
parenta6ece18d95a35acc4fb3f9648403ce42d0d6b2d7 (diff)
downloadframeworks_base-fb9896b5cdb149594fa1b36ac77038d90091a957.zip
frameworks_base-fb9896b5cdb149594fa1b36ac77038d90091a957.tar.gz
frameworks_base-fb9896b5cdb149594fa1b36ac77038d90091a957.tar.bz2
Add a Throttle check shortly after boot.
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
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/ThrottleService.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/services/java/com/android/server/ThrottleService.java b/services/java/com/android/server/ThrottleService.java
index 4ff0fb9..58a642e 100644
--- a/services/java/com/android/server/ThrottleService.java
+++ b/services/java/com/android/server/ThrottleService.java
@@ -75,6 +75,7 @@ public class ThrottleService extends IThrottleManager.Stub {
private Context mContext;
+ private static final int INITIAL_POLL_DELAY_SEC = 90;
private static final int TESTING_POLLING_PERIOD_SEC = 60 * 1;
private static final int TESTING_RESET_PERIOD_SEC = 60 * 10;
private static final long TESTING_THRESHOLD = 1 * 1024 * 1024;
@@ -331,6 +332,12 @@ public class ThrottleService extends IThrottleManager.Stub {
// get policy
mHandler.obtainMessage(EVENT_POLICY_CHANGED).sendToTarget();
+
+ // if we poll now we won't have network connectivity or even imsi access
+ // queue up a poll to happen in a little while - after ntp and imsi are avail
+ // TODO - make this callback based (ie, listen for notificaitons)
+ mHandler.sendMessageDelayed(mHandler.obtainMessage(EVENT_POLL_ALARM),
+ INITIAL_POLL_DELAY_SEC * 1000);
}
// check for new policy info (threshold limit/value/etc)