List of usage examples for android.media AudioManager setParameters
public void setParameters(String keyValuePairs)
From source file:dk.nota.lyt.libvlc.PlaybackService.java
private void changeAudioFocus(boolean acquire) { final AudioManager am = (AudioManager) getSystemService(AUDIO_SERVICE); if (am == null) return;/* w w w.ja v a 2s . c o m*/ if (acquire) { if (!mHasAudioFocus) { final int result = am.requestAudioFocus(mAudioFocusListener, AudioManager.STREAM_MUSIC, AudioManager.AUDIOFOCUS_GAIN); if (result == AudioManager.AUDIOFOCUS_REQUEST_GRANTED) { am.setParameters("bgm_state=true"); mHasAudioFocus = true; } } } else { if (mHasAudioFocus) { final int result = am.abandonAudioFocus(mAudioFocusListener); am.setParameters("bgm_state=false"); mHasAudioFocus = false; } } }