I have a strange device specific issue with Galaxy S5. I'm using SIP (Linphone) to make call from Galaxy S5 to another device and when I enable speakerphone, the device starts to using its main microphone as noise reduction microphone and its secondary microphone as main one. The result is that I have to speak into device back side, because user just doesn't hear me when I speak into main microphone.
AudioManager manager = (AudioManager) getSystemService(AUDIO_SERVICE);
manager.setSpeakerphoneOn(true);
I have used this code to enable speakerphone. I have also tried to enable various modes:
manager.setMode(AudioManager.MODE_NORMAL); //Also tested with other modes
There is no issues when speakerphone is disabled. Also in standard dialer speakerphone mode works just fine. Couldn't reproduce this issue on any other device.