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:
- AudioManger.setMicrophoneMute functionality not working??
- setMicrophoneMute(boolean) doesn't work on some devices
- Unable to mute the microphone in Android
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:
- How is that flag (SET_MIC_MUTE in database) being used?
- When does this flag actually disconnect the microphone signal from the pre-amplifier circuit inside the phone?
- If it doesn't do that, who does that?
- If nothing does that, how is this "mute" expected to work?
Please explain. Thanks.