SipPhone: fix missing-call DisconnectCause feedback
also fix delivering bad news before closing a SipAudioCallImpl object so that apps can get the current audio-call object state before it's closed: http://b/issue?id=3009262 Change-Id: I94c19dae8b4f252de869e614ec462b19b4ff2077
This commit is contained in:
@ -823,7 +823,9 @@ public class SipPhone extends SipPhoneBase {
|
||||
|
||||
@Override
|
||||
public void onCallEnded(SipAudioCall call) {
|
||||
onCallEnded(Connection.DisconnectCause.NORMAL);
|
||||
onCallEnded(call.isInCall()
|
||||
? Connection.DisconnectCause.NORMAL
|
||||
: Connection.DisconnectCause.INCOMING_MISSED);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -269,7 +269,6 @@ public class SipAudioCallImpl extends SipSessionAdapter
|
||||
@Override
|
||||
public void onCallEnded(ISipSession session) {
|
||||
Log.d(TAG, "sip call ended: " + session);
|
||||
close();
|
||||
Listener listener = mListener;
|
||||
if (listener != null) {
|
||||
try {
|
||||
@ -278,12 +277,12 @@ public class SipAudioCallImpl extends SipSessionAdapter
|
||||
Log.e(TAG, "onCallEnded()", t);
|
||||
}
|
||||
}
|
||||
close();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCallBusy(ISipSession session) {
|
||||
Log.d(TAG, "sip call busy: " + session);
|
||||
close(false);
|
||||
Listener listener = mListener;
|
||||
if (listener != null) {
|
||||
try {
|
||||
@ -292,6 +291,7 @@ public class SipAudioCallImpl extends SipSessionAdapter
|
||||
Log.e(TAG, "onCallBusy()", t);
|
||||
}
|
||||
}
|
||||
close(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -316,12 +316,6 @@ public class SipAudioCallImpl extends SipSessionAdapter
|
||||
+ ": " + message);
|
||||
mErrorCode = errorCode;
|
||||
mErrorMessage = message;
|
||||
synchronized (this) {
|
||||
if ((mErrorCode == SipErrorCode.DATA_CONNECTION_LOST)
|
||||
|| !isInCall()) {
|
||||
close(true);
|
||||
}
|
||||
}
|
||||
Listener listener = mListener;
|
||||
if (listener != null) {
|
||||
try {
|
||||
@ -330,6 +324,12 @@ public class SipAudioCallImpl extends SipSessionAdapter
|
||||
Log.e(TAG, "onError()", t);
|
||||
}
|
||||
}
|
||||
synchronized (this) {
|
||||
if ((errorCode == SipErrorCode.DATA_CONNECTION_LOST)
|
||||
|| !isInCall()) {
|
||||
close(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public synchronized void attachCall(ISipSession session,
|
||||
|
Reference in New Issue
Block a user