Merge "Empty DC's apnList when the DC is free." into jb-dev
This commit is contained in:
@ -996,9 +996,23 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean dataConnectionNotInUse(DataConnectionAc dcac) {
|
private boolean dataConnectionNotInUse(DataConnectionAc dcac) {
|
||||||
|
if (DBG) log("dataConnectionNotInUse: check if dcac is inuse dc=" + dcac.dataConnection);
|
||||||
for (ApnContext apnContext : mApnContexts.values()) {
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2131,14 +2145,14 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
|
|||||||
protected void onDisconnectDone(int connId, AsyncResult ar) {
|
protected void onDisconnectDone(int connId, AsyncResult ar) {
|
||||||
ApnContext apnContext = null;
|
ApnContext apnContext = null;
|
||||||
|
|
||||||
if(DBG) log("onDisconnectDone: EVENT_DISCONNECT_DONE connId=" + connId);
|
|
||||||
if (ar.userObj instanceof ApnContext) {
|
if (ar.userObj instanceof ApnContext) {
|
||||||
apnContext = (ApnContext) ar.userObj;
|
apnContext = (ApnContext) ar.userObj;
|
||||||
} else {
|
} else {
|
||||||
loge("Invalid ar in onDisconnectDone");
|
loge("onDisconnectDone: Invalid ar in onDisconnectDone, ignore");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(DBG) log("onDisconnectDone: EVENT_DISCONNECT_DONE apnContext=" + apnContext);
|
||||||
apnContext.setState(State.IDLE);
|
apnContext.setState(State.IDLE);
|
||||||
|
|
||||||
mPhone.notifyDataConnection(apnContext.getReason(), apnContext.getApnType());
|
mPhone.notifyDataConnection(apnContext.getReason(), apnContext.getApnType());
|
||||||
|
Reference in New Issue
Block a user