зеркало из https://github.com/mozilla/gecko-dev.git
Bug 815452 - Don't unmute FM audio if the user increases the volume when FM audio is muted for channel policy reasons. r=sicking a=basecamp-blocker
This commit is contained in:
Родитель
f5800a023c
Коммит
eea4b358f4
|
@ -70,7 +70,7 @@ if ("nsIAudioManager" in Ci) {
|
|||
const nsIAudioManager = Ci.nsIAudioManager;
|
||||
audioChannelSettings = [
|
||||
// settings name, max value, apply to stream types
|
||||
['audio.volume.content', 15, [nsIAudioManager.STREAM_TYPE_SYSTEM, nsIAudioManager.STREAM_TYPE_MUSIC, nsIAudioManager.STREAM_TYPE_FM]],
|
||||
['audio.volume.content', 15, [nsIAudioManager.STREAM_TYPE_SYSTEM, nsIAudioManager.STREAM_TYPE_MUSIC]],
|
||||
['audio.volume.notification', 15, [nsIAudioManager.STREAM_TYPE_RING, nsIAudioManager.STREAM_TYPE_NOTIFICATION]],
|
||||
['audio.volume.alarm', 15, [nsIAudioManager.STREAM_TYPE_ALARM]],
|
||||
['audio.volume.telephony', 5, [nsIAudioManager.STREAM_TYPE_VOICE_CALL]],
|
||||
|
|
|
@ -391,10 +391,16 @@ NS_IMETHODIMP
|
|||
AudioManager::SetStreamVolumeIndex(int32_t aStream, int32_t aIndex) {
|
||||
status_t status =
|
||||
AudioSystem::setStreamVolumeIndex(static_cast<audio_stream_type_t>(aStream), aIndex);
|
||||
// sync the fm stream volume with music volume
|
||||
if (aStream == AUDIO_STREAM_MUSIC && IsDeviceOn(AUDIO_DEVICE_OUT_FM)) {
|
||||
|
||||
// sync the fm stream volume with music volume, except set fm volume by audioChannelServices
|
||||
if (aStream == AUDIO_STREAM_FM && IsDeviceOn(AUDIO_DEVICE_OUT_FM)) {
|
||||
mFMChannelIsMuted = aIndex == 0;
|
||||
}
|
||||
// sync fm volume with music stream type
|
||||
if (aStream == AUDIO_STREAM_MUSIC && IsDeviceOn(AUDIO_DEVICE_OUT_FM) && !mFMChannelIsMuted) {
|
||||
AudioSystem::setStreamVolumeIndex(static_cast<audio_stream_type_t>(AUDIO_STREAM_FM), aIndex);
|
||||
}
|
||||
|
||||
return status ? NS_ERROR_FAILURE : NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -52,6 +52,7 @@ protected:
|
|||
|
||||
private:
|
||||
nsAutoPtr<mozilla::hal::SwitchObserver> mObserver;
|
||||
bool mFMChannelIsMuted;
|
||||
};
|
||||
|
||||
} /* namespace gonk */
|
||||
|
|
Загрузка…
Ссылка в новой задаче