diff options
author | Wink Saville <wink@google.com> | 2012-08-21 22:58:54 -0700 |
---|---|---|
committer | Wink Saville <wink@google.com> | 2012-08-21 22:58:54 -0700 |
commit | b44b13a3f5967a7ce80f7124dc7b9c486f49c275 (patch) | |
tree | 1befa3d9509978931182d141f8fc6bdd6e4733dd | |
parent | a18cfccac509e124d0a80c109a5711b336d41f75 (diff) | |
download | base-b44b13a3f5967a7ce80f7124dc7b9c486f49c275.tar.gz |
Empty DC's apnList when the DC is free.
Not doing this causes DC.apnList's to have multiple entries in the
apnlist which causes DC's to look like its connected to both IMS and
INTERNET. And when selecting CDMA only mode on a Xoom we will not bring
up the connection thus no data connectivity.
Bug: 6939338
Change-Id: I17bc17cd1938ebac773db8131d12d0fa724348b0
-rw-r--r-- | telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java | 20 |
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()); |