Fix pause while incall
This commit is contained in:
parent
3c7f18a956
commit
045dbe0423
1 changed files with 7 additions and 16 deletions
|
@ -601,10 +601,12 @@ public class InCallActivity extends FragmentActivity implements LinphoneCallStat
|
||||||
}
|
}
|
||||||
|
|
||||||
private void pauseOrResumeCall() {
|
private void pauseOrResumeCall() {
|
||||||
LinphoneCore lc = LinphoneManager.getLc();
|
LinphoneCore lc = LinphoneManager.getLcIfManagerNotDestroyedOrNull();
|
||||||
LinphoneCall call = lc.getCurrentCall();
|
if (lc != null && lc.getCallsNb() >= 1) {
|
||||||
|
LinphoneCall call = lc.getCalls()[0];
|
||||||
pauseOrResumeCall(call);
|
pauseOrResumeCall(call);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void pauseOrResumeCall(LinphoneCall call) {
|
public void pauseOrResumeCall(LinphoneCall call) {
|
||||||
LinphoneCore lc = LinphoneManager.getLc();
|
LinphoneCore lc = LinphoneManager.getLc();
|
||||||
|
@ -622,19 +624,8 @@ public class InCallActivity extends FragmentActivity implements LinphoneCallStat
|
||||||
}
|
}
|
||||||
pause.setBackgroundResource(R.drawable.pause_on);
|
pause.setBackgroundResource(R.drawable.pause_on);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
List<LinphoneCall> pausedCalls = LinphoneUtils.getCallsInState(lc, Arrays.asList(State.Paused));
|
|
||||||
if (pausedCalls.size() == 1) {
|
|
||||||
LinphoneCall callToResume = pausedCalls.get(0);
|
|
||||||
if ((call != null && callToResume.equals(call)) || call == null) {
|
|
||||||
lc.resumeCall(callToResume);
|
|
||||||
if (isVideoCallPaused) {
|
|
||||||
isVideoCallPaused = false;
|
|
||||||
showVideoView();
|
|
||||||
}
|
|
||||||
pause.setBackgroundResource(R.drawable.pause_off);
|
|
||||||
}
|
|
||||||
} else if (call != null) {
|
} else if (call != null) {
|
||||||
|
if (call.getState() == State.Paused) {
|
||||||
lc.resumeCall(call);
|
lc.resumeCall(call);
|
||||||
if (isVideoCallPaused) {
|
if (isVideoCallPaused) {
|
||||||
isVideoCallPaused = false;
|
isVideoCallPaused = false;
|
||||||
|
|
Loading…
Reference in a new issue