am 06e8cdc0: Fix race between ending and answering a SIP call.

* commit '06e8cdc0f81ead604d5adf9d7b3f982e10226fd2':
  Fix race between ending and answering a SIP call.
This commit is contained in:
Hung-ying Tyan
2010-11-30 23:21:40 -08:00
committed by Android Git Automerger

View File

@@ -527,11 +527,14 @@ class SipSessionGroup implements SipListener {
}
public void answerCall(String sessionDescription, int timeout) {
try {
processCommand(new MakeCallCommand(mPeerProfile,
sessionDescription, timeout));
} catch (SipException e) {
onError(e);
synchronized (SipSessionGroup.this) {
if (mPeerProfile == null) return;
try {
processCommand(new MakeCallCommand(mPeerProfile,
sessionDescription, timeout));
} catch (SipException e) {
onError(e);
}
}
}
@@ -540,14 +543,11 @@ class SipSessionGroup implements SipListener {
}
public void changeCall(String sessionDescription, int timeout) {
doCommandAsync(new MakeCallCommand(mPeerProfile, sessionDescription,
timeout));
}
public void changeCallWithTimeout(
String sessionDescription, int timeout) {
doCommandAsync(new MakeCallCommand(mPeerProfile, sessionDescription,
timeout));
synchronized (SipSessionGroup.this) {
if (mPeerProfile == null) return;
doCommandAsync(new MakeCallCommand(mPeerProfile,
sessionDescription, timeout));
}
}
public void register(int duration) {