I have been trying to use Android's AudioManager.setMicrophoneMute() without much success. That is, it simply refuses to mute the microphone, no matter what I do.

I searched the web for some clues and I found several references reporting similar experience:

Which begs the question: Does AudioManager.setMicrophoneMute() work at all? Is it only a stub method, waiting to be implemented in some future version of Android? If not, how does it work? What do I need to make it work? What are the conditions that make it work as its name implies?

EDIT: I noticed that the documentation for this method says:

This method should only be used by applications that replace the platform-wide management of audio settings or the main telephony application.

What does this mean? Why would I want to replace the platform-wide management? Do I really need to do that? If so, how do I do that?

EDIT: The answer below is great but I still don't understand:

  1. How is that flag (SET_MIC_MUTE in database) being used?
  2. When does this flag actually disconnect the microphone signal from the pre-amplifier circuit inside the phone?
  3. If it doesn't do that, who does that?
  4. If nothing does that, how is this "mute" expected to work?

Please explain. Thanks.

Edit
Report