一 AOSP AudioMnager.java 中对外暴露的API
1 申请音频焦点
public int requestAudioFocus(OnAudioFocusChangeListener l, int streamType, int durationHint)
示例:
mAudioManager.requestAudioFocus(mAudioFocusListener, AudioManager.STREAM_MUSIC, AudioManager.AUDIOFOCUS_GAIN_TRANSIENT);
public int requestAudioFocus(@NonNull AudioFocusRequest focusRequest)
示例:
mFocusRequest = new AudioFocusRequest
.Builder(focusRequest)