Prevent sending a re-invite when we have accepted a re-invite to enable/disable video.
This commit is contained in:
parent
c89b3a8d32
commit
9ecc101f04
1 changed files with 8 additions and 7 deletions
|
@ -323,7 +323,7 @@ public class InCallActivity extends FragmentActivity implements
|
||||||
|
|
||||||
if (id == R.id.video) {
|
if (id == R.id.video) {
|
||||||
isVideoEnabled = !isVideoEnabled;
|
isVideoEnabled = !isVideoEnabled;
|
||||||
switchVideo(isVideoEnabled);
|
switchVideo(isVideoEnabled, true);
|
||||||
}
|
}
|
||||||
else if (id == R.id.micro) {
|
else if (id == R.id.micro) {
|
||||||
toggleMicro();
|
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];
|
final LinphoneCall call = LinphoneManager.getLc().getCalls()[0];
|
||||||
if (call == null) {
|
if (call == null) {
|
||||||
return;
|
return;
|
||||||
|
@ -396,10 +396,11 @@ public class InCallActivity extends FragmentActivity implements
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if (!displayVideo) {
|
if (!displayVideo) {
|
||||||
LinphoneCallParams params = call.getCurrentParamsCopy();
|
if (isInitiator) {
|
||||||
params.setVideoEnabled(false);
|
LinphoneCallParams params = call.getCurrentParamsCopy();
|
||||||
LinphoneManager.getLc().updateCall(call, params);
|
params.setVideoEnabled(false);
|
||||||
|
LinphoneManager.getLc().updateCall(call, params);
|
||||||
|
}
|
||||||
showAudioView();
|
showAudioView();
|
||||||
} else {
|
} else {
|
||||||
if (!call.getRemoteParams().isLowBandwidthEnabled()) {
|
if (!call.getRemoteParams().isLowBandwidthEnabled()) {
|
||||||
|
@ -965,7 +966,7 @@ public class InCallActivity extends FragmentActivity implements
|
||||||
boolean isVideoEnabledInCall = call.getCurrentParamsCopy().getVideoEnabled();
|
boolean isVideoEnabledInCall = call.getCurrentParamsCopy().getVideoEnabled();
|
||||||
if (isVideoEnabledInCall != isVideoEnabled) {
|
if (isVideoEnabledInCall != isVideoEnabled) {
|
||||||
isVideoEnabled = isVideoEnabledInCall;
|
isVideoEnabled = isVideoEnabledInCall;
|
||||||
switchVideo(isVideoEnabled);
|
switchVideo(isVideoEnabled, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// The following should not be needed except some devices need it (e.g. Galaxy S).
|
// The following should not be needed except some devices need it (e.g. Galaxy S).
|
||||||
|
|
Loading…
Reference in a new issue