看起来是因为不同的AP使用了不同的Audio Stream,仅仅获取到Stream_MUSIC的Focus并不够,你可以仔细参看那关于Audio Stream的部分内容:下面是我截取的内容,我觉得因为你不能确保那些其他的AP按规则来获取Stream(通常来说音乐类的AP都应该获取的是STREAM_MUSIC),那么想其他所有的AP都静音,也许只能靠遍历禁止下面所有Stream的办法。【奇怪,为什么天天动听与酷狗不是用的都是STREAM_MUSIC?】
int STREAM_ALARM The audio stream for alarms
int STREAM_DTMF The audio stream for DTMF Tones
int STREAM_MUSIC The audio stream for music playback
int STREAM_NOTIFICATION The audio stream for notifications
int STREAM_RING The audio stream for the phone ring
int STREAM_SYSTEM The audio stream for system sounds
int STREAM_VOICE_CALL The audio stream for phone calls