Log more RetryManager information.
6505637 had unexplainable behavior. Add some logging so we can see
what's going on.
bug:6505637
Change-Id: I43c2ce7f8d12271d988b112f47589d0fba2b6955
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 @@
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 @@
*/
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 @@
/** 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 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 @@
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 @@
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 @@
// 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 @@
}
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 @@
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 @@
} else {
retVal = true;
}
- if (DBG) log("validateNonNegative: " + name + ", " + value + ", " + retVal);
+ if (VDBG) log("validateNonNegative: " + name + ", " + value + ", " + retVal);
return retVal;
}