Unpause when only one paused call
This commit is contained in:
parent
d87ac447d5
commit
4022cbe222
2 changed files with 15 additions and 3 deletions
|
@ -273,6 +273,10 @@ public class IncallActivity extends AbstractCalleesActivity implements
|
||||||
lc().pauseCall(call);
|
lc().pauseCall(call);
|
||||||
} else {
|
} else {
|
||||||
((Checkable) v).setChecked(true);
|
((Checkable) v).setChecked(true);
|
||||||
|
List<LinphoneCall> pausedCalls = LinphoneUtils.getCallsInState(lc(), Arrays.asList(State.Paused));
|
||||||
|
if (pausedCalls.size() == 1) {
|
||||||
|
lc().resumeCall(pausedCalls.get(0));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case R.id.conf_simple_video:
|
case R.id.conf_simple_video:
|
||||||
|
|
|
@ -26,8 +26,11 @@ import java.io.InputStream;
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
import org.linphone.core.LinphoneAddress;
|
import org.linphone.core.LinphoneAddress;
|
||||||
import org.linphone.core.LinphoneCall;
|
import org.linphone.core.LinphoneCall;
|
||||||
|
@ -177,16 +180,21 @@ public final class LinphoneUtils {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final List<LinphoneCall> getRunningOrPausedCalls(LinphoneCore lc) {
|
public static final List<LinphoneCall> getCallsInState(LinphoneCore lc, Collection<State> states) {
|
||||||
List<LinphoneCall> foundCalls = new ArrayList<LinphoneCall>();
|
List<LinphoneCall> foundCalls = new ArrayList<LinphoneCall>();
|
||||||
for (LinphoneCall call : getLinphoneCalls(lc)) {
|
for (LinphoneCall call : getLinphoneCalls(lc)) {
|
||||||
State state = call.getState();
|
if (states.contains(call.getState())) {
|
||||||
if (state == State.Paused || state == State.PausedByRemote || state == State.StreamsRunning) {
|
|
||||||
foundCalls.add(call);
|
foundCalls.add(call);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return foundCalls;
|
return foundCalls;
|
||||||
}
|
}
|
||||||
|
public static final List<LinphoneCall> getRunningOrPausedCalls(LinphoneCore lc) {
|
||||||
|
return getCallsInState(lc, Arrays.asList(
|
||||||
|
State.Paused,
|
||||||
|
State.PausedByRemote,
|
||||||
|
State.StreamsRunning));
|
||||||
|
}
|
||||||
|
|
||||||
public static final int countConferenceCalls(LinphoneCore lc) {
|
public static final int countConferenceCalls(LinphoneCore lc) {
|
||||||
int count = lc.getConferenceSize();
|
int count = lc.getConferenceSize();
|
||||||
|
|
Loading…
Reference in a new issue