Prevent sending a re-invite when we have accepted a re-invite to enable/disable video.

This commit is contained in:
Ghislain MARY 2013-01-23 12:30:35 +01:00
parent c89b3a8d32
commit 9ecc101f04

View file

@ -323,7 +323,7 @@ public class InCallActivity extends FragmentActivity implements
if (id == R.id.video) {
isVideoEnabled = !isVideoEnabled;
switchVideo(isVideoEnabled);
switchVideo(isVideoEnabled, true);
}
else if (id == R.id.micro) {
toggleMicro();
@ -386,7 +386,7 @@ public class InCallActivity extends FragmentActivity implements
});
}
private void switchVideo(final boolean displayVideo) {
private void switchVideo(final boolean displayVideo, final boolean isInitiator) {
final LinphoneCall call = LinphoneManager.getLc().getCalls()[0];
if (call == null) {
return;
@ -396,10 +396,11 @@ public class InCallActivity extends FragmentActivity implements
@Override
public void run() {
if (!displayVideo) {
if (isInitiator) {
LinphoneCallParams params = call.getCurrentParamsCopy();
params.setVideoEnabled(false);
LinphoneManager.getLc().updateCall(call, params);
}
showAudioView();
} else {
if (!call.getRemoteParams().isLowBandwidthEnabled()) {
@ -965,7 +966,7 @@ public class InCallActivity extends FragmentActivity implements
boolean isVideoEnabledInCall = call.getCurrentParamsCopy().getVideoEnabled();
if (isVideoEnabledInCall != isVideoEnabled) {
isVideoEnabled = isVideoEnabledInCall;
switchVideo(isVideoEnabled);
switchVideo(isVideoEnabled, false);
}
// The following should not be needed except some devices need it (e.g. Galaxy S).