am 32346522: Merge "Don\'t enter DISCONNECTING state when the call/connection is not alive" into gingerbread
Merge commit '3234652242f54e3366e7c74e5a0cf0a7da5871b4' into gingerbread-plus-aosp * commit '3234652242f54e3366e7c74e5a0cf0a7da5871b4': Don't enter DISCONNECTING state when the call/connection is not alive
This commit is contained in:
@@ -441,18 +441,23 @@ public class SipPhone extends SipPhoneBase {
|
|||||||
@Override
|
@Override
|
||||||
public void hangup() throws CallStateException {
|
public void hangup() throws CallStateException {
|
||||||
synchronized (SipPhone.class) {
|
synchronized (SipPhone.class) {
|
||||||
Log.v(LOG_TAG, "hang up call: " + getState() + ": " + this
|
if (mState.isAlive()) {
|
||||||
+ " on phone " + getPhone());
|
Log.d(LOG_TAG, "hang up call: " + getState() + ": " + this
|
||||||
CallStateException excp = null;
|
+ " on phone " + getPhone());
|
||||||
for (Connection c : connections) {
|
CallStateException excp = null;
|
||||||
try {
|
for (Connection c : connections) {
|
||||||
c.hangup();
|
try {
|
||||||
} catch (CallStateException e) {
|
c.hangup();
|
||||||
excp = e;
|
} 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 {
|
public void hangup() throws CallStateException {
|
||||||
synchronized (SipPhone.class) {
|
synchronized (SipPhone.class) {
|
||||||
Log.v(LOG_TAG, "hangup conn: " + mPeer.getUriString() + ": "
|
Log.v(LOG_TAG, "hangup conn: " + mPeer.getUriString() + ": "
|
||||||
+ ": on phone " + getPhone().getPhoneName());
|
+ mState + ": on phone " + getPhone().getPhoneName());
|
||||||
try {
|
try {
|
||||||
if (mSipAudioCall != null) mSipAudioCall.endCall();
|
if (mState.isAlive()) {
|
||||||
setState(Call.State.DISCONNECTING);
|
if (mSipAudioCall != null) mSipAudioCall.endCall();
|
||||||
setDisconnectCause(DisconnectCause.LOCAL);
|
setState(Call.State.DISCONNECTING);
|
||||||
|
setDisconnectCause(DisconnectCause.LOCAL);
|
||||||
|
}
|
||||||
} catch (SipException e) {
|
} catch (SipException e) {
|
||||||
throw new CallStateException("hangup(): " + e);
|
throw new CallStateException("hangup(): " + e);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user