1

I am working on an android project. I would like to set the micrphone on mute when licking a button. Using this code:

AudioManager audioManager = ((AudioManager) getApplicationContext().getSystemService(Context.AUDIO_SERVICE));
audioManager.setMicrophoneMute(true);

everything works ok, EXCEPT motorola.

On morotola, the microphone is not set to mute. Can someone please give me an advice?

EDIT

I found this:

Intent buttonUp = new Intent(Intent.ACTION_MEDIA_BUTTON);
buttonUp.putExtra(Intent.EXTRA_KEY_EVENT,new KeyEvent(KeyEvent.ACTION_UP,KeyEvent.KEYCODE_MUTE));
getBaseContext().sendOrderedBroadcast(buttonUp,"android.permission.CALL_PRIVILEGED");

How to now use this code in order to unmute the call?

Community
  • 1
  • 1
just ME
  • 1,817
  • 6
  • 32
  • 53
  • Please check this answer . http://stackoverflow.com/a/6562119/614807 – Chirag Aug 14 '12 at 13:16
  • thank you for your reply. How to unmute a Intent buttonUp = new Intent(Intent.ACTION_MEDIA_BUTTON); buttonUp.putExtra(Intent.EXTRA_KEY_EVENT,new KeyEvent(KeyEvent.ACTION_UP,KeyEvent.KEYCODE_MUTE)); getBaseContext().sendOrderedBroadcast(buttonUp,"android.permission.CALL_PRIVILEGED"); – just ME Aug 14 '12 at 14:01

0 Answers0