am ad58ca67
: Merge "AudioService: handle stream mute by stream alias" into lmp-mr1-dev
* commit 'ad58ca67c6e3a999357f0d4df8daa9fbbe1a2903': AudioService: handle stream mute by stream alias
This commit is contained in:
@ -1511,9 +1511,11 @@ public class AudioService extends IAudioService.Stub {
|
||||
if (mUseFixedVolume) {
|
||||
return;
|
||||
}
|
||||
|
||||
int streamAlias = mStreamVolumeAlias[streamType];
|
||||
for (int stream = 0; stream < mStreamStates.length; stream++) {
|
||||
if (!isStreamAffectedByMute(stream) || stream == streamType) continue;
|
||||
if (!isStreamAffectedByMute(streamAlias) || streamAlias == mStreamVolumeAlias[stream]) {
|
||||
continue;
|
||||
}
|
||||
mStreamStates[stream].mute(cb, state);
|
||||
}
|
||||
}
|
||||
@ -1526,19 +1528,23 @@ public class AudioService extends IAudioService.Stub {
|
||||
if (streamType == AudioManager.USE_DEFAULT_STREAM_TYPE) {
|
||||
streamType = getActiveStreamType(streamType);
|
||||
}
|
||||
|
||||
if (isStreamAffectedByMute(streamType)) {
|
||||
if (streamType == AudioSystem.STREAM_MUSIC) {
|
||||
int streamAlias = mStreamVolumeAlias[streamType];
|
||||
if (isStreamAffectedByMute(streamAlias)) {
|
||||
if (streamAlias == AudioSystem.STREAM_MUSIC) {
|
||||
setSystemAudioMute(state);
|
||||
}
|
||||
mStreamStates[streamType].mute(cb, state);
|
||||
for (int stream = 0; stream < mStreamStates.length; stream++) {
|
||||
if (streamAlias == mStreamVolumeAlias[stream]) {
|
||||
mStreamStates[stream].mute(cb, state);
|
||||
|
||||
Intent intent = new Intent(AudioManager.STREAM_MUTE_CHANGED_ACTION);
|
||||
intent.putExtra(AudioManager.EXTRA_VOLUME_STREAM_TYPE, streamType);
|
||||
intent.putExtra(AudioManager.EXTRA_VOLUME_STREAM_TYPE, stream);
|
||||
intent.putExtra(AudioManager.EXTRA_STREAM_VOLUME_MUTED, state);
|
||||
sendBroadcastToAll(intent);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void setSystemAudioMute(boolean state) {
|
||||
if (mHdmiManager == null || mHdmiTvClient == null) return;
|
||||
|
Reference in New Issue
Block a user