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?