Merge change 5339 into donut
* changes: Fix intermittent crash related to call waiting
This commit is contained in:
@@ -253,11 +253,7 @@ public final class CdmaCallTracker extends CallTracker {
|
|||||||
// Always unmute when answering a new call
|
// Always unmute when answering a new call
|
||||||
setMute(false);
|
setMute(false);
|
||||||
cm.acceptCall(obtainCompleteMessage());
|
cm.acceptCall(obtainCompleteMessage());
|
||||||
} else if ((foregroundCall.connections.size() > 0) &&
|
} else if (ringingCall.getState() == CdmaCall.State.WAITING) {
|
||||||
(ringingCall.getState() == CdmaCall.State.WAITING)) {
|
|
||||||
// TODO(Moto): jsh asks, "Is this check necessary? I don't think it should be
|
|
||||||
// possible to have no fg connection and a WAITING call, but if we should hit
|
|
||||||
// this situation, is a CallStateExcetion appropriate?"
|
|
||||||
CdmaConnection cwConn = (CdmaConnection)(ringingCall.getLatestConnection());
|
CdmaConnection cwConn = (CdmaConnection)(ringingCall.getLatestConnection());
|
||||||
|
|
||||||
// Since there is no network response for supplimentary
|
// Since there is no network response for supplimentary
|
||||||
@@ -530,10 +526,6 @@ public final class CdmaCallTracker extends CallTracker {
|
|||||||
CdmaConnection cn = (CdmaConnection)foregroundCall.connections.get(n);
|
CdmaConnection cn = (CdmaConnection)foregroundCall.connections.get(n);
|
||||||
droppedDuringPoll.add(cn);
|
droppedDuringPoll.add(cn);
|
||||||
}
|
}
|
||||||
// TODO(Moto): jsh asks, "Are we sure we don't need to do this for
|
|
||||||
// ringingCall as well? What if there's a WAITING call (ie, UI timer
|
|
||||||
// hasn't expired, moving it to DISCONNECTED)? How/when will it
|
|
||||||
// transition to DISCONNECTED?"
|
|
||||||
}
|
}
|
||||||
foregroundCall.setGeneric(false);
|
foregroundCall.setGeneric(false);
|
||||||
// Dropped connections are removed from the CallTracker
|
// Dropped connections are removed from the CallTracker
|
||||||
@@ -681,8 +673,12 @@ public final class CdmaCallTracker extends CallTracker {
|
|||||||
// set the ringing call state to IDLE here to avoid a race condition
|
// set the ringing call state to IDLE here to avoid a race condition
|
||||||
// where a new call waiting could get a hang up from an old call
|
// where a new call waiting could get a hang up from an old call
|
||||||
// waiting ringingCall.
|
// waiting ringingCall.
|
||||||
// TODO(Moto): jsh asks, "Should we call conn.ondisconnect() here or Somewhere?"
|
//
|
||||||
ringingCall.detach(conn);
|
// PhoneApp does the call log itself since only PhoneApp knows
|
||||||
|
// the hangup reason is user ignoring or timing out. So conn.onDisconnect()
|
||||||
|
// is not called here. Instead, conn.onLocalDisconnect() is called.
|
||||||
|
conn.onLocalDisconnect();
|
||||||
|
phone.notifyCallStateChanged();
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -452,12 +452,7 @@ public class CdmaConnection extends Connection {
|
|||||||
this.cause = cause;
|
this.cause = cause;
|
||||||
|
|
||||||
if (!disconnected) {
|
if (!disconnected) {
|
||||||
index = -1;
|
doDisconnect();
|
||||||
|
|
||||||
disconnectTime = System.currentTimeMillis();
|
|
||||||
duration = SystemClock.elapsedRealtime() - connectTimeReal;
|
|
||||||
disconnected = true;
|
|
||||||
|
|
||||||
if (Config.LOGD) Log.d(LOG_TAG,
|
if (Config.LOGD) Log.d(LOG_TAG,
|
||||||
"[CDMAConn] onDisconnect: cause=" + cause);
|
"[CDMAConn] onDisconnect: cause=" + cause);
|
||||||
|
|
||||||
@@ -470,6 +465,21 @@ public class CdmaConnection extends Connection {
|
|||||||
releaseWakeLock();
|
releaseWakeLock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Called when the call waiting connection has been hung up */
|
||||||
|
/*package*/ void
|
||||||
|
onLocalDisconnect() {
|
||||||
|
if (!disconnected) {
|
||||||
|
doDisconnect();
|
||||||
|
if (Config.LOGD) Log.d(LOG_TAG,
|
||||||
|
"[CDMAConn] onLoalDisconnect" );
|
||||||
|
|
||||||
|
if (parent != null) {
|
||||||
|
parent.detach(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
releaseWakeLock();
|
||||||
|
}
|
||||||
|
|
||||||
// Returns true if state has changed, false if nothing changed
|
// Returns true if state has changed, false if nothing changed
|
||||||
/*package*/ boolean
|
/*package*/ boolean
|
||||||
update (DriverCall dc) {
|
update (DriverCall dc) {
|
||||||
@@ -586,6 +596,14 @@ public class CdmaConnection extends Connection {
|
|||||||
releaseWakeLock();
|
releaseWakeLock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void
|
||||||
|
doDisconnect() {
|
||||||
|
index = -1;
|
||||||
|
disconnectTime = System.currentTimeMillis();
|
||||||
|
duration = SystemClock.elapsedRealtime() - connectTimeReal;
|
||||||
|
disconnected = true;
|
||||||
|
}
|
||||||
|
|
||||||
private void
|
private void
|
||||||
onStartedHolding() {
|
onStartedHolding() {
|
||||||
holdingStartTime = SystemClock.elapsedRealtime();
|
holdingStartTime = SystemClock.elapsedRealtime();
|
||||||
|
|||||||
Reference in New Issue
Block a user