2

I'm facing a Problem, related to my Question: Is it possible to ignore plugged in Headset and still use phone speakers?
I used the same code as in the linked question. The only change here is that I use the PhoneStateListener to intercept when a call is answered and respond to it. This Code is executed, if a Call get's answered:

AudioManager audioManager = (AudioManager) _context.getSystemService(Context.AUDIO_SERVICE);
audioManager.setMode(AudioManager.MODE_IN_CALL);

If I add audioManager.setSpeakerphoneOn(true); to it, the loudspeakers are activated (what I don't want)
Nothing happens if I change the AudioManager Mode from AudioManager.MODE_IN_CALL to AudioManager.MODE_IN_COMMUNICATION

My Problem is, that I can't make an "normal" Phone Call, while my Headset is plugged in.
So far I played around with AudioManager and the setMode() function of it.
Unfortunately, the only thing I managed to do was to make a phone call over the loudspeakers. But this is not the desired goal.

Can anyone help me with this?

Michael
  • 59
  • 1
  • 8

0 Answers0