Bug 818708 - Content audio channels should be muted if in background when another content audio channel is playing. r=sicking

This commit is contained in:
Andrea Marchesini 2013-01-03 17:18:43 -05:00
Родитель 1b8e54ed96
Коммит f6c7eded41
1 изменённых файлов: 16 добавлений и 3 удалений

Просмотреть файл

@ -151,10 +151,23 @@ AudioChannelService::GetMuted(AudioChannelType aType, bool aElementHidden)
return true;
case AUDIO_CHANNEL_CONTENT:
// TODO: this should work per apps
if (mChannelCounters[AUDIO_CHANNEL_CONTENT].Length() > 1)
return true;
{
// If we have more than 1 using the content channel,
// this must be muted.
uint32_t childId = CONTENT_PARENT_UNKNOWN_CHILD_ID;
bool empty = true;
for (uint32_t i = 0;
i < mChannelCounters[AUDIO_CHANNEL_CONTENT].Length();
++i) {
if (empty) {
childId = mChannelCounters[AUDIO_CHANNEL_CONTENT][i];
empty = false;
}
else if (childId != mChannelCounters[AUDIO_CHANNEL_CONTENT][i])
return true;
}
break;
}
case AUDIO_CHANNEL_NOTIFICATION:
case AUDIO_CHANNEL_ALARM: