Merge commit 'a68780dd0f0af0938b72fdf6539db575da471028' into kraken * commit 'a68780dd0f0af0938b72fdf6539db575da471028': Roaming data doesn't count against limits
This commit is contained in:
@@ -44,6 +44,8 @@ import android.os.SystemProperties;
|
|||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
import android.util.Slog;
|
import android.util.Slog;
|
||||||
|
|
||||||
|
import com.android.internal.telephony.TelephonyProperties;
|
||||||
|
|
||||||
import java.io.FileDescriptor;
|
import java.io.FileDescriptor;
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
@@ -319,15 +321,19 @@ public class ThrottleService extends IThrottleManager.Stub {
|
|||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
Slog.e(TAG, "got remoteException in onPollAlarm:" + e);
|
Slog.e(TAG, "got remoteException in onPollAlarm:" + e);
|
||||||
}
|
}
|
||||||
|
// don't count this data if we're roaming.
|
||||||
mRecorder.addData(incRead, incWrite);
|
boolean roaming = "true".equals(
|
||||||
|
SystemProperties.get(TelephonyProperties.PROPERTY_OPERATOR_ISROAMING));
|
||||||
|
if (!roaming) {
|
||||||
|
mRecorder.addData(incRead, incWrite);
|
||||||
|
}
|
||||||
|
|
||||||
long periodRx = mRecorder.getPeriodRx(0);
|
long periodRx = mRecorder.getPeriodRx(0);
|
||||||
long periodTx = mRecorder.getPeriodTx(0);
|
long periodTx = mRecorder.getPeriodTx(0);
|
||||||
long total = periodRx + periodTx;
|
long total = periodRx + periodTx;
|
||||||
if (DBG) {
|
if (DBG) {
|
||||||
Slog.d(TAG, "onPollAlarm - now =" + now + ", read =" + incRead +
|
Slog.d(TAG, "onPollAlarm - now =" + now + ", roaming =" + roaming +
|
||||||
", written =" + incWrite + ", new total =" + total);
|
", read =" + incRead + ", written =" + incWrite + ", new total =" + total);
|
||||||
}
|
}
|
||||||
mLastRead += incRead;
|
mLastRead += incRead;
|
||||||
mLastWrite += incWrite;
|
mLastWrite += incWrite;
|
||||||
@@ -686,12 +692,6 @@ public class ThrottleService extends IThrottleManager.Stub {
|
|||||||
}
|
}
|
||||||
|
|
||||||
long getPeriodRx(int which) {
|
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) {
|
synchronized (mParent) {
|
||||||
if (which > mPeriodCount) return 0;
|
if (which > mPeriodCount) return 0;
|
||||||
which = mCurrentPeriod - which;
|
which = mCurrentPeriod - which;
|
||||||
|
|||||||
Reference in New Issue
Block a user