summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorRobert Greenwalt <robdroid@android.com>2010-04-26 15:43:27 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-04-26 15:43:27 -0700
commitb344456083a4fa3911ebf58c73f022827cc073eb (patch)
treed2a002652b1861cc5b7bee76bc40459e4a6d1130 /services
parent0ff9212d077e77f8b3e0afa232293306c0f72d07 (diff)
parent27fba6797b07583ef6c280bc287bf327e47f5e66 (diff)
downloadframeworks_base-b344456083a4fa3911ebf58c73f022827cc073eb.zip
frameworks_base-b344456083a4fa3911ebf58c73f022827cc073eb.tar.gz
frameworks_base-b344456083a4fa3911ebf58c73f022827cc073eb.tar.bz2
am 27fba679: Fix Throttle reset.
Merge commit '27fba6797b07583ef6c280bc287bf327e47f5e66' into froyo-plus-aosp * commit '27fba6797b07583ef6c280bc287bf327e47f5e66': Fix Throttle reset.
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/ThrottleService.java36
1 files changed, 16 insertions, 20 deletions
diff --git a/services/java/com/android/server/ThrottleService.java b/services/java/com/android/server/ThrottleService.java
index a1aa555..6a5bbd2 100644
--- a/services/java/com/android/server/ThrottleService.java
+++ b/services/java/com/android/server/ThrottleService.java
@@ -732,23 +732,25 @@ public class ThrottleService extends IThrottleManager.Stub {
checkForSubscriberId();
boolean startNewPeriod = true;
- // if we rolled back in time, toss out
- // if we rolled foward, advance to the next
- if (end.before(mPeriodStart)) {
+ if (start.equals(mPeriodStart) && end.equals(mPeriodEnd)) {
+ // same endpoints - keep collecting
if (DBG) {
- Slog.d(TAG, "next period (" + start.getTimeInMillis() + "," +
- end.getTimeInMillis() + ") - old start was " +
- mPeriodStart.getTimeInMillis() + ", wiping");
+ Slog.d(TAG, "same period (" + start.getTimeInMillis() + "," +
+ end.getTimeInMillis() +") - ammending data");
}
- synchronized (mParent) {
- mPeriodRxData[mCurrentPeriod] = 0;
- mPeriodTxData[mCurrentPeriod] = 0;
- }
- } else if(start.after(mPeriodEnd)) {
+ startNewPeriod = false;
+ } else {
if (DBG) {
- Slog.d(TAG, "next period (" + start.getTimeInMillis() + "," +
- end.getTimeInMillis() + ") - old end was " +
- mPeriodEnd.getTimeInMillis() + ", following");
+ if(start.equals(mPeriodEnd) || start.after(mPeriodEnd)) {
+ Slog.d(TAG, "next period (" + start.getTimeInMillis() + "," +
+ end.getTimeInMillis() + ") - old end was " +
+ mPeriodEnd.getTimeInMillis() + ", following");
+ } else {
+ Slog.d(TAG, "new period (" + start.getTimeInMillis() + "," +
+ end.getTimeInMillis() + ") replacing old (" +
+ mPeriodStart.getTimeInMillis() + "," +
+ mPeriodEnd.getTimeInMillis() + ")");
+ }
}
synchronized (mParent) {
++mCurrentPeriod;
@@ -756,12 +758,6 @@ public class ThrottleService extends IThrottleManager.Stub {
mPeriodRxData[mCurrentPeriod] = 0;
mPeriodTxData[mCurrentPeriod] = 0;
}
- } else {
- startNewPeriod = false;
- if (DBG) {
- Slog.d(TAG, "next period (" + start.getTimeInMillis() + "," +
- end.getTimeInMillis() + ") - we fit - ammending to last period");
- }
}
setPeriodStart(start);
setPeriodEnd(end);