summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorRobert Greenwalt <robdroid@android.com>2010-04-23 13:15:44 -0700
committerRobert Greenwalt <robdroid@android.com>2010-04-23 13:15:44 -0700
commit5bf16d6e8c0afae4e60590ffbdbed1bd6e73ff8b (patch)
tree12442732ee0ab3331d61d7ad4bcb86f6eb71c95e /services
parent251ccef0445d4456809bfc41a6344e2dae24f2c3 (diff)
downloadframeworks_base-5bf16d6e8c0afae4e60590ffbdbed1bd6e73ff8b.zip
frameworks_base-5bf16d6e8c0afae4e60590ffbdbed1bd6e73ff8b.tar.gz
frameworks_base-5bf16d6e8c0afae4e60590ffbdbed1bd6e73ff8b.tar.bz2
Respond to changes in throttle policy.
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
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/ThrottleService.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/services/java/com/android/server/ThrottleService.java b/services/java/com/android/server/ThrottleService.java
index 58a642e..2fe7420 100644
--- a/services/java/com/android/server/ThrottleService.java
+++ b/services/java/com/android/server/ThrottleService.java
@@ -391,6 +391,9 @@ public class ThrottleService extends IThrottleManager.Stub {
", resetDay=" + mPolicyResetDay + ", noteType=" +
mPolicyNotificationsAllowedMask);
+ // force updates
+ mThrottleIndex = THROTTLE_INDEX_UNINITIALIZED;
+
onResetAlarm();
onPollAlarm();
@@ -490,6 +493,7 @@ public class ThrottleService extends IThrottleManager.Stub {
} // else already up!
} else {
+ clearThrottleAndNotification();
if ((mPolicyNotificationsAllowedMask & NOTIFICATION_WARNING) != 0) {
// check if we should warn about throttle
// pretend we only have 1/2 the time remaining that we actually do
@@ -566,9 +570,9 @@ public class ThrottleService extends IThrottleManager.Stub {
Intent broadcast = new Intent(ThrottleManager.THROTTLE_ACTION);
broadcast.putExtra(ThrottleManager.EXTRA_THROTTLE_LEVEL, -1);
mContext.sendStickyBroadcast(broadcast);
+ mNotificationManager.cancel(R.drawable.stat_sys_throttled);
+ mWarningNotificationSent = false;
}
- mNotificationManager.cancel(R.drawable.stat_sys_throttled);
- mWarningNotificationSent = false;
}
private Calendar calculatePeriodEnd(long now) {
@@ -627,7 +631,6 @@ public class ThrottleService extends IThrottleManager.Stub {
Calendar start = calculatePeriodStart(end);
if (mRecorder.setNextPeriod(start, end)) {
- clearThrottleAndNotification();
onPollAlarm();
}