diff options
author | David Krause <david.krause@motorola.com> | 2009-06-14 21:05:41 -0500 |
---|---|---|
committer | Wink Saville <wink@google.com> | 2009-06-24 20:53:15 -0700 |
commit | 8a9ae45015a4cabdd56b1160261d4e7cbe551014 (patch) | |
tree | ad6a3cc57f1d140defeedbc1ced57fab5acc9a63 /telephony | |
parent | 5f80605a0b866f34c74955e190909bd6ab5d992e (diff) | |
download | frameworks_base-8a9ae45015a4cabdd56b1160261d4e7cbe551014.zip frameworks_base-8a9ae45015a4cabdd56b1160261d4e7cbe551014.tar.gz frameworks_base-8a9ae45015a4cabdd56b1160261d4e7cbe551014.tar.bz2 |
Fix intermittent crash related to call waiting
Previously, when call waiting is ignored by user or timed out
by PhoneApp, the connection object for call waiting does not
release the wake lock. It causes the phone process to crash
randomly.
The fix is to release the wake lock when call waiting is
ignored by user or timed out by PhoneApp.
Diffstat (limited to 'telephony')
-rw-r--r-- | telephony/java/com/android/internal/telephony/cdma/CdmaCallTracker.java | 18 | ||||
-rw-r--r-- | telephony/java/com/android/internal/telephony/cdma/CdmaConnection.java | 30 |
2 files changed, 31 insertions, 17 deletions
diff --git a/telephony/java/com/android/internal/telephony/cdma/CdmaCallTracker.java b/telephony/java/com/android/internal/telephony/cdma/CdmaCallTracker.java index da9fd0c..ed2ea90 100644 --- a/telephony/java/com/android/internal/telephony/cdma/CdmaCallTracker.java +++ b/telephony/java/com/android/internal/telephony/cdma/CdmaCallTracker.java @@ -253,11 +253,7 @@ public final class CdmaCallTracker extends CallTracker { // Always unmute when answering a new call setMute(false); cm.acceptCall(obtainCompleteMessage()); - } else if ((foregroundCall.connections.size() > 0) && - (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?" + } else if (ringingCall.getState() == CdmaCall.State.WAITING) { CdmaConnection cwConn = (CdmaConnection)(ringingCall.getLatestConnection()); // 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); 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); // 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 // where a new call waiting could get a hang up from an old call // 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; } else { try { diff --git a/telephony/java/com/android/internal/telephony/cdma/CdmaConnection.java b/telephony/java/com/android/internal/telephony/cdma/CdmaConnection.java index 588bdf0..025382d 100644 --- a/telephony/java/com/android/internal/telephony/cdma/CdmaConnection.java +++ b/telephony/java/com/android/internal/telephony/cdma/CdmaConnection.java @@ -452,12 +452,7 @@ public class CdmaConnection extends Connection { this.cause = cause; if (!disconnected) { - index = -1; - - disconnectTime = System.currentTimeMillis(); - duration = SystemClock.elapsedRealtime() - connectTimeReal; - disconnected = true; - + doDisconnect(); if (Config.LOGD) Log.d(LOG_TAG, "[CDMAConn] onDisconnect: cause=" + cause); @@ -470,6 +465,21 @@ public class CdmaConnection extends Connection { 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 /*package*/ boolean update (DriverCall dc) { @@ -587,6 +597,14 @@ public class CdmaConnection extends Connection { } private void + doDisconnect() { + index = -1; + disconnectTime = System.currentTimeMillis(); + duration = SystemClock.elapsedRealtime() - connectTimeReal; + disconnected = true; + } + + private void onStartedHolding() { holdingStartTime = SystemClock.elapsedRealtime(); } |