Do not perform echo canceller calibration on first startup if the device is known to have a built-in echo canceller.

This commit is contained in:
Ghislain MARY 2012-10-16 14:53:03 +02:00
parent 16e5cf9690
commit e01ba7f0e6

View file

@ -47,6 +47,7 @@ import org.linphone.core.LinphoneFriend;
import org.linphone.core.Log; import org.linphone.core.Log;
import org.linphone.core.OnlineStatus; import org.linphone.core.OnlineStatus;
import org.linphone.mediastream.Version; import org.linphone.mediastream.Version;
import org.linphone.mediastream.video.capture.hwconf.Hacks;
import org.linphone.setup.SetupActivity; import org.linphone.setup.SetupActivity;
import org.linphone.ui.AddressText; import org.linphone.ui.AddressText;
@ -1150,11 +1151,13 @@ public class LinphoneActivity extends FragmentActivity implements OnClickListene
@Override @Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) { protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if ((requestCode == FIRST_LOGIN_ACTIVITY) && (resultCode == RESULT_OK)) { if ((requestCode == FIRST_LOGIN_ACTIVITY) && (resultCode == RESULT_OK)) {
Toast.makeText(this, getString(R.string.ec_calibration_launch_message), Toast.LENGTH_LONG).show(); if (!Hacks.hasBuiltInEchoCanceller()) {
try { Toast.makeText(this, getString(R.string.ec_calibration_launch_message), Toast.LENGTH_LONG).show();
LinphoneManager.getInstance().startEcCalibration(this); try {
} catch (LinphoneCoreException e) { LinphoneManager.getInstance().startEcCalibration(this);
Log.e(e, "Unable to calibrate EC"); } catch (LinphoneCoreException e) {
Log.e(e, "Unable to calibrate EC");
}
} }
} }
else if (resultCode == Activity.RESULT_FIRST_USER && requestCode == SETTINGS_ACTIVITY) { else if (resultCode == Activity.RESULT_FIRST_USER && requestCode == SETTINGS_ACTIVITY) {