Merge "Import translations. DO NOT MERGE"
diff --git a/src/com/android/settings/datausage/BillingCycleSettings.java b/src/com/android/settings/datausage/BillingCycleSettings.java
index a17c8fc..7e659c3 100644
--- a/src/com/android/settings/datausage/BillingCycleSettings.java
+++ b/src/com/android/settings/datausage/BillingCycleSettings.java
@@ -48,6 +48,7 @@
private static final String TAG = "BillingCycleSettings";
private static final boolean LOGD = false;
+ private static final long MAX_DATA_LIMIT_BYTES = 50000 * GB_IN_BYTES;
private static final String TAG_CONFIRM_LIMIT = "confirmLimit";
private static final String TAG_CYCLE_EDITOR = "cycleEditor";
@@ -228,10 +229,13 @@
}
final long bytes = (long) (Float.valueOf(bytesString)
* (spinner.getSelectedItemPosition() == 0 ? MB_IN_BYTES : GB_IN_BYTES));
+
+ // to fix the overflow problem
+ final long correctedBytes = Math.min(MAX_DATA_LIMIT_BYTES, bytes);
if (isLimit) {
- editor.setPolicyLimitBytes(template, bytes);
+ editor.setPolicyLimitBytes(template, correctedBytes);
} else {
- editor.setPolicyWarningBytes(template, bytes);
+ editor.setPolicyWarningBytes(template, correctedBytes);
}
target.updatePrefs();
}
diff --git a/tests/unit/src/com/android/settings/TetherServiceTest.java b/tests/unit/src/com/android/settings/TetherServiceTest.java
index e2bb5f8..bec3e7e 100644
--- a/tests/unit/src/com/android/settings/TetherServiceTest.java
+++ b/tests/unit/src/com/android/settings/TetherServiceTest.java
@@ -239,7 +239,7 @@
assertTrue(waitForProvisionRequest(TETHERING_WIFI));
assertTrue(waitForProvisionResponse(TETHER_ERROR_PROVISION_FAILED));
- verify(mWifiManager).setWifiApEnabled(isNull(WifiConfiguration.class), eq(false));
+ verify(mConnectivityManager).stopTethering(ConnectivityManager.TETHERING_WIFI);
}
public void testFailureStopsTethering_Usb() {