@Override public void setEchoSuppressionEnabled(boolean enabled) { // TODO: Remove the enabled argument. We should check the speakerphone // state with AudioManager instead of keeping a state here so the // method with a state argument is redundant. Also rename the method // to something like onSpeaerphoneStateChanged(). Echo suppression may // not be available on every device. synchronized (SipPhone.class) { AudioManager audioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE); String echoSuppression = audioManager.getParameters("ec_supported"); if (echoSuppression.contains("off")) { mForegroundCall.setAudioGroupMode(); } } }