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) {
|
if (mUseFixedVolume) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
int streamAlias = mStreamVolumeAlias[streamType];
|
||||||
for (int stream = 0; stream < mStreamStates.length; stream++) {
|
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);
|
mStreamStates[stream].mute(cb, state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1526,17 +1528,21 @@ public class AudioService extends IAudioService.Stub {
|
|||||||
if (streamType == AudioManager.USE_DEFAULT_STREAM_TYPE) {
|
if (streamType == AudioManager.USE_DEFAULT_STREAM_TYPE) {
|
||||||
streamType = getActiveStreamType(streamType);
|
streamType = getActiveStreamType(streamType);
|
||||||
}
|
}
|
||||||
|
int streamAlias = mStreamVolumeAlias[streamType];
|
||||||
if (isStreamAffectedByMute(streamType)) {
|
if (isStreamAffectedByMute(streamAlias)) {
|
||||||
if (streamType == AudioSystem.STREAM_MUSIC) {
|
if (streamAlias == AudioSystem.STREAM_MUSIC) {
|
||||||
setSystemAudioMute(state);
|
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 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);
|
intent.putExtra(AudioManager.EXTRA_STREAM_VOLUME_MUTED, state);
|
||||||
sendBroadcastToAll(intent);
|
sendBroadcastToAll(intent);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user