From 637add1638e7c6c88349880d177cac611a7963c9 Mon Sep 17 00:00:00 2001 From: Guillaume Beraudo Date: Wed, 9 Nov 2011 14:51:18 +0100 Subject: [PATCH] Fix merge button --- src/org/linphone/IncallActivity.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/org/linphone/IncallActivity.java b/src/org/linphone/IncallActivity.java index e039d22a0..5a573aa87 100644 --- a/src/org/linphone/IncallActivity.java +++ b/src/org/linphone/IncallActivity.java @@ -747,6 +747,12 @@ public class IncallActivity extends ListActivity implements private Handler mHandler = new Handler(); + private static int conferenceCalleesNb(LinphoneCore lc) { + int count = lc.getConferenceSize(); + if (lc.isInConference()) count--; + return count; + } + private void updateSimpleControlButtons() { LinphoneCall activeCall = lc().getCurrentCall(); View control = findViewById(R.id.conf_control_buttons); @@ -761,7 +767,7 @@ public class IncallActivity extends ListActivity implements resume.setVisibility(showResume ? VISIBLE : GONE); View merge = control.findViewById(R.id.conf_simple_merge); - boolean showMerge = callNb >= 2; + boolean showMerge = callNb >= 2 && callNb > conferenceCalleesNb(lc()); merge.setVisibility(showMerge ? VISIBLE : GONE); View transfer = control.findViewById(R.id.conf_simple_transfer); @@ -940,7 +946,7 @@ public class IncallActivity extends ListActivity implements mSpeakerButton.setChecked(false); break; default: - throw new RuntimeException("Unkown audio state " + state); + throw new RuntimeException("Unknown audio state " + state); } } });