am dc26a0c8: Merge "Clean up calls immediately if cid become inactive in unsol data state changed" into honeycomb-LTE

* commit 'dc26a0c8d4ce4edcddcfc6b8e810ae5f8e73cda4':
  Clean up calls immediately if cid become inactive in unsol data state changed
This commit is contained in:
Wink Saville
2011-04-16 14:47:15 -07:00
committed by Android Git Automerger
2 changed files with 11 additions and 26 deletions

View File

@@ -97,7 +97,6 @@ public abstract class DataConnectionTracker extends Handler {
protected static final int EVENT_TRY_SETUP_DATA = 5; protected static final int EVENT_TRY_SETUP_DATA = 5;
protected static final int EVENT_DATA_STATE_CHANGED = 6; protected static final int EVENT_DATA_STATE_CHANGED = 6;
protected static final int EVENT_POLL_PDP = 7; protected static final int EVENT_POLL_PDP = 7;
protected static final int EVENT_GET_PDP_LIST_COMPLETE = 11;
protected static final int EVENT_RADIO_OFF_OR_NOT_AVAILABLE = 12; protected static final int EVENT_RADIO_OFF_OR_NOT_AVAILABLE = 12;
protected static final int EVENT_VOICE_CALL_STARTED = 14; protected static final int EVENT_VOICE_CALL_STARTED = 14;
protected static final int EVENT_VOICE_CALL_ENDED = 15; protected static final int EVENT_VOICE_CALL_ENDED = 15;

View File

@@ -996,7 +996,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
* via an unsolicited response (which could have happened at any * via an unsolicited response (which could have happened at any
* previous state * previous state
*/ */
private void onDataStateChanged (AsyncResult ar, boolean explicitPoll) { private void onDataStateChanged (AsyncResult ar) {
ArrayList<DataCallState> dataCallStates; ArrayList<DataCallState> dataCallStates;
dataCallStates = (ArrayList<DataCallState>)(ar.result); dataCallStates = (ArrayList<DataCallState>)(ar.result);
@@ -1009,12 +1009,11 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
} }
for (ApnContext apnContext : mApnContexts.values()) { for (ApnContext apnContext : mApnContexts.values()) {
onDataStateChanged(dataCallStates, explicitPoll, apnContext); onDataStateChanged(dataCallStates, apnContext);
} }
} }
private void onDataStateChanged (ArrayList<DataCallState> dataCallStates, private void onDataStateChanged (ArrayList<DataCallState> dataCallStates,
boolean explicitPoll,
ApnContext apnContext) { ApnContext apnContext) {
if (apnContext == null) { if (apnContext == null) {
@@ -1044,25 +1043,16 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
return; return;
} else if (!dataCallStatesHasActiveCID(dataCallStates, } else if (!dataCallStatesHasActiveCID(dataCallStates,
apnContext.getDataConnection().getCid())) { apnContext.getDataConnection().getCid())) {
// Here, we only consider this authoritative if we asked for the
// PDP list. If it was an unsolicited response, we poll again
// to make sure everyone agrees on the initial state.
if (!explicitPoll) { Log.i(LOG_TAG, "PDP connection has dropped (active=false case). "
// We think it disconnected but aren't sure...poll from our side
mPhone.mCM.getPDPContextList(
this.obtainMessage(EVENT_GET_PDP_LIST_COMPLETE));
} else {
Log.i(LOG_TAG, "PDP connection has dropped (active=false case). "
+ " Reconnecting"); + " Reconnecting");
// Log the network drop on the event log. // Log the network drop on the event log.
int cid = getCellLocationId(); int cid = getCellLocationId();
EventLog.writeEvent(EventLogTags.PDP_NETWORK_DROP, cid, EventLog.writeEvent(EventLogTags.PDP_NETWORK_DROP, cid,
TelephonyManager.getDefault().getNetworkType()); TelephonyManager.getDefault().getNetworkType());
cleanUpConnection(true, apnContext); cleanUpConnection(true, apnContext);
}
} }
} }
} }
@@ -1214,7 +1204,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
// It's possible the PDP context went down and we weren't notified. // It's possible the PDP context went down and we weren't notified.
// Start polling the context list in an attempt to recover. // Start polling the context list in an attempt to recover.
if (DBG) log("no DATAIN in a while; polling PDP"); if (DBG) log("no DATAIN in a while; polling PDP");
mPhone.mCM.getDataCallList(obtainMessage(EVENT_GET_PDP_LIST_COMPLETE)); mPhone.mCM.getDataCallList(obtainMessage(EVENT_DATA_STATE_CHANGED));
mNoRecvPollCount++; mNoRecvPollCount++;
@@ -1653,7 +1643,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
protected void onPollPdp() { protected void onPollPdp() {
if (getOverallState() == State.CONNECTED) { if (getOverallState() == State.CONNECTED) {
// only poll when connected // only poll when connected
mPhone.mCM.getPDPContextList(this.obtainMessage(EVENT_GET_PDP_LIST_COMPLETE)); mPhone.mCM.getDataCallList(this.obtainMessage(EVENT_DATA_STATE_CHANGED));
sendMessageDelayed(obtainMessage(EVENT_POLL_PDP), POLL_PDP_MILLIS); sendMessageDelayed(obtainMessage(EVENT_POLL_PDP), POLL_PDP_MILLIS);
} }
} }
@@ -1933,11 +1923,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
break; break;
case EVENT_DATA_STATE_CHANGED: case EVENT_DATA_STATE_CHANGED:
onDataStateChanged((AsyncResult) msg.obj, false); onDataStateChanged((AsyncResult) msg.obj);
break;
case EVENT_GET_PDP_LIST_COMPLETE:
onDataStateChanged((AsyncResult) msg.obj, true);
break; break;
case EVENT_POLL_PDP: case EVENT_POLL_PDP: