diff options
author | Robert Greenwalt <rgreenwalt@google.com> | 2012-05-16 15:59:49 -0700 |
---|---|---|
committer | Robert Greenwalt <rgreenwalt@google.com> | 2012-05-16 17:15:12 -0700 |
commit | 83daf6c5aea671086ca152d02378da194770168b (patch) | |
tree | a5615a35bf03b5f2f6286f01fb62e243a2236b22 /telephony | |
parent | a0e0d5806c9aa12e291d9ceb60a35eb9b7fde5b0 (diff) | |
download | frameworks_base-83daf6c5aea671086ca152d02378da194770168b.zip frameworks_base-83daf6c5aea671086ca152d02378da194770168b.tar.gz frameworks_base-83daf6c5aea671086ca152d02378da194770168b.tar.bz2 |
Log more RetryManager information.
6505637 had unexplainable behavior. Add some logging so we can see
what's going on.
bug:6505637
Change-Id: I43c2ce7f8d12271d988b112f47589d0fba2b6955
Diffstat (limited to 'telephony')
-rw-r--r-- | telephony/java/com/android/internal/telephony/DataConnection.java | 1 | ||||
-rw-r--r-- | telephony/java/com/android/internal/telephony/RetryManager.java | 41 |
2 files changed, 28 insertions, 14 deletions
diff --git a/telephony/java/com/android/internal/telephony/DataConnection.java b/telephony/java/com/android/internal/telephony/DataConnection.java index 7c70a7e..0033ceb 100644 --- a/telephony/java/com/android/internal/telephony/DataConnection.java +++ b/telephony/java/com/android/internal/telephony/DataConnection.java @@ -1256,6 +1256,7 @@ public abstract class DataConnection extends StateMachine { pw.println(" mRetryOverride=" + mRetryOverride); pw.println(" mRefCount=" + mRefCount); pw.println(" userData=" + userData); + if (mRetryMgr != null) pw.println(" " + mRetryMgr); pw.flush(); } } diff --git a/telephony/java/com/android/internal/telephony/RetryManager.java b/telephony/java/com/android/internal/telephony/RetryManager.java index 29bd104..ae451b9 100644 --- a/telephony/java/com/android/internal/telephony/RetryManager.java +++ b/telephony/java/com/android/internal/telephony/RetryManager.java @@ -74,7 +74,8 @@ import java.util.ArrayList; */ public class RetryManager { static public final String LOG_TAG = "RetryManager"; - static public final boolean DBG = false; + static public final boolean DBG = true; + static public final boolean VDBG = false; /** * Retry record with times in milli-seconds @@ -107,9 +108,20 @@ public class RetryManager { /** Random number generator */ private Random rng = new Random(); + private String mConfig; + /** Constructor */ public RetryManager() { - if (DBG) log("constructor"); + if (VDBG) log("constructor"); + } + + public String toString() { + String ret = "RetryManager: forever=" + mRetryForever + ", maxRetry=" + mMaxRetryCount + + ", retry=" + mRetryCount + ",\n " + mConfig; + for (RetryRec r : mRetryArray) { + ret += "\n " + r.mDelayTime + ":" + r.mRandomizationTime; + } + return ret; } /** @@ -127,7 +139,7 @@ public class RetryManager { public boolean configure(int maxRetryCount, int retryTime, int randomizationTime) { Pair<Boolean, Integer> value; - if (DBG) log("configure: " + maxRetryCount + ", " + retryTime + "," + randomizationTime); + if (VDBG) log("configure: " + maxRetryCount + ", " + retryTime + "," + randomizationTime); if (!validateNonNegativeInt("maxRetryCount", maxRetryCount)) { return false; @@ -161,12 +173,13 @@ public class RetryManager { if ((configStr.startsWith("\"") && configStr.endsWith("\""))) { configStr = configStr.substring(1, configStr.length()-1); } - if (DBG) log("configure: '" + configStr + "'"); + if (VDBG) log("configure: '" + configStr + "'"); + mConfig = configStr; if (!TextUtils.isEmpty(configStr)) { int defaultRandomization = 0; - if (DBG) log("configure: not empty"); + if (VDBG) log("configure: not empty"); mMaxRetryCount = 0; resetRetryCount(); @@ -174,14 +187,14 @@ public class RetryManager { String strArray[] = configStr.split(","); for (int i = 0; i < strArray.length; i++) { - if (DBG) log("configure: strArray[" + i + "]='" + strArray[i] + "'"); + if (VDBG) log("configure: strArray[" + i + "]='" + strArray[i] + "'"); Pair<Boolean, Integer> value; String splitStr[] = strArray[i].split("=", 2); splitStr[0] = splitStr[0].trim(); - if (DBG) log("configure: splitStr[0]='" + splitStr[0] + "'"); + if (VDBG) log("configure: splitStr[0]='" + splitStr[0] + "'"); if (splitStr.length > 1) { splitStr[1] = splitStr[1].trim(); - if (DBG) log("configure: splitStr[1]='" + splitStr[1] + "'"); + if (VDBG) log("configure: splitStr[1]='" + splitStr[1] + "'"); if (TextUtils.equals(splitStr[0], "default_randomization")) { value = parseNonNegativeInt(splitStr[0], splitStr[1]); if (!value.first) return false; @@ -214,7 +227,7 @@ public class RetryManager { // Check if optional randomization value present if (splitStr.length > 1) { splitStr[1] = splitStr[1].trim(); - if (DBG) log("configure: splitStr[1]='" + splitStr[1] + "'"); + if (VDBG) log("configure: splitStr[1]='" + splitStr[1] + "'"); value = parseNonNegativeInt("randomizationTime", splitStr[1]); if (!value.first) return false; rr.mRandomizationTime = value.second; @@ -226,12 +239,12 @@ public class RetryManager { } if (mRetryArray.size() > mMaxRetryCount) { mMaxRetryCount = mRetryArray.size(); - if (DBG) log("configure: setting mMaxRetryCount=" + mMaxRetryCount); + if (VDBG) log("configure: setting mMaxRetryCount=" + mMaxRetryCount); } - if (DBG) log("configure: true"); + if (VDBG) log("configure: true"); return true; } else { - if (DBG) log("configure: false it's empty"); + if (VDBG) log("configure: false it's empty"); return false; } } @@ -349,7 +362,7 @@ public class RetryManager { Log.e(LOG_TAG, name + " bad value: " + stringValue, e); retVal = new Pair<Boolean, Integer>(false, 0); } - if (DBG) log("parseNonNetativeInt: " + name + ", " + stringValue + ", " + if (VDBG) log("parseNonNetativeInt: " + name + ", " + stringValue + ", " + retVal.first + ", " + retVal.second); return retVal; } @@ -369,7 +382,7 @@ public class RetryManager { } else { retVal = true; } - if (DBG) log("validateNonNegative: " + name + ", " + value + ", " + retVal); + if (VDBG) log("validateNonNegative: " + name + ", " + value + ", " + retVal); return retVal; } |