Fix ringing stopping, by binding ringing status to call

This commit is contained in:
Pierre-Eric Pelloux-Prayer 2011-10-13 15:08:23 +02:00
parent 0e0a6eec05
commit efcb45d7c7

View file

@ -665,7 +665,7 @@ public final class LinphoneManager implements LinphoneCoreListener {
} }
private LinphoneServiceListener serviceListener; private LinphoneServiceListener serviceListener;
private LinphoneCall.State mCurrentCallState; private LinphoneCall ringingCall;
private MediaPlayer mRingerPlayer; private MediaPlayer mRingerPlayer;
private Vibrator mVibrator; private Vibrator mVibrator;
@ -727,11 +727,11 @@ public final class LinphoneManager implements LinphoneCoreListener {
wl.acquire(10000); wl.acquire(10000);
startRinging(); startRinging();
} ringingCall = call;
} else if (call == ringingCall) {
if (mCurrentCallState == IncomingReceived) {
//previous state was ringing, so stop ringing //previous state was ringing, so stop ringing
stopRinging(); stopRinging();
ringingCall = null;
routeAudioToReceiver(); routeAudioToReceiver();
} }
@ -745,7 +745,6 @@ public final class LinphoneManager implements LinphoneCoreListener {
} }
} }
mCurrentCallState=state;
serviceListener.onCallStateChanged(call, state, message); serviceListener.onCallStateChanged(call, state, message);
} }
@ -853,6 +852,7 @@ public final class LinphoneManager implements LinphoneCoreListener {
public void setAudioModeIncallForGalaxyS() { public void setAudioModeIncallForGalaxyS() {
stopRinging(); stopRinging();
mAudioManager.setMode(MODE_IN_CALL); mAudioManager.setMode(MODE_IN_CALL);
ringingCall = null;
} }
// Called on first launch only // Called on first launch only