Fixed audio routes no being set correctly all the time

This commit is contained in:
Sylvain Berfini 2016-09-01 11:53:30 +02:00
parent 6ac636b5b3
commit e39cc0112d
4 changed files with 5 additions and 33 deletions

View file

@ -300,7 +300,6 @@ public class CallActivity extends Activity implements OnClickListener, SensorEve
callFragment.setArguments(getIntent().getExtras()); callFragment.setArguments(getIntent().getExtras());
getFragmentManager().beginTransaction().add(R.id.fragmentContainer, callFragment).commitAllowingStateLoss(); getFragmentManager().beginTransaction().add(R.id.fragmentContainer, callFragment).commitAllowingStateLoss();
} }
} }

View file

@ -305,14 +305,10 @@ public class CallIncomingActivity extends Activity implements LinphoneSliderTrig
if (!LinphoneActivity.isInstanciated()) { if (!LinphoneActivity.isInstanciated()) {
return; return;
} }
final LinphoneCallParams remoteParams = mCall.getRemoteParams(); LinphoneManager.getInstance().routeAudioToReceiver();
if (remoteParams != null && remoteParams.getVideoEnabled() && LinphonePreferences.instance().shouldAutomaticallyAcceptVideoRequests()) {
LinphoneActivity.instance().startVideoActivity(mCall);
} else {
LinphoneActivity.instance().startIncallActivity(mCall); LinphoneActivity.instance().startIncallActivity(mCall);
} }
} }
}
@Override @Override
public void onLeftHandleTriggered() { public void onLeftHandleTriggered() {

View file

@ -101,12 +101,7 @@ public class CallOutgoingActivity extends Activity implements OnClickListener{
if (!LinphoneActivity.isInstanciated()) { if (!LinphoneActivity.isInstanciated()) {
return; return;
} }
final LinphoneCallParams remoteParams = mCall.getRemoteParams();
if (remoteParams != null && remoteParams.getVideoEnabled() && LinphonePreferences.instance().shouldAutomaticallyAcceptVideoRequests()) {
LinphoneActivity.instance().startVideoActivity(mCall);
} else {
LinphoneActivity.instance().startIncallActivity(mCall); LinphoneActivity.instance().startIncallActivity(mCall);
}
finish(); finish();
return; return;
} else if (state == State.Error) { } else if (state == State.Error) {

View file

@ -943,16 +943,8 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
LinphoneManager.getInstance().newOutgoingCall(address); LinphoneManager.getInstance().newOutgoingCall(address);
} }
public void startVideoActivity(LinphoneCall currentCall) {
Intent intent = new Intent(this, CallActivity.class);
intent.putExtra("VideoEnabled", true);
startOrientationSensor();
startActivityForResult(intent, CALL_ACTIVITY);
}
public void startIncallActivity(LinphoneCall currentCall) { public void startIncallActivity(LinphoneCall currentCall) {
Intent intent = new Intent(this, CallActivity.class); Intent intent = new Intent(this, CallActivity.class);
intent.putExtra("VideoEnabled", false);
startOrientationSensor(); startOrientationSensor();
startActivityForResult(intent, CALL_ACTIVITY); startActivityForResult(intent, CALL_ACTIVITY);
} }
@ -1024,8 +1016,6 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
LinphoneCall call = LinphoneManager.getLc().getCalls()[0]; LinphoneCall call = LinphoneManager.getLc().getCalls()[0];
if (call.getState() == LinphoneCall.State.IncomingReceived) { if (call.getState() == LinphoneCall.State.IncomingReceived) {
startActivity(new Intent(LinphoneActivity.this, CallIncomingActivity.class)); startActivity(new Intent(LinphoneActivity.this, CallIncomingActivity.class));
} else if (call.getCurrentParamsCopy().getVideoEnabled()) {
startVideoActivity(call);
} else { } else {
startIncallActivity(call); startIncallActivity(call);
} }
@ -1332,15 +1322,11 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
startActivity(new Intent(this, CallIncomingActivity.class)); startActivity(new Intent(this, CallIncomingActivity.class));
} else if (callState == State.OutgoingInit || callState == State.OutgoingProgress || callState == State.OutgoingRinging) { } else if (callState == State.OutgoingInit || callState == State.OutgoingProgress || callState == State.OutgoingRinging) {
startActivity(new Intent(this, CallOutgoingActivity.class)); startActivity(new Intent(this, CallOutgoingActivity.class));
} else {
if (call.getCurrentParamsCopy().getVideoEnabled()) {
startVideoActivity(call);
} else { } else {
startIncallActivity(call); startIncallActivity(call);
} }
} }
} }
}
doNotGoToCallActivity = false; doNotGoToCallActivity = false;
} }
@ -1383,12 +1369,8 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
} else if (extras != null && extras.getBoolean("Notification", false)) { } else if (extras != null && extras.getBoolean("Notification", false)) {
if (LinphoneManager.getLc().getCallsNb() > 0) { if (LinphoneManager.getLc().getCallsNb() > 0) {
LinphoneCall call = LinphoneManager.getLc().getCalls()[0]; LinphoneCall call = LinphoneManager.getLc().getCalls()[0];
if (call.getCurrentParamsCopy().getVideoEnabled()) {
startVideoActivity(call);
} else {
startIncallActivity(call); startIncallActivity(call);
} }
}
} else { } else {
DialerFragment dialerFragment = DialerFragment.instance(); DialerFragment dialerFragment = DialerFragment.instance();
if (dialerFragment != null) { if (dialerFragment != null) {