am b6c770e4: am 0b2ebe9b: Merge "Respond to changes in throttle policy." into froyo

Merge commit 'b6c770e4e387bd73d4e7d4cbad99079b37f59043' into kraken

* commit 'b6c770e4e387bd73d4e7d4cbad99079b37f59043':
  Respond to changes in throttle policy.
This commit is contained in:
Robert Greenwalt
2010-04-23 13:55:05 -07:00
committed by Android Git Automerger

View File

@@ -391,6 +391,9 @@ public class ThrottleService extends IThrottleManager.Stub {
", resetDay=" + mPolicyResetDay + ", noteType=" + ", resetDay=" + mPolicyResetDay + ", noteType=" +
mPolicyNotificationsAllowedMask); mPolicyNotificationsAllowedMask);
// force updates
mThrottleIndex = THROTTLE_INDEX_UNINITIALIZED;
onResetAlarm(); onResetAlarm();
onPollAlarm(); onPollAlarm();
@@ -490,6 +493,7 @@ public class ThrottleService extends IThrottleManager.Stub {
} // else already up! } // else already up!
} else { } else {
clearThrottleAndNotification();
if ((mPolicyNotificationsAllowedMask & NOTIFICATION_WARNING) != 0) { if ((mPolicyNotificationsAllowedMask & NOTIFICATION_WARNING) != 0) {
// check if we should warn about throttle // check if we should warn about throttle
// pretend we only have 1/2 the time remaining that we actually do // 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); Intent broadcast = new Intent(ThrottleManager.THROTTLE_ACTION);
broadcast.putExtra(ThrottleManager.EXTRA_THROTTLE_LEVEL, -1); broadcast.putExtra(ThrottleManager.EXTRA_THROTTLE_LEVEL, -1);
mContext.sendStickyBroadcast(broadcast); 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) { private Calendar calculatePeriodEnd(long now) {
@@ -627,7 +631,6 @@ public class ThrottleService extends IThrottleManager.Stub {
Calendar start = calculatePeriodStart(end); Calendar start = calculatePeriodStart(end);
if (mRecorder.setNextPeriod(start, end)) { if (mRecorder.setNextPeriod(start, end)) {
clearThrottleAndNotification();
onPollAlarm(); onPollAlarm();
} }