summaryrefslogtreecommitdiffstats
path: root/telephony/java
diff options
context:
space:
mode:
authorHung-ying Tyan <tyanh@google.com>2010-09-28 10:56:34 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-09-28 10:56:34 -0700
commite18f15e6fe9a7217de805e8a7ad84c01761910ec (patch)
tree9e6b2a6b6e9597848194a9616af39bab07b3f655 /telephony/java
parenta2a57aa02b6be61ce7cbdae9ef0cd964d46ad069 (diff)
parent1738252a596c71851cabf5835acb3584ad6b3191 (diff)
downloadframeworks_base-e18f15e6fe9a7217de805e8a7ad84c01761910ec.zip
frameworks_base-e18f15e6fe9a7217de805e8a7ad84c01761910ec.tar.gz
frameworks_base-e18f15e6fe9a7217de805e8a7ad84c01761910ec.tar.bz2
am 1738252a: am 32346522: Merge "Don\'t enter DISCONNECTING state when the call/connection is not alive" into gingerbread
Merge commit '1738252a596c71851cabf5835acb3584ad6b3191' * commit '1738252a596c71851cabf5835acb3584ad6b3191': Don't enter DISCONNECTING state when the call/connection is not alive
Diffstat (limited to 'telephony/java')
-rwxr-xr-xtelephony/java/com/android/internal/telephony/sip/SipPhone.java35
1 files changed, 21 insertions, 14 deletions
diff --git a/telephony/java/com/android/internal/telephony/sip/SipPhone.java b/telephony/java/com/android/internal/telephony/sip/SipPhone.java
index c0ad7e9..4e3f26d 100755
--- a/telephony/java/com/android/internal/telephony/sip/SipPhone.java
+++ b/telephony/java/com/android/internal/telephony/sip/SipPhone.java
@@ -444,18 +444,23 @@ public class SipPhone extends SipPhoneBase {
@Override
public void hangup() throws CallStateException {
synchronized (SipPhone.class) {
- Log.v(LOG_TAG, "hang up call: " + getState() + ": " + this
- + " on phone " + getPhone());
- CallStateException excp = null;
- for (Connection c : connections) {
- try {
- c.hangup();
- } catch (CallStateException e) {
- excp = e;
+ if (mState.isAlive()) {
+ Log.d(LOG_TAG, "hang up call: " + getState() + ": " + this
+ + " on phone " + getPhone());
+ CallStateException excp = null;
+ for (Connection c : connections) {
+ try {
+ c.hangup();
+ } catch (CallStateException e) {
+ excp = e;
+ }
}
+ if (excp != null) throw excp;
+ setState(State.DISCONNECTING);
+ } else {
+ Log.d(LOG_TAG, "hang up dead call: " + getState() + ": "
+ + this + " on phone " + getPhone());
}
- if (excp != null) throw excp;
- setState(State.DISCONNECTING);
}
}
@@ -787,11 +792,13 @@ public class SipPhone extends SipPhoneBase {
public void hangup() throws CallStateException {
synchronized (SipPhone.class) {
Log.v(LOG_TAG, "hangup conn: " + mPeer.getUriString() + ": "
- + ": on phone " + getPhone().getPhoneName());
+ + mState + ": on phone " + getPhone().getPhoneName());
try {
- if (mSipAudioCall != null) mSipAudioCall.endCall();
- setState(Call.State.DISCONNECTING);
- setDisconnectCause(DisconnectCause.LOCAL);
+ if (mState.isAlive()) {
+ if (mSipAudioCall != null) mSipAudioCall.endCall();
+ setState(Call.State.DISCONNECTING);
+ setDisconnectCause(DisconnectCause.LOCAL);
+ }
} catch (SipException e) {
throw new CallStateException("hangup(): " + e);
}