Loading media/audio/aconfig/audio.aconfig +7 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,13 @@ package: "com.android.media.audio" flag { name: "alarm_min_volume_zero" namespace: "media_audio" description: "Support configuring alarm min vol to zero" bug: "296884402" } flag { name: "bluetooth_mac_address_anonymization" namespace: "media_audio" Loading services/audiopolicy/engine/common/Android.bp +4 −0 Original line number Diff line number Diff line Loading @@ -57,4 +57,8 @@ cc_library_static { "libaudiofoundation", "libaudiopolicycomponents", ], whole_static_libs: [ "server_configurable_flags", "com.android.media.audio-aconfig-cc", ], } services/audiopolicy/engine/common/src/EngineBase.cpp +19 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ #include "EngineBase.h" #include "EngineDefaultConfig.h" #include <TypeConverter.h> #include <com_android_media_audio.h> namespace android { namespace audio_policy { Loading Loading @@ -178,6 +179,24 @@ engineConfig::ParsingResult EngineBase::processParsingResult( ALOGE("%s: Invalid %s", __FUNCTION__, configCurve.deviceCategory.c_str()); continue; } if (!com::android::media::audio::alarm_min_volume_zero()) { /* * This special handling is done because the audio_policy_volumes.xml * is updated but if the flag is disabled, the min alarm volume can * still be zero because the audio_policy_volumes.xml is the source of * truth. So the index value is modified here to match the flag setting */ if (volumeConfig.name.compare(audio_stream_type_to_string(AUDIO_STREAM_ALARM)) == 0 && deviceCat == DEVICE_CATEGORY_SPEAKER) { for (auto &point : configCurve.curvePoints) { if (point.index == 1) { ALOGD("Mute alarm disabled: Found point with index 1. setting it to 0"); point.index = 0; break; } } } } sp<VolumeCurve> curve = new VolumeCurve(deviceCat); for (auto &point : configCurve.curvePoints) { curve->add({point.index, point.attenuationInMb}); Loading Loading
media/audio/aconfig/audio.aconfig +7 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,13 @@ package: "com.android.media.audio" flag { name: "alarm_min_volume_zero" namespace: "media_audio" description: "Support configuring alarm min vol to zero" bug: "296884402" } flag { name: "bluetooth_mac_address_anonymization" namespace: "media_audio" Loading
services/audiopolicy/engine/common/Android.bp +4 −0 Original line number Diff line number Diff line Loading @@ -57,4 +57,8 @@ cc_library_static { "libaudiofoundation", "libaudiopolicycomponents", ], whole_static_libs: [ "server_configurable_flags", "com.android.media.audio-aconfig-cc", ], }
services/audiopolicy/engine/common/src/EngineBase.cpp +19 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ #include "EngineBase.h" #include "EngineDefaultConfig.h" #include <TypeConverter.h> #include <com_android_media_audio.h> namespace android { namespace audio_policy { Loading Loading @@ -178,6 +179,24 @@ engineConfig::ParsingResult EngineBase::processParsingResult( ALOGE("%s: Invalid %s", __FUNCTION__, configCurve.deviceCategory.c_str()); continue; } if (!com::android::media::audio::alarm_min_volume_zero()) { /* * This special handling is done because the audio_policy_volumes.xml * is updated but if the flag is disabled, the min alarm volume can * still be zero because the audio_policy_volumes.xml is the source of * truth. So the index value is modified here to match the flag setting */ if (volumeConfig.name.compare(audio_stream_type_to_string(AUDIO_STREAM_ALARM)) == 0 && deviceCat == DEVICE_CATEGORY_SPEAKER) { for (auto &point : configCurve.curvePoints) { if (point.index == 1) { ALOGD("Mute alarm disabled: Found point with index 1. setting it to 0"); point.index = 0; break; } } } } sp<VolumeCurve> curve = new VolumeCurve(deviceCat); for (auto &point : configCurve.curvePoints) { curve->add({point.index, point.attenuationInMb}); Loading