diff --git a/telephony/java/com/android/internal/telephony/RetryManager.java b/telephony/java/com/android/internal/telephony/RetryManager.java
index 242b2cd8a1483..385b19101c3bb 100644
--- a/telephony/java/com/android/internal/telephony/RetryManager.java
+++ b/telephony/java/com/android/internal/telephony/RetryManager.java
@@ -41,7 +41,8 @@ import java.util.ArrayList;
*
*
* max_retries is the number of times that incrementRetryCount
- * maybe called before isRetryNeeded will return false.
+ * maybe called before isRetryNeeded will return false. if value
+ * is infinite then isRetryNeeded will always return true.
*
* default_randomizationTime will be used as the randomizationTime
* for delay times which have no supplied randomizationTime. If
@@ -60,9 +61,13 @@ import java.util.ArrayList;
* the 4..10 retries all using 3000 as the delay:
*
"max_retries=10, default_randomization=500, 1000, 2000, 3000"
*
- * 4 retires with a 100ms default randomization value for the first 2 values and
- * the other two having specified values of 500ms:
+ * 4 retires with a 100 as the default randomization value for the first 2 values and
+ * the other two having specified values of 500:
* "default_randomization=100, 1000, 2000, 4000:500, 5000:500"
+ *
+ * Infinite number of retires with the first one at 1000, the second at 2000 all
+ * others will be at 3000.
+ * "max_retries=infinite,1000,2000,3000
*
*
* {@hide}
@@ -181,9 +186,13 @@ public class RetryManager {
if (!value.first) return false;
defaultRandomization = value.second;
} else if (TextUtils.equals(splitStr[0], "max_retries")) {
- value = parseNonNegativeInt(splitStr[0], splitStr[1]);
- if (!value.first) return false;
- mMaxRetryCount = value.second;
+ if (TextUtils.equals("infinite",splitStr[1])) {
+ mRetryForever = true;
+ } else {
+ value = parseNonNegativeInt(splitStr[0], splitStr[1]);
+ if (!value.first) return false;
+ mMaxRetryCount = value.second;
+ }
} else {
Log.e(LOG_TAG, "Unrecognized configuration name value pair: "
+ strArray[i]);
diff --git a/tests/CoreTests/com/android/internal/telephony/TelephonyUtilsTest.java b/tests/CoreTests/com/android/internal/telephony/TelephonyUtilsTest.java
index e4cf1e82693c6..bf0c88b7cc2d3 100644
--- a/tests/CoreTests/com/android/internal/telephony/TelephonyUtilsTest.java
+++ b/tests/CoreTests/com/android/internal/telephony/TelephonyUtilsTest.java
@@ -122,6 +122,29 @@ public class TelephonyUtilsTest extends TestCase {
assertFalse(rm.isRetryNeeded());
}
+ /**
+ * Test infinite retires
+ */
+ @SmallTest
+ public void testRetryManageInfinite() throws Exception {
+ RetryManager rm = new RetryManager();
+
+ assertTrue(rm.configure("1000,2000,3000,max_retries=infinite"));
+ assertTrue(rm.isRetryNeeded());
+ assertEquals(1000, rm.getRetryTimer());
+ rm.increaseRetryCount();
+ assertTrue(rm.isRetryNeeded());
+ assertEquals(2000, rm.getRetryTimer());
+ rm.increaseRetryCount();
+ assertTrue(rm.isRetryNeeded());
+ // All others are 3000 and isRetryNeeded is always true
+ for (int i=0; i < 100; i++) {
+ assertEquals(3000, rm.getRetryTimer());
+ rm.increaseRetryCount();
+ assertTrue(rm.isRetryNeeded());
+ }
+ }
+
/**
* Test string configuration using all options.
*/