diff options
author | Wink Saville <wink@google.com> | 2009-08-13 14:18:00 -0700 |
---|---|---|
committer | Wink Saville <wink@google.com> | 2009-08-13 14:18:00 -0700 |
commit | a03ab1a6a07614f3d588232e12d9c45d840bae82 (patch) | |
tree | 386d275ee29c04b0788931559a274a1a539f114b /telephony/java | |
parent | ddb79c9fd53893aa126599330a9289497e5f5c93 (diff) | |
download | frameworks_base-a03ab1a6a07614f3d588232e12d9c45d840bae82.zip frameworks_base-a03ab1a6a07614f3d588232e12d9c45d840bae82.tar.gz frameworks_base-a03ab1a6a07614f3d588232e12d9c45d840bae82.tar.bz2 |
Allow max_retires to be set to infinite.
Setting max_retires to infinite sets mRetryForever to true and therefore
isRetryNeeded will always be true. This is better than an alternative
which is to set max_retires to a large value such as 2147483647.
Diffstat (limited to 'telephony/java')
-rw-r--r-- | telephony/java/com/android/internal/telephony/RetryManager.java | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/telephony/java/com/android/internal/telephony/RetryManager.java b/telephony/java/com/android/internal/telephony/RetryManager.java index 242b2cd..385b191 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; *</ul> *<p> * 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: * <ul><li><code>"max_retries=10, default_randomization=500, 1000, 2000, 3000"</code></ul> * - * <li>4 retires with a 100ms default randomization value for the first 2 values and - * the other two having specified values of 500ms: + * <li>4 retires with a 100 as the default randomization value for the first 2 values and + * the other two having specified values of 500: * <ul><li><code>"default_randomization=100, 1000, 2000, 4000:500, 5000:500"</code></ul> + * + * <li>Infinite number of retires with the first one at 1000, the second at 2000 all + * others will be at 3000. + * <ul><li><code>"max_retries=infinite,1000,2000,3000</code></ul> * </ul> * * {@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]); |