summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Robert Greenwalt <robdroid@android.com> 2010-04-09 09:29:20 -0700
committer Android (Google) Code Review <android-gerrit@google.com> 2010-04-09 09:29:21 -0700
commitcb27041034343a6a15f0812d04f66fefbed30686 (patch)
tree4b0059666651d996e92ec733fd472a1cc032ed15
parent9da7730d5f97270c356ee86298c5d6d45f39b264 (diff)
parent5f996899b058f0eb6655d3fe3fd3a5d93256e6c5 (diff)
Merge "Roaming data doesn't count against limits" into froyo
-rw-r--r--services/java/com/android/server/ThrottleService.java20
1 files changed, 10 insertions, 10 deletions
diff --git a/services/java/com/android/server/ThrottleService.java b/services/java/com/android/server/ThrottleService.java
index 64153b96289d..1d73ff212a67 100644
--- a/services/java/com/android/server/ThrottleService.java
+++ b/services/java/com/android/server/ThrottleService.java
@@ -44,6 +44,8 @@ import android.os.SystemProperties;
import android.provider.Settings;
import android.util.Slog;
+import com.android.internal.telephony.TelephonyProperties;
+
import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.Calendar;
@@ -319,15 +321,19 @@ public class ThrottleService extends IThrottleManager.Stub {
} catch (RemoteException e) {
Slog.e(TAG, "got remoteException in onPollAlarm:" + e);
}
-
- mRecorder.addData(incRead, incWrite);
+ // don't count this data if we're roaming.
+ boolean roaming = "true".equals(
+ SystemProperties.get(TelephonyProperties.PROPERTY_OPERATOR_ISROAMING));
+ if (!roaming) {
+ mRecorder.addData(incRead, incWrite);
+ }
long periodRx = mRecorder.getPeriodRx(0);
long periodTx = mRecorder.getPeriodTx(0);
long total = periodRx + periodTx;
if (DBG) {
- Slog.d(TAG, "onPollAlarm - now =" + now + ", read =" + incRead +
- ", written =" + incWrite + ", new total =" + total);
+ Slog.d(TAG, "onPollAlarm - now =" + now + ", roaming =" + roaming +
+ ", read =" + incRead + ", written =" + incWrite + ", new total =" + total);
}
mLastRead += incRead;
mLastWrite += incWrite;
@@ -686,12 +692,6 @@ public class ThrottleService extends IThrottleManager.Stub {
}
long getPeriodRx(int which) {
- if (DBG) { // TODO - remove
- Slog.d(TAG, "reading slot "+ which +" with current =" + mCurrentPeriod);
- for(int x = 0; x<mPeriodCount; x++) {
- Slog.d(TAG, " " + x + " = " + mPeriodRxData[x]);
- }
- }
synchronized (mParent) {
if (which > mPeriodCount) return 0;
which = mCurrentPeriod - which;