Search code examples
androidaudiomute

android sdk error - AudioManager.isMicrophoneMute() always false


As the title states AudioManager.isMicrophoneMute() always returns false, no matter what.

The setup:

Manifest includes this permission because of an older bug that could be related to this. Old bug was about checking if headphones are used. Doesn't help, but doesn't hurt either.

<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />

  1. Initiate a call into the emulator from telnet.
  2. Pick up phone
  3. Check app - status audioManager.getMode() == audioManager.MODE_IN_CALL is true. Ok, we're good
  4. Status check audioManager.isMicrophoneMute() is false - ok, we're still good
  5. Switch back to phone and press the Mute button
  6. Switch to app, check audioManager.isMicrophoneMute() and it's still false - no good. should be true.

So is this a broken API? Or do I need some other permissions? Or does this not work on Emulator??

Thank you.


Solution

  • This now works in 5.x Lollipop. Still doesn't work in 4.x. Maybe Google just won't fix it for the older OS.