Merge change 26171 into eclair

* changes:
  Fix several CDMA call collision cases
This commit is contained in:
Android (Google) Code Review
2009-09-21 13:50:27 -04:00

View File

@@ -437,7 +437,7 @@ public final class CdmaCallTracker extends CallTracker {
new AsyncResult(null, null, null)); new AsyncResult(null, null, null));
} }
if (Phone.DEBUG_PHONE) { if (Phone.DEBUG_PHONE) {
log("update phone state, old= , new= , " + oldState + state); log("update phone state, old=" + oldState + " new="+ state);
} }
if (state != oldState) { if (state != oldState) {
phone.notifyPhoneStateChanged(); phone.notifyPhoneStateChanged();
@@ -522,37 +522,44 @@ public final class CdmaCallTracker extends CallTracker {
} }
} else { } else {
if (Phone.DEBUG_PHONE) { if (Phone.DEBUG_PHONE) {
log("pending Mo= , dc= " + pendingMO + dc); log("pendingMo=" + pendingMO + ", dc=" + dc);
} }
// find if the MT call is a new ring or unknown connection // find if the MT call is a new ring or unknown connection
newRinging = checkMtFindNewRinging(dc,i); newRinging = checkMtFindNewRinging(dc,i);
if (newRinging == null) { if (newRinging == null) {
unknownConnectionAppeared = true; unknownConnectionAppeared = true;
} }
checkAndEnableDataCallAfterEmergencyCallDropped();
} }
hasNonHangupStateChanged = true; hasNonHangupStateChanged = true;
} else if (conn != null && dc == null) { } else if (conn != null && dc == null) {
// This case means the RIL has no more active call anymore and
// we need to clean up the foregroundCall and ringingCall.
// Loop through foreground call connections as
// it contains the known logical connections.
int count = foregroundCall.connections.size(); int count = foregroundCall.connections.size();
if (count == 0) { for (int n = 0; n < count; n++) {
// Handle an unanswered MO/MT call, there is no if (Phone.DEBUG_PHONE) log("adding fgCall cn " + n + " to droppedDuringPoll");
// foregroundCall connections at this time. CdmaConnection cn = (CdmaConnection)foregroundCall.connections.get(n);
droppedDuringPoll.add(conn); droppedDuringPoll.add(cn);
} else { }
// Loop through foreground call connections as count = ringingCall.connections.size();
// it contains the known logical connections. // Loop through ringing call connections as
for (int n = 0; n < count; n++) { // it may contain the known logical connections.
CdmaConnection cn = (CdmaConnection)foregroundCall.connections.get(n); for (int n = 0; n < count; n++) {
droppedDuringPoll.add(cn); if (Phone.DEBUG_PHONE) log("adding rgCall cn " + n + " to droppedDuringPoll");
} CdmaConnection cn = (CdmaConnection)ringingCall.connections.get(n);
droppedDuringPoll.add(cn);
} }
foregroundCall.setGeneric(false); foregroundCall.setGeneric(false);
ringingCall.setGeneric(false);
// Re-start Ecm timer when the connected emergency call ends // Re-start Ecm timer when the connected emergency call ends
if (mIsEcmTimerCanceled) { if (mIsEcmTimerCanceled) {
handleEcmTimer(phone.RESTART_ECM_TIMER); handleEcmTimer(phone.RESTART_ECM_TIMER);
} else {
mIsInEmergencyCall = false;
} }
// If emergency call is not going through while dialing
checkAndEnableDataCallAfterEmergencyCallDropped();
// Dropped connections are removed from the CallTracker // Dropped connections are removed from the CallTracker
// list but kept in the Call list // list but kept in the Call list
@@ -568,6 +575,7 @@ public final class CdmaCallTracker extends CallTracker {
if (newRinging == null) { if (newRinging == null) {
unknownConnectionAppeared = true; unknownConnectionAppeared = true;
} }
checkAndEnableDataCallAfterEmergencyCallDropped();
} else { } else {
// Call info stored in conn is not consistent with the call info from dc. // Call info stored in conn is not consistent with the call info from dc.
// We should follow the rule of MT calls taking precedence over MO calls // We should follow the rule of MT calls taking precedence over MO calls
@@ -1030,10 +1038,30 @@ public final class CdmaCallTracker extends CallTracker {
*/ */
private void disableDataCallInEmergencyCall(String dialString) { private void disableDataCallInEmergencyCall(String dialString) {
if (PhoneNumberUtils.isEmergencyNumber(dialString)) { if (PhoneNumberUtils.isEmergencyNumber(dialString)) {
if (Phone.DEBUG_PHONE) log("disableDataCallInEmergencyCall");
phone.disableDataConnectivity(); phone.disableDataConnectivity();
mIsInEmergencyCall = true; mIsInEmergencyCall = true;
} }
} }
/**
* Check and enable data call after an emergency call is dropped if it's
* not in ECM
*/
private void checkAndEnableDataCallAfterEmergencyCallDropped() {
if (mIsInEmergencyCall) {
String inEcm=SystemProperties.get(TelephonyProperties.PROPERTY_INECM_MODE, "false");
if (Phone.DEBUG_PHONE) {
log("checkAndEnableDataCallAfterEmergencyCallDropped,inEcm=" + inEcm);
}
if (inEcm.compareTo("false") == 0) {
// Re-initiate data connection
phone.mDataConnection.setDataEnabled(true);
}
mIsInEmergencyCall = false;
}
}
/** /**
* Check the MT call to see if it's a new ring or * Check the MT call to see if it's a new ring or
* a unknown connection. * a unknown connection.