summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWink Saville <wink@google.com>2012-08-22 11:49:47 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-08-22 11:49:48 -0700
commit2e2849a5e4927fce51be7f0bd44fbf07e4bcd14d (patch)
tree75b3a64f95166ce5dc173b9bc7b881316985bf20
parent72404a82d30ff0631a31aed93f221c1fdf210888 (diff)
parentb44b13a3f5967a7ce80f7124dc7b9c486f49c275 (diff)
downloadbase-2e2849a5e4927fce51be7f0bd44fbf07e4bcd14d.tar.gz
Merge "Empty DC's apnList when the DC is free." into jb-dev
-rw-r--r--telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java20
1 files changed, 17 insertions, 3 deletions
diff --git a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java
index a971066a6bad..23364b49a101 100644
--- a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java
+++ b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java
@@ -996,9 +996,23 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
}
private boolean dataConnectionNotInUse(DataConnectionAc dcac) {
+ if (DBG) log("dataConnectionNotInUse: check if dcac is inuse dc=" + dcac.dataConnection);
for (ApnContext apnContext : mApnContexts.values()) {
- if (apnContext.getDataConnectionAc() == dcac) return false;
+ if (apnContext.getDataConnectionAc() == dcac) {
+ if (DBG) log("dataConnectionNotInUse: in use by apnContext=" + apnContext);
+ return false;
+ }
+ }
+ // TODO: Fix retry handling so free DataConnections have empty apnlists.
+ // Probably move retry handling into DataConnections and reduce complexity
+ // of DCT.
+ for (ApnContext apnContext : dcac.getApnListSync()) {
+ if (DBG) {
+ log("dataConnectionNotInUse: removing apnContext=" + apnContext);
+ }
+ dcac.removeApnContextSync(apnContext);
}
+ if (DBG) log("dataConnectionNotInUse: not in use return true");
return true;
}
@@ -2131,14 +2145,14 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
protected void onDisconnectDone(int connId, AsyncResult ar) {
ApnContext apnContext = null;
- if(DBG) log("onDisconnectDone: EVENT_DISCONNECT_DONE connId=" + connId);
if (ar.userObj instanceof ApnContext) {
apnContext = (ApnContext) ar.userObj;
} else {
- loge("Invalid ar in onDisconnectDone");
+ loge("onDisconnectDone: Invalid ar in onDisconnectDone, ignore");
return;
}
+ if(DBG) log("onDisconnectDone: EVENT_DISCONNECT_DONE apnContext=" + apnContext);
apnContext.setState(State.IDLE);
mPhone.notifyDataConnection(apnContext.getReason(), apnContext.getApnType());