diff options
author | Hung-ying Tyan <tyanh@google.com> | 2010-09-28 07:23:36 +0800 |
---|---|---|
committer | Hung-ying Tyan <tyanh@google.com> | 2010-09-28 09:01:26 +0800 |
commit | 2b4f5cfd9be5ceffc4745a45736e067a475a4dff (patch) | |
tree | 50661aeba91faab6b3e9a40d2ed2b4dd388ff4e6 /telephony | |
parent | 04a426f5b50a628fb73bc29b003b0e5bece17c27 (diff) | |
download | frameworks_base-2b4f5cfd9be5ceffc4745a45736e067a475a4dff.zip frameworks_base-2b4f5cfd9be5ceffc4745a45736e067a475a4dff.tar.gz frameworks_base-2b4f5cfd9be5ceffc4745a45736e067a475a4dff.tar.bz2 |
Don't enter DISCONNECTING state when the call/connection is not alive
http://b/issue?id=3027719
Change-Id: I1b52418a3695e96b48538fbf14497e34d2cfdda9
Diffstat (limited to 'telephony')
-rwxr-xr-x | telephony/java/com/android/internal/telephony/sip/SipPhone.java | 35 |
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 999da9f..9670214 100755 --- a/telephony/java/com/android/internal/telephony/sip/SipPhone.java +++ b/telephony/java/com/android/internal/telephony/sip/SipPhone.java @@ -441,18 +441,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); } } @@ -784,11 +789,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); } |