summaryrefslogtreecommitdiffstats
path: root/services/audiopolicy
diff options
context:
space:
mode:
Diffstat (limited to 'services/audiopolicy')
-rw-r--r--services/audiopolicy/Android.mk59
-rw-r--r--services/audiopolicy/AudioPolicyInterface.h16
-rw-r--r--services/audiopolicy/AudioPolicyManager.h937
-rw-r--r--services/audiopolicy/common/Android.mk9
-rw-r--r--services/audiopolicy/common/include/RoutingStrategy.h38
-rwxr-xr-xservices/audiopolicy/common/include/Volume.h159
-rwxr-xr-xservices/audiopolicy/common/include/policy.h88
-rw-r--r--services/audiopolicy/common/managerdefinitions/Android.mk36
-rw-r--r--services/audiopolicy/common/managerdefinitions/include/AudioGain.h40
-rw-r--r--services/audiopolicy/common/managerdefinitions/include/AudioInputDescriptor.h87
-rw-r--r--services/audiopolicy/common/managerdefinitions/include/AudioOutputDescriptor.h163
-rw-r--r--services/audiopolicy/common/managerdefinitions/include/AudioPatch.h55
-rw-r--r--services/audiopolicy/common/managerdefinitions/include/AudioPolicyMix.h81
-rw-r--r--services/audiopolicy/common/managerdefinitions/include/AudioPort.h126
-rw-r--r--services/audiopolicy/common/managerdefinitions/include/ConfigParsingUtils.h275
-rw-r--r--services/audiopolicy/common/managerdefinitions/include/DeviceDescriptor.h95
-rw-r--r--services/audiopolicy/common/managerdefinitions/include/EffectDescriptor.h71
-rw-r--r--services/audiopolicy/common/managerdefinitions/include/HwModule.h74
-rw-r--r--services/audiopolicy/common/managerdefinitions/include/IOProfile.h60
-rw-r--r--services/audiopolicy/common/managerdefinitions/include/SessionRoute.h118
-rw-r--r--services/audiopolicy/common/managerdefinitions/include/SoundTriggerSession.h33
-rw-r--r--services/audiopolicy/common/managerdefinitions/include/StreamDescriptor.h85
-rw-r--r--services/audiopolicy/common/managerdefinitions/include/audio_policy_conf.h (renamed from services/audiopolicy/audio_policy_conf.h)14
-rw-r--r--services/audiopolicy/common/managerdefinitions/src/AudioGain.cpp130
-rw-r--r--services/audiopolicy/common/managerdefinitions/src/AudioInputDescriptor.cpp195
-rw-r--r--services/audiopolicy/common/managerdefinitions/src/AudioOutputDescriptor.cpp497
-rw-r--r--services/audiopolicy/common/managerdefinitions/src/AudioPatch.cpp154
-rw-r--r--services/audiopolicy/common/managerdefinitions/src/AudioPolicyMix.cpp193
-rw-r--r--services/audiopolicy/common/managerdefinitions/src/AudioPort.cpp929
-rw-r--r--services/audiopolicy/common/managerdefinitions/src/ConfigParsingUtils.cpp288
-rw-r--r--services/audiopolicy/common/managerdefinitions/src/DeviceDescriptor.cpp350
-rw-r--r--services/audiopolicy/common/managerdefinitions/src/EffectDescriptor.cpp192
-rw-r--r--services/audiopolicy/common/managerdefinitions/src/HwModule.cpp375
-rw-r--r--services/audiopolicy/common/managerdefinitions/src/IOProfile.cpp164
-rw-r--r--services/audiopolicy/common/managerdefinitions/src/SessionRoute.cpp124
-rw-r--r--services/audiopolicy/common/managerdefinitions/src/SoundTriggerSession.cpp45
-rw-r--r--services/audiopolicy/common/managerdefinitions/src/StreamDescriptor.cpp162
-rwxr-xr-xservices/audiopolicy/engine/interface/AudioPolicyManagerInterface.h171
-rwxr-xr-xservices/audiopolicy/engine/interface/AudioPolicyManagerObserver.h62
-rwxr-xr-xservices/audiopolicy/engineconfigurable/Android.mk59
-rwxr-xr-xservices/audiopolicy/engineconfigurable/include/AudioPolicyEngineInstance.h81
-rwxr-xr-xservices/audiopolicy/engineconfigurable/include/EngineDefinition.h22
-rwxr-xr-xservices/audiopolicy/engineconfigurable/interface/AudioPolicyPluginInterface.h147
-rw-r--r--services/audiopolicy/engineconfigurable/parameter-framework/Android.mk7
-rw-r--r--services/audiopolicy/engineconfigurable/parameter-framework/example/Android.mk105
-rwxr-xr-xservices/audiopolicy/engineconfigurable/parameter-framework/example/ParameterFrameworkConfigurationPolicy.xml15
-rw-r--r--services/audiopolicy/engineconfigurable/parameter-framework/example/README.md11
-rw-r--r--services/audiopolicy/engineconfigurable/parameter-framework/example/Settings/PolicyConfigurableDomains.xml11298
-rw-r--r--services/audiopolicy/engineconfigurable/parameter-framework/example/Settings/device_for_input_source.pfw515
-rw-r--r--services/audiopolicy/engineconfigurable/parameter-framework/example/Settings/device_for_strategy_accessibility.pfw302
-rw-r--r--services/audiopolicy/engineconfigurable/parameter-framework/example/Settings/device_for_strategy_dtmf.pfw637
-rw-r--r--services/audiopolicy/engineconfigurable/parameter-framework/example/Settings/device_for_strategy_enforced_audible.pfw358
-rw-r--r--services/audiopolicy/engineconfigurable/parameter-framework/example/Settings/device_for_strategy_media.pfw331
-rw-r--r--services/audiopolicy/engineconfigurable/parameter-framework/example/Settings/device_for_strategy_phone.pfw485
-rw-r--r--services/audiopolicy/engineconfigurable/parameter-framework/example/Settings/device_for_strategy_rerouting.pfw297
-rw-r--r--services/audiopolicy/engineconfigurable/parameter-framework/example/Settings/device_for_strategy_sonification.pfw485
-rw-r--r--services/audiopolicy/engineconfigurable/parameter-framework/example/Settings/device_for_strategy_sonification_respectful.pfw545
-rw-r--r--services/audiopolicy/engineconfigurable/parameter-framework/example/Settings/device_for_strategy_transmitted_through_speaker.pfw40
-rwxr-xr-xservices/audiopolicy/engineconfigurable/parameter-framework/example/Settings/strategy_for_stream.pfw20
-rw-r--r--services/audiopolicy/engineconfigurable/parameter-framework/example/Settings/strategy_for_usage.pfw39
-rw-r--r--services/audiopolicy/engineconfigurable/parameter-framework/example/Settings/volumes.pfw545
-rwxr-xr-xservices/audiopolicy/engineconfigurable/parameter-framework/example/Structure/PolicyClass.xml5
-rwxr-xr-xservices/audiopolicy/engineconfigurable/parameter-framework/example/Structure/PolicySubsystem-CommonTypes.xml170
-rwxr-xr-xservices/audiopolicy/engineconfigurable/parameter-framework/example/Structure/PolicySubsystem-Volume.xml26
-rwxr-xr-xservices/audiopolicy/engineconfigurable/parameter-framework/example/Structure/PolicySubsystem.xml137
-rwxr-xr-xservices/audiopolicy/engineconfigurable/parameter-framework/example/policy_criteria.txt9
-rwxr-xr-xservices/audiopolicy/engineconfigurable/parameter-framework/plugin/Android.mk36
-rwxr-xr-xservices/audiopolicy/engineconfigurable/parameter-framework/plugin/InputSource.cpp53
-rwxr-xr-xservices/audiopolicy/engineconfigurable/parameter-framework/plugin/InputSource.h49
-rwxr-xr-xservices/audiopolicy/engineconfigurable/parameter-framework/plugin/PolicyMappingKeys.h32
-rwxr-xr-xservices/audiopolicy/engineconfigurable/parameter-framework/plugin/PolicySubsystem.cpp99
-rwxr-xr-xservices/audiopolicy/engineconfigurable/parameter-framework/plugin/PolicySubsystem.h60
-rwxr-xr-xservices/audiopolicy/engineconfigurable/parameter-framework/plugin/PolicySubsystemBuilder.cpp29
-rwxr-xr-xservices/audiopolicy/engineconfigurable/parameter-framework/plugin/Strategy.cpp54
-rwxr-xr-xservices/audiopolicy/engineconfigurable/parameter-framework/plugin/Strategy.h49
-rwxr-xr-xservices/audiopolicy/engineconfigurable/parameter-framework/plugin/Stream.cpp56
-rwxr-xr-xservices/audiopolicy/engineconfigurable/parameter-framework/plugin/Stream.h49
-rwxr-xr-xservices/audiopolicy/engineconfigurable/parameter-framework/plugin/Usage.cpp56
-rwxr-xr-xservices/audiopolicy/engineconfigurable/parameter-framework/plugin/Usage.h49
-rwxr-xr-xservices/audiopolicy/engineconfigurable/parameter-framework/plugin/VolumeProfile.cpp75
-rwxr-xr-xservices/audiopolicy/engineconfigurable/parameter-framework/plugin/VolumeProfile.h64
-rwxr-xr-xservices/audiopolicy/engineconfigurable/src/Collection.h163
-rwxr-xr-xservices/audiopolicy/engineconfigurable/src/Element.h99
-rwxr-xr-xservices/audiopolicy/engineconfigurable/src/Engine.cpp270
-rwxr-xr-xservices/audiopolicy/engineconfigurable/src/Engine.h225
-rwxr-xr-xservices/audiopolicy/engineconfigurable/src/EngineInstance.cpp63
-rwxr-xr-xservices/audiopolicy/engineconfigurable/src/InputSource.cpp69
-rwxr-xr-xservices/audiopolicy/engineconfigurable/src/InputSource.h88
-rwxr-xr-xservices/audiopolicy/engineconfigurable/src/Strategy.cpp68
-rwxr-xr-xservices/audiopolicy/engineconfigurable/src/Strategy.h89
-rwxr-xr-xservices/audiopolicy/engineconfigurable/src/Stream.cpp155
-rwxr-xr-xservices/audiopolicy/engineconfigurable/src/Stream.h115
-rwxr-xr-xservices/audiopolicy/engineconfigurable/src/Usage.cpp57
-rwxr-xr-xservices/audiopolicy/engineconfigurable/src/Usage.h88
-rw-r--r--services/audiopolicy/engineconfigurable/wrapper/Android.mk40
-rwxr-xr-xservices/audiopolicy/engineconfigurable/wrapper/ParameterManagerWrapper.cpp435
-rwxr-xr-xservices/audiopolicy/engineconfigurable/wrapper/audio_policy_criteria_conf.h71
-rwxr-xr-xservices/audiopolicy/engineconfigurable/wrapper/config/audio_policy_criteria.conf137
-rwxr-xr-xservices/audiopolicy/engineconfigurable/wrapper/include/ParameterManagerWrapper.h286
-rwxr-xr-xservices/audiopolicy/enginedefault/Android.mk46
-rwxr-xr-xservices/audiopolicy/enginedefault/include/AudioPolicyEngineInstance.h76
-rwxr-xr-xservices/audiopolicy/enginedefault/src/Engine.cpp718
-rwxr-xr-xservices/audiopolicy/enginedefault/src/Engine.h158
-rwxr-xr-xservices/audiopolicy/enginedefault/src/EngineInstance.cpp54
-rw-r--r--services/audiopolicy/enginedefault/src/Gains.cpp255
-rw-r--r--services/audiopolicy/enginedefault/src/Gains.h64
-rw-r--r--services/audiopolicy/manager/AudioPolicyFactory.cpp (renamed from services/audiopolicy/AudioPolicyFactory.cpp)2
-rw-r--r--services/audiopolicy/managerdefault/AudioPolicyManager.cpp (renamed from services/audiopolicy/AudioPolicyManager.cpp)5124
-rw-r--r--services/audiopolicy/managerdefault/AudioPolicyManager.h618
-rw-r--r--services/audiopolicy/service/AudioPolicyClientImpl.cpp (renamed from services/audiopolicy/AudioPolicyClientImpl.cpp)6
-rw-r--r--services/audiopolicy/service/AudioPolicyClientImplLegacy.cpp (renamed from services/audiopolicy/AudioPolicyClientImplLegacy.cpp)0
-rw-r--r--services/audiopolicy/service/AudioPolicyEffects.cpp (renamed from services/audiopolicy/AudioPolicyEffects.cpp)6
-rw-r--r--services/audiopolicy/service/AudioPolicyEffects.h (renamed from services/audiopolicy/AudioPolicyEffects.h)0
-rw-r--r--services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp (renamed from services/audiopolicy/AudioPolicyInterfaceImpl.cpp)74
-rw-r--r--services/audiopolicy/service/AudioPolicyInterfaceImplLegacy.cpp (renamed from services/audiopolicy/AudioPolicyInterfaceImplLegacy.cpp)24
-rw-r--r--services/audiopolicy/service/AudioPolicyService.cpp (renamed from services/audiopolicy/AudioPolicyService.cpp)84
-rw-r--r--services/audiopolicy/service/AudioPolicyService.h (renamed from services/audiopolicy/AudioPolicyService.h)37
-rw-r--r--services/audiopolicy/utilities/convert/convert.h383
118 files changed, 29333 insertions, 5165 deletions
diff --git a/services/audiopolicy/Android.mk b/services/audiopolicy/Android.mk
index 188fc89..5b38e1c 100644
--- a/services/audiopolicy/Android.mk
+++ b/services/audiopolicy/Android.mk
@@ -3,25 +3,27 @@ LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES:= \
- AudioPolicyService.cpp \
- AudioPolicyEffects.cpp
+ service/AudioPolicyService.cpp \
+ service/AudioPolicyEffects.cpp
ifeq ($(USE_LEGACY_AUDIO_POLICY), 1)
LOCAL_SRC_FILES += \
- AudioPolicyInterfaceImplLegacy.cpp \
- AudioPolicyClientImplLegacy.cpp
+ service/AudioPolicyInterfaceImplLegacy.cpp \
+ service/AudioPolicyClientImplLegacy.cpp
LOCAL_CFLAGS += -DUSE_LEGACY_AUDIO_POLICY
else
LOCAL_SRC_FILES += \
- AudioPolicyInterfaceImpl.cpp \
- AudioPolicyClientImpl.cpp
+ service/AudioPolicyInterfaceImpl.cpp \
+ service/AudioPolicyClientImpl.cpp
endif
LOCAL_C_INCLUDES := \
$(TOPDIR)frameworks/av/services/audioflinger \
$(call include-path-for, audio-effects) \
- $(call include-path-for, audio-utils)
+ $(call include-path-for, audio-utils) \
+ $(TOPDIR)frameworks/av/services/audiopolicy/common/include \
+ $(TOPDIR)frameworks/av/services/audiopolicy/engine/interface \
LOCAL_SHARED_LIBRARIES := \
libcutils \
@@ -39,7 +41,8 @@ LOCAL_SHARED_LIBRARIES += \
endif
LOCAL_STATIC_LIBRARIES := \
- libmedia_helper
+ libmedia_helper \
+ libaudiopolicycomponents
LOCAL_MODULE:= libaudiopolicyservice
@@ -53,7 +56,7 @@ ifneq ($(USE_LEGACY_AUDIO_POLICY), 1)
include $(CLEAR_VARS)
LOCAL_SRC_FILES:= \
- AudioPolicyManager.cpp
+ managerdefault/AudioPolicyManager.cpp \
LOCAL_SHARED_LIBRARIES := \
libcutils \
@@ -61,8 +64,30 @@ LOCAL_SHARED_LIBRARIES := \
liblog \
libsoundtrigger
+ifeq ($(USE_CONFIGURABLE_AUDIO_POLICY), 1)
+
+LOCAL_REQUIRED_MODULES := \
+ parameter-framework.policy \
+ audio_policy_criteria.conf \
+
+LOCAL_C_INCLUDES += \
+ $(TOPDIR)frameworks/av/services/audiopolicy/engineconfigurable/include \
+
+LOCAL_SHARED_LIBRARIES += libaudiopolicyengineconfigurable
+
+else
+
+LOCAL_SHARED_LIBRARIES += libaudiopolicyenginedefault
+
+endif
+
+LOCAL_C_INCLUDES += \
+ $(TOPDIR)frameworks/av/services/audiopolicy/common/include \
+ $(TOPDIR)frameworks/av/services/audiopolicy/engine/interface \
+
LOCAL_STATIC_LIBRARIES := \
- libmedia_helper
+ libmedia_helper \
+ libaudiopolicycomponents
LOCAL_MODULE:= libaudiopolicymanagerdefault
@@ -73,14 +98,26 @@ ifneq ($(USE_CUSTOM_AUDIO_POLICY), 1)
include $(CLEAR_VARS)
LOCAL_SRC_FILES:= \
- AudioPolicyFactory.cpp
+ manager/AudioPolicyFactory.cpp
LOCAL_SHARED_LIBRARIES := \
libaudiopolicymanagerdefault
+LOCAL_STATIC_LIBRARIES := \
+ libaudiopolicycomponents
+
+LOCAL_C_INCLUDES += \
+ $(TOPDIR)frameworks/av/services/audiopolicy/common/include \
+ $(TOPDIR)frameworks/av/services/audiopolicy/engine/interface \
+
LOCAL_MODULE:= libaudiopolicymanager
include $(BUILD_SHARED_LIBRARY)
endif
endif
+
+#######################################################################
+# Recursive call sub-folder Android.mk
+#
+include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/services/audiopolicy/AudioPolicyInterface.h b/services/audiopolicy/AudioPolicyInterface.h
index 4508fa7..8523fc5 100644
--- a/services/audiopolicy/AudioPolicyInterface.h
+++ b/services/audiopolicy/AudioPolicyInterface.h
@@ -75,7 +75,8 @@ public:
// indicate a change in device connection status
virtual status_t setDeviceConnectionState(audio_devices_t device,
audio_policy_dev_state_t state,
- const char *device_address) = 0;
+ const char *device_address,
+ const char *device_name) = 0;
// retrieve a device connection status
virtual audio_policy_dev_state_t getDeviceConnectionState(audio_devices_t device,
const char *device_address) = 0;
@@ -105,10 +106,12 @@ public:
audio_io_handle_t *output,
audio_session_t session,
audio_stream_type_t *stream,
+ uid_t uid,
uint32_t samplingRate,
audio_format_t format,
audio_channel_mask_t channelMask,
audio_output_flags_t flags,
+ int selectedDeviceId,
const audio_offload_info_t *offloadInfo) = 0;
// indicates to the audio policy manager that the output starts being used by corresponding stream.
virtual status_t startOutput(audio_io_handle_t output,
@@ -127,10 +130,12 @@ public:
virtual status_t getInputForAttr(const audio_attributes_t *attr,
audio_io_handle_t *input,
audio_session_t session,
+ uid_t uid,
uint32_t samplingRate,
audio_format_t format,
audio_channel_mask_t channelMask,
audio_input_flags_t flags,
+ audio_port_handle_t selectedDeviceId,
input_type_t *inputType) = 0;
// indicates to the audio policy manager that the input starts being used.
virtual status_t startInput(audio_io_handle_t input,
@@ -206,7 +211,7 @@ public:
struct audio_patch *patches,
unsigned int *generation) = 0;
virtual status_t setAudioPortConfig(const struct audio_port_config *config) = 0;
- virtual void clearAudioPatches(uid_t uid) = 0;
+ virtual void releaseResourcesForUid(uid_t uid) = 0;
virtual status_t acquireSoundTriggerSession(audio_session_t *session,
audio_io_handle_t *ioHandle,
@@ -216,6 +221,11 @@ public:
virtual status_t registerPolicyMixes(Vector<AudioMix> mixes) = 0;
virtual status_t unregisterPolicyMixes(Vector<AudioMix> mixes) = 0;
+
+ virtual status_t startAudioSource(const struct audio_port_config *source,
+ const audio_attributes_t *attributes,
+ audio_io_handle_t *handle) = 0;
+ virtual status_t stopAudioSource(audio_io_handle_t handle) = 0;
};
@@ -318,6 +328,8 @@ public:
virtual void onAudioPatchListUpdate() = 0;
virtual audio_unique_id_t newAudioUniqueId() = 0;
+
+ virtual void onDynamicPolicyMixStateUpdate(String8 regId, int32_t state) = 0;
};
extern "C" AudioPolicyInterface* createAudioPolicyManager(AudioPolicyClientInterface *clientInterface);
diff --git a/services/audiopolicy/AudioPolicyManager.h b/services/audiopolicy/AudioPolicyManager.h
deleted file mode 100644
index cbdafa6..0000000
--- a/services/audiopolicy/AudioPolicyManager.h
+++ /dev/null
@@ -1,937 +0,0 @@
-/*
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#include <stdint.h>
-#include <sys/types.h>
-#include <cutils/config_utils.h>
-#include <cutils/misc.h>
-#include <utils/Timers.h>
-#include <utils/Errors.h>
-#include <utils/KeyedVector.h>
-#include <utils/SortedVector.h>
-#include <media/AudioPolicy.h>
-#include "AudioPolicyInterface.h"
-
-
-namespace android {
-
-// ----------------------------------------------------------------------------
-
-// Attenuation applied to STRATEGY_SONIFICATION streams when a headset is connected: 6dB
-#define SONIFICATION_HEADSET_VOLUME_FACTOR 0.5
-// Min volume for STRATEGY_SONIFICATION streams when limited by music volume: -36dB
-#define SONIFICATION_HEADSET_VOLUME_MIN 0.016
-// Time in milliseconds during which we consider that music is still active after a music
-// track was stopped - see computeVolume()
-#define SONIFICATION_HEADSET_MUSIC_DELAY 5000
-// Time in milliseconds after media stopped playing during which we consider that the
-// sonification should be as unobtrusive as during the time media was playing.
-#define SONIFICATION_RESPECTFUL_AFTER_MUSIC_DELAY 5000
-// Time in milliseconds during witch some streams are muted while the audio path
-// is switched
-#define MUTE_TIME_MS 2000
-
-#define NUM_TEST_OUTPUTS 5
-
-#define NUM_VOL_CURVE_KNEES 2
-
-// Default minimum length allowed for offloading a compressed track
-// Can be overridden by the audio.offload.min.duration.secs property
-#define OFFLOAD_DEFAULT_MIN_DURATION_SECS 60
-
-#define MAX_MIXER_SAMPLING_RATE 48000
-#define MAX_MIXER_CHANNEL_COUNT 8
-
-// ----------------------------------------------------------------------------
-// AudioPolicyManager implements audio policy manager behavior common to all platforms.
-// ----------------------------------------------------------------------------
-
-class AudioPolicyManager: public AudioPolicyInterface
-#ifdef AUDIO_POLICY_TEST
- , public Thread
-#endif //AUDIO_POLICY_TEST
-{
-
-public:
- AudioPolicyManager(AudioPolicyClientInterface *clientInterface);
- virtual ~AudioPolicyManager();
-
- // AudioPolicyInterface
- virtual status_t setDeviceConnectionState(audio_devices_t device,
- audio_policy_dev_state_t state,
- const char *device_address);
- virtual audio_policy_dev_state_t getDeviceConnectionState(audio_devices_t device,
- const char *device_address);
- virtual void setPhoneState(audio_mode_t state);
- virtual void setForceUse(audio_policy_force_use_t usage,
- audio_policy_forced_cfg_t config);
- virtual audio_policy_forced_cfg_t getForceUse(audio_policy_force_use_t usage);
- virtual void setSystemProperty(const char* property, const char* value);
- virtual status_t initCheck();
- virtual audio_io_handle_t getOutput(audio_stream_type_t stream,
- uint32_t samplingRate,
- audio_format_t format,
- audio_channel_mask_t channelMask,
- audio_output_flags_t flags,
- const audio_offload_info_t *offloadInfo);
- virtual status_t getOutputForAttr(const audio_attributes_t *attr,
- audio_io_handle_t *output,
- audio_session_t session,
- audio_stream_type_t *stream,
- uint32_t samplingRate,
- audio_format_t format,
- audio_channel_mask_t channelMask,
- audio_output_flags_t flags,
- const audio_offload_info_t *offloadInfo);
- virtual status_t startOutput(audio_io_handle_t output,
- audio_stream_type_t stream,
- audio_session_t session);
- virtual status_t stopOutput(audio_io_handle_t output,
- audio_stream_type_t stream,
- audio_session_t session);
- virtual void releaseOutput(audio_io_handle_t output,
- audio_stream_type_t stream,
- audio_session_t session);
- virtual status_t getInputForAttr(const audio_attributes_t *attr,
- audio_io_handle_t *input,
- audio_session_t session,
- uint32_t samplingRate,
- audio_format_t format,
- audio_channel_mask_t channelMask,
- audio_input_flags_t flags,
- input_type_t *inputType);
-
- // indicates to the audio policy manager that the input starts being used.
- virtual status_t startInput(audio_io_handle_t input,
- audio_session_t session);
-
- // indicates to the audio policy manager that the input stops being used.
- virtual status_t stopInput(audio_io_handle_t input,
- audio_session_t session);
- virtual void releaseInput(audio_io_handle_t input,
- audio_session_t session);
- virtual void closeAllInputs();
- virtual void initStreamVolume(audio_stream_type_t stream,
- int indexMin,
- int indexMax);
- virtual status_t setStreamVolumeIndex(audio_stream_type_t stream,
- int index,
- audio_devices_t device);
- virtual status_t getStreamVolumeIndex(audio_stream_type_t stream,
- int *index,
- audio_devices_t device);
-
- // return the strategy corresponding to a given stream type
- virtual uint32_t getStrategyForStream(audio_stream_type_t stream);
- // return the strategy corresponding to the given audio attributes
- virtual uint32_t getStrategyForAttr(const audio_attributes_t *attr);
-
- // return the enabled output devices for the given stream type
- virtual audio_devices_t getDevicesForStream(audio_stream_type_t stream);
-
- virtual audio_io_handle_t getOutputForEffect(const effect_descriptor_t *desc = NULL);
- virtual status_t registerEffect(const effect_descriptor_t *desc,
- audio_io_handle_t io,
- uint32_t strategy,
- int session,
- int id);
- virtual status_t unregisterEffect(int id);
- virtual status_t setEffectEnabled(int id, bool enabled);
-
- virtual bool isStreamActive(audio_stream_type_t stream, uint32_t inPastMs = 0) const;
- // return whether a stream is playing remotely, override to change the definition of
- // local/remote playback, used for instance by notification manager to not make
- // media players lose audio focus when not playing locally
- // For the base implementation, "remotely" means playing during screen mirroring which
- // uses an output for playback with a non-empty, non "0" address.
- virtual bool isStreamActiveRemotely(audio_stream_type_t stream, uint32_t inPastMs = 0) const;
- virtual bool isSourceActive(audio_source_t source) const;
-
- virtual status_t dump(int fd);
-
- virtual bool isOffloadSupported(const audio_offload_info_t& offloadInfo);
-
- virtual status_t listAudioPorts(audio_port_role_t role,
- audio_port_type_t type,
- unsigned int *num_ports,
- struct audio_port *ports,
- unsigned int *generation);
- virtual status_t getAudioPort(struct audio_port *port);
- virtual status_t createAudioPatch(const struct audio_patch *patch,
- audio_patch_handle_t *handle,
- uid_t uid);
- virtual status_t releaseAudioPatch(audio_patch_handle_t handle,
- uid_t uid);
- virtual status_t listAudioPatches(unsigned int *num_patches,
- struct audio_patch *patches,
- unsigned int *generation);
- virtual status_t setAudioPortConfig(const struct audio_port_config *config);
- virtual void clearAudioPatches(uid_t uid);
-
- virtual status_t acquireSoundTriggerSession(audio_session_t *session,
- audio_io_handle_t *ioHandle,
- audio_devices_t *device);
-
- virtual status_t releaseSoundTriggerSession(audio_session_t session);
-
- virtual status_t registerPolicyMixes(Vector<AudioMix> mixes);
- virtual status_t unregisterPolicyMixes(Vector<AudioMix> mixes);
-
-protected:
-
- enum routing_strategy {
- STRATEGY_MEDIA,
- STRATEGY_PHONE,
- STRATEGY_SONIFICATION,
- STRATEGY_SONIFICATION_RESPECTFUL,
- STRATEGY_DTMF,
- STRATEGY_ENFORCED_AUDIBLE,
- STRATEGY_TRANSMITTED_THROUGH_SPEAKER,
- STRATEGY_ACCESSIBILITY,
- STRATEGY_REROUTING,
- NUM_STRATEGIES
- };
-
- // 4 points to define the volume attenuation curve, each characterized by the volume
- // index (from 0 to 100) at which they apply, and the attenuation in dB at that index.
- // we use 100 steps to avoid rounding errors when computing the volume in volIndexToAmpl()
-
- enum { VOLMIN = 0, VOLKNEE1 = 1, VOLKNEE2 = 2, VOLMAX = 3, VOLCNT = 4};
-
- class VolumeCurvePoint
- {
- public:
- int mIndex;
- float mDBAttenuation;
- };
-
- // device categories used for volume curve management.
- enum device_category {
- DEVICE_CATEGORY_HEADSET,
- DEVICE_CATEGORY_SPEAKER,
- DEVICE_CATEGORY_EARPIECE,
- DEVICE_CATEGORY_EXT_MEDIA,
- DEVICE_CATEGORY_CNT
- };
-
- class HwModule;
-
- class AudioGain: public RefBase
- {
- public:
- AudioGain(int index, bool useInChannelMask);
- virtual ~AudioGain() {}
-
- void dump(int fd, int spaces, int index) const;
-
- void getDefaultConfig(struct audio_gain_config *config);
- status_t checkConfig(const struct audio_gain_config *config);
- int mIndex;
- struct audio_gain mGain;
- bool mUseInChannelMask;
- };
-
- class AudioPort: public virtual RefBase
- {
- public:
- AudioPort(const String8& name, audio_port_type_t type,
- audio_port_role_t role, const sp<HwModule>& module);
- virtual ~AudioPort() {}
-
- virtual void toAudioPort(struct audio_port *port) const;
-
- void importAudioPort(const sp<AudioPort> port);
- void clearCapabilities();
-
- void loadSamplingRates(char *name);
- void loadFormats(char *name);
- void loadOutChannels(char *name);
- void loadInChannels(char *name);
-
- audio_gain_mode_t loadGainMode(char *name);
- void loadGain(cnode *root, int index);
- virtual void loadGains(cnode *root);
-
- // searches for an exact match
- status_t checkExactSamplingRate(uint32_t samplingRate) const;
- // searches for a compatible match, and returns the best match via updatedSamplingRate
- status_t checkCompatibleSamplingRate(uint32_t samplingRate,
- uint32_t *updatedSamplingRate) const;
- // searches for an exact match
- status_t checkExactChannelMask(audio_channel_mask_t channelMask) const;
- // searches for a compatible match, currently implemented for input channel masks only
- status_t checkCompatibleChannelMask(audio_channel_mask_t channelMask) const;
- status_t checkFormat(audio_format_t format) const;
- status_t checkGain(const struct audio_gain_config *gainConfig, int index) const;
-
- uint32_t pickSamplingRate() const;
- audio_channel_mask_t pickChannelMask() const;
- audio_format_t pickFormat() const;
-
- static const audio_format_t sPcmFormatCompareTable[];
- static int compareFormats(audio_format_t format1, audio_format_t format2);
-
- void dump(int fd, int spaces) const;
-
- String8 mName;
- audio_port_type_t mType;
- audio_port_role_t mRole;
- bool mUseInChannelMask;
- // by convention, "0' in the first entry in mSamplingRates, mChannelMasks or mFormats
- // indicates the supported parameters should be read from the output stream
- // after it is opened for the first time
- Vector <uint32_t> mSamplingRates; // supported sampling rates
- Vector <audio_channel_mask_t> mChannelMasks; // supported channel masks
- Vector <audio_format_t> mFormats; // supported audio formats
- Vector < sp<AudioGain> > mGains; // gain controllers
- sp<HwModule> mModule; // audio HW module exposing this I/O stream
- uint32_t mFlags; // attribute flags (e.g primary output,
- // direct output...).
- };
-
- class AudioPortConfig: public virtual RefBase
- {
- public:
- AudioPortConfig();
- virtual ~AudioPortConfig() {}
-
- status_t applyAudioPortConfig(const struct audio_port_config *config,
- struct audio_port_config *backupConfig = NULL);
- virtual void toAudioPortConfig(struct audio_port_config *dstConfig,
- const struct audio_port_config *srcConfig = NULL) const = 0;
- virtual sp<AudioPort> getAudioPort() const = 0;
- uint32_t mSamplingRate;
- audio_format_t mFormat;
- audio_channel_mask_t mChannelMask;
- struct audio_gain_config mGain;
- };
-
-
- class AudioPatch: public RefBase
- {
- public:
- AudioPatch(audio_patch_handle_t handle,
- const struct audio_patch *patch, uid_t uid) :
- mHandle(handle), mPatch(*patch), mUid(uid), mAfPatchHandle(0) {}
-
- status_t dump(int fd, int spaces, int index) const;
-
- audio_patch_handle_t mHandle;
- struct audio_patch mPatch;
- uid_t mUid;
- audio_patch_handle_t mAfPatchHandle;
- };
-
- class DeviceDescriptor: public AudioPort, public AudioPortConfig
- {
- public:
- DeviceDescriptor(const String8& name, audio_devices_t type);
-
- virtual ~DeviceDescriptor() {}
-
- bool equals(const sp<DeviceDescriptor>& other) const;
-
- // AudioPortConfig
- virtual sp<AudioPort> getAudioPort() const { return (AudioPort*) this; }
- virtual void toAudioPortConfig(struct audio_port_config *dstConfig,
- const struct audio_port_config *srcConfig = NULL) const;
-
- // AudioPort
- virtual void loadGains(cnode *root);
- virtual void toAudioPort(struct audio_port *port) const;
-
- status_t dump(int fd, int spaces, int index) const;
-
- audio_devices_t mDeviceType;
- String8 mAddress;
- audio_port_handle_t mId;
- };
-
- class DeviceVector : public SortedVector< sp<DeviceDescriptor> >
- {
- public:
- DeviceVector() : SortedVector(), mDeviceTypes(AUDIO_DEVICE_NONE) {}
-
- ssize_t add(const sp<DeviceDescriptor>& item);
- ssize_t remove(const sp<DeviceDescriptor>& item);
- ssize_t indexOf(const sp<DeviceDescriptor>& item) const;
-
- audio_devices_t types() const { return mDeviceTypes; }
-
- void loadDevicesFromType(audio_devices_t types);
- void loadDevicesFromName(char *name, const DeviceVector& declaredDevices);
-
- sp<DeviceDescriptor> getDevice(audio_devices_t type, String8 address) const;
- DeviceVector getDevicesFromType(audio_devices_t types) const;
- sp<DeviceDescriptor> getDeviceFromId(audio_port_handle_t id) const;
- sp<DeviceDescriptor> getDeviceFromName(const String8& name) const;
- DeviceVector getDevicesFromTypeAddr(audio_devices_t type, String8 address)
- const;
-
- private:
- void refreshTypes();
- audio_devices_t mDeviceTypes;
- };
-
- // the IOProfile class describes the capabilities of an output or input stream.
- // It is currently assumed that all combination of listed parameters are supported.
- // It is used by the policy manager to determine if an output or input is suitable for
- // a given use case, open/close it accordingly and connect/disconnect audio tracks
- // to/from it.
- class IOProfile : public AudioPort
- {
- public:
- IOProfile(const String8& name, audio_port_role_t role, const sp<HwModule>& module);
- virtual ~IOProfile();
-
- // This method is used for both output and input.
- // If parameter updatedSamplingRate is non-NULL, it is assigned the actual sample rate.
- // For input, flags is interpreted as audio_input_flags_t.
- // TODO: merge audio_output_flags_t and audio_input_flags_t.
- bool isCompatibleProfile(audio_devices_t device,
- String8 address,
- uint32_t samplingRate,
- uint32_t *updatedSamplingRate,
- audio_format_t format,
- audio_channel_mask_t channelMask,
- uint32_t flags) const;
-
- void dump(int fd);
- void log();
-
- DeviceVector mSupportedDevices; // supported devices
- // (devices this output can be routed to)
- };
-
- class HwModule : public RefBase
- {
- public:
- HwModule(const char *name);
- ~HwModule();
-
- status_t loadOutput(cnode *root);
- status_t loadInput(cnode *root);
- status_t loadDevice(cnode *root);
-
- status_t addOutputProfile(String8 name, const audio_config_t *config,
- audio_devices_t device, String8 address);
- status_t removeOutputProfile(String8 name);
- status_t addInputProfile(String8 name, const audio_config_t *config,
- audio_devices_t device, String8 address);
- status_t removeInputProfile(String8 name);
-
- void dump(int fd);
-
- const char *const mName; // base name of the audio HW module (primary, a2dp ...)
- uint32_t mHalVersion; // audio HAL API version
- audio_module_handle_t mHandle;
- Vector < sp<IOProfile> > mOutputProfiles; // output profiles exposed by this module
- Vector < sp<IOProfile> > mInputProfiles; // input profiles exposed by this module
- DeviceVector mDeclaredDevices; // devices declared in audio_policy.conf
-
- };
-
- // default volume curve
- static const VolumeCurvePoint sDefaultVolumeCurve[AudioPolicyManager::VOLCNT];
- // default volume curve for media strategy
- static const VolumeCurvePoint sDefaultMediaVolumeCurve[AudioPolicyManager::VOLCNT];
- // volume curve for non-media audio on ext media outputs (HDMI, Line, etc)
- static const VolumeCurvePoint sExtMediaSystemVolumeCurve[AudioPolicyManager::VOLCNT];
- // volume curve for media strategy on speakers
- static const VolumeCurvePoint sSpeakerMediaVolumeCurve[AudioPolicyManager::VOLCNT];
- static const VolumeCurvePoint sSpeakerMediaVolumeCurveDrc[AudioPolicyManager::VOLCNT];
- // volume curve for sonification strategy on speakers
- static const VolumeCurvePoint sSpeakerSonificationVolumeCurve[AudioPolicyManager::VOLCNT];
- static const VolumeCurvePoint sSpeakerSonificationVolumeCurveDrc[AudioPolicyManager::VOLCNT];
- static const VolumeCurvePoint sDefaultSystemVolumeCurve[AudioPolicyManager::VOLCNT];
- static const VolumeCurvePoint sDefaultSystemVolumeCurveDrc[AudioPolicyManager::VOLCNT];
- static const VolumeCurvePoint sHeadsetSystemVolumeCurve[AudioPolicyManager::VOLCNT];
- static const VolumeCurvePoint sDefaultVoiceVolumeCurve[AudioPolicyManager::VOLCNT];
- static const VolumeCurvePoint sSpeakerVoiceVolumeCurve[AudioPolicyManager::VOLCNT];
- static const VolumeCurvePoint sLinearVolumeCurve[AudioPolicyManager::VOLCNT];
- static const VolumeCurvePoint sSilentVolumeCurve[AudioPolicyManager::VOLCNT];
- static const VolumeCurvePoint sFullScaleVolumeCurve[AudioPolicyManager::VOLCNT];
- // default volume curves per stream and device category. See initializeVolumeCurves()
- static const VolumeCurvePoint *sVolumeProfiles[AUDIO_STREAM_CNT][DEVICE_CATEGORY_CNT];
-
- // descriptor for audio outputs. Used to maintain current configuration of each opened audio output
- // and keep track of the usage of this output by each audio stream type.
- class AudioOutputDescriptor: public AudioPortConfig
- {
- public:
- AudioOutputDescriptor(const sp<IOProfile>& profile);
-
- status_t dump(int fd);
-
- audio_devices_t device() const;
- void changeRefCount(audio_stream_type_t stream, int delta);
-
- bool isDuplicated() const { return (mOutput1 != NULL && mOutput2 != NULL); }
- audio_devices_t supportedDevices();
- uint32_t latency();
- bool sharesHwModuleWith(const sp<AudioOutputDescriptor> outputDesc);
- bool isActive(uint32_t inPastMs = 0) const;
- bool isStreamActive(audio_stream_type_t stream,
- uint32_t inPastMs = 0,
- nsecs_t sysTime = 0) const;
- bool isStrategyActive(routing_strategy strategy,
- uint32_t inPastMs = 0,
- nsecs_t sysTime = 0) const;
-
- virtual void toAudioPortConfig(struct audio_port_config *dstConfig,
- const struct audio_port_config *srcConfig = NULL) const;
- virtual sp<AudioPort> getAudioPort() const { return mProfile; }
- void toAudioPort(struct audio_port *port) const;
-
- audio_port_handle_t mId;
- audio_io_handle_t mIoHandle; // output handle
- uint32_t mLatency; //
- audio_output_flags_t mFlags; //
- audio_devices_t mDevice; // current device this output is routed to
- AudioMix *mPolicyMix; // non NULL when used by a dynamic policy
- audio_patch_handle_t mPatchHandle;
- uint32_t mRefCount[AUDIO_STREAM_CNT]; // number of streams of each type using this output
- nsecs_t mStopTime[AUDIO_STREAM_CNT];
- sp<AudioOutputDescriptor> mOutput1; // used by duplicated outputs: first output
- sp<AudioOutputDescriptor> mOutput2; // used by duplicated outputs: second output
- float mCurVolume[AUDIO_STREAM_CNT]; // current stream volume
- int mMuteCount[AUDIO_STREAM_CNT]; // mute request counter
- const sp<IOProfile> mProfile; // I/O profile this output derives from
- bool mStrategyMutedByDevice[NUM_STRATEGIES]; // strategies muted because of incompatible
- // device selection. See checkDeviceMuteStrategies()
- uint32_t mDirectOpenCount; // number of clients using this output (direct outputs only)
- };
-
- // descriptor for audio inputs. Used to maintain current configuration of each opened audio input
- // and keep track of the usage of this input.
- class AudioInputDescriptor: public AudioPortConfig
- {
- public:
- AudioInputDescriptor(const sp<IOProfile>& profile);
-
- status_t dump(int fd);
-
- audio_port_handle_t mId;
- audio_io_handle_t mIoHandle; // input handle
- audio_devices_t mDevice; // current device this input is routed to
- AudioMix *mPolicyMix; // non NULL when used by a dynamic policy
- audio_patch_handle_t mPatchHandle;
- uint32_t mRefCount; // number of AudioRecord clients using
- // this input
- uint32_t mOpenRefCount;
- audio_source_t mInputSource; // input source selected by application
- //(mediarecorder.h)
- const sp<IOProfile> mProfile; // I/O profile this output derives from
- SortedVector<audio_session_t> mSessions; // audio sessions attached to this input
- bool mIsSoundTrigger; // used by a soundtrigger capture
-
- virtual void toAudioPortConfig(struct audio_port_config *dstConfig,
- const struct audio_port_config *srcConfig = NULL) const;
- virtual sp<AudioPort> getAudioPort() const { return mProfile; }
- void toAudioPort(struct audio_port *port) const;
- };
-
- // stream descriptor used for volume control
- class StreamDescriptor
- {
- public:
- StreamDescriptor();
-
- int getVolumeIndex(audio_devices_t device);
- void dump(int fd);
-
- int mIndexMin; // min volume index
- int mIndexMax; // max volume index
- KeyedVector<audio_devices_t, int> mIndexCur; // current volume index per device
- bool mCanBeMuted; // true is the stream can be muted
-
- const VolumeCurvePoint *mVolumeCurve[DEVICE_CATEGORY_CNT];
- };
-
- // stream descriptor used for volume control
- class EffectDescriptor : public RefBase
- {
- public:
-
- status_t dump(int fd);
-
- int mIo; // io the effect is attached to
- routing_strategy mStrategy; // routing strategy the effect is associated to
- int mSession; // audio session the effect is on
- effect_descriptor_t mDesc; // effect descriptor
- bool mEnabled; // enabled state: CPU load being used or not
- };
-
- void addOutput(audio_io_handle_t output, sp<AudioOutputDescriptor> outputDesc);
- void addInput(audio_io_handle_t input, sp<AudioInputDescriptor> inputDesc);
-
- // return the strategy corresponding to a given stream type
- static routing_strategy getStrategy(audio_stream_type_t stream);
-
- // return appropriate device for streams handled by the specified strategy according to current
- // phone state, connected devices...
- // if fromCache is true, the device is returned from mDeviceForStrategy[],
- // otherwise it is determine by current state
- // (device connected,phone state, force use, a2dp output...)
- // This allows to:
- // 1 speed up process when the state is stable (when starting or stopping an output)
- // 2 access to either current device selection (fromCache == true) or
- // "future" device selection (fromCache == false) when called from a context
- // where conditions are changing (setDeviceConnectionState(), setPhoneState()...) AND
- // before updateDevicesAndOutputs() is called.
- virtual audio_devices_t getDeviceForStrategy(routing_strategy strategy,
- bool fromCache);
-
- // change the route of the specified output. Returns the number of ms we have slept to
- // allow new routing to take effect in certain cases.
- virtual uint32_t setOutputDevice(audio_io_handle_t output,
- audio_devices_t device,
- bool force = false,
- int delayMs = 0,
- audio_patch_handle_t *patchHandle = NULL,
- const char* address = NULL);
- status_t resetOutputDevice(audio_io_handle_t output,
- int delayMs = 0,
- audio_patch_handle_t *patchHandle = NULL);
- status_t setInputDevice(audio_io_handle_t input,
- audio_devices_t device,
- bool force = false,
- audio_patch_handle_t *patchHandle = NULL);
- status_t resetInputDevice(audio_io_handle_t input,
- audio_patch_handle_t *patchHandle = NULL);
-
- // select input device corresponding to requested audio source
- virtual audio_devices_t getDeviceForInputSource(audio_source_t inputSource);
-
- // return io handle of active input or 0 if no input is active
- // Only considers inputs from physical devices (e.g. main mic, headset mic) when
- // ignoreVirtualInputs is true.
- audio_io_handle_t getActiveInput(bool ignoreVirtualInputs = true);
-
- uint32_t activeInputsCount() const;
-
- // initialize volume curves for each strategy and device category
- void initializeVolumeCurves();
-
- // compute the actual volume for a given stream according to the requested index and a particular
- // device
- virtual float computeVolume(audio_stream_type_t stream, int index,
- audio_io_handle_t output, audio_devices_t device);
-
- // check that volume change is permitted, compute and send new volume to audio hardware
- virtual status_t checkAndSetVolume(audio_stream_type_t stream, int index,
- audio_io_handle_t output,
- audio_devices_t device,
- int delayMs = 0, bool force = false);
-
- // apply all stream volumes to the specified output and device
- void applyStreamVolumes(audio_io_handle_t output, audio_devices_t device, int delayMs = 0, bool force = false);
-
- // Mute or unmute all streams handled by the specified strategy on the specified output
- void setStrategyMute(routing_strategy strategy,
- bool on,
- audio_io_handle_t output,
- int delayMs = 0,
- audio_devices_t device = (audio_devices_t)0);
-
- // Mute or unmute the stream on the specified output
- void setStreamMute(audio_stream_type_t stream,
- bool on,
- audio_io_handle_t output,
- int delayMs = 0,
- audio_devices_t device = (audio_devices_t)0);
-
- // handle special cases for sonification strategy while in call: mute streams or replace by
- // a special tone in the device used for communication
- void handleIncallSonification(audio_stream_type_t stream, bool starting, bool stateChange);
-
- // true if device is in a telephony or VoIP call
- virtual bool isInCall();
-
- // true if given state represents a device in a telephony or VoIP call
- virtual bool isStateInCall(int state);
-
- // when a device is connected, checks if an open output can be routed
- // to this device. If none is open, tries to open one of the available outputs.
- // Returns an output suitable to this device or 0.
- // when a device is disconnected, checks if an output is not used any more and
- // returns its handle if any.
- // transfers the audio tracks and effects from one output thread to another accordingly.
- status_t checkOutputsForDevice(const sp<DeviceDescriptor> devDesc,
- audio_policy_dev_state_t state,
- SortedVector<audio_io_handle_t>& outputs,
- const String8 address);
-
- status_t checkInputsForDevice(audio_devices_t device,
- audio_policy_dev_state_t state,
- SortedVector<audio_io_handle_t>& inputs,
- const String8 address);
-
- // close an output and its companion duplicating output.
- void closeOutput(audio_io_handle_t output);
-
- // close an input.
- void closeInput(audio_io_handle_t input);
-
- // checks and if necessary changes outputs used for all strategies.
- // must be called every time a condition that affects the output choice for a given strategy
- // changes: connected device, phone state, force use...
- // Must be called before updateDevicesAndOutputs()
- void checkOutputForStrategy(routing_strategy strategy);
-
- // Same as checkOutputForStrategy() but for a all strategies in order of priority
- void checkOutputForAllStrategies();
-
- // manages A2DP output suspend/restore according to phone state and BT SCO usage
- void checkA2dpSuspend();
-
- // returns the A2DP output handle if it is open or 0 otherwise
- audio_io_handle_t getA2dpOutput();
-
- // selects the most appropriate device on output for current state
- // must be called every time a condition that affects the device choice for a given output is
- // changed: connected device, phone state, force use, output start, output stop..
- // see getDeviceForStrategy() for the use of fromCache parameter
- audio_devices_t getNewOutputDevice(audio_io_handle_t output, bool fromCache);
-
- // updates cache of device used by all strategies (mDeviceForStrategy[])
- // must be called every time a condition that affects the device choice for a given strategy is
- // changed: connected device, phone state, force use...
- // cached values are used by getDeviceForStrategy() if parameter fromCache is true.
- // Must be called after checkOutputForAllStrategies()
- void updateDevicesAndOutputs();
-
- // selects the most appropriate device on input for current state
- audio_devices_t getNewInputDevice(audio_io_handle_t input);
-
- virtual uint32_t getMaxEffectsCpuLoad();
- virtual uint32_t getMaxEffectsMemory();
-#ifdef AUDIO_POLICY_TEST
- virtual bool threadLoop();
- void exit();
- int testOutputIndex(audio_io_handle_t output);
-#endif //AUDIO_POLICY_TEST
-
- status_t setEffectEnabled(const sp<EffectDescriptor>& effectDesc, bool enabled);
-
- // returns the category the device belongs to with regard to volume curve management
- static device_category getDeviceCategory(audio_devices_t device);
-
- // extract one device relevant for volume control from multiple device selection
- static audio_devices_t getDeviceForVolume(audio_devices_t device);
-
- SortedVector<audio_io_handle_t> getOutputsForDevice(audio_devices_t device,
- DefaultKeyedVector<audio_io_handle_t, sp<AudioOutputDescriptor> > openOutputs);
- bool vectorsEqual(SortedVector<audio_io_handle_t>& outputs1,
- SortedVector<audio_io_handle_t>& outputs2);
-
- // mute/unmute strategies using an incompatible device combination
- // if muting, wait for the audio in pcm buffer to be drained before proceeding
- // if unmuting, unmute only after the specified delay
- // Returns the number of ms waited
- virtual uint32_t checkDeviceMuteStrategies(sp<AudioOutputDescriptor> outputDesc,
- audio_devices_t prevDevice,
- uint32_t delayMs);
-
- audio_io_handle_t selectOutput(const SortedVector<audio_io_handle_t>& outputs,
- audio_output_flags_t flags,
- audio_format_t format);
- // samplingRate parameter is an in/out and so may be modified
- sp<IOProfile> getInputProfile(audio_devices_t device,
- String8 address,
- uint32_t& samplingRate,
- audio_format_t format,
- audio_channel_mask_t channelMask,
- audio_input_flags_t flags);
- sp<IOProfile> getProfileForDirectOutput(audio_devices_t device,
- uint32_t samplingRate,
- audio_format_t format,
- audio_channel_mask_t channelMask,
- audio_output_flags_t flags);
-
- audio_io_handle_t selectOutputForEffects(const SortedVector<audio_io_handle_t>& outputs);
-
- bool isNonOffloadableEffectEnabled();
-
- virtual status_t addAudioPatch(audio_patch_handle_t handle,
- const sp<AudioPatch>& patch);
- virtual status_t removeAudioPatch(audio_patch_handle_t handle);
-
- sp<AudioOutputDescriptor> getOutputFromId(audio_port_handle_t id) const;
- sp<AudioInputDescriptor> getInputFromId(audio_port_handle_t id) const;
- sp<HwModule> getModuleForDevice(audio_devices_t device) const;
- sp<HwModule> getModuleFromName(const char *name) const;
- audio_devices_t availablePrimaryOutputDevices();
- audio_devices_t availablePrimaryInputDevices();
-
- void updateCallRouting(audio_devices_t rxDevice, int delayMs = 0);
-
- //
- // Audio policy configuration file parsing (audio_policy.conf)
- //
- static uint32_t stringToEnum(const struct StringToEnum *table,
- size_t size,
- const char *name);
- static const char *enumToString(const struct StringToEnum *table,
- size_t size,
- uint32_t value);
- static bool stringToBool(const char *value);
- static uint32_t parseOutputFlagNames(char *name);
- static uint32_t parseInputFlagNames(char *name);
- static audio_devices_t parseDeviceNames(char *name);
- void loadHwModule(cnode *root);
- void loadHwModules(cnode *root);
- void loadGlobalConfig(cnode *root, const sp<HwModule>& module);
- status_t loadAudioPolicyConfig(const char *path);
- void defaultAudioPolicyConfig(void);
-
-
- uid_t mUidCached;
- AudioPolicyClientInterface *mpClientInterface; // audio policy client interface
- audio_io_handle_t mPrimaryOutput; // primary output handle
- // list of descriptors for outputs currently opened
- DefaultKeyedVector<audio_io_handle_t, sp<AudioOutputDescriptor> > mOutputs;
- // copy of mOutputs before setDeviceConnectionState() opens new outputs
- // reset to mOutputs when updateDevicesAndOutputs() is called.
- DefaultKeyedVector<audio_io_handle_t, sp<AudioOutputDescriptor> > mPreviousOutputs;
- DefaultKeyedVector<audio_io_handle_t, sp<AudioInputDescriptor> > mInputs; // list of input descriptors
- DeviceVector mAvailableOutputDevices; // all available output devices
- DeviceVector mAvailableInputDevices; // all available input devices
- int mPhoneState; // current phone state
- audio_policy_forced_cfg_t mForceUse[AUDIO_POLICY_FORCE_USE_CNT]; // current forced use configuration
-
- StreamDescriptor mStreams[AUDIO_STREAM_CNT]; // stream descriptors for volume control
- bool mLimitRingtoneVolume; // limit ringtone volume to music volume if headset connected
- audio_devices_t mDeviceForStrategy[NUM_STRATEGIES];
- float mLastVoiceVolume; // last voice volume value sent to audio HAL
-
- // Maximum CPU load allocated to audio effects in 0.1 MIPS (ARMv5TE, 0 WS memory) units
- static const uint32_t MAX_EFFECTS_CPU_LOAD = 1000;
- // Maximum memory allocated to audio effects in KB
- static const uint32_t MAX_EFFECTS_MEMORY = 512;
- uint32_t mTotalEffectsCpuLoad; // current CPU load used by effects
- uint32_t mTotalEffectsMemory; // current memory used by effects
- KeyedVector<int, sp<EffectDescriptor> > mEffects; // list of registered audio effects
- bool mA2dpSuspended; // true if A2DP output is suspended
- sp<DeviceDescriptor> mDefaultOutputDevice; // output device selected by default at boot time
- bool mSpeakerDrcEnabled;// true on devices that use DRC on the DEVICE_CATEGORY_SPEAKER path
- // to boost soft sounds, used to adjust volume curves accordingly
-
- Vector < sp<HwModule> > mHwModules;
- volatile int32_t mNextUniqueId;
- volatile int32_t mAudioPortGeneration;
-
- DefaultKeyedVector<audio_patch_handle_t, sp<AudioPatch> > mAudioPatches;
-
- DefaultKeyedVector<audio_session_t, audio_io_handle_t> mSoundTriggerSessions;
-
- sp<AudioPatch> mCallTxPatch;
- sp<AudioPatch> mCallRxPatch;
-
- // for supporting "beacon" streams, i.e. streams that only play on speaker, and never
- // when something other than STREAM_TTS (a.k.a. "Transmitted Through Speaker") is playing
- enum {
- STARTING_OUTPUT,
- STARTING_BEACON,
- STOPPING_OUTPUT,
- STOPPING_BEACON
- };
- uint32_t mBeaconMuteRefCount; // ref count for stream that would mute beacon
- uint32_t mBeaconPlayingRefCount;// ref count for the playing beacon streams
- bool mBeaconMuted; // has STREAM_TTS been muted
-
- // custom mix entry in mPolicyMixes
- class AudioPolicyMix : public RefBase {
- public:
- AudioPolicyMix() {}
-
- AudioMix mMix; // Audio policy mix descriptor
- sp<AudioOutputDescriptor> mOutput; // Corresponding output stream
- };
- DefaultKeyedVector<String8, sp<AudioPolicyMix> > mPolicyMixes; // list of registered mixes
-
-
-#ifdef AUDIO_POLICY_TEST
- Mutex mLock;
- Condition mWaitWorkCV;
-
- int mCurOutput;
- bool mDirectOutput;
- audio_io_handle_t mTestOutputs[NUM_TEST_OUTPUTS];
- int mTestInput;
- uint32_t mTestDevice;
- uint32_t mTestSamplingRate;
- uint32_t mTestFormat;
- uint32_t mTestChannels;
- uint32_t mTestLatencyMs;
-#endif //AUDIO_POLICY_TEST
- static float volIndexToAmpl(audio_devices_t device, const StreamDescriptor& streamDesc,
- int indexInUi);
- static bool isVirtualInputDevice(audio_devices_t device);
- uint32_t nextUniqueId();
- uint32_t nextAudioPortGeneration();
-private:
- // updates device caching and output for streams that can influence the
- // routing of notifications
- void handleNotificationRoutingForStream(audio_stream_type_t stream);
- static bool deviceDistinguishesOnAddress(audio_devices_t device);
- // find the outputs on a given output descriptor that have the given address.
- // to be called on an AudioOutputDescriptor whose supported devices (as defined
- // in mProfile->mSupportedDevices) matches the device whose address is to be matched.
- // see deviceDistinguishesOnAddress(audio_devices_t) for whether the device type is one
- // where addresses are used to distinguish between one connected device and another.
- void findIoHandlesByAddress(sp<AudioOutputDescriptor> desc /*in*/,
- const audio_devices_t device /*in*/,
- const String8 address /*in*/,
- SortedVector<audio_io_handle_t>& outputs /*out*/);
- uint32_t curAudioPortGeneration() const { return mAudioPortGeneration; }
- // internal method to return the output handle for the given device and format
- audio_io_handle_t getOutputForDevice(
- audio_devices_t device,
- audio_session_t session,
- audio_stream_type_t stream,
- uint32_t samplingRate,
- audio_format_t format,
- audio_channel_mask_t channelMask,
- audio_output_flags_t flags,
- const audio_offload_info_t *offloadInfo);
- // internal function to derive a stream type value from audio attributes
- audio_stream_type_t streamTypefromAttributesInt(const audio_attributes_t *attr);
- // return true if any output is playing anything besides the stream to ignore
- bool isAnyOutputActive(audio_stream_type_t streamToIgnore);
- // event is one of STARTING_OUTPUT, STARTING_BEACON, STOPPING_OUTPUT, STOPPING_BEACON
- // returns 0 if no mute/unmute event happened, the largest latency of the device where
- // the mute/unmute happened
- uint32_t handleEventForBeacon(int event);
- uint32_t setBeaconMute(bool mute);
- bool isValidAttributes(const audio_attributes_t *paa);
-
- // select input device corresponding to requested audio source and return associated policy
- // mix if any. Calls getDeviceForInputSource().
- audio_devices_t getDeviceAndMixForInputSource(audio_source_t inputSource,
- AudioMix **policyMix = NULL);
-
- // Called by setDeviceConnectionState().
- status_t setDeviceConnectionStateInt(audio_devices_t device,
- audio_policy_dev_state_t state,
- const char *device_address);
- sp<DeviceDescriptor> getDeviceDescriptor(const audio_devices_t device,
- const char *device_address);
-
-};
-
-};
diff --git a/services/audiopolicy/common/Android.mk b/services/audiopolicy/common/Android.mk
new file mode 100644
index 0000000..dcce8e3
--- /dev/null
+++ b/services/audiopolicy/common/Android.mk
@@ -0,0 +1,9 @@
+
+LOCAL_PATH := $(call my-dir)
+include $(CLEAR_VARS)
+
+#######################################################################
+# Recursive call sub-folder Android.mk
+#
+include $(call all-makefiles-under,$(LOCAL_PATH))
+
diff --git a/services/audiopolicy/common/include/RoutingStrategy.h b/services/audiopolicy/common/include/RoutingStrategy.h
new file mode 100644
index 0000000..d38967e
--- /dev/null
+++ b/services/audiopolicy/common/include/RoutingStrategy.h
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+namespace android {
+
+// Time in milliseconds after media stopped playing during which we consider that the
+// sonification should be as unobtrusive as during the time media was playing.
+#define SONIFICATION_RESPECTFUL_AFTER_MUSIC_DELAY 5000
+
+enum routing_strategy {
+ STRATEGY_MEDIA,
+ STRATEGY_PHONE,
+ STRATEGY_SONIFICATION,
+ STRATEGY_SONIFICATION_RESPECTFUL,
+ STRATEGY_DTMF,
+ STRATEGY_ENFORCED_AUDIBLE,
+ STRATEGY_TRANSMITTED_THROUGH_SPEAKER,
+ STRATEGY_ACCESSIBILITY,
+ STRATEGY_REROUTING,
+ NUM_STRATEGIES
+};
+
+}; //namespace android
diff --git a/services/audiopolicy/common/include/Volume.h b/services/audiopolicy/common/include/Volume.h
new file mode 100755
index 0000000..712f7a7
--- /dev/null
+++ b/services/audiopolicy/common/include/Volume.h
@@ -0,0 +1,159 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <system/audio.h>
+#include <utils/Log.h>
+#include <math.h>
+
+// Absolute min volume in dB (can be represented in single precision normal float value)
+#define VOLUME_MIN_DB (-758)
+
+class VolumeCurvePoint
+{
+public:
+ int mIndex;
+ float mDBAttenuation;
+};
+
+class Volume
+{
+public:
+ /**
+ * 4 points to define the volume attenuation curve, each characterized by the volume
+ * index (from 0 to 100) at which they apply, and the attenuation in dB at that index.
+ * we use 100 steps to avoid rounding errors when computing the volume in volIndexToDb()
+ *
+ * @todo shall become configurable
+ */
+ enum {
+ VOLMIN = 0,
+ VOLKNEE1 = 1,
+ VOLKNEE2 = 2,
+ VOLMAX = 3,
+
+ VOLCNT = 4
+ };
+
+ /**
+ * device categories used for volume curve management.
+ */
+ enum device_category {
+ DEVICE_CATEGORY_HEADSET,
+ DEVICE_CATEGORY_SPEAKER,
+ DEVICE_CATEGORY_EARPIECE,
+ DEVICE_CATEGORY_EXT_MEDIA,
+ DEVICE_CATEGORY_CNT
+ };
+
+ /**
+ * extract one device relevant for volume control from multiple device selection
+ *
+ * @param[in] device for which the volume category is associated
+ *
+ * @return subset of device required to limit the number of volume category per device
+ */
+ static audio_devices_t getDeviceForVolume(audio_devices_t device)
+ {
+ if (device == AUDIO_DEVICE_NONE) {
+ // this happens when forcing a route update and no track is active on an output.
+ // In this case the returned category is not important.
+ device = AUDIO_DEVICE_OUT_SPEAKER;
+ } else if (popcount(device) > 1) {
+ // Multiple device selection is either:
+ // - speaker + one other device: give priority to speaker in this case.
+ // - one A2DP device + another device: happens with duplicated output. In this case
+ // retain the device on the A2DP output as the other must not correspond to an active
+ // selection if not the speaker.
+ // - HDMI-CEC system audio mode only output: give priority to available item in order.
+ if (device & AUDIO_DEVICE_OUT_SPEAKER) {
+ device = AUDIO_DEVICE_OUT_SPEAKER;
+ } else if (device & AUDIO_DEVICE_OUT_SPEAKER_SAFE) {
+ device = AUDIO_DEVICE_OUT_SPEAKER_SAFE;
+ } else if (device & AUDIO_DEVICE_OUT_HDMI_ARC) {
+ device = AUDIO_DEVICE_OUT_HDMI_ARC;
+ } else if (device & AUDIO_DEVICE_OUT_AUX_LINE) {
+ device = AUDIO_DEVICE_OUT_AUX_LINE;
+ } else if (device & AUDIO_DEVICE_OUT_SPDIF) {
+ device = AUDIO_DEVICE_OUT_SPDIF;
+ } else {
+ device = (audio_devices_t)(device & AUDIO_DEVICE_OUT_ALL_A2DP);
+ }
+ }
+
+ /*SPEAKER_SAFE is an alias of SPEAKER for purposes of volume control*/
+ if (device == AUDIO_DEVICE_OUT_SPEAKER_SAFE)
+ device = AUDIO_DEVICE_OUT_SPEAKER;
+
+ ALOGW_IF(popcount(device) != 1,
+ "getDeviceForVolume() invalid device combination: %08x",
+ device);
+
+ return device;
+ }
+
+ /**
+ * returns the category the device belongs to with regard to volume curve management
+ *
+ * @param[in] device to check upon the category to whom it belongs to.
+ *
+ * @return device category.
+ */
+ static device_category getDeviceCategory(audio_devices_t device)
+ {
+ switch(getDeviceForVolume(device)) {
+ case AUDIO_DEVICE_OUT_EARPIECE:
+ return DEVICE_CATEGORY_EARPIECE;
+ case AUDIO_DEVICE_OUT_WIRED_HEADSET:
+ case AUDIO_DEVICE_OUT_WIRED_HEADPHONE:
+ case AUDIO_DEVICE_OUT_BLUETOOTH_SCO:
+ case AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET:
+ case AUDIO_DEVICE_OUT_BLUETOOTH_A2DP:
+ case AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES:
+ return DEVICE_CATEGORY_HEADSET;
+ case AUDIO_DEVICE_OUT_LINE:
+ case AUDIO_DEVICE_OUT_AUX_DIGITAL:
+ /*USB? Remote submix?*/
+ return DEVICE_CATEGORY_EXT_MEDIA;
+ case AUDIO_DEVICE_OUT_SPEAKER:
+ case AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT:
+ case AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER:
+ case AUDIO_DEVICE_OUT_USB_ACCESSORY:
+ case AUDIO_DEVICE_OUT_USB_DEVICE:
+ case AUDIO_DEVICE_OUT_REMOTE_SUBMIX:
+ default:
+ return DEVICE_CATEGORY_SPEAKER;
+ }
+ }
+
+ static inline float DbToAmpl(float decibels)
+ {
+ if (decibels <= VOLUME_MIN_DB) {
+ return 0.0f;
+ }
+ return exp( decibels * 0.115129f); // exp( dB * ln(10) / 20 )
+ }
+
+ static inline float AmplToDb(float amplification)
+ {
+ if (amplification == 0) {
+ return VOLUME_MIN_DB;
+ }
+ return 20 * log10(amplification);
+ }
+
+};
diff --git a/services/audiopolicy/common/include/policy.h b/services/audiopolicy/common/include/policy.h
new file mode 100755
index 0000000..4b73e3c
--- /dev/null
+++ b/services/audiopolicy/common/include/policy.h
@@ -0,0 +1,88 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <system/audio.h>
+
+// For mixed output and inputs, the policy will use max mixer sampling rates.
+// Do not limit sampling rate otherwise
+#define MAX_MIXER_SAMPLING_RATE 192000
+
+// For mixed output and inputs, the policy will use max mixer channel count.
+// Do not limit channel count otherwise
+#define MAX_MIXER_CHANNEL_COUNT 8
+
+/**
+ * A device mask for all audio input devices that are considered "virtual" when evaluating
+ * active inputs in getActiveInput()
+ */
+#define APM_AUDIO_IN_DEVICE_VIRTUAL_ALL (AUDIO_DEVICE_IN_REMOTE_SUBMIX|AUDIO_DEVICE_IN_FM_TUNER)
+
+
+/**
+ * A device mask for all audio input and output devices where matching inputs/outputs on device
+ * type alone is not enough: the address must match too
+ */
+#define APM_AUDIO_DEVICE_OUT_MATCH_ADDRESS_ALL (AUDIO_DEVICE_OUT_REMOTE_SUBMIX)
+
+#define APM_AUDIO_DEVICE_IN_MATCH_ADDRESS_ALL (AUDIO_DEVICE_IN_REMOTE_SUBMIX)
+
+/**
+ * Check if the state given correspond to an in call state.
+ * @TODO find a better name for widely call state
+ *
+ * @param[in] state to consider
+ *
+ * @return true if given state represents a device in a telephony or VoIP call
+ */
+static inline bool is_state_in_call(int state)
+{
+ return (state == AUDIO_MODE_IN_CALL) || (state == AUDIO_MODE_IN_COMMUNICATION);
+}
+
+/**
+ * Check if the input device given is considered as a virtual device.
+ *
+ * @param[in] device to consider
+ *
+ * @return true if the device is a virtual one, false otherwise.
+ */
+static inline bool is_virtual_input_device(audio_devices_t device)
+{
+ if ((device & AUDIO_DEVICE_BIT_IN) != 0) {
+ device &= ~AUDIO_DEVICE_BIT_IN;
+ if ((popcount(device) == 1) && ((device & ~APM_AUDIO_IN_DEVICE_VIRTUAL_ALL) == 0))
+ return true;
+ }
+ return false;
+}
+
+/**
+ * Check whether the device type is one
+ * where addresses are used to distinguish between one connected device and another
+ *
+ * @param[in] device to consider
+ *
+ * @return true if the device needs distinguish on address, false otherwise..
+ */
+static inline bool device_distinguishes_on_address(audio_devices_t device)
+{
+ return (((device & AUDIO_DEVICE_BIT_IN) != 0) &&
+ ((~AUDIO_DEVICE_BIT_IN & device & APM_AUDIO_DEVICE_IN_MATCH_ADDRESS_ALL) != 0)) ||
+ (((device & AUDIO_DEVICE_BIT_IN) == 0) &&
+ ((device & APM_AUDIO_DEVICE_OUT_MATCH_ADDRESS_ALL) != 0));
+}
diff --git a/services/audiopolicy/common/managerdefinitions/Android.mk b/services/audiopolicy/common/managerdefinitions/Android.mk
new file mode 100644
index 0000000..8728ff3
--- /dev/null
+++ b/services/audiopolicy/common/managerdefinitions/Android.mk
@@ -0,0 +1,36 @@
+LOCAL_PATH:= $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES:= \
+ src/DeviceDescriptor.cpp \
+ src/AudioGain.cpp \
+ src/StreamDescriptor.cpp \
+ src/HwModule.cpp \
+ src/IOProfile.cpp \
+ src/AudioPort.cpp \
+ src/AudioPolicyMix.cpp \
+ src/AudioPatch.cpp \
+ src/AudioInputDescriptor.cpp \
+ src/AudioOutputDescriptor.cpp \
+ src/EffectDescriptor.cpp \
+ src/ConfigParsingUtils.cpp \
+ src/SoundTriggerSession.cpp \
+ src/SessionRoute.cpp \
+
+LOCAL_SHARED_LIBRARIES := \
+ libcutils \
+ libutils \
+ liblog \
+
+LOCAL_C_INCLUDES += \
+ $(LOCAL_PATH)/include \
+ $(TOPDIR)frameworks/av/services/audiopolicy/common/include \
+ $(TOPDIR)frameworks/av/services/audiopolicy
+
+LOCAL_EXPORT_C_INCLUDE_DIRS := \
+ $(LOCAL_PATH)/include
+
+LOCAL_MODULE := libaudiopolicycomponents
+
+include $(BUILD_STATIC_LIBRARY)
diff --git a/services/audiopolicy/common/managerdefinitions/include/AudioGain.h b/services/audiopolicy/common/managerdefinitions/include/AudioGain.h
new file mode 100644
index 0000000..21fbf9b
--- /dev/null
+++ b/services/audiopolicy/common/managerdefinitions/include/AudioGain.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <utils/Errors.h>
+#include <utils/RefBase.h>
+#include <system/audio.h>
+
+namespace android {
+
+class AudioGain: public RefBase
+{
+public:
+ AudioGain(int index, bool useInChannelMask);
+ virtual ~AudioGain() {}
+
+ void dump(int fd, int spaces, int index) const;
+
+ void getDefaultConfig(struct audio_gain_config *config);
+ status_t checkConfig(const struct audio_gain_config *config);
+ int mIndex;
+ struct audio_gain mGain;
+ bool mUseInChannelMask;
+};
+
+}; // namespace android
diff --git a/services/audiopolicy/common/managerdefinitions/include/AudioInputDescriptor.h b/services/audiopolicy/common/managerdefinitions/include/AudioInputDescriptor.h
new file mode 100644
index 0000000..18bcfdb
--- /dev/null
+++ b/services/audiopolicy/common/managerdefinitions/include/AudioInputDescriptor.h
@@ -0,0 +1,87 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include "AudioPort.h"
+#include <utils/Errors.h>
+#include <system/audio.h>
+#include <utils/SortedVector.h>
+#include <utils/KeyedVector.h>
+
+namespace android {
+
+class IOProfile;
+class AudioMix;
+
+// descriptor for audio inputs. Used to maintain current configuration of each opened audio input
+// and keep track of the usage of this input.
+class AudioInputDescriptor: public AudioPortConfig
+{
+public:
+ AudioInputDescriptor(const sp<IOProfile>& profile);
+ void setIoHandle(audio_io_handle_t ioHandle);
+ audio_port_handle_t getId() const;
+ audio_module_handle_t getModuleHandle() const;
+
+ status_t dump(int fd);
+
+ audio_io_handle_t mIoHandle; // input handle
+ audio_devices_t mDevice; // current device this input is routed to
+ AudioMix *mPolicyMix; // non NULL when used by a dynamic policy
+ audio_patch_handle_t mPatchHandle;
+ uint32_t mRefCount; // number of AudioRecord clients using
+ // this input
+ uint32_t mOpenRefCount;
+ audio_source_t mInputSource; // input source selected by application
+ //(mediarecorder.h)
+ const sp<IOProfile> mProfile; // I/O profile this output derives from
+ SortedVector<audio_session_t> mSessions; // audio sessions attached to this input
+ bool mIsSoundTrigger; // used by a soundtrigger capture
+
+ virtual void toAudioPortConfig(struct audio_port_config *dstConfig,
+ const struct audio_port_config *srcConfig = NULL) const;
+ virtual sp<AudioPort> getAudioPort() const { return mProfile; }
+ void toAudioPort(struct audio_port *port) const;
+
+private:
+ audio_port_handle_t mId;
+};
+
+class AudioInputCollection :
+ public DefaultKeyedVector< audio_io_handle_t, sp<AudioInputDescriptor> >
+{
+public:
+ bool isSourceActive(audio_source_t source) const;
+
+ sp<AudioInputDescriptor> getInputFromId(audio_port_handle_t id) const;
+
+ uint32_t activeInputsCount() const;
+
+ /**
+ * return io handle of active input or 0 if no input is active
+ * Only considers inputs from physical devices (e.g. main mic, headset mic) when
+ * ignoreVirtualInputs is true.
+ */
+ audio_io_handle_t getActiveInput(bool ignoreVirtualInputs = true);
+
+ audio_devices_t getSupportedDevices(audio_io_handle_t handle) const;
+
+ status_t dump(int fd) const;
+};
+
+
+}; // namespace android
diff --git a/services/audiopolicy/common/managerdefinitions/include/AudioOutputDescriptor.h b/services/audiopolicy/common/managerdefinitions/include/AudioOutputDescriptor.h
new file mode 100644
index 0000000..50f622d
--- /dev/null
+++ b/services/audiopolicy/common/managerdefinitions/include/AudioOutputDescriptor.h
@@ -0,0 +1,163 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include "AudioPort.h"
+#include <RoutingStrategy.h>
+#include <utils/Errors.h>
+#include <utils/Timers.h>
+#include <utils/KeyedVector.h>
+#include <system/audio.h>
+
+namespace android {
+
+class IOProfile;
+class AudioMix;
+class AudioPolicyClientInterface;
+
+// descriptor for audio outputs. Used to maintain current configuration of each opened audio output
+// and keep track of the usage of this output by each audio stream type.
+class AudioOutputDescriptor: public AudioPortConfig
+{
+public:
+ AudioOutputDescriptor(const sp<AudioPort>& port,
+ AudioPolicyClientInterface *clientInterface);
+ virtual ~AudioOutputDescriptor() {}
+
+ status_t dump(int fd);
+ void log(const char* indent);
+
+ audio_port_handle_t getId() const;
+ virtual audio_devices_t device() const;
+ virtual bool sharesHwModuleWith(const sp<AudioOutputDescriptor> outputDesc);
+ virtual audio_devices_t supportedDevices();
+ virtual bool isDuplicated() const { return false; }
+ virtual uint32_t latency() { return 0; }
+ virtual bool isFixedVolume(audio_devices_t device);
+ virtual sp<AudioOutputDescriptor> subOutput1() { return 0; }
+ virtual sp<AudioOutputDescriptor> subOutput2() { return 0; }
+ virtual bool setVolume(float volume,
+ audio_stream_type_t stream,
+ audio_devices_t device,
+ uint32_t delayMs,
+ bool force);
+ virtual void changeRefCount(audio_stream_type_t stream, int delta);
+
+ bool isActive(uint32_t inPastMs = 0) const;
+ bool isStreamActive(audio_stream_type_t stream,
+ uint32_t inPastMs = 0,
+ nsecs_t sysTime = 0) const;
+
+ virtual void toAudioPortConfig(struct audio_port_config *dstConfig,
+ const struct audio_port_config *srcConfig = NULL) const;
+ virtual sp<AudioPort> getAudioPort() const { return mPort; }
+ virtual void toAudioPort(struct audio_port *port) const;
+
+ audio_module_handle_t getModuleHandle() const;
+
+ sp<AudioPort> mPort;
+ audio_devices_t mDevice; // current device this output is routed to
+ audio_patch_handle_t mPatchHandle;
+ uint32_t mRefCount[AUDIO_STREAM_CNT]; // number of streams of each type using this output
+ nsecs_t mStopTime[AUDIO_STREAM_CNT];
+ float mCurVolume[AUDIO_STREAM_CNT]; // current stream volume in dB
+ int mMuteCount[AUDIO_STREAM_CNT]; // mute request counter
+ bool mStrategyMutedByDevice[NUM_STRATEGIES]; // strategies muted because of incompatible
+ // device selection. See checkDeviceMuteStrategies()
+ AudioPolicyClientInterface *mClientInterface;
+
+protected:
+ audio_port_handle_t mId;
+};
+
+// Audio output driven by a software mixer in audio flinger.
+class SwAudioOutputDescriptor: public AudioOutputDescriptor
+{
+public:
+ SwAudioOutputDescriptor(const sp<IOProfile>& profile,
+ AudioPolicyClientInterface *clientInterface);
+ virtual ~SwAudioOutputDescriptor() {}
+
+ status_t dump(int fd);
+
+ void setIoHandle(audio_io_handle_t ioHandle);
+
+ virtual audio_devices_t device() const;
+ virtual bool sharesHwModuleWith(const sp<AudioOutputDescriptor> outputDesc);
+ virtual audio_devices_t supportedDevices();
+ virtual uint32_t latency();
+ virtual bool isDuplicated() const { return (mOutput1 != NULL && mOutput2 != NULL); }
+ virtual bool isFixedVolume(audio_devices_t device);
+ virtual sp<AudioOutputDescriptor> subOutput1() { return mOutput1; }
+ virtual sp<AudioOutputDescriptor> subOutput2() { return mOutput2; }
+ virtual void changeRefCount(audio_stream_type_t stream, int delta);
+ virtual bool setVolume(float volume,
+ audio_stream_type_t stream,
+ audio_devices_t device,
+ uint32_t delayMs,
+ bool force);
+
+ virtual void toAudioPortConfig(struct audio_port_config *dstConfig,
+ const struct audio_port_config *srcConfig = NULL) const;
+ virtual void toAudioPort(struct audio_port *port) const;
+
+ const sp<IOProfile> mProfile; // I/O profile this output derives from
+ audio_io_handle_t mIoHandle; // output handle
+ uint32_t mLatency; //
+ audio_output_flags_t mFlags; //
+ AudioMix *mPolicyMix; // non NULL when used by a dynamic policy
+ sp<SwAudioOutputDescriptor> mOutput1; // used by duplicated outputs: first output
+ sp<SwAudioOutputDescriptor> mOutput2; // used by duplicated outputs: second output
+ uint32_t mDirectOpenCount; // number of clients using this output (direct outputs only)
+ uint32_t mGlobalRefCount; // non-stream-specific ref count
+};
+
+class SwAudioOutputCollection :
+ public DefaultKeyedVector< audio_io_handle_t, sp<SwAudioOutputDescriptor> >
+{
+public:
+ bool isStreamActive(audio_stream_type_t stream, uint32_t inPastMs = 0) const;
+
+ /**
+ * return whether a stream is playing remotely, override to change the definition of
+ * local/remote playback, used for instance by notification manager to not make
+ * media players lose audio focus when not playing locally
+ * For the base implementation, "remotely" means playing during screen mirroring which
+ * uses an output for playback with a non-empty, non "0" address.
+ */
+ bool isStreamActiveRemotely(audio_stream_type_t stream, uint32_t inPastMs = 0) const;
+
+ /**
+ * returns the A2DP output handle if it is open or 0 otherwise
+ */
+ audio_io_handle_t getA2dpOutput() const;
+
+ sp<SwAudioOutputDescriptor> getOutputFromId(audio_port_handle_t id) const;
+
+ sp<SwAudioOutputDescriptor> getPrimaryOutput() const;
+
+ /**
+ * return true if any output is playing anything besides the stream to ignore
+ */
+ bool isAnyOutputActive(audio_stream_type_t streamToIgnore) const;
+
+ audio_devices_t getSupportedDevices(audio_io_handle_t handle) const;
+
+ status_t dump(int fd) const;
+};
+
+}; // namespace android
diff --git a/services/audiopolicy/common/managerdefinitions/include/AudioPatch.h b/services/audiopolicy/common/managerdefinitions/include/AudioPatch.h
new file mode 100644
index 0000000..385f257
--- /dev/null
+++ b/services/audiopolicy/common/managerdefinitions/include/AudioPatch.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <system/audio.h>
+#include <utils/Errors.h>
+#include <utils/RefBase.h>
+#include <utils/Errors.h>
+#include <utils/KeyedVector.h>
+
+namespace android {
+
+class AudioPatch : public RefBase
+{
+public:
+ AudioPatch(const struct audio_patch *patch, uid_t uid);
+
+ status_t dump(int fd, int spaces, int index) const;
+
+ audio_patch_handle_t mHandle;
+ struct audio_patch mPatch;
+ uid_t mUid;
+ audio_patch_handle_t mAfPatchHandle;
+
+private:
+ static volatile int32_t mNextUniqueId;
+};
+
+class AudioPatchCollection : public DefaultKeyedVector<audio_patch_handle_t, sp<AudioPatch> >
+{
+public:
+ status_t addAudioPatch(audio_patch_handle_t handle, const sp<AudioPatch>& patch);
+
+ status_t removeAudioPatch(audio_patch_handle_t handle);
+
+ status_t listAudioPatches(unsigned int *num_patches, struct audio_patch *patches) const;
+
+ status_t dump(int fd) const;
+};
+
+}; // namespace android
diff --git a/services/audiopolicy/common/managerdefinitions/include/AudioPolicyMix.h b/services/audiopolicy/common/managerdefinitions/include/AudioPolicyMix.h
new file mode 100644
index 0000000..d51f4e1
--- /dev/null
+++ b/services/audiopolicy/common/managerdefinitions/include/AudioPolicyMix.h
@@ -0,0 +1,81 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <utils/RefBase.h>
+#include <media/AudioPolicy.h>
+#include <utils/KeyedVector.h>
+#include <hardware/audio.h>
+#include <utils/String8.h>
+
+namespace android {
+
+class SwAudioOutputDescriptor;
+
+/**
+ * custom mix entry in mPolicyMixes
+ */
+class AudioPolicyMix : public RefBase {
+public:
+ AudioPolicyMix() {}
+
+ const sp<SwAudioOutputDescriptor> &getOutput() const;
+
+ void setOutput(sp<SwAudioOutputDescriptor> &output);
+
+ void clearOutput();
+
+ android::AudioMix *getMix();
+
+ void setMix(AudioMix &mix);
+
+private:
+ AudioMix mMix; // Audio policy mix descriptor
+ sp<SwAudioOutputDescriptor> mOutput; // Corresponding output stream
+};
+
+
+class AudioPolicyMixCollection : public DefaultKeyedVector<String8, sp<AudioPolicyMix> >
+{
+public:
+ status_t getAudioPolicyMix(String8 address, sp<AudioPolicyMix> &policyMix) const;
+
+ status_t registerMix(String8 address, AudioMix mix);
+
+ status_t unregisterMix(String8 address);
+
+ void closeOutput(sp<SwAudioOutputDescriptor> &desc);
+
+ /**
+ * Try to find an output descriptor for the given attributes.
+ *
+ * @param[in] attributes to consider fowr the research of output descriptor.
+ * @param[out] desc to return if an output could be found.
+ *
+ * @return NO_ERROR if an output was found for the given attribute (in this case, the
+ * descriptor output param is initialized), error code otherwise.
+ */
+ status_t getOutputForAttr(audio_attributes_t attributes, sp<SwAudioOutputDescriptor> &desc);
+
+ audio_devices_t getDeviceAndMixForInputSource(audio_source_t inputSource,
+ audio_devices_t availableDeviceTypes,
+ AudioMix **policyMix);
+
+ status_t getInputMixForAttr(audio_attributes_t attr, AudioMix **policyMix);
+};
+
+}; // namespace android
diff --git a/services/audiopolicy/common/managerdefinitions/include/AudioPort.h b/services/audiopolicy/common/managerdefinitions/include/AudioPort.h
new file mode 100644
index 0000000..4fdf5b4
--- /dev/null
+++ b/services/audiopolicy/common/managerdefinitions/include/AudioPort.h
@@ -0,0 +1,126 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <utils/String8.h>
+#include <utils/Vector.h>
+#include <utils/RefBase.h>
+#include <utils/Errors.h>
+#include <system/audio.h>
+#include <cutils/config_utils.h>
+
+namespace android {
+
+class HwModule;
+class AudioGain;
+
+class AudioPort : public virtual RefBase
+{
+public:
+ AudioPort(const String8& name, audio_port_type_t type,
+ audio_port_role_t role);
+ virtual ~AudioPort() {}
+
+ virtual void attach(const sp<HwModule>& module);
+ bool isAttached() { return mModule != 0; }
+
+ static audio_port_handle_t getNextUniqueId();
+
+ virtual void toAudioPort(struct audio_port *port) const;
+
+ virtual void importAudioPort(const sp<AudioPort> port);
+ void clearCapabilities();
+
+ void loadSamplingRates(char *name);
+ void loadFormats(char *name);
+ void loadOutChannels(char *name);
+ void loadInChannels(char *name);
+
+ audio_gain_mode_t loadGainMode(char *name);
+ void loadGain(cnode *root, int index);
+ virtual void loadGains(cnode *root);
+
+ // searches for an exact match
+ status_t checkExactSamplingRate(uint32_t samplingRate) const;
+ // searches for a compatible match, and returns the best match via updatedSamplingRate
+ status_t checkCompatibleSamplingRate(uint32_t samplingRate,
+ uint32_t *updatedSamplingRate) const;
+ // searches for an exact match
+ status_t checkExactChannelMask(audio_channel_mask_t channelMask) const;
+ // searches for a compatible match, currently implemented for input channel masks only
+ status_t checkCompatibleChannelMask(audio_channel_mask_t channelMask,
+ audio_channel_mask_t *updatedChannelMask) const;
+
+ status_t checkExactFormat(audio_format_t format) const;
+ // searches for a compatible match, currently implemented for input formats only
+ status_t checkCompatibleFormat(audio_format_t format, audio_format_t *updatedFormat) const;
+ status_t checkGain(const struct audio_gain_config *gainConfig, int index) const;
+
+ uint32_t pickSamplingRate() const;
+ audio_channel_mask_t pickChannelMask() const;
+ audio_format_t pickFormat() const;
+
+ static const audio_format_t sPcmFormatCompareTable[];
+ static int compareFormats(const audio_format_t *format1, const audio_format_t *format2) {
+ return compareFormats(*format1, *format2);
+ }
+ static int compareFormats(audio_format_t format1, audio_format_t format2);
+
+ audio_module_handle_t getModuleHandle() const;
+ uint32_t getModuleVersion() const;
+ const char *getModuleName() const;
+
+ void dump(int fd, int spaces) const;
+ void log(const char* indent) const;
+
+ String8 mName;
+ audio_port_type_t mType;
+ audio_port_role_t mRole;
+ bool mUseInChannelMask;
+ // by convention, "0' in the first entry in mSamplingRates, mChannelMasks or mFormats
+ // indicates the supported parameters should be read from the output stream
+ // after it is opened for the first time
+ Vector <uint32_t> mSamplingRates; // supported sampling rates
+ Vector <audio_channel_mask_t> mChannelMasks; // supported channel masks
+ Vector <audio_format_t> mFormats; // supported audio formats
+ Vector < sp<AudioGain> > mGains; // gain controllers
+ sp<HwModule> mModule; // audio HW module exposing this I/O stream
+ uint32_t mFlags; // attribute flags (e.g primary output,
+ // direct output...).
+
+private:
+ static volatile int32_t mNextUniqueId;
+};
+
+class AudioPortConfig : public virtual RefBase
+{
+public:
+ AudioPortConfig();
+ virtual ~AudioPortConfig() {}
+
+ status_t applyAudioPortConfig(const struct audio_port_config *config,
+ struct audio_port_config *backupConfig = NULL);
+ virtual void toAudioPortConfig(struct audio_port_config *dstConfig,
+ const struct audio_port_config *srcConfig = NULL) const = 0;
+ virtual sp<AudioPort> getAudioPort() const = 0;
+ uint32_t mSamplingRate;
+ audio_format_t mFormat;
+ audio_channel_mask_t mChannelMask;
+ struct audio_gain_config mGain;
+};
+
+}; // namespace android
diff --git a/services/audiopolicy/common/managerdefinitions/include/ConfigParsingUtils.h b/services/audiopolicy/common/managerdefinitions/include/ConfigParsingUtils.h
new file mode 100644
index 0000000..78d2cdf
--- /dev/null
+++ b/services/audiopolicy/common/managerdefinitions/include/ConfigParsingUtils.h
@@ -0,0 +1,275 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include "DeviceDescriptor.h"
+#include "HwModule.h"
+#include "audio_policy_conf.h"
+#include <system/audio.h>
+#include <utils/Log.h>
+#include <utils/Vector.h>
+#include <utils/SortedVector.h>
+#include <cutils/config_utils.h>
+#include <utils/RefBase.h>
+#include <system/audio_policy.h>
+
+namespace android {
+
+// ----------------------------------------------------------------------------
+// Definitions for audio_policy.conf file parsing
+// ----------------------------------------------------------------------------
+
+struct StringToEnum {
+ const char *name;
+ uint32_t value;
+};
+
+// TODO: move to a separate file. Should be in sync with audio.h.
+#define STRING_TO_ENUM(string) { #string, (uint32_t)string } // uint32_t cast removes warning
+#define NAME_TO_ENUM(name, value) { name, value }
+#ifndef ARRAY_SIZE
+#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
+#endif
+
+const StringToEnum sDeviceTypeToEnumTable[] = {
+ STRING_TO_ENUM(AUDIO_DEVICE_OUT_EARPIECE),
+ STRING_TO_ENUM(AUDIO_DEVICE_OUT_SPEAKER),
+ STRING_TO_ENUM(AUDIO_DEVICE_OUT_SPEAKER_SAFE),
+ STRING_TO_ENUM(AUDIO_DEVICE_OUT_WIRED_HEADSET),
+ STRING_TO_ENUM(AUDIO_DEVICE_OUT_WIRED_HEADPHONE),
+ STRING_TO_ENUM(AUDIO_DEVICE_OUT_BLUETOOTH_SCO),
+ STRING_TO_ENUM(AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET),
+ STRING_TO_ENUM(AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT),
+ STRING_TO_ENUM(AUDIO_DEVICE_OUT_ALL_SCO),
+ STRING_TO_ENUM(AUDIO_DEVICE_OUT_BLUETOOTH_A2DP),
+ STRING_TO_ENUM(AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES),
+ STRING_TO_ENUM(AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER),
+ STRING_TO_ENUM(AUDIO_DEVICE_OUT_ALL_A2DP),
+ STRING_TO_ENUM(AUDIO_DEVICE_OUT_AUX_DIGITAL),
+ STRING_TO_ENUM(AUDIO_DEVICE_OUT_HDMI),
+ STRING_TO_ENUM(AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET),
+ STRING_TO_ENUM(AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET),
+ STRING_TO_ENUM(AUDIO_DEVICE_OUT_USB_ACCESSORY),
+ STRING_TO_ENUM(AUDIO_DEVICE_OUT_USB_DEVICE),
+ STRING_TO_ENUM(AUDIO_DEVICE_OUT_ALL_USB),
+ STRING_TO_ENUM(AUDIO_DEVICE_OUT_REMOTE_SUBMIX),
+ STRING_TO_ENUM(AUDIO_DEVICE_OUT_TELEPHONY_TX),
+ STRING_TO_ENUM(AUDIO_DEVICE_OUT_LINE),
+ STRING_TO_ENUM(AUDIO_DEVICE_OUT_HDMI_ARC),
+ STRING_TO_ENUM(AUDIO_DEVICE_OUT_SPDIF),
+ STRING_TO_ENUM(AUDIO_DEVICE_OUT_FM),
+ STRING_TO_ENUM(AUDIO_DEVICE_OUT_AUX_LINE),
+ STRING_TO_ENUM(AUDIO_DEVICE_OUT_IP),
+ STRING_TO_ENUM(AUDIO_DEVICE_IN_AMBIENT),
+ STRING_TO_ENUM(AUDIO_DEVICE_IN_BUILTIN_MIC),
+ STRING_TO_ENUM(AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET),
+ STRING_TO_ENUM(AUDIO_DEVICE_IN_ALL_SCO),
+ STRING_TO_ENUM(AUDIO_DEVICE_IN_WIRED_HEADSET),
+ STRING_TO_ENUM(AUDIO_DEVICE_IN_AUX_DIGITAL),
+ STRING_TO_ENUM(AUDIO_DEVICE_IN_HDMI),
+ STRING_TO_ENUM(AUDIO_DEVICE_IN_TELEPHONY_RX),
+ STRING_TO_ENUM(AUDIO_DEVICE_IN_VOICE_CALL),
+ STRING_TO_ENUM(AUDIO_DEVICE_IN_BACK_MIC),
+ STRING_TO_ENUM(AUDIO_DEVICE_IN_REMOTE_SUBMIX),
+ STRING_TO_ENUM(AUDIO_DEVICE_IN_ANLG_DOCK_HEADSET),
+ STRING_TO_ENUM(AUDIO_DEVICE_IN_DGTL_DOCK_HEADSET),
+ STRING_TO_ENUM(AUDIO_DEVICE_IN_USB_ACCESSORY),
+ STRING_TO_ENUM(AUDIO_DEVICE_IN_USB_DEVICE),
+ STRING_TO_ENUM(AUDIO_DEVICE_IN_FM_TUNER),
+ STRING_TO_ENUM(AUDIO_DEVICE_IN_TV_TUNER),
+ STRING_TO_ENUM(AUDIO_DEVICE_IN_LINE),
+ STRING_TO_ENUM(AUDIO_DEVICE_IN_SPDIF),
+ STRING_TO_ENUM(AUDIO_DEVICE_IN_BLUETOOTH_A2DP),
+ STRING_TO_ENUM(AUDIO_DEVICE_IN_LOOPBACK),
+ STRING_TO_ENUM(AUDIO_DEVICE_IN_IP),
+};
+
+const StringToEnum sDeviceNameToEnumTable[] = {
+ NAME_TO_ENUM("Earpiece", AUDIO_DEVICE_OUT_EARPIECE),
+ NAME_TO_ENUM("Speaker", AUDIO_DEVICE_OUT_SPEAKER),
+ NAME_TO_ENUM("Speaker Protected", AUDIO_DEVICE_OUT_SPEAKER_SAFE),
+ NAME_TO_ENUM("Wired Headset", AUDIO_DEVICE_OUT_WIRED_HEADSET),
+ NAME_TO_ENUM("Wired Headphones", AUDIO_DEVICE_OUT_WIRED_HEADPHONE),
+ NAME_TO_ENUM("BT SCO", AUDIO_DEVICE_OUT_BLUETOOTH_SCO),
+ NAME_TO_ENUM("BT SCO Headset", AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET),
+ NAME_TO_ENUM("BT SCO Car Kit", AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT),
+ NAME_TO_ENUM("", AUDIO_DEVICE_OUT_ALL_SCO),
+ NAME_TO_ENUM("BT A2DP Out", AUDIO_DEVICE_OUT_BLUETOOTH_A2DP),
+ NAME_TO_ENUM("BT A2DP Headphones", AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES),
+ NAME_TO_ENUM("BT A2DP Speaker", AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER),
+ NAME_TO_ENUM("", AUDIO_DEVICE_OUT_ALL_A2DP),
+ NAME_TO_ENUM("HDMI Out", AUDIO_DEVICE_OUT_AUX_DIGITAL),
+ NAME_TO_ENUM("HDMI Out", AUDIO_DEVICE_OUT_HDMI),
+ NAME_TO_ENUM("Analog Dock Out", AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET),
+ NAME_TO_ENUM("Digital Dock Out", AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET),
+ NAME_TO_ENUM("USB Host Out", AUDIO_DEVICE_OUT_USB_ACCESSORY),
+ NAME_TO_ENUM("USB Device Out", AUDIO_DEVICE_OUT_USB_DEVICE),
+ NAME_TO_ENUM("", AUDIO_DEVICE_OUT_ALL_USB),
+ NAME_TO_ENUM("Reroute Submix Out", AUDIO_DEVICE_OUT_REMOTE_SUBMIX),
+ NAME_TO_ENUM("Telephony Tx", AUDIO_DEVICE_OUT_TELEPHONY_TX),
+ NAME_TO_ENUM("Line Out", AUDIO_DEVICE_OUT_LINE),
+ NAME_TO_ENUM("HDMI ARC Out", AUDIO_DEVICE_OUT_HDMI_ARC),
+ NAME_TO_ENUM("S/PDIF Out", AUDIO_DEVICE_OUT_SPDIF),
+ NAME_TO_ENUM("FM transceiver Out", AUDIO_DEVICE_OUT_FM),
+ NAME_TO_ENUM("Aux Line Out", AUDIO_DEVICE_OUT_AUX_LINE),
+ NAME_TO_ENUM("IP Out", AUDIO_DEVICE_OUT_IP),
+ NAME_TO_ENUM("Ambient Mic", AUDIO_DEVICE_IN_AMBIENT),
+ NAME_TO_ENUM("Built-In Mic", AUDIO_DEVICE_IN_BUILTIN_MIC),
+ NAME_TO_ENUM("BT SCO Headset Mic", AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET),
+ NAME_TO_ENUM("", AUDIO_DEVICE_IN_ALL_SCO),
+ NAME_TO_ENUM("Wired Headset Mic", AUDIO_DEVICE_IN_WIRED_HEADSET),
+ NAME_TO_ENUM("HDMI In", AUDIO_DEVICE_IN_AUX_DIGITAL),
+ NAME_TO_ENUM("HDMI In", AUDIO_DEVICE_IN_HDMI),
+ NAME_TO_ENUM("Telephony Rx", AUDIO_DEVICE_IN_TELEPHONY_RX),
+ NAME_TO_ENUM("Telephony Rx", AUDIO_DEVICE_IN_VOICE_CALL),
+ NAME_TO_ENUM("Built-In Back Mic", AUDIO_DEVICE_IN_BACK_MIC),
+ NAME_TO_ENUM("Reroute Submix In", AUDIO_DEVICE_IN_REMOTE_SUBMIX),
+ NAME_TO_ENUM("Analog Dock In", AUDIO_DEVICE_IN_ANLG_DOCK_HEADSET),
+ NAME_TO_ENUM("Digital Dock In", AUDIO_DEVICE_IN_DGTL_DOCK_HEADSET),
+ NAME_TO_ENUM("USB Host In", AUDIO_DEVICE_IN_USB_ACCESSORY),
+ NAME_TO_ENUM("USB Device In", AUDIO_DEVICE_IN_USB_DEVICE),
+ NAME_TO_ENUM("FM Tuner In", AUDIO_DEVICE_IN_FM_TUNER),
+ NAME_TO_ENUM("TV Tuner In", AUDIO_DEVICE_IN_TV_TUNER),
+ NAME_TO_ENUM("Line In", AUDIO_DEVICE_IN_LINE),
+ NAME_TO_ENUM("S/PDIF In", AUDIO_DEVICE_IN_SPDIF),
+ NAME_TO_ENUM("BT A2DP In", AUDIO_DEVICE_IN_BLUETOOTH_A2DP),
+ NAME_TO_ENUM("Loopback In", AUDIO_DEVICE_IN_LOOPBACK),
+ NAME_TO_ENUM("IP In", AUDIO_DEVICE_IN_IP),
+};
+
+const StringToEnum sOutputFlagNameToEnumTable[] = {
+ STRING_TO_ENUM(AUDIO_OUTPUT_FLAG_DIRECT),
+ STRING_TO_ENUM(AUDIO_OUTPUT_FLAG_PRIMARY),
+ STRING_TO_ENUM(AUDIO_OUTPUT_FLAG_FAST),
+ STRING_TO_ENUM(AUDIO_OUTPUT_FLAG_DEEP_BUFFER),
+ STRING_TO_ENUM(AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD),
+ STRING_TO_ENUM(AUDIO_OUTPUT_FLAG_NON_BLOCKING),
+ STRING_TO_ENUM(AUDIO_OUTPUT_FLAG_HW_AV_SYNC),
+ STRING_TO_ENUM(AUDIO_OUTPUT_FLAG_TTS),
+ STRING_TO_ENUM(AUDIO_OUTPUT_FLAG_RAW),
+ STRING_TO_ENUM(AUDIO_OUTPUT_FLAG_SYNC),
+};
+
+const StringToEnum sInputFlagNameToEnumTable[] = {
+ STRING_TO_ENUM(AUDIO_INPUT_FLAG_FAST),
+ STRING_TO_ENUM(AUDIO_INPUT_FLAG_HW_HOTWORD),
+ STRING_TO_ENUM(AUDIO_INPUT_FLAG_RAW),
+ STRING_TO_ENUM(AUDIO_INPUT_FLAG_SYNC),
+};
+
+const StringToEnum sFormatNameToEnumTable[] = {
+ STRING_TO_ENUM(AUDIO_FORMAT_PCM_16_BIT),
+ STRING_TO_ENUM(AUDIO_FORMAT_PCM_8_BIT),
+ STRING_TO_ENUM(AUDIO_FORMAT_PCM_32_BIT),
+ STRING_TO_ENUM(AUDIO_FORMAT_PCM_8_24_BIT),
+ STRING_TO_ENUM(AUDIO_FORMAT_PCM_FLOAT),
+ STRING_TO_ENUM(AUDIO_FORMAT_PCM_24_BIT_PACKED),
+ STRING_TO_ENUM(AUDIO_FORMAT_MP3),
+ STRING_TO_ENUM(AUDIO_FORMAT_AAC),
+ STRING_TO_ENUM(AUDIO_FORMAT_AAC_MAIN),
+ STRING_TO_ENUM(AUDIO_FORMAT_AAC_LC),
+ STRING_TO_ENUM(AUDIO_FORMAT_AAC_SSR),
+ STRING_TO_ENUM(AUDIO_FORMAT_AAC_LTP),
+ STRING_TO_ENUM(AUDIO_FORMAT_AAC_HE_V1),
+ STRING_TO_ENUM(AUDIO_FORMAT_AAC_SCALABLE),
+ STRING_TO_ENUM(AUDIO_FORMAT_AAC_ERLC),
+ STRING_TO_ENUM(AUDIO_FORMAT_AAC_LD),
+ STRING_TO_ENUM(AUDIO_FORMAT_AAC_HE_V2),
+ STRING_TO_ENUM(AUDIO_FORMAT_AAC_ELD),
+ STRING_TO_ENUM(AUDIO_FORMAT_VORBIS),
+ STRING_TO_ENUM(AUDIO_FORMAT_HE_AAC_V1),
+ STRING_TO_ENUM(AUDIO_FORMAT_HE_AAC_V2),
+ STRING_TO_ENUM(AUDIO_FORMAT_OPUS),
+ STRING_TO_ENUM(AUDIO_FORMAT_AC3),
+ STRING_TO_ENUM(AUDIO_FORMAT_E_AC3),
+ STRING_TO_ENUM(AUDIO_FORMAT_DTS),
+ STRING_TO_ENUM(AUDIO_FORMAT_DTS_HD),
+};
+
+const StringToEnum sOutChannelsNameToEnumTable[] = {
+ STRING_TO_ENUM(AUDIO_CHANNEL_OUT_MONO),
+ STRING_TO_ENUM(AUDIO_CHANNEL_OUT_STEREO),
+ STRING_TO_ENUM(AUDIO_CHANNEL_OUT_QUAD),
+ STRING_TO_ENUM(AUDIO_CHANNEL_OUT_5POINT1),
+ STRING_TO_ENUM(AUDIO_CHANNEL_OUT_7POINT1),
+};
+
+const StringToEnum sInChannelsNameToEnumTable[] = {
+ STRING_TO_ENUM(AUDIO_CHANNEL_IN_MONO),
+ STRING_TO_ENUM(AUDIO_CHANNEL_IN_STEREO),
+ STRING_TO_ENUM(AUDIO_CHANNEL_IN_FRONT_BACK),
+};
+
+const StringToEnum sIndexChannelsNameToEnumTable[] = {
+ STRING_TO_ENUM(AUDIO_CHANNEL_INDEX_MASK_1),
+ STRING_TO_ENUM(AUDIO_CHANNEL_INDEX_MASK_2),
+ STRING_TO_ENUM(AUDIO_CHANNEL_INDEX_MASK_3),
+ STRING_TO_ENUM(AUDIO_CHANNEL_INDEX_MASK_4),
+ STRING_TO_ENUM(AUDIO_CHANNEL_INDEX_MASK_5),
+ STRING_TO_ENUM(AUDIO_CHANNEL_INDEX_MASK_6),
+ STRING_TO_ENUM(AUDIO_CHANNEL_INDEX_MASK_7),
+ STRING_TO_ENUM(AUDIO_CHANNEL_INDEX_MASK_8),
+};
+
+const StringToEnum sGainModeNameToEnumTable[] = {
+ STRING_TO_ENUM(AUDIO_GAIN_MODE_JOINT),
+ STRING_TO_ENUM(AUDIO_GAIN_MODE_CHANNELS),
+ STRING_TO_ENUM(AUDIO_GAIN_MODE_RAMP),
+};
+
+class ConfigParsingUtils
+{
+public:
+ static uint32_t stringToEnum(const struct StringToEnum *table,
+ size_t size,
+ const char *name);
+ static const char *enumToString(const struct StringToEnum *table,
+ size_t size,
+ uint32_t value);
+ static bool stringToBool(const char *value);
+ static uint32_t parseOutputFlagNames(char *name);
+ static uint32_t parseInputFlagNames(char *name);
+ static audio_devices_t parseDeviceNames(char *name);
+
+ static void loadHwModules(cnode *root, HwModuleCollection &hwModules,
+ DeviceVector &availableInputDevices,
+ DeviceVector &availableOutputDevices,
+ sp<DeviceDescriptor> &defaultOutputDevices,
+ bool &isSpeakerDrcEnabled);
+
+ static void loadGlobalConfig(cnode *root, const sp<HwModule>& module,
+ DeviceVector &availableInputDevices,
+ DeviceVector &availableOutputDevices,
+ sp<DeviceDescriptor> &defaultOutputDevices,
+ bool &isSpeakerDrcEnabled);
+
+ static status_t loadAudioPolicyConfig(const char *path,
+ HwModuleCollection &hwModules,
+ DeviceVector &availableInputDevices,
+ DeviceVector &availableOutputDevices,
+ sp<DeviceDescriptor> &defaultOutputDevices,
+ bool &isSpeakerDrcEnabled);
+
+private:
+ static void loadHwModule(cnode *root, HwModuleCollection &hwModules,
+ DeviceVector &availableInputDevices,
+ DeviceVector &availableOutputDevices,
+ sp<DeviceDescriptor> &defaultOutputDevices,
+ bool &isSpeakerDrcEnabled);
+};
+
+}; // namespace android
diff --git a/services/audiopolicy/common/managerdefinitions/include/DeviceDescriptor.h b/services/audiopolicy/common/managerdefinitions/include/DeviceDescriptor.h
new file mode 100644
index 0000000..c42ece6
--- /dev/null
+++ b/services/audiopolicy/common/managerdefinitions/include/DeviceDescriptor.h
@@ -0,0 +1,95 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include "AudioPort.h"
+#include <utils/Errors.h>
+#include <utils/String8.h>
+#include <utils/SortedVector.h>
+#include <cutils/config_utils.h>
+#include <system/audio.h>
+#include <system/audio_policy.h>
+
+namespace android {
+
+class DeviceDescriptor : public AudioPort, public AudioPortConfig
+{
+public:
+ DeviceDescriptor(audio_devices_t type);
+
+ virtual ~DeviceDescriptor() {}
+
+ bool equals(const sp<DeviceDescriptor>& other) const;
+
+ // AudioPortConfig
+ virtual sp<AudioPort> getAudioPort() const { return (AudioPort*) this; }
+ virtual void toAudioPortConfig(struct audio_port_config *dstConfig,
+ const struct audio_port_config *srcConfig = NULL) const;
+
+ // AudioPort
+ virtual void attach(const sp<HwModule>& module);
+ virtual void loadGains(cnode *root);
+ virtual void toAudioPort(struct audio_port *port) const;
+ virtual void importAudioPort(const sp<AudioPort> port);
+
+ audio_port_handle_t getId() const;
+ audio_devices_t type() const { return mDeviceType; }
+ status_t dump(int fd, int spaces, int index) const;
+ void log() const;
+
+ String8 mTag;
+ String8 mAddress;
+
+private:
+ audio_devices_t mDeviceType;
+ audio_port_handle_t mId;
+
+friend class DeviceVector;
+};
+
+class DeviceVector : public SortedVector< sp<DeviceDescriptor> >
+{
+public:
+ DeviceVector() : SortedVector(), mDeviceTypes(AUDIO_DEVICE_NONE) {}
+
+ ssize_t add(const sp<DeviceDescriptor>& item);
+ ssize_t remove(const sp<DeviceDescriptor>& item);
+ ssize_t indexOf(const sp<DeviceDescriptor>& item) const;
+
+ audio_devices_t types() const { return mDeviceTypes; }
+
+ void loadDevicesFromType(audio_devices_t types);
+ void loadDevicesFromTag(char *tag, const DeviceVector& declaredDevices);
+
+ sp<DeviceDescriptor> getDevice(audio_devices_t type, String8 address) const;
+ DeviceVector getDevicesFromType(audio_devices_t types) const;
+ sp<DeviceDescriptor> getDeviceFromId(audio_port_handle_t id) const;
+ sp<DeviceDescriptor> getDeviceFromTag(const String8& tag) const;
+ DeviceVector getDevicesFromTypeAddr(audio_devices_t type, String8 address) const;
+
+ audio_devices_t getDevicesFromHwModule(audio_module_handle_t moduleHandle) const;
+
+ audio_policy_dev_state_t getDeviceConnectionState(const sp<DeviceDescriptor> &devDesc) const;
+
+ status_t dump(int fd, const String8 &direction) const;
+
+private:
+ void refreshTypes();
+ audio_devices_t mDeviceTypes;
+};
+
+}; // namespace android
diff --git a/services/audiopolicy/common/managerdefinitions/include/EffectDescriptor.h b/services/audiopolicy/common/managerdefinitions/include/EffectDescriptor.h
new file mode 100644
index 0000000..c9783a1
--- /dev/null
+++ b/services/audiopolicy/common/managerdefinitions/include/EffectDescriptor.h
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <RoutingStrategy.h>
+#include <hardware/audio_effect.h>
+#include <utils/KeyedVector.h>
+#include <utils/RefBase.h>
+#include <utils/Errors.h>
+
+namespace android {
+
+
+class EffectDescriptor : public RefBase
+{
+public:
+ status_t dump(int fd);
+
+ int mIo; // io the effect is attached to
+ routing_strategy mStrategy; // routing strategy the effect is associated to
+ int mSession; // audio session the effect is on
+ effect_descriptor_t mDesc; // effect descriptor
+ bool mEnabled; // enabled state: CPU load being used or not
+};
+
+class EffectDescriptorCollection : public KeyedVector<int, sp<EffectDescriptor> >
+{
+public:
+ EffectDescriptorCollection();
+
+ status_t registerEffect(const effect_descriptor_t *desc, audio_io_handle_t io,
+ uint32_t strategy, int session, int id);
+ status_t unregisterEffect(int id);
+ status_t setEffectEnabled(int id, bool enabled);
+ uint32_t getMaxEffectsCpuLoad() const;
+ uint32_t getMaxEffectsMemory() const;
+ bool isNonOffloadableEffectEnabled();
+
+ status_t dump(int fd);
+
+private:
+ status_t setEffectEnabled(const sp<EffectDescriptor> &effectDesc, bool enabled);
+
+ uint32_t mTotalEffectsCpuLoad; // current CPU load used by effects
+ uint32_t mTotalEffectsMemory; // current memory used by effects
+
+ /**
+ * Maximum CPU load allocated to audio effects in 0.1 MIPS (ARMv5TE, 0 WS memory) units
+ */
+ static const uint32_t MAX_EFFECTS_CPU_LOAD = 1000;
+ /**
+ * Maximum memory allocated to audio effects in KB
+ */
+ static const uint32_t MAX_EFFECTS_MEMORY = 512;
+};
+
+}; // namespace android
diff --git a/services/audiopolicy/common/managerdefinitions/include/HwModule.h b/services/audiopolicy/common/managerdefinitions/include/HwModule.h
new file mode 100644
index 0000000..92c3ea2
--- /dev/null
+++ b/services/audiopolicy/common/managerdefinitions/include/HwModule.h
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include "DeviceDescriptor.h"
+#include <utils/RefBase.h>
+#include <utils/String8.h>
+#include <utils/Errors.h>
+#include <utils/Vector.h>
+#include <system/audio.h>
+#include <cutils/config_utils.h>
+
+namespace android {
+
+class IOProfile;
+
+class HwModule : public RefBase
+{
+public:
+ HwModule(const char *name);
+ ~HwModule();
+
+ status_t loadOutput(cnode *root);
+ status_t loadInput(cnode *root);
+ status_t loadDevice(cnode *root);
+
+ status_t addOutputProfile(String8 name, const audio_config_t *config,
+ audio_devices_t device, String8 address);
+ status_t removeOutputProfile(String8 name);
+ status_t addInputProfile(String8 name, const audio_config_t *config,
+ audio_devices_t device, String8 address);
+ status_t removeInputProfile(String8 name);
+
+ audio_module_handle_t getHandle() const { return mHandle; }
+
+ void dump(int fd);
+
+ const char *const mName; // base name of the audio HW module (primary, a2dp ...)
+ uint32_t mHalVersion; // audio HAL API version
+ audio_module_handle_t mHandle;
+ Vector < sp<IOProfile> > mOutputProfiles; // output profiles exposed by this module
+ Vector < sp<IOProfile> > mInputProfiles; // input profiles exposed by this module
+ DeviceVector mDeclaredDevices; // devices declared in audio_policy.conf
+};
+
+class HwModuleCollection : public Vector< sp<HwModule> >
+{
+public:
+ sp<HwModule> getModuleFromName(const char *name) const;
+
+ sp <HwModule> getModuleForDevice(audio_devices_t device) const;
+
+ sp<DeviceDescriptor> getDeviceDescriptor(const audio_devices_t device,
+ const char *device_address,
+ const char *device_name) const;
+
+ status_t dump(int fd) const;
+};
+
+}; // namespace android
diff --git a/services/audiopolicy/common/managerdefinitions/include/IOProfile.h b/services/audiopolicy/common/managerdefinitions/include/IOProfile.h
new file mode 100644
index 0000000..ab6fcc1
--- /dev/null
+++ b/services/audiopolicy/common/managerdefinitions/include/IOProfile.h
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include "AudioPort.h"
+#include "DeviceDescriptor.h"
+#include <utils/String8.h>
+#include <system/audio.h>
+
+namespace android {
+
+class HwModule;
+
+// the IOProfile class describes the capabilities of an output or input stream.
+// It is currently assumed that all combination of listed parameters are supported.
+// It is used by the policy manager to determine if an output or input is suitable for
+// a given use case, open/close it accordingly and connect/disconnect audio tracks
+// to/from it.
+class IOProfile : public AudioPort
+{
+public:
+ IOProfile(const String8& name, audio_port_role_t role);
+ virtual ~IOProfile();
+
+ // This method is used for both output and input.
+ // If parameter updatedSamplingRate is non-NULL, it is assigned the actual sample rate.
+ // For input, flags is interpreted as audio_input_flags_t.
+ // TODO: merge audio_output_flags_t and audio_input_flags_t.
+ bool isCompatibleProfile(audio_devices_t device,
+ String8 address,
+ uint32_t samplingRate,
+ uint32_t *updatedSamplingRate,
+ audio_format_t format,
+ audio_format_t *updatedFormat,
+ audio_channel_mask_t channelMask,
+ audio_channel_mask_t *updatedChannelMask,
+ uint32_t flags) const;
+
+ void dump(int fd);
+ void log();
+
+ DeviceVector mSupportedDevices; // supported devices
+ // (devices this output can be routed to)
+};
+
+}; // namespace android
diff --git a/services/audiopolicy/common/managerdefinitions/include/SessionRoute.h b/services/audiopolicy/common/managerdefinitions/include/SessionRoute.h
new file mode 100644
index 0000000..b4feaf0
--- /dev/null
+++ b/services/audiopolicy/common/managerdefinitions/include/SessionRoute.h
@@ -0,0 +1,118 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <system/audio.h>
+#include <utils/KeyedVector.h>
+#include <utils/RefBase.h>
+#include <utils/Errors.h>
+
+namespace android {
+
+class DeviceDescriptor;
+
+class SessionRoute : public RefBase
+{
+public:
+ // For Input (Source) routes, use STREAM_TYPE_NA ("NA" = "not applicable)for the
+ // streamType argument
+ static const audio_stream_type_t STREAM_TYPE_NA = AUDIO_STREAM_DEFAULT;
+
+ // For Output (Sink) routes, use SOURCE_TYPE_NA ("NA" = "not applicable") for the
+ // source argument
+
+ static const audio_source_t SOURCE_TYPE_NA = AUDIO_SOURCE_DEFAULT;
+
+ SessionRoute(audio_session_t session,
+ audio_stream_type_t streamType,
+ audio_source_t source,
+ sp<DeviceDescriptor> deviceDescriptor,
+ uid_t uid)
+ : mUid(uid),
+ mSession(session),
+ mDeviceDescriptor(deviceDescriptor),
+ mRefCount(0),
+ mActivityCount(0),
+ mChanged(false),
+ mStreamType(streamType),
+ mSource(source)
+ {}
+
+ void log(const char* prefix);
+
+ bool isActive() {
+ return (mDeviceDescriptor != 0) && (mChanged || (mActivityCount > 0));
+ }
+
+ uid_t mUid;
+ audio_session_t mSession;
+ sp<DeviceDescriptor> mDeviceDescriptor;
+
+ // "reference" counting
+ int mRefCount; // +/- on references
+ int mActivityCount; // +/- on start/stop
+ bool mChanged;
+ // for outputs
+ const audio_stream_type_t mStreamType;
+ // for inputs
+ const audio_source_t mSource;
+};
+
+class SessionRouteMap: public KeyedVector<audio_session_t, sp<SessionRoute> >
+{
+public:
+ // These constants identify the SessionRoutMap as holding EITHER input routes,
+ // or output routes. An error will occur if an attempt is made to add a SessionRoute
+ // object with mStreamType == STREAM_TYPE_NA (i.e. an input SessionRoute) to a
+ // SessionRoutMap that is marked for output (i.e. mMapType == SESSION_ROUTE_MAP_OUTPUT)
+ // and similarly for output SessionRoutes and Input SessionRouteMaps.
+ typedef enum
+ {
+ MAPTYPE_INPUT = 0,
+ MAPTYPE_OUTPUT = 1
+ } session_route_map_type_t;
+
+ SessionRouteMap(session_route_map_type_t mapType) :
+ mMapType(mapType)
+ {}
+
+ bool hasRoute(audio_session_t session);
+
+ void removeRoute(audio_session_t session);
+
+ int incRouteActivity(audio_session_t session);
+ int decRouteActivity(audio_session_t session);
+ bool hasRouteChanged(audio_session_t session); // also clears the changed flag
+ void log(const char* caption);
+
+ // Specify an Output(Sink) route by passing SessionRoute::SOURCE_TYPE_NA in the
+ // source argument.
+ // Specify an Input(Source) rout by passing SessionRoute::AUDIO_STREAM_DEFAULT
+ // in the streamType argument.
+ void addRoute(audio_session_t session,
+ audio_stream_type_t streamType,
+ audio_source_t source,
+ sp<DeviceDescriptor> deviceDescriptor,
+ uid_t uid);
+
+private:
+ // Used to mark a SessionRoute as for either inputs (mMapType == kSessionRouteMap_Input)
+ // or outputs (mMapType == kSessionRouteMap_Output)
+ const session_route_map_type_t mMapType;
+};
+
+}; // namespace android
diff --git a/services/audiopolicy/common/managerdefinitions/include/SoundTriggerSession.h b/services/audiopolicy/common/managerdefinitions/include/SoundTriggerSession.h
new file mode 100644
index 0000000..420e6d7
--- /dev/null
+++ b/services/audiopolicy/common/managerdefinitions/include/SoundTriggerSession.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <system/audio.h>
+#include <utils/Errors.h>
+#include <utils/KeyedVector.h>
+
+namespace android {
+
+class SoundTriggerSessionCollection : public DefaultKeyedVector<audio_session_t, audio_io_handle_t>
+{
+public:
+ status_t releaseSession(audio_session_t session);
+
+ status_t acquireSession(audio_session_t session, audio_io_handle_t ioHandle);
+};
+
+}; // namespace android
diff --git a/services/audiopolicy/common/managerdefinitions/include/StreamDescriptor.h b/services/audiopolicy/common/managerdefinitions/include/StreamDescriptor.h
new file mode 100644
index 0000000..84db5ab
--- /dev/null
+++ b/services/audiopolicy/common/managerdefinitions/include/StreamDescriptor.h
@@ -0,0 +1,85 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <Volume.h>
+#include <utils/KeyedVector.h>
+#include <utils/StrongPointer.h>
+#include <utils/SortedVector.h>
+#include <hardware/audio.h>
+
+namespace android {
+
+// stream descriptor used for volume control
+class StreamDescriptor
+{
+public:
+ StreamDescriptor();
+
+ int getVolumeIndex(audio_devices_t device) const;
+ bool canBeMuted() const { return mCanBeMuted; }
+ void clearCurrentVolumeIndex();
+ void addCurrentVolumeIndex(audio_devices_t device, int index);
+ int getVolumeIndexMin() const { return mIndexMin; }
+ int getVolumeIndexMax() const { return mIndexMax; }
+ void setVolumeIndexMin(int volIndexMin);
+ void setVolumeIndexMax(int volIndexMax);
+
+ void dump(int fd) const;
+
+ void setVolumeCurvePoint(Volume::device_category deviceCategory, const VolumeCurvePoint *point);
+ const VolumeCurvePoint *getVolumeCurvePoint(Volume::device_category deviceCategory) const
+ {
+ return mVolumeCurve[deviceCategory];
+ }
+
+private:
+ const VolumeCurvePoint *mVolumeCurve[Volume::DEVICE_CATEGORY_CNT];
+ KeyedVector<audio_devices_t, int> mIndexCur; /**< current volume index per device. */
+ int mIndexMin; /**< min volume index. */
+ int mIndexMax; /**< max volume index. */
+ bool mCanBeMuted; /**< true is the stream can be muted. */
+};
+
+/**
+ * stream descriptors collection for volume control
+ */
+class StreamDescriptorCollection : public DefaultKeyedVector<audio_stream_type_t, StreamDescriptor>
+{
+public:
+ StreamDescriptorCollection();
+
+ void clearCurrentVolumeIndex(audio_stream_type_t stream);
+ void addCurrentVolumeIndex(audio_stream_type_t stream, audio_devices_t device, int index);
+
+ bool canBeMuted(audio_stream_type_t stream);
+
+ status_t dump(int fd) const;
+
+ void setVolumeCurvePoint(audio_stream_type_t stream,
+ Volume::device_category deviceCategory,
+ const VolumeCurvePoint *point);
+
+ const VolumeCurvePoint *getVolumeCurvePoint(audio_stream_type_t stream,
+ Volume::device_category deviceCategory) const;
+
+ void setVolumeIndexMin(audio_stream_type_t stream,int volIndexMin);
+ void setVolumeIndexMax(audio_stream_type_t stream,int volIndexMax);
+
+};
+
+}; // namespace android
diff --git a/services/audiopolicy/audio_policy_conf.h b/services/audiopolicy/common/managerdefinitions/include/audio_policy_conf.h
index 2535a67..a393e3b 100644
--- a/services/audiopolicy/audio_policy_conf.h
+++ b/services/audiopolicy/common/managerdefinitions/include/audio_policy_conf.h
@@ -14,9 +14,7 @@
* limitations under the License.
*/
-
-#ifndef ANDROID_AUDIO_POLICY_CONF_H
-#define ANDROID_AUDIO_POLICY_CONF_H
+#pragma once
/////////////////////////////////////////////////
@@ -53,9 +51,9 @@
// "formats" in outputs descriptors indicating that supported
// values should be queried after opening the output.
-#define DEVICES_TAG "devices"
-#define DEVICE_TYPE "type"
-#define DEVICE_ADDRESS "address"
+#define APM_DEVICES_TAG "devices"
+#define APM_DEVICE_TYPE "type"
+#define APM_DEVICE_ADDRESS "address"
#define MIXERS_TAG "mixers"
#define MIXER_TYPE "type"
@@ -71,7 +69,3 @@
#define GAIN_STEP_VALUE "step_value_mB"
#define GAIN_MIN_RAMP_MS "min_ramp_ms"
#define GAIN_MAX_RAMP_MS "max_ramp_ms"
-
-
-
-#endif // ANDROID_AUDIO_POLICY_CONF_H
diff --git a/services/audiopolicy/common/managerdefinitions/src/AudioGain.cpp b/services/audiopolicy/common/managerdefinitions/src/AudioGain.cpp
new file mode 100644
index 0000000..fc7b0cc
--- /dev/null
+++ b/services/audiopolicy/common/managerdefinitions/src/AudioGain.cpp
@@ -0,0 +1,130 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "APM::AudioGain"
+//#define LOG_NDEBUG 0
+
+//#define VERY_VERBOSE_LOGGING
+#ifdef VERY_VERBOSE_LOGGING
+#define ALOGVV ALOGV
+#else
+#define ALOGVV(a...) do { } while(0)
+#endif
+
+#include "AudioGain.h"
+#include "StreamDescriptor.h"
+#include <utils/Log.h>
+#include <utils/String8.h>
+
+#include <math.h>
+
+namespace android {
+
+AudioGain::AudioGain(int index, bool useInChannelMask)
+{
+ mIndex = index;
+ mUseInChannelMask = useInChannelMask;
+ memset(&mGain, 0, sizeof(struct audio_gain));
+}
+
+void AudioGain::getDefaultConfig(struct audio_gain_config *config)
+{
+ config->index = mIndex;
+ config->mode = mGain.mode;
+ config->channel_mask = mGain.channel_mask;
+ if ((mGain.mode & AUDIO_GAIN_MODE_JOINT) == AUDIO_GAIN_MODE_JOINT) {
+ config->values[0] = mGain.default_value;
+ } else {
+ uint32_t numValues;
+ if (mUseInChannelMask) {
+ numValues = audio_channel_count_from_in_mask(mGain.channel_mask);
+ } else {
+ numValues = audio_channel_count_from_out_mask(mGain.channel_mask);
+ }
+ for (size_t i = 0; i < numValues; i++) {
+ config->values[i] = mGain.default_value;
+ }
+ }
+ if ((mGain.mode & AUDIO_GAIN_MODE_RAMP) == AUDIO_GAIN_MODE_RAMP) {
+ config->ramp_duration_ms = mGain.min_ramp_ms;
+ }
+}
+
+status_t AudioGain::checkConfig(const struct audio_gain_config *config)
+{
+ if ((config->mode & ~mGain.mode) != 0) {
+ return BAD_VALUE;
+ }
+ if ((config->mode & AUDIO_GAIN_MODE_JOINT) == AUDIO_GAIN_MODE_JOINT) {
+ if ((config->values[0] < mGain.min_value) ||
+ (config->values[0] > mGain.max_value)) {
+ return BAD_VALUE;
+ }
+ } else {
+ if ((config->channel_mask & ~mGain.channel_mask) != 0) {
+ return BAD_VALUE;
+ }
+ uint32_t numValues;
+ if (mUseInChannelMask) {
+ numValues = audio_channel_count_from_in_mask(config->channel_mask);
+ } else {
+ numValues = audio_channel_count_from_out_mask(config->channel_mask);
+ }
+ for (size_t i = 0; i < numValues; i++) {
+ if ((config->values[i] < mGain.min_value) ||
+ (config->values[i] > mGain.max_value)) {
+ return BAD_VALUE;
+ }
+ }
+ }
+ if ((config->mode & AUDIO_GAIN_MODE_RAMP) == AUDIO_GAIN_MODE_RAMP) {
+ if ((config->ramp_duration_ms < mGain.min_ramp_ms) ||
+ (config->ramp_duration_ms > mGain.max_ramp_ms)) {
+ return BAD_VALUE;
+ }
+ }
+ return NO_ERROR;
+}
+
+void AudioGain::dump(int fd, int spaces, int index) const
+{
+ const size_t SIZE = 256;
+ char buffer[SIZE];
+ String8 result;
+
+ snprintf(buffer, SIZE, "%*sGain %d:\n", spaces, "", index+1);
+ result.append(buffer);
+ snprintf(buffer, SIZE, "%*s- mode: %08x\n", spaces, "", mGain.mode);
+ result.append(buffer);
+ snprintf(buffer, SIZE, "%*s- channel_mask: %08x\n", spaces, "", mGain.channel_mask);
+ result.append(buffer);
+ snprintf(buffer, SIZE, "%*s- min_value: %d mB\n", spaces, "", mGain.min_value);
+ result.append(buffer);
+ snprintf(buffer, SIZE, "%*s- max_value: %d mB\n", spaces, "", mGain.max_value);
+ result.append(buffer);
+ snprintf(buffer, SIZE, "%*s- default_value: %d mB\n", spaces, "", mGain.default_value);
+ result.append(buffer);
+ snprintf(buffer, SIZE, "%*s- step_value: %d mB\n", spaces, "", mGain.step_value);
+ result.append(buffer);
+ snprintf(buffer, SIZE, "%*s- min_ramp_ms: %d ms\n", spaces, "", mGain.min_ramp_ms);
+ result.append(buffer);
+ snprintf(buffer, SIZE, "%*s- max_ramp_ms: %d ms\n", spaces, "", mGain.max_ramp_ms);
+ result.append(buffer);
+
+ write(fd, result.string(), result.size());
+}
+
+}; // namespace android
diff --git a/services/audiopolicy/common/managerdefinitions/src/AudioInputDescriptor.cpp b/services/audiopolicy/common/managerdefinitions/src/AudioInputDescriptor.cpp
new file mode 100644
index 0000000..937160b
--- /dev/null
+++ b/services/audiopolicy/common/managerdefinitions/src/AudioInputDescriptor.cpp
@@ -0,0 +1,195 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "APM::AudioInputDescriptor"
+//#define LOG_NDEBUG 0
+
+#include "AudioInputDescriptor.h"
+#include "IOProfile.h"
+#include "AudioGain.h"
+#include "HwModule.h"
+#include <media/AudioPolicy.h>
+#include <policy.h>
+
+namespace android {
+
+AudioInputDescriptor::AudioInputDescriptor(const sp<IOProfile>& profile)
+ : mIoHandle(0),
+ mDevice(AUDIO_DEVICE_NONE), mPolicyMix(NULL), mPatchHandle(0), mRefCount(0),
+ mInputSource(AUDIO_SOURCE_DEFAULT), mProfile(profile), mIsSoundTrigger(false), mId(0)
+{
+ if (profile != NULL) {
+ mSamplingRate = profile->pickSamplingRate();
+ mFormat = profile->pickFormat();
+ mChannelMask = profile->pickChannelMask();
+ if (profile->mGains.size() > 0) {
+ profile->mGains[0]->getDefaultConfig(&mGain);
+ }
+ }
+}
+
+void AudioInputDescriptor::setIoHandle(audio_io_handle_t ioHandle)
+{
+ mId = AudioPort::getNextUniqueId();
+ mIoHandle = ioHandle;
+}
+
+audio_module_handle_t AudioInputDescriptor::getModuleHandle() const
+{
+ if (mProfile == 0) {
+ return 0;
+ }
+ return mProfile->getModuleHandle();
+}
+
+audio_port_handle_t AudioInputDescriptor::getId() const
+{
+ return mId;
+}
+
+void AudioInputDescriptor::toAudioPortConfig(struct audio_port_config *dstConfig,
+ const struct audio_port_config *srcConfig) const
+{
+ ALOG_ASSERT(mProfile != 0,
+ "toAudioPortConfig() called on input with null profile %d", mIoHandle);
+ dstConfig->config_mask = AUDIO_PORT_CONFIG_SAMPLE_RATE|AUDIO_PORT_CONFIG_CHANNEL_MASK|
+ AUDIO_PORT_CONFIG_FORMAT|AUDIO_PORT_CONFIG_GAIN;
+ if (srcConfig != NULL) {
+ dstConfig->config_mask |= srcConfig->config_mask;
+ }
+
+ AudioPortConfig::toAudioPortConfig(dstConfig, srcConfig);
+
+ dstConfig->id = mId;
+ dstConfig->role = AUDIO_PORT_ROLE_SINK;
+ dstConfig->type = AUDIO_PORT_TYPE_MIX;
+ dstConfig->ext.mix.hw_module = getModuleHandle();
+ dstConfig->ext.mix.handle = mIoHandle;
+ dstConfig->ext.mix.usecase.source = mInputSource;
+}
+
+void AudioInputDescriptor::toAudioPort(struct audio_port *port) const
+{
+ ALOG_ASSERT(mProfile != 0, "toAudioPort() called on input with null profile %d", mIoHandle);
+
+ mProfile->toAudioPort(port);
+ port->id = mId;
+ toAudioPortConfig(&port->active_config);
+ port->ext.mix.hw_module = getModuleHandle();
+ port->ext.mix.handle = mIoHandle;
+ port->ext.mix.latency_class = AUDIO_LATENCY_NORMAL;
+}
+
+status_t AudioInputDescriptor::dump(int fd)
+{
+ const size_t SIZE = 256;
+ char buffer[SIZE];
+ String8 result;
+
+ snprintf(buffer, SIZE, " ID: %d\n", getId());
+ result.append(buffer);
+ snprintf(buffer, SIZE, " Sampling rate: %d\n", mSamplingRate);
+ result.append(buffer);
+ snprintf(buffer, SIZE, " Format: %d\n", mFormat);
+ result.append(buffer);
+ snprintf(buffer, SIZE, " Channels: %08x\n", mChannelMask);
+ result.append(buffer);
+ snprintf(buffer, SIZE, " Devices %08x\n", mDevice);
+ result.append(buffer);
+ snprintf(buffer, SIZE, " Ref Count %d\n", mRefCount);
+ result.append(buffer);
+ snprintf(buffer, SIZE, " Open Ref Count %d\n", mOpenRefCount);
+ result.append(buffer);
+
+ write(fd, result.string(), result.size());
+
+ return NO_ERROR;
+}
+
+bool AudioInputCollection::isSourceActive(audio_source_t source) const
+{
+ for (size_t i = 0; i < size(); i++) {
+ const sp<AudioInputDescriptor> inputDescriptor = valueAt(i);
+ if (inputDescriptor->mRefCount == 0) {
+ continue;
+ }
+ if (inputDescriptor->mInputSource == (int)source) {
+ return true;
+ }
+ }
+ return false;
+}
+
+sp<AudioInputDescriptor> AudioInputCollection::getInputFromId(audio_port_handle_t id) const
+{
+ sp<AudioInputDescriptor> inputDesc = NULL;
+ for (size_t i = 0; i < size(); i++) {
+ inputDesc = valueAt(i);
+ if (inputDesc->getId() == id) {
+ break;
+ }
+ }
+ return inputDesc;
+}
+
+uint32_t AudioInputCollection::activeInputsCount() const
+{
+ uint32_t count = 0;
+ for (size_t i = 0; i < size(); i++) {
+ const sp<AudioInputDescriptor> desc = valueAt(i);
+ if (desc->mRefCount > 0) {
+ count++;
+ }
+ }
+ return count;
+}
+
+audio_io_handle_t AudioInputCollection::getActiveInput(bool ignoreVirtualInputs)
+{
+ for (size_t i = 0; i < size(); i++) {
+ const sp<AudioInputDescriptor> input_descriptor = valueAt(i);
+ if ((input_descriptor->mRefCount > 0)
+ && (!ignoreVirtualInputs || !is_virtual_input_device(input_descriptor->mDevice))) {
+ return keyAt(i);
+ }
+ }
+ return 0;
+}
+
+audio_devices_t AudioInputCollection::getSupportedDevices(audio_io_handle_t handle) const
+{
+ sp<AudioInputDescriptor> inputDesc = valueFor(handle);
+ audio_devices_t devices = inputDesc->mProfile->mSupportedDevices.types();
+ return devices;
+}
+
+status_t AudioInputCollection::dump(int fd) const
+{
+ const size_t SIZE = 256;
+ char buffer[SIZE];
+
+ snprintf(buffer, SIZE, "\nInputs dump:\n");
+ write(fd, buffer, strlen(buffer));
+ for (size_t i = 0; i < size(); i++) {
+ snprintf(buffer, SIZE, "- Input %d dump:\n", keyAt(i));
+ write(fd, buffer, strlen(buffer));
+ valueAt(i)->dump(fd);
+ }
+
+ return NO_ERROR;
+}
+
+}; //namespace android
diff --git a/services/audiopolicy/common/managerdefinitions/src/AudioOutputDescriptor.cpp b/services/audiopolicy/common/managerdefinitions/src/AudioOutputDescriptor.cpp
new file mode 100644
index 0000000..a278375
--- /dev/null
+++ b/services/audiopolicy/common/managerdefinitions/src/AudioOutputDescriptor.cpp
@@ -0,0 +1,497 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "APM::AudioOutputDescriptor"
+//#define LOG_NDEBUG 0
+
+#include <AudioPolicyInterface.h>
+#include "AudioOutputDescriptor.h"
+#include "IOProfile.h"
+#include "AudioGain.h"
+#include "Volume.h"
+#include "HwModule.h"
+#include <media/AudioPolicy.h>
+
+// A device mask for all audio output devices that are considered "remote" when evaluating
+// active output devices in isStreamActiveRemotely()
+#define APM_AUDIO_OUT_DEVICE_REMOTE_ALL AUDIO_DEVICE_OUT_REMOTE_SUBMIX
+
+namespace android {
+
+AudioOutputDescriptor::AudioOutputDescriptor(const sp<AudioPort>& port,
+ AudioPolicyClientInterface *clientInterface)
+ : mPort(port), mDevice(AUDIO_DEVICE_NONE),
+ mPatchHandle(0), mClientInterface(clientInterface), mId(0)
+{
+ // clear usage count for all stream types
+ for (int i = 0; i < AUDIO_STREAM_CNT; i++) {
+ mRefCount[i] = 0;
+ mCurVolume[i] = -1.0;
+ mMuteCount[i] = 0;
+ mStopTime[i] = 0;
+ }
+ for (int i = 0; i < NUM_STRATEGIES; i++) {
+ mStrategyMutedByDevice[i] = false;
+ }
+ if (port != NULL) {
+ mSamplingRate = port->pickSamplingRate();
+ mFormat = port->pickFormat();
+ mChannelMask = port->pickChannelMask();
+ if (port->mGains.size() > 0) {
+ port->mGains[0]->getDefaultConfig(&mGain);
+ }
+ }
+}
+
+audio_module_handle_t AudioOutputDescriptor::getModuleHandle() const
+{
+ return mPort->getModuleHandle();
+}
+
+audio_port_handle_t AudioOutputDescriptor::getId() const
+{
+ return mId;
+}
+
+audio_devices_t AudioOutputDescriptor::device() const
+{
+ return mDevice;
+}
+
+audio_devices_t AudioOutputDescriptor::supportedDevices()
+{
+ return mDevice;
+}
+
+bool AudioOutputDescriptor::sharesHwModuleWith(
+ const sp<AudioOutputDescriptor> outputDesc)
+{
+ if (outputDesc->isDuplicated()) {
+ return sharesHwModuleWith(outputDesc->subOutput1()) ||
+ sharesHwModuleWith(outputDesc->subOutput2());
+ } else {
+ return (getModuleHandle() == outputDesc->getModuleHandle());
+ }
+}
+
+void AudioOutputDescriptor::changeRefCount(audio_stream_type_t stream,
+ int delta)
+{
+ if ((delta + (int)mRefCount[stream]) < 0) {
+ ALOGW("changeRefCount() invalid delta %d for stream %d, refCount %d",
+ delta, stream, mRefCount[stream]);
+ mRefCount[stream] = 0;
+ return;
+ }
+ mRefCount[stream] += delta;
+ ALOGV("changeRefCount() stream %d, count %d", stream, mRefCount[stream]);
+}
+
+bool AudioOutputDescriptor::isActive(uint32_t inPastMs) const
+{
+ nsecs_t sysTime = 0;
+ if (inPastMs != 0) {
+ sysTime = systemTime();
+ }
+ for (int i = 0; i < (int)AUDIO_STREAM_CNT; i++) {
+ if (i == AUDIO_STREAM_PATCH) {
+ continue;
+ }
+ if (isStreamActive((audio_stream_type_t)i, inPastMs, sysTime)) {
+ return true;
+ }
+ }
+ return false;
+}
+
+bool AudioOutputDescriptor::isStreamActive(audio_stream_type_t stream,
+ uint32_t inPastMs,
+ nsecs_t sysTime) const
+{
+ if (mRefCount[stream] != 0) {
+ return true;
+ }
+ if (inPastMs == 0) {
+ return false;
+ }
+ if (sysTime == 0) {
+ sysTime = systemTime();
+ }
+ if (ns2ms(sysTime - mStopTime[stream]) < inPastMs) {
+ return true;
+ }
+ return false;
+}
+
+
+bool AudioOutputDescriptor::isFixedVolume(audio_devices_t device __unused)
+{
+ return false;
+}
+
+bool AudioOutputDescriptor::setVolume(float volume,
+ audio_stream_type_t stream,
+ audio_devices_t device __unused,
+ uint32_t delayMs,
+ bool force)
+{
+ // We actually change the volume if:
+ // - the float value returned by computeVolume() changed
+ // - the force flag is set
+ if (volume != mCurVolume[stream] || force) {
+ ALOGV("setVolume() for stream %d, volume %f, delay %d", stream, volume, delayMs);
+ mCurVolume[stream] = volume;
+ return true;
+ }
+ return false;
+}
+
+void AudioOutputDescriptor::toAudioPortConfig(
+ struct audio_port_config *dstConfig,
+ const struct audio_port_config *srcConfig) const
+{
+ dstConfig->config_mask = AUDIO_PORT_CONFIG_SAMPLE_RATE|AUDIO_PORT_CONFIG_CHANNEL_MASK|
+ AUDIO_PORT_CONFIG_FORMAT|AUDIO_PORT_CONFIG_GAIN;
+ if (srcConfig != NULL) {
+ dstConfig->config_mask |= srcConfig->config_mask;
+ }
+ AudioPortConfig::toAudioPortConfig(dstConfig, srcConfig);
+
+ dstConfig->id = mId;
+ dstConfig->role = AUDIO_PORT_ROLE_SOURCE;
+ dstConfig->type = AUDIO_PORT_TYPE_MIX;
+ dstConfig->ext.mix.hw_module = getModuleHandle();
+ dstConfig->ext.mix.usecase.stream = AUDIO_STREAM_DEFAULT;
+}
+
+void AudioOutputDescriptor::toAudioPort(
+ struct audio_port *port) const
+{
+ mPort->toAudioPort(port);
+ port->id = mId;
+ port->ext.mix.hw_module = getModuleHandle();
+}
+
+status_t AudioOutputDescriptor::dump(int fd)
+{
+ const size_t SIZE = 256;
+ char buffer[SIZE];
+ String8 result;
+
+ snprintf(buffer, SIZE, " ID: %d\n", mId);
+ result.append(buffer);
+ snprintf(buffer, SIZE, " Sampling rate: %d\n", mSamplingRate);
+ result.append(buffer);
+ snprintf(buffer, SIZE, " Format: %08x\n", mFormat);
+ result.append(buffer);
+ snprintf(buffer, SIZE, " Channels: %08x\n", mChannelMask);
+ result.append(buffer);
+ snprintf(buffer, SIZE, " Devices %08x\n", device());
+ result.append(buffer);
+ snprintf(buffer, SIZE, " Stream volume refCount muteCount\n");
+ result.append(buffer);
+ for (int i = 0; i < (int)AUDIO_STREAM_CNT; i++) {
+ snprintf(buffer, SIZE, " %02d %.03f %02d %02d\n",
+ i, mCurVolume[i], mRefCount[i], mMuteCount[i]);
+ result.append(buffer);
+ }
+ write(fd, result.string(), result.size());
+
+ return NO_ERROR;
+}
+
+void AudioOutputDescriptor::log(const char* indent)
+{
+ ALOGI("%sID: %d,0x%X, [rt:%d fmt:0x%X ch:0x%X]",
+ indent, mId, mId, mSamplingRate, mFormat, mChannelMask);
+}
+
+// SwAudioOutputDescriptor implementation
+SwAudioOutputDescriptor::SwAudioOutputDescriptor(
+ const sp<IOProfile>& profile, AudioPolicyClientInterface *clientInterface)
+ : AudioOutputDescriptor(profile, clientInterface),
+ mProfile(profile), mIoHandle(0), mLatency(0),
+ mFlags((audio_output_flags_t)0), mPolicyMix(NULL),
+ mOutput1(0), mOutput2(0), mDirectOpenCount(0), mGlobalRefCount(0)
+{
+ if (profile != NULL) {
+ mFlags = (audio_output_flags_t)profile->mFlags;
+ }
+}
+
+void SwAudioOutputDescriptor::setIoHandle(audio_io_handle_t ioHandle)
+{
+ mId = AudioPort::getNextUniqueId();
+ mIoHandle = ioHandle;
+}
+
+
+status_t SwAudioOutputDescriptor::dump(int fd)
+{
+ const size_t SIZE = 256;
+ char buffer[SIZE];
+ String8 result;
+
+ snprintf(buffer, SIZE, " Latency: %d\n", mLatency);
+ result.append(buffer);
+ snprintf(buffer, SIZE, " Flags %08x\n", mFlags);
+ result.append(buffer);
+ write(fd, result.string(), result.size());
+
+ AudioOutputDescriptor::dump(fd);
+
+ return NO_ERROR;
+}
+
+audio_devices_t SwAudioOutputDescriptor::device() const
+{
+ if (isDuplicated()) {
+ return (audio_devices_t)(mOutput1->mDevice | mOutput2->mDevice);
+ } else {
+ return mDevice;
+ }
+}
+
+bool SwAudioOutputDescriptor::sharesHwModuleWith(
+ const sp<AudioOutputDescriptor> outputDesc)
+{
+ if (isDuplicated()) {
+ return mOutput1->sharesHwModuleWith(outputDesc) || mOutput2->sharesHwModuleWith(outputDesc);
+ } else if (outputDesc->isDuplicated()){
+ return sharesHwModuleWith(outputDesc->subOutput1()) ||
+ sharesHwModuleWith(outputDesc->subOutput2());
+ } else {
+ return AudioOutputDescriptor::sharesHwModuleWith(outputDesc);
+ }
+}
+
+audio_devices_t SwAudioOutputDescriptor::supportedDevices()
+{
+ if (isDuplicated()) {
+ return (audio_devices_t)(mOutput1->supportedDevices() | mOutput2->supportedDevices());
+ } else {
+ return mProfile->mSupportedDevices.types() ;
+ }
+}
+
+uint32_t SwAudioOutputDescriptor::latency()
+{
+ if (isDuplicated()) {
+ return (mOutput1->mLatency > mOutput2->mLatency) ? mOutput1->mLatency : mOutput2->mLatency;
+ } else {
+ return mLatency;
+ }
+}
+
+void SwAudioOutputDescriptor::changeRefCount(audio_stream_type_t stream,
+ int delta)
+{
+ // forward usage count change to attached outputs
+ if (isDuplicated()) {
+ mOutput1->changeRefCount(stream, delta);
+ mOutput2->changeRefCount(stream, delta);
+ }
+ AudioOutputDescriptor::changeRefCount(stream, delta);
+
+ // handle stream-independent ref count
+ uint32_t oldGlobalRefCount = mGlobalRefCount;
+ if ((delta + (int)mGlobalRefCount) < 0) {
+ ALOGW("changeRefCount() invalid delta %d globalRefCount %d", delta, mGlobalRefCount);
+ mGlobalRefCount = 0;
+ } else {
+ mGlobalRefCount += delta;
+ }
+ if ((oldGlobalRefCount == 0) && (mGlobalRefCount > 0)) {
+ if ((mPolicyMix != NULL) && ((mPolicyMix->mCbFlags & AudioMix::kCbFlagNotifyActivity) != 0))
+ {
+ mClientInterface->onDynamicPolicyMixStateUpdate(mPolicyMix->mRegistrationId,
+ MIX_STATE_MIXING);
+ }
+
+ } else if ((oldGlobalRefCount > 0) && (mGlobalRefCount == 0)) {
+ if ((mPolicyMix != NULL) && ((mPolicyMix->mCbFlags & AudioMix::kCbFlagNotifyActivity) != 0))
+ {
+ mClientInterface->onDynamicPolicyMixStateUpdate(mPolicyMix->mRegistrationId,
+ MIX_STATE_IDLE);
+ }
+ }
+}
+
+
+bool SwAudioOutputDescriptor::isFixedVolume(audio_devices_t device)
+{
+ // unit gain if rerouting to external policy
+ if (device == AUDIO_DEVICE_OUT_REMOTE_SUBMIX) {
+ if (mPolicyMix != NULL) {
+ ALOGV("max gain when rerouting for output=%d", mIoHandle);
+ return true;
+ }
+ }
+ return false;
+}
+
+void SwAudioOutputDescriptor::toAudioPortConfig(
+ struct audio_port_config *dstConfig,
+ const struct audio_port_config *srcConfig) const
+{
+
+ ALOG_ASSERT(!isDuplicated(), "toAudioPortConfig() called on duplicated output %d", mIoHandle);
+ AudioOutputDescriptor::toAudioPortConfig(dstConfig, srcConfig);
+
+ dstConfig->ext.mix.handle = mIoHandle;
+}
+
+void SwAudioOutputDescriptor::toAudioPort(
+ struct audio_port *port) const
+{
+ ALOG_ASSERT(!isDuplicated(), "toAudioPort() called on duplicated output %d", mIoHandle);
+
+ AudioOutputDescriptor::toAudioPort(port);
+
+ toAudioPortConfig(&port->active_config);
+ port->ext.mix.handle = mIoHandle;
+ port->ext.mix.latency_class =
+ mFlags & AUDIO_OUTPUT_FLAG_FAST ? AUDIO_LATENCY_LOW : AUDIO_LATENCY_NORMAL;
+}
+
+bool SwAudioOutputDescriptor::setVolume(float volume,
+ audio_stream_type_t stream,
+ audio_devices_t device,
+ uint32_t delayMs,
+ bool force)
+{
+ bool changed = AudioOutputDescriptor::setVolume(volume, stream, device, delayMs, force);
+
+ if (changed) {
+ // Force VOICE_CALL to track BLUETOOTH_SCO stream volume when bluetooth audio is
+ // enabled
+ float volume = Volume::DbToAmpl(mCurVolume[stream]);
+ if (stream == AUDIO_STREAM_BLUETOOTH_SCO) {
+ mClientInterface->setStreamVolume(
+ AUDIO_STREAM_VOICE_CALL, volume, mIoHandle, delayMs);
+ }
+ mClientInterface->setStreamVolume(stream, volume, mIoHandle, delayMs);
+ }
+ return changed;
+}
+
+// SwAudioOutputCollection implementation
+
+bool SwAudioOutputCollection::isStreamActive(audio_stream_type_t stream, uint32_t inPastMs) const
+{
+ nsecs_t sysTime = systemTime();
+ for (size_t i = 0; i < this->size(); i++) {
+ const sp<SwAudioOutputDescriptor> outputDesc = this->valueAt(i);
+ if (outputDesc->isStreamActive(stream, inPastMs, sysTime)) {
+ return true;
+ }
+ }
+ return false;
+}
+
+bool SwAudioOutputCollection::isStreamActiveRemotely(audio_stream_type_t stream,
+ uint32_t inPastMs) const
+{
+ nsecs_t sysTime = systemTime();
+ for (size_t i = 0; i < size(); i++) {
+ const sp<SwAudioOutputDescriptor> outputDesc = valueAt(i);
+ if (((outputDesc->device() & APM_AUDIO_OUT_DEVICE_REMOTE_ALL) != 0) &&
+ outputDesc->isStreamActive(stream, inPastMs, sysTime)) {
+ // do not consider re routing (when the output is going to a dynamic policy)
+ // as "remote playback"
+ if (outputDesc->mPolicyMix == NULL) {
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+audio_io_handle_t SwAudioOutputCollection::getA2dpOutput() const
+{
+ for (size_t i = 0; i < size(); i++) {
+ sp<SwAudioOutputDescriptor> outputDesc = valueAt(i);
+ if (!outputDesc->isDuplicated() && outputDesc->device() & AUDIO_DEVICE_OUT_ALL_A2DP) {
+ return this->keyAt(i);
+ }
+ }
+ return 0;
+}
+
+sp<SwAudioOutputDescriptor> SwAudioOutputCollection::getPrimaryOutput() const
+{
+ for (size_t i = 0; i < size(); i++) {
+ const sp<SwAudioOutputDescriptor> outputDesc = valueAt(i);
+ if (outputDesc->mFlags & AUDIO_OUTPUT_FLAG_PRIMARY) {
+ return outputDesc;
+ }
+ }
+ return NULL;
+}
+
+sp<SwAudioOutputDescriptor> SwAudioOutputCollection::getOutputFromId(audio_port_handle_t id) const
+{
+ sp<SwAudioOutputDescriptor> outputDesc = NULL;
+ for (size_t i = 0; i < size(); i++) {
+ outputDesc = valueAt(i);
+ if (outputDesc->getId() == id) {
+ break;
+ }
+ }
+ return outputDesc;
+}
+
+bool SwAudioOutputCollection::isAnyOutputActive(audio_stream_type_t streamToIgnore) const
+{
+ for (size_t s = 0 ; s < AUDIO_STREAM_CNT ; s++) {
+ if (s == (size_t) streamToIgnore) {
+ continue;
+ }
+ for (size_t i = 0; i < size(); i++) {
+ const sp<SwAudioOutputDescriptor> outputDesc = valueAt(i);
+ if (outputDesc->mRefCount[s] != 0) {
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+audio_devices_t SwAudioOutputCollection::getSupportedDevices(audio_io_handle_t handle) const
+{
+ sp<SwAudioOutputDescriptor> outputDesc = valueFor(handle);
+ audio_devices_t devices = outputDesc->mProfile->mSupportedDevices.types();
+ return devices;
+}
+
+
+status_t SwAudioOutputCollection::dump(int fd) const
+{
+ const size_t SIZE = 256;
+ char buffer[SIZE];
+
+ snprintf(buffer, SIZE, "\nOutputs dump:\n");
+ write(fd, buffer, strlen(buffer));
+ for (size_t i = 0; i < size(); i++) {
+ snprintf(buffer, SIZE, "- Output %d dump:\n", keyAt(i));
+ write(fd, buffer, strlen(buffer));
+ valueAt(i)->dump(fd);
+ }
+
+ return NO_ERROR;
+}
+
+}; //namespace android
diff --git a/services/audiopolicy/common/managerdefinitions/src/AudioPatch.cpp b/services/audiopolicy/common/managerdefinitions/src/AudioPatch.cpp
new file mode 100644
index 0000000..a06d867
--- /dev/null
+++ b/services/audiopolicy/common/managerdefinitions/src/AudioPatch.cpp
@@ -0,0 +1,154 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "APM::AudioPatch"
+//#define LOG_NDEBUG 0
+
+#include "AudioPatch.h"
+#include "AudioGain.h"
+#include "ConfigParsingUtils.h"
+#include <cutils/log.h>
+#include <utils/String8.h>
+
+namespace android {
+
+int32_t volatile AudioPatch::mNextUniqueId = 1;
+
+AudioPatch::AudioPatch(const struct audio_patch *patch, uid_t uid) :
+ mHandle(static_cast<audio_patch_handle_t>(android_atomic_inc(&mNextUniqueId))),
+ mPatch(*patch),
+ mUid(uid),
+ mAfPatchHandle(0)
+{
+}
+
+status_t AudioPatch::dump(int fd, int spaces, int index) const
+{
+ const size_t SIZE = 256;
+ char buffer[SIZE];
+ String8 result;
+
+ snprintf(buffer, SIZE, "%*sAudio patch %d:\n", spaces, "", index+1);
+ result.append(buffer);
+ snprintf(buffer, SIZE, "%*s- handle: %2d\n", spaces, "", mHandle);
+ result.append(buffer);
+ snprintf(buffer, SIZE, "%*s- audio flinger handle: %2d\n", spaces, "", mAfPatchHandle);
+ result.append(buffer);
+ snprintf(buffer, SIZE, "%*s- owner uid: %2d\n", spaces, "", mUid);
+ result.append(buffer);
+ snprintf(buffer, SIZE, "%*s- %d sources:\n", spaces, "", mPatch.num_sources);
+ result.append(buffer);
+ for (size_t i = 0; i < mPatch.num_sources; i++) {
+ if (mPatch.sources[i].type == AUDIO_PORT_TYPE_DEVICE) {
+ snprintf(buffer, SIZE, "%*s- Device ID %d %s\n", spaces + 2, "",
+ mPatch.sources[i].id, ConfigParsingUtils::enumToString(sDeviceTypeToEnumTable,
+ ARRAY_SIZE(sDeviceTypeToEnumTable),
+ mPatch.sources[i].ext.device.type));
+ } else {
+ snprintf(buffer, SIZE, "%*s- Mix ID %d I/O handle %d\n", spaces + 2, "",
+ mPatch.sources[i].id, mPatch.sources[i].ext.mix.handle);
+ }
+ result.append(buffer);
+ }
+ snprintf(buffer, SIZE, "%*s- %d sinks:\n", spaces, "", mPatch.num_sinks);
+ result.append(buffer);
+ for (size_t i = 0; i < mPatch.num_sinks; i++) {
+ if (mPatch.sinks[i].type == AUDIO_PORT_TYPE_DEVICE) {
+ snprintf(buffer, SIZE, "%*s- Device ID %d %s\n", spaces + 2, "",
+ mPatch.sinks[i].id, ConfigParsingUtils::enumToString(sDeviceTypeToEnumTable,
+ ARRAY_SIZE(sDeviceTypeToEnumTable),
+ mPatch.sinks[i].ext.device.type));
+ } else {
+ snprintf(buffer, SIZE, "%*s- Mix ID %d I/O handle %d\n", spaces + 2, "",
+ mPatch.sinks[i].id, mPatch.sinks[i].ext.mix.handle);
+ }
+ result.append(buffer);
+ }
+
+ write(fd, result.string(), result.size());
+ return NO_ERROR;
+}
+
+status_t AudioPatchCollection::addAudioPatch(audio_patch_handle_t handle,
+ const sp<AudioPatch>& patch)
+{
+ ssize_t index = indexOfKey(handle);
+
+ if (index >= 0) {
+ ALOGW("addAudioPatch() patch %d already in", handle);
+ return ALREADY_EXISTS;
+ }
+ add(handle, patch);
+ ALOGV("addAudioPatch() handle %d af handle %d num_sources %d num_sinks %d source handle %d"
+ "sink handle %d",
+ handle, patch->mAfPatchHandle, patch->mPatch.num_sources, patch->mPatch.num_sinks,
+ patch->mPatch.sources[0].id, patch->mPatch.sinks[0].id);
+ return NO_ERROR;
+}
+
+status_t AudioPatchCollection::removeAudioPatch(audio_patch_handle_t handle)
+{
+ ssize_t index = indexOfKey(handle);
+
+ if (index < 0) {
+ ALOGW("removeAudioPatch() patch %d not in", handle);
+ return ALREADY_EXISTS;
+ }
+ ALOGV("removeAudioPatch() handle %d af handle %d", handle, valueAt(index)->mAfPatchHandle);
+ removeItemsAt(index);
+ return NO_ERROR;
+}
+
+status_t AudioPatchCollection::listAudioPatches(unsigned int *num_patches,
+ struct audio_patch *patches) const
+{
+ if (num_patches == NULL || (*num_patches != 0 && patches == NULL)) {
+ return BAD_VALUE;
+ }
+ ALOGV("listAudioPatches() num_patches %d patches %p available patches %zu",
+ *num_patches, patches, size());
+ if (patches == NULL) {
+ *num_patches = 0;
+ }
+
+ size_t patchesWritten = 0;
+ size_t patchesMax = *num_patches;
+ for (size_t i = 0; i < size() && patchesWritten < patchesMax; i++) {
+ const sp<AudioPatch> patch = valueAt(i);
+ patches[patchesWritten] = patch->mPatch;
+ patches[patchesWritten++].id = patch->mHandle;
+ ALOGV("listAudioPatches() patch %zu num_sources %d num_sinks %d",
+ i, patch->mPatch.num_sources, patch->mPatch.num_sinks);
+ }
+ *num_patches = size();
+
+ ALOGV("listAudioPatches() got %zu patches needed %d", patchesWritten, *num_patches);
+ return NO_ERROR;
+}
+
+status_t AudioPatchCollection::dump(int fd) const
+{
+ const size_t SIZE = 256;
+ char buffer[SIZE];
+ snprintf(buffer, SIZE, "\nAudio Patches:\n");
+ write(fd, buffer, strlen(buffer));
+ for (size_t i = 0; i < size(); i++) {
+ valueAt(i)->dump(fd, 2, i);
+ }
+ return NO_ERROR;
+}
+
+}; // namespace android
diff --git a/services/audiopolicy/common/managerdefinitions/src/AudioPolicyMix.cpp b/services/audiopolicy/common/managerdefinitions/src/AudioPolicyMix.cpp
new file mode 100644
index 0000000..6f1998c
--- /dev/null
+++ b/services/audiopolicy/common/managerdefinitions/src/AudioPolicyMix.cpp
@@ -0,0 +1,193 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "APM::AudioPolicyMix"
+//#define LOG_NDEBUG 0
+
+#include "AudioPolicyMix.h"
+#include "HwModule.h"
+#include "AudioPort.h"
+#include "IOProfile.h"
+#include "AudioGain.h"
+#include <AudioOutputDescriptor.h>
+
+namespace android {
+
+void AudioPolicyMix::setOutput(sp<SwAudioOutputDescriptor> &output)
+{
+ mOutput = output;
+}
+
+const sp<SwAudioOutputDescriptor> &AudioPolicyMix::getOutput() const
+{
+ return mOutput;
+}
+
+void AudioPolicyMix::clearOutput()
+{
+ mOutput.clear();
+}
+
+void AudioPolicyMix::setMix(AudioMix &mix)
+{
+ mMix = mix;
+}
+
+android::AudioMix *AudioPolicyMix::getMix()
+{
+ return &mMix;
+}
+
+status_t AudioPolicyMixCollection::registerMix(String8 address, AudioMix mix)
+{
+ ssize_t index = indexOfKey(address);
+ if (index >= 0) {
+ ALOGE("registerPolicyMixes(): mix for address %s already registered", address.string());
+ return BAD_VALUE;
+ }
+ sp<AudioPolicyMix> policyMix = new AudioPolicyMix();
+ policyMix->setMix(mix);
+ add(address, policyMix);
+ return NO_ERROR;
+}
+
+status_t AudioPolicyMixCollection::unregisterMix(String8 address)
+{
+ ssize_t index = indexOfKey(address);
+ if (index < 0) {
+ ALOGE("unregisterPolicyMixes(): mix for address %s not registered", address.string());
+ return BAD_VALUE;
+ }
+
+ removeItemsAt(index);
+ return NO_ERROR;
+}
+
+status_t AudioPolicyMixCollection::getAudioPolicyMix(String8 address,
+ sp<AudioPolicyMix> &policyMix) const
+{
+ ssize_t index = indexOfKey(address);
+ if (index < 0) {
+ ALOGE("unregisterPolicyMixes(): mix for address %s not registered", address.string());
+ return BAD_VALUE;
+ }
+ policyMix = valueAt(index);
+ return NO_ERROR;
+}
+
+void AudioPolicyMixCollection::closeOutput(sp<SwAudioOutputDescriptor> &desc)
+{
+ for (size_t i = 0; i < size(); i++) {
+ sp<AudioPolicyMix> policyMix = valueAt(i);
+ if (policyMix->getOutput() == desc) {
+ policyMix->clearOutput();
+ }
+ }
+}
+
+status_t AudioPolicyMixCollection::getOutputForAttr(audio_attributes_t attributes,
+ sp<SwAudioOutputDescriptor> &desc)
+{
+ for (size_t i = 0; i < size(); i++) {
+ sp<AudioPolicyMix> policyMix = valueAt(i);
+ AudioMix *mix = policyMix->getMix();
+
+ if (mix->mMixType == MIX_TYPE_PLAYERS) {
+ for (size_t j = 0; j < mix->mCriteria.size(); j++) {
+ if ((RULE_MATCH_ATTRIBUTE_USAGE == mix->mCriteria[j].mRule &&
+ mix->mCriteria[j].mAttr.mUsage == attributes.usage) ||
+ (RULE_EXCLUDE_ATTRIBUTE_USAGE == mix->mCriteria[j].mRule &&
+ mix->mCriteria[j].mAttr.mUsage != attributes.usage)) {
+ desc = policyMix->getOutput();
+ break;
+ }
+ if (strncmp(attributes.tags, "addr=", strlen("addr=")) == 0 &&
+ strncmp(attributes.tags + strlen("addr="),
+ mix->mRegistrationId.string(),
+ AUDIO_ATTRIBUTES_TAGS_MAX_SIZE - strlen("addr=") - 1) == 0) {
+ desc = policyMix->getOutput();
+ break;
+ }
+ }
+ } else if (mix->mMixType == MIX_TYPE_RECORDERS) {
+ if (attributes.usage == AUDIO_USAGE_VIRTUAL_SOURCE &&
+ strncmp(attributes.tags, "addr=", strlen("addr=")) == 0 &&
+ strncmp(attributes.tags + strlen("addr="),
+ mix->mRegistrationId.string(),
+ AUDIO_ATTRIBUTES_TAGS_MAX_SIZE - strlen("addr=") - 1) == 0) {
+ desc = policyMix->getOutput();
+ }
+ }
+ if (desc != 0) {
+ desc->mPolicyMix = mix;
+ return NO_ERROR;
+ }
+ }
+ return BAD_VALUE;
+}
+
+audio_devices_t AudioPolicyMixCollection::getDeviceAndMixForInputSource(audio_source_t inputSource,
+ audio_devices_t availDevices,
+ AudioMix **policyMix)
+{
+ for (size_t i = 0; i < size(); i++) {
+ AudioMix *mix = valueAt(i)->getMix();
+
+ if (mix->mMixType != MIX_TYPE_RECORDERS) {
+ continue;
+ }
+ for (size_t j = 0; j < mix->mCriteria.size(); j++) {
+ if ((RULE_MATCH_ATTRIBUTE_CAPTURE_PRESET == mix->mCriteria[j].mRule &&
+ mix->mCriteria[j].mAttr.mSource == inputSource) ||
+ (RULE_EXCLUDE_ATTRIBUTE_CAPTURE_PRESET == mix->mCriteria[j].mRule &&
+ mix->mCriteria[j].mAttr.mSource != inputSource)) {
+ if (availDevices & AUDIO_DEVICE_IN_REMOTE_SUBMIX) {
+ if (policyMix != NULL) {
+ *policyMix = mix;
+ }
+ return AUDIO_DEVICE_IN_REMOTE_SUBMIX;
+ }
+ break;
+ }
+ }
+ }
+ return AUDIO_DEVICE_NONE;
+}
+
+status_t AudioPolicyMixCollection::getInputMixForAttr(audio_attributes_t attr, AudioMix **policyMix)
+{
+ if (strncmp(attr.tags, "addr=", strlen("addr=")) != 0) {
+ return BAD_VALUE;
+ }
+ String8 address(attr.tags + strlen("addr="));
+
+ ssize_t index = indexOfKey(address);
+ if (index < 0) {
+ ALOGW("getInputMixForAttr() no policy for address %s", address.string());
+ return BAD_VALUE;
+ }
+ sp<AudioPolicyMix> audioPolicyMix = valueAt(index);
+ AudioMix *mix = audioPolicyMix->getMix();
+
+ if (mix->mMixType != MIX_TYPE_PLAYERS) {
+ ALOGW("getInputMixForAttr() bad policy mix type for address %s", address.string());
+ return BAD_VALUE;
+ }
+ *policyMix = mix;
+ return NO_ERROR;
+}
+
+}; //namespace android
diff --git a/services/audiopolicy/common/managerdefinitions/src/AudioPort.cpp b/services/audiopolicy/common/managerdefinitions/src/AudioPort.cpp
new file mode 100644
index 0000000..4e24f19
--- /dev/null
+++ b/services/audiopolicy/common/managerdefinitions/src/AudioPort.cpp
@@ -0,0 +1,929 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "APM::AudioPort"
+//#define LOG_NDEBUG 0
+#include <media/AudioResamplerPublic.h>
+#include "AudioPort.h"
+#include "HwModule.h"
+#include "AudioGain.h"
+#include "ConfigParsingUtils.h"
+#include "audio_policy_conf.h"
+#include <policy.h>
+
+namespace android {
+
+int32_t volatile AudioPort::mNextUniqueId = 1;
+
+// --- AudioPort class implementation
+
+AudioPort::AudioPort(const String8& name, audio_port_type_t type,
+ audio_port_role_t role) :
+ mName(name), mType(type), mRole(role), mFlags(0)
+{
+ mUseInChannelMask = ((type == AUDIO_PORT_TYPE_DEVICE) && (role == AUDIO_PORT_ROLE_SOURCE)) ||
+ ((type == AUDIO_PORT_TYPE_MIX) && (role == AUDIO_PORT_ROLE_SINK));
+}
+
+void AudioPort::attach(const sp<HwModule>& module)
+{
+ mModule = module;
+}
+
+audio_port_handle_t AudioPort::getNextUniqueId()
+{
+ return static_cast<audio_port_handle_t>(android_atomic_inc(&mNextUniqueId));
+}
+
+audio_module_handle_t AudioPort::getModuleHandle() const
+{
+ if (mModule == 0) {
+ return 0;
+ }
+ return mModule->mHandle;
+}
+
+uint32_t AudioPort::getModuleVersion() const
+{
+ if (mModule == 0) {
+ return 0;
+ }
+ return mModule->mHalVersion;
+}
+
+const char *AudioPort::getModuleName() const
+{
+ if (mModule == 0) {
+ return "";
+ }
+ return mModule->mName;
+}
+
+void AudioPort::toAudioPort(struct audio_port *port) const
+{
+ port->role = mRole;
+ port->type = mType;
+ strlcpy(port->name, mName, AUDIO_PORT_MAX_NAME_LEN);
+ unsigned int i;
+ for (i = 0; i < mSamplingRates.size() && i < AUDIO_PORT_MAX_SAMPLING_RATES; i++) {
+ if (mSamplingRates[i] != 0) {
+ port->sample_rates[i] = mSamplingRates[i];
+ }
+ }
+ port->num_sample_rates = i;
+ for (i = 0; i < mChannelMasks.size() && i < AUDIO_PORT_MAX_CHANNEL_MASKS; i++) {
+ if (mChannelMasks[i] != 0) {
+ port->channel_masks[i] = mChannelMasks[i];
+ }
+ }
+ port->num_channel_masks = i;
+ for (i = 0; i < mFormats.size() && i < AUDIO_PORT_MAX_FORMATS; i++) {
+ if (mFormats[i] != 0) {
+ port->formats[i] = mFormats[i];
+ }
+ }
+ port->num_formats = i;
+
+ ALOGV("AudioPort::toAudioPort() num gains %zu", mGains.size());
+
+ for (i = 0; i < mGains.size() && i < AUDIO_PORT_MAX_GAINS; i++) {
+ port->gains[i] = mGains[i]->mGain;
+ }
+ port->num_gains = i;
+}
+
+void AudioPort::importAudioPort(const sp<AudioPort> port) {
+ for (size_t k = 0 ; k < port->mSamplingRates.size() ; k++) {
+ const uint32_t rate = port->mSamplingRates.itemAt(k);
+ if (rate != 0) { // skip "dynamic" rates
+ bool hasRate = false;
+ for (size_t l = 0 ; l < mSamplingRates.size() ; l++) {
+ if (rate == mSamplingRates.itemAt(l)) {
+ hasRate = true;
+ break;
+ }
+ }
+ if (!hasRate) { // never import a sampling rate twice
+ mSamplingRates.add(rate);
+ }
+ }
+ }
+ for (size_t k = 0 ; k < port->mChannelMasks.size() ; k++) {
+ const audio_channel_mask_t mask = port->mChannelMasks.itemAt(k);
+ if (mask != 0) { // skip "dynamic" masks
+ bool hasMask = false;
+ for (size_t l = 0 ; l < mChannelMasks.size() ; l++) {
+ if (mask == mChannelMasks.itemAt(l)) {
+ hasMask = true;
+ break;
+ }
+ }
+ if (!hasMask) { // never import a channel mask twice
+ mChannelMasks.add(mask);
+ }
+ }
+ }
+ for (size_t k = 0 ; k < port->mFormats.size() ; k++) {
+ const audio_format_t format = port->mFormats.itemAt(k);
+ if (format != 0) { // skip "dynamic" formats
+ bool hasFormat = false;
+ for (size_t l = 0 ; l < mFormats.size() ; l++) {
+ if (format == mFormats.itemAt(l)) {
+ hasFormat = true;
+ break;
+ }
+ }
+ if (!hasFormat) { // never import a format twice
+ mFormats.add(format);
+ }
+ }
+ }
+}
+
+void AudioPort::clearCapabilities() {
+ mChannelMasks.clear();
+ mFormats.clear();
+ mSamplingRates.clear();
+}
+
+void AudioPort::loadSamplingRates(char *name)
+{
+ char *str = strtok(name, "|");
+
+ // by convention, "0' in the first entry in mSamplingRates indicates the supported sampling
+ // rates should be read from the output stream after it is opened for the first time
+ if (str != NULL && strcmp(str, DYNAMIC_VALUE_TAG) == 0) {
+ mSamplingRates.add(0);
+ return;
+ }
+
+ while (str != NULL) {
+ uint32_t rate = atoi(str);
+ if (rate != 0) {
+ ALOGV("loadSamplingRates() adding rate %d", rate);
+ mSamplingRates.add(rate);
+ }
+ str = strtok(NULL, "|");
+ }
+}
+
+void AudioPort::loadFormats(char *name)
+{
+ char *str = strtok(name, "|");
+
+ // by convention, "0' in the first entry in mFormats indicates the supported formats
+ // should be read from the output stream after it is opened for the first time
+ if (str != NULL && strcmp(str, DYNAMIC_VALUE_TAG) == 0) {
+ mFormats.add(AUDIO_FORMAT_DEFAULT);
+ return;
+ }
+
+ while (str != NULL) {
+ audio_format_t format = (audio_format_t)ConfigParsingUtils::stringToEnum(sFormatNameToEnumTable,
+ ARRAY_SIZE(sFormatNameToEnumTable),
+ str);
+ if (format != AUDIO_FORMAT_DEFAULT) {
+ mFormats.add(format);
+ }
+ str = strtok(NULL, "|");
+ }
+ // we sort from worst to best, so that AUDIO_FORMAT_DEFAULT is always the first entry.
+ // TODO: compareFormats could be a lambda to convert between pointer-to-format to format:
+ // [](const audio_format_t *format1, const audio_format_t *format2) {
+ // return compareFormats(*format1, *format2);
+ // }
+ mFormats.sort(compareFormats);
+}
+
+void AudioPort::loadInChannels(char *name)
+{
+ const char *str = strtok(name, "|");
+
+ ALOGV("loadInChannels() %s", name);
+
+ if (str != NULL && strcmp(str, DYNAMIC_VALUE_TAG) == 0) {
+ mChannelMasks.add(0);
+ return;
+ }
+
+ while (str != NULL) {
+ audio_channel_mask_t channelMask =
+ (audio_channel_mask_t)ConfigParsingUtils::stringToEnum(sInChannelsNameToEnumTable,
+ ARRAY_SIZE(sInChannelsNameToEnumTable),
+ str);
+ if (channelMask == 0) { // if not found, check the channel index table
+ channelMask = (audio_channel_mask_t)
+ ConfigParsingUtils::stringToEnum(sIndexChannelsNameToEnumTable,
+ ARRAY_SIZE(sIndexChannelsNameToEnumTable),
+ str);
+ }
+ if (channelMask != 0) {
+ ALOGV("loadInChannels() adding channelMask %#x", channelMask);
+ mChannelMasks.add(channelMask);
+ }
+ str = strtok(NULL, "|");
+ }
+}
+
+void AudioPort::loadOutChannels(char *name)
+{
+ const char *str = strtok(name, "|");
+
+ ALOGV("loadOutChannels() %s", name);
+
+ // by convention, "0' in the first entry in mChannelMasks indicates the supported channel
+ // masks should be read from the output stream after it is opened for the first time
+ if (str != NULL && strcmp(str, DYNAMIC_VALUE_TAG) == 0) {
+ mChannelMasks.add(0);
+ return;
+ }
+
+ while (str != NULL) {
+ audio_channel_mask_t channelMask =
+ (audio_channel_mask_t)ConfigParsingUtils::stringToEnum(sOutChannelsNameToEnumTable,
+ ARRAY_SIZE(sOutChannelsNameToEnumTable),
+ str);
+ if (channelMask == 0) { // if not found, check the channel index table
+ channelMask = (audio_channel_mask_t)
+ ConfigParsingUtils::stringToEnum(sIndexChannelsNameToEnumTable,
+ ARRAY_SIZE(sIndexChannelsNameToEnumTable),
+ str);
+ }
+ if (channelMask != 0) {
+ mChannelMasks.add(channelMask);
+ }
+ str = strtok(NULL, "|");
+ }
+ return;
+}
+
+audio_gain_mode_t AudioPort::loadGainMode(char *name)
+{
+ const char *str = strtok(name, "|");
+
+ ALOGV("loadGainMode() %s", name);
+ audio_gain_mode_t mode = 0;
+ while (str != NULL) {
+ mode |= (audio_gain_mode_t)ConfigParsingUtils::stringToEnum(sGainModeNameToEnumTable,
+ ARRAY_SIZE(sGainModeNameToEnumTable),
+ str);
+ str = strtok(NULL, "|");
+ }
+ return mode;
+}
+
+void AudioPort::loadGain(cnode *root, int index)
+{
+ cnode *node = root->first_child;
+
+ sp<AudioGain> gain = new AudioGain(index, mUseInChannelMask);
+
+ while (node) {
+ if (strcmp(node->name, GAIN_MODE) == 0) {
+ gain->mGain.mode = loadGainMode((char *)node->value);
+ } else if (strcmp(node->name, GAIN_CHANNELS) == 0) {
+ if (mUseInChannelMask) {
+ gain->mGain.channel_mask =
+ (audio_channel_mask_t)ConfigParsingUtils::stringToEnum(sInChannelsNameToEnumTable,
+ ARRAY_SIZE(sInChannelsNameToEnumTable),
+ (char *)node->value);
+ } else {
+ gain->mGain.channel_mask =
+ (audio_channel_mask_t)ConfigParsingUtils::stringToEnum(sOutChannelsNameToEnumTable,
+ ARRAY_SIZE(sOutChannelsNameToEnumTable),
+ (char *)node->value);
+ }
+ } else if (strcmp(node->name, GAIN_MIN_VALUE) == 0) {
+ gain->mGain.min_value = atoi((char *)node->value);
+ } else if (strcmp(node->name, GAIN_MAX_VALUE) == 0) {
+ gain->mGain.max_value = atoi((char *)node->value);
+ } else if (strcmp(node->name, GAIN_DEFAULT_VALUE) == 0) {
+ gain->mGain.default_value = atoi((char *)node->value);
+ } else if (strcmp(node->name, GAIN_STEP_VALUE) == 0) {
+ gain->mGain.step_value = atoi((char *)node->value);
+ } else if (strcmp(node->name, GAIN_MIN_RAMP_MS) == 0) {
+ gain->mGain.min_ramp_ms = atoi((char *)node->value);
+ } else if (strcmp(node->name, GAIN_MAX_RAMP_MS) == 0) {
+ gain->mGain.max_ramp_ms = atoi((char *)node->value);
+ }
+ node = node->next;
+ }
+
+ ALOGV("loadGain() adding new gain mode %08x channel mask %08x min mB %d max mB %d",
+ gain->mGain.mode, gain->mGain.channel_mask, gain->mGain.min_value, gain->mGain.max_value);
+
+ if (gain->mGain.mode == 0) {
+ return;
+ }
+ mGains.add(gain);
+}
+
+void AudioPort::loadGains(cnode *root)
+{
+ cnode *node = root->first_child;
+ int index = 0;
+ while (node) {
+ ALOGV("loadGains() loading gain %s", node->name);
+ loadGain(node, index++);
+ node = node->next;
+ }
+}
+
+status_t AudioPort::checkExactSamplingRate(uint32_t samplingRate) const
+{
+ if (mSamplingRates.isEmpty()) {
+ return NO_ERROR;
+ }
+
+ for (size_t i = 0; i < mSamplingRates.size(); i ++) {
+ if (mSamplingRates[i] == samplingRate) {
+ return NO_ERROR;
+ }
+ }
+ return BAD_VALUE;
+}
+
+status_t AudioPort::checkCompatibleSamplingRate(uint32_t samplingRate,
+ uint32_t *updatedSamplingRate) const
+{
+ if (mSamplingRates.isEmpty()) {
+ if (updatedSamplingRate != NULL) {
+ *updatedSamplingRate = samplingRate;
+ }
+ return NO_ERROR;
+ }
+
+ // Search for the closest supported sampling rate that is above (preferred)
+ // or below (acceptable) the desired sampling rate, within a permitted ratio.
+ // The sampling rates do not need to be sorted in ascending order.
+ ssize_t maxBelow = -1;
+ ssize_t minAbove = -1;
+ uint32_t candidate;
+ for (size_t i = 0; i < mSamplingRates.size(); i++) {
+ candidate = mSamplingRates[i];
+ if (candidate == samplingRate) {
+ if (updatedSamplingRate != NULL) {
+ *updatedSamplingRate = candidate;
+ }
+ return NO_ERROR;
+ }
+ // candidate < desired
+ if (candidate < samplingRate) {
+ if (maxBelow < 0 || candidate > mSamplingRates[maxBelow]) {
+ maxBelow = i;
+ }
+ // candidate > desired
+ } else {
+ if (minAbove < 0 || candidate < mSamplingRates[minAbove]) {
+ minAbove = i;
+ }
+ }
+ }
+
+ // Prefer to down-sample from a higher sampling rate, as we get the desired frequency spectrum.
+ if (minAbove >= 0) {
+ candidate = mSamplingRates[minAbove];
+ if (candidate / AUDIO_RESAMPLER_DOWN_RATIO_MAX <= samplingRate) {
+ if (updatedSamplingRate != NULL) {
+ *updatedSamplingRate = candidate;
+ }
+ return NO_ERROR;
+ }
+ }
+ // But if we have to up-sample from a lower sampling rate, that's OK.
+ if (maxBelow >= 0) {
+ candidate = mSamplingRates[maxBelow];
+ if (candidate * AUDIO_RESAMPLER_UP_RATIO_MAX >= samplingRate) {
+ if (updatedSamplingRate != NULL) {
+ *updatedSamplingRate = candidate;
+ }
+ return NO_ERROR;
+ }
+ }
+ // leave updatedSamplingRate unmodified
+ return BAD_VALUE;
+}
+
+status_t AudioPort::checkExactChannelMask(audio_channel_mask_t channelMask) const
+{
+ if (mChannelMasks.isEmpty()) {
+ return NO_ERROR;
+ }
+
+ for (size_t i = 0; i < mChannelMasks.size(); i++) {
+ if (mChannelMasks[i] == channelMask) {
+ return NO_ERROR;
+ }
+ }
+ return BAD_VALUE;
+}
+
+status_t AudioPort::checkCompatibleChannelMask(audio_channel_mask_t channelMask,
+ audio_channel_mask_t *updatedChannelMask) const
+{
+ if (mChannelMasks.isEmpty()) {
+ if (updatedChannelMask != NULL) {
+ *updatedChannelMask = channelMask;
+ }
+ return NO_ERROR;
+ }
+
+ const bool isRecordThread = mType == AUDIO_PORT_TYPE_MIX && mRole == AUDIO_PORT_ROLE_SINK;
+ const bool isIndex = audio_channel_mask_get_representation(channelMask)
+ == AUDIO_CHANNEL_REPRESENTATION_INDEX;
+ int bestMatch = 0;
+ for (size_t i = 0; i < mChannelMasks.size(); i ++) {
+ audio_channel_mask_t supported = mChannelMasks[i];
+ if (supported == channelMask) {
+ // Exact matches always taken.
+ if (updatedChannelMask != NULL) {
+ *updatedChannelMask = channelMask;
+ }
+ return NO_ERROR;
+ }
+
+ // AUDIO_CHANNEL_NONE (value: 0) is used for dynamic channel support
+ if (isRecordThread && supported != AUDIO_CHANNEL_NONE) {
+ // Approximate (best) match:
+ // The match score measures how well the supported channel mask matches the
+ // desired mask, where increasing-is-better.
+ //
+ // TODO: Some tweaks may be needed.
+ // Should be a static function of the data processing library.
+ //
+ // In priority:
+ // match score = 1000 if legacy channel conversion equivalent (always prefer this)
+ // OR
+ // match score += 100 if the channel mask representations match
+ // match score += number of channels matched.
+ //
+ // If there are no matched channels, the mask may still be accepted
+ // but the playback or record will be silent.
+ const bool isSupportedIndex = (audio_channel_mask_get_representation(supported)
+ == AUDIO_CHANNEL_REPRESENTATION_INDEX);
+ int match;
+ if (isIndex && isSupportedIndex) {
+ // index equivalence
+ match = 100 + __builtin_popcount(
+ audio_channel_mask_get_bits(channelMask)
+ & audio_channel_mask_get_bits(supported));
+ } else if (isIndex && !isSupportedIndex) {
+ const uint32_t equivalentBits =
+ (1 << audio_channel_count_from_in_mask(supported)) - 1 ;
+ match = __builtin_popcount(
+ audio_channel_mask_get_bits(channelMask) & equivalentBits);
+ } else if (!isIndex && isSupportedIndex) {
+ const uint32_t equivalentBits =
+ (1 << audio_channel_count_from_in_mask(channelMask)) - 1;
+ match = __builtin_popcount(
+ equivalentBits & audio_channel_mask_get_bits(supported));
+ } else {
+ // positional equivalence
+ match = 100 + __builtin_popcount(
+ audio_channel_mask_get_bits(channelMask)
+ & audio_channel_mask_get_bits(supported));
+ switch (supported) {
+ case AUDIO_CHANNEL_IN_FRONT_BACK:
+ case AUDIO_CHANNEL_IN_STEREO:
+ if (channelMask == AUDIO_CHANNEL_IN_MONO) {
+ match = 1000;
+ }
+ break;
+ case AUDIO_CHANNEL_IN_MONO:
+ if (channelMask == AUDIO_CHANNEL_IN_FRONT_BACK
+ || channelMask == AUDIO_CHANNEL_IN_STEREO) {
+ match = 1000;
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ if (match > bestMatch) {
+ bestMatch = match;
+ if (updatedChannelMask != NULL) {
+ *updatedChannelMask = supported;
+ } else {
+ return NO_ERROR; // any match will do in this case.
+ }
+ }
+ }
+ }
+ return bestMatch > 0 ? NO_ERROR : BAD_VALUE;
+}
+
+status_t AudioPort::checkExactFormat(audio_format_t format) const
+{
+ if (mFormats.isEmpty()) {
+ return NO_ERROR;
+ }
+
+ for (size_t i = 0; i < mFormats.size(); i ++) {
+ if (mFormats[i] == format) {
+ return NO_ERROR;
+ }
+ }
+ return BAD_VALUE;
+}
+
+status_t AudioPort::checkCompatibleFormat(audio_format_t format, audio_format_t *updatedFormat)
+ const
+{
+ if (mFormats.isEmpty()) {
+ if (updatedFormat != NULL) {
+ *updatedFormat = format;
+ }
+ return NO_ERROR;
+ }
+
+ const bool checkInexact = // when port is input and format is linear pcm
+ mType == AUDIO_PORT_TYPE_MIX && mRole == AUDIO_PORT_ROLE_SINK
+ && audio_is_linear_pcm(format);
+
+ // iterate from best format to worst format (reverse order)
+ for (ssize_t i = mFormats.size() - 1; i >= 0 ; --i) {
+ if (mFormats[i] == format ||
+ (checkInexact
+ && mFormats[i] != AUDIO_FORMAT_DEFAULT
+ && audio_is_linear_pcm(mFormats[i]))) {
+ // for inexact checks we take the first linear pcm format due to sorting.
+ if (updatedFormat != NULL) {
+ *updatedFormat = mFormats[i];
+ }
+ return NO_ERROR;
+ }
+ }
+ return BAD_VALUE;
+}
+
+uint32_t AudioPort::pickSamplingRate() const
+{
+ // special case for uninitialized dynamic profile
+ if (mSamplingRates.size() == 1 && mSamplingRates[0] == 0) {
+ return 0;
+ }
+
+ // For direct outputs, pick minimum sampling rate: this helps ensuring that the
+ // channel count / sampling rate combination chosen will be supported by the connected
+ // sink
+ if ((mType == AUDIO_PORT_TYPE_MIX) && (mRole == AUDIO_PORT_ROLE_SOURCE) &&
+ (mFlags & (AUDIO_OUTPUT_FLAG_DIRECT | AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD))) {
+ uint32_t samplingRate = UINT_MAX;
+ for (size_t i = 0; i < mSamplingRates.size(); i ++) {
+ if ((mSamplingRates[i] < samplingRate) && (mSamplingRates[i] > 0)) {
+ samplingRate = mSamplingRates[i];
+ }
+ }
+ return (samplingRate == UINT_MAX) ? 0 : samplingRate;
+ }
+
+ uint32_t samplingRate = 0;
+ uint32_t maxRate = MAX_MIXER_SAMPLING_RATE;
+
+ // For mixed output and inputs, use max mixer sampling rates. Do not
+ // limit sampling rate otherwise
+ // For inputs, also see checkCompatibleSamplingRate().
+ if (mType != AUDIO_PORT_TYPE_MIX) {
+ maxRate = UINT_MAX;
+ }
+ // TODO: should mSamplingRates[] be ordered in terms of our preference
+ // and we return the first (and hence most preferred) match? This is of concern if
+ // we want to choose 96kHz over 192kHz for USB driver stability or resource constraints.
+ for (size_t i = 0; i < mSamplingRates.size(); i ++) {
+ if ((mSamplingRates[i] > samplingRate) && (mSamplingRates[i] <= maxRate)) {
+ samplingRate = mSamplingRates[i];
+ }
+ }
+ return samplingRate;
+}
+
+audio_channel_mask_t AudioPort::pickChannelMask() const
+{
+ // special case for uninitialized dynamic profile
+ if (mChannelMasks.size() == 1 && mChannelMasks[0] == 0) {
+ return AUDIO_CHANNEL_NONE;
+ }
+ audio_channel_mask_t channelMask = AUDIO_CHANNEL_NONE;
+
+ // For direct outputs, pick minimum channel count: this helps ensuring that the
+ // channel count / sampling rate combination chosen will be supported by the connected
+ // sink
+ if ((mType == AUDIO_PORT_TYPE_MIX) && (mRole == AUDIO_PORT_ROLE_SOURCE) &&
+ (mFlags & (AUDIO_OUTPUT_FLAG_DIRECT | AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD))) {
+ uint32_t channelCount = UINT_MAX;
+ for (size_t i = 0; i < mChannelMasks.size(); i ++) {
+ uint32_t cnlCount;
+ if (mUseInChannelMask) {
+ cnlCount = audio_channel_count_from_in_mask(mChannelMasks[i]);
+ } else {
+ cnlCount = audio_channel_count_from_out_mask(mChannelMasks[i]);
+ }
+ if ((cnlCount < channelCount) && (cnlCount > 0)) {
+ channelMask = mChannelMasks[i];
+ channelCount = cnlCount;
+ }
+ }
+ return channelMask;
+ }
+
+ uint32_t channelCount = 0;
+ uint32_t maxCount = MAX_MIXER_CHANNEL_COUNT;
+
+ // For mixed output and inputs, use max mixer channel count. Do not
+ // limit channel count otherwise
+ if (mType != AUDIO_PORT_TYPE_MIX) {
+ maxCount = UINT_MAX;
+ }
+ for (size_t i = 0; i < mChannelMasks.size(); i ++) {
+ uint32_t cnlCount;
+ if (mUseInChannelMask) {
+ cnlCount = audio_channel_count_from_in_mask(mChannelMasks[i]);
+ } else {
+ cnlCount = audio_channel_count_from_out_mask(mChannelMasks[i]);
+ }
+ if ((cnlCount > channelCount) && (cnlCount <= maxCount)) {
+ channelMask = mChannelMasks[i];
+ channelCount = cnlCount;
+ }
+ }
+ return channelMask;
+}
+
+/* format in order of increasing preference */
+const audio_format_t AudioPort::sPcmFormatCompareTable[] = {
+ AUDIO_FORMAT_DEFAULT,
+ AUDIO_FORMAT_PCM_16_BIT,
+ AUDIO_FORMAT_PCM_8_24_BIT,
+ AUDIO_FORMAT_PCM_24_BIT_PACKED,
+ AUDIO_FORMAT_PCM_32_BIT,
+ AUDIO_FORMAT_PCM_FLOAT,
+};
+
+int AudioPort::compareFormats(audio_format_t format1,
+ audio_format_t format2)
+{
+ // NOTE: AUDIO_FORMAT_INVALID is also considered not PCM and will be compared equal to any
+ // compressed format and better than any PCM format. This is by design of pickFormat()
+ if (!audio_is_linear_pcm(format1)) {
+ if (!audio_is_linear_pcm(format2)) {
+ return 0;
+ }
+ return 1;
+ }
+ if (!audio_is_linear_pcm(format2)) {
+ return -1;
+ }
+
+ int index1 = -1, index2 = -1;
+ for (size_t i = 0;
+ (i < ARRAY_SIZE(sPcmFormatCompareTable)) && ((index1 == -1) || (index2 == -1));
+ i ++) {
+ if (sPcmFormatCompareTable[i] == format1) {
+ index1 = i;
+ }
+ if (sPcmFormatCompareTable[i] == format2) {
+ index2 = i;
+ }
+ }
+ // format1 not found => index1 < 0 => format2 > format1
+ // format2 not found => index2 < 0 => format2 < format1
+ return index1 - index2;
+}
+
+audio_format_t AudioPort::pickFormat() const
+{
+ // special case for uninitialized dynamic profile
+ if (mFormats.size() == 1 && mFormats[0] == 0) {
+ return AUDIO_FORMAT_DEFAULT;
+ }
+
+ audio_format_t format = AUDIO_FORMAT_DEFAULT;
+ audio_format_t bestFormat =
+ AudioPort::sPcmFormatCompareTable[
+ ARRAY_SIZE(AudioPort::sPcmFormatCompareTable) - 1];
+ // For mixed output and inputs, use best mixer output format. Do not
+ // limit format otherwise
+ if ((mType != AUDIO_PORT_TYPE_MIX) ||
+ ((mRole == AUDIO_PORT_ROLE_SOURCE) &&
+ (((mFlags & (AUDIO_OUTPUT_FLAG_DIRECT | AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD)) != 0)))) {
+ bestFormat = AUDIO_FORMAT_INVALID;
+ }
+
+ for (size_t i = 0; i < mFormats.size(); i ++) {
+ if ((compareFormats(mFormats[i], format) > 0) &&
+ (compareFormats(mFormats[i], bestFormat) <= 0)) {
+ format = mFormats[i];
+ }
+ }
+ return format;
+}
+
+status_t AudioPort::checkGain(const struct audio_gain_config *gainConfig,
+ int index) const
+{
+ if (index < 0 || (size_t)index >= mGains.size()) {
+ return BAD_VALUE;
+ }
+ return mGains[index]->checkConfig(gainConfig);
+}
+
+void AudioPort::dump(int fd, int spaces) const
+{
+ const size_t SIZE = 256;
+ char buffer[SIZE];
+ String8 result;
+
+ if (mName.length() != 0) {
+ snprintf(buffer, SIZE, "%*s- name: %s\n", spaces, "", mName.string());
+ result.append(buffer);
+ }
+
+ if (mSamplingRates.size() != 0) {
+ snprintf(buffer, SIZE, "%*s- sampling rates: ", spaces, "");
+ result.append(buffer);
+ for (size_t i = 0; i < mSamplingRates.size(); i++) {
+ if (i == 0 && mSamplingRates[i] == 0) {
+ snprintf(buffer, SIZE, "Dynamic");
+ } else {
+ snprintf(buffer, SIZE, "%d", mSamplingRates[i]);
+ }
+ result.append(buffer);
+ result.append(i == (mSamplingRates.size() - 1) ? "" : ", ");
+ }
+ result.append("\n");
+ }
+
+ if (mChannelMasks.size() != 0) {
+ snprintf(buffer, SIZE, "%*s- channel masks: ", spaces, "");
+ result.append(buffer);
+ for (size_t i = 0; i < mChannelMasks.size(); i++) {
+ ALOGV("AudioPort::dump mChannelMasks %zu %08x", i, mChannelMasks[i]);
+
+ if (i == 0 && mChannelMasks[i] == 0) {
+ snprintf(buffer, SIZE, "Dynamic");
+ } else {
+ snprintf(buffer, SIZE, "0x%04x", mChannelMasks[i]);
+ }
+ result.append(buffer);
+ result.append(i == (mChannelMasks.size() - 1) ? "" : ", ");
+ }
+ result.append("\n");
+ }
+
+ if (mFormats.size() != 0) {
+ snprintf(buffer, SIZE, "%*s- formats: ", spaces, "");
+ result.append(buffer);
+ for (size_t i = 0; i < mFormats.size(); i++) {
+ const char *formatStr = ConfigParsingUtils::enumToString(sFormatNameToEnumTable,
+ ARRAY_SIZE(sFormatNameToEnumTable),
+ mFormats[i]);
+ const bool isEmptyStr = formatStr[0] == 0;
+ if (i == 0 && isEmptyStr) {
+ snprintf(buffer, SIZE, "Dynamic");
+ } else {
+ if (isEmptyStr) {
+ snprintf(buffer, SIZE, "%#x", mFormats[i]);
+ } else {
+ snprintf(buffer, SIZE, "%s", formatStr);
+ }
+ }
+ result.append(buffer);
+ result.append(i == (mFormats.size() - 1) ? "" : ", ");
+ }
+ result.append("\n");
+ }
+ write(fd, result.string(), result.size());
+ if (mGains.size() != 0) {
+ snprintf(buffer, SIZE, "%*s- gains:\n", spaces, "");
+ write(fd, buffer, strlen(buffer) + 1);
+ for (size_t i = 0; i < mGains.size(); i++) {
+ mGains[i]->dump(fd, spaces + 2, i);
+ }
+ }
+}
+
+void AudioPort::log(const char* indent) const
+{
+ ALOGI("%s Port[nm:%s, type:%d, role:%d]", indent, mName.string(), mType, mRole);
+}
+
+// --- AudioPortConfig class implementation
+
+AudioPortConfig::AudioPortConfig()
+{
+ mSamplingRate = 0;
+ mChannelMask = AUDIO_CHANNEL_NONE;
+ mFormat = AUDIO_FORMAT_INVALID;
+ mGain.index = -1;
+}
+
+status_t AudioPortConfig::applyAudioPortConfig(
+ const struct audio_port_config *config,
+ struct audio_port_config *backupConfig)
+{
+ struct audio_port_config localBackupConfig;
+ status_t status = NO_ERROR;
+
+ localBackupConfig.config_mask = config->config_mask;
+ toAudioPortConfig(&localBackupConfig);
+
+ sp<AudioPort> audioport = getAudioPort();
+ if (audioport == 0) {
+ status = NO_INIT;
+ goto exit;
+ }
+ if (config->config_mask & AUDIO_PORT_CONFIG_SAMPLE_RATE) {
+ status = audioport->checkExactSamplingRate(config->sample_rate);
+ if (status != NO_ERROR) {
+ goto exit;
+ }
+ mSamplingRate = config->sample_rate;
+ }
+ if (config->config_mask & AUDIO_PORT_CONFIG_CHANNEL_MASK) {
+ status = audioport->checkExactChannelMask(config->channel_mask);
+ if (status != NO_ERROR) {
+ goto exit;
+ }
+ mChannelMask = config->channel_mask;
+ }
+ if (config->config_mask & AUDIO_PORT_CONFIG_FORMAT) {
+ status = audioport->checkExactFormat(config->format);
+ if (status != NO_ERROR) {
+ goto exit;
+ }
+ mFormat = config->format;
+ }
+ if (config->config_mask & AUDIO_PORT_CONFIG_GAIN) {
+ status = audioport->checkGain(&config->gain, config->gain.index);
+ if (status != NO_ERROR) {
+ goto exit;
+ }
+ mGain = config->gain;
+ }
+
+exit:
+ if (status != NO_ERROR) {
+ applyAudioPortConfig(&localBackupConfig);
+ }
+ if (backupConfig != NULL) {
+ *backupConfig = localBackupConfig;
+ }
+ return status;
+}
+
+void AudioPortConfig::toAudioPortConfig(struct audio_port_config *dstConfig,
+ const struct audio_port_config *srcConfig) const
+{
+ if (dstConfig->config_mask & AUDIO_PORT_CONFIG_SAMPLE_RATE) {
+ dstConfig->sample_rate = mSamplingRate;
+ if ((srcConfig != NULL) && (srcConfig->config_mask & AUDIO_PORT_CONFIG_SAMPLE_RATE)) {
+ dstConfig->sample_rate = srcConfig->sample_rate;
+ }
+ } else {
+ dstConfig->sample_rate = 0;
+ }
+ if (dstConfig->config_mask & AUDIO_PORT_CONFIG_CHANNEL_MASK) {
+ dstConfig->channel_mask = mChannelMask;
+ if ((srcConfig != NULL) && (srcConfig->config_mask & AUDIO_PORT_CONFIG_CHANNEL_MASK)) {
+ dstConfig->channel_mask = srcConfig->channel_mask;
+ }
+ } else {
+ dstConfig->channel_mask = AUDIO_CHANNEL_NONE;
+ }
+ if (dstConfig->config_mask & AUDIO_PORT_CONFIG_FORMAT) {
+ dstConfig->format = mFormat;
+ if ((srcConfig != NULL) && (srcConfig->config_mask & AUDIO_PORT_CONFIG_FORMAT)) {
+ dstConfig->format = srcConfig->format;
+ }
+ } else {
+ dstConfig->format = AUDIO_FORMAT_INVALID;
+ }
+ if (dstConfig->config_mask & AUDIO_PORT_CONFIG_GAIN) {
+ dstConfig->gain = mGain;
+ if ((srcConfig != NULL) && (srcConfig->config_mask & AUDIO_PORT_CONFIG_GAIN)) {
+ dstConfig->gain = srcConfig->gain;
+ }
+ } else {
+ dstConfig->gain.index = -1;
+ }
+ if (dstConfig->gain.index != -1) {
+ dstConfig->config_mask |= AUDIO_PORT_CONFIG_GAIN;
+ } else {
+ dstConfig->config_mask &= ~AUDIO_PORT_CONFIG_GAIN;
+ }
+}
+
+}; // namespace android
diff --git a/services/audiopolicy/common/managerdefinitions/src/ConfigParsingUtils.cpp b/services/audiopolicy/common/managerdefinitions/src/ConfigParsingUtils.cpp
new file mode 100644
index 0000000..89ef045
--- /dev/null
+++ b/services/audiopolicy/common/managerdefinitions/src/ConfigParsingUtils.cpp
@@ -0,0 +1,288 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "APM::ConfigParsingUtils"
+//#define LOG_NDEBUG 0
+
+#include "ConfigParsingUtils.h"
+#include "AudioGain.h"
+#include <hardware/audio.h>
+#include <utils/Log.h>
+#include <cutils/misc.h>
+
+namespace android {
+
+//static
+uint32_t ConfigParsingUtils::stringToEnum(const struct StringToEnum *table,
+ size_t size,
+ const char *name)
+{
+ for (size_t i = 0; i < size; i++) {
+ if (strcmp(table[i].name, name) == 0) {
+ ALOGV("stringToEnum() found %s", table[i].name);
+ return table[i].value;
+ }
+ }
+ return 0;
+}
+
+//static
+const char *ConfigParsingUtils::enumToString(const struct StringToEnum *table,
+ size_t size,
+ uint32_t value)
+{
+ for (size_t i = 0; i < size; i++) {
+ if (table[i].value == value) {
+ return table[i].name;
+ }
+ }
+ return "";
+}
+
+//static
+bool ConfigParsingUtils::stringToBool(const char *value)
+{
+ return ((strcasecmp("true", value) == 0) || (strcmp("1", value) == 0));
+}
+
+
+// --- audio_policy.conf file parsing
+//static
+uint32_t ConfigParsingUtils::parseOutputFlagNames(char *name)
+{
+ uint32_t flag = 0;
+
+ // it is OK to cast name to non const here as we are not going to use it after
+ // strtok() modifies it
+ char *flagName = strtok(name, "|");
+ while (flagName != NULL) {
+ if (strlen(flagName) != 0) {
+ flag |= ConfigParsingUtils::stringToEnum(sOutputFlagNameToEnumTable,
+ ARRAY_SIZE(sOutputFlagNameToEnumTable),
+ flagName);
+ }
+ flagName = strtok(NULL, "|");
+ }
+ //force direct flag if offload flag is set: offloading implies a direct output stream
+ // and all common behaviors are driven by checking only the direct flag
+ // this should normally be set appropriately in the policy configuration file
+ if ((flag & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD) != 0) {
+ flag |= AUDIO_OUTPUT_FLAG_DIRECT;
+ }
+
+ return flag;
+}
+
+//static
+uint32_t ConfigParsingUtils::parseInputFlagNames(char *name)
+{
+ uint32_t flag = 0;
+
+ // it is OK to cast name to non const here as we are not going to use it after
+ // strtok() modifies it
+ char *flagName = strtok(name, "|");
+ while (flagName != NULL) {
+ if (strlen(flagName) != 0) {
+ flag |= stringToEnum(sInputFlagNameToEnumTable,
+ ARRAY_SIZE(sInputFlagNameToEnumTable),
+ flagName);
+ }
+ flagName = strtok(NULL, "|");
+ }
+ return flag;
+}
+
+//static
+audio_devices_t ConfigParsingUtils::parseDeviceNames(char *name)
+{
+ uint32_t device = 0;
+
+ char *devName = strtok(name, "|");
+ while (devName != NULL) {
+ if (strlen(devName) != 0) {
+ device |= stringToEnum(sDeviceTypeToEnumTable,
+ ARRAY_SIZE(sDeviceTypeToEnumTable),
+ devName);
+ }
+ devName = strtok(NULL, "|");
+ }
+ return device;
+}
+
+//static
+void ConfigParsingUtils::loadHwModule(cnode *root, HwModuleCollection &hwModules,
+ DeviceVector &availableInputDevices,
+ DeviceVector &availableOutputDevices,
+ sp<DeviceDescriptor> &defaultOutputDevices,
+ bool &isSpeakerDrcEnable)
+{
+ status_t status = NAME_NOT_FOUND;
+ cnode *node;
+ sp<HwModule> module = new HwModule(root->name);
+
+ node = config_find(root, DEVICES_TAG);
+ if (node != NULL) {
+ node = node->first_child;
+ while (node) {
+ ALOGV("loadHwModule() loading device %s", node->name);
+ status_t tmpStatus = module->loadDevice(node);
+ if (status == NAME_NOT_FOUND || status == NO_ERROR) {
+ status = tmpStatus;
+ }
+ node = node->next;
+ }
+ }
+ node = config_find(root, OUTPUTS_TAG);
+ if (node != NULL) {
+ node = node->first_child;
+ while (node) {
+ ALOGV("loadHwModule() loading output %s", node->name);
+ status_t tmpStatus = module->loadOutput(node);
+ if (status == NAME_NOT_FOUND || status == NO_ERROR) {
+ status = tmpStatus;
+ }
+ node = node->next;
+ }
+ }
+ node = config_find(root, INPUTS_TAG);
+ if (node != NULL) {
+ node = node->first_child;
+ while (node) {
+ ALOGV("loadHwModule() loading input %s", node->name);
+ status_t tmpStatus = module->loadInput(node);
+ if (status == NAME_NOT_FOUND || status == NO_ERROR) {
+ status = tmpStatus;
+ }
+ node = node->next;
+ }
+ }
+ loadGlobalConfig(root, module, availableInputDevices, availableOutputDevices,
+ defaultOutputDevices, isSpeakerDrcEnable);
+
+ if (status == NO_ERROR) {
+ hwModules.add(module);
+ }
+}
+
+//static
+void ConfigParsingUtils::loadHwModules(cnode *root, HwModuleCollection &hwModules,
+ DeviceVector &availableInputDevices,
+ DeviceVector &availableOutputDevices,
+ sp<DeviceDescriptor> &defaultOutputDevices,
+ bool &isSpeakerDrcEnabled)
+{
+ cnode *node = config_find(root, AUDIO_HW_MODULE_TAG);
+ if (node == NULL) {
+ return;
+ }
+
+ node = node->first_child;
+ while (node) {
+ ALOGV("loadHwModules() loading module %s", node->name);
+ loadHwModule(node, hwModules, availableInputDevices, availableOutputDevices,
+ defaultOutputDevices, isSpeakerDrcEnabled);
+ node = node->next;
+ }
+}
+
+//static
+void ConfigParsingUtils::loadGlobalConfig(cnode *root, const sp<HwModule>& module,
+ DeviceVector &availableInputDevices,
+ DeviceVector &availableOutputDevices,
+ sp<DeviceDescriptor> &defaultOutputDevice,
+ bool &speakerDrcEnabled)
+{
+ cnode *node = config_find(root, GLOBAL_CONFIG_TAG);
+
+ if (node == NULL) {
+ return;
+ }
+ DeviceVector declaredDevices;
+ if (module != NULL) {
+ declaredDevices = module->mDeclaredDevices;
+ }
+
+ node = node->first_child;
+ while (node) {
+ if (strcmp(ATTACHED_OUTPUT_DEVICES_TAG, node->name) == 0) {
+ availableOutputDevices.loadDevicesFromTag((char *)node->value,
+ declaredDevices);
+ ALOGV("loadGlobalConfig() Attached Output Devices %08x",
+ availableOutputDevices.types());
+ } else if (strcmp(DEFAULT_OUTPUT_DEVICE_TAG, node->name) == 0) {
+ audio_devices_t device = (audio_devices_t)stringToEnum(
+ sDeviceTypeToEnumTable,
+ ARRAY_SIZE(sDeviceTypeToEnumTable),
+ (char *)node->value);
+ if (device != AUDIO_DEVICE_NONE) {
+ defaultOutputDevice = new DeviceDescriptor(device);
+ } else {
+ ALOGW("loadGlobalConfig() default device not specified");
+ }
+ ALOGV("loadGlobalConfig() mDefaultOutputDevice %08x", defaultOutputDevice->type());
+ } else if (strcmp(ATTACHED_INPUT_DEVICES_TAG, node->name) == 0) {
+ availableInputDevices.loadDevicesFromTag((char *)node->value,
+ declaredDevices);
+ ALOGV("loadGlobalConfig() Available InputDevices %08x", availableInputDevices.types());
+ } else if (strcmp(SPEAKER_DRC_ENABLED_TAG, node->name) == 0) {
+ speakerDrcEnabled = stringToBool((char *)node->value);
+ ALOGV("loadGlobalConfig() mSpeakerDrcEnabled = %d", speakerDrcEnabled);
+ } else if (strcmp(AUDIO_HAL_VERSION_TAG, node->name) == 0) {
+ uint32_t major, minor;
+ sscanf((char *)node->value, "%u.%u", &major, &minor);
+ module->mHalVersion = HARDWARE_DEVICE_API_VERSION(major, minor);
+ ALOGV("loadGlobalConfig() mHalVersion = %04x major %u minor %u",
+ module->mHalVersion, major, minor);
+ }
+ node = node->next;
+ }
+}
+
+//static
+status_t ConfigParsingUtils::loadAudioPolicyConfig(const char *path,
+ HwModuleCollection &hwModules,
+ DeviceVector &availableInputDevices,
+ DeviceVector &availableOutputDevices,
+ sp<DeviceDescriptor> &defaultOutputDevices,
+ bool &isSpeakerDrcEnabled)
+{
+ cnode *root;
+ char *data;
+
+ data = (char *)load_file(path, NULL);
+ if (data == NULL) {
+ return -ENODEV;
+ }
+ root = config_node("", "");
+ config_load(root, data);
+
+ loadHwModules(root, hwModules,
+ availableInputDevices, availableOutputDevices,
+ defaultOutputDevices, isSpeakerDrcEnabled);
+ // legacy audio_policy.conf files have one global_configuration section
+ loadGlobalConfig(root, hwModules.getModuleFromName(AUDIO_HARDWARE_MODULE_ID_PRIMARY),
+ availableInputDevices, availableOutputDevices,
+ defaultOutputDevices, isSpeakerDrcEnabled);
+ config_free(root);
+ free(root);
+ free(data);
+
+ ALOGI("loadAudioPolicyConfig() loaded %s\n", path);
+
+ return NO_ERROR;
+}
+
+}; // namespace android
diff --git a/services/audiopolicy/common/managerdefinitions/src/DeviceDescriptor.cpp b/services/audiopolicy/common/managerdefinitions/src/DeviceDescriptor.cpp
new file mode 100644
index 0000000..1f1fca3
--- /dev/null
+++ b/services/audiopolicy/common/managerdefinitions/src/DeviceDescriptor.cpp
@@ -0,0 +1,350 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "APM::Devices"
+//#define LOG_NDEBUG 0
+
+#include "DeviceDescriptor.h"
+#include "AudioGain.h"
+#include "HwModule.h"
+#include "ConfigParsingUtils.h"
+
+namespace android {
+
+DeviceDescriptor::DeviceDescriptor(audio_devices_t type) :
+ AudioPort(String8(""), AUDIO_PORT_TYPE_DEVICE,
+ audio_is_output_device(type) ? AUDIO_PORT_ROLE_SINK :
+ AUDIO_PORT_ROLE_SOURCE),
+ mTag(""), mAddress(""), mDeviceType(type), mId(0)
+{
+
+}
+
+audio_port_handle_t DeviceDescriptor::getId() const
+{
+ return mId;
+}
+
+void DeviceDescriptor::attach(const sp<HwModule>& module)
+{
+ AudioPort::attach(module);
+ mId = getNextUniqueId();
+}
+
+bool DeviceDescriptor::equals(const sp<DeviceDescriptor>& other) const
+{
+ // Devices are considered equal if they:
+ // - are of the same type (a device type cannot be AUDIO_DEVICE_NONE)
+ // - have the same address or one device does not specify the address
+ // - have the same channel mask or one device does not specify the channel mask
+ if (other == 0) {
+ return false;
+ }
+ return (mDeviceType == other->mDeviceType) &&
+ (mAddress == "" || other->mAddress == "" || mAddress == other->mAddress) &&
+ (mChannelMask == 0 || other->mChannelMask == 0 ||
+ mChannelMask == other->mChannelMask);
+}
+
+void DeviceDescriptor::loadGains(cnode *root)
+{
+ AudioPort::loadGains(root);
+ if (mGains.size() > 0) {
+ mGains[0]->getDefaultConfig(&mGain);
+ }
+}
+
+void DeviceVector::refreshTypes()
+{
+ mDeviceTypes = AUDIO_DEVICE_NONE;
+ for(size_t i = 0; i < size(); i++) {
+ mDeviceTypes |= itemAt(i)->type();
+ }
+ ALOGV("DeviceVector::refreshTypes() mDeviceTypes %08x", mDeviceTypes);
+}
+
+ssize_t DeviceVector::indexOf(const sp<DeviceDescriptor>& item) const
+{
+ for(size_t i = 0; i < size(); i++) {
+ if (item->equals(itemAt(i))) {
+ return i;
+ }
+ }
+ return -1;
+}
+
+ssize_t DeviceVector::add(const sp<DeviceDescriptor>& item)
+{
+ ssize_t ret = indexOf(item);
+
+ if (ret < 0) {
+ ret = SortedVector::add(item);
+ if (ret >= 0) {
+ refreshTypes();
+ }
+ } else {
+ ALOGW("DeviceVector::add device %08x already in", item->type());
+ ret = -1;
+ }
+ return ret;
+}
+
+ssize_t DeviceVector::remove(const sp<DeviceDescriptor>& item)
+{
+ size_t i;
+ ssize_t ret = indexOf(item);
+
+ if (ret < 0) {
+ ALOGW("DeviceVector::remove device %08x not in", item->type());
+ } else {
+ ret = SortedVector::removeAt(ret);
+ if (ret >= 0) {
+ refreshTypes();
+ }
+ }
+ return ret;
+}
+
+audio_devices_t DeviceVector::getDevicesFromHwModule(audio_module_handle_t moduleHandle) const
+{
+ audio_devices_t devices = AUDIO_DEVICE_NONE;
+ for (size_t i = 0; i < size(); i++) {
+ if (itemAt(i)->getModuleHandle() == moduleHandle) {
+ devices |= itemAt(i)->type();
+ }
+ }
+ return devices;
+}
+
+void DeviceVector::loadDevicesFromType(audio_devices_t types)
+{
+ DeviceVector deviceList;
+
+ uint32_t role_bit = AUDIO_DEVICE_BIT_IN & types;
+ types &= ~role_bit;
+
+ while (types) {
+ uint32_t i = 31 - __builtin_clz(types);
+ uint32_t type = 1 << i;
+ types &= ~type;
+ add(new DeviceDescriptor(type | role_bit));
+ }
+}
+
+void DeviceVector::loadDevicesFromTag(char *tag,
+ const DeviceVector& declaredDevices)
+{
+ char *devTag = strtok(tag, "|");
+ while (devTag != NULL) {
+ if (strlen(devTag) != 0) {
+ audio_devices_t type = ConfigParsingUtils::stringToEnum(sDeviceTypeToEnumTable,
+ ARRAY_SIZE(sDeviceTypeToEnumTable),
+ devTag);
+ if (type != AUDIO_DEVICE_NONE) {
+ sp<DeviceDescriptor> dev = new DeviceDescriptor(type);
+ if (type == AUDIO_DEVICE_IN_REMOTE_SUBMIX ||
+ type == AUDIO_DEVICE_OUT_REMOTE_SUBMIX ) {
+ dev->mAddress = String8("0");
+ }
+ add(dev);
+ } else {
+ sp<DeviceDescriptor> deviceDesc =
+ declaredDevices.getDeviceFromTag(String8(devTag));
+ if (deviceDesc != 0) {
+ add(deviceDesc);
+ }
+ }
+ }
+ devTag = strtok(NULL, "|");
+ }
+}
+
+sp<DeviceDescriptor> DeviceVector::getDevice(audio_devices_t type, String8 address) const
+{
+ sp<DeviceDescriptor> device;
+ for (size_t i = 0; i < size(); i++) {
+ if (itemAt(i)->type() == type) {
+ if (address == "" || itemAt(i)->mAddress == address) {
+ device = itemAt(i);
+ if (itemAt(i)->mAddress == address) {
+ break;
+ }
+ }
+ }
+ }
+ ALOGV("DeviceVector::getDevice() for type %08x address %s found %p",
+ type, address.string(), device.get());
+ return device;
+}
+
+sp<DeviceDescriptor> DeviceVector::getDeviceFromId(audio_port_handle_t id) const
+{
+ sp<DeviceDescriptor> device;
+ for (size_t i = 0; i < size(); i++) {
+ if (itemAt(i)->getId() == id) {
+ device = itemAt(i);
+ break;
+ }
+ }
+ return device;
+}
+
+DeviceVector DeviceVector::getDevicesFromType(audio_devices_t type) const
+{
+ DeviceVector devices;
+ bool isOutput = audio_is_output_devices(type);
+ type &= ~AUDIO_DEVICE_BIT_IN;
+ for (size_t i = 0; (i < size()) && (type != AUDIO_DEVICE_NONE); i++) {
+ bool curIsOutput = audio_is_output_devices(itemAt(i)->mDeviceType);
+ audio_devices_t curType = itemAt(i)->mDeviceType & ~AUDIO_DEVICE_BIT_IN;
+ if ((isOutput == curIsOutput) && ((type & curType) != 0)) {
+ devices.add(itemAt(i));
+ type &= ~curType;
+ ALOGV("DeviceVector::getDevicesFromType() for type %x found %p",
+ itemAt(i)->type(), itemAt(i).get());
+ }
+ }
+ return devices;
+}
+
+DeviceVector DeviceVector::getDevicesFromTypeAddr(
+ audio_devices_t type, String8 address) const
+{
+ DeviceVector devices;
+ for (size_t i = 0; i < size(); i++) {
+ if (itemAt(i)->type() == type) {
+ if (itemAt(i)->mAddress == address) {
+ devices.add(itemAt(i));
+ }
+ }
+ }
+ return devices;
+}
+
+sp<DeviceDescriptor> DeviceVector::getDeviceFromTag(const String8& tag) const
+{
+ sp<DeviceDescriptor> device;
+ for (size_t i = 0; i < size(); i++) {
+ if (itemAt(i)->mTag == tag) {
+ device = itemAt(i);
+ break;
+ }
+ }
+ return device;
+}
+
+
+status_t DeviceVector::dump(int fd, const String8 &direction) const
+{
+ const size_t SIZE = 256;
+ char buffer[SIZE];
+
+ snprintf(buffer, SIZE, "\n Available %s devices:\n", direction.string());
+ write(fd, buffer, strlen(buffer));
+ for (size_t i = 0; i < size(); i++) {
+ itemAt(i)->dump(fd, 2, i);
+ }
+ return NO_ERROR;
+}
+
+audio_policy_dev_state_t DeviceVector::getDeviceConnectionState(const sp<DeviceDescriptor> &devDesc) const
+{
+ ssize_t index = indexOf(devDesc);
+ return index >= 0 ? AUDIO_POLICY_DEVICE_STATE_AVAILABLE : AUDIO_POLICY_DEVICE_STATE_UNAVAILABLE;
+}
+
+void DeviceDescriptor::toAudioPortConfig(struct audio_port_config *dstConfig,
+ const struct audio_port_config *srcConfig) const
+{
+ dstConfig->config_mask = AUDIO_PORT_CONFIG_CHANNEL_MASK|AUDIO_PORT_CONFIG_GAIN;
+ if (srcConfig != NULL) {
+ dstConfig->config_mask |= srcConfig->config_mask;
+ }
+
+ AudioPortConfig::toAudioPortConfig(dstConfig, srcConfig);
+
+ dstConfig->id = mId;
+ dstConfig->role = audio_is_output_device(mDeviceType) ?
+ AUDIO_PORT_ROLE_SINK : AUDIO_PORT_ROLE_SOURCE;
+ dstConfig->type = AUDIO_PORT_TYPE_DEVICE;
+ dstConfig->ext.device.type = mDeviceType;
+
+ //TODO Understand why this test is necessary. i.e. why at boot time does it crash
+ // without the test?
+ // This has been demonstrated to NOT be true (at start up)
+ // ALOG_ASSERT(mModule != NULL);
+ dstConfig->ext.device.hw_module = mModule != 0 ? mModule->mHandle : AUDIO_IO_HANDLE_NONE;
+ strncpy(dstConfig->ext.device.address, mAddress.string(), AUDIO_DEVICE_MAX_ADDRESS_LEN);
+}
+
+void DeviceDescriptor::toAudioPort(struct audio_port *port) const
+{
+ ALOGV("DeviceDescriptor::toAudioPort() handle %d type %x", mId, mDeviceType);
+ AudioPort::toAudioPort(port);
+ port->id = mId;
+ toAudioPortConfig(&port->active_config);
+ port->ext.device.type = mDeviceType;
+ port->ext.device.hw_module = mModule->mHandle;
+ strncpy(port->ext.device.address, mAddress.string(), AUDIO_DEVICE_MAX_ADDRESS_LEN);
+}
+
+void DeviceDescriptor::importAudioPort(const sp<AudioPort> port) {
+ AudioPort::importAudioPort(port);
+ mSamplingRate = port->pickSamplingRate();
+ mFormat = port->pickFormat();
+ mChannelMask = port->pickChannelMask();
+}
+
+status_t DeviceDescriptor::dump(int fd, int spaces, int index) const
+{
+ const size_t SIZE = 256;
+ char buffer[SIZE];
+ String8 result;
+
+ snprintf(buffer, SIZE, "%*sDevice %d:\n", spaces, "", index+1);
+ result.append(buffer);
+ if (mId != 0) {
+ snprintf(buffer, SIZE, "%*s- id: %2d\n", spaces, "", mId);
+ result.append(buffer);
+ }
+ snprintf(buffer, SIZE, "%*s- type: %-48s\n", spaces, "",
+ ConfigParsingUtils::enumToString(sDeviceTypeToEnumTable,
+ ARRAY_SIZE(sDeviceTypeToEnumTable),
+ mDeviceType));
+ result.append(buffer);
+ if (mAddress.size() != 0) {
+ snprintf(buffer, SIZE, "%*s- address: %-32s\n", spaces, "", mAddress.string());
+ result.append(buffer);
+ }
+ write(fd, result.string(), result.size());
+ AudioPort::dump(fd, spaces);
+
+ return NO_ERROR;
+}
+
+void DeviceDescriptor::log() const
+{
+ ALOGI("Device id:%d type:0x%X:%s, addr:%s",
+ mId,
+ mDeviceType,
+ ConfigParsingUtils::enumToString(
+ sDeviceNameToEnumTable, ARRAY_SIZE(sDeviceNameToEnumTable), mDeviceType),
+ mAddress.string());
+
+ AudioPort::log(" ");
+}
+
+}; // namespace android
diff --git a/services/audiopolicy/common/managerdefinitions/src/EffectDescriptor.cpp b/services/audiopolicy/common/managerdefinitions/src/EffectDescriptor.cpp
new file mode 100644
index 0000000..33d838d
--- /dev/null
+++ b/services/audiopolicy/common/managerdefinitions/src/EffectDescriptor.cpp
@@ -0,0 +1,192 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "APM::EffectDescriptor"
+//#define LOG_NDEBUG 0
+
+#include "EffectDescriptor.h"
+#include <utils/String8.h>
+
+namespace android {
+
+status_t EffectDescriptor::dump(int fd)
+{
+ const size_t SIZE = 256;
+ char buffer[SIZE];
+ String8 result;
+
+ snprintf(buffer, SIZE, " I/O: %d\n", mIo);
+ result.append(buffer);
+ snprintf(buffer, SIZE, " Strategy: %d\n", mStrategy);
+ result.append(buffer);
+ snprintf(buffer, SIZE, " Session: %d\n", mSession);
+ result.append(buffer);
+ snprintf(buffer, SIZE, " Name: %s\n", mDesc.name);
+ result.append(buffer);
+ snprintf(buffer, SIZE, " %s\n", mEnabled ? "Enabled" : "Disabled");
+ result.append(buffer);
+ write(fd, result.string(), result.size());
+
+ return NO_ERROR;
+}
+
+EffectDescriptorCollection::EffectDescriptorCollection() :
+ mTotalEffectsCpuLoad(0),
+ mTotalEffectsMemory(0)
+{
+
+}
+
+status_t EffectDescriptorCollection::registerEffect(const effect_descriptor_t *desc,
+ audio_io_handle_t io,
+ uint32_t strategy,
+ int session,
+ int id)
+{
+ if (mTotalEffectsMemory + desc->memoryUsage > getMaxEffectsMemory()) {
+ ALOGW("registerEffect() memory limit exceeded for Fx %s, Memory %d KB",
+ desc->name, desc->memoryUsage);
+ return INVALID_OPERATION;
+ }
+ mTotalEffectsMemory += desc->memoryUsage;
+ ALOGV("registerEffect() effect %s, io %d, strategy %d session %d id %d",
+ desc->name, io, strategy, session, id);
+ ALOGV("registerEffect() memory %d, total memory %d", desc->memoryUsage, mTotalEffectsMemory);
+
+ sp<EffectDescriptor> effectDesc = new EffectDescriptor();
+ memcpy (&effectDesc->mDesc, desc, sizeof(effect_descriptor_t));
+ effectDesc->mIo = io;
+ effectDesc->mStrategy = static_cast<routing_strategy>(strategy);
+ effectDesc->mSession = session;
+ effectDesc->mEnabled = false;
+
+ add(id, effectDesc);
+
+ return NO_ERROR;
+}
+
+status_t EffectDescriptorCollection::unregisterEffect(int id)
+{
+ ssize_t index = indexOfKey(id);
+ if (index < 0) {
+ ALOGW("unregisterEffect() unknown effect ID %d", id);
+ return INVALID_OPERATION;
+ }
+
+ sp<EffectDescriptor> effectDesc = valueAt(index);
+
+ setEffectEnabled(effectDesc, false);
+
+ if (mTotalEffectsMemory < effectDesc->mDesc.memoryUsage) {
+ ALOGW("unregisterEffect() memory %d too big for total %d",
+ effectDesc->mDesc.memoryUsage, mTotalEffectsMemory);
+ effectDesc->mDesc.memoryUsage = mTotalEffectsMemory;
+ }
+ mTotalEffectsMemory -= effectDesc->mDesc.memoryUsage;
+ ALOGV("unregisterEffect() effect %s, ID %d, memory %d total memory %d",
+ effectDesc->mDesc.name, id, effectDesc->mDesc.memoryUsage, mTotalEffectsMemory);
+
+ removeItem(id);
+
+ return NO_ERROR;
+}
+
+status_t EffectDescriptorCollection::setEffectEnabled(int id, bool enabled)
+{
+ ssize_t index = indexOfKey(id);
+ if (index < 0) {
+ ALOGW("unregisterEffect() unknown effect ID %d", id);
+ return INVALID_OPERATION;
+ }
+
+ return setEffectEnabled(valueAt(index), enabled);
+}
+
+
+status_t EffectDescriptorCollection::setEffectEnabled(const sp<EffectDescriptor> &effectDesc,
+ bool enabled)
+{
+ if (enabled == effectDesc->mEnabled) {
+ ALOGV("setEffectEnabled(%s) effect already %s",
+ enabled?"true":"false", enabled?"enabled":"disabled");
+ return INVALID_OPERATION;
+ }
+
+ if (enabled) {
+ if (mTotalEffectsCpuLoad + effectDesc->mDesc.cpuLoad > getMaxEffectsCpuLoad()) {
+ ALOGW("setEffectEnabled(true) CPU Load limit exceeded for Fx %s, CPU %f MIPS",
+ effectDesc->mDesc.name, (float)effectDesc->mDesc.cpuLoad/10);
+ return INVALID_OPERATION;
+ }
+ mTotalEffectsCpuLoad += effectDesc->mDesc.cpuLoad;
+ ALOGV("setEffectEnabled(true) total CPU %d", mTotalEffectsCpuLoad);
+ } else {
+ if (mTotalEffectsCpuLoad < effectDesc->mDesc.cpuLoad) {
+ ALOGW("setEffectEnabled(false) CPU load %d too high for total %d",
+ effectDesc->mDesc.cpuLoad, mTotalEffectsCpuLoad);
+ effectDesc->mDesc.cpuLoad = mTotalEffectsCpuLoad;
+ }
+ mTotalEffectsCpuLoad -= effectDesc->mDesc.cpuLoad;
+ ALOGV("setEffectEnabled(false) total CPU %d", mTotalEffectsCpuLoad);
+ }
+ effectDesc->mEnabled = enabled;
+ return NO_ERROR;
+}
+
+bool EffectDescriptorCollection::isNonOffloadableEffectEnabled()
+{
+ for (size_t i = 0; i < size(); i++) {
+ sp<EffectDescriptor> effectDesc = valueAt(i);
+ if (effectDesc->mEnabled && (effectDesc->mStrategy == STRATEGY_MEDIA) &&
+ ((effectDesc->mDesc.flags & EFFECT_FLAG_OFFLOAD_SUPPORTED) == 0)) {
+ ALOGV("isNonOffloadableEffectEnabled() non offloadable effect %s enabled on session %d",
+ effectDesc->mDesc.name, effectDesc->mSession);
+ return true;
+ }
+ }
+ return false;
+}
+
+uint32_t EffectDescriptorCollection::getMaxEffectsCpuLoad() const
+{
+ return MAX_EFFECTS_CPU_LOAD;
+}
+
+uint32_t EffectDescriptorCollection::getMaxEffectsMemory() const
+{
+ return MAX_EFFECTS_MEMORY;
+}
+
+status_t EffectDescriptorCollection::dump(int fd)
+{
+ const size_t SIZE = 256;
+ char buffer[SIZE];
+
+ snprintf(buffer, SIZE, "\nTotal Effects CPU: %f MIPS, Total Effects memory: %d KB\n",
+ (float)mTotalEffectsCpuLoad/10, mTotalEffectsMemory);
+ write(fd, buffer, strlen(buffer));
+
+ snprintf(buffer, SIZE, "Registered effects:\n");
+ write(fd, buffer, strlen(buffer));
+ for (size_t i = 0; i < size(); i++) {
+ snprintf(buffer, SIZE, "- Effect %d dump:\n", keyAt(i));
+ write(fd, buffer, strlen(buffer));
+ valueAt(i)->dump(fd);
+ }
+ return NO_ERROR;
+}
+
+}; //namespace android
diff --git a/services/audiopolicy/common/managerdefinitions/src/HwModule.cpp b/services/audiopolicy/common/managerdefinitions/src/HwModule.cpp
new file mode 100644
index 0000000..7e2050b
--- /dev/null
+++ b/services/audiopolicy/common/managerdefinitions/src/HwModule.cpp
@@ -0,0 +1,375 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "APM::HwModule"
+//#define LOG_NDEBUG 0
+
+#include "HwModule.h"
+#include "IOProfile.h"
+#include "AudioGain.h"
+#include "ConfigParsingUtils.h"
+#include "audio_policy_conf.h"
+#include <hardware/audio.h>
+#include <policy.h>
+
+namespace android {
+
+HwModule::HwModule(const char *name)
+ : mName(strndup(name, AUDIO_HARDWARE_MODULE_ID_MAX_LEN)),
+ mHalVersion(AUDIO_DEVICE_API_VERSION_MIN), mHandle(0)
+{
+}
+
+HwModule::~HwModule()
+{
+ for (size_t i = 0; i < mOutputProfiles.size(); i++) {
+ mOutputProfiles[i]->mSupportedDevices.clear();
+ }
+ for (size_t i = 0; i < mInputProfiles.size(); i++) {
+ mInputProfiles[i]->mSupportedDevices.clear();
+ }
+ free((void *)mName);
+}
+
+status_t HwModule::loadInput(cnode *root)
+{
+ cnode *node = root->first_child;
+
+ sp<IOProfile> profile = new IOProfile(String8(root->name), AUDIO_PORT_ROLE_SINK);
+
+ while (node) {
+ if (strcmp(node->name, SAMPLING_RATES_TAG) == 0) {
+ profile->loadSamplingRates((char *)node->value);
+ } else if (strcmp(node->name, FORMATS_TAG) == 0) {
+ profile->loadFormats((char *)node->value);
+ } else if (strcmp(node->name, CHANNELS_TAG) == 0) {
+ profile->loadInChannels((char *)node->value);
+ } else if (strcmp(node->name, DEVICES_TAG) == 0) {
+ profile->mSupportedDevices.loadDevicesFromTag((char *)node->value,
+ mDeclaredDevices);
+ } else if (strcmp(node->name, FLAGS_TAG) == 0) {
+ profile->mFlags = ConfigParsingUtils::parseInputFlagNames((char *)node->value);
+ } else if (strcmp(node->name, GAINS_TAG) == 0) {
+ profile->loadGains(node);
+ }
+ node = node->next;
+ }
+ ALOGW_IF(profile->mSupportedDevices.isEmpty(),
+ "loadInput() invalid supported devices");
+ ALOGW_IF(profile->mChannelMasks.size() == 0,
+ "loadInput() invalid supported channel masks");
+ ALOGW_IF(profile->mSamplingRates.size() == 0,
+ "loadInput() invalid supported sampling rates");
+ ALOGW_IF(profile->mFormats.size() == 0,
+ "loadInput() invalid supported formats");
+ if (!profile->mSupportedDevices.isEmpty() &&
+ (profile->mChannelMasks.size() != 0) &&
+ (profile->mSamplingRates.size() != 0) &&
+ (profile->mFormats.size() != 0)) {
+
+ ALOGV("loadInput() adding input Supported Devices %04x",
+ profile->mSupportedDevices.types());
+
+ profile->attach(this);
+ mInputProfiles.add(profile);
+ return NO_ERROR;
+ } else {
+ return BAD_VALUE;
+ }
+}
+
+status_t HwModule::loadOutput(cnode *root)
+{
+ cnode *node = root->first_child;
+
+ sp<IOProfile> profile = new IOProfile(String8(root->name), AUDIO_PORT_ROLE_SOURCE);
+
+ while (node) {
+ if (strcmp(node->name, SAMPLING_RATES_TAG) == 0) {
+ profile->loadSamplingRates((char *)node->value);
+ } else if (strcmp(node->name, FORMATS_TAG) == 0) {
+ profile->loadFormats((char *)node->value);
+ } else if (strcmp(node->name, CHANNELS_TAG) == 0) {
+ profile->loadOutChannels((char *)node->value);
+ } else if (strcmp(node->name, DEVICES_TAG) == 0) {
+ profile->mSupportedDevices.loadDevicesFromTag((char *)node->value,
+ mDeclaredDevices);
+ } else if (strcmp(node->name, FLAGS_TAG) == 0) {
+ profile->mFlags = ConfigParsingUtils::parseOutputFlagNames((char *)node->value);
+ } else if (strcmp(node->name, GAINS_TAG) == 0) {
+ profile->loadGains(node);
+ }
+ node = node->next;
+ }
+ ALOGW_IF(profile->mSupportedDevices.isEmpty(),
+ "loadOutput() invalid supported devices");
+ ALOGW_IF(profile->mChannelMasks.size() == 0,
+ "loadOutput() invalid supported channel masks");
+ ALOGW_IF(profile->mSamplingRates.size() == 0,
+ "loadOutput() invalid supported sampling rates");
+ ALOGW_IF(profile->mFormats.size() == 0,
+ "loadOutput() invalid supported formats");
+ if (!profile->mSupportedDevices.isEmpty() &&
+ (profile->mChannelMasks.size() != 0) &&
+ (profile->mSamplingRates.size() != 0) &&
+ (profile->mFormats.size() != 0)) {
+
+ ALOGV("loadOutput() adding output Supported Devices %04x, mFlags %04x",
+ profile->mSupportedDevices.types(), profile->mFlags);
+ profile->attach(this);
+ mOutputProfiles.add(profile);
+ return NO_ERROR;
+ } else {
+ return BAD_VALUE;
+ }
+}
+
+status_t HwModule::loadDevice(cnode *root)
+{
+ cnode *node = root->first_child;
+
+ audio_devices_t type = AUDIO_DEVICE_NONE;
+ while (node) {
+ if (strcmp(node->name, APM_DEVICE_TYPE) == 0) {
+ type = ConfigParsingUtils::parseDeviceNames((char *)node->value);
+ break;
+ }
+ node = node->next;
+ }
+ if (type == AUDIO_DEVICE_NONE ||
+ (!audio_is_input_device(type) && !audio_is_output_device(type))) {
+ ALOGW("loadDevice() bad type %08x", type);
+ return BAD_VALUE;
+ }
+ sp<DeviceDescriptor> deviceDesc = new DeviceDescriptor(type);
+ deviceDesc->mTag = String8(root->name);
+
+ node = root->first_child;
+ while (node) {
+ if (strcmp(node->name, APM_DEVICE_ADDRESS) == 0) {
+ deviceDesc->mAddress = String8((char *)node->value);
+ } else if (strcmp(node->name, CHANNELS_TAG) == 0) {
+ if (audio_is_input_device(type)) {
+ deviceDesc->loadInChannels((char *)node->value);
+ } else {
+ deviceDesc->loadOutChannels((char *)node->value);
+ }
+ } else if (strcmp(node->name, GAINS_TAG) == 0) {
+ deviceDesc->loadGains(node);
+ }
+ node = node->next;
+ }
+
+ ALOGV("loadDevice() adding device tag %s type %08x address %s",
+ deviceDesc->mTag.string(), type, deviceDesc->mAddress.string());
+
+ mDeclaredDevices.add(deviceDesc);
+
+ return NO_ERROR;
+}
+
+status_t HwModule::addOutputProfile(String8 name, const audio_config_t *config,
+ audio_devices_t device, String8 address)
+{
+ sp<IOProfile> profile = new IOProfile(name, AUDIO_PORT_ROLE_SOURCE);
+
+ profile->mSamplingRates.add(config->sample_rate);
+ profile->mChannelMasks.add(config->channel_mask);
+ profile->mFormats.add(config->format);
+
+ sp<DeviceDescriptor> devDesc = new DeviceDescriptor(device);
+ devDesc->mAddress = address;
+ profile->mSupportedDevices.add(devDesc);
+
+ profile->attach(this);
+ mOutputProfiles.add(profile);
+
+ return NO_ERROR;
+}
+
+status_t HwModule::removeOutputProfile(String8 name)
+{
+ for (size_t i = 0; i < mOutputProfiles.size(); i++) {
+ if (mOutputProfiles[i]->mName == name) {
+ mOutputProfiles.removeAt(i);
+ break;
+ }
+ }
+
+ return NO_ERROR;
+}
+
+status_t HwModule::addInputProfile(String8 name, const audio_config_t *config,
+ audio_devices_t device, String8 address)
+{
+ sp<IOProfile> profile = new IOProfile(name, AUDIO_PORT_ROLE_SINK);
+
+ profile->mSamplingRates.add(config->sample_rate);
+ profile->mChannelMasks.add(config->channel_mask);
+ profile->mFormats.add(config->format);
+
+ sp<DeviceDescriptor> devDesc = new DeviceDescriptor(device);
+ devDesc->mAddress = address;
+ profile->mSupportedDevices.add(devDesc);
+
+ ALOGV("addInputProfile() name %s rate %d mask 0x08", name.string(), config->sample_rate, config->channel_mask);
+
+ profile->attach(this);
+ mInputProfiles.add(profile);
+
+ return NO_ERROR;
+}
+
+status_t HwModule::removeInputProfile(String8 name)
+{
+ for (size_t i = 0; i < mInputProfiles.size(); i++) {
+ if (mInputProfiles[i]->mName == name) {
+ mInputProfiles.removeAt(i);
+ break;
+ }
+ }
+
+ return NO_ERROR;
+}
+
+
+void HwModule::dump(int fd)
+{
+ const size_t SIZE = 256;
+ char buffer[SIZE];
+ String8 result;
+
+ snprintf(buffer, SIZE, " - name: %s\n", mName);
+ result.append(buffer);
+ snprintf(buffer, SIZE, " - handle: %d\n", mHandle);
+ result.append(buffer);
+ snprintf(buffer, SIZE, " - version: %u.%u\n", mHalVersion >> 8, mHalVersion & 0xFF);
+ result.append(buffer);
+ write(fd, result.string(), result.size());
+ if (mOutputProfiles.size()) {
+ write(fd, " - outputs:\n", strlen(" - outputs:\n"));
+ for (size_t i = 0; i < mOutputProfiles.size(); i++) {
+ snprintf(buffer, SIZE, " output %zu:\n", i);
+ write(fd, buffer, strlen(buffer));
+ mOutputProfiles[i]->dump(fd);
+ }
+ }
+ if (mInputProfiles.size()) {
+ write(fd, " - inputs:\n", strlen(" - inputs:\n"));
+ for (size_t i = 0; i < mInputProfiles.size(); i++) {
+ snprintf(buffer, SIZE, " input %zu:\n", i);
+ write(fd, buffer, strlen(buffer));
+ mInputProfiles[i]->dump(fd);
+ }
+ }
+ if (mDeclaredDevices.size()) {
+ write(fd, " - devices:\n", strlen(" - devices:\n"));
+ for (size_t i = 0; i < mDeclaredDevices.size(); i++) {
+ mDeclaredDevices[i]->dump(fd, 4, i);
+ }
+ }
+}
+
+sp <HwModule> HwModuleCollection::getModuleFromName(const char *name) const
+{
+ sp <HwModule> module;
+
+ for (size_t i = 0; i < size(); i++)
+ {
+ if (strcmp(itemAt(i)->mName, name) == 0) {
+ return itemAt(i);
+ }
+ }
+ return module;
+}
+
+
+sp <HwModule> HwModuleCollection::getModuleForDevice(audio_devices_t device) const
+{
+ sp <HwModule> module;
+
+ for (size_t i = 0; i < size(); i++) {
+ if (itemAt(i)->mHandle == 0) {
+ continue;
+ }
+ if (audio_is_output_device(device)) {
+ for (size_t j = 0; j < itemAt(i)->mOutputProfiles.size(); j++)
+ {
+ if (itemAt(i)->mOutputProfiles[j]->mSupportedDevices.types() & device) {
+ return itemAt(i);
+ }
+ }
+ } else {
+ for (size_t j = 0; j < itemAt(i)->mInputProfiles.size(); j++) {
+ if (itemAt(i)->mInputProfiles[j]->mSupportedDevices.types() &
+ device & ~AUDIO_DEVICE_BIT_IN) {
+ return itemAt(i);
+ }
+ }
+ }
+ }
+ return module;
+}
+
+sp<DeviceDescriptor> HwModuleCollection::getDeviceDescriptor(const audio_devices_t device,
+ const char *device_address,
+ const char *device_name) const
+{
+ String8 address = (device_address == NULL) ? String8("") : String8(device_address);
+ // handle legacy remote submix case where the address was not always specified
+ if (device_distinguishes_on_address(device) && (address.length() == 0)) {
+ address = String8("0");
+ }
+
+ for (size_t i = 0; i < size(); i++) {
+ const sp<HwModule> hwModule = itemAt(i);
+ if (hwModule->mHandle == 0) {
+ continue;
+ }
+ DeviceVector deviceList =
+ hwModule->mDeclaredDevices.getDevicesFromTypeAddr(device, address);
+ if (!deviceList.isEmpty()) {
+ return deviceList.itemAt(0);
+ }
+ deviceList = hwModule->mDeclaredDevices.getDevicesFromType(device);
+ if (!deviceList.isEmpty()) {
+ return deviceList.itemAt(0);
+ }
+ }
+
+ sp<DeviceDescriptor> devDesc =
+ new DeviceDescriptor(device);
+ devDesc->mName = device_name;
+ devDesc->mAddress = address;
+ return devDesc;
+}
+
+status_t HwModuleCollection::dump(int fd) const
+{
+ const size_t SIZE = 256;
+ char buffer[SIZE];
+
+ snprintf(buffer, SIZE, "\nHW Modules dump:\n");
+ write(fd, buffer, strlen(buffer));
+ for (size_t i = 0; i < size(); i++) {
+ snprintf(buffer, SIZE, "- HW Module %zu:\n", i + 1);
+ write(fd, buffer, strlen(buffer));
+ itemAt(i)->dump(fd);
+ }
+ return NO_ERROR;
+}
+
+} //namespace android
diff --git a/services/audiopolicy/common/managerdefinitions/src/IOProfile.cpp b/services/audiopolicy/common/managerdefinitions/src/IOProfile.cpp
new file mode 100644
index 0000000..7b6d51d
--- /dev/null
+++ b/services/audiopolicy/common/managerdefinitions/src/IOProfile.cpp
@@ -0,0 +1,164 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "APM::IOProfile"
+//#define LOG_NDEBUG 0
+
+#include "IOProfile.h"
+#include "HwModule.h"
+#include "AudioGain.h"
+
+namespace android {
+
+IOProfile::IOProfile(const String8& name, audio_port_role_t role)
+ : AudioPort(name, AUDIO_PORT_TYPE_MIX, role)
+{
+}
+
+IOProfile::~IOProfile()
+{
+}
+
+// checks if the IO profile is compatible with specified parameters.
+// Sampling rate, format and channel mask must be specified in order to
+// get a valid a match
+bool IOProfile::isCompatibleProfile(audio_devices_t device,
+ String8 address,
+ uint32_t samplingRate,
+ uint32_t *updatedSamplingRate,
+ audio_format_t format,
+ audio_format_t *updatedFormat,
+ audio_channel_mask_t channelMask,
+ audio_channel_mask_t *updatedChannelMask,
+ uint32_t flags) const
+{
+ const bool isPlaybackThread = mType == AUDIO_PORT_TYPE_MIX && mRole == AUDIO_PORT_ROLE_SOURCE;
+ const bool isRecordThread = mType == AUDIO_PORT_TYPE_MIX && mRole == AUDIO_PORT_ROLE_SINK;
+ ALOG_ASSERT(isPlaybackThread != isRecordThread);
+
+
+ if (device != AUDIO_DEVICE_NONE) {
+ // just check types if multiple devices are selected
+ if (popcount(device & ~AUDIO_DEVICE_BIT_IN) > 1) {
+ if ((mSupportedDevices.types() & device) != device) {
+ return false;
+ }
+ } else if (mSupportedDevices.getDevice(device, address) == 0) {
+ return false;
+ }
+ }
+
+ if (samplingRate == 0) {
+ return false;
+ }
+ uint32_t myUpdatedSamplingRate = samplingRate;
+ if (isPlaybackThread && checkExactSamplingRate(samplingRate) != NO_ERROR) {
+ return false;
+ }
+ if (isRecordThread && checkCompatibleSamplingRate(samplingRate, &myUpdatedSamplingRate) !=
+ NO_ERROR) {
+ return false;
+ }
+
+ if (!audio_is_valid_format(format)) {
+ return false;
+ }
+ if (isPlaybackThread && checkExactFormat(format) != NO_ERROR) {
+ return false;
+ }
+ audio_format_t myUpdatedFormat = format;
+ if (isRecordThread && checkCompatibleFormat(format, &myUpdatedFormat) != NO_ERROR) {
+ return false;
+ }
+
+ if (isPlaybackThread && (!audio_is_output_channel(channelMask) ||
+ checkExactChannelMask(channelMask) != NO_ERROR)) {
+ return false;
+ }
+ audio_channel_mask_t myUpdatedChannelMask = channelMask;
+ if (isRecordThread && (!audio_is_input_channel(channelMask) ||
+ checkCompatibleChannelMask(channelMask, &myUpdatedChannelMask) != NO_ERROR)) {
+ return false;
+ }
+
+ if (isPlaybackThread && (mFlags & flags) != flags) {
+ return false;
+ }
+ // The only input flag that is allowed to be different is the fast flag.
+ // An existing fast stream is compatible with a normal track request.
+ // An existing normal stream is compatible with a fast track request,
+ // but the fast request will be denied by AudioFlinger and converted to normal track.
+ if (isRecordThread && ((mFlags ^ flags) &
+ ~AUDIO_INPUT_FLAG_FAST)) {
+ return false;
+ }
+
+ if (updatedSamplingRate != NULL) {
+ *updatedSamplingRate = myUpdatedSamplingRate;
+ }
+ if (updatedFormat != NULL) {
+ *updatedFormat = myUpdatedFormat;
+ }
+ if (updatedChannelMask != NULL) {
+ *updatedChannelMask = myUpdatedChannelMask;
+ }
+ return true;
+}
+
+void IOProfile::dump(int fd)
+{
+ const size_t SIZE = 256;
+ char buffer[SIZE];
+ String8 result;
+
+ AudioPort::dump(fd, 4);
+
+ snprintf(buffer, SIZE, " - flags: 0x%04x\n", mFlags);
+ result.append(buffer);
+ snprintf(buffer, SIZE, " - devices:\n");
+ result.append(buffer);
+ write(fd, result.string(), result.size());
+ for (size_t i = 0; i < mSupportedDevices.size(); i++) {
+ mSupportedDevices[i]->dump(fd, 6, i);
+ }
+}
+
+void IOProfile::log()
+{
+ const size_t SIZE = 256;
+ char buffer[SIZE];
+ String8 result;
+
+ ALOGV(" - sampling rates: ");
+ for (size_t i = 0; i < mSamplingRates.size(); i++) {
+ ALOGV(" %d", mSamplingRates[i]);
+ }
+
+ ALOGV(" - channel masks: ");
+ for (size_t i = 0; i < mChannelMasks.size(); i++) {
+ ALOGV(" 0x%04x", mChannelMasks[i]);
+ }
+
+ ALOGV(" - formats: ");
+ for (size_t i = 0; i < mFormats.size(); i++) {
+ ALOGV(" 0x%08x", mFormats[i]);
+ }
+
+ ALOGV(" - devices: 0x%04x\n", mSupportedDevices.types());
+ ALOGV(" - flags: 0x%04x\n", mFlags);
+}
+
+}; // namespace android
diff --git a/services/audiopolicy/common/managerdefinitions/src/SessionRoute.cpp b/services/audiopolicy/common/managerdefinitions/src/SessionRoute.cpp
new file mode 100644
index 0000000..7ecfa44
--- /dev/null
+++ b/services/audiopolicy/common/managerdefinitions/src/SessionRoute.cpp
@@ -0,0 +1,124 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "APM::SessionRoute"
+//#define LOG_NDEBUG 0
+
+#include "SessionRoute.h"
+#include "HwModule.h"
+#include "AudioGain.h"
+#include "DeviceDescriptor.h"
+#include <utils/Log.h>
+
+namespace android {
+
+// --- SessionRoute class implementation
+void SessionRoute::log(const char* prefix)
+{
+ ALOGI("%s[SessionRoute strm:0x%X, src:%d, sess:0x%X, dev:0x%X refs:%d act:%d",
+ prefix, mStreamType, mSource, mSession,
+ mDeviceDescriptor != 0 ? mDeviceDescriptor->type() : AUDIO_DEVICE_NONE,
+ mRefCount, mActivityCount);
+}
+
+// --- SessionRouteMap class implementation
+bool SessionRouteMap::hasRoute(audio_session_t session)
+{
+ return indexOfKey(session) >= 0 && valueFor(session)->mDeviceDescriptor != 0;
+}
+
+bool SessionRouteMap::hasRouteChanged(audio_session_t session)
+{
+ if (indexOfKey(session) >= 0) {
+ if (valueFor(session)->mChanged) {
+ valueFor(session)->mChanged = false;
+ return true;
+ }
+ }
+ return false;
+}
+
+void SessionRouteMap::removeRoute(audio_session_t session)
+{
+ sp<SessionRoute> route = indexOfKey(session) >= 0 ? valueFor(session) : 0;
+ if (route != 0) {
+ ALOG_ASSERT(route->mRefCount > 0);
+ --route->mRefCount;
+ if (route->mRefCount <= 0) {
+ removeItem(session);
+ }
+ }
+}
+
+int SessionRouteMap::incRouteActivity(audio_session_t session)
+{
+ sp<SessionRoute> route = indexOfKey(session) >= 0 ? valueFor(session) : 0;
+ return route != 0 ? ++(route->mActivityCount) : -1;
+}
+
+int SessionRouteMap::decRouteActivity(audio_session_t session)
+{
+ sp<SessionRoute> route = indexOfKey(session) >= 0 ? valueFor(session) : 0;
+ if (route != 0 && route->mActivityCount > 0) {
+ return --(route->mActivityCount);
+ } else {
+ return -1;
+ }
+}
+
+void SessionRouteMap::log(const char* caption)
+{
+ ALOGI("%s ----", caption);
+ for(size_t index = 0; index < size(); index++) {
+ valueAt(index)->log(" ");
+ }
+}
+
+void SessionRouteMap::addRoute(audio_session_t session,
+ audio_stream_type_t streamType,
+ audio_source_t source,
+ sp<DeviceDescriptor> descriptor,
+ uid_t uid)
+{
+ if (mMapType == MAPTYPE_INPUT && streamType != SessionRoute::STREAM_TYPE_NA) {
+ ALOGE("Adding Output Route to InputRouteMap");
+ return;
+ } else if (mMapType == MAPTYPE_OUTPUT && source != SessionRoute::SOURCE_TYPE_NA) {
+ ALOGE("Adding Input Route to OutputRouteMap");
+ return;
+ }
+
+ sp<SessionRoute> route = indexOfKey(session) >= 0 ? valueFor(session) : 0;
+
+ if (route != 0) {
+ if (((route->mDeviceDescriptor == 0) && (descriptor != 0)) ||
+ ((route->mDeviceDescriptor != 0) &&
+ ((descriptor == 0) || (!route->mDeviceDescriptor->equals(descriptor))))) {
+ route->mChanged = true;
+ }
+ route->mRefCount++;
+ route->mDeviceDescriptor = descriptor;
+ } else {
+ route = new SessionRoute(session, streamType, source, descriptor, uid);
+ route->mRefCount++;
+ add(session, route);
+ if (descriptor != 0) {
+ route->mChanged = true;
+ }
+ }
+}
+
+} // namespace android
diff --git a/services/audiopolicy/common/managerdefinitions/src/SoundTriggerSession.cpp b/services/audiopolicy/common/managerdefinitions/src/SoundTriggerSession.cpp
new file mode 100644
index 0000000..8ca3ae0
--- /dev/null
+++ b/services/audiopolicy/common/managerdefinitions/src/SoundTriggerSession.cpp
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "APM::SoundTriggerSession"
+//#define LOG_NDEBUG 0
+
+#include "SoundTriggerSession.h"
+
+
+namespace android {
+
+status_t SoundTriggerSessionCollection::acquireSession(audio_session_t session,
+ audio_io_handle_t ioHandle)
+{
+ add(session, ioHandle);
+
+ return NO_ERROR;
+}
+
+status_t SoundTriggerSessionCollection::releaseSession(audio_session_t session)
+{
+ ssize_t index = indexOfKey(session);
+ if (index < 0) {
+ ALOGW("acquireSoundTriggerSession() session %d not registered", session);
+ return BAD_VALUE;
+ }
+
+ removeItem(session);
+ return NO_ERROR;
+}
+
+}; //namespace android
diff --git a/services/audiopolicy/common/managerdefinitions/src/StreamDescriptor.cpp b/services/audiopolicy/common/managerdefinitions/src/StreamDescriptor.cpp
new file mode 100644
index 0000000..b682e2c
--- /dev/null
+++ b/services/audiopolicy/common/managerdefinitions/src/StreamDescriptor.cpp
@@ -0,0 +1,162 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "APM::Volumes"
+//#define LOG_NDEBUG 0
+
+//#define VERY_VERBOSE_LOGGING
+#ifdef VERY_VERBOSE_LOGGING
+#define ALOGVV ALOGV
+#else
+#define ALOGVV(a...) do { } while(0)
+#endif
+
+#include "StreamDescriptor.h"
+#include <utils/Log.h>
+#include <utils/String8.h>
+
+namespace android {
+
+// --- StreamDescriptor class implementation
+
+StreamDescriptor::StreamDescriptor()
+ : mIndexMin(0), mIndexMax(1), mCanBeMuted(true)
+{
+ mIndexCur.add(AUDIO_DEVICE_OUT_DEFAULT, 0);
+}
+
+int StreamDescriptor::getVolumeIndex(audio_devices_t device) const
+{
+ device = Volume::getDeviceForVolume(device);
+ // there is always a valid entry for AUDIO_DEVICE_OUT_DEFAULT
+ if (mIndexCur.indexOfKey(device) < 0) {
+ device = AUDIO_DEVICE_OUT_DEFAULT;
+ }
+ return mIndexCur.valueFor(device);
+}
+
+void StreamDescriptor::clearCurrentVolumeIndex()
+{
+ mIndexCur.clear();
+}
+
+void StreamDescriptor::addCurrentVolumeIndex(audio_devices_t device, int index)
+{
+ mIndexCur.add(device, index);
+}
+
+void StreamDescriptor::setVolumeIndexMin(int volIndexMin)
+{
+ mIndexMin = volIndexMin;
+}
+
+void StreamDescriptor::setVolumeIndexMax(int volIndexMax)
+{
+ mIndexMax = volIndexMax;
+}
+
+void StreamDescriptor::setVolumeCurvePoint(Volume::device_category deviceCategory,
+ const VolumeCurvePoint *point)
+{
+ mVolumeCurve[deviceCategory] = point;
+}
+
+void StreamDescriptor::dump(int fd) const
+{
+ const size_t SIZE = 256;
+ char buffer[SIZE];
+ String8 result;
+
+ snprintf(buffer, SIZE, "%s %02d %02d ",
+ mCanBeMuted ? "true " : "false", mIndexMin, mIndexMax);
+ result.append(buffer);
+ for (size_t i = 0; i < mIndexCur.size(); i++) {
+ snprintf(buffer, SIZE, "%04x : %02d, ",
+ mIndexCur.keyAt(i),
+ mIndexCur.valueAt(i));
+ result.append(buffer);
+ }
+ result.append("\n");
+
+ write(fd, result.string(), result.size());
+}
+
+StreamDescriptorCollection::StreamDescriptorCollection()
+{
+ for (size_t stream = 0 ; stream < AUDIO_STREAM_CNT; stream++) {
+ add(static_cast<audio_stream_type_t>(stream), StreamDescriptor());
+ }
+}
+
+bool StreamDescriptorCollection::canBeMuted(audio_stream_type_t stream)
+{
+ return valueAt(stream).canBeMuted();
+}
+
+void StreamDescriptorCollection::clearCurrentVolumeIndex(audio_stream_type_t stream)
+{
+ editValueAt(stream).clearCurrentVolumeIndex();
+}
+
+void StreamDescriptorCollection::addCurrentVolumeIndex(audio_stream_type_t stream,
+ audio_devices_t device, int index)
+{
+ editValueAt(stream).addCurrentVolumeIndex(device, index);
+}
+
+void StreamDescriptorCollection::setVolumeCurvePoint(audio_stream_type_t stream,
+ Volume::device_category deviceCategory,
+ const VolumeCurvePoint *point)
+{
+ editValueAt(stream).setVolumeCurvePoint(deviceCategory, point);
+}
+
+const VolumeCurvePoint *StreamDescriptorCollection::getVolumeCurvePoint(audio_stream_type_t stream,
+ Volume::device_category deviceCategory) const
+{
+ return valueAt(stream).getVolumeCurvePoint(deviceCategory);
+}
+
+void StreamDescriptorCollection::setVolumeIndexMin(audio_stream_type_t stream,int volIndexMin)
+{
+ return editValueAt(stream).setVolumeIndexMin(volIndexMin);
+}
+
+void StreamDescriptorCollection::setVolumeIndexMax(audio_stream_type_t stream,int volIndexMax)
+{
+ return editValueAt(stream).setVolumeIndexMax(volIndexMax);
+}
+
+status_t StreamDescriptorCollection::dump(int fd) const
+{
+ const size_t SIZE = 256;
+ char buffer[SIZE];
+
+ snprintf(buffer, SIZE, "\nStreams dump:\n");
+ write(fd, buffer, strlen(buffer));
+ snprintf(buffer, SIZE,
+ " Stream Can be muted Index Min Index Max Index Cur [device : index]...\n");
+ write(fd, buffer, strlen(buffer));
+ for (size_t i = 0; i < size(); i++) {
+ snprintf(buffer, SIZE, " %02zu ", i);
+ write(fd, buffer, strlen(buffer));
+ valueAt(i).dump(fd);
+ }
+
+ return NO_ERROR;
+}
+
+}; // namespace android
diff --git a/services/audiopolicy/engine/interface/AudioPolicyManagerInterface.h b/services/audiopolicy/engine/interface/AudioPolicyManagerInterface.h
new file mode 100755
index 0000000..e73e543
--- /dev/null
+++ b/services/audiopolicy/engine/interface/AudioPolicyManagerInterface.h
@@ -0,0 +1,171 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <AudioPolicyManagerObserver.h>
+#include <RoutingStrategy.h>
+#include <Volume.h>
+#include <HwModule.h>
+#include <DeviceDescriptor.h>
+#include <system/audio.h>
+#include <system/audio_policy.h>
+#include <utils/Errors.h>
+#include <utils/Vector.h>
+
+namespace android {
+
+/**
+ * This interface is dedicated to the policy manager that a Policy Engine shall implement.
+ */
+class AudioPolicyManagerInterface
+{
+public:
+ /**
+ * Checks if the engine was correctly initialized.
+ *
+ * @return NO_ERROR if initialization has been done correctly, error code otherwise..
+ */
+ virtual status_t initCheck() = 0;
+
+ /**
+ * Sets the Manager observer that allows the engine to retrieve information on collection
+ * of devices, streams, HwModules, ...
+ *
+ * @param[in] observer handle on the manager.
+ */
+ virtual void setObserver(AudioPolicyManagerObserver *observer) = 0;
+
+ /**
+ * Get the input device selected for a given input source.
+ *
+ * @param[in] inputSource to get the selected input device associated to
+ *
+ * @return selected input device for the given input source, may be none if error.
+ */
+ virtual audio_devices_t getDeviceForInputSource(audio_source_t inputSource) const = 0;
+
+ /**
+ * Get the output device associated to a given strategy.
+ *
+ * @param[in] stream type for which the selected ouput device is requested.
+ *
+ * @return selected ouput device for the given strategy, may be none if error.
+ */
+ virtual audio_devices_t getDeviceForStrategy(routing_strategy stategy) const = 0;
+
+ /**
+ * Get the strategy selected for a given stream type.
+ *
+ * @param[in] stream: for which the selected strategy followed by is requested.
+ *
+ * @return strategy to be followed.
+ */
+ virtual routing_strategy getStrategyForStream(audio_stream_type_t stream) = 0;
+
+ /**
+ * Get the strategy selected for a given usage.
+ *
+ * @param[in] usage to get the selected strategy followed by.
+ *
+ * @return strategy to be followed.
+ */
+ virtual routing_strategy getStrategyForUsage(audio_usage_t usage) = 0;
+
+ /**
+ * Set the Telephony Mode.
+ *
+ * @param[in] mode: Android Phone state (normal, ringtone, csv, in communication)
+ *
+ * @return NO_ERROR if Telephony Mode set correctly, error code otherwise.
+ */
+ virtual status_t setPhoneState(audio_mode_t mode) = 0;
+
+ /**
+ * Get the telephony Mode
+ *
+ * @return the current telephony mode
+ */
+ virtual audio_mode_t getPhoneState() const = 0;
+
+ /**
+ * Set Force Use config for a given usage.
+ *
+ * @param[in] usage for which a configuration shall be forced.
+ * @param[in] config wished to be forced for the given usage.
+ *
+ * @return NO_ERROR if the Force Use config was set correctly, error code otherwise (e.g. config
+ * not allowed a given usage...)
+ */
+ virtual status_t setForceUse(audio_policy_force_use_t usage,
+ audio_policy_forced_cfg_t config) = 0;
+
+ /**
+ * Get Force Use config for a given usage.
+ *
+ * @param[in] usage for which a configuration shall be forced.
+ *
+ * @return config wished to be forced for the given usage.
+ */
+ virtual audio_policy_forced_cfg_t getForceUse(audio_policy_force_use_t usage) const = 0;
+
+ /**
+ * Set the connection state of device(s).
+ *
+ * @param[in] devDesc for which the state has changed.
+ * @param[in] state of availability of this(these) device(s).
+ *
+ * @return NO_ERROR if devices criterion updated correctly, error code otherwise.
+ */
+ virtual status_t setDeviceConnectionState(const android::sp<android::DeviceDescriptor> devDesc,
+ audio_policy_dev_state_t state) = 0;
+
+ /**
+ * Translate a volume index given by the UI to an amplification value in dB for a stream type
+ * and a device category.
+ *
+ * @param[in] deviceCategory for which the conversion is requested.
+ * @param[in] stream type for which the conversion is requested.
+ * @param[in] indexInUi index received from the UI to be translated.
+ *
+ * @return amplification value in dB matching the UI index for this given device and stream.
+ */
+ virtual float volIndexToDb(Volume::device_category deviceCategory, audio_stream_type_t stream,
+ int indexInUi) = 0;
+
+ /**
+ * Initialize the min / max index of volume applicable for a given stream type. These indexes
+ * will be used upon conversion of UI index to volume amplification.
+ *
+ * @param[in] stream type for which the indexes need to be set
+ * @param[in] indexMin Minimum index allowed for this stream.
+ * @param[in] indexMax Maximum index allowed for this stream.
+ */
+ virtual status_t initStreamVolume(audio_stream_type_t stream, int indexMin, int indexMax) = 0;
+
+ /**
+ * Initialize volume curves for each strategy and device category
+ *
+ * @param[in] isSpeakerDrcEnabled true on devices that use DRC on the DEVICE_CATEGORY_SPEAKER
+ path to boost soft sounds, used to adjust volume curves accordingly
+ */
+ virtual void initializeVolumeCurves(bool isSpeakerDrcEnabled) = 0;
+
+protected:
+ virtual ~AudioPolicyManagerInterface() {}
+};
+
+}; // namespace android
diff --git a/services/audiopolicy/engine/interface/AudioPolicyManagerObserver.h b/services/audiopolicy/engine/interface/AudioPolicyManagerObserver.h
new file mode 100755
index 0000000..6d43df2
--- /dev/null
+++ b/services/audiopolicy/engine/interface/AudioPolicyManagerObserver.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <AudioGain.h>
+#include <AudioPort.h>
+#include <AudioPatch.h>
+#include <IOProfile.h>
+#include <DeviceDescriptor.h>
+#include <AudioInputDescriptor.h>
+#include <AudioOutputDescriptor.h>
+#include <AudioPolicyMix.h>
+#include <SoundTriggerSession.h>
+#include <StreamDescriptor.h>
+
+namespace android {
+
+/**
+ * This interface is an observer that the manager shall implement to allows e.g. the engine
+ * to access to policy pillars elements (like output / input descritors collections,
+ * HwModule collections, AudioMix, ...
+ */
+class AudioPolicyManagerObserver
+{
+public:
+ virtual const AudioPatchCollection &getAudioPatches() const = 0;
+
+ virtual const SoundTriggerSessionCollection &getSoundTriggerSessionCollection() const = 0;
+
+ virtual const AudioPolicyMixCollection &getAudioPolicyMixCollection() const = 0;
+
+ virtual const SwAudioOutputCollection &getOutputs() const = 0;
+
+ virtual const AudioInputCollection &getInputs() const = 0;
+
+ virtual const DeviceVector &getAvailableOutputDevices() const = 0;
+
+ virtual const DeviceVector &getAvailableInputDevices() const = 0;
+
+ virtual StreamDescriptorCollection &getStreamDescriptors() = 0;
+
+ virtual const sp<DeviceDescriptor> &getDefaultOutputDevice() const = 0;
+
+protected:
+ virtual ~AudioPolicyManagerObserver() {}
+};
+
+}; // namespace android
diff --git a/services/audiopolicy/engineconfigurable/Android.mk b/services/audiopolicy/engineconfigurable/Android.mk
new file mode 100755
index 0000000..b18c520
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/Android.mk
@@ -0,0 +1,59 @@
+ifeq ($(USE_CONFIGURABLE_AUDIO_POLICY), 1)
+
+LOCAL_PATH := $(call my-dir)
+
+# Component build
+#######################################################################
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+ src/Engine.cpp \
+ src/EngineInstance.cpp \
+ src/Stream.cpp \
+ src/Strategy.cpp \
+ src/Usage.cpp \
+ src/InputSource.cpp \
+
+audio_policy_engine_includes_common := \
+ $(TOPDIR)frameworks/av/services/audiopolicy/engineconfigurable/include \
+ $(TOPDIR)frameworks/av/services/audiopolicy/engineconfigurable/interface \
+ $(TOPDIR)frameworks/av/services/audiopolicy/engine/interface
+
+LOCAL_CFLAGS += \
+ -Wall \
+ -Werror \
+ -Wextra \
+
+LOCAL_EXPORT_C_INCLUDE_DIRS := \
+ $(audio_policy_engine_includes_common)
+
+LOCAL_C_INCLUDES := \
+ $(audio_policy_engine_includes_common) \
+ $(TARGET_OUT_HEADERS)/hw \
+ $(call include-path-for, frameworks-av) \
+ $(call include-path-for, audio-utils) \
+ $(TOPDIR)frameworks/av/services/audiopolicy/common/include
+
+
+LOCAL_MODULE := libaudiopolicyengineconfigurable
+LOCAL_MODULE_TAGS := optional
+LOCAL_STATIC_LIBRARIES := \
+ libmedia_helper \
+ libaudiopolicypfwwrapper \
+ libaudiopolicycomponents
+
+LOCAL_SHARED_LIBRARIES := \
+ libcutils \
+ libutils \
+ libaudioutils \
+ libparameter
+
+include $(BUILD_SHARED_LIBRARY)
+
+#######################################################################
+# Recursive call sub-folder Android.mk
+#
+include $(call all-makefiles-under,$(LOCAL_PATH))
+
+endif
diff --git a/services/audiopolicy/engineconfigurable/include/AudioPolicyEngineInstance.h b/services/audiopolicy/engineconfigurable/include/AudioPolicyEngineInstance.h
new file mode 100755
index 0000000..6c4be2c
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/include/AudioPolicyEngineInstance.h
@@ -0,0 +1,81 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+class AudioPolicyManagerInterface;
+class AudioPolicyPluginInterface;
+
+namespace android
+{
+namespace audio_policy
+{
+
+class Engine;
+
+class EngineInstance
+{
+protected:
+ EngineInstance();
+
+public:
+ virtual ~EngineInstance();
+
+ /**
+ * Get Audio Policy Engine instance.
+ *
+ * @return pointer to Route Manager Instance object.
+ */
+ static EngineInstance *getInstance();
+
+ /**
+ * Interface query.
+ * The first client of an interface of the policy engine will start the singleton.
+ *
+ * @tparam RequestedInterface: interface that the client is wishing to retrieve.
+ *
+ * @return interface handle.
+ */
+ template <class RequestedInterface>
+ RequestedInterface *queryInterface() const;
+
+protected:
+ /**
+ * Get Audio Policy Engine instance.
+ *
+ * @return Audio Policy Engine singleton.
+ */
+ Engine *getEngine() const;
+
+private:
+ /* Copy facilities are put private to disable copy. */
+ EngineInstance(const EngineInstance &object);
+ EngineInstance &operator=(const EngineInstance &object);
+};
+
+/**
+ * Limit template instantation to supported type interfaces.
+ * Compile time error will claim if invalid interface is requested.
+ */
+template <>
+AudioPolicyManagerInterface *EngineInstance::queryInterface() const;
+
+template <>
+AudioPolicyPluginInterface *EngineInstance::queryInterface() const;
+
+}; // namespace audio_policy
+
+}; // namespace android
diff --git a/services/audiopolicy/engineconfigurable/include/EngineDefinition.h b/services/audiopolicy/engineconfigurable/include/EngineDefinition.h
new file mode 100755
index 0000000..54d8db5
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/include/EngineDefinition.h
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <Volume.h>
+#include <vector>
+
+typedef std::vector<VolumeCurvePoint> VolumeCurvePoints;
diff --git a/services/audiopolicy/engineconfigurable/interface/AudioPolicyPluginInterface.h b/services/audiopolicy/engineconfigurable/interface/AudioPolicyPluginInterface.h
new file mode 100755
index 0000000..74daba5
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/interface/AudioPolicyPluginInterface.h
@@ -0,0 +1,147 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <RoutingStrategy.h>
+#include <EngineDefinition.h>
+#include <Volume.h>
+#include <system/audio.h>
+#include <utils/Errors.h>
+#include <string>
+#include <vector>
+
+namespace android {
+
+/**
+ * This interface allows the parameter plugin to:
+ * - instantiate all the members of the policy engine (strategies, input sources, usages, profiles)
+ * - keep up to date the attributes of these policy members ( i.e. devices to be used for a
+ * strategy, strategy to be followed by a usage or a stream, ...)
+ */
+class AudioPolicyPluginInterface
+{
+public:
+ /**
+ * Add a strategy to the engine
+ *
+ * @param[in] name of the strategy to add
+ * @param[in] identifier: the numerical value associated to this member. It MUST match either
+ * system/audio.h or system/audio_policy.h enumration value in order to link the
+ * parameter controled by the PFW and the policy manager component.
+ *
+ * @return NO_ERROR if the strategy has been added successfully, error code otherwise.
+ *
+ */
+ virtual android::status_t addStrategy(const std::string &name, routing_strategy id) = 0;
+
+ /**
+ * Add a streams to the engine.
+ *
+ * @param[in] name of the stream to add
+ * @param[in] identifier: the numerical value associated to this member. It MUST match either
+ * system/audio.h or system/audio_policy.h enumration value in order to link the
+ * parameter controled by the PFW and the policy manager component.
+ *
+ * @return NO_ERROR if the stream has been added successfully, error code otherwise.
+ *
+ */
+ virtual android::status_t addStream(const std::string &name, audio_stream_type_t id) = 0;
+
+ /**
+ * Add a usage to the engine
+ *
+ * @param[in] name of the usage to add
+ * @param[in] identifier: the numerical value associated to this member. It MUST match either
+ * system/audio.h or system/audio_policy.h enumration value in order to link the
+ * parameter controled by the PFW and the policy manager component.
+ *
+ * @return NO_ERROR if the usage has been added successfully, error code otherwise.
+ *
+ */
+ virtual android::status_t addUsage(const std::string &name, audio_usage_t id) = 0;
+
+ /**
+ * Add an input source to the engine
+ *
+ * @param[in] name of the input source to add
+ * @param[in] identifier: the numerical value associated to this member. It MUST match either
+ * system/audio.h or system/audio_policy.h enumration value in order to link the
+ * parameter controled by the PFW and the policy manager component.
+ *
+ * @return NO_ERROR if the input source has been added successfully, error code otherwise.
+ *
+ */
+ virtual android::status_t addInputSource(const std::string &name, audio_source_t id) = 0;
+
+ /**
+ * Set the device to be used by a strategy.
+ *
+ * @param[in] strategy: name of the strategy for which the device to use has to be set
+ * @param[in] devices; mask of devices to be used for the given strategy.
+ *
+ * @return true if the devices were set correclty for this strategy, false otherwise.
+ */
+ virtual bool setDeviceForStrategy(const routing_strategy &strategy, audio_devices_t devices) = 0;
+
+ /**
+ * Set the strategy to be followed by a stream.
+ *
+ * @param[in] stream: name of the stream for which the strategy to use has to be set
+ * @param[in] strategy to follow for the given stream.
+ *
+ * @return true if the strategy were set correclty for this stream, false otherwise.
+ */
+ virtual bool setStrategyForStream(const audio_stream_type_t &stream, routing_strategy strategy) = 0;
+
+ /**
+ * Set the strategy to be followed by a stream.
+ *
+ * @param[in] stream: name of the stream for which the strategy to use has to be set
+ * @param[in] strategy to follow for the given stream.
+ *
+ * @return true if the strategy were set correclty for this stream, false otherwise.
+ */
+ virtual bool setVolumeProfileForStream(const audio_stream_type_t &stream,
+ Volume::device_category category,
+ const VolumeCurvePoints &points) = 0;
+
+ /**
+ * Set the strategy to be followed by a usage.
+ *
+ * @param[in] usage: name of the usage for which the strategy to use has to be set
+ * @param[in] strategy to follow for the given usage.
+ *
+ * @return true if the strategy were set correclty for this usage, false otherwise.
+ */
+ virtual bool setStrategyForUsage(const audio_usage_t &usage, routing_strategy strategy) = 0;
+
+ /**
+ * Set the input device to be used by an input source.
+ *
+ * @param[in] inputSource: name of the input source for which the device to use has to be set
+ * @param[in] devices; mask of devices to be used for the given input source.
+ *
+ * @return true if the devices were set correclty for this input source, false otherwise.
+ */
+ virtual bool setDeviceForInputSource(const audio_source_t &inputSource,
+ audio_devices_t device) = 0;
+
+protected:
+ virtual ~AudioPolicyPluginInterface() {}
+};
+
+}; // namespace android
diff --git a/services/audiopolicy/engineconfigurable/parameter-framework/Android.mk b/services/audiopolicy/engineconfigurable/parameter-framework/Android.mk
new file mode 100644
index 0000000..c402fd5
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/parameter-framework/Android.mk
@@ -0,0 +1,7 @@
+LOCAL_PATH := $(call my-dir)
+
+#######################################################################
+# Recursive call sub-folder Android.mk
+#######################################################################
+
+include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/services/audiopolicy/engineconfigurable/parameter-framework/example/Android.mk b/services/audiopolicy/engineconfigurable/parameter-framework/example/Android.mk
new file mode 100644
index 0000000..e9b1902
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/parameter-framework/example/Android.mk
@@ -0,0 +1,105 @@
+################################################################################################
+#
+# @NOTE:
+# Audio Policy Engine configurable example for generic device build
+#
+# Any vendor shall have its own configuration within the corresponding device folder
+#
+################################################################################################
+
+
+LOCAL_PATH := $(call my-dir)
+
+PFW_CORE := external/parameter-framework
+BUILD_PFW_SETTINGS := $(PFW_CORE)/support/android/build_pfw_settings.mk
+PFW_DEFAULT_SCHEMAS_DIR := $(PFW_CORE)/Schemas
+PFW_SCHEMAS_DIR := $(PFW_DEFAULT_SCHEMAS_DIR)
+
+##################################################################
+# CONFIGURATION FILES
+##################################################################
+######### Policy PFW top level file #########
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := ParameterFrameworkConfigurationPolicy.xml
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_CLASS := ETC
+LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/parameter-framework
+LOCAL_SRC_FILES := $(LOCAL_MODULE)
+include $(BUILD_PREBUILT)
+
+
+########## Policy PFW Structures #########
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := PolicyClass.xml
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_CLASS := ETC
+LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/parameter-framework/Structure/Policy
+LOCAL_SRC_FILES := Structure/$(LOCAL_MODULE)
+include $(BUILD_PREBUILT)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := PolicySubsystem.xml
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_CLASS := ETC
+LOCAL_REQUIRED_MODULES := \
+ PolicySubsystem-CommonTypes.xml \
+ PolicySubsystem-Volume.xml \
+ libpolicy-subsystem \
+
+LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/parameter-framework/Structure/Policy
+LOCAL_SRC_FILES := Structure/$(LOCAL_MODULE)
+include $(BUILD_PREBUILT)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := PolicySubsystem-CommonTypes.xml
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_CLASS := ETC
+LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/parameter-framework/Structure/Policy
+LOCAL_SRC_FILES := Structure/$(LOCAL_MODULE)
+include $(BUILD_PREBUILT)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := PolicySubsystem-Volume.xml
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_CLASS := ETC
+LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/parameter-framework/Structure/Policy
+LOCAL_SRC_FILES := Structure/$(LOCAL_MODULE)
+include $(BUILD_PREBUILT)
+
+######### Policy PFW Settings #########
+include $(CLEAR_VARS)
+LOCAL_MODULE := parameter-framework.policy
+LOCAL_MODULE_STEM := PolicyConfigurableDomains.xml
+LOCAL_MODULE_CLASS := ETC
+LOCAL_MODULE_RELATIVE_PATH := parameter-framework/Settings/Policy
+LOCAL_ADDITIONAL_DEPENDENCIES := \
+ PolicyClass.xml \
+ PolicySubsystem.xml \
+ ParameterFrameworkConfigurationPolicy.xml
+
+ifeq ($(pfw_rebuild_settings),true)
+PFW_TOPLEVEL_FILE := $(TARGET_OUT_ETC)/parameter-framework/ParameterFrameworkConfigurationPolicy.xml
+PFW_CRITERIA_FILE := $(LOCAL_PATH)/policy_criteria.txt
+PFW_EDD_FILES := \
+ $(LOCAL_PATH)/Settings/device_for_strategy_media.pfw \
+ $(LOCAL_PATH)/Settings/device_for_strategy_phone.pfw \
+ $(LOCAL_PATH)/Settings/device_for_strategy_sonification.pfw \
+ $(LOCAL_PATH)/Settings/device_for_strategy_sonification_respectful.pfw \
+ $(LOCAL_PATH)/Settings/device_for_strategy_dtmf.pfw \
+ $(LOCAL_PATH)/Settings/device_for_strategy_enforced_audible.pfw \
+ $(LOCAL_PATH)/Settings/device_for_strategy_transmitted_through_speaker.pfw \
+ $(LOCAL_PATH)/Settings/device_for_strategy_accessibility.pfw \
+ $(LOCAL_PATH)/Settings/device_for_strategy_rerouting.pfw \
+ $(LOCAL_PATH)/Settings/strategy_for_stream.pfw \
+ $(LOCAL_PATH)/Settings/strategy_for_usage.pfw \
+ $(LOCAL_PATH)/Settings/device_for_input_source.pfw \
+ $(LOCAL_PATH)/Settings/volumes.pfw
+
+include $(BUILD_PFW_SETTINGS)
+else
+# Use the existing file
+LOCAL_SRC_FILES := Settings/$(LOCAL_MODULE_STEM)
+include $(BUILD_PREBUILT)
+endif # pfw_rebuild_settings
diff --git a/services/audiopolicy/engineconfigurable/parameter-framework/example/ParameterFrameworkConfigurationPolicy.xml b/services/audiopolicy/engineconfigurable/parameter-framework/example/ParameterFrameworkConfigurationPolicy.xml
new file mode 100755
index 0000000..6905201
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/parameter-framework/example/ParameterFrameworkConfigurationPolicy.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ParameterFrameworkConfiguration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="Schemas/ParameterFrameworkConfiguration.xsd"
+ SystemClassName="Policy" ServerPort="5019" TuningAllowed="true">
+
+ <SubsystemPlugins>
+ <Location Folder="">
+ <Plugin Name="libpolicy-subsystem.so"/>
+ </Location>
+ </SubsystemPlugins>
+ <StructureDescriptionFileLocation Path="Structure/Policy/PolicyClass.xml"/>
+ <SettingsConfiguration>
+ <ConfigurableDomainsFileLocation Path="Settings/Policy/PolicyConfigurableDomains.xml"/>
+ </SettingsConfiguration>
+</ParameterFrameworkConfiguration>
diff --git a/services/audiopolicy/engineconfigurable/parameter-framework/example/README.md b/services/audiopolicy/engineconfigurable/parameter-framework/example/README.md
new file mode 100644
index 0000000..92668e1
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/parameter-framework/example/README.md
@@ -0,0 +1,11 @@
+Configurable Policy Engine Example
+================================
+
+This folder exposes a generic functional configurable policy engine configuration files
+to provide to have a product following the nexus experience.
+
+A vendor wishing to customize the behavior shall provides its own set of configuration files
+within the device folder for the product to customize.
+
+For any question about the parameter framework and configuration files,
+See [the wiki on github](https://github.com/01org/parameter-framework/wiki).
diff --git a/services/audiopolicy/engineconfigurable/parameter-framework/example/Settings/PolicyConfigurableDomains.xml b/services/audiopolicy/engineconfigurable/parameter-framework/example/Settings/PolicyConfigurableDomains.xml
new file mode 100644
index 0000000..8cb0723
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/parameter-framework/example/Settings/PolicyConfigurableDomains.xml
@@ -0,0 +1,11298 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- #### DO NOT EDIT THIS FILE #### -->
+<ConfigurableDomains xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Schemas/ConfigurableDomains.xsd" SystemClassName="Policy">
+ <ConfigurableDomain Name="DeviceForStrategy.Media.UnreachableDevices" SequenceAware="false">
+ <Configurations>
+ <Configuration Name="Calibration">
+ <CompoundRule Type="All"/>
+ </Configuration>
+ </Configurations>
+ <ConfigurableElements>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/fm"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/speaker_safe"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/earpiece"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/bluetooth_sco"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/bluetooth_sco_headset"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/bluetooth_sco_carkit"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/telephony_tx"/>
+ </ConfigurableElements>
+ <Settings>
+ <Configuration Name="Calibration">
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/fm">
+ <BitParameter Name="fm">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/speaker_safe">
+ <BitParameter Name="speaker_safe">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ </Settings>
+ </ConfigurableDomain>
+ <ConfigurableDomain Name="DeviceForStrategy.Media.Device2" SequenceAware="false">
+ <Configurations>
+ <Configuration Name="RemoteSubmix">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="RemoteSubmix"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="BluetoothA2dp">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="ForceUseForMedia" MatchesWhen="IsNot" Value="ForceNoBtA2dp"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="BluetoothA2dp"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="BluetoothA2dpHeadphone">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="ForceUseForMedia" MatchesWhen="IsNot" Value="ForceNoBtA2dp"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="BluetoothA2dpHeadphones"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="BluetoothA2dpSpeaker">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="ForceUseForMedia" MatchesWhen="IsNot" Value="ForceNoBtA2dp"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="BluetoothA2dpSpeaker"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="ForceSpeaker">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="ForceUseForMedia" MatchesWhen="Is" Value="ForceSpeaker"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="Speaker"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForHdmiSystemAudio" MatchesWhen="IsNot" Value="ForceHdmiSystemEnforced"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="WiredHeadphone">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="WiredHeadphone"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="Line">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="Line"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="WiredHeadset">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="WiredHeadset"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="UsbAccessory">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="UsbAccessory"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="UsbDevice">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="UsbDevice"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="DgtlDockHeadset">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="DgtlDockHeadset"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="AuxDigital">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="Hdmi"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="AnlgDockHeadset">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="AnlgDockHeadset"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForDock" MatchesWhen="Is" Value="ForceAnalogDock"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="Speaker">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="Speaker"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForHdmiSystemAudio" MatchesWhen="IsNot" Value="ForceHdmiSystemEnforced"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="Default">
+ <CompoundRule Type="All"/>
+ </Configuration>
+ </Configurations>
+ <ConfigurableElements>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/speaker"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/hdmi"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/dgtl_dock_headset"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/angl_dock_headset"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/usb_device"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/usb_accessory"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/wired_headset"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/wired_headphone"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/bluetooth_a2dp_speaker"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/bluetooth_a2dp_headphones"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/bluetooth_a2dp"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/remote_submix"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/line"/>
+ </ConfigurableElements>
+ <Settings>
+ <Configuration Name="RemoteSubmix">
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="BluetoothA2dp">
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="BluetoothA2dpHeadphone">
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="BluetoothA2dpSpeaker">
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="ForceSpeaker">
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="WiredHeadphone">
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="Line">
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/line">
+ <BitParameter Name="line">1</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="WiredHeadset">
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="UsbAccessory">
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="UsbDevice">
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="DgtlDockHeadset">
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="AuxDigital">
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="AnlgDockHeadset">
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="Speaker">
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="Default">
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ </Settings>
+ </ConfigurableDomain>
+ <ConfigurableDomain Name="DeviceForStrategy.Media.Arc" SequenceAware="false">
+ <Configurations>
+ <Configuration Name="Selected">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="HdmiArc"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="NotSelected">
+ <CompoundRule Type="All"/>
+ </Configuration>
+ </Configurations>
+ <ConfigurableElements>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/hdmi_arc"/>
+ </ConfigurableElements>
+ <Settings>
+ <Configuration Name="Selected">
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/hdmi_arc">
+ <BitParameter Name="hdmi_arc">1</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="NotSelected">
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/hdmi_arc">
+ <BitParameter Name="hdmi_arc">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ </Settings>
+ </ConfigurableDomain>
+ <ConfigurableDomain Name="DeviceForStrategy.Media.Spdif" SequenceAware="false">
+ <Configurations>
+ <Configuration Name="Selected">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="Spdif"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="NotSelected">
+ <CompoundRule Type="All"/>
+ </Configuration>
+ </Configurations>
+ <ConfigurableElements>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/spdif"/>
+ </ConfigurableElements>
+ <Settings>
+ <Configuration Name="Selected">
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/spdif">
+ <BitParameter Name="spdif">1</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="NotSelected">
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/spdif">
+ <BitParameter Name="spdif">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ </Settings>
+ </ConfigurableDomain>
+ <ConfigurableDomain Name="DeviceForStrategy.Media.AuxLine" SequenceAware="false">
+ <Configurations>
+ <Configuration Name="Selected">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="AuxLine"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="NotSelected">
+ <CompoundRule Type="All"/>
+ </Configuration>
+ </Configurations>
+ <ConfigurableElements>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/aux_line"/>
+ </ConfigurableElements>
+ <Settings>
+ <Configuration Name="Selected">
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/aux_line">
+ <BitParameter Name="aux_line">1</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="NotSelected">
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/aux_line">
+ <BitParameter Name="aux_line">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ </Settings>
+ </ConfigurableDomain>
+ <ConfigurableDomain Name="DeviceForStrategy.Phone.UnreachableDevices" SequenceAware="false">
+ <Configurations>
+ <Configuration Name="Calibration">
+ <CompoundRule Type="All"/>
+ </Configuration>
+ </Configurations>
+ <ConfigurableElements>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/remote_submix"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/hdmi_arc"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/aux_line"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/spdif"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/fm"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/speaker_safe"/>
+ </ConfigurableElements>
+ <Settings>
+ <Configuration Name="Calibration">
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/hdmi_arc">
+ <BitParameter Name="hdmi_arc">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/aux_line">
+ <BitParameter Name="aux_line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/spdif">
+ <BitParameter Name="spdif">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/fm">
+ <BitParameter Name="fm">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/speaker_safe">
+ <BitParameter Name="speaker_safe">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ </Settings>
+ </ConfigurableDomain>
+ <ConfigurableDomain Name="DeviceForStrategy.Phone.Device" SequenceAware="false">
+ <Configurations>
+ <Configuration Name="ScoCarkit">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="BluetoothScoCarkit"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForCommunication" MatchesWhen="Is" Value="ForceBtSco"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="BluetoothScoHeadset">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="BluetoothScoHeadset"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForCommunication" MatchesWhen="Is" Value="ForceBtSco"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="BluetoothSco">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="BluetoothSco"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForCommunication" MatchesWhen="Is" Value="ForceBtSco"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="BluetoothA2dp">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="BluetoothA2dp"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCommunication"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForMedia" MatchesWhen="IsNot" Value="ForceNoBtA2dp"/>
+ <CompoundRule Type="Any">
+ <SelectionCriterionRule SelectionCriterion="ForceUseForCommunication" MatchesWhen="Is" Value="ForceBtSco"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForCommunication" MatchesWhen="Is" Value="ForceNone"/>
+ </CompoundRule>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="BluetoothA2dpHeadphones">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="BluetoothA2dpHeadphones"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCommunication"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForMedia" MatchesWhen="IsNot" Value="ForceNoBtA2dp"/>
+ <CompoundRule Type="Any">
+ <SelectionCriterionRule SelectionCriterion="ForceUseForCommunication" MatchesWhen="Is" Value="ForceBtSco"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForCommunication" MatchesWhen="Is" Value="ForceNone"/>
+ </CompoundRule>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="BluetoothA2dpSpeaker">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="BluetoothA2dpSpeaker"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCommunication"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForMedia" MatchesWhen="IsNot" Value="ForceNoBtA2dp"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForCommunication" MatchesWhen="Is" Value="ForceSpeaker"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="WiredHeadphone">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="WiredHeadphone"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForCommunication" MatchesWhen="IsNot" Value="ForceSpeaker"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="WiredHeadset">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="WiredHeadset"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForCommunication" MatchesWhen="IsNot" Value="ForceSpeaker"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="UsbDevice">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="UsbDevice"/>
+ <CompoundRule Type="Any">
+ <SelectionCriterionRule SelectionCriterion="ForceUseForCommunication" MatchesWhen="Is" Value="ForceBtSco"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForCommunication" MatchesWhen="Is" Value="ForceNone"/>
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="ForceUseForCommunication" MatchesWhen="Is" Value="ForceSpeaker"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Excludes" Value="UsbAccessory"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCommunication"/>
+ </CompoundRule>
+ </CompoundRule>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="UsbAccessory">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="UsbAccessory"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCommunication"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCall"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="DgtlDockHeadset">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="DgtlDockHeadset"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCommunication"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="Hdmi">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="Hdmi"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCommunication"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="AnlgDockHeadset">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="AnlgDockHeadset"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCommunication"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="Earpiece">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="Earpiece"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForCommunication" MatchesWhen="IsNot" Value="ForceSpeaker"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="Line">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="Line"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForCommunication" MatchesWhen="Is" Value="ForceSpeaker"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="Speaker">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="Speaker"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForCommunication" MatchesWhen="Is" Value="ForceSpeaker"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="Default">
+ <CompoundRule Type="All"/>
+ </Configuration>
+ </Configurations>
+ <ConfigurableElements>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/earpiece"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/wired_headset"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/wired_headphone"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_sco"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_sco_headset"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_sco_carkit"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_a2dp"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_a2dp_headphones"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_a2dp_speaker"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/hdmi"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/angl_dock_headset"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/dgtl_dock_headset"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/usb_accessory"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/usb_device"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/telephony_tx"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/line"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/speaker"/>
+ </ConfigurableElements>
+ <Settings>
+ <Configuration Name="ScoCarkit">
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="BluetoothScoHeadset">
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="BluetoothSco">
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="BluetoothA2dp">
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="BluetoothA2dpHeadphones">
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="BluetoothA2dpSpeaker">
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="WiredHeadphone">
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="WiredHeadset">
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="UsbDevice">
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="UsbAccessory">
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="DgtlDockHeadset">
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="Hdmi">
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="AnlgDockHeadset">
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="Earpiece">
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="Line">
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/line">
+ <BitParameter Name="line">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="Speaker">
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">1</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="Default">
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/phone/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ </Settings>
+ </ConfigurableDomain>
+ <ConfigurableDomain Name="DeviceForStrategy.Sonification.UnreachableDevices" SequenceAware="false">
+ <Configurations>
+ <Configuration Name="Calibration">
+ <CompoundRule Type="All"/>
+ </Configuration>
+ </Configurations>
+ <ConfigurableElements>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/remote_submix"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/hdmi_arc"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/spdif"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/fm"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/speaker_safe"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/aux_line"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/hdmi"/>
+ </ConfigurableElements>
+ <Settings>
+ <Configuration Name="Calibration">
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/hdmi_arc">
+ <BitParameter Name="hdmi_arc">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/spdif">
+ <BitParameter Name="spdif">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/fm">
+ <BitParameter Name="fm">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/speaker_safe">
+ <BitParameter Name="speaker_safe">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/aux_line">
+ <BitParameter Name="aux_line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ </Settings>
+ </ConfigurableDomain>
+ <ConfigurableDomain Name="DeviceForStrategy.Sonification.Speaker" SequenceAware="false">
+ <Configurations>
+ <Configuration Name="Selected">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="Speaker"/>
+ <CompoundRule Type="Any">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCommunication"/>
+ </CompoundRule>
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="ForceUseForCommunication" MatchesWhen="Is" Value="ForceSpeaker"/>
+ <CompoundRule Type="Any">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="Is" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="Is" Value="InCommunication"/>
+ </CompoundRule>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Excludes" Value="Line"/>
+ </CompoundRule>
+ </CompoundRule>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="NotSelected">
+ <CompoundRule Type="All"/>
+ </Configuration>
+ </Configurations>
+ <ConfigurableElements>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/speaker"/>
+ </ConfigurableElements>
+ <Settings>
+ <Configuration Name="Selected">
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">1</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="NotSelected">
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ </Settings>
+ </ConfigurableDomain>
+ <ConfigurableDomain Name="DeviceForStrategy.Sonification.Device2" SequenceAware="false">
+ <Configurations>
+ <Configuration Name="BluetoothA2dp">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="BluetoothA2dp"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCommunication"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForMedia" MatchesWhen="IsNot" Value="ForceNoBtA2dp"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="BluetoothA2dpHeadphones">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="BluetoothA2dpHeadphones"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCommunication"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForMedia" MatchesWhen="IsNot" Value="ForceNoBtA2dp"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="BluetoothA2dpSpeaker">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="BluetoothA2dpSpeaker"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCommunication"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForMedia" MatchesWhen="IsNot" Value="ForceNoBtA2dp"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="ScoCarkit">
+ <CompoundRule Type="All">
+ <CompoundRule Type="Any">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="Is" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="Is" Value="InCommunication"/>
+ </CompoundRule>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForCommunication" MatchesWhen="Is" Value="ForceBtSco"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="BluetoothScoCarkit"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="ScoHeadset">
+ <CompoundRule Type="All">
+ <CompoundRule Type="Any">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="Is" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="Is" Value="InCommunication"/>
+ </CompoundRule>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForCommunication" MatchesWhen="Is" Value="ForceBtSco"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="BluetoothScoHeadset"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="Sco">
+ <CompoundRule Type="All">
+ <CompoundRule Type="Any">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="Is" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="Is" Value="InCommunication"/>
+ </CompoundRule>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForCommunication" MatchesWhen="Is" Value="ForceBtSco"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="BluetoothSco"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="WiredHeadphone">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="WiredHeadphone"/>
+ <CompoundRule Type="Any">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCommunication"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForMedia" MatchesWhen="IsNot" Value="ForceSpeaker"/>
+ </CompoundRule>
+ <CompoundRule Type="All">
+ <CompoundRule Type="Any">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="Is" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="Is" Value="InCommunication"/>
+ </CompoundRule>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForCommunication" MatchesWhen="IsNot" Value="ForceSpeaker"/>
+ </CompoundRule>
+ </CompoundRule>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="Line">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="Line"/>
+ <CompoundRule Type="Any">
+ <CompoundRule Type="All">
+ <CompoundRule Type="Any">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="Is" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="Is" Value="InCommunication"/>
+ </CompoundRule>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForCommunication" MatchesWhen="Is" Value="ForceSpeaker"/>
+ </CompoundRule>
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCommunication"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForMedia" MatchesWhen="IsNot" Value="ForceSpeaker"/>
+ </CompoundRule>
+ </CompoundRule>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="WiredHeadset">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="WiredHeadset"/>
+ <CompoundRule Type="Any">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCommunication"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForMedia" MatchesWhen="IsNot" Value="ForceSpeaker"/>
+ </CompoundRule>
+ <CompoundRule Type="All">
+ <CompoundRule Type="Any">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="Is" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="Is" Value="InCommunication"/>
+ </CompoundRule>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForCommunication" MatchesWhen="IsNot" Value="ForceSpeaker"/>
+ </CompoundRule>
+ </CompoundRule>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="UsbDevice">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="UsbDevice"/>
+ <CompoundRule Type="Any">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Excludes" Value="UsbAccessory"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCommunication"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForMedia" MatchesWhen="IsNot" Value="ForceSpeaker"/>
+ </CompoundRule>
+ <CompoundRule Type="All">
+ <CompoundRule Type="Any">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="Is" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="Is" Value="InCommunication"/>
+ </CompoundRule>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForCommunication" MatchesWhen="IsNot" Value="ForceSpeaker"/>
+ </CompoundRule>
+ </CompoundRule>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="UsbAccessory">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="UsbAccessory"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCommunication"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForMedia" MatchesWhen="IsNot" Value="ForceSpeaker"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="DgtlDockHeadset">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="DgtlDockHeadset"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCommunication"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForMedia" MatchesWhen="IsNot" Value="ForceSpeaker"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="AnlgDockHeadset">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="AnlgDockHeadset"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCommunication"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForMedia" MatchesWhen="IsNot" Value="ForceSpeaker"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForDock" MatchesWhen="Is" Value="ForceAnalogDock"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="Earpiece">
+ <CompoundRule Type="All">
+ <CompoundRule Type="Any">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="Is" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="Is" Value="InCommunication"/>
+ </CompoundRule>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForCommunication" MatchesWhen="IsNot" Value="ForceSpeaker"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="Earpiece"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="None">
+ <CompoundRule Type="All"/>
+ </Configuration>
+ </Configurations>
+ <ConfigurableElements>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/earpiece"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/wired_headset"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/wired_headphone"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_sco"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_sco_headset"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_sco_carkit"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_a2dp"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_a2dp_headphones"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_a2dp_speaker"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/angl_dock_headset"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/dgtl_dock_headset"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/usb_accessory"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/usb_device"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/telephony_tx"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/line"/>
+ </ConfigurableElements>
+ <Settings>
+ <Configuration Name="BluetoothA2dp">
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="BluetoothA2dpHeadphones">
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="BluetoothA2dpSpeaker">
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="ScoCarkit">
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="ScoHeadset">
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="Sco">
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="WiredHeadphone">
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="Line">
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/line">
+ <BitParameter Name="line">1</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="WiredHeadset">
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="UsbDevice">
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="UsbAccessory">
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="DgtlDockHeadset">
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="AnlgDockHeadset">
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="Earpiece">
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="None">
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ </Settings>
+ </ConfigurableDomain>
+ <ConfigurableDomain Name="DeviceForStrategy.SonificationRespectful.UnreachableDevices" SequenceAware="false">
+ <Configurations>
+ <Configuration Name="Calibration">
+ <CompoundRule Type="All"/>
+ </Configuration>
+ </Configurations>
+ <ConfigurableElements>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/remote_submix"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/hdmi_arc"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/aux_line"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/spdif"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/fm"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/telephony_tx"/>
+ </ConfigurableElements>
+ <Settings>
+ <Configuration Name="Calibration">
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/hdmi_arc">
+ <BitParameter Name="hdmi_arc">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/aux_line">
+ <BitParameter Name="aux_line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/spdif">
+ <BitParameter Name="spdif">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/fm">
+ <BitParameter Name="fm">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ </Settings>
+ </ConfigurableDomain>
+ <ConfigurableDomain Name="DeviceForStrategy.SonificationRespectful.Speakers" SequenceAware="false">
+ <Configurations>
+ <Configuration Name="SpeakerSafe">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="Speaker"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="SpeakerSafe"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCommunication"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="Speaker">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="Speaker"/>
+ <CompoundRule Type="Any">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCommunication"/>
+ </CompoundRule>
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="ForceUseForCommunication" MatchesWhen="Is" Value="ForceSpeaker"/>
+ <CompoundRule Type="Any">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="Is" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="Is" Value="InCommunication"/>
+ </CompoundRule>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Excludes" Value="Line"/>
+ </CompoundRule>
+ </CompoundRule>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="None">
+ <CompoundRule Type="All"/>
+ </Configuration>
+ </Configurations>
+ <ConfigurableElements>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/speaker_safe"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/speaker"/>
+ </ConfigurableElements>
+ <Settings>
+ <Configuration Name="SpeakerSafe">
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/speaker_safe">
+ <BitParameter Name="speaker_safe">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="Speaker">
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/speaker_safe">
+ <BitParameter Name="speaker_safe">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">1</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="None">
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/speaker_safe">
+ <BitParameter Name="speaker_safe">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ </Settings>
+ </ConfigurableDomain>
+ <ConfigurableDomain Name="DeviceForStrategy.SonificationRespectful.Device2" SequenceAware="false">
+ <Configurations>
+ <Configuration Name="BluetoothA2dp">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCommunication"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForMedia" MatchesWhen="Is" Value="ForceNoBtA2dp"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="BluetoothA2dp"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="BluetoothA2dpHeadphones">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCommunication"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForMedia" MatchesWhen="Is" Value="ForceNoBtA2dp"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="BluetoothA2dpHeadphones"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="BluetoothA2dpSpeaker">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCommunication"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForMedia" MatchesWhen="Is" Value="ForceNoBtA2dp"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="BluetoothA2dpSpeaker"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="BluetoothScoCarkit">
+ <CompoundRule Type="All">
+ <CompoundRule Type="Any">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="Is" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="Is" Value="InCommunication"/>
+ </CompoundRule>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForCommunication" MatchesWhen="Is" Value="ForceBtSco"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="BluetoothScoCarkit"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="BluetoothScoHeadset">
+ <CompoundRule Type="All">
+ <CompoundRule Type="Any">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="Is" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="Is" Value="InCommunication"/>
+ </CompoundRule>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForCommunication" MatchesWhen="Is" Value="ForceBtSco"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="BluetoothScoHeadset"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="BluetoothSco">
+ <CompoundRule Type="All">
+ <CompoundRule Type="Any">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="Is" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="Is" Value="InCommunication"/>
+ </CompoundRule>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForCommunication" MatchesWhen="Is" Value="ForceBtSco"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="BluetoothSco"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="WiredHeadphone">
+ <CompoundRule Type="All">
+ <CompoundRule Type="Any">
+ <CompoundRule Type="All">
+ <CompoundRule Type="Any">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="Is" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="Is" Value="InCommunication"/>
+ </CompoundRule>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForCommunication" MatchesWhen="IsNot" Value="ForceSpeaker"/>
+ </CompoundRule>
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCommunication"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForMedia" MatchesWhen="IsNot" Value="ForceSpeaker"/>
+ </CompoundRule>
+ </CompoundRule>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="WiredHeadphone"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="LineWhenFollowMediaStrategy">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCommunication"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="WiredHeadphone"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForMedia" MatchesWhen="IsNot" Value="ForceSpeaker"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="WiredHeadset">
+ <CompoundRule Type="All">
+ <CompoundRule Type="Any">
+ <CompoundRule Type="All">
+ <CompoundRule Type="Any">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="Is" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="Is" Value="InCommunication"/>
+ </CompoundRule>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForCommunication" MatchesWhen="IsNot" Value="ForceSpeaker"/>
+ </CompoundRule>
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCommunication"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForMedia" MatchesWhen="IsNot" Value="ForceSpeaker"/>
+ </CompoundRule>
+ </CompoundRule>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="WiredHeadset"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="UsbDevice">
+ <CompoundRule Type="All">
+ <CompoundRule Type="Any">
+ <CompoundRule Type="All">
+ <CompoundRule Type="Any">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="Is" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="Is" Value="InCommunication"/>
+ </CompoundRule>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForCommunication" MatchesWhen="IsNot" Value="ForceSpeaker"/>
+ </CompoundRule>
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCommunication"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForMedia" MatchesWhen="IsNot" Value="ForceSpeaker"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Excludes" Value="UsbAccessory"/>
+ </CompoundRule>
+ </CompoundRule>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="UsbDevice"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="UsbAccessory">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCommunication"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForMedia" MatchesWhen="IsNot" Value="ForceSpeaker"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="UsbAccessory"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="DgtlDockHeadset">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCommunication"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForMedia" MatchesWhen="IsNot" Value="ForceSpeaker"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="DgtlDockHeadset"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="AuxDigital">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCommunication"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForMedia" MatchesWhen="IsNot" Value="ForceSpeaker"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="Hdmi"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="AnlgDockHeadset">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCommunication"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForMedia" MatchesWhen="IsNot" Value="ForceSpeaker"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForDock" MatchesWhen="Is" Value="ForceAnalogDock"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="AnlgDockHeadset"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="Earpiece">
+ <CompoundRule Type="All">
+ <CompoundRule Type="Any">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="Is" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="Is" Value="InCommunication"/>
+ </CompoundRule>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForCommunication" MatchesWhen="IsNot" Value="ForceSpeaker"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="Earpiece"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="Line">
+ <CompoundRule Type="All">
+ <CompoundRule Type="Any">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="Is" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="Is" Value="InCommunication"/>
+ </CompoundRule>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForCommunication" MatchesWhen="Is" Value="ForceSpeaker"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="Line"/>
+ </CompoundRule>
+ </Configuration>
+ </Configurations>
+ <ConfigurableElements>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/earpiece"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_sco"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_sco_headset"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_sco_carkit"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_a2dp_headphones"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_a2dp_speaker"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_a2dp"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/wired_headset"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/wired_headphone"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/line"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/angl_dock_headset"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/dgtl_dock_headset"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/usb_accessory"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/usb_device"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/hdmi"/>
+ </ConfigurableElements>
+ <Settings>
+ <Configuration Name="BluetoothA2dp">
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="BluetoothA2dpHeadphones">
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="BluetoothA2dpSpeaker">
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="BluetoothScoCarkit">
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="BluetoothScoHeadset">
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="BluetoothSco">
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="WiredHeadphone">
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="LineWhenFollowMediaStrategy">
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/line">
+ <BitParameter Name="line">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="WiredHeadset">
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="UsbDevice">
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="UsbAccessory">
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="DgtlDockHeadset">
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="AuxDigital">
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">1</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="AnlgDockHeadset">
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="Earpiece">
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="Line">
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/line">
+ <BitParameter Name="line">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/sonification_respectful/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ </Settings>
+ </ConfigurableDomain>
+ <ConfigurableDomain Name="DeviceForStrategy.Dtmf.UnreachableDevices" SequenceAware="false">
+ <Configurations>
+ <Configuration Name="Calibration">
+ <CompoundRule Type="All"/>
+ </Configuration>
+ </Configurations>
+ <ConfigurableElements>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/fm"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/speaker_safe"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_sco_carkit"/>
+ </ConfigurableElements>
+ <Settings>
+ <Configuration Name="Calibration">
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/fm">
+ <BitParameter Name="fm">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/speaker_safe">
+ <BitParameter Name="speaker_safe">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ </Settings>
+ </ConfigurableDomain>
+ <ConfigurableDomain Name="DeviceForStrategy.Dtmf.Device2" SequenceAware="false">
+ <Configurations>
+ <Configuration Name="RemoteSubmix">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCommunication"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="RemoteSubmix"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="BluetoothA2dp">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCommunication"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForMedia" MatchesWhen="IsNot" Value="ForceNoBtA2dp"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="BluetoothA2dp"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="BluetoothA2dpHeadphones">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCommunication"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForMedia" MatchesWhen="IsNot" Value="ForceNoBtA2dp"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="BluetoothA2dpHeadphones"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="BluetoothA2dpSpeaker">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCommunication"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForMedia" MatchesWhen="IsNot" Value="ForceNoBtA2dp"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="BluetoothA2dpSpeaker"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="ForceSpeakerWhenNotInCall">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCommunication"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForMedia" MatchesWhen="Is" Value="ForceSpeaker"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForHdmiSystemAudio" MatchesWhen="IsNot" Value="ForceHdmiSystemEnforced"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="Speaker"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="BluetoothScoHeadset">
+ <CompoundRule Type="All">
+ <CompoundRule Type="Any">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="Is" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="Is" Value="InCommunication"/>
+ </CompoundRule>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="BluetoothScoHeadset"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForCommunication" MatchesWhen="Is" Value="ForceBtSco"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="BluetoothSco">
+ <CompoundRule Type="All">
+ <CompoundRule Type="Any">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="Is" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="Is" Value="InCommunication"/>
+ </CompoundRule>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="BluetoothSco"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForCommunication" MatchesWhen="Is" Value="ForceBtSco"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="WiredHeadphone">
+ <CompoundRule Type="All">
+ <CompoundRule Type="Any">
+ <CompoundRule Type="All">
+ <CompoundRule Type="Any">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="Is" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="Is" Value="InCommunication"/>
+ </CompoundRule>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForCommunication" MatchesWhen="IsNot" Value="ForceSpeaker"/>
+ </CompoundRule>
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCommunication"/>
+ </CompoundRule>
+ </CompoundRule>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="WiredHeadphone"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="LineWhenFollowingMedia">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCommunication"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="Line"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="WiredHeadset">
+ <CompoundRule Type="All">
+ <CompoundRule Type="Any">
+ <CompoundRule Type="All">
+ <CompoundRule Type="Any">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="Is" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="Is" Value="InCommunication"/>
+ </CompoundRule>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForCommunication" MatchesWhen="IsNot" Value="ForceSpeaker"/>
+ </CompoundRule>
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCommunication"/>
+ </CompoundRule>
+ </CompoundRule>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="WiredHeadset"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="UsbDevice">
+ <CompoundRule Type="All">
+ <CompoundRule Type="Any">
+ <CompoundRule Type="All">
+ <CompoundRule Type="Any">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="Is" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="Is" Value="InCommunication"/>
+ </CompoundRule>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForCommunication" MatchesWhen="IsNot" Value="ForceSpeaker"/>
+ </CompoundRule>
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCommunication"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Excludes" Value="UsbAccessory"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForCommunication" MatchesWhen="Is" Value="ForceSpeaker"/>
+ </CompoundRule>
+ </CompoundRule>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="UsbDevice"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="UsbAccessory">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCommunication"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="UsbAccessory"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="DgtlDockHeadset">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCommunication"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="DgtlDockHeadset"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="Hdmi">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCommunication"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="Hdmi"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="AnlgDockHeadset">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCommunication"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForDock" MatchesWhen="Is" Value="ForceAnalogDock"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="AnlgDockHeadset"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="Earpiece">
+ <CompoundRule Type="All">
+ <CompoundRule Type="Any">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="Is" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="Is" Value="InCommunication"/>
+ </CompoundRule>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="Earpiece"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForCommunication" MatchesWhen="IsNot" Value="ForceSpeaker"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="LineWhenFallThroughPhone">
+ <CompoundRule Type="All">
+ <CompoundRule Type="Any">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="Is" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="Is" Value="InCommunication"/>
+ </CompoundRule>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="Line"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForCommunication" MatchesWhen="Is" Value="ForceSpeaker"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="Speaker">
+ <CompoundRule Type="All">
+ <CompoundRule Type="Any">
+ <CompoundRule Type="All">
+ <CompoundRule Type="Any">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="Is" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="Is" Value="InCommunication"/>
+ </CompoundRule>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForCommunication" MatchesWhen="Is" Value="ForceSpeaker"/>
+ </CompoundRule>
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCommunication"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForHdmiSystemAudio" MatchesWhen="IsNot" Value="ForceHdmiSystemEnforced"/>
+ </CompoundRule>
+ </CompoundRule>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="Speaker"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="Default">
+ <CompoundRule Type="All"/>
+ </Configuration>
+ </Configurations>
+ <ConfigurableElements>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/remote_submix"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/earpiece"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/wired_headset"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/wired_headphone"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_sco"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_sco_headset"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp_headphones"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp_speaker"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/hdmi"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/angl_dock_headset"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/dgtl_dock_headset"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/usb_accessory"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/usb_device"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/telephony_tx"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/line"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/speaker"/>
+ </ConfigurableElements>
+ <Settings>
+ <Configuration Name="RemoteSubmix">
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="BluetoothA2dp">
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="BluetoothA2dpHeadphones">
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="BluetoothA2dpSpeaker">
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="ForceSpeakerWhenNotInCall">
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">1</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="BluetoothScoHeadset">
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="BluetoothSco">
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="WiredHeadphone">
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="LineWhenFollowingMedia">
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/line">
+ <BitParameter Name="line">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="WiredHeadset">
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="UsbDevice">
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="UsbAccessory">
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="DgtlDockHeadset">
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="Hdmi">
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="AnlgDockHeadset">
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="Earpiece">
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="LineWhenFallThroughPhone">
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/line">
+ <BitParameter Name="line">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="Speaker">
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">1</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="Default">
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/dtmf/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ </Settings>
+ </ConfigurableDomain>
+ <ConfigurableDomain Name="DeviceForStrategy.Dtmf.Arc" SequenceAware="false">
+ <Configurations>
+ <Configuration Name="Selected">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCommunication"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="HdmiArc"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="NotSelected">
+ <CompoundRule Type="All"/>
+ </Configuration>
+ </Configurations>
+ <ConfigurableElements>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/hdmi_arc"/>
+ </ConfigurableElements>
+ <Settings>
+ <Configuration Name="Selected">
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/hdmi_arc">
+ <BitParameter Name="hdmi_arc">1</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="NotSelected">
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/hdmi_arc">
+ <BitParameter Name="hdmi_arc">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ </Settings>
+ </ConfigurableDomain>
+ <ConfigurableDomain Name="DeviceForStrategy.Dtmf.Spdif" SequenceAware="false">
+ <Configurations>
+ <Configuration Name="Selected">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCommunication"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="Spdif"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="NotSelected">
+ <CompoundRule Type="All"/>
+ </Configuration>
+ </Configurations>
+ <ConfigurableElements>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/spdif"/>
+ </ConfigurableElements>
+ <Settings>
+ <Configuration Name="Selected">
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/spdif">
+ <BitParameter Name="spdif">1</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="NotSelected">
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/spdif">
+ <BitParameter Name="spdif">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ </Settings>
+ </ConfigurableDomain>
+ <ConfigurableDomain Name="DeviceForStrategy.Dtmf.AuxLine" SequenceAware="false">
+ <Configurations>
+ <Configuration Name="Selected">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="IsNot" Value="InCommunication"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="AuxLine"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="NotSelected">
+ <CompoundRule Type="All"/>
+ </Configuration>
+ </Configurations>
+ <ConfigurableElements>
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/aux_line"/>
+ </ConfigurableElements>
+ <Settings>
+ <Configuration Name="Selected">
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/aux_line">
+ <BitParameter Name="aux_line">1</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="NotSelected">
+ <ConfigurableElement Path="/Policy/policy/strategies/media/selected_output_devices/mask/aux_line">
+ <BitParameter Name="aux_line">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ </Settings>
+ </ConfigurableDomain>
+ <ConfigurableDomain Name="DeviceForStrategy.EnforcedAudible.UnreachableDevices" SequenceAware="false">
+ <Configurations>
+ <Configuration Name="Calibration">
+ <CompoundRule Type="All"/>
+ </Configuration>
+ </Configurations>
+ <ConfigurableElements>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/remote_submix"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/hdmi_arc"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/spdif"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/aux_line"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/speaker_safe"/>
+ </ConfigurableElements>
+ <Settings>
+ <Configuration Name="Calibration">
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/hdmi_arc">
+ <BitParameter Name="hdmi_arc">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/spdif">
+ <BitParameter Name="spdif">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/aux_line">
+ <BitParameter Name="aux_line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/speaker_safe">
+ <BitParameter Name="speaker_safe">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ </Settings>
+ </ConfigurableDomain>
+ <ConfigurableDomain Name="DeviceForStrategy.EnforcedAudible.Speaker" SequenceAware="false">
+ <Configurations>
+ <Configuration Name="Selected">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="Speaker"/>
+ <CompoundRule Type="Any">
+ <SelectionCriterionRule SelectionCriterion="ForceUseForSystem" MatchesWhen="Is" Value="ForceSystemEnforced"/>
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="ForceUseForMedia" MatchesWhen="Is" Value="ForceSpeaker"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Excludes" Value="RemoteSubmix"/>
+ <CompoundRule Type="Any">
+ <SelectionCriterionRule SelectionCriterion="ForceUseForMedia" MatchesWhen="IsNot" Value="ForceNoBtA2dp"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Excludes" Value="BluetoothA2dp"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Excludes" Value="BluetoothA2dpHeadphones"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Excludes" Value="BluetoothA2dpSpeaker"/>
+ </CompoundRule>
+ </CompoundRule>
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Excludes" Value="RemoteSubmix"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Excludes" Value="WiredHeadphone"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Excludes" Value="Line"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Excludes" Value="WiredHeadset"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Excludes" Value="UsbAccessory"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Excludes" Value="UsbDevice"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Excludes" Value="DgtlDockHeadset"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Excludes" Value="Hdmi"/>
+ <CompoundRule Type="Any">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Excludes" Value="AnlgDockHeadset"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForDock" MatchesWhen="IsNot" Value="ForceAnalogDock"/>
+ </CompoundRule>
+ </CompoundRule>
+ </CompoundRule>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="NotSelected">
+ <CompoundRule Type="All"/>
+ </Configuration>
+ </Configurations>
+ <ConfigurableElements>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/speaker"/>
+ </ConfigurableElements>
+ <Settings>
+ <Configuration Name="Selected">
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">1</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="NotSelected">
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ </Settings>
+ </ConfigurableDomain>
+ <ConfigurableDomain Name="DeviceForStrategy.EnforcedAudible.Device2" SequenceAware="false">
+ <Configurations>
+ <Configuration Name="RemoteSubmix">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="RemoteSubmix"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="BluetoothA2dp">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="BluetoothA2dp"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForMedia" MatchesWhen="IsNot" Value="ForceNoBtA2dp"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="BluetoothA2dpHeadphones">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="BluetoothA2dpHeadphones"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForMedia" MatchesWhen="IsNot" Value="ForceNoBtA2dp"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="BluetoothA2dpSpeaker">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="BluetoothA2dpSpeaker"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForMedia" MatchesWhen="IsNot" Value="ForceNoBtA2dp"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="WiredHeadphone">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="ForceUseForMedia" MatchesWhen="IsNot" Value="ForceSpeaker"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="WiredHeadphone"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="Line">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="ForceUseForMedia" MatchesWhen="IsNot" Value="ForceSpeaker"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="Line"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="WiredHeadset">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="ForceUseForMedia" MatchesWhen="IsNot" Value="ForceSpeaker"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="WiredHeadset"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="UsbAccessory">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="ForceUseForMedia" MatchesWhen="IsNot" Value="ForceSpeaker"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="UsbAccessory"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="UsbDevice">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="ForceUseForMedia" MatchesWhen="IsNot" Value="ForceSpeaker"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="UsbDevice"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="DgtlDockHeadset">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="ForceUseForMedia" MatchesWhen="IsNot" Value="ForceSpeaker"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="DgtlDockHeadset"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="Hdmi">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="ForceUseForMedia" MatchesWhen="IsNot" Value="ForceSpeaker"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="Hdmi"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="AnlgDockHeadset">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="ForceUseForMedia" MatchesWhen="IsNot" Value="ForceSpeaker"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForDock" MatchesWhen="Is" Value="ForceAnalogDock"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="AnlgDockHeadset"/>
+ </CompoundRule>
+ </Configuration>
+ </Configurations>
+ <ConfigurableElements>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/remote_submix"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/earpiece"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/wired_headset"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/wired_headphone"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_sco"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_sco_headset"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_sco_carkit"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_a2dp"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_a2dp_headphones"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_a2dp_speaker"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/hdmi"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/angl_dock_headset"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/dgtl_dock_headset"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/usb_accessory"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/usb_device"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/telephony_tx"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/line"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/fm"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/speaker_safe"/>
+ </ConfigurableElements>
+ <Settings>
+ <Configuration Name="RemoteSubmix">
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/fm">
+ <BitParameter Name="fm">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/speaker_safe">
+ <BitParameter Name="speaker_safe">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="BluetoothA2dp">
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/fm">
+ <BitParameter Name="fm">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/speaker_safe">
+ <BitParameter Name="speaker_safe">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="BluetoothA2dpHeadphones">
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/fm">
+ <BitParameter Name="fm">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/speaker_safe">
+ <BitParameter Name="speaker_safe">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="BluetoothA2dpSpeaker">
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/fm">
+ <BitParameter Name="fm">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/speaker_safe">
+ <BitParameter Name="speaker_safe">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="WiredHeadphone">
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/fm">
+ <BitParameter Name="fm">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/speaker_safe">
+ <BitParameter Name="speaker_safe">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="Line">
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/line">
+ <BitParameter Name="line">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/fm">
+ <BitParameter Name="fm">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/speaker_safe">
+ <BitParameter Name="speaker_safe">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="WiredHeadset">
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/fm">
+ <BitParameter Name="fm">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/speaker_safe">
+ <BitParameter Name="speaker_safe">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="UsbAccessory">
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/fm">
+ <BitParameter Name="fm">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/speaker_safe">
+ <BitParameter Name="speaker_safe">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="UsbDevice">
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/fm">
+ <BitParameter Name="fm">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/speaker_safe">
+ <BitParameter Name="speaker_safe">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="DgtlDockHeadset">
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/fm">
+ <BitParameter Name="fm">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/speaker_safe">
+ <BitParameter Name="speaker_safe">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="Hdmi">
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/fm">
+ <BitParameter Name="fm">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/speaker_safe">
+ <BitParameter Name="speaker_safe">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="AnlgDockHeadset">
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/fm">
+ <BitParameter Name="fm">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/enforced_audible/selected_output_devices/mask/speaker_safe">
+ <BitParameter Name="speaker_safe">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ </Settings>
+ </ConfigurableDomain>
+ <ConfigurableDomain Name="DeviceForStrategy.TransmittedThroughSpeaker.UnreacheableDevices" SequenceAware="false">
+ <Configurations>
+ <Configuration Name="Calibration">
+ <CompoundRule Type="All"/>
+ </Configuration>
+ </Configurations>
+ <ConfigurableElements>
+ <ConfigurableElement Path="/Policy/policy/strategies/transmitted_through_speaker/selected_output_devices/mask/remote_submix"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/transmitted_through_speaker/selected_output_devices/mask/hdmi_arc"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/transmitted_through_speaker/selected_output_devices/mask/spdif"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/transmitted_through_speaker/selected_output_devices/mask/aux_line"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/transmitted_through_speaker/selected_output_devices/mask/fm"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/transmitted_through_speaker/selected_output_devices/mask/speaker_safe"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/transmitted_through_speaker/selected_output_devices/mask/earpiece"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/transmitted_through_speaker/selected_output_devices/mask/wired_headset"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/transmitted_through_speaker/selected_output_devices/mask/wired_headphone"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/transmitted_through_speaker/selected_output_devices/mask/bluetooth_sco"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/transmitted_through_speaker/selected_output_devices/mask/bluetooth_sco_headset"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/transmitted_through_speaker/selected_output_devices/mask/bluetooth_sco_carkit"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/transmitted_through_speaker/selected_output_devices/mask/bluetooth_a2dp"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/transmitted_through_speaker/selected_output_devices/mask/bluetooth_a2dp_headphones"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/transmitted_through_speaker/selected_output_devices/mask/bluetooth_a2dp_speaker"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/transmitted_through_speaker/selected_output_devices/mask/hdmi"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/transmitted_through_speaker/selected_output_devices/mask/angl_dock_headset"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/transmitted_through_speaker/selected_output_devices/mask/dgtl_dock_headset"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/transmitted_through_speaker/selected_output_devices/mask/usb_accessory"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/transmitted_through_speaker/selected_output_devices/mask/usb_device"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/transmitted_through_speaker/selected_output_devices/mask/telephony_tx"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/transmitted_through_speaker/selected_output_devices/mask/line"/>
+ </ConfigurableElements>
+ <Settings>
+ <Configuration Name="Calibration">
+ <ConfigurableElement Path="/Policy/policy/strategies/transmitted_through_speaker/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/transmitted_through_speaker/selected_output_devices/mask/hdmi_arc">
+ <BitParameter Name="hdmi_arc">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/transmitted_through_speaker/selected_output_devices/mask/spdif">
+ <BitParameter Name="spdif">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/transmitted_through_speaker/selected_output_devices/mask/aux_line">
+ <BitParameter Name="aux_line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/transmitted_through_speaker/selected_output_devices/mask/fm">
+ <BitParameter Name="fm">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/transmitted_through_speaker/selected_output_devices/mask/speaker_safe">
+ <BitParameter Name="speaker_safe">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/transmitted_through_speaker/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/transmitted_through_speaker/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/transmitted_through_speaker/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/transmitted_through_speaker/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/transmitted_through_speaker/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/transmitted_through_speaker/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/transmitted_through_speaker/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/transmitted_through_speaker/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/transmitted_through_speaker/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/transmitted_through_speaker/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/transmitted_through_speaker/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/transmitted_through_speaker/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/transmitted_through_speaker/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/transmitted_through_speaker/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/transmitted_through_speaker/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/transmitted_through_speaker/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ </Settings>
+ </ConfigurableDomain>
+ <ConfigurableDomain Name="DeviceForStrategy.TransmittedThroughSpeaker.Speaker" SequenceAware="false">
+ <Configurations>
+ <Configuration Name="Selected">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="Speaker"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="NotSelected">
+ <CompoundRule Type="All"/>
+ </Configuration>
+ </Configurations>
+ <ConfigurableElements>
+ <ConfigurableElement Path="/Policy/policy/strategies/transmitted_through_speaker/selected_output_devices/mask/speaker"/>
+ </ConfigurableElements>
+ <Settings>
+ <Configuration Name="Selected">
+ <ConfigurableElement Path="/Policy/policy/strategies/transmitted_through_speaker/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">1</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="NotSelected">
+ <ConfigurableElement Path="/Policy/policy/strategies/transmitted_through_speaker/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ </Settings>
+ </ConfigurableDomain>
+ <ConfigurableDomain Name="DeviceForStrategy.Accessibility.UnreachableDevices" SequenceAware="false">
+ <Configurations>
+ <Configuration Name="Calibration">
+ <CompoundRule Type="All"/>
+ </Configuration>
+ </Configurations>
+ <ConfigurableElements>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/hdmi_arc"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/spdif"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/aux_line"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/fm"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/speaker_safe"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/earpiece"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/bluetooth_sco"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/bluetooth_sco_headset"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/bluetooth_sco_carkit"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/telephony_tx"/>
+ </ConfigurableElements>
+ <Settings>
+ <Configuration Name="Calibration">
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/hdmi_arc">
+ <BitParameter Name="hdmi_arc">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/spdif">
+ <BitParameter Name="spdif">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/aux_line">
+ <BitParameter Name="aux_line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/fm">
+ <BitParameter Name="fm">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/speaker_safe">
+ <BitParameter Name="speaker_safe">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ </Settings>
+ </ConfigurableDomain>
+ <ConfigurableDomain Name="DeviceForStrategy.Accessibility.Device2" SequenceAware="false">
+ <Configurations>
+ <Configuration Name="RemoteSubmix">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="RemoteSubmix"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="BluetoothA2dp">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="ForceUseForMedia" MatchesWhen="IsNot" Value="ForceNoBtA2dp"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="BluetoothA2dp"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="BluetoothA2dpHeadphone">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="ForceUseForMedia" MatchesWhen="IsNot" Value="ForceNoBtA2dp"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="BluetoothA2dpHeadphones"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="BluetoothA2dpSpeaker">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="ForceUseForMedia" MatchesWhen="IsNot" Value="ForceNoBtA2dp"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="BluetoothA2dpSpeaker"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="ForceSpeaker">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="ForceUseForMedia" MatchesWhen="Is" Value="ForceSpeaker"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="Speaker"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="WiredHeadphone">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="WiredHeadphone"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="Line">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="Line"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="WiredHeadset">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="WiredHeadset"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="UsbAccessory">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="UsbAccessory"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="UsbDevice">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="UsbDevice"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="DgtlDockHeadset">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="DgtlDockHeadset"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="AuxDigital">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="Hdmi"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="AnlgDockHeadset">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="AnlgDockHeadset"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForDock" MatchesWhen="Is" Value="ForceAnalogDock"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="Speaker">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="Speaker"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="Default">
+ <CompoundRule Type="All"/>
+ </Configuration>
+ </Configurations>
+ <ConfigurableElements>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/remote_submix"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/bluetooth_a2dp"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/bluetooth_a2dp_headphones"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/bluetooth_a2dp_speaker"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/speaker"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/wired_headset"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/wired_headphone"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/line"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/angl_dock_headset"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/dgtl_dock_headset"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/usb_accessory"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/usb_device"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/hdmi"/>
+ </ConfigurableElements>
+ <Settings>
+ <Configuration Name="RemoteSubmix">
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="BluetoothA2dp">
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="BluetoothA2dpHeadphone">
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="BluetoothA2dpSpeaker">
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="ForceSpeaker">
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="WiredHeadphone">
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="Line">
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/line">
+ <BitParameter Name="line">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="WiredHeadset">
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="UsbAccessory">
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="UsbDevice">
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="DgtlDockHeadset">
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="AuxDigital">
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">1</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="AnlgDockHeadset">
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="Speaker">
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="Default">
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/accessibility/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ </Settings>
+ </ConfigurableDomain>
+ <ConfigurableDomain Name="DeviceForStrategy.Rerouting.UnreachableDevices" SequenceAware="false">
+ <Configurations>
+ <Configuration Name="Calibration">
+ <CompoundRule Type="All"/>
+ </Configuration>
+ </Configurations>
+ <ConfigurableElements>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/hdmi_arc"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/spdif"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/aux_line"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/fm"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/speaker_safe"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/earpiece"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/bluetooth_sco"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/bluetooth_sco_headset"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/bluetooth_sco_carkit"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/telephony_tx"/>
+ </ConfigurableElements>
+ <Settings>
+ <Configuration Name="Calibration">
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/hdmi_arc">
+ <BitParameter Name="hdmi_arc">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/spdif">
+ <BitParameter Name="spdif">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/aux_line">
+ <BitParameter Name="aux_line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/fm">
+ <BitParameter Name="fm">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/speaker_safe">
+ <BitParameter Name="speaker_safe">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/earpiece">
+ <BitParameter Name="earpiece">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/bluetooth_sco">
+ <BitParameter Name="bluetooth_sco">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/bluetooth_sco_carkit">
+ <BitParameter Name="bluetooth_sco_carkit">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/telephony_tx">
+ <BitParameter Name="telephony_tx">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ </Settings>
+ </ConfigurableDomain>
+ <ConfigurableDomain Name="DeviceForStrategy.Rerouting.Device2" SequenceAware="false">
+ <Configurations>
+ <Configuration Name="RemoteSubmix">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="RemoteSubmix"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="BluetoothA2dp">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="ForceUseForMedia" MatchesWhen="IsNot" Value="ForceNoBtA2dp"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="BluetoothA2dp"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="BluetoothA2dpHeadphone">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="ForceUseForMedia" MatchesWhen="IsNot" Value="ForceNoBtA2dp"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="BluetoothA2dpHeadphones"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="BluetoothA2dpSpeaker">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="ForceUseForMedia" MatchesWhen="IsNot" Value="ForceNoBtA2dp"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="BluetoothA2dpSpeaker"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="ForceSpeaker">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="ForceUseForMedia" MatchesWhen="Is" Value="ForceSpeaker"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="Speaker"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="WiredHeadphone">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="WiredHeadphone"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="Line">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="Line"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="WiredHeadset">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="WiredHeadset"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="UsbAccessory">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="UsbAccessory"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="UsbDevice">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="UsbDevice"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="DgtlDockHeadset">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="DgtlDockHeadset"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="AuxDigital">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="Hdmi"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="AnlgDockHeadset">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="AnlgDockHeadset"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForDock" MatchesWhen="Is" Value="ForceAnalogDock"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="Speaker">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableOutputDevices" MatchesWhen="Includes" Value="Speaker"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="Default">
+ <CompoundRule Type="All"/>
+ </Configuration>
+ </Configurations>
+ <ConfigurableElements>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/remote_submix"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/bluetooth_a2dp"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/bluetooth_a2dp_headphones"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/bluetooth_a2dp_speaker"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/speaker"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/wired_headset"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/wired_headphone"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/line"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/angl_dock_headset"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/dgtl_dock_headset"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/usb_accessory"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/usb_device"/>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/hdmi"/>
+ </ConfigurableElements>
+ <Settings>
+ <Configuration Name="RemoteSubmix">
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="BluetoothA2dp">
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="BluetoothA2dpHeadphone">
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="BluetoothA2dpSpeaker">
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="ForceSpeaker">
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="WiredHeadphone">
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="Line">
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/line">
+ <BitParameter Name="line">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="WiredHeadset">
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="UsbAccessory">
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="UsbDevice">
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="DgtlDockHeadset">
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="AuxDigital">
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">1</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="AnlgDockHeadset">
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="Speaker">
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="Default">
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/bluetooth_a2dp_headphones">
+ <BitParameter Name="bluetooth_a2dp_headphones">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/bluetooth_a2dp_speaker">
+ <BitParameter Name="bluetooth_a2dp_speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/speaker">
+ <BitParameter Name="speaker">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/wired_headphone">
+ <BitParameter Name="wired_headphone">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/angl_dock_headset">
+ <BitParameter Name="angl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/strategies/rerouting/selected_output_devices/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ </Settings>
+ </ConfigurableDomain>
+ <ConfigurableDomain Name="StrategyForStream" SequenceAware="false">
+ <Configurations>
+ <Configuration Name="Calibration">
+ <CompoundRule Type="All"/>
+ </Configuration>
+ </Configurations>
+ <ConfigurableElements>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/applicable_strategy/strategy"/>
+ <ConfigurableElement Path="/Policy/policy/streams/system/applicable_strategy/strategy"/>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/applicable_strategy/strategy"/>
+ <ConfigurableElement Path="/Policy/policy/streams/music/applicable_strategy/strategy"/>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/applicable_strategy/strategy"/>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/applicable_strategy/strategy"/>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/applicable_strategy/strategy"/>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/applicable_strategy/strategy"/>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/applicable_strategy/strategy"/>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/applicable_strategy/strategy"/>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/applicable_strategy/strategy"/>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/applicable_strategy/strategy"/>
+ </ConfigurableElements>
+ <Settings>
+ <Configuration Name="Calibration">
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/applicable_strategy/strategy">
+ <EnumParameter Name="strategy">phone</EnumParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/system/applicable_strategy/strategy">
+ <EnumParameter Name="strategy">media</EnumParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/applicable_strategy/strategy">
+ <EnumParameter Name="strategy">sonification</EnumParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/music/applicable_strategy/strategy">
+ <EnumParameter Name="strategy">media</EnumParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/applicable_strategy/strategy">
+ <EnumParameter Name="strategy">sonification</EnumParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/applicable_strategy/strategy">
+ <EnumParameter Name="strategy">sonification_respectful</EnumParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/applicable_strategy/strategy">
+ <EnumParameter Name="strategy">phone</EnumParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/applicable_strategy/strategy">
+ <EnumParameter Name="strategy">enforced_audible</EnumParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/applicable_strategy/strategy">
+ <EnumParameter Name="strategy">dtmf</EnumParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/applicable_strategy/strategy">
+ <EnumParameter Name="strategy">transmitted_through_speaker</EnumParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/applicable_strategy/strategy">
+ <EnumParameter Name="strategy">accessibility</EnumParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/applicable_strategy/strategy">
+ <EnumParameter Name="strategy">rerouting</EnumParameter>
+ </ConfigurableElement>
+ </Configuration>
+ </Settings>
+ </ConfigurableDomain>
+ <ConfigurableDomain Name="SelectedStrategyForUsages.Calibration" SequenceAware="false">
+ <Configurations>
+ <Configuration Name="Calibration">
+ <CompoundRule Type="All"/>
+ </Configuration>
+ </Configurations>
+ <ConfigurableElements>
+ <ConfigurableElement Path="/Policy/policy/usages/unknown/applicable_strategy/strategy"/>
+ <ConfigurableElement Path="/Policy/policy/usages/media/applicable_strategy/strategy"/>
+ <ConfigurableElement Path="/Policy/policy/usages/voice_communication/applicable_strategy/strategy"/>
+ <ConfigurableElement Path="/Policy/policy/usages/voice_communication_signalling/applicable_strategy/strategy"/>
+ <ConfigurableElement Path="/Policy/policy/usages/alarm/applicable_strategy/strategy"/>
+ <ConfigurableElement Path="/Policy/policy/usages/notification/applicable_strategy/strategy"/>
+ <ConfigurableElement Path="/Policy/policy/usages/notification_telephony_ringtone/applicable_strategy/strategy"/>
+ <ConfigurableElement Path="/Policy/policy/usages/notification_communication_request/applicable_strategy/strategy"/>
+ <ConfigurableElement Path="/Policy/policy/usages/notification_communication_instant/applicable_strategy/strategy"/>
+ <ConfigurableElement Path="/Policy/policy/usages/notification_communication_delayed/applicable_strategy/strategy"/>
+ <ConfigurableElement Path="/Policy/policy/usages/notification_event/applicable_strategy/strategy"/>
+ <ConfigurableElement Path="/Policy/policy/usages/assistance_navigation_guidance/applicable_strategy/strategy"/>
+ <ConfigurableElement Path="/Policy/policy/usages/assistance_sonification/applicable_strategy/strategy"/>
+ <ConfigurableElement Path="/Policy/policy/usages/game/applicable_strategy/strategy"/>
+ </ConfigurableElements>
+ <Settings>
+ <Configuration Name="Calibration">
+ <ConfigurableElement Path="/Policy/policy/usages/unknown/applicable_strategy/strategy">
+ <EnumParameter Name="strategy">media</EnumParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/usages/media/applicable_strategy/strategy">
+ <EnumParameter Name="strategy">media</EnumParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/usages/voice_communication/applicable_strategy/strategy">
+ <EnumParameter Name="strategy">phone</EnumParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/usages/voice_communication_signalling/applicable_strategy/strategy">
+ <EnumParameter Name="strategy">dtmf</EnumParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/usages/alarm/applicable_strategy/strategy">
+ <EnumParameter Name="strategy">sonification</EnumParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/usages/notification/applicable_strategy/strategy">
+ <EnumParameter Name="strategy">sonification_respectful</EnumParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/usages/notification_telephony_ringtone/applicable_strategy/strategy">
+ <EnumParameter Name="strategy">sonification</EnumParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/usages/notification_communication_request/applicable_strategy/strategy">
+ <EnumParameter Name="strategy">sonification_respectful</EnumParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/usages/notification_communication_instant/applicable_strategy/strategy">
+ <EnumParameter Name="strategy">sonification_respectful</EnumParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/usages/notification_communication_delayed/applicable_strategy/strategy">
+ <EnumParameter Name="strategy">sonification_respectful</EnumParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/usages/notification_event/applicable_strategy/strategy">
+ <EnumParameter Name="strategy">sonification_respectful</EnumParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/usages/assistance_navigation_guidance/applicable_strategy/strategy">
+ <EnumParameter Name="strategy">media</EnumParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/usages/assistance_sonification/applicable_strategy/strategy">
+ <EnumParameter Name="strategy">media</EnumParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/usages/game/applicable_strategy/strategy">
+ <EnumParameter Name="strategy">media</EnumParameter>
+ </ConfigurableElement>
+ </Configuration>
+ </Settings>
+ </ConfigurableDomain>
+ <ConfigurableDomain Name="SelectedStrategyForUsages.AssistanceAccessibility" SequenceAware="false">
+ <Configurations>
+ <Configuration Name="Sonification">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="Is" Value="RingTone"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="Phone">
+ <CompoundRule Type="Any">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="Is" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="Is" Value="InCommunication"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="Accessibility">
+ <CompoundRule Type="All"/>
+ </Configuration>
+ </Configurations>
+ <ConfigurableElements>
+ <ConfigurableElement Path="/Policy/policy/usages/assistance_accessibility/applicable_strategy/strategy"/>
+ </ConfigurableElements>
+ <Settings>
+ <Configuration Name="Sonification">
+ <ConfigurableElement Path="/Policy/policy/usages/assistance_accessibility/applicable_strategy/strategy">
+ <EnumParameter Name="strategy">sonification</EnumParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="Phone">
+ <ConfigurableElement Path="/Policy/policy/usages/assistance_accessibility/applicable_strategy/strategy">
+ <EnumParameter Name="strategy">phone</EnumParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="Accessibility">
+ <ConfigurableElement Path="/Policy/policy/usages/assistance_accessibility/applicable_strategy/strategy">
+ <EnumParameter Name="strategy">accessibility</EnumParameter>
+ </ConfigurableElement>
+ </Configuration>
+ </Settings>
+ </ConfigurableDomain>
+ <ConfigurableDomain Name="DeviceForInputSource.Calibration" SequenceAware="false">
+ <Configurations>
+ <Configuration Name="Calibration">
+ <CompoundRule Type="All"/>
+ </Configuration>
+ </Configurations>
+ <ConfigurableElements>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/in"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/communication"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/ambient"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/hdmi"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/telephony_rx"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/back_mic"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/remote_submix"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/anlg_dock_headset"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/dgtl_dock_headset"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/usb_accessory"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/fm_tuner"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/tv_tuner"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/line"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/spdif"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/loopback"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/in"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/communication"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/ambient"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/hdmi"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/telephony_rx"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/back_mic"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/remote_submix"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/anlg_dock_headset"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/dgtl_dock_headset"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/usb_accessory"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/fm_tuner"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/tv_tuner"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/line"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/spdif"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/loopback"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_downlink/applicable_input_device/mask/in"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_downlink/applicable_input_device/mask/communication"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_downlink/applicable_input_device/mask/ambient"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_downlink/applicable_input_device/mask/builtin_mic"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_downlink/applicable_input_device/mask/bluetooth_sco_headset"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_downlink/applicable_input_device/mask/wired_headset"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_downlink/applicable_input_device/mask/hdmi"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_downlink/applicable_input_device/mask/back_mic"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_downlink/applicable_input_device/mask/remote_submix"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_downlink/applicable_input_device/mask/anlg_dock_headset"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_downlink/applicable_input_device/mask/dgtl_dock_headset"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_downlink/applicable_input_device/mask/usb_accessory"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_downlink/applicable_input_device/mask/usb_device"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_downlink/applicable_input_device/mask/fm_tuner"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_downlink/applicable_input_device/mask/tv_tuner"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_downlink/applicable_input_device/mask/line"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_downlink/applicable_input_device/mask/spdif"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_downlink/applicable_input_device/mask/bluetooth_a2dp"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_downlink/applicable_input_device/mask/loopback"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_call/applicable_input_device/mask/in"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_call/applicable_input_device/mask/communication"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_call/applicable_input_device/mask/ambient"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_call/applicable_input_device/mask/builtin_mic"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_call/applicable_input_device/mask/bluetooth_sco_headset"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_call/applicable_input_device/mask/wired_headset"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_call/applicable_input_device/mask/hdmi"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_call/applicable_input_device/mask/back_mic"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_call/applicable_input_device/mask/remote_submix"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_call/applicable_input_device/mask/anlg_dock_headset"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_call/applicable_input_device/mask/dgtl_dock_headset"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_call/applicable_input_device/mask/usb_accessory"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_call/applicable_input_device/mask/usb_device"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_call/applicable_input_device/mask/fm_tuner"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_call/applicable_input_device/mask/tv_tuner"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_call/applicable_input_device/mask/line"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_call/applicable_input_device/mask/spdif"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_call/applicable_input_device/mask/bluetooth_a2dp"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_call/applicable_input_device/mask/loopback"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_uplink/applicable_input_device/mask/in"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_uplink/applicable_input_device/mask/communication"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_uplink/applicable_input_device/mask/ambient"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_uplink/applicable_input_device/mask/builtin_mic"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_uplink/applicable_input_device/mask/bluetooth_sco_headset"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_uplink/applicable_input_device/mask/wired_headset"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_uplink/applicable_input_device/mask/hdmi"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_uplink/applicable_input_device/mask/back_mic"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_uplink/applicable_input_device/mask/remote_submix"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_uplink/applicable_input_device/mask/anlg_dock_headset"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_uplink/applicable_input_device/mask/dgtl_dock_headset"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_uplink/applicable_input_device/mask/usb_accessory"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_uplink/applicable_input_device/mask/usb_device"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_uplink/applicable_input_device/mask/fm_tuner"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_uplink/applicable_input_device/mask/tv_tuner"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_uplink/applicable_input_device/mask/line"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_uplink/applicable_input_device/mask/spdif"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_uplink/applicable_input_device/mask/bluetooth_a2dp"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_uplink/applicable_input_device/mask/loopback"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/camcorder/applicable_input_device/mask/in"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/camcorder/applicable_input_device/mask/communication"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/camcorder/applicable_input_device/mask/ambient"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/camcorder/applicable_input_device/mask/bluetooth_sco_headset"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/camcorder/applicable_input_device/mask/wired_headset"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/camcorder/applicable_input_device/mask/hdmi"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/camcorder/applicable_input_device/mask/telephony_rx"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/camcorder/applicable_input_device/mask/remote_submix"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/camcorder/applicable_input_device/mask/anlg_dock_headset"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/camcorder/applicable_input_device/mask/dgtl_dock_headset"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/camcorder/applicable_input_device/mask/usb_accessory"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/camcorder/applicable_input_device/mask/usb_device"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/camcorder/applicable_input_device/mask/fm_tuner"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/camcorder/applicable_input_device/mask/tv_tuner"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/camcorder/applicable_input_device/mask/line"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/camcorder/applicable_input_device/mask/spdif"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/camcorder/applicable_input_device/mask/bluetooth_a2dp"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/camcorder/applicable_input_device/mask/loopback"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_recognition/applicable_input_device/mask/in"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_recognition/applicable_input_device/mask/communication"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_recognition/applicable_input_device/mask/ambient"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_recognition/applicable_input_device/mask/hdmi"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_recognition/applicable_input_device/mask/telephony_rx"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_recognition/applicable_input_device/mask/back_mic"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_recognition/applicable_input_device/mask/remote_submix"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_recognition/applicable_input_device/mask/anlg_dock_headset"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_recognition/applicable_input_device/mask/dgtl_dock_headset"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_recognition/applicable_input_device/mask/usb_accessory"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_recognition/applicable_input_device/mask/fm_tuner"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_recognition/applicable_input_device/mask/tv_tuner"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_recognition/applicable_input_device/mask/line"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_recognition/applicable_input_device/mask/spdif"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_recognition/applicable_input_device/mask/bluetooth_a2dp"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_recognition/applicable_input_device/mask/loopback"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/in"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/communication"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/ambient"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/hdmi"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/telephony_rx"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/remote_submix"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/anlg_dock_headset"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/dgtl_dock_headset"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/usb_accessory"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/fm_tuner"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/tv_tuner"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/line"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/spdif"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/bluetooth_a2dp"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/loopback"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/remote_submix/applicable_input_device/mask/in"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/remote_submix/applicable_input_device/mask/communication"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/remote_submix/applicable_input_device/mask/ambient"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/remote_submix/applicable_input_device/mask/builtin_mic"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/remote_submix/applicable_input_device/mask/bluetooth_sco_headset"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/remote_submix/applicable_input_device/mask/wired_headset"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/remote_submix/applicable_input_device/mask/hdmi"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/remote_submix/applicable_input_device/mask/telephony_rx"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/remote_submix/applicable_input_device/mask/back_mic"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/remote_submix/applicable_input_device/mask/anlg_dock_headset"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/remote_submix/applicable_input_device/mask/dgtl_dock_headset"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/remote_submix/applicable_input_device/mask/usb_accessory"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/remote_submix/applicable_input_device/mask/usb_device"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/remote_submix/applicable_input_device/mask/fm_tuner"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/remote_submix/applicable_input_device/mask/tv_tuner"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/remote_submix/applicable_input_device/mask/line"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/remote_submix/applicable_input_device/mask/spdif"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/remote_submix/applicable_input_device/mask/bluetooth_a2dp"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/remote_submix/applicable_input_device/mask/loopback"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/hotword/applicable_input_device/mask/in"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/hotword/applicable_input_device/mask/communication"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/hotword/applicable_input_device/mask/ambient"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/hotword/applicable_input_device/mask/hdmi"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/hotword/applicable_input_device/mask/telephony_rx"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/hotword/applicable_input_device/mask/back_mic"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/hotword/applicable_input_device/mask/remote_submix"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/hotword/applicable_input_device/mask/anlg_dock_headset"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/hotword/applicable_input_device/mask/dgtl_dock_headset"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/hotword/applicable_input_device/mask/usb_accessory"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/hotword/applicable_input_device/mask/fm_tuner"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/hotword/applicable_input_device/mask/tv_tuner"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/hotword/applicable_input_device/mask/line"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/hotword/applicable_input_device/mask/spdif"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/hotword/applicable_input_device/mask/bluetooth_a2dp"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/hotword/applicable_input_device/mask/loopback"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/fm_tuner/applicable_input_device/mask/in"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/fm_tuner/applicable_input_device/mask/communication"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/fm_tuner/applicable_input_device/mask/ambient"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/fm_tuner/applicable_input_device/mask/bluetooth_sco_headset"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/fm_tuner/applicable_input_device/mask/hdmi"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/fm_tuner/applicable_input_device/mask/telephony_rx"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/fm_tuner/applicable_input_device/mask/builtin_mic"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/fm_tuner/applicable_input_device/mask/wired_headset"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/fm_tuner/applicable_input_device/mask/back_mic"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/fm_tuner/applicable_input_device/mask/remote_submix"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/fm_tuner/applicable_input_device/mask/anlg_dock_headset"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/fm_tuner/applicable_input_device/mask/dgtl_dock_headset"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/fm_tuner/applicable_input_device/mask/usb_accessory"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/fm_tuner/applicable_input_device/mask/usb_device"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/fm_tuner/applicable_input_device/mask/fm_tuner"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/fm_tuner/applicable_input_device/mask/tv_tuner"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/fm_tuner/applicable_input_device/mask/line"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/fm_tuner/applicable_input_device/mask/spdif"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/fm_tuner/applicable_input_device/mask/bluetooth_a2dp"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/fm_tuner/applicable_input_device/mask/loopback"/>
+ </ConfigurableElements>
+ <Settings>
+ <Configuration Name="Calibration">
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/in">
+ <BitParameter Name="in">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/communication">
+ <BitParameter Name="communication">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/ambient">
+ <BitParameter Name="ambient">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/telephony_rx">
+ <BitParameter Name="telephony_rx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/back_mic">
+ <BitParameter Name="back_mic">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/anlg_dock_headset">
+ <BitParameter Name="anlg_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/fm_tuner">
+ <BitParameter Name="fm_tuner">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/tv_tuner">
+ <BitParameter Name="tv_tuner">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/spdif">
+ <BitParameter Name="spdif">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/loopback">
+ <BitParameter Name="loopback">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/in">
+ <BitParameter Name="in">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/communication">
+ <BitParameter Name="communication">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/ambient">
+ <BitParameter Name="ambient">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/telephony_rx">
+ <BitParameter Name="telephony_rx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/back_mic">
+ <BitParameter Name="back_mic">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/anlg_dock_headset">
+ <BitParameter Name="anlg_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/fm_tuner">
+ <BitParameter Name="fm_tuner">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/tv_tuner">
+ <BitParameter Name="tv_tuner">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/spdif">
+ <BitParameter Name="spdif">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/loopback">
+ <BitParameter Name="loopback">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_downlink/applicable_input_device/mask/in">
+ <BitParameter Name="in">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_downlink/applicable_input_device/mask/communication">
+ <BitParameter Name="communication">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_downlink/applicable_input_device/mask/ambient">
+ <BitParameter Name="ambient">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_downlink/applicable_input_device/mask/builtin_mic">
+ <BitParameter Name="builtin_mic">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_downlink/applicable_input_device/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_downlink/applicable_input_device/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_downlink/applicable_input_device/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_downlink/applicable_input_device/mask/back_mic">
+ <BitParameter Name="back_mic">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_downlink/applicable_input_device/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_downlink/applicable_input_device/mask/anlg_dock_headset">
+ <BitParameter Name="anlg_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_downlink/applicable_input_device/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_downlink/applicable_input_device/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_downlink/applicable_input_device/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_downlink/applicable_input_device/mask/fm_tuner">
+ <BitParameter Name="fm_tuner">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_downlink/applicable_input_device/mask/tv_tuner">
+ <BitParameter Name="tv_tuner">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_downlink/applicable_input_device/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_downlink/applicable_input_device/mask/spdif">
+ <BitParameter Name="spdif">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_downlink/applicable_input_device/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_downlink/applicable_input_device/mask/loopback">
+ <BitParameter Name="loopback">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_call/applicable_input_device/mask/in">
+ <BitParameter Name="in">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_call/applicable_input_device/mask/communication">
+ <BitParameter Name="communication">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_call/applicable_input_device/mask/ambient">
+ <BitParameter Name="ambient">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_call/applicable_input_device/mask/builtin_mic">
+ <BitParameter Name="builtin_mic">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_call/applicable_input_device/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_call/applicable_input_device/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_call/applicable_input_device/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_call/applicable_input_device/mask/back_mic">
+ <BitParameter Name="back_mic">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_call/applicable_input_device/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_call/applicable_input_device/mask/anlg_dock_headset">
+ <BitParameter Name="anlg_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_call/applicable_input_device/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_call/applicable_input_device/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_call/applicable_input_device/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_call/applicable_input_device/mask/fm_tuner">
+ <BitParameter Name="fm_tuner">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_call/applicable_input_device/mask/tv_tuner">
+ <BitParameter Name="tv_tuner">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_call/applicable_input_device/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_call/applicable_input_device/mask/spdif">
+ <BitParameter Name="spdif">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_call/applicable_input_device/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_call/applicable_input_device/mask/loopback">
+ <BitParameter Name="loopback">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_uplink/applicable_input_device/mask/in">
+ <BitParameter Name="in">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_uplink/applicable_input_device/mask/communication">
+ <BitParameter Name="communication">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_uplink/applicable_input_device/mask/ambient">
+ <BitParameter Name="ambient">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_uplink/applicable_input_device/mask/builtin_mic">
+ <BitParameter Name="builtin_mic">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_uplink/applicable_input_device/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_uplink/applicable_input_device/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_uplink/applicable_input_device/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_uplink/applicable_input_device/mask/back_mic">
+ <BitParameter Name="back_mic">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_uplink/applicable_input_device/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_uplink/applicable_input_device/mask/anlg_dock_headset">
+ <BitParameter Name="anlg_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_uplink/applicable_input_device/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_uplink/applicable_input_device/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_uplink/applicable_input_device/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_uplink/applicable_input_device/mask/fm_tuner">
+ <BitParameter Name="fm_tuner">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_uplink/applicable_input_device/mask/tv_tuner">
+ <BitParameter Name="tv_tuner">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_uplink/applicable_input_device/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_uplink/applicable_input_device/mask/spdif">
+ <BitParameter Name="spdif">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_uplink/applicable_input_device/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_uplink/applicable_input_device/mask/loopback">
+ <BitParameter Name="loopback">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/camcorder/applicable_input_device/mask/in">
+ <BitParameter Name="in">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/camcorder/applicable_input_device/mask/communication">
+ <BitParameter Name="communication">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/camcorder/applicable_input_device/mask/ambient">
+ <BitParameter Name="ambient">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/camcorder/applicable_input_device/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/camcorder/applicable_input_device/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/camcorder/applicable_input_device/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/camcorder/applicable_input_device/mask/telephony_rx">
+ <BitParameter Name="telephony_rx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/camcorder/applicable_input_device/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/camcorder/applicable_input_device/mask/anlg_dock_headset">
+ <BitParameter Name="anlg_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/camcorder/applicable_input_device/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/camcorder/applicable_input_device/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/camcorder/applicable_input_device/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/camcorder/applicable_input_device/mask/fm_tuner">
+ <BitParameter Name="fm_tuner">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/camcorder/applicable_input_device/mask/tv_tuner">
+ <BitParameter Name="tv_tuner">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/camcorder/applicable_input_device/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/camcorder/applicable_input_device/mask/spdif">
+ <BitParameter Name="spdif">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/camcorder/applicable_input_device/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/camcorder/applicable_input_device/mask/loopback">
+ <BitParameter Name="loopback">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_recognition/applicable_input_device/mask/in">
+ <BitParameter Name="in">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_recognition/applicable_input_device/mask/communication">
+ <BitParameter Name="communication">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_recognition/applicable_input_device/mask/ambient">
+ <BitParameter Name="ambient">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_recognition/applicable_input_device/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_recognition/applicable_input_device/mask/telephony_rx">
+ <BitParameter Name="telephony_rx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_recognition/applicable_input_device/mask/back_mic">
+ <BitParameter Name="back_mic">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_recognition/applicable_input_device/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_recognition/applicable_input_device/mask/anlg_dock_headset">
+ <BitParameter Name="anlg_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_recognition/applicable_input_device/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_recognition/applicable_input_device/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_recognition/applicable_input_device/mask/fm_tuner">
+ <BitParameter Name="fm_tuner">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_recognition/applicable_input_device/mask/tv_tuner">
+ <BitParameter Name="tv_tuner">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_recognition/applicable_input_device/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_recognition/applicable_input_device/mask/spdif">
+ <BitParameter Name="spdif">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_recognition/applicable_input_device/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_recognition/applicable_input_device/mask/loopback">
+ <BitParameter Name="loopback">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/in">
+ <BitParameter Name="in">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/communication">
+ <BitParameter Name="communication">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/ambient">
+ <BitParameter Name="ambient">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/telephony_rx">
+ <BitParameter Name="telephony_rx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/anlg_dock_headset">
+ <BitParameter Name="anlg_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/fm_tuner">
+ <BitParameter Name="fm_tuner">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/tv_tuner">
+ <BitParameter Name="tv_tuner">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/spdif">
+ <BitParameter Name="spdif">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/loopback">
+ <BitParameter Name="loopback">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/remote_submix/applicable_input_device/mask/in">
+ <BitParameter Name="in">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/remote_submix/applicable_input_device/mask/communication">
+ <BitParameter Name="communication">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/remote_submix/applicable_input_device/mask/ambient">
+ <BitParameter Name="ambient">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/remote_submix/applicable_input_device/mask/builtin_mic">
+ <BitParameter Name="builtin_mic">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/remote_submix/applicable_input_device/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/remote_submix/applicable_input_device/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/remote_submix/applicable_input_device/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/remote_submix/applicable_input_device/mask/telephony_rx">
+ <BitParameter Name="telephony_rx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/remote_submix/applicable_input_device/mask/back_mic">
+ <BitParameter Name="back_mic">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/remote_submix/applicable_input_device/mask/anlg_dock_headset">
+ <BitParameter Name="anlg_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/remote_submix/applicable_input_device/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/remote_submix/applicable_input_device/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/remote_submix/applicable_input_device/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/remote_submix/applicable_input_device/mask/fm_tuner">
+ <BitParameter Name="fm_tuner">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/remote_submix/applicable_input_device/mask/tv_tuner">
+ <BitParameter Name="tv_tuner">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/remote_submix/applicable_input_device/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/remote_submix/applicable_input_device/mask/spdif">
+ <BitParameter Name="spdif">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/remote_submix/applicable_input_device/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/remote_submix/applicable_input_device/mask/loopback">
+ <BitParameter Name="loopback">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/hotword/applicable_input_device/mask/in">
+ <BitParameter Name="in">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/hotword/applicable_input_device/mask/communication">
+ <BitParameter Name="communication">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/hotword/applicable_input_device/mask/ambient">
+ <BitParameter Name="ambient">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/hotword/applicable_input_device/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/hotword/applicable_input_device/mask/telephony_rx">
+ <BitParameter Name="telephony_rx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/hotword/applicable_input_device/mask/back_mic">
+ <BitParameter Name="back_mic">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/hotword/applicable_input_device/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/hotword/applicable_input_device/mask/anlg_dock_headset">
+ <BitParameter Name="anlg_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/hotword/applicable_input_device/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/hotword/applicable_input_device/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/hotword/applicable_input_device/mask/fm_tuner">
+ <BitParameter Name="fm_tuner">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/hotword/applicable_input_device/mask/tv_tuner">
+ <BitParameter Name="tv_tuner">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/hotword/applicable_input_device/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/hotword/applicable_input_device/mask/spdif">
+ <BitParameter Name="spdif">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/hotword/applicable_input_device/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/hotword/applicable_input_device/mask/loopback">
+ <BitParameter Name="loopback">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/fm_tuner/applicable_input_device/mask/in">
+ <BitParameter Name="in">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/fm_tuner/applicable_input_device/mask/communication">
+ <BitParameter Name="communication">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/fm_tuner/applicable_input_device/mask/ambient">
+ <BitParameter Name="ambient">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/fm_tuner/applicable_input_device/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/fm_tuner/applicable_input_device/mask/hdmi">
+ <BitParameter Name="hdmi">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/fm_tuner/applicable_input_device/mask/telephony_rx">
+ <BitParameter Name="telephony_rx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/fm_tuner/applicable_input_device/mask/builtin_mic">
+ <BitParameter Name="builtin_mic">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/fm_tuner/applicable_input_device/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/fm_tuner/applicable_input_device/mask/back_mic">
+ <BitParameter Name="back_mic">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/fm_tuner/applicable_input_device/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/fm_tuner/applicable_input_device/mask/anlg_dock_headset">
+ <BitParameter Name="anlg_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/fm_tuner/applicable_input_device/mask/dgtl_dock_headset">
+ <BitParameter Name="dgtl_dock_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/fm_tuner/applicable_input_device/mask/usb_accessory">
+ <BitParameter Name="usb_accessory">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/fm_tuner/applicable_input_device/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/fm_tuner/applicable_input_device/mask/fm_tuner">
+ <BitParameter Name="fm_tuner">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/fm_tuner/applicable_input_device/mask/tv_tuner">
+ <BitParameter Name="tv_tuner">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/fm_tuner/applicable_input_device/mask/line">
+ <BitParameter Name="line">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/fm_tuner/applicable_input_device/mask/spdif">
+ <BitParameter Name="spdif">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/fm_tuner/applicable_input_device/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/fm_tuner/applicable_input_device/mask/loopback">
+ <BitParameter Name="loopback">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ </Settings>
+ </ConfigurableDomain>
+ <ConfigurableDomain Name="DeviceForInputSource.DefaultAndMic" SequenceAware="false">
+ <Configurations>
+ <Configuration Name="A2dp">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableInputDevices" MatchesWhen="Includes" Value="BluetoothA2dp"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="Sco">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableInputDevices" MatchesWhen="Includes" Value="BluetoothScoHeadset"/>
+ <SelectionCriterionRule SelectionCriterion="ForceUseForRecord" MatchesWhen="Is" Value="ForceBtSco"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="WiredHeadset">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableInputDevices" MatchesWhen="Includes" Value="WiredHeadset"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="UsbDevice">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableInputDevices" MatchesWhen="Includes" Value="UsbDevice"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="BuiltinMic">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableInputDevices" MatchesWhen="Includes" Value="BuiltinMic"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="Default">
+ <CompoundRule Type="All"/>
+ </Configuration>
+ </Configurations>
+ <ConfigurableElements>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/bluetooth_a2dp"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/wired_headset"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/usb_device"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/builtin_mic"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/bluetooth_sco_headset"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/bluetooth_a2dp"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/wired_headset"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/usb_device"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/builtin_mic"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/bluetooth_sco_headset"/>
+ </ConfigurableElements>
+ <Settings>
+ <Configuration Name="A2dp">
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/builtin_mic">
+ <BitParameter Name="builtin_mic">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/builtin_mic">
+ <BitParameter Name="builtin_mic">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="Sco">
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/builtin_mic">
+ <BitParameter Name="builtin_mic">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/wired_headset">
+ <BitParameter Name="wired_headset">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/builtin_mic">
+ <BitParameter Name="builtin_mic">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">1</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="WiredHeadset">
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/wired_headset">
+ <BitParameter Name="wired_headset">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/builtin_mic">
+ <BitParameter Name="builtin_mic">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/wired_headset">
+ <BitParameter Name="wired_headset">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/builtin_mic">
+ <BitParameter Name="builtin_mic">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="UsbDevice">
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/usb_device">
+ <BitParameter Name="usb_device">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/builtin_mic">
+ <BitParameter Name="builtin_mic">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/usb_device">
+ <BitParameter Name="usb_device">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/builtin_mic">
+ <BitParameter Name="builtin_mic">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="BuiltinMic">
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/builtin_mic">
+ <BitParameter Name="builtin_mic">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/builtin_mic">
+ <BitParameter Name="builtin_mic">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="Default">
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/builtin_mic">
+ <BitParameter Name="builtin_mic">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/default/applicable_input_device/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/bluetooth_a2dp">
+ <BitParameter Name="bluetooth_a2dp">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/builtin_mic">
+ <BitParameter Name="builtin_mic">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/mic/applicable_input_device/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ </Settings>
+ </ConfigurableDomain>
+ <ConfigurableDomain Name="DeviceForInputSource.VoiceUplinkAndVoiceDownlinkAndVoiceCall" SequenceAware="false">
+ <Configurations>
+ <Configuration Name="VoiceCall">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableInputDevices" MatchesWhen="Includes" Value="TelephonyRx"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="Default">
+ <CompoundRule Type="All"/>
+ </Configuration>
+ </Configurations>
+ <ConfigurableElements>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_downlink/applicable_input_device/mask/telephony_rx"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_call/applicable_input_device/mask/telephony_rx"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_uplink/applicable_input_device/mask/telephony_rx"/>
+ </ConfigurableElements>
+ <Settings>
+ <Configuration Name="VoiceCall">
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_downlink/applicable_input_device/mask/telephony_rx">
+ <BitParameter Name="telephony_rx">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_call/applicable_input_device/mask/telephony_rx">
+ <BitParameter Name="telephony_rx">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_uplink/applicable_input_device/mask/telephony_rx">
+ <BitParameter Name="telephony_rx">1</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="Default">
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_downlink/applicable_input_device/mask/telephony_rx">
+ <BitParameter Name="telephony_rx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_call/applicable_input_device/mask/telephony_rx">
+ <BitParameter Name="telephony_rx">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_uplink/applicable_input_device/mask/telephony_rx">
+ <BitParameter Name="telephony_rx">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ </Settings>
+ </ConfigurableDomain>
+ <ConfigurableDomain Name="DeviceForInputSource.Camcorder" SequenceAware="false">
+ <Configurations>
+ <Configuration Name="BackMic">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableInputDevices" MatchesWhen="Includes" Value="BackMic"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="BuiltinMic">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableInputDevices" MatchesWhen="Includes" Value="BuiltinMic"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="Default">
+ <CompoundRule Type="All"/>
+ </Configuration>
+ </Configurations>
+ <ConfigurableElements>
+ <ConfigurableElement Path="/Policy/policy/input_sources/camcorder/applicable_input_device/mask/back_mic"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/camcorder/applicable_input_device/mask/builtin_mic"/>
+ </ConfigurableElements>
+ <Settings>
+ <Configuration Name="BackMic">
+ <ConfigurableElement Path="/Policy/policy/input_sources/camcorder/applicable_input_device/mask/back_mic">
+ <BitParameter Name="back_mic">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/camcorder/applicable_input_device/mask/builtin_mic">
+ <BitParameter Name="builtin_mic">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="BuiltinMic">
+ <ConfigurableElement Path="/Policy/policy/input_sources/camcorder/applicable_input_device/mask/back_mic">
+ <BitParameter Name="back_mic">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/camcorder/applicable_input_device/mask/builtin_mic">
+ <BitParameter Name="builtin_mic">1</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="Default">
+ <ConfigurableElement Path="/Policy/policy/input_sources/camcorder/applicable_input_device/mask/back_mic">
+ <BitParameter Name="back_mic">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/camcorder/applicable_input_device/mask/builtin_mic">
+ <BitParameter Name="builtin_mic">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ </Settings>
+ </ConfigurableDomain>
+ <ConfigurableDomain Name="DeviceForInputSource.VoiceRecognitionAndHotword" SequenceAware="false">
+ <Configurations>
+ <Configuration Name="ScoHeadset">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="ForceUseForRecord" MatchesWhen="Is" Value="ForceBtSco"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableInputDevices" MatchesWhen="Includes" Value="BluetoothScoHeadset"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="WiredHeadset">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableInputDevices" MatchesWhen="Includes" Value="WiredHeadset"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="UsbDevice">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableInputDevices" MatchesWhen="Includes" Value="UsbDevice"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="BuiltinMic">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableInputDevices" MatchesWhen="Includes" Value="BuiltinMic"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="Default">
+ <CompoundRule Type="All"/>
+ </Configuration>
+ </Configurations>
+ <ConfigurableElements>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_recognition/applicable_input_device/mask/bluetooth_sco_headset"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_recognition/applicable_input_device/mask/wired_headset"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_recognition/applicable_input_device/mask/usb_device"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_recognition/applicable_input_device/mask/builtin_mic"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/hotword/applicable_input_device/mask/bluetooth_sco_headset"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/hotword/applicable_input_device/mask/wired_headset"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/hotword/applicable_input_device/mask/usb_device"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/hotword/applicable_input_device/mask/builtin_mic"/>
+ </ConfigurableElements>
+ <Settings>
+ <Configuration Name="ScoHeadset">
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_recognition/applicable_input_device/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_recognition/applicable_input_device/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_recognition/applicable_input_device/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_recognition/applicable_input_device/mask/builtin_mic">
+ <BitParameter Name="builtin_mic">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/hotword/applicable_input_device/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/hotword/applicable_input_device/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/hotword/applicable_input_device/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/hotword/applicable_input_device/mask/builtin_mic">
+ <BitParameter Name="builtin_mic">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="WiredHeadset">
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_recognition/applicable_input_device/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_recognition/applicable_input_device/mask/wired_headset">
+ <BitParameter Name="wired_headset">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_recognition/applicable_input_device/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_recognition/applicable_input_device/mask/builtin_mic">
+ <BitParameter Name="builtin_mic">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/hotword/applicable_input_device/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/hotword/applicable_input_device/mask/wired_headset">
+ <BitParameter Name="wired_headset">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/hotword/applicable_input_device/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/hotword/applicable_input_device/mask/builtin_mic">
+ <BitParameter Name="builtin_mic">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="UsbDevice">
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_recognition/applicable_input_device/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_recognition/applicable_input_device/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_recognition/applicable_input_device/mask/usb_device">
+ <BitParameter Name="usb_device">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_recognition/applicable_input_device/mask/builtin_mic">
+ <BitParameter Name="builtin_mic">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/hotword/applicable_input_device/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/hotword/applicable_input_device/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/hotword/applicable_input_device/mask/usb_device">
+ <BitParameter Name="usb_device">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/hotword/applicable_input_device/mask/builtin_mic">
+ <BitParameter Name="builtin_mic">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="BuiltinMic">
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_recognition/applicable_input_device/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_recognition/applicable_input_device/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_recognition/applicable_input_device/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_recognition/applicable_input_device/mask/builtin_mic">
+ <BitParameter Name="builtin_mic">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/hotword/applicable_input_device/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/hotword/applicable_input_device/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/hotword/applicable_input_device/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/hotword/applicable_input_device/mask/builtin_mic">
+ <BitParameter Name="builtin_mic">1</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="Default">
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_recognition/applicable_input_device/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_recognition/applicable_input_device/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_recognition/applicable_input_device/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_recognition/applicable_input_device/mask/builtin_mic">
+ <BitParameter Name="builtin_mic">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/hotword/applicable_input_device/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/hotword/applicable_input_device/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/hotword/applicable_input_device/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/hotword/applicable_input_device/mask/builtin_mic">
+ <BitParameter Name="builtin_mic">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ </Settings>
+ </ConfigurableDomain>
+ <ConfigurableDomain Name="DeviceForInputSource.VoiceCommunication" SequenceAware="false">
+ <Configurations>
+ <Configuration Name="ScoHeadset">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="ForceUseForCommunication" MatchesWhen="Is" Value="ForceBtSco"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableInputDevices" MatchesWhen="Includes" Value="BluetoothScoHeadset"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="WiredHeadset">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="ForceUseForCommunication" MatchesWhen="Is" Value="ForceNone"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableInputDevices" MatchesWhen="Includes" Value="WiredHeadset"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="UsbDevice">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="ForceUseForCommunication" MatchesWhen="Is" Value="ForceNone"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableInputDevices" MatchesWhen="Includes" Value="UsbDevice"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="BuiltinMic">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableInputDevices" MatchesWhen="Includes" Value="BuiltinMic"/>
+ <CompoundRule Type="Any">
+ <SelectionCriterionRule SelectionCriterion="ForceUseForCommunication" MatchesWhen="Is" Value="ForceNone"/>
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="ForceUseForCommunication" MatchesWhen="Is" Value="ForceSpeaker"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableInputDevices" MatchesWhen="Excludes" Value="BackMic"/>
+ </CompoundRule>
+ </CompoundRule>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="BackMic">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="ForceUseForCommunication" MatchesWhen="Is" Value="ForceSpeaker"/>
+ <SelectionCriterionRule SelectionCriterion="AvailableInputDevices" MatchesWhen="Includes" Value="BackMic"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="Default">
+ <CompoundRule Type="All"/>
+ </Configuration>
+ </Configurations>
+ <ConfigurableElements>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/bluetooth_sco_headset"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/wired_headset"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/usb_device"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/builtin_mic"/>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/back_mic"/>
+ </ConfigurableElements>
+ <Settings>
+ <Configuration Name="ScoHeadset">
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/builtin_mic">
+ <BitParameter Name="builtin_mic">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/back_mic">
+ <BitParameter Name="back_mic">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="WiredHeadset">
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/wired_headset">
+ <BitParameter Name="wired_headset">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/builtin_mic">
+ <BitParameter Name="builtin_mic">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/back_mic">
+ <BitParameter Name="back_mic">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="UsbDevice">
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/usb_device">
+ <BitParameter Name="usb_device">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/builtin_mic">
+ <BitParameter Name="builtin_mic">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/back_mic">
+ <BitParameter Name="back_mic">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="BuiltinMic">
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/builtin_mic">
+ <BitParameter Name="builtin_mic">1</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/back_mic">
+ <BitParameter Name="back_mic">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="BackMic">
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/builtin_mic">
+ <BitParameter Name="builtin_mic">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/back_mic">
+ <BitParameter Name="back_mic">1</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="Default">
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/bluetooth_sco_headset">
+ <BitParameter Name="bluetooth_sco_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/wired_headset">
+ <BitParameter Name="wired_headset">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/usb_device">
+ <BitParameter Name="usb_device">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/builtin_mic">
+ <BitParameter Name="builtin_mic">0</BitParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/input_sources/voice_communication/applicable_input_device/mask/back_mic">
+ <BitParameter Name="back_mic">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ </Settings>
+ </ConfigurableDomain>
+ <ConfigurableDomain Name="DeviceForInputSource.RemoteSubmix" SequenceAware="false">
+ <Configurations>
+ <Configuration Name="RemoteSubmix">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableInputDevices" MatchesWhen="Includes" Value="RemoteSubmix"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="Default">
+ <CompoundRule Type="All"/>
+ </Configuration>
+ </Configurations>
+ <ConfigurableElements>
+ <ConfigurableElement Path="/Policy/policy/input_sources/remote_submix/applicable_input_device/mask/remote_submix"/>
+ </ConfigurableElements>
+ <Settings>
+ <Configuration Name="RemoteSubmix">
+ <ConfigurableElement Path="/Policy/policy/input_sources/remote_submix/applicable_input_device/mask/remote_submix">
+ <BitParameter Name="remote_submix">1</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="Default">
+ <ConfigurableElement Path="/Policy/policy/input_sources/remote_submix/applicable_input_device/mask/remote_submix">
+ <BitParameter Name="remote_submix">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ </Settings>
+ </ConfigurableDomain>
+ <ConfigurableDomain Name="DeviceForInputSource.FmTuner" SequenceAware="false">
+ <Configurations>
+ <Configuration Name="FmTuner">
+ <CompoundRule Type="All">
+ <SelectionCriterionRule SelectionCriterion="AvailableInputDevices" MatchesWhen="Includes" Value="FmTuner"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="Default">
+ <CompoundRule Type="All"/>
+ </Configuration>
+ </Configurations>
+ <ConfigurableElements>
+ <ConfigurableElement Path="/Policy/policy/input_sources/fm_tuner/applicable_input_device/mask/fm_tuner"/>
+ </ConfigurableElements>
+ <Settings>
+ <Configuration Name="FmTuner">
+ <ConfigurableElement Path="/Policy/policy/input_sources/fm_tuner/applicable_input_device/mask/fm_tuner">
+ <BitParameter Name="fm_tuner">1</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="Default">
+ <ConfigurableElement Path="/Policy/policy/input_sources/fm_tuner/applicable_input_device/mask/fm_tuner">
+ <BitParameter Name="fm_tuner">0</BitParameter>
+ </ConfigurableElement>
+ </Configuration>
+ </Settings>
+ </ConfigurableDomain>
+ <ConfigurableDomain Name="VolumeProfilesForStream.Calibration" SequenceAware="false">
+ <Configurations>
+ <Configuration Name="Calibration">
+ <CompoundRule Type="All"/>
+ </Configuration>
+ </Configurations>
+ <ConfigurableElements>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/headset_device_category/curve_points/0/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/headset_device_category/curve_points/0/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/headset_device_category/curve_points/1/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/headset_device_category/curve_points/1/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/headset_device_category/curve_points/2/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/headset_device_category/curve_points/2/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/headset_device_category/curve_points/3/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/headset_device_category/curve_points/3/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/speaker_device_category/curve_points/0/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/speaker_device_category/curve_points/0/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/speaker_device_category/curve_points/1/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/speaker_device_category/curve_points/1/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/speaker_device_category/curve_points/2/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/speaker_device_category/curve_points/2/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/speaker_device_category/curve_points/3/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/speaker_device_category/curve_points/3/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/earpiece_device_category/curve_points/0/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/earpiece_device_category/curve_points/0/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/earpiece_device_category/curve_points/1/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/earpiece_device_category/curve_points/1/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/earpiece_device_category/curve_points/2/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/earpiece_device_category/curve_points/2/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/earpiece_device_category/curve_points/3/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/earpiece_device_category/curve_points/3/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/extmedia_device_category/curve_points/0/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/extmedia_device_category/curve_points/0/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/extmedia_device_category/curve_points/1/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/extmedia_device_category/curve_points/1/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/extmedia_device_category/curve_points/2/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/extmedia_device_category/curve_points/2/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/extmedia_device_category/curve_points/3/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/extmedia_device_category/curve_points/3/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/headset_device_category/curve_points/0/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/headset_device_category/curve_points/0/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/headset_device_category/curve_points/1/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/headset_device_category/curve_points/1/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/headset_device_category/curve_points/2/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/headset_device_category/curve_points/2/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/headset_device_category/curve_points/3/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/headset_device_category/curve_points/3/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/speaker_device_category/curve_points/0/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/speaker_device_category/curve_points/0/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/speaker_device_category/curve_points/1/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/speaker_device_category/curve_points/1/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/speaker_device_category/curve_points/2/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/speaker_device_category/curve_points/2/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/speaker_device_category/curve_points/3/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/speaker_device_category/curve_points/3/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/earpiece_device_category/curve_points/0/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/earpiece_device_category/curve_points/0/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/earpiece_device_category/curve_points/1/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/earpiece_device_category/curve_points/1/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/earpiece_device_category/curve_points/2/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/earpiece_device_category/curve_points/2/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/earpiece_device_category/curve_points/3/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/earpiece_device_category/curve_points/3/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/extmedia_device_category/curve_points/0/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/extmedia_device_category/curve_points/0/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/extmedia_device_category/curve_points/1/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/extmedia_device_category/curve_points/1/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/extmedia_device_category/curve_points/2/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/extmedia_device_category/curve_points/2/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/extmedia_device_category/curve_points/3/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/extmedia_device_category/curve_points/3/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/headset_device_category/curve_points/0/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/headset_device_category/curve_points/0/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/headset_device_category/curve_points/1/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/headset_device_category/curve_points/1/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/headset_device_category/curve_points/2/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/headset_device_category/curve_points/2/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/headset_device_category/curve_points/3/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/headset_device_category/curve_points/3/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/speaker_device_category/curve_points/0/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/speaker_device_category/curve_points/0/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/speaker_device_category/curve_points/1/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/speaker_device_category/curve_points/1/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/speaker_device_category/curve_points/2/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/speaker_device_category/curve_points/2/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/speaker_device_category/curve_points/3/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/speaker_device_category/curve_points/3/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/earpiece_device_category/curve_points/0/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/earpiece_device_category/curve_points/0/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/earpiece_device_category/curve_points/1/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/earpiece_device_category/curve_points/1/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/earpiece_device_category/curve_points/2/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/earpiece_device_category/curve_points/2/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/earpiece_device_category/curve_points/3/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/earpiece_device_category/curve_points/3/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/extmedia_device_category/curve_points/0/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/extmedia_device_category/curve_points/0/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/extmedia_device_category/curve_points/1/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/extmedia_device_category/curve_points/1/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/extmedia_device_category/curve_points/2/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/extmedia_device_category/curve_points/2/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/extmedia_device_category/curve_points/3/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/extmedia_device_category/curve_points/3/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/headset_device_category/curve_points/0/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/headset_device_category/curve_points/0/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/headset_device_category/curve_points/1/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/headset_device_category/curve_points/1/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/headset_device_category/curve_points/2/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/headset_device_category/curve_points/2/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/headset_device_category/curve_points/3/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/headset_device_category/curve_points/3/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/speaker_device_category/curve_points/0/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/speaker_device_category/curve_points/0/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/speaker_device_category/curve_points/1/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/speaker_device_category/curve_points/1/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/speaker_device_category/curve_points/2/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/speaker_device_category/curve_points/2/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/speaker_device_category/curve_points/3/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/speaker_device_category/curve_points/3/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/earpiece_device_category/curve_points/0/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/earpiece_device_category/curve_points/0/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/earpiece_device_category/curve_points/1/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/earpiece_device_category/curve_points/1/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/earpiece_device_category/curve_points/2/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/earpiece_device_category/curve_points/2/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/earpiece_device_category/curve_points/3/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/earpiece_device_category/curve_points/3/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/extmedia_device_category/curve_points/0/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/extmedia_device_category/curve_points/0/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/extmedia_device_category/curve_points/1/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/extmedia_device_category/curve_points/1/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/extmedia_device_category/curve_points/2/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/extmedia_device_category/curve_points/2/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/extmedia_device_category/curve_points/3/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/extmedia_device_category/curve_points/3/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/headset_device_category/curve_points/0/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/headset_device_category/curve_points/0/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/headset_device_category/curve_points/1/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/headset_device_category/curve_points/1/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/headset_device_category/curve_points/2/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/headset_device_category/curve_points/2/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/headset_device_category/curve_points/3/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/headset_device_category/curve_points/3/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/speaker_device_category/curve_points/0/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/speaker_device_category/curve_points/0/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/speaker_device_category/curve_points/1/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/speaker_device_category/curve_points/1/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/speaker_device_category/curve_points/2/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/speaker_device_category/curve_points/2/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/speaker_device_category/curve_points/3/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/speaker_device_category/curve_points/3/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/earpiece_device_category/curve_points/0/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/earpiece_device_category/curve_points/0/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/earpiece_device_category/curve_points/1/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/earpiece_device_category/curve_points/1/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/earpiece_device_category/curve_points/2/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/earpiece_device_category/curve_points/2/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/earpiece_device_category/curve_points/3/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/earpiece_device_category/curve_points/3/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/extmedia_device_category/curve_points/0/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/extmedia_device_category/curve_points/0/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/extmedia_device_category/curve_points/1/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/extmedia_device_category/curve_points/1/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/extmedia_device_category/curve_points/2/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/extmedia_device_category/curve_points/2/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/extmedia_device_category/curve_points/3/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/extmedia_device_category/curve_points/3/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/headset_device_category/curve_points/0/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/headset_device_category/curve_points/0/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/headset_device_category/curve_points/1/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/headset_device_category/curve_points/1/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/headset_device_category/curve_points/2/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/headset_device_category/curve_points/2/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/headset_device_category/curve_points/3/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/headset_device_category/curve_points/3/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/speaker_device_category/curve_points/0/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/speaker_device_category/curve_points/0/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/speaker_device_category/curve_points/1/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/speaker_device_category/curve_points/1/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/speaker_device_category/curve_points/2/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/speaker_device_category/curve_points/2/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/speaker_device_category/curve_points/3/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/speaker_device_category/curve_points/3/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/earpiece_device_category/curve_points/0/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/earpiece_device_category/curve_points/0/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/earpiece_device_category/curve_points/1/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/earpiece_device_category/curve_points/1/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/earpiece_device_category/curve_points/2/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/earpiece_device_category/curve_points/2/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/earpiece_device_category/curve_points/3/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/earpiece_device_category/curve_points/3/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/extmedia_device_category/curve_points/0/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/extmedia_device_category/curve_points/0/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/extmedia_device_category/curve_points/1/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/extmedia_device_category/curve_points/1/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/extmedia_device_category/curve_points/2/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/extmedia_device_category/curve_points/2/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/extmedia_device_category/curve_points/3/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/extmedia_device_category/curve_points/3/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/headset_device_category/curve_points/0/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/headset_device_category/curve_points/0/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/headset_device_category/curve_points/1/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/headset_device_category/curve_points/1/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/headset_device_category/curve_points/2/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/headset_device_category/curve_points/2/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/headset_device_category/curve_points/3/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/headset_device_category/curve_points/3/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/speaker_device_category/curve_points/0/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/speaker_device_category/curve_points/0/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/speaker_device_category/curve_points/1/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/speaker_device_category/curve_points/1/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/speaker_device_category/curve_points/2/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/speaker_device_category/curve_points/2/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/speaker_device_category/curve_points/3/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/speaker_device_category/curve_points/3/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/earpiece_device_category/curve_points/0/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/earpiece_device_category/curve_points/0/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/earpiece_device_category/curve_points/1/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/earpiece_device_category/curve_points/1/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/earpiece_device_category/curve_points/2/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/earpiece_device_category/curve_points/2/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/earpiece_device_category/curve_points/3/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/earpiece_device_category/curve_points/3/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/extmedia_device_category/curve_points/0/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/extmedia_device_category/curve_points/0/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/extmedia_device_category/curve_points/1/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/extmedia_device_category/curve_points/1/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/extmedia_device_category/curve_points/2/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/extmedia_device_category/curve_points/2/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/extmedia_device_category/curve_points/3/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/extmedia_device_category/curve_points/3/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/headset_device_category/curve_points/0/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/headset_device_category/curve_points/0/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/headset_device_category/curve_points/1/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/headset_device_category/curve_points/1/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/headset_device_category/curve_points/2/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/headset_device_category/curve_points/2/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/headset_device_category/curve_points/3/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/headset_device_category/curve_points/3/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/speaker_device_category/curve_points/0/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/speaker_device_category/curve_points/0/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/speaker_device_category/curve_points/1/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/speaker_device_category/curve_points/1/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/speaker_device_category/curve_points/2/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/speaker_device_category/curve_points/2/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/speaker_device_category/curve_points/3/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/speaker_device_category/curve_points/3/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/earpiece_device_category/curve_points/0/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/earpiece_device_category/curve_points/0/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/earpiece_device_category/curve_points/1/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/earpiece_device_category/curve_points/1/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/earpiece_device_category/curve_points/2/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/earpiece_device_category/curve_points/2/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/earpiece_device_category/curve_points/3/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/earpiece_device_category/curve_points/3/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/extmedia_device_category/curve_points/0/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/extmedia_device_category/curve_points/0/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/extmedia_device_category/curve_points/1/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/extmedia_device_category/curve_points/1/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/extmedia_device_category/curve_points/2/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/extmedia_device_category/curve_points/2/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/extmedia_device_category/curve_points/3/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/extmedia_device_category/curve_points/3/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/headset_device_category/curve_points/0/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/headset_device_category/curve_points/0/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/headset_device_category/curve_points/1/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/headset_device_category/curve_points/1/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/headset_device_category/curve_points/2/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/headset_device_category/curve_points/2/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/headset_device_category/curve_points/3/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/headset_device_category/curve_points/3/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/speaker_device_category/curve_points/0/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/speaker_device_category/curve_points/0/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/speaker_device_category/curve_points/1/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/speaker_device_category/curve_points/1/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/speaker_device_category/curve_points/2/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/speaker_device_category/curve_points/2/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/speaker_device_category/curve_points/3/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/speaker_device_category/curve_points/3/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/earpiece_device_category/curve_points/0/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/earpiece_device_category/curve_points/0/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/earpiece_device_category/curve_points/1/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/earpiece_device_category/curve_points/1/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/earpiece_device_category/curve_points/2/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/earpiece_device_category/curve_points/2/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/earpiece_device_category/curve_points/3/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/earpiece_device_category/curve_points/3/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/extmedia_device_category/curve_points/0/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/extmedia_device_category/curve_points/0/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/extmedia_device_category/curve_points/1/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/extmedia_device_category/curve_points/1/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/extmedia_device_category/curve_points/2/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/extmedia_device_category/curve_points/2/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/extmedia_device_category/curve_points/3/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/extmedia_device_category/curve_points/3/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/headset_device_category/curve_points/0/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/headset_device_category/curve_points/0/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/headset_device_category/curve_points/1/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/headset_device_category/curve_points/1/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/headset_device_category/curve_points/2/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/headset_device_category/curve_points/2/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/headset_device_category/curve_points/3/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/headset_device_category/curve_points/3/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/speaker_device_category/curve_points/0/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/speaker_device_category/curve_points/0/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/speaker_device_category/curve_points/1/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/speaker_device_category/curve_points/1/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/speaker_device_category/curve_points/2/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/speaker_device_category/curve_points/2/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/speaker_device_category/curve_points/3/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/speaker_device_category/curve_points/3/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/earpiece_device_category/curve_points/0/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/earpiece_device_category/curve_points/0/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/earpiece_device_category/curve_points/1/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/earpiece_device_category/curve_points/1/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/earpiece_device_category/curve_points/2/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/earpiece_device_category/curve_points/2/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/earpiece_device_category/curve_points/3/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/earpiece_device_category/curve_points/3/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/extmedia_device_category/curve_points/0/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/extmedia_device_category/curve_points/0/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/extmedia_device_category/curve_points/1/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/extmedia_device_category/curve_points/1/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/extmedia_device_category/curve_points/2/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/extmedia_device_category/curve_points/2/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/extmedia_device_category/curve_points/3/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/extmedia_device_category/curve_points/3/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/headset_device_category/curve_points/0/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/headset_device_category/curve_points/0/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/headset_device_category/curve_points/1/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/headset_device_category/curve_points/1/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/headset_device_category/curve_points/2/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/headset_device_category/curve_points/2/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/headset_device_category/curve_points/3/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/headset_device_category/curve_points/3/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/speaker_device_category/curve_points/0/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/speaker_device_category/curve_points/0/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/speaker_device_category/curve_points/1/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/speaker_device_category/curve_points/1/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/speaker_device_category/curve_points/2/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/speaker_device_category/curve_points/2/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/speaker_device_category/curve_points/3/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/speaker_device_category/curve_points/3/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/earpiece_device_category/curve_points/0/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/earpiece_device_category/curve_points/0/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/earpiece_device_category/curve_points/1/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/earpiece_device_category/curve_points/1/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/earpiece_device_category/curve_points/2/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/earpiece_device_category/curve_points/2/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/earpiece_device_category/curve_points/3/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/earpiece_device_category/curve_points/3/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/extmedia_device_category/curve_points/0/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/extmedia_device_category/curve_points/0/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/extmedia_device_category/curve_points/1/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/extmedia_device_category/curve_points/1/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/extmedia_device_category/curve_points/2/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/extmedia_device_category/curve_points/2/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/extmedia_device_category/curve_points/3/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/extmedia_device_category/curve_points/3/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/headset_device_category/curve_points/0/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/headset_device_category/curve_points/0/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/headset_device_category/curve_points/1/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/headset_device_category/curve_points/1/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/headset_device_category/curve_points/2/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/headset_device_category/curve_points/2/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/headset_device_category/curve_points/3/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/headset_device_category/curve_points/3/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/speaker_device_category/curve_points/0/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/speaker_device_category/curve_points/0/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/speaker_device_category/curve_points/1/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/speaker_device_category/curve_points/1/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/speaker_device_category/curve_points/2/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/speaker_device_category/curve_points/2/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/speaker_device_category/curve_points/3/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/speaker_device_category/curve_points/3/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/earpiece_device_category/curve_points/0/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/earpiece_device_category/curve_points/0/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/earpiece_device_category/curve_points/1/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/earpiece_device_category/curve_points/1/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/earpiece_device_category/curve_points/2/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/earpiece_device_category/curve_points/2/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/earpiece_device_category/curve_points/3/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/earpiece_device_category/curve_points/3/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/extmedia_device_category/curve_points/0/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/extmedia_device_category/curve_points/0/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/extmedia_device_category/curve_points/1/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/extmedia_device_category/curve_points/1/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/extmedia_device_category/curve_points/2/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/extmedia_device_category/curve_points/2/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/extmedia_device_category/curve_points/3/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/extmedia_device_category/curve_points/3/db_attenuation"/>
+ </ConfigurableElements>
+ <Settings>
+ <Configuration Name="Calibration">
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/headset_device_category/curve_points/0/index">
+ <IntegerParameter Name="index">0</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/headset_device_category/curve_points/0/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-24.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/headset_device_category/curve_points/1/index">
+ <IntegerParameter Name="index">33</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/headset_device_category/curve_points/1/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-18.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/headset_device_category/curve_points/2/index">
+ <IntegerParameter Name="index">66</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/headset_device_category/curve_points/2/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-12.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/headset_device_category/curve_points/3/index">
+ <IntegerParameter Name="index">100</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/headset_device_category/curve_points/3/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-6.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/speaker_device_category/curve_points/0/index">
+ <IntegerParameter Name="index">0</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/speaker_device_category/curve_points/0/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-24.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/speaker_device_category/curve_points/1/index">
+ <IntegerParameter Name="index">33</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/speaker_device_category/curve_points/1/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-16.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/speaker_device_category/curve_points/2/index">
+ <IntegerParameter Name="index">66</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/speaker_device_category/curve_points/2/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-8.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/speaker_device_category/curve_points/3/index">
+ <IntegerParameter Name="index">100</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/speaker_device_category/curve_points/3/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">0.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/earpiece_device_category/curve_points/0/index">
+ <IntegerParameter Name="index">0</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/earpiece_device_category/curve_points/0/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-24.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/earpiece_device_category/curve_points/1/index">
+ <IntegerParameter Name="index">33</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/earpiece_device_category/curve_points/1/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-18.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/earpiece_device_category/curve_points/2/index">
+ <IntegerParameter Name="index">66</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/earpiece_device_category/curve_points/2/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-12.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/earpiece_device_category/curve_points/3/index">
+ <IntegerParameter Name="index">100</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/earpiece_device_category/curve_points/3/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-6.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/extmedia_device_category/curve_points/0/index">
+ <IntegerParameter Name="index">1</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/extmedia_device_category/curve_points/0/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-58.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/extmedia_device_category/curve_points/1/index">
+ <IntegerParameter Name="index">33</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/extmedia_device_category/curve_points/1/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-40.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/extmedia_device_category/curve_points/2/index">
+ <IntegerParameter Name="index">66</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/extmedia_device_category/curve_points/2/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-17.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/extmedia_device_category/curve_points/3/index">
+ <IntegerParameter Name="index">100</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/voice_call/volume_profiles/extmedia_device_category/curve_points/3/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">0.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/headset_device_category/curve_points/0/index">
+ <IntegerParameter Name="index">1</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/headset_device_category/curve_points/0/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-30.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/headset_device_category/curve_points/1/index">
+ <IntegerParameter Name="index">33</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/headset_device_category/curve_points/1/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-26.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/headset_device_category/curve_points/2/index">
+ <IntegerParameter Name="index">66</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/headset_device_category/curve_points/2/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-22.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/headset_device_category/curve_points/3/index">
+ <IntegerParameter Name="index">100</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/headset_device_category/curve_points/3/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-18.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/speaker_device_category/curve_points/0/index">
+ <IntegerParameter Name="index">1</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/speaker_device_category/curve_points/0/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-24.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/speaker_device_category/curve_points/1/index">
+ <IntegerParameter Name="index">33</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/speaker_device_category/curve_points/1/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-18.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/speaker_device_category/curve_points/2/index">
+ <IntegerParameter Name="index">66</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/speaker_device_category/curve_points/2/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-12.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/speaker_device_category/curve_points/3/index">
+ <IntegerParameter Name="index">100</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/speaker_device_category/curve_points/3/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-6.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/earpiece_device_category/curve_points/0/index">
+ <IntegerParameter Name="index">1</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/earpiece_device_category/curve_points/0/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-24.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/earpiece_device_category/curve_points/1/index">
+ <IntegerParameter Name="index">33</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/earpiece_device_category/curve_points/1/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-18.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/earpiece_device_category/curve_points/2/index">
+ <IntegerParameter Name="index">66</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/earpiece_device_category/curve_points/2/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-12.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/earpiece_device_category/curve_points/3/index">
+ <IntegerParameter Name="index">100</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/earpiece_device_category/curve_points/3/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-6.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/extmedia_device_category/curve_points/0/index">
+ <IntegerParameter Name="index">1</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/extmedia_device_category/curve_points/0/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-58.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/extmedia_device_category/curve_points/1/index">
+ <IntegerParameter Name="index">33</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/extmedia_device_category/curve_points/1/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-40.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/extmedia_device_category/curve_points/2/index">
+ <IntegerParameter Name="index">66</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/extmedia_device_category/curve_points/2/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-21.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/extmedia_device_category/curve_points/3/index">
+ <IntegerParameter Name="index">100</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/system/volume_profiles/extmedia_device_category/curve_points/3/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-10.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/headset_device_category/curve_points/0/index">
+ <IntegerParameter Name="index">1</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/headset_device_category/curve_points/0/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-49.50000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/headset_device_category/curve_points/1/index">
+ <IntegerParameter Name="index">33</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/headset_device_category/curve_points/1/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-33.50000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/headset_device_category/curve_points/2/index">
+ <IntegerParameter Name="index">66</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/headset_device_category/curve_points/2/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-17.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/headset_device_category/curve_points/3/index">
+ <IntegerParameter Name="index">100</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/headset_device_category/curve_points/3/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">0.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/speaker_device_category/curve_points/0/index">
+ <IntegerParameter Name="index">1</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/speaker_device_category/curve_points/0/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-35.69921875</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/speaker_device_category/curve_points/1/index">
+ <IntegerParameter Name="index">33</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/speaker_device_category/curve_points/1/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-26.10156250</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/speaker_device_category/curve_points/2/index">
+ <IntegerParameter Name="index">66</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/speaker_device_category/curve_points/2/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-13.19921875</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/speaker_device_category/curve_points/3/index">
+ <IntegerParameter Name="index">100</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/speaker_device_category/curve_points/3/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">0.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/earpiece_device_category/curve_points/0/index">
+ <IntegerParameter Name="index">1</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/earpiece_device_category/curve_points/0/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-49.50000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/earpiece_device_category/curve_points/1/index">
+ <IntegerParameter Name="index">33</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/earpiece_device_category/curve_points/1/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-33.50000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/earpiece_device_category/curve_points/2/index">
+ <IntegerParameter Name="index">66</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/earpiece_device_category/curve_points/2/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-17.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/earpiece_device_category/curve_points/3/index">
+ <IntegerParameter Name="index">100</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/earpiece_device_category/curve_points/3/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">0.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/extmedia_device_category/curve_points/0/index">
+ <IntegerParameter Name="index">1</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/extmedia_device_category/curve_points/0/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-58.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/extmedia_device_category/curve_points/1/index">
+ <IntegerParameter Name="index">33</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/extmedia_device_category/curve_points/1/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-40.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/extmedia_device_category/curve_points/2/index">
+ <IntegerParameter Name="index">66</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/extmedia_device_category/curve_points/2/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-27.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/extmedia_device_category/curve_points/3/index">
+ <IntegerParameter Name="index">100</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/ring/volume_profiles/extmedia_device_category/curve_points/3/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-10.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/headset_device_category/curve_points/0/index">
+ <IntegerParameter Name="index">1</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/headset_device_category/curve_points/0/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-58.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/headset_device_category/curve_points/1/index">
+ <IntegerParameter Name="index">33</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/headset_device_category/curve_points/1/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-40.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/headset_device_category/curve_points/2/index">
+ <IntegerParameter Name="index">66</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/headset_device_category/curve_points/2/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-17.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/headset_device_category/curve_points/3/index">
+ <IntegerParameter Name="index">100</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/headset_device_category/curve_points/3/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">0.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/speaker_device_category/curve_points/0/index">
+ <IntegerParameter Name="index">1</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/speaker_device_category/curve_points/0/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-56.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/speaker_device_category/curve_points/1/index">
+ <IntegerParameter Name="index">33</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/speaker_device_category/curve_points/1/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-34.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/speaker_device_category/curve_points/2/index">
+ <IntegerParameter Name="index">66</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/speaker_device_category/curve_points/2/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-11.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/speaker_device_category/curve_points/3/index">
+ <IntegerParameter Name="index">100</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/speaker_device_category/curve_points/3/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">0.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/earpiece_device_category/curve_points/0/index">
+ <IntegerParameter Name="index">1</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/earpiece_device_category/curve_points/0/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-58.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/earpiece_device_category/curve_points/1/index">
+ <IntegerParameter Name="index">33</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/earpiece_device_category/curve_points/1/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-40.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/earpiece_device_category/curve_points/2/index">
+ <IntegerParameter Name="index">66</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/earpiece_device_category/curve_points/2/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-17.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/earpiece_device_category/curve_points/3/index">
+ <IntegerParameter Name="index">100</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/earpiece_device_category/curve_points/3/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">0.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/extmedia_device_category/curve_points/0/index">
+ <IntegerParameter Name="index">1</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/extmedia_device_category/curve_points/0/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-58.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/extmedia_device_category/curve_points/1/index">
+ <IntegerParameter Name="index">33</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/extmedia_device_category/curve_points/1/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-40.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/extmedia_device_category/curve_points/2/index">
+ <IntegerParameter Name="index">66</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/extmedia_device_category/curve_points/2/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-17.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/extmedia_device_category/curve_points/3/index">
+ <IntegerParameter Name="index">100</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/music/volume_profiles/extmedia_device_category/curve_points/3/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">0.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/headset_device_category/curve_points/0/index">
+ <IntegerParameter Name="index">1</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/headset_device_category/curve_points/0/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-49.50000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/headset_device_category/curve_points/1/index">
+ <IntegerParameter Name="index">33</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/headset_device_category/curve_points/1/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-33.50000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/headset_device_category/curve_points/2/index">
+ <IntegerParameter Name="index">66</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/headset_device_category/curve_points/2/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-17.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/headset_device_category/curve_points/3/index">
+ <IntegerParameter Name="index">100</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/headset_device_category/curve_points/3/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">0.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/speaker_device_category/curve_points/0/index">
+ <IntegerParameter Name="index">1</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/speaker_device_category/curve_points/0/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-35.69921875</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/speaker_device_category/curve_points/1/index">
+ <IntegerParameter Name="index">33</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/speaker_device_category/curve_points/1/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-26.10156250</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/speaker_device_category/curve_points/2/index">
+ <IntegerParameter Name="index">66</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/speaker_device_category/curve_points/2/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-13.19921875</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/speaker_device_category/curve_points/3/index">
+ <IntegerParameter Name="index">100</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/speaker_device_category/curve_points/3/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">0.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/earpiece_device_category/curve_points/0/index">
+ <IntegerParameter Name="index">1</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/earpiece_device_category/curve_points/0/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-49.50000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/earpiece_device_category/curve_points/1/index">
+ <IntegerParameter Name="index">33</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/earpiece_device_category/curve_points/1/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-33.50000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/earpiece_device_category/curve_points/2/index">
+ <IntegerParameter Name="index">66</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/earpiece_device_category/curve_points/2/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-17.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/earpiece_device_category/curve_points/3/index">
+ <IntegerParameter Name="index">100</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/earpiece_device_category/curve_points/3/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">0.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/extmedia_device_category/curve_points/0/index">
+ <IntegerParameter Name="index">1</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/extmedia_device_category/curve_points/0/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-58.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/extmedia_device_category/curve_points/1/index">
+ <IntegerParameter Name="index">33</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/extmedia_device_category/curve_points/1/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-40.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/extmedia_device_category/curve_points/2/index">
+ <IntegerParameter Name="index">66</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/extmedia_device_category/curve_points/2/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-27.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/extmedia_device_category/curve_points/3/index">
+ <IntegerParameter Name="index">100</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/alarm/volume_profiles/extmedia_device_category/curve_points/3/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-10.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/headset_device_category/curve_points/0/index">
+ <IntegerParameter Name="index">1</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/headset_device_category/curve_points/0/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-49.50000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/headset_device_category/curve_points/1/index">
+ <IntegerParameter Name="index">33</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/headset_device_category/curve_points/1/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-33.50000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/headset_device_category/curve_points/2/index">
+ <IntegerParameter Name="index">66</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/headset_device_category/curve_points/2/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-17.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/headset_device_category/curve_points/3/index">
+ <IntegerParameter Name="index">100</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/headset_device_category/curve_points/3/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">0.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/speaker_device_category/curve_points/0/index">
+ <IntegerParameter Name="index">1</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/speaker_device_category/curve_points/0/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-35.69921875</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/speaker_device_category/curve_points/1/index">
+ <IntegerParameter Name="index">33</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/speaker_device_category/curve_points/1/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-26.10156250</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/speaker_device_category/curve_points/2/index">
+ <IntegerParameter Name="index">66</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/speaker_device_category/curve_points/2/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-13.19921875</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/speaker_device_category/curve_points/3/index">
+ <IntegerParameter Name="index">100</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/speaker_device_category/curve_points/3/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">0.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/earpiece_device_category/curve_points/0/index">
+ <IntegerParameter Name="index">1</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/earpiece_device_category/curve_points/0/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-49.50000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/earpiece_device_category/curve_points/1/index">
+ <IntegerParameter Name="index">33</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/earpiece_device_category/curve_points/1/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-33.50000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/earpiece_device_category/curve_points/2/index">
+ <IntegerParameter Name="index">66</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/earpiece_device_category/curve_points/2/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-17.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/earpiece_device_category/curve_points/3/index">
+ <IntegerParameter Name="index">100</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/earpiece_device_category/curve_points/3/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">0.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/extmedia_device_category/curve_points/0/index">
+ <IntegerParameter Name="index">1</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/extmedia_device_category/curve_points/0/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-58.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/extmedia_device_category/curve_points/1/index">
+ <IntegerParameter Name="index">33</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/extmedia_device_category/curve_points/1/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-40.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/extmedia_device_category/curve_points/2/index">
+ <IntegerParameter Name="index">66</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/extmedia_device_category/curve_points/2/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-27.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/extmedia_device_category/curve_points/3/index">
+ <IntegerParameter Name="index">100</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/notification/volume_profiles/extmedia_device_category/curve_points/3/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-10.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/headset_device_category/curve_points/0/index">
+ <IntegerParameter Name="index">0</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/headset_device_category/curve_points/0/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-24.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/headset_device_category/curve_points/1/index">
+ <IntegerParameter Name="index">33</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/headset_device_category/curve_points/1/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-18.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/headset_device_category/curve_points/2/index">
+ <IntegerParameter Name="index">66</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/headset_device_category/curve_points/2/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-12.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/headset_device_category/curve_points/3/index">
+ <IntegerParameter Name="index">100</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/headset_device_category/curve_points/3/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-6.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/speaker_device_category/curve_points/0/index">
+ <IntegerParameter Name="index">0</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/speaker_device_category/curve_points/0/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-24.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/speaker_device_category/curve_points/1/index">
+ <IntegerParameter Name="index">33</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/speaker_device_category/curve_points/1/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-16.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/speaker_device_category/curve_points/2/index">
+ <IntegerParameter Name="index">66</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/speaker_device_category/curve_points/2/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-8.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/speaker_device_category/curve_points/3/index">
+ <IntegerParameter Name="index">100</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/speaker_device_category/curve_points/3/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">0.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/earpiece_device_category/curve_points/0/index">
+ <IntegerParameter Name="index">0</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/earpiece_device_category/curve_points/0/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-24.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/earpiece_device_category/curve_points/1/index">
+ <IntegerParameter Name="index">33</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/earpiece_device_category/curve_points/1/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-18.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/earpiece_device_category/curve_points/2/index">
+ <IntegerParameter Name="index">66</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/earpiece_device_category/curve_points/2/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-12.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/earpiece_device_category/curve_points/3/index">
+ <IntegerParameter Name="index">100</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/earpiece_device_category/curve_points/3/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-6.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/extmedia_device_category/curve_points/0/index">
+ <IntegerParameter Name="index">1</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/extmedia_device_category/curve_points/0/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-58.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/extmedia_device_category/curve_points/1/index">
+ <IntegerParameter Name="index">33</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/extmedia_device_category/curve_points/1/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-40.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/extmedia_device_category/curve_points/2/index">
+ <IntegerParameter Name="index">66</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/extmedia_device_category/curve_points/2/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-17.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/extmedia_device_category/curve_points/3/index">
+ <IntegerParameter Name="index">100</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/bluetooth_sco/volume_profiles/extmedia_device_category/curve_points/3/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">0.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/headset_device_category/curve_points/0/index">
+ <IntegerParameter Name="index">1</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/headset_device_category/curve_points/0/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-30.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/headset_device_category/curve_points/1/index">
+ <IntegerParameter Name="index">33</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/headset_device_category/curve_points/1/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-26.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/headset_device_category/curve_points/2/index">
+ <IntegerParameter Name="index">66</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/headset_device_category/curve_points/2/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-22.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/headset_device_category/curve_points/3/index">
+ <IntegerParameter Name="index">100</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/headset_device_category/curve_points/3/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-18.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/speaker_device_category/curve_points/0/index">
+ <IntegerParameter Name="index">1</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/speaker_device_category/curve_points/0/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-24.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/speaker_device_category/curve_points/1/index">
+ <IntegerParameter Name="index">33</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/speaker_device_category/curve_points/1/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-18.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/speaker_device_category/curve_points/2/index">
+ <IntegerParameter Name="index">66</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/speaker_device_category/curve_points/2/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-12.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/speaker_device_category/curve_points/3/index">
+ <IntegerParameter Name="index">100</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/speaker_device_category/curve_points/3/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-6.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/earpiece_device_category/curve_points/0/index">
+ <IntegerParameter Name="index">1</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/earpiece_device_category/curve_points/0/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-24.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/earpiece_device_category/curve_points/1/index">
+ <IntegerParameter Name="index">33</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/earpiece_device_category/curve_points/1/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-18.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/earpiece_device_category/curve_points/2/index">
+ <IntegerParameter Name="index">66</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/earpiece_device_category/curve_points/2/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-12.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/earpiece_device_category/curve_points/3/index">
+ <IntegerParameter Name="index">100</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/earpiece_device_category/curve_points/3/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-6.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/extmedia_device_category/curve_points/0/index">
+ <IntegerParameter Name="index">1</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/extmedia_device_category/curve_points/0/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-58.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/extmedia_device_category/curve_points/1/index">
+ <IntegerParameter Name="index">33</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/extmedia_device_category/curve_points/1/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-40.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/extmedia_device_category/curve_points/2/index">
+ <IntegerParameter Name="index">66</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/extmedia_device_category/curve_points/2/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-27.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/extmedia_device_category/curve_points/3/index">
+ <IntegerParameter Name="index">100</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/enforced_audible/volume_profiles/extmedia_device_category/curve_points/3/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-10.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/headset_device_category/curve_points/0/index">
+ <IntegerParameter Name="index">0</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/headset_device_category/curve_points/0/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-96.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/headset_device_category/curve_points/1/index">
+ <IntegerParameter Name="index">1</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/headset_device_category/curve_points/1/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-96.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/headset_device_category/curve_points/2/index">
+ <IntegerParameter Name="index">2</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/headset_device_category/curve_points/2/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-96.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/headset_device_category/curve_points/3/index">
+ <IntegerParameter Name="index">100</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/headset_device_category/curve_points/3/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-96.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/speaker_device_category/curve_points/0/index">
+ <IntegerParameter Name="index">0</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/speaker_device_category/curve_points/0/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-96.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/speaker_device_category/curve_points/1/index">
+ <IntegerParameter Name="index">33</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/speaker_device_category/curve_points/1/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-68.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/speaker_device_category/curve_points/2/index">
+ <IntegerParameter Name="index">66</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/speaker_device_category/curve_points/2/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-34.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/speaker_device_category/curve_points/3/index">
+ <IntegerParameter Name="index">100</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/speaker_device_category/curve_points/3/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">0.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/earpiece_device_category/curve_points/0/index">
+ <IntegerParameter Name="index">0</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/earpiece_device_category/curve_points/0/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-96.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/earpiece_device_category/curve_points/1/index">
+ <IntegerParameter Name="index">1</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/earpiece_device_category/curve_points/1/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-96.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/earpiece_device_category/curve_points/2/index">
+ <IntegerParameter Name="index">2</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/earpiece_device_category/curve_points/2/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-96.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/earpiece_device_category/curve_points/3/index">
+ <IntegerParameter Name="index">100</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/earpiece_device_category/curve_points/3/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-96.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/extmedia_device_category/curve_points/0/index">
+ <IntegerParameter Name="index">0</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/extmedia_device_category/curve_points/0/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-96.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/extmedia_device_category/curve_points/1/index">
+ <IntegerParameter Name="index">1</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/extmedia_device_category/curve_points/1/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-96.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/extmedia_device_category/curve_points/2/index">
+ <IntegerParameter Name="index">2</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/extmedia_device_category/curve_points/2/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-96.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/extmedia_device_category/curve_points/3/index">
+ <IntegerParameter Name="index">100</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/tts/volume_profiles/extmedia_device_category/curve_points/3/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-96.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/headset_device_category/curve_points/0/index">
+ <IntegerParameter Name="index">1</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/headset_device_category/curve_points/0/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-58.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/headset_device_category/curve_points/1/index">
+ <IntegerParameter Name="index">33</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/headset_device_category/curve_points/1/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-40.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/headset_device_category/curve_points/2/index">
+ <IntegerParameter Name="index">66</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/headset_device_category/curve_points/2/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-17.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/headset_device_category/curve_points/3/index">
+ <IntegerParameter Name="index">100</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/headset_device_category/curve_points/3/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">0.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/speaker_device_category/curve_points/0/index">
+ <IntegerParameter Name="index">1</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/speaker_device_category/curve_points/0/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-56.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/speaker_device_category/curve_points/1/index">
+ <IntegerParameter Name="index">33</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/speaker_device_category/curve_points/1/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-34.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/speaker_device_category/curve_points/2/index">
+ <IntegerParameter Name="index">66</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/speaker_device_category/curve_points/2/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-11.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/speaker_device_category/curve_points/3/index">
+ <IntegerParameter Name="index">100</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/speaker_device_category/curve_points/3/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">0.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/earpiece_device_category/curve_points/0/index">
+ <IntegerParameter Name="index">1</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/earpiece_device_category/curve_points/0/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-58.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/earpiece_device_category/curve_points/1/index">
+ <IntegerParameter Name="index">33</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/earpiece_device_category/curve_points/1/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-40.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/earpiece_device_category/curve_points/2/index">
+ <IntegerParameter Name="index">66</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/earpiece_device_category/curve_points/2/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-17.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/earpiece_device_category/curve_points/3/index">
+ <IntegerParameter Name="index">100</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/earpiece_device_category/curve_points/3/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">0.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/extmedia_device_category/curve_points/0/index">
+ <IntegerParameter Name="index">1</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/extmedia_device_category/curve_points/0/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-58.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/extmedia_device_category/curve_points/1/index">
+ <IntegerParameter Name="index">33</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/extmedia_device_category/curve_points/1/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-40.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/extmedia_device_category/curve_points/2/index">
+ <IntegerParameter Name="index">66</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/extmedia_device_category/curve_points/2/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-17.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/extmedia_device_category/curve_points/3/index">
+ <IntegerParameter Name="index">100</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/accessibility/volume_profiles/extmedia_device_category/curve_points/3/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">0.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/headset_device_category/curve_points/0/index">
+ <IntegerParameter Name="index">0</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/headset_device_category/curve_points/0/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">0.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/headset_device_category/curve_points/1/index">
+ <IntegerParameter Name="index">1</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/headset_device_category/curve_points/1/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">0.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/headset_device_category/curve_points/2/index">
+ <IntegerParameter Name="index">2</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/headset_device_category/curve_points/2/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">0.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/headset_device_category/curve_points/3/index">
+ <IntegerParameter Name="index">100</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/headset_device_category/curve_points/3/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">0.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/speaker_device_category/curve_points/0/index">
+ <IntegerParameter Name="index">0</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/speaker_device_category/curve_points/0/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">0.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/speaker_device_category/curve_points/1/index">
+ <IntegerParameter Name="index">1</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/speaker_device_category/curve_points/1/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">0.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/speaker_device_category/curve_points/2/index">
+ <IntegerParameter Name="index">2</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/speaker_device_category/curve_points/2/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">0.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/speaker_device_category/curve_points/3/index">
+ <IntegerParameter Name="index">100</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/speaker_device_category/curve_points/3/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">0.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/earpiece_device_category/curve_points/0/index">
+ <IntegerParameter Name="index">0</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/earpiece_device_category/curve_points/0/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">0.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/earpiece_device_category/curve_points/1/index">
+ <IntegerParameter Name="index">1</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/earpiece_device_category/curve_points/1/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">0.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/earpiece_device_category/curve_points/2/index">
+ <IntegerParameter Name="index">2</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/earpiece_device_category/curve_points/2/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">0.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/earpiece_device_category/curve_points/3/index">
+ <IntegerParameter Name="index">100</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/earpiece_device_category/curve_points/3/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">0.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/extmedia_device_category/curve_points/0/index">
+ <IntegerParameter Name="index">0</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/extmedia_device_category/curve_points/0/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">0.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/extmedia_device_category/curve_points/1/index">
+ <IntegerParameter Name="index">1</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/extmedia_device_category/curve_points/1/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">0.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/extmedia_device_category/curve_points/2/index">
+ <IntegerParameter Name="index">2</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/extmedia_device_category/curve_points/2/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">0.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/extmedia_device_category/curve_points/3/index">
+ <IntegerParameter Name="index">100</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/rerouting/volume_profiles/extmedia_device_category/curve_points/3/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">0.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/headset_device_category/curve_points/0/index">
+ <IntegerParameter Name="index">0</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/headset_device_category/curve_points/0/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">0.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/headset_device_category/curve_points/1/index">
+ <IntegerParameter Name="index">1</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/headset_device_category/curve_points/1/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">0.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/headset_device_category/curve_points/2/index">
+ <IntegerParameter Name="index">2</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/headset_device_category/curve_points/2/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">0.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/headset_device_category/curve_points/3/index">
+ <IntegerParameter Name="index">100</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/headset_device_category/curve_points/3/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">0.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/speaker_device_category/curve_points/0/index">
+ <IntegerParameter Name="index">0</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/speaker_device_category/curve_points/0/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">0.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/speaker_device_category/curve_points/1/index">
+ <IntegerParameter Name="index">1</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/speaker_device_category/curve_points/1/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">0.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/speaker_device_category/curve_points/2/index">
+ <IntegerParameter Name="index">2</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/speaker_device_category/curve_points/2/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">0.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/speaker_device_category/curve_points/3/index">
+ <IntegerParameter Name="index">100</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/speaker_device_category/curve_points/3/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">0.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/earpiece_device_category/curve_points/0/index">
+ <IntegerParameter Name="index">0</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/earpiece_device_category/curve_points/0/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">0.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/earpiece_device_category/curve_points/1/index">
+ <IntegerParameter Name="index">1</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/earpiece_device_category/curve_points/1/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">0.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/earpiece_device_category/curve_points/2/index">
+ <IntegerParameter Name="index">2</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/earpiece_device_category/curve_points/2/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">0.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/earpiece_device_category/curve_points/3/index">
+ <IntegerParameter Name="index">100</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/earpiece_device_category/curve_points/3/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">0.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/extmedia_device_category/curve_points/0/index">
+ <IntegerParameter Name="index">0</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/extmedia_device_category/curve_points/0/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">0.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/extmedia_device_category/curve_points/1/index">
+ <IntegerParameter Name="index">1</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/extmedia_device_category/curve_points/1/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">0.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/extmedia_device_category/curve_points/2/index">
+ <IntegerParameter Name="index">2</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/extmedia_device_category/curve_points/2/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">0.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/extmedia_device_category/curve_points/3/index">
+ <IntegerParameter Name="index">100</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/patch/volume_profiles/extmedia_device_category/curve_points/3/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">0.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ </Configuration>
+ </Settings>
+ </ConfigurableDomain>
+ <ConfigurableDomain Name="VolumeProfilesForStream.Dtmf" SequenceAware="false">
+ <Configurations>
+ <Configuration Name="InCall">
+ <CompoundRule Type="Any">
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="Is" Value="InCall"/>
+ <SelectionCriterionRule SelectionCriterion="TelephonyMode" MatchesWhen="Is" Value="InCommunication"/>
+ </CompoundRule>
+ </Configuration>
+ <Configuration Name="OutOfCall">
+ <CompoundRule Type="All"/>
+ </Configuration>
+ </Configurations>
+ <ConfigurableElements>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/headset_device_category/curve_points/0/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/headset_device_category/curve_points/0/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/headset_device_category/curve_points/1/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/headset_device_category/curve_points/1/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/headset_device_category/curve_points/2/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/headset_device_category/curve_points/2/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/headset_device_category/curve_points/3/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/headset_device_category/curve_points/3/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/speaker_device_category/curve_points/0/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/speaker_device_category/curve_points/0/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/speaker_device_category/curve_points/1/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/speaker_device_category/curve_points/1/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/speaker_device_category/curve_points/2/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/speaker_device_category/curve_points/2/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/speaker_device_category/curve_points/3/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/speaker_device_category/curve_points/3/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/earpiece_device_category/curve_points/0/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/earpiece_device_category/curve_points/0/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/earpiece_device_category/curve_points/1/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/earpiece_device_category/curve_points/1/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/earpiece_device_category/curve_points/2/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/earpiece_device_category/curve_points/2/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/earpiece_device_category/curve_points/3/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/earpiece_device_category/curve_points/3/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/extmedia_device_category/curve_points/0/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/extmedia_device_category/curve_points/0/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/extmedia_device_category/curve_points/1/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/extmedia_device_category/curve_points/1/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/extmedia_device_category/curve_points/2/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/extmedia_device_category/curve_points/2/db_attenuation"/>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/extmedia_device_category/curve_points/3/index"/>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/extmedia_device_category/curve_points/3/db_attenuation"/>
+ </ConfigurableElements>
+ <Settings>
+ <Configuration Name="InCall">
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/headset_device_category/curve_points/0/index">
+ <IntegerParameter Name="index">1</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/headset_device_category/curve_points/0/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-30.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/headset_device_category/curve_points/1/index">
+ <IntegerParameter Name="index">33</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/headset_device_category/curve_points/1/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-26.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/headset_device_category/curve_points/2/index">
+ <IntegerParameter Name="index">66</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/headset_device_category/curve_points/2/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-22.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/headset_device_category/curve_points/3/index">
+ <IntegerParameter Name="index">100</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/headset_device_category/curve_points/3/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-18.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/speaker_device_category/curve_points/0/index">
+ <IntegerParameter Name="index">1</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/speaker_device_category/curve_points/0/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-24.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/speaker_device_category/curve_points/1/index">
+ <IntegerParameter Name="index">33</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/speaker_device_category/curve_points/1/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-18.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/speaker_device_category/curve_points/2/index">
+ <IntegerParameter Name="index">66</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/speaker_device_category/curve_points/2/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-12.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/speaker_device_category/curve_points/3/index">
+ <IntegerParameter Name="index">100</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/speaker_device_category/curve_points/3/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-6.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/earpiece_device_category/curve_points/0/index">
+ <IntegerParameter Name="index">1</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/earpiece_device_category/curve_points/0/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-24.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/earpiece_device_category/curve_points/1/index">
+ <IntegerParameter Name="index">33</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/earpiece_device_category/curve_points/1/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-18.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/earpiece_device_category/curve_points/2/index">
+ <IntegerParameter Name="index">66</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/earpiece_device_category/curve_points/2/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-12.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/earpiece_device_category/curve_points/3/index">
+ <IntegerParameter Name="index">100</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/earpiece_device_category/curve_points/3/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-6.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/extmedia_device_category/curve_points/0/index">
+ <IntegerParameter Name="index">1</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/extmedia_device_category/curve_points/0/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-58.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/extmedia_device_category/curve_points/1/index">
+ <IntegerParameter Name="index">33</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/extmedia_device_category/curve_points/1/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-40.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/extmedia_device_category/curve_points/2/index">
+ <IntegerParameter Name="index">66</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/extmedia_device_category/curve_points/2/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-27.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/extmedia_device_category/curve_points/3/index">
+ <IntegerParameter Name="index">100</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/extmedia_device_category/curve_points/3/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-10.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ </Configuration>
+ <Configuration Name="OutOfCall">
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/headset_device_category/curve_points/0/index">
+ <IntegerParameter Name="index">0</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/headset_device_category/curve_points/0/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-24.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/headset_device_category/curve_points/1/index">
+ <IntegerParameter Name="index">33</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/headset_device_category/curve_points/1/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-18.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/headset_device_category/curve_points/2/index">
+ <IntegerParameter Name="index">66</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/headset_device_category/curve_points/2/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-12.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/headset_device_category/curve_points/3/index">
+ <IntegerParameter Name="index">100</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/headset_device_category/curve_points/3/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-6.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/speaker_device_category/curve_points/0/index">
+ <IntegerParameter Name="index">0</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/speaker_device_category/curve_points/0/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-24.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/speaker_device_category/curve_points/1/index">
+ <IntegerParameter Name="index">33</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/speaker_device_category/curve_points/1/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-16.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/speaker_device_category/curve_points/2/index">
+ <IntegerParameter Name="index">66</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/speaker_device_category/curve_points/2/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-8.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/speaker_device_category/curve_points/3/index">
+ <IntegerParameter Name="index">100</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/speaker_device_category/curve_points/3/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">0.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/earpiece_device_category/curve_points/0/index">
+ <IntegerParameter Name="index">0</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/earpiece_device_category/curve_points/0/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-24.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/earpiece_device_category/curve_points/1/index">
+ <IntegerParameter Name="index">33</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/earpiece_device_category/curve_points/1/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-18.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/earpiece_device_category/curve_points/2/index">
+ <IntegerParameter Name="index">66</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/earpiece_device_category/curve_points/2/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-12.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/earpiece_device_category/curve_points/3/index">
+ <IntegerParameter Name="index">100</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/earpiece_device_category/curve_points/3/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-6.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/extmedia_device_category/curve_points/0/index">
+ <IntegerParameter Name="index">1</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/extmedia_device_category/curve_points/0/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-58.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/extmedia_device_category/curve_points/1/index">
+ <IntegerParameter Name="index">33</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/extmedia_device_category/curve_points/1/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-40.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/extmedia_device_category/curve_points/2/index">
+ <IntegerParameter Name="index">66</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/extmedia_device_category/curve_points/2/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">-17.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/extmedia_device_category/curve_points/3/index">
+ <IntegerParameter Name="index">100</IntegerParameter>
+ </ConfigurableElement>
+ <ConfigurableElement Path="/Policy/policy/streams/dtmf/volume_profiles/extmedia_device_category/curve_points/3/db_attenuation">
+ <FixedPointParameter Name="db_attenuation">0.00000000</FixedPointParameter>
+ </ConfigurableElement>
+ </Configuration>
+ </Settings>
+ </ConfigurableDomain>
+</ConfigurableDomains>
diff --git a/services/audiopolicy/engineconfigurable/parameter-framework/example/Settings/device_for_input_source.pfw b/services/audiopolicy/engineconfigurable/parameter-framework/example/Settings/device_for_input_source.pfw
new file mode 100644
index 0000000..d4bc370
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/parameter-framework/example/Settings/device_for_input_source.pfw
@@ -0,0 +1,515 @@
+supDomain: DeviceForInputSource
+ domain: Calibration
+ conf: Calibration
+ #
+ # Note that ALL input devices must have the sign bit set to 1.
+ # As the devices is a mask, use the "in" bit as a direction indicator.
+ #
+ component: /Policy/policy/input_sources/default/applicable_input_device/mask
+ in = 1
+ communication = 0
+ ambient = 0
+ hdmi = 0
+ telephony_rx = 0
+ back_mic = 0
+ remote_submix = 0
+ anlg_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ fm_tuner = 0
+ tv_tuner = 0
+ line = 0
+ spdif = 0
+ loopback = 0
+ component: /Policy/policy/input_sources/mic/applicable_input_device/mask
+ in = 1
+ communication = 0
+ ambient = 0
+ hdmi = 0
+ telephony_rx = 0
+ back_mic = 0
+ remote_submix = 0
+ anlg_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ fm_tuner = 0
+ tv_tuner = 0
+ line = 0
+ spdif = 0
+ loopback = 0
+ component: /Policy/policy/input_sources/voice_downlink/applicable_input_device/mask
+ in = 1
+ communication = 0
+ ambient = 0
+ builtin_mic = 0
+ bluetooth_sco_headset = 0
+ wired_headset = 0
+ hdmi = 0
+ back_mic = 0
+ remote_submix = 0
+ anlg_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ fm_tuner = 0
+ tv_tuner = 0
+ line = 0
+ spdif = 0
+ bluetooth_a2dp = 0
+ loopback = 0
+ component: /Policy/policy/input_sources/voice_call/applicable_input_device/mask
+ in = 1
+ communication = 0
+ ambient = 0
+ builtin_mic = 0
+ bluetooth_sco_headset = 0
+ wired_headset = 0
+ hdmi = 0
+ back_mic = 0
+ remote_submix = 0
+ anlg_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ fm_tuner = 0
+ tv_tuner = 0
+ line = 0
+ spdif = 0
+ bluetooth_a2dp = 0
+ loopback = 0
+ component: /Policy/policy/input_sources/voice_uplink/applicable_input_device/mask
+ in = 1
+ communication = 0
+ ambient = 0
+ builtin_mic = 0
+ bluetooth_sco_headset = 0
+ wired_headset = 0
+ hdmi = 0
+ back_mic = 0
+ remote_submix = 0
+ anlg_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ fm_tuner = 0
+ tv_tuner = 0
+ line = 0
+ spdif = 0
+ bluetooth_a2dp = 0
+ loopback = 0
+ component: /Policy/policy/input_sources/camcorder/applicable_input_device/mask
+ in = 1
+ communication = 0
+ ambient = 0
+ bluetooth_sco_headset = 0
+ wired_headset = 0
+ hdmi = 0
+ telephony_rx = 0
+ remote_submix = 0
+ anlg_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ fm_tuner = 0
+ tv_tuner = 0
+ line = 0
+ spdif = 0
+ bluetooth_a2dp = 0
+ loopback = 0
+ component: /Policy/policy/input_sources/voice_recognition/applicable_input_device/mask
+ in = 1
+ communication = 0
+ ambient = 0
+ hdmi = 0
+ telephony_rx = 0
+ back_mic = 0
+ remote_submix = 0
+ anlg_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ fm_tuner = 0
+ tv_tuner = 0
+ line = 0
+ spdif = 0
+ bluetooth_a2dp = 0
+ loopback = 0
+ component: /Policy/policy/input_sources/voice_communication/applicable_input_device/mask
+ in = 1
+ communication = 0
+ ambient = 0
+ hdmi = 0
+ telephony_rx = 0
+ remote_submix = 0
+ anlg_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ fm_tuner = 0
+ tv_tuner = 0
+ line = 0
+ spdif = 0
+ bluetooth_a2dp = 0
+ loopback = 0
+ component: /Policy/policy/input_sources/remote_submix/applicable_input_device/mask
+ in = 1
+ communication = 0
+ ambient = 0
+ builtin_mic = 0
+ bluetooth_sco_headset = 0
+ wired_headset = 0
+ hdmi = 0
+ telephony_rx = 0
+ back_mic = 0
+ anlg_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ fm_tuner = 0
+ tv_tuner = 0
+ line = 0
+ spdif = 0
+ bluetooth_a2dp = 0
+ loopback = 0
+ component: /Policy/policy/input_sources/hotword/applicable_input_device/mask
+ in = 1
+ communication = 0
+ ambient = 0
+ hdmi = 0
+ telephony_rx = 0
+ back_mic = 0
+ remote_submix = 0
+ anlg_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ fm_tuner = 0
+ tv_tuner = 0
+ line = 0
+ spdif = 0
+ bluetooth_a2dp = 0
+ loopback = 0
+ component: /Policy/policy/input_sources/fm_tuner/applicable_input_device/mask
+ in = 1
+ communication = 0
+ ambient = 0
+ bluetooth_sco_headset = 0
+ hdmi = 0
+ telephony_rx = 0
+ builtin_mic = 0
+ wired_headset = 0
+ back_mic = 0
+ remote_submix = 0
+ anlg_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ fm_tuner = 0
+ tv_tuner = 0
+ line = 0
+ spdif = 0
+ bluetooth_a2dp = 0
+ loopback = 0
+
+ domain: DefaultAndMic
+ conf: A2dp
+ AvailableInputDevices Includes BluetoothA2dp
+
+ component: /Policy/policy/input_sources
+ component: default/applicable_input_device/mask/
+ bluetooth_a2dp = 1
+ wired_headset = 0
+ usb_device = 0
+ builtin_mic = 0
+ bluetooth_sco_headset = 0
+ component: mic/applicable_input_device/mask/
+ bluetooth_a2dp = 1
+ wired_headset = 0
+ usb_device = 0
+ builtin_mic = 0
+ bluetooth_sco_headset = 0
+
+ conf: Sco
+ AvailableInputDevices Includes BluetoothScoHeadset
+ ForceUseForRecord Is ForceBtSco
+
+ component: /Policy/policy/input_sources
+ component: default/applicable_input_device/mask/
+ bluetooth_a2dp = 0
+ wired_headset = 0
+ usb_device = 0
+ builtin_mic = 0
+ bluetooth_sco_headset = 1
+ component: mic/applicable_input_device/mask/
+ bluetooth_a2dp = 0
+ wired_headset = 1
+ usb_device = 0
+ builtin_mic = 0
+ bluetooth_sco_headset = 1
+
+ conf: WiredHeadset
+ AvailableInputDevices Includes WiredHeadset
+
+ component: /Policy/policy/input_sources
+ component: default/applicable_input_device/mask/
+ bluetooth_a2dp = 0
+ wired_headset = 1
+ usb_device = 0
+ builtin_mic = 0
+ bluetooth_sco_headset = 0
+ component: mic/applicable_input_device/mask/
+ bluetooth_a2dp = 0
+ wired_headset = 1
+ usb_device = 0
+ builtin_mic = 0
+ bluetooth_sco_headset = 0
+
+ conf: UsbDevice
+ AvailableInputDevices Includes UsbDevice
+
+ component: /Policy/policy/input_sources
+ component: default/applicable_input_device/mask/
+ bluetooth_a2dp = 0
+ wired_headset = 0
+ usb_device = 1
+ builtin_mic = 0
+ bluetooth_sco_headset = 0
+ component: mic/applicable_input_device/mask/
+ bluetooth_a2dp = 0
+ wired_headset = 0
+ usb_device = 1
+ builtin_mic = 0
+ bluetooth_sco_headset = 0
+
+ conf: BuiltinMic
+ AvailableInputDevices Includes BuiltinMic
+
+ component: /Policy/policy/input_sources
+ component: default/applicable_input_device/mask/
+ bluetooth_a2dp = 0
+ wired_headset = 0
+ usb_device = 0
+ builtin_mic = 1
+ bluetooth_sco_headset = 0
+ component: mic/applicable_input_device/mask/
+ bluetooth_a2dp = 0
+ wired_headset = 0
+ usb_device = 0
+ builtin_mic = 1
+ bluetooth_sco_headset = 0
+
+ conf: Default
+ component: /Policy/policy/input_sources
+ component: default/applicable_input_device/mask/
+ bluetooth_a2dp = 0
+ wired_headset = 0
+ usb_device = 0
+ builtin_mic = 0
+ bluetooth_sco_headset = 0
+ component: mic/applicable_input_device/mask/
+ bluetooth_a2dp = 0
+ wired_headset = 0
+ usb_device = 0
+ builtin_mic = 0
+ bluetooth_sco_headset = 0
+
+ domain: VoiceUplinkAndVoiceDownlinkAndVoiceCall
+ conf: VoiceCall
+ AvailableInputDevices Includes TelephonyRx
+
+ component: /Policy/policy/input_sources
+ voice_downlink/applicable_input_device/mask/telephony_rx = 1
+ voice_call/applicable_input_device/mask/telephony_rx = 1
+ voice_uplink/applicable_input_device/mask/telephony_rx = 1
+
+ conf: Default
+ component: /Policy/policy/input_sources
+ voice_downlink/applicable_input_device/mask/telephony_rx = 0
+ voice_call/applicable_input_device/mask/telephony_rx = 0
+ voice_uplink/applicable_input_device/mask/telephony_rx = 0
+
+ domain: Camcorder
+ conf: BackMic
+ AvailableInputDevices Includes BackMic
+
+ component: /Policy/policy/input_sources/camcorder/applicable_input_device/mask
+ back_mic = 1
+ builtin_mic = 0
+
+ conf: BuiltinMic
+ AvailableInputDevices Includes BuiltinMic
+
+ component: /Policy/policy/input_sources/camcorder/applicable_input_device/mask
+ back_mic = 0
+ builtin_mic = 1
+
+ conf: Default
+ component: /Policy/policy/input_sources/camcorder/applicable_input_device/mask
+ back_mic = 0
+ builtin_mic = 0
+
+ domain: VoiceRecognitionAndHotword
+ conf: ScoHeadset
+ ForceUseForRecord Is ForceBtSco
+ AvailableInputDevices Includes BluetoothScoHeadset
+
+ component: /Policy/policy/input_sources
+ component: voice_recognition/applicable_input_device/mask
+ bluetooth_sco_headset = 1
+ wired_headset = 0
+ usb_device = 0
+ builtin_mic = 0
+ component: hotword/applicable_input_device/mask
+ bluetooth_sco_headset = 1
+ wired_headset = 0
+ usb_device = 0
+ builtin_mic = 0
+
+ conf: WiredHeadset
+ AvailableInputDevices Includes WiredHeadset
+
+ component: /Policy/policy/input_sources
+ component: voice_recognition/applicable_input_device/mask
+ bluetooth_sco_headset = 0
+ wired_headset = 1
+ usb_device = 0
+ builtin_mic = 0
+ component: hotword/applicable_input_device/mask
+ bluetooth_sco_headset = 0
+ wired_headset = 1
+ usb_device = 0
+ builtin_mic = 0
+
+ conf: UsbDevice
+ AvailableInputDevices Includes UsbDevice
+
+ component: /Policy/policy/input_sources
+ component: voice_recognition/applicable_input_device/mask
+ bluetooth_sco_headset = 0
+ wired_headset = 0
+ usb_device = 1
+ builtin_mic = 0
+ component: hotword/applicable_input_device/mask
+ bluetooth_sco_headset = 0
+ wired_headset = 0
+ usb_device = 1
+ builtin_mic = 0
+
+ conf: BuiltinMic
+ AvailableInputDevices Includes BuiltinMic
+
+ component: /Policy/policy/input_sources
+ component: voice_recognition/applicable_input_device/mask
+ bluetooth_sco_headset = 0
+ wired_headset = 0
+ usb_device = 0
+ builtin_mic = 1
+ component: hotword/applicable_input_device/mask
+ bluetooth_sco_headset = 0
+ wired_headset = 0
+ usb_device = 0
+ builtin_mic = 1
+
+ conf: Default
+ component: /Policy/policy/input_sources
+ component: voice_recognition/applicable_input_device/mask
+ bluetooth_sco_headset = 0
+ wired_headset = 0
+ usb_device = 0
+ builtin_mic = 0
+ component: hotword/applicable_input_device/mask
+ bluetooth_sco_headset = 0
+ wired_headset = 0
+ usb_device = 0
+ builtin_mic = 0
+
+ domain: VoiceCommunication
+ conf: ScoHeadset
+ #
+ # SCO device may be requested but no SCO device is available
+ #
+ ForceUseForCommunication Is ForceBtSco
+ AvailableInputDevices Includes BluetoothScoHeadset
+
+ component: /Policy/policy/input_sources/voice_communication/applicable_input_device/mask
+ bluetooth_sco_headset = 1
+ wired_headset = 0
+ usb_device = 0
+ builtin_mic = 0
+ back_mic = 0
+
+ conf: WiredHeadset
+ ForceUseForCommunication Is ForceNone
+ AvailableInputDevices Includes WiredHeadset
+
+ component: /Policy/policy/input_sources/voice_communication/applicable_input_device/mask
+ bluetooth_sco_headset = 0
+ wired_headset = 1
+ usb_device = 0
+ builtin_mic = 0
+ back_mic = 0
+
+ conf: UsbDevice
+ ForceUseForCommunication Is ForceNone
+ AvailableInputDevices Includes UsbDevice
+
+ component: /Policy/policy/input_sources/voice_communication/applicable_input_device/mask
+ bluetooth_sco_headset = 0
+ wired_headset = 0
+ usb_device = 1
+ builtin_mic = 0
+ back_mic = 0
+
+ conf: BuiltinMic
+ AvailableInputDevices Includes BuiltinMic
+ ANY
+ ForceUseForCommunication Is ForceNone
+ ALL
+ ForceUseForCommunication Is ForceSpeaker
+ AvailableInputDevices Excludes BackMic
+
+ component: /Policy/policy/input_sources/voice_communication/applicable_input_device/mask
+ bluetooth_sco_headset = 0
+ wired_headset = 0
+ usb_device = 0
+ builtin_mic = 1
+ back_mic = 0
+
+ conf: BackMic
+ ForceUseForCommunication Is ForceSpeaker
+ AvailableInputDevices Includes BackMic
+
+ component: /Policy/policy/input_sources/voice_communication/applicable_input_device/mask
+ bluetooth_sco_headset = 0
+ wired_headset = 0
+ usb_device = 0
+ builtin_mic = 0
+ back_mic = 1
+
+ conf: Default
+ component: /Policy/policy/input_sources/voice_communication/applicable_input_device/mask
+ bluetooth_sco_headset = 0
+ wired_headset = 0
+ usb_device = 0
+ builtin_mic = 0
+ back_mic = 0
+
+ domain: RemoteSubmix
+ conf: RemoteSubmix
+ AvailableInputDevices Includes RemoteSubmix
+
+ component: /Policy/policy/input_sources/remote_submix/applicable_input_device/mask
+ remote_submix = 1
+
+ conf: Default
+ component: /Policy/policy/input_sources/remote_submix/applicable_input_device/mask
+ remote_submix = 0
+
+ domain: FmTuner
+ conf: FmTuner
+ AvailableInputDevices Includes FmTuner
+
+ component: /Policy/policy/input_sources/fm_tuner/applicable_input_device/mask
+ fm_tuner = 1
+
+ conf: Default
+ component: /Policy/policy/input_sources/fm_tuner/applicable_input_device/mask
+ fm_tuner = 0
+
diff --git a/services/audiopolicy/engineconfigurable/parameter-framework/example/Settings/device_for_strategy_accessibility.pfw b/services/audiopolicy/engineconfigurable/parameter-framework/example/Settings/device_for_strategy_accessibility.pfw
new file mode 100644
index 0000000..e8ab33b
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/parameter-framework/example/Settings/device_for_strategy_accessibility.pfw
@@ -0,0 +1,302 @@
+supDomain: DeviceForStrategy
+
+ supDomain: Accessibility
+ #
+ # @FIXME: STRATEGY_ACCESSIBILITY follows STRATEGY_MEDIA for now
+ #
+ # @FIXME: How to disable HDMI if !audio_is_linear_pcm other than programmatically???
+ #
+ domain: UnreachableDevices
+ conf: Calibration
+ component: /Policy/policy/strategies/accessibility/selected_output_devices/mask
+ hdmi_arc = 0
+ spdif = 0
+ aux_line = 0
+ fm = 0
+ speaker_safe = 0
+ earpiece = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ telephony_tx = 0
+
+ domain: Device2
+ conf: RemoteSubmix
+ AvailableOutputDevices Includes RemoteSubmix
+
+ component: /Policy/policy/strategies/accessibility/selected_output_devices/mask
+ remote_submix = 1
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ speaker = 0
+ wired_headset = 0
+ wired_headphone = 0
+ line = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ hdmi = 0
+
+ conf: BluetoothA2dp
+ ForceUseForMedia IsNot ForceNoBtA2dp
+ AvailableOutputDevices Includes BluetoothA2dp
+
+ component: /Policy/policy/strategies/accessibility/selected_output_devices/mask
+ remote_submix = 0
+ bluetooth_a2dp = 1
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ speaker = 0
+ wired_headset = 0
+ wired_headphone = 0
+ line = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ hdmi = 0
+
+ conf: BluetoothA2dpHeadphone
+ ForceUseForMedia IsNot ForceNoBtA2dp
+ AvailableOutputDevices Includes BluetoothA2dpHeadphones
+
+ component: /Policy/policy/strategies/accessibility/selected_output_devices/mask
+ remote_submix = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 1
+ bluetooth_a2dp_speaker = 0
+ speaker = 0
+ wired_headset = 0
+ wired_headphone = 0
+ line = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ hdmi = 0
+
+ conf: BluetoothA2dpSpeaker
+ ForceUseForMedia IsNot ForceNoBtA2dp
+ AvailableOutputDevices Includes BluetoothA2dpSpeaker
+
+ component: /Policy/policy/strategies/accessibility/selected_output_devices/mask
+ remote_submix = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 1
+ speaker = 0
+ wired_headset = 0
+ wired_headphone = 0
+ line = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ hdmi = 0
+
+ conf: ForceSpeaker
+ ForceUseForMedia Is ForceSpeaker
+ AvailableOutputDevices Includes Speaker
+
+ component: /Policy/policy/strategies/accessibility/selected_output_devices/mask
+ remote_submix = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ speaker = 1
+ wired_headset = 0
+ wired_headphone = 0
+ line = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ hdmi = 0
+
+ conf: WiredHeadphone
+ AvailableOutputDevices Includes WiredHeadphone
+
+ component: /Policy/policy/strategies/accessibility/selected_output_devices/mask
+ remote_submix = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ speaker = 0
+ wired_headset = 0
+ wired_headphone = 1
+ line = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ hdmi = 0
+
+ conf: Line
+ AvailableOutputDevices Includes Line
+
+ component: /Policy/policy/strategies/accessibility/selected_output_devices/mask
+ remote_submix = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ speaker = 0
+ wired_headset = 0
+ wired_headphone = 0
+ line = 1
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ hdmi = 0
+
+ conf: WiredHeadset
+ AvailableOutputDevices Includes WiredHeadset
+
+ component: /Policy/policy/strategies/accessibility/selected_output_devices/mask
+ remote_submix = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ speaker = 0
+ wired_headset = 1
+ wired_headphone = 0
+ line = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ hdmi = 0
+
+ conf: UsbAccessory
+ AvailableOutputDevices Includes UsbAccessory
+
+ component: /Policy/policy/strategies/accessibility/selected_output_devices/mask
+ remote_submix = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ speaker = 0
+ wired_headset = 0
+ wired_headphone = 0
+ line = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 1
+ usb_device = 0
+ hdmi = 0
+
+ conf: UsbDevice
+ AvailableOutputDevices Includes UsbDevice
+
+ component: /Policy/policy/strategies/accessibility/selected_output_devices/mask
+ remote_submix = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ speaker = 0
+ wired_headset = 0
+ wired_headphone = 0
+ line = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 1
+ hdmi = 0
+
+ conf: DgtlDockHeadset
+ AvailableOutputDevices Includes DgtlDockHeadset
+
+ component: /Policy/policy/strategies/accessibility/selected_output_devices/mask
+ remote_submix = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ speaker = 0
+ wired_headset = 0
+ wired_headphone = 0
+ line = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 1
+ usb_accessory = 0
+ usb_device = 0
+ hdmi = 0
+
+ conf: AuxDigital
+ #
+ # Do not route accessibility prompts to a digital output currently configured with a
+ # compressed format as they would likely not be mixed and dropped.
+ #
+ # @TODO How to translate the following condition(???)
+ # desc->isActive() && !audio_is_linear_pcm(desc->mFormat) && devices != AUDIO_DEVICE_NONE
+ #
+ AvailableOutputDevices Includes Hdmi
+
+ component: /Policy/policy/strategies/accessibility/selected_output_devices/mask
+ remote_submix = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ speaker = 0
+ wired_headset = 0
+ wired_headphone = 0
+ line = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ hdmi = 1
+
+ conf: AnlgDockHeadset
+ AvailableOutputDevices Includes AnlgDockHeadset
+ ForceUseForDock Is ForceAnalogDock
+
+ component: /Policy/policy/strategies/accessibility/selected_output_devices/mask
+ remote_submix = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ speaker = 0
+ wired_headset = 0
+ wired_headphone = 0
+ line = 0
+ angl_dock_headset = 1
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ hdmi = 0
+
+ conf: Speaker
+ AvailableOutputDevices Includes Speaker
+
+ component: /Policy/policy/strategies/accessibility/selected_output_devices/mask
+ remote_submix = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ speaker = 1
+ wired_headset = 0
+ wired_headphone = 0
+ line = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ hdmi = 0
+
+ conf: Default
+ component: /Policy/policy/strategies/accessibility/selected_output_devices/mask
+ remote_submix = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ speaker = 0
+ wired_headset = 0
+ wired_headphone = 0
+ line = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ hdmi = 0
diff --git a/services/audiopolicy/engineconfigurable/parameter-framework/example/Settings/device_for_strategy_dtmf.pfw b/services/audiopolicy/engineconfigurable/parameter-framework/example/Settings/device_for_strategy_dtmf.pfw
new file mode 100644
index 0000000..85273b2
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/parameter-framework/example/Settings/device_for_strategy_dtmf.pfw
@@ -0,0 +1,637 @@
+supDomain: DeviceForStrategy
+
+ supDomain: Dtmf
+
+ domain: UnreachableDevices
+ conf: Calibration
+ component: /Policy/policy/strategies/dtmf/selected_output_devices/mask
+ fm = 0
+ speaker_safe = 0
+ bluetooth_sco_carkit = 0
+
+ domain: Device2
+ conf: RemoteSubmix
+ #
+ # DTMF follows Media strategy if not in call
+ #
+ TelephonyMode IsNot InCall
+ TelephonyMode IsNot InCommunication
+ AvailableOutputDevices Includes RemoteSubmix
+
+ component: /Policy/policy/strategies/dtmf/selected_output_devices/mask
+ remote_submix = 1
+ earpiece = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ hdmi = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ telephony_tx = 0
+ line = 0
+ speaker = 0
+
+ conf: BluetoothA2dp
+ #
+ # DTMF follows Media strategy if not in call
+ #
+ TelephonyMode IsNot InCall
+ TelephonyMode IsNot InCommunication
+ ForceUseForMedia IsNot ForceNoBtA2dp
+ AvailableOutputDevices Includes BluetoothA2dp
+
+ component: /Policy/policy/strategies/dtmf/selected_output_devices/mask
+ remote_submix = 0
+ earpiece = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_a2dp = 1
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ hdmi = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ telephony_tx = 0
+ line = 0
+ speaker = 0
+
+ conf: BluetoothA2dpHeadphones
+ #
+ # DTMF follows Media strategy if not in call
+ #
+ TelephonyMode IsNot InCall
+ TelephonyMode IsNot InCommunication
+ ForceUseForMedia IsNot ForceNoBtA2dp
+ AvailableOutputDevices Includes BluetoothA2dpHeadphones
+
+ component: /Policy/policy/strategies/dtmf/selected_output_devices/mask
+ remote_submix = 0
+ earpiece = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 1
+ bluetooth_a2dp_speaker = 0
+ hdmi = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ telephony_tx = 0
+ line = 0
+ speaker = 0
+
+ conf: BluetoothA2dpSpeaker
+ #
+ # DTMF follows Media strategy if not in call
+ #
+ TelephonyMode IsNot InCall
+ TelephonyMode IsNot InCommunication
+ ForceUseForMedia IsNot ForceNoBtA2dp
+ AvailableOutputDevices Includes BluetoothA2dpSpeaker
+
+ component: /Policy/policy/strategies/dtmf/selected_output_devices/mask
+ remote_submix = 0
+ earpiece = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 1
+ hdmi = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ telephony_tx = 0
+ line = 0
+ speaker = 0
+
+ conf: ForceSpeakerWhenNotInCall
+ #
+ # DTMF follows Media strategy if not in call
+ #
+ TelephonyMode IsNot InCall
+ TelephonyMode IsNot InCommunication
+ ForceUseForMedia Is ForceSpeaker
+ ForceUseForHdmiSystemAudio IsNot ForceHdmiSystemEnforced
+ AvailableOutputDevices Includes Speaker
+
+ component: /Policy/policy/strategies/dtmf/selected_output_devices/mask
+ remote_submix = 0
+ earpiece = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ hdmi = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ telephony_tx = 0
+ line = 0
+ speaker = 1
+
+ conf: BluetoothScoHeadset
+ #
+ # DTMF falls through Phone strategy if in call
+ #
+ ANY
+ TelephonyMode Is InCall
+ TelephonyMode Is InCommunication
+ AvailableOutputDevices Includes BluetoothScoHeadset
+ ForceUseForCommunication Is ForceBtSco
+
+ component: /Policy/policy/strategies/dtmf/selected_output_devices/mask
+ remote_submix = 0
+ earpiece = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 1
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ hdmi = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ telephony_tx = 0
+ line = 0
+ speaker = 0
+
+ conf: BluetoothSco
+ #
+ # DTMF falls through Phone strategy if in call
+ #
+ ANY
+ TelephonyMode Is InCall
+ TelephonyMode Is InCommunication
+ AvailableOutputDevices Includes BluetoothSco
+ ForceUseForCommunication Is ForceBtSco
+
+ component: /Policy/policy/strategies/dtmf/selected_output_devices/mask
+ remote_submix = 0
+ earpiece = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_sco = 1
+ bluetooth_sco_headset = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ hdmi = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ telephony_tx = 0
+ line = 0
+ speaker = 0
+
+ conf: WiredHeadphone
+ ANY
+ #
+ # DTMF falls through Phone strategy if in call
+ #
+ ALL
+ ANY
+ TelephonyMode Is InCall
+ TelephonyMode Is InCommunication
+ ForceUseForCommunication IsNot ForceSpeaker
+ #
+ # DTMF follows Media strategy if not in call
+ #
+ ALL
+ TelephonyMode IsNot InCall
+ TelephonyMode IsNot InCommunication
+ AvailableOutputDevices Includes WiredHeadphone
+
+ component: /Policy/policy/strategies/dtmf/selected_output_devices/mask
+ remote_submix = 0
+ earpiece = 0
+ wired_headset = 0
+ wired_headphone = 1
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ hdmi = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ telephony_tx = 0
+ line = 0
+ speaker = 0
+
+ conf: LineWhenFollowingMedia
+ #
+ # DTMF follows Media strategy if not in call
+ #
+ TelephonyMode IsNot InCall
+ TelephonyMode IsNot InCommunication
+ AvailableOutputDevices Includes Line
+
+ component: /Policy/policy/strategies/dtmf/selected_output_devices/mask
+ remote_submix = 0
+ earpiece = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ hdmi = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ telephony_tx = 0
+ line = 1
+ speaker = 0
+
+ conf: WiredHeadset
+ ANY
+ #
+ # DTMF falls through Phone strategy if in call
+ #
+ ALL
+ ANY
+ TelephonyMode Is InCall
+ TelephonyMode Is InCommunication
+ ForceUseForCommunication IsNot ForceSpeaker
+ #
+ # DTMF follows Media strategy if not in call
+ #
+ ALL
+ TelephonyMode IsNot InCall
+ TelephonyMode IsNot InCommunication
+ AvailableOutputDevices Includes WiredHeadset
+
+ component: /Policy/policy/strategies/dtmf/selected_output_devices/mask
+ remote_submix = 0
+ earpiece = 0
+ wired_headset = 1
+ wired_headphone = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ hdmi = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ telephony_tx = 0
+ line = 0
+ speaker = 0
+
+ conf: UsbDevice
+ ANY
+ #
+ # DTMF falls through Phone strategy if in call (widely speaking)
+ #
+ ALL
+ ANY
+ TelephonyMode Is InCall
+ TelephonyMode Is InCommunication
+ ForceUseForCommunication IsNot ForceSpeaker
+ #
+ # DTMF follows Media strategy if not in call
+ # Media strategy inverts the priority of USB device vs accessory
+ #
+ ALL
+ TelephonyMode IsNot InCall
+ TelephonyMode IsNot InCommunication
+ AvailableOutputDevices Excludes UsbAccessory
+ ForceUseForCommunication Is ForceSpeaker
+ AvailableOutputDevices Includes UsbDevice
+
+ component: /Policy/policy/strategies/dtmf/selected_output_devices/mask
+ remote_submix = 0
+ earpiece = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ hdmi = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 1
+ telephony_tx = 0
+ line = 0
+ speaker = 0
+
+ conf: UsbAccessory
+ #
+ # DTMF falls through Phone strategy if in call (widely speaking)
+ # but USB accessory not reachable in call
+ #
+ # DTMF follows Media strategy if not in call
+ # Media strategy inverts the priority of USB device vs accessory
+ #
+ TelephonyMode IsNot InCall
+ TelephonyMode IsNot InCommunication
+ AvailableOutputDevices Includes UsbAccessory
+
+ component: /Policy/policy/strategies/dtmf/selected_output_devices/mask
+ remote_submix = 0
+ earpiece = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ hdmi = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 1
+ usb_device = 0
+ telephony_tx = 0
+ line = 0
+ speaker = 0
+
+ conf: DgtlDockHeadset
+ #
+ # DTMF falls through Phone strategy if in call (widely speaking)
+ # but DgtlDockHeadset not reachable in call
+ #
+ # DTMF follows Media strategy if not in call
+ #
+ TelephonyMode IsNot InCall
+ TelephonyMode IsNot InCommunication
+ AvailableOutputDevices Includes DgtlDockHeadset
+
+ component: /Policy/policy/strategies/dtmf/selected_output_devices/mask
+ remote_submix = 0
+ earpiece = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ hdmi = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 1
+ usb_accessory = 0
+ usb_device = 0
+ telephony_tx = 0
+ line = 0
+ speaker = 0
+
+ conf: Hdmi
+ #
+ # DTMF falls through Phone strategy if in call (widely speaking)
+ # but Hdmi not reachable in call
+ #
+ # DTMF follows Media strategy if not in call
+ #
+ TelephonyMode IsNot InCall
+ TelephonyMode IsNot InCommunication
+ AvailableOutputDevices Includes Hdmi
+
+ component: /Policy/policy/strategies/dtmf/selected_output_devices/mask
+ remote_submix = 0
+ earpiece = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ hdmi = 1
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ telephony_tx = 0
+ line = 0
+ speaker = 0
+
+ conf: AnlgDockHeadset
+ #
+ # DTMF falls through Phone strategy if in call (widely speaking)
+ # but AnlgDockHeadset not reachable in call
+ #
+ # DTMF follows Media strategy if not in call
+ # Media strategy inverts the priority of USB device vs accessory
+ #
+ TelephonyMode IsNot InCall
+ TelephonyMode IsNot InCommunication
+ ForceUseForDock Is ForceAnalogDock
+ AvailableOutputDevices Includes AnlgDockHeadset
+
+ component: /Policy/policy/strategies/dtmf/selected_output_devices/mask
+ remote_submix = 0
+ earpiece = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ hdmi = 0
+ angl_dock_headset = 1
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ telephony_tx = 0
+ line = 0
+ speaker = 0
+
+ conf: Earpiece
+ #
+ # DTMF falls through Phone strategy if in call
+ #
+ ANY
+ TelephonyMode Is InCall
+ TelephonyMode Is InCommunication
+ AvailableOutputDevices Includes Earpiece
+ ForceUseForCommunication IsNot ForceSpeaker
+
+ component: /Policy/policy/strategies/dtmf/selected_output_devices/mask
+ remote_submix = 0
+ earpiece = 1
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ hdmi = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ telephony_tx = 0
+ line = 0
+ speaker = 0
+
+ conf: LineWhenFallThroughPhone
+ #
+ # DTMF falls through Phone strategy if in call
+ #
+ ANY
+ TelephonyMode Is InCall
+ TelephonyMode Is InCommunication
+ AvailableOutputDevices Includes Line
+ ForceUseForCommunication Is ForceSpeaker
+
+ component: /Policy/policy/strategies/dtmf/selected_output_devices/mask
+ remote_submix = 0
+ earpiece = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ hdmi = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ telephony_tx = 0
+ line = 1
+ speaker = 0
+
+ conf: Speaker
+ ANY
+ #
+ # DTMF falls through Phone strategy if in call
+ #
+ ALL
+ ANY
+ TelephonyMode Is InCall
+ TelephonyMode Is InCommunication
+ ForceUseForCommunication Is ForceSpeaker
+ #
+ # DTMF follows Media strategy if not in call
+ #
+ ALL
+ TelephonyMode IsNot InCall
+ TelephonyMode IsNot InCommunication
+ ForceUseForHdmiSystemAudio IsNot ForceHdmiSystemEnforced
+ AvailableOutputDevices Includes Speaker
+
+ component: /Policy/policy/strategies/dtmf/selected_output_devices/mask
+ remote_submix = 0
+ earpiece = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ hdmi = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ telephony_tx = 0
+ line = 0
+ speaker = 1
+
+ conf: Default
+ component: /Policy/policy/strategies/dtmf/selected_output_devices/mask
+ remote_submix = 0
+ earpiece = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ hdmi = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ telephony_tx = 0
+ line = 0
+ speaker = 0
+
+ domain: Arc
+ #
+ # DTMF strategy follows media strategy if not in call
+ # these following domains consists in device(s) that can co-exist with others
+ # e.g. ARC, SPDIF, AUX_LINE
+ #
+ conf: Selected
+ TelephonyMode IsNot InCall
+ TelephonyMode IsNot InCommunication
+ AvailableOutputDevices Includes HdmiArc
+
+ /Policy/policy/strategies/media/selected_output_devices/mask/hdmi_arc = 1
+
+ conf: NotSelected
+ /Policy/policy/strategies/media/selected_output_devices/mask/hdmi_arc = 0
+
+ domain: Spdif
+ #
+ # DTMF strategy follows media strategy if not in call
+ # these following domains consists in device(s) that can co-exist with others
+ # e.g. ARC, SPDIF, AUX_LINE
+ #
+ conf: Selected
+ TelephonyMode IsNot InCall
+ TelephonyMode IsNot InCommunication
+ AvailableOutputDevices Includes Spdif
+
+ /Policy/policy/strategies/media/selected_output_devices/mask/spdif = 1
+
+ conf: NotSelected
+ /Policy/policy/strategies/media/selected_output_devices/mask/spdif = 0
+
+ domain: AuxLine
+ #
+ # DTMF strategy follows media strategy if not in call
+ # these following domains consists in device(s) that can co-exist with others
+ # e.g. ARC, SPDIF, AUX_LINE
+ #
+ conf: Selected
+ TelephonyMode IsNot InCall
+ TelephonyMode IsNot InCommunication
+ AvailableOutputDevices Includes AuxLine
+
+ /Policy/policy/strategies/media/selected_output_devices/mask/aux_line = 1
+
+ conf: NotSelected
+ /Policy/policy/strategies/media/selected_output_devices/mask/aux_line = 0
diff --git a/services/audiopolicy/engineconfigurable/parameter-framework/example/Settings/device_for_strategy_enforced_audible.pfw b/services/audiopolicy/engineconfigurable/parameter-framework/example/Settings/device_for_strategy_enforced_audible.pfw
new file mode 100644
index 0000000..d714743
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/parameter-framework/example/Settings/device_for_strategy_enforced_audible.pfw
@@ -0,0 +1,358 @@
+supDomain: DeviceForStrategy
+
+ supDomain: EnforcedAudible
+
+ domain: UnreachableDevices
+ conf: Calibration
+ component: /Policy/policy/strategies/enforced_audible/selected_output_devices/mask
+ # no enforced_audible on remote submix (e.g. WFD)
+ remote_submix = 0
+ hdmi_arc = 0
+ spdif = 0
+ aux_line = 0
+ speaker_safe = 0
+
+ domain: Speaker
+ conf: Selected
+ #
+ # strategy STRATEGY_ENFORCED_AUDIBLE uses same routing policy as STRATEGY_SONIFICATION
+ # except:
+ # - when in call where it doesn't default to STRATEGY_PHONE behavior
+ # - in countries where not enforced in which case it follows STRATEGY_MEDIA
+ #
+ AvailableOutputDevices Includes Speaker
+ ANY
+ ForceUseForSystem Is ForceSystemEnforced
+ ALL
+ ForceUseForMedia Is ForceSpeaker
+ AvailableOutputDevices Excludes RemoteSubmix
+ ANY
+ ForceUseForMedia IsNot ForceNoBtA2dp
+ AvailableOutputDevices Excludes BluetoothA2dp
+ AvailableOutputDevices Excludes BluetoothA2dpHeadphones
+ AvailableOutputDevices Excludes BluetoothA2dpSpeaker
+ #
+ # Speaker is also the fallback device if any of the device from Device2 domain
+ # is selected.
+ #
+ ALL
+ AvailableOutputDevices Excludes RemoteSubmix
+ AvailableOutputDevices Excludes WiredHeadphone
+ AvailableOutputDevices Excludes Line
+ AvailableOutputDevices Excludes WiredHeadset
+ AvailableOutputDevices Excludes UsbAccessory
+ AvailableOutputDevices Excludes UsbDevice
+ AvailableOutputDevices Excludes DgtlDockHeadset
+ AvailableOutputDevices Excludes Hdmi
+ ANY
+ AvailableOutputDevices Excludes AnlgDockHeadset
+ ForceUseForDock IsNot ForceAnalogDock
+
+ component: /Policy/policy/strategies/enforced_audible/selected_output_devices/mask
+ speaker = 1
+
+ conf: NotSelected
+ component: /Policy/policy/strategies/enforced_audible/selected_output_devices/mask
+ speaker = 0
+
+ domain: Device2
+ conf: RemoteSubmix
+ AvailableOutputDevices Includes RemoteSubmix
+
+ component: /Policy/policy/strategies/enforced_audible/selected_output_devices/mask
+ remote_submix = 1
+ earpiece = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ hdmi = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ telephony_tx = 0
+ line = 0
+ fm = 0
+ speaker_safe = 0
+
+ conf: BluetoothA2dp
+ AvailableOutputDevices Includes BluetoothA2dp
+ ForceUseForMedia IsNot ForceNoBtA2dp
+
+ component: /Policy/policy/strategies/enforced_audible/selected_output_devices/mask
+ remote_submix = 0
+ earpiece = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp = 1
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ hdmi = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ telephony_tx = 0
+ line = 0
+ fm = 0
+ speaker_safe = 0
+
+ conf: BluetoothA2dpHeadphones
+ AvailableOutputDevices Includes BluetoothA2dpHeadphones
+ ForceUseForMedia IsNot ForceNoBtA2dp
+
+ component: /Policy/policy/strategies/enforced_audible/selected_output_devices/mask
+ remote_submix = 0
+ earpiece = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 1
+ bluetooth_a2dp_speaker = 0
+ hdmi = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ telephony_tx = 0
+ line = 0
+ fm = 0
+ speaker_safe = 0
+
+ conf: BluetoothA2dpSpeaker
+ AvailableOutputDevices Includes BluetoothA2dpSpeaker
+ ForceUseForMedia IsNot ForceNoBtA2dp
+
+ component: /Policy/policy/strategies/enforced_audible/selected_output_devices/mask
+ remote_submix = 0
+ earpiece = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 1
+ hdmi = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ telephony_tx = 0
+ line = 0
+ fm = 0
+ speaker_safe = 0
+
+ conf: WiredHeadphone
+ ForceUseForMedia IsNot ForceSpeaker
+ AvailableOutputDevices Includes WiredHeadphone
+
+ component: /Policy/policy/strategies/enforced_audible/selected_output_devices/mask
+ remote_submix = 0
+ earpiece = 0
+ wired_headset = 0
+ wired_headphone = 1
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ hdmi = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ telephony_tx = 0
+ line = 0
+ fm = 0
+ speaker_safe = 0
+
+ conf: Line
+ ForceUseForMedia IsNot ForceSpeaker
+ AvailableOutputDevices Includes Line
+
+ component: /Policy/policy/strategies/enforced_audible/selected_output_devices/mask
+ remote_submix = 0
+ earpiece = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ hdmi = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ telephony_tx = 0
+ line = 1
+ fm = 0
+ speaker_safe = 0
+
+ conf: WiredHeadset
+ ForceUseForMedia IsNot ForceSpeaker
+ AvailableOutputDevices Includes WiredHeadset
+
+ component: /Policy/policy/strategies/enforced_audible/selected_output_devices/mask
+ remote_submix = 0
+ earpiece = 0
+ wired_headset = 1
+ wired_headphone = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ hdmi = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ telephony_tx = 0
+ line = 0
+ fm = 0
+ speaker_safe = 0
+
+ conf: UsbAccessory
+ ForceUseForMedia IsNot ForceSpeaker
+ AvailableOutputDevices Includes UsbAccessory
+
+ component: /Policy/policy/strategies/enforced_audible/selected_output_devices/mask
+ remote_submix = 0
+ earpiece = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ hdmi = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 1
+ usb_device = 0
+ telephony_tx = 0
+ line = 0
+ fm = 0
+ speaker_safe = 0
+
+ conf: UsbDevice
+ ForceUseForMedia IsNot ForceSpeaker
+ AvailableOutputDevices Includes UsbDevice
+
+ component: /Policy/policy/strategies/enforced_audible/selected_output_devices/mask
+ remote_submix = 0
+ earpiece = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ hdmi = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 1
+ telephony_tx = 0
+ line = 0
+ fm = 0
+ speaker_safe = 0
+
+ conf: DgtlDockHeadset
+ ForceUseForMedia IsNot ForceSpeaker
+ AvailableOutputDevices Includes DgtlDockHeadset
+
+ component: /Policy/policy/strategies/enforced_audible/selected_output_devices/mask
+ remote_submix = 0
+ earpiece = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ hdmi = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 1
+ usb_accessory = 0
+ usb_device = 0
+ telephony_tx = 0
+ line = 0
+ fm = 0
+ speaker_safe = 0
+
+ conf: Hdmi
+ ForceUseForMedia IsNot ForceSpeaker
+ AvailableOutputDevices Includes Hdmi
+
+ component: /Policy/policy/strategies/enforced_audible/selected_output_devices/mask
+ remote_submix = 0
+ earpiece = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ hdmi = 1
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ telephony_tx = 0
+ line = 0
+ fm = 0
+ speaker_safe = 0
+
+ conf: AnlgDockHeadset
+ ForceUseForMedia IsNot ForceSpeaker
+ ForceUseForDock Is ForceAnalogDock
+ AvailableOutputDevices Includes AnlgDockHeadset
+
+ component: /Policy/policy/strategies/enforced_audible/selected_output_devices/mask
+ remote_submix = 0
+ earpiece = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ hdmi = 0
+ angl_dock_headset = 1
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ telephony_tx = 0
+ line = 0
+ fm = 0
+ speaker_safe = 0
+
diff --git a/services/audiopolicy/engineconfigurable/parameter-framework/example/Settings/device_for_strategy_media.pfw b/services/audiopolicy/engineconfigurable/parameter-framework/example/Settings/device_for_strategy_media.pfw
new file mode 100644
index 0000000..38bede5
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/parameter-framework/example/Settings/device_for_strategy_media.pfw
@@ -0,0 +1,331 @@
+domainGroup: DeviceForStrategy
+
+ domainGroup: Media
+
+ domain: UnreachableDevices
+ conf: Calibration
+ component: /Policy/policy/strategies/media/selected_output_devices/mask
+ fm = 0
+ speaker_safe = 0
+ earpiece = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ telephony_tx = 0
+
+ domain: Device2
+ conf: RemoteSubmix
+ AvailableOutputDevices Includes RemoteSubmix
+
+ component: /Policy/policy/strategies/media/selected_output_devices/mask
+ speaker = 0
+ hdmi = 0
+ dgtl_dock_headset = 0
+ angl_dock_headset = 0
+ usb_device = 0
+ usb_accessory = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_a2dp_speaker = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp = 0
+ remote_submix = 1
+ line = 0
+
+ conf: BluetoothA2dp
+ ForceUseForMedia IsNot ForceNoBtA2dp
+ AvailableOutputDevices Includes BluetoothA2dp
+
+ component: /Policy/policy/strategies/media/selected_output_devices/mask
+ speaker = 0
+ hdmi = 0
+ dgtl_dock_headset = 0
+ angl_dock_headset = 0
+ usb_device = 0
+ usb_accessory = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_a2dp_speaker = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp = 1
+ remote_submix = 0
+ line = 0
+
+ conf: BluetoothA2dpHeadphone
+ ForceUseForMedia IsNot ForceNoBtA2dp
+ AvailableOutputDevices Includes BluetoothA2dpHeadphones
+
+ component: /Policy/policy/strategies/media/selected_output_devices/mask
+ speaker = 0
+ hdmi = 0
+ dgtl_dock_headset = 0
+ angl_dock_headset = 0
+ usb_device = 0
+ usb_accessory = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_a2dp_speaker = 0
+ bluetooth_a2dp_headphones = 1
+ bluetooth_a2dp = 0
+ remote_submix = 0
+ line = 0
+
+ conf: BluetoothA2dpSpeaker
+ ForceUseForMedia IsNot ForceNoBtA2dp
+ AvailableOutputDevices Includes BluetoothA2dpSpeaker
+
+ component: /Policy/policy/strategies/media/selected_output_devices/mask
+ speaker = 0
+ hdmi = 0
+ dgtl_dock_headset = 0
+ angl_dock_headset = 0
+ usb_device = 0
+ usb_accessory = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_a2dp_speaker = 1
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp = 0
+ remote_submix = 0
+ line = 0
+
+ conf: ForceSpeaker
+ ForceUseForMedia Is ForceSpeaker
+ AvailableOutputDevices Includes Speaker
+ #
+ # If hdmi system audio mode is on, remove speaker out of output list.
+ #
+ ForceUseForHdmiSystemAudio IsNot ForceHdmiSystemEnforced
+
+ component: /Policy/policy/strategies/media/selected_output_devices/mask
+ speaker = 1
+ hdmi = 0
+ dgtl_dock_headset = 0
+ angl_dock_headset = 0
+ usb_device = 0
+ usb_accessory = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_a2dp_speaker = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp = 0
+ remote_submix = 0
+ line = 0
+
+ conf: WiredHeadphone
+ AvailableOutputDevices Includes WiredHeadphone
+
+ component: /Policy/policy/strategies/media/selected_output_devices/mask
+ speaker = 0
+ hdmi = 0
+ dgtl_dock_headset = 0
+ angl_dock_headset = 0
+ usb_device = 0
+ usb_accessory = 0
+ wired_headset = 0
+ wired_headphone = 1
+ bluetooth_a2dp_speaker = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp = 0
+ remote_submix = 0
+ line = 0
+
+ conf: Line
+ AvailableOutputDevices Includes Line
+
+ component: /Policy/policy/strategies/media/selected_output_devices/mask
+ speaker = 0
+ hdmi = 0
+ dgtl_dock_headset = 0
+ angl_dock_headset = 0
+ usb_device = 0
+ usb_accessory = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_a2dp_speaker = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp = 0
+ remote_submix = 0
+ line = 1
+
+ conf: WiredHeadset
+ AvailableOutputDevices Includes WiredHeadset
+
+ component: /Policy/policy/strategies/media/selected_output_devices/mask
+ speaker = 0
+ hdmi = 0
+ dgtl_dock_headset = 0
+ angl_dock_headset = 0
+ usb_device = 0
+ usb_accessory = 0
+ wired_headset = 1
+ wired_headphone = 0
+ bluetooth_a2dp_speaker = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp = 0
+ remote_submix = 0
+ line = 0
+
+ conf: UsbAccessory
+ AvailableOutputDevices Includes UsbAccessory
+
+ component: /Policy/policy/strategies/media/selected_output_devices/mask
+ speaker = 0
+ hdmi = 0
+ dgtl_dock_headset = 0
+ angl_dock_headset = 0
+ usb_device = 0
+ usb_accessory = 1
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_a2dp_speaker = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp = 0
+ remote_submix = 0
+ line = 0
+
+ conf: UsbDevice
+ AvailableOutputDevices Includes UsbDevice
+
+ component: /Policy/policy/strategies/media/selected_output_devices/mask
+ speaker = 0
+ hdmi = 0
+ dgtl_dock_headset = 0
+ angl_dock_headset = 0
+ usb_device = 1
+ usb_accessory = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_a2dp_speaker = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp = 0
+ remote_submix = 0
+ line = 0
+
+ conf: DgtlDockHeadset
+ AvailableOutputDevices Includes DgtlDockHeadset
+
+ component: /Policy/policy/strategies/media/selected_output_devices/mask
+ speaker = 0
+ hdmi = 0
+ dgtl_dock_headset = 1
+ angl_dock_headset = 0
+ usb_device = 0
+ usb_accessory = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_a2dp_speaker = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp = 0
+ remote_submix = 0
+ line = 0
+
+ conf: AuxDigital
+ AvailableOutputDevices Includes Hdmi
+
+ component: /Policy/policy/strategies/media/selected_output_devices/mask
+ speaker = 0
+ hdmi = 1
+ dgtl_dock_headset = 0
+ angl_dock_headset = 0
+ usb_device = 0
+ usb_accessory = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_a2dp_speaker = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp = 0
+ remote_submix = 0
+ line = 0
+
+ conf: AnlgDockHeadset
+ AvailableOutputDevices Includes AnlgDockHeadset
+ ForceUseForDock Is ForceAnalogDock
+
+ component: /Policy/policy/strategies/media/selected_output_devices/mask
+ speaker = 0
+ hdmi = 0
+ dgtl_dock_headset = 0
+ angl_dock_headset = 1
+ usb_device = 0
+ usb_accessory = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_a2dp_speaker = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp = 0
+ remote_submix = 0
+ line = 0
+
+ conf: Speaker
+ AvailableOutputDevices Includes Speaker
+ #
+ # If hdmi system audio mode is on, remove speaker out of output list.
+ #
+ ForceUseForHdmiSystemAudio IsNot ForceHdmiSystemEnforced
+
+ component: /Policy/policy/strategies/media/selected_output_devices/mask
+ speaker = 1
+ hdmi = 0
+ dgtl_dock_headset = 0
+ angl_dock_headset = 0
+ usb_device = 0
+ usb_accessory = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_a2dp_speaker = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp = 0
+ remote_submix = 0
+ line = 0
+
+ conf: Default
+ component: /Policy/policy/strategies/media/selected_output_devices/mask
+ speaker = 0
+ hdmi = 0
+ dgtl_dock_headset = 0
+ angl_dock_headset = 0
+ usb_device = 0
+ usb_accessory = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_a2dp_speaker = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp = 0
+ remote_submix = 0
+ line = 0
+
+ domain: Arc
+ #
+ # these following domains consists in device(s) that can co-exist with others
+ # e.g. ARC, SPDIF, AUX_LINE
+ #
+ conf: Selected
+ AvailableOutputDevices Includes HdmiArc
+
+ /Policy/policy/strategies/media/selected_output_devices/mask/hdmi_arc = 1
+
+ conf: NotSelected
+ /Policy/policy/strategies/media/selected_output_devices/mask/hdmi_arc = 0
+
+ domain: Spdif
+ #
+ # these following domains consists in device(s) that can co-exist with others
+ # e.g. ARC, SPDIF, AUX_LINE
+ #
+ conf: Selected
+ AvailableOutputDevices Includes Spdif
+
+ /Policy/policy/strategies/media/selected_output_devices/mask/spdif = 1
+
+ conf: NotSelected
+ /Policy/policy/strategies/media/selected_output_devices/mask/spdif = 0
+
+ domain: AuxLine
+ conf: Selected
+ AvailableOutputDevices Includes AuxLine
+
+ /Policy/policy/strategies/media/selected_output_devices/mask/aux_line = 1
+
+ conf: NotSelected
+ /Policy/policy/strategies/media/selected_output_devices/mask/aux_line = 0
diff --git a/services/audiopolicy/engineconfigurable/parameter-framework/example/Settings/device_for_strategy_phone.pfw b/services/audiopolicy/engineconfigurable/parameter-framework/example/Settings/device_for_strategy_phone.pfw
new file mode 100644
index 0000000..7b01491
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/parameter-framework/example/Settings/device_for_strategy_phone.pfw
@@ -0,0 +1,485 @@
+supDomain: DeviceForStrategy
+
+ supDomain: Phone
+
+ domain: UnreachableDevices
+ conf: Calibration
+ component: /Policy/policy/strategies/phone/selected_output_devices/mask
+ # no sonification on remote submix (e.g. WFD)
+ remote_submix = 0
+ hdmi_arc = 0
+ aux_line = 0
+ spdif = 0
+ fm = 0
+ speaker_safe = 0
+
+ domain: Device
+ conf: ScoCarkit
+ AvailableOutputDevices Includes BluetoothScoCarkit
+ ForceUseForCommunication Is ForceBtSco
+
+ component: /Policy/policy/strategies/phone/selected_output_devices/mask
+ earpiece = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 1
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ hdmi = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ telephony_tx = 0
+ line = 0
+ speaker = 0
+
+ conf: BluetoothScoHeadset
+ AvailableOutputDevices Includes BluetoothScoHeadset
+ ForceUseForCommunication Is ForceBtSco
+
+ component: /Policy/policy/strategies/phone/selected_output_devices/mask
+ earpiece = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 1
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ hdmi = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ telephony_tx = 0
+ line = 0
+ speaker = 0
+
+ conf: BluetoothSco
+ AvailableOutputDevices Includes BluetoothSco
+ ForceUseForCommunication Is ForceBtSco
+
+ component: /Policy/policy/strategies/phone/selected_output_devices/mask
+ earpiece = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_sco = 1
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ hdmi = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ telephony_tx = 0
+ line = 0
+ speaker = 0
+
+ conf: BluetoothA2dp
+ #
+ # Fallback BT Sco devices in case of FORCE_BT_SCO
+ # or FORCE_NONE
+ #
+ AvailableOutputDevices Includes BluetoothA2dp
+ TelephonyMode IsNot InCall
+ TelephonyMode IsNot InCommunication
+ ForceUseForMedia IsNot ForceNoBtA2dp
+ ANY
+ ForceUseForCommunication Is ForceBtSco
+ ForceUseForCommunication Is ForceNone
+
+ component: /Policy/policy/strategies/phone/selected_output_devices/mask
+ earpiece = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp = 1
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ hdmi = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ telephony_tx = 0
+ line = 0
+ speaker = 0
+
+ conf: BluetoothA2dpHeadphones
+ #
+ # Fallback BT Sco devices in case of FORCE_BT_SCO
+ # or FORCE_NONE
+ #
+ AvailableOutputDevices Includes BluetoothA2dpHeadphones
+ TelephonyMode IsNot InCall
+ TelephonyMode IsNot InCommunication
+ ForceUseForMedia IsNot ForceNoBtA2dp
+ ANY
+ ForceUseForCommunication Is ForceBtSco
+ ForceUseForCommunication Is ForceNone
+
+ component: /Policy/policy/strategies/phone/selected_output_devices/mask
+ earpiece = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 1
+ bluetooth_a2dp_speaker = 0
+ hdmi = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ telephony_tx = 0
+ line = 0
+ speaker = 0
+
+ conf: BluetoothA2dpSpeaker
+ #
+ # Fallback BT Sco devices in case of FORCE_BT_SCO
+ # or FORCE_NONE
+ #
+ AvailableOutputDevices Includes BluetoothA2dpSpeaker
+ TelephonyMode IsNot InCall
+ TelephonyMode IsNot InCommunication
+ ForceUseForMedia IsNot ForceNoBtA2dp
+ ForceUseForCommunication Is ForceSpeaker
+
+ component: /Policy/policy/strategies/phone/selected_output_devices/mask
+ earpiece = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 1
+ bluetooth_a2dp_speaker = 0
+ hdmi = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ telephony_tx = 0
+ line = 0
+ speaker = 0
+
+ conf: WiredHeadphone
+ #
+ # Fallback BT Sco devices in case of FORCE_BT_SCO
+ # or FORCE_NONE
+ #
+ AvailableOutputDevices Includes WiredHeadphone
+ ForceUseForCommunication IsNot ForceSpeaker
+
+ component: /Policy/policy/strategies/phone/selected_output_devices/mask
+ earpiece = 0
+ wired_headset = 0
+ wired_headphone = 1
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ hdmi = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ telephony_tx = 0
+ line = 0
+ speaker = 0
+
+ conf: WiredHeadset
+ #
+ # Fallback BT Sco devices in case of FORCE_BT_SCO
+ # or FORCE_NONE
+ #
+ AvailableOutputDevices Includes WiredHeadset
+ ForceUseForCommunication IsNot ForceSpeaker
+
+ component: /Policy/policy/strategies/phone/selected_output_devices/mask
+ earpiece = 0
+ wired_headset = 1
+ wired_headphone = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ hdmi = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ telephony_tx = 0
+ line = 0
+ speaker = 0
+
+ conf: UsbDevice
+ #
+ # Fallback BT Sco devices in case of FORCE_BT_SCO
+ # or FORCE_NONE
+ #
+ AvailableOutputDevices Includes UsbDevice
+ ANY
+ ForceUseForCommunication Is ForceBtSco
+ ForceUseForCommunication Is ForceNone
+ ALL
+ ForceUseForCommunication Is ForceSpeaker
+ #
+ # In case of Force Speaker, priority between device and accessory are
+ # inverted compared to Force None or Bt Sco
+ #
+ AvailableOutputDevices Excludes UsbAccessory
+ TelephonyMode IsNot InCall
+ TelephonyMode IsNot InCommunication
+
+ component: /Policy/policy/strategies/phone/selected_output_devices/mask
+ earpiece = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ hdmi = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 1
+ telephony_tx = 0
+ line = 0
+ speaker = 0
+
+ conf: UsbAccessory
+ #
+ # Fallback BT Sco devices in case of FORCE_BT_SCO
+ # or FORCE_NONE
+ #
+ AvailableOutputDevices Includes UsbAccessory
+ TelephonyMode IsNot InCommunication
+ TelephonyMode IsNot InCall
+
+ component: /Policy/policy/strategies/phone/selected_output_devices/mask
+ earpiece = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ hdmi = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 1
+ telephony_tx = 0
+ line = 0
+ speaker = 0
+
+ conf: DgtlDockHeadset
+ #
+ # Fallback BT Sco devices in case of FORCE_BT_SCO
+ # or FORCE_NONE
+ #
+ AvailableOutputDevices Includes DgtlDockHeadset
+ TelephonyMode IsNot InCall
+ TelephonyMode IsNot InCommunication
+
+ component: /Policy/policy/strategies/phone/selected_output_devices/mask
+ earpiece = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ hdmi = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 1
+ usb_accessory = 0
+ usb_device = 0
+ telephony_tx = 0
+ line = 0
+ speaker = 0
+
+ conf: Hdmi
+ #
+ # Fallback BT Sco devices in case of FORCE_BT_SCO
+ # or FORCE_NONE
+ #
+ AvailableOutputDevices Includes Hdmi
+ TelephonyMode IsNot InCall
+ TelephonyMode IsNot InCommunication
+
+ component: /Policy/policy/strategies/phone/selected_output_devices/mask
+ earpiece = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ hdmi = 1
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ telephony_tx = 0
+ line = 0
+ speaker = 0
+
+ conf: AnlgDockHeadset
+ #
+ # Fallback BT Sco devices in case of FORCE_BT_SCO
+ # or FORCE_NONE
+ #
+ AvailableOutputDevices Includes AnlgDockHeadset
+ TelephonyMode IsNot InCall
+ TelephonyMode IsNot InCommunication
+
+ component: /Policy/policy/strategies/phone/selected_output_devices/mask
+ earpiece = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ hdmi = 0
+ angl_dock_headset = 1
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ telephony_tx = 0
+ line = 0
+ speaker = 0
+
+ conf: Earpiece
+ #
+ # Fallback BT Sco devices in case of FORCE_BT_SCO
+ # or FORCE_NONE
+ #
+ AvailableOutputDevices Includes Earpiece
+ ForceUseForCommunication IsNot ForceSpeaker
+
+ component: /Policy/policy/strategies/phone/selected_output_devices/mask
+ earpiece = 1
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ hdmi = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ telephony_tx = 0
+ line = 0
+ speaker = 0
+
+ conf: Line
+ #
+ # Fallback BT Sco devices in case of FORCE_BT_SCO
+ # or FORCE_NONE
+ #
+ AvailableOutputDevices Includes Line
+ ForceUseForCommunication Is ForceSpeaker
+
+ component: /Policy/policy/strategies/phone/selected_output_devices/mask
+ earpiece = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ hdmi = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ telephony_tx = 0
+ line = 1
+ speaker = 0
+
+ conf: Speaker
+ #
+ # Fallback BT Sco devices in case of FORCE_BT_SCO
+ # or FORCE_NONE
+ #
+ AvailableOutputDevices Includes Speaker
+ ForceUseForCommunication Is ForceSpeaker
+
+ component: /Policy/policy/strategies/phone/selected_output_devices/mask
+ earpiece = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ hdmi = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ telephony_tx = 0
+ line = 0
+ speaker = 1
+
+ conf: Default
+ component: /Policy/policy/strategies/phone/selected_output_devices/mask
+ earpiece = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ hdmi = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ telephony_tx = 0
+ line = 0
+ speaker = 0
+
+
diff --git a/services/audiopolicy/engineconfigurable/parameter-framework/example/Settings/device_for_strategy_rerouting.pfw b/services/audiopolicy/engineconfigurable/parameter-framework/example/Settings/device_for_strategy_rerouting.pfw
new file mode 100644
index 0000000..d390a33
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/parameter-framework/example/Settings/device_for_strategy_rerouting.pfw
@@ -0,0 +1,297 @@
+domainGroup: DeviceForStrategy
+
+ domainGroup: Rerouting
+ #
+ # Falls through media strategy
+ #
+ domain: UnreachableDevices
+ conf: Calibration
+ component: /Policy/policy/strategies/rerouting/selected_output_devices/mask
+ hdmi_arc = 0
+ spdif = 0
+ aux_line = 0
+ fm = 0
+ speaker_safe = 0
+ earpiece = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ telephony_tx = 0
+
+ domain: Device2
+ conf: RemoteSubmix
+ AvailableOutputDevices Includes RemoteSubmix
+
+ component: /Policy/policy/strategies/rerouting/selected_output_devices/mask
+ remote_submix = 1
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ speaker = 0
+ wired_headset = 0
+ wired_headphone = 0
+ line = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ hdmi = 0
+
+ conf: BluetoothA2dp
+ ForceUseForMedia IsNot ForceNoBtA2dp
+ AvailableOutputDevices Includes BluetoothA2dp
+
+ component: /Policy/policy/strategies/rerouting/selected_output_devices/mask
+ remote_submix = 0
+ bluetooth_a2dp = 1
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ speaker = 0
+ wired_headset = 0
+ wired_headphone = 0
+ line = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ hdmi = 0
+
+ conf: BluetoothA2dpHeadphone
+ ForceUseForMedia IsNot ForceNoBtA2dp
+ AvailableOutputDevices Includes BluetoothA2dpHeadphones
+
+ component: /Policy/policy/strategies/rerouting/selected_output_devices/mask
+ remote_submix = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 1
+ bluetooth_a2dp_speaker = 0
+ speaker = 0
+ wired_headset = 0
+ wired_headphone = 0
+ line = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ hdmi = 0
+
+ conf: BluetoothA2dpSpeaker
+ ForceUseForMedia IsNot ForceNoBtA2dp
+ AvailableOutputDevices Includes BluetoothA2dpSpeaker
+
+ component: /Policy/policy/strategies/rerouting/selected_output_devices/mask
+ remote_submix = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 1
+ speaker = 0
+ wired_headset = 0
+ wired_headphone = 0
+ line = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ hdmi = 0
+
+ conf: ForceSpeaker
+ ForceUseForMedia Is ForceSpeaker
+ AvailableOutputDevices Includes Speaker
+
+ component: /Policy/policy/strategies/rerouting/selected_output_devices/mask
+ remote_submix = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ speaker = 1
+ wired_headset = 0
+ wired_headphone = 0
+ line = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ hdmi = 0
+
+ conf: WiredHeadphone
+ AvailableOutputDevices Includes WiredHeadphone
+
+ component: /Policy/policy/strategies/rerouting/selected_output_devices/mask
+ remote_submix = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ speaker = 0
+ wired_headset = 0
+ wired_headphone = 1
+ line = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ hdmi = 0
+
+ conf: Line
+ AvailableOutputDevices Includes Line
+
+ component: /Policy/policy/strategies/rerouting/selected_output_devices/mask
+ remote_submix = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ speaker = 0
+ wired_headset = 0
+ wired_headphone = 0
+ line = 1
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ hdmi = 0
+
+ conf: WiredHeadset
+ AvailableOutputDevices Includes WiredHeadset
+
+ component: /Policy/policy/strategies/rerouting/selected_output_devices/mask
+ remote_submix = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ speaker = 0
+ wired_headset = 1
+ wired_headphone = 0
+ line = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ hdmi = 0
+
+ conf: UsbAccessory
+ AvailableOutputDevices Includes UsbAccessory
+
+ component: /Policy/policy/strategies/rerouting/selected_output_devices/mask
+ remote_submix = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ speaker = 0
+ wired_headset = 0
+ wired_headphone = 0
+ line = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 1
+ usb_device = 0
+ hdmi = 0
+
+ conf: UsbDevice
+ AvailableOutputDevices Includes UsbDevice
+
+ component: /Policy/policy/strategies/rerouting/selected_output_devices/mask
+ remote_submix = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ speaker = 0
+ wired_headset = 0
+ wired_headphone = 0
+ line = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 1
+ hdmi = 0
+
+ conf: DgtlDockHeadset
+ AvailableOutputDevices Includes DgtlDockHeadset
+
+ component: /Policy/policy/strategies/rerouting/selected_output_devices/mask
+ remote_submix = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ speaker = 0
+ wired_headset = 0
+ wired_headphone = 0
+ line = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 1
+ usb_accessory = 0
+ usb_device = 0
+ hdmi = 0
+
+ conf: AuxDigital
+ #
+ # Rerouting is similar to media and sonification (exept here: sonification is not allowed on HDMI)
+ #
+ AvailableOutputDevices Includes Hdmi
+
+ component: /Policy/policy/strategies/rerouting/selected_output_devices/mask
+ remote_submix = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ speaker = 0
+ wired_headset = 0
+ wired_headphone = 0
+ line = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ hdmi = 1
+
+ conf: AnlgDockHeadset
+ AvailableOutputDevices Includes AnlgDockHeadset
+ ForceUseForDock Is ForceAnalogDock
+
+ component: /Policy/policy/strategies/rerouting/selected_output_devices/mask
+ remote_submix = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ speaker = 0
+ wired_headset = 0
+ wired_headphone = 0
+ line = 0
+ angl_dock_headset = 1
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ hdmi = 0
+
+ conf: Speaker
+ AvailableOutputDevices Includes Speaker
+
+ component: /Policy/policy/strategies/rerouting/selected_output_devices/mask
+ remote_submix = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ speaker = 1
+ wired_headset = 0
+ wired_headphone = 0
+ line = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ hdmi = 0
+
+ conf: Default
+ component: /Policy/policy/strategies/rerouting/selected_output_devices/mask
+ remote_submix = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ speaker = 0
+ wired_headset = 0
+ wired_headphone = 0
+ line = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ hdmi = 0
+
diff --git a/services/audiopolicy/engineconfigurable/parameter-framework/example/Settings/device_for_strategy_sonification.pfw b/services/audiopolicy/engineconfigurable/parameter-framework/example/Settings/device_for_strategy_sonification.pfw
new file mode 100644
index 0000000..71101f8
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/parameter-framework/example/Settings/device_for_strategy_sonification.pfw
@@ -0,0 +1,485 @@
+supDomain: DeviceForStrategy
+
+ supDomain: Sonification
+
+ domain: UnreachableDevices
+ conf: Calibration
+ component: /Policy/policy/strategies/sonification/selected_output_devices/mask
+ # no sonification on remote submix (e.g. WFD)
+ remote_submix = 0
+ hdmi_arc = 0
+ spdif = 0
+ fm = 0
+ speaker_safe = 0
+ aux_line = 0
+ #
+ # Sonification follows phone strategy if in call but HDMI is not reachable
+ #
+ hdmi = 0
+
+ domain: Speaker
+
+ conf: Selected
+ AvailableOutputDevices Includes Speaker
+ ANY
+ #
+ # Sonification falls through ENFORCED_AUDIBLE if not in call (widely speaking)
+ #
+ ALL
+ TelephonyMode IsNot InCall
+ TelephonyMode IsNot InCommunication
+ ALL
+ #
+ # Sonification follows phone strategy if in call (widely speaking)
+ #
+ ForceUseForCommunication Is ForceSpeaker
+ ANY
+ TelephonyMode Is InCall
+ TelephonyMode Is InCommunication
+ AvailableOutputDevices Excludes Line
+
+ component: /Policy/policy/strategies/sonification/selected_output_devices/mask
+ speaker = 1
+
+ conf: NotSelected
+ component: /Policy/policy/strategies/sonification/selected_output_devices/mask
+ speaker = 0
+
+ domain: Device2
+
+ conf: BluetoothA2dp
+ #
+ # Sonification falls through media strategy if not in call (widely speaking)
+ #
+ AvailableOutputDevices Includes BluetoothA2dp
+ TelephonyMode IsNot InCall
+ TelephonyMode IsNot InCommunication
+ ForceUseForMedia IsNot ForceNoBtA2dp
+
+ component: /Policy/policy/strategies/sonification/selected_output_devices/mask
+ earpiece = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp = 1
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ telephony_tx = 0
+ line = 0
+
+ conf: BluetoothA2dpHeadphones
+ #
+ # Sonification falls through media strategy if not in call (widely speaking)
+ #
+ AvailableOutputDevices Includes BluetoothA2dpHeadphones
+ TelephonyMode IsNot InCall
+ TelephonyMode IsNot InCommunication
+ ForceUseForMedia IsNot ForceNoBtA2dp
+
+ component: /Policy/policy/strategies/sonification/selected_output_devices/mask
+ earpiece = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 1
+ bluetooth_a2dp_speaker = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ telephony_tx = 0
+ line = 0
+
+ conf: BluetoothA2dpSpeaker
+ #
+ # Sonification falls through media strategy if not in call (widely speaking)
+ #
+ AvailableOutputDevices Includes BluetoothA2dpSpeaker
+ TelephonyMode IsNot InCall
+ TelephonyMode IsNot InCommunication
+ ForceUseForMedia IsNot ForceNoBtA2dp
+
+ component: /Policy/policy/strategies/sonification/selected_output_devices/mask
+ earpiece = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 1
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ telephony_tx = 0
+ line = 0
+
+ conf: ScoCarkit
+ #
+ # Sonification follows phone strategy if in call (widely speaking)
+ #
+ ANY
+ TelephonyMode Is InCall
+ TelephonyMode Is InCommunication
+ ForceUseForCommunication Is ForceBtSco
+ AvailableOutputDevices Includes BluetoothScoCarkit
+
+ component: /Policy/policy/strategies/sonification/selected_output_devices/mask
+ earpiece = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 1
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ telephony_tx = 0
+ line = 0
+
+ conf: ScoHeadset
+ #
+ # Sonification follows phone strategy if in call (widely speaking)
+ #
+ ANY
+ TelephonyMode Is InCall
+ TelephonyMode Is InCommunication
+ ForceUseForCommunication Is ForceBtSco
+ AvailableOutputDevices Includes BluetoothScoHeadset
+
+ component: /Policy/policy/strategies/sonification/selected_output_devices/mask
+ earpiece = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 1
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ telephony_tx = 0
+ line = 0
+
+ conf: Sco
+ #
+ # Sonification follows phone strategy if in call (widely speaking)
+ #
+ ANY
+ TelephonyMode Is InCall
+ TelephonyMode Is InCommunication
+ ForceUseForCommunication Is ForceBtSco
+ AvailableOutputDevices Includes BluetoothSco
+
+ component: /Policy/policy/strategies/sonification/selected_output_devices/mask
+ earpiece = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_sco = 1
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ telephony_tx = 0
+ line = 0
+
+ conf: WiredHeadphone
+ AvailableOutputDevices Includes WiredHeadphone
+ ANY
+ #
+ # Sonification falls through media strategy if not in call (widely speaking)
+ #
+ ALL
+ TelephonyMode IsNot InCall
+ TelephonyMode IsNot InCommunication
+ ForceUseForMedia IsNot ForceSpeaker
+ #
+ # Sonification follows Phone strategy if in call (widely speaking)
+ #
+ ALL
+ ANY
+ TelephonyMode Is InCall
+ TelephonyMode Is InCommunication
+ ForceUseForCommunication IsNot ForceSpeaker
+
+ component: /Policy/policy/strategies/sonification/selected_output_devices/mask
+ earpiece = 0
+ wired_headset = 0
+ wired_headphone = 1
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ telephony_tx = 0
+ line = 0
+
+ conf: Line
+ AvailableOutputDevices Includes Line
+ ANY
+ #
+ # Sonification follows Phone strategy if in call (widely speaking)
+ #
+ ALL
+ ANY
+ TelephonyMode Is InCall
+ TelephonyMode Is InCommunication
+ ForceUseForCommunication Is ForceSpeaker
+ #
+ # Sonification falls through media strategy if not in call (widely speaking)
+ #
+ ALL
+ TelephonyMode IsNot InCall
+ TelephonyMode IsNot InCommunication
+ ForceUseForMedia IsNot ForceSpeaker
+
+ component: /Policy/policy/strategies/sonification/selected_output_devices/mask
+ earpiece = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ telephony_tx = 0
+ line = 1
+
+ conf: WiredHeadset
+ AvailableOutputDevices Includes WiredHeadset
+ ANY
+ #
+ # Sonification falls through media strategy if not in call (widely speaking)
+ #
+ ALL
+ TelephonyMode IsNot InCall
+ TelephonyMode IsNot InCommunication
+ ForceUseForMedia IsNot ForceSpeaker
+ ALL
+ #
+ # Sonification Follows Phone Strategy if in call (widely speaking)
+ #
+ ANY
+ TelephonyMode Is InCall
+ TelephonyMode Is InCommunication
+ ForceUseForCommunication IsNot ForceSpeaker
+
+ component: /Policy/policy/strategies/sonification/selected_output_devices/mask
+ earpiece = 0
+ wired_headset = 1
+ wired_headphone = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ telephony_tx = 0
+ line = 0
+
+ conf: UsbDevice
+ AvailableOutputDevices Includes UsbDevice
+ ANY
+ #
+ # Sonification falls through media strategy if not in call (widely speaking)
+ #
+ ALL
+ AvailableOutputDevices Excludes UsbAccessory
+ TelephonyMode IsNot InCall
+ TelephonyMode IsNot InCommunication
+ ForceUseForMedia IsNot ForceSpeaker
+ ALL
+ #
+ # Sonification Follows Phone Strategy if in call (widely speaking)
+ #
+ ANY
+ TelephonyMode Is InCall
+ TelephonyMode Is InCommunication
+ ForceUseForCommunication IsNot ForceSpeaker
+
+ component: /Policy/policy/strategies/sonification/selected_output_devices/mask
+ earpiece = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 1
+ telephony_tx = 0
+ line = 0
+
+ conf: UsbAccessory
+ AvailableOutputDevices Includes UsbAccessory
+ #
+ # Sonification falls through media strategy if not in call (widely speaking)
+ #
+ # Sonification Follows Phone Strategy if in call (widely speaking)
+ # but USB Accessory not reachable in call.
+ #
+ TelephonyMode IsNot InCall
+ TelephonyMode IsNot InCommunication
+ ForceUseForMedia IsNot ForceSpeaker
+
+ component: /Policy/policy/strategies/sonification/selected_output_devices/mask
+ earpiece = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 1
+ usb_device = 0
+ telephony_tx = 0
+ line = 0
+
+ conf: DgtlDockHeadset
+ AvailableOutputDevices Includes DgtlDockHeadset
+ #
+ # Sonification falls through media strategy if not in call
+ #
+ # Sonification Follows Phone Strategy if in call (widely speaking)
+ # but DgtlDockHeadset not reachable in call.
+ #
+ TelephonyMode IsNot InCall
+ TelephonyMode IsNot InCommunication
+ ForceUseForMedia IsNot ForceSpeaker
+
+ component: /Policy/policy/strategies/sonification/selected_output_devices/mask
+ earpiece = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 1
+ usb_accessory = 0
+ usb_device = 0
+ telephony_tx = 0
+ line = 0
+
+ conf: AnlgDockHeadset
+ AvailableOutputDevices Includes AnlgDockHeadset
+ #
+ # Sonification falls through media strategy if not in call
+ #
+ # Sonification Follows Phone Strategy if in call (widely speaking)
+ # but AnlgDockHeadset not reachable in call.
+ #
+ TelephonyMode IsNot InCall
+ TelephonyMode IsNot InCommunication
+ ForceUseForMedia IsNot ForceSpeaker
+ ForceUseForDock Is ForceAnalogDock
+
+ component: /Policy/policy/strategies/sonification/selected_output_devices/mask
+ earpiece = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ angl_dock_headset = 1
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ telephony_tx = 0
+ line = 0
+
+ conf: Earpiece
+ #
+ # Sonification Follows Phone Strategy if in call
+ #
+ ANY
+ TelephonyMode Is InCall
+ TelephonyMode Is InCommunication
+ ForceUseForCommunication IsNot ForceSpeaker
+ AvailableOutputDevices Includes Earpiece
+
+ component: /Policy/policy/strategies/sonification/selected_output_devices/mask
+ earpiece = 1
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ telephony_tx = 0
+ line = 0
+
+ conf: None
+ component: /Policy/policy/strategies/sonification/selected_output_devices/mask
+ earpiece = 0
+ wired_headset = 0
+ wired_headphone = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ telephony_tx = 0
+ line = 0
diff --git a/services/audiopolicy/engineconfigurable/parameter-framework/example/Settings/device_for_strategy_sonification_respectful.pfw b/services/audiopolicy/engineconfigurable/parameter-framework/example/Settings/device_for_strategy_sonification_respectful.pfw
new file mode 100644
index 0000000..f66674c
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/parameter-framework/example/Settings/device_for_strategy_sonification_respectful.pfw
@@ -0,0 +1,545 @@
+domainGroup: DeviceForStrategy
+
+ domainGroup: SonificationRespectful
+ #
+ # Sonificiation Respectful follows:
+ # - If in call: Strategy sonification (that follows phone strategy in call also...)
+ # - If not in call AND a music stream is active remotely: Strategy sonification (that
+ # follows enforced audible, which follows media)
+ # - if not in call and no music stream active remotely and music stream active): strategy
+ # media
+ # - Otherwise follows sonification by replacing speaker with speaker safe if speaker is
+ # selected.
+ #
+ # Case of stream active handled programmatically
+
+ domain: UnreachableDevices
+ conf: Calibration
+ component: /Policy/policy/strategies/sonification_respectful/selected_output_devices/mask
+ remote_submix = 0
+ hdmi_arc = 0
+ aux_line = 0
+ spdif = 0
+ fm = 0
+ telephony_tx = 0
+
+ domain: Speakers
+
+ conf: SpeakerSafe
+ AvailableOutputDevices Includes Speaker
+ AvailableOutputDevices Includes SpeakerSafe
+ #
+ # Follows sonification strategy if not in call and replace speaker by speaker safe
+ # if and only if speaker only selected
+ #
+ TelephonyMode IsNot InCall
+ TelephonyMode IsNot InCommunication
+
+ component: /Policy/policy/strategies/sonification_respectful/selected_output_devices/mask
+ speaker_safe = 1
+ speaker = 0
+
+ conf: Speaker
+ AvailableOutputDevices Includes Speaker
+ ANY
+ #
+ # Follows sonification strategy if not in call
+ #
+ ALL
+ TelephonyMode IsNot InCall
+ TelephonyMode IsNot InCommunication
+ ALL
+ #
+ # Follows Phone Strategy if call
+ #
+ ForceUseForCommunication Is ForceSpeaker
+ ANY
+ TelephonyMode Is InCall
+ TelephonyMode Is InCommunication
+ AvailableOutputDevices Excludes Line
+
+ component: /Policy/policy/strategies/sonification_respectful/selected_output_devices/mask
+ speaker_safe = 0
+ speaker = 1
+
+ conf: None
+ component: /Policy/policy/strategies/sonification_respectful/selected_output_devices/mask
+ speaker_safe = 0
+ speaker = 0
+
+ domain: Device2
+ conf: BluetoothA2dp
+ #
+ # SonificationRespectful Follows Sonification that falls through Media strategy if not in call
+ # SonificationRespectful follows media if music stream is active
+ #
+ TelephonyMode IsNot InCall
+ TelephonyMode IsNot InCommunication
+ ForceUseForMedia Is ForceNoBtA2dp
+ AvailableOutputDevices Includes BluetoothA2dp
+
+ component: /Policy/policy/strategies/sonification_respectful/selected_output_devices/mask
+ earpiece = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ bluetooth_a2dp = 1
+ wired_headset = 0
+ wired_headphone = 0
+ line = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ hdmi = 0
+
+ conf: BluetoothA2dpHeadphones
+ #
+ # SonificationRespectful Follows Sonification that falls through Media strategy if not in call
+ # SonificationRespectful follows media if music stream is active
+ #
+ TelephonyMode IsNot InCall
+ TelephonyMode IsNot InCommunication
+ ForceUseForMedia Is ForceNoBtA2dp
+ AvailableOutputDevices Includes BluetoothA2dpHeadphones
+
+ component: /Policy/policy/strategies/sonification_respectful/selected_output_devices/mask
+ earpiece = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp_headphones = 1
+ bluetooth_a2dp_speaker = 0
+ bluetooth_a2dp = 0
+ wired_headset = 0
+ wired_headphone = 0
+ line = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ hdmi = 0
+
+ conf: BluetoothA2dpSpeaker
+ #
+ # SonificationRespectful Follows Sonification that falls through Media strategy if not in call
+ # SonificationRespectful follows media if music stream is active
+ #
+ TelephonyMode IsNot InCall
+ TelephonyMode IsNot InCommunication
+ ForceUseForMedia Is ForceNoBtA2dp
+ AvailableOutputDevices Includes BluetoothA2dpSpeaker
+
+ component: /Policy/policy/strategies/sonification_respectful/selected_output_devices/mask
+ earpiece = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 1
+ bluetooth_a2dp = 0
+ wired_headset = 0
+ wired_headphone = 0
+ line = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ hdmi = 0
+
+ conf: BluetoothScoCarkit
+ #
+ # SonificationRespectful Follows Phone strategy if in call
+ #
+ ANY
+ TelephonyMode Is InCall
+ TelephonyMode Is InCommunication
+ ForceUseForCommunication Is ForceBtSco
+ AvailableOutputDevices Includes BluetoothScoCarkit
+
+ component: /Policy/policy/strategies/sonification_respectful/selected_output_devices/mask
+ earpiece = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 1
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ bluetooth_a2dp = 0
+ wired_headset = 0
+ wired_headphone = 0
+ line = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ hdmi = 0
+
+ conf: BluetoothScoHeadset
+ #
+ # SonificationRespectful Follows Phone strategy if in call
+ #
+ ANY
+ TelephonyMode Is InCall
+ TelephonyMode Is InCommunication
+ ForceUseForCommunication Is ForceBtSco
+ AvailableOutputDevices Includes BluetoothScoHeadset
+
+ component: /Policy/policy/strategies/sonification_respectful/selected_output_devices/mask
+ earpiece = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 1
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ bluetooth_a2dp = 0
+ wired_headset = 0
+ wired_headphone = 0
+ line = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ hdmi = 0
+
+ conf: BluetoothSco
+ #
+ # SonificationRespectful Follows Phone strategy if in call
+ #
+ ANY
+ TelephonyMode Is InCall
+ TelephonyMode Is InCommunication
+ ForceUseForCommunication Is ForceBtSco
+ AvailableOutputDevices Includes BluetoothSco
+
+ component: /Policy/policy/strategies/sonification_respectful/selected_output_devices/mask
+ earpiece = 0
+ bluetooth_sco = 1
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ bluetooth_a2dp = 0
+ wired_headset = 0
+ wired_headphone = 0
+ line = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ hdmi = 0
+
+ conf: WiredHeadphone
+ ANY
+ ALL
+ #
+ # SonificationRespectful Follows Phone strategy if in call
+ #
+ ANY
+ TelephonyMode Is InCall
+ TelephonyMode Is InCommunication
+ ForceUseForCommunication IsNot ForceSpeaker
+ ALL
+ #
+ # SonificationRespectful Follows Sonification that falls through Media strategy if not in call
+ # SonificationRespectful follows media if music stream is active
+ #
+ TelephonyMode IsNot InCall
+ TelephonyMode IsNot InCommunication
+ ForceUseForMedia IsNot ForceSpeaker
+ AvailableOutputDevices Includes WiredHeadphone
+
+ component: /Policy/policy/strategies/sonification_respectful/selected_output_devices/mask
+ earpiece = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ bluetooth_a2dp = 0
+ wired_headset = 0
+ wired_headphone = 1
+ line = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ hdmi = 0
+
+ conf: LineWhenFollowMediaStrategy
+ #
+ # SonificationRespectful Follows Sonification that falls through Media strategy if not in call
+ # SonificationRespectful follows media if music stream is active
+ #
+ TelephonyMode IsNot InCall
+ TelephonyMode IsNot InCommunication
+ AvailableOutputDevices Includes WiredHeadphone
+ ForceUseForMedia IsNot ForceSpeaker
+
+ component: /Policy/policy/strategies/sonification_respectful/selected_output_devices/mask
+ earpiece = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ bluetooth_a2dp = 0
+ wired_headset = 0
+ wired_headphone = 0
+ line = 1
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ hdmi = 0
+
+ conf: WiredHeadset
+ ANY
+ ALL
+ #
+ # SonificationRespectful Follows Phone strategy if in call
+ #
+ ANY
+ TelephonyMode Is InCall
+ TelephonyMode Is InCommunication
+ ForceUseForCommunication IsNot ForceSpeaker
+ ALL
+ #
+ # SonificationRespectful Follows Sonification that falls through Media strategy if not in call
+ # SonificationRespectful follows media if music stream is active
+ #
+ TelephonyMode IsNot InCall
+ TelephonyMode IsNot InCommunication
+ ForceUseForMedia IsNot ForceSpeaker
+ AvailableOutputDevices Includes WiredHeadset
+
+ component: /Policy/policy/strategies/sonification_respectful/selected_output_devices/mask
+ earpiece = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ bluetooth_a2dp = 0
+ wired_headset = 1
+ wired_headphone = 0
+ line = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ hdmi = 0
+
+ conf: UsbDevice
+ ANY
+ ALL
+ #
+ # SonificationRespectful Follows Phone strategy if in call
+ #
+ ANY
+ TelephonyMode Is InCall
+ TelephonyMode Is InCommunication
+ ForceUseForCommunication IsNot ForceSpeaker
+ ALL
+ #
+ # SonificationRespectful Follows Sonification that falls through Media strategy if not in call
+ # SonificationRespectful follows media if music stream is active
+ #
+ TelephonyMode IsNot InCall
+ TelephonyMode IsNot InCommunication
+ ForceUseForMedia IsNot ForceSpeaker
+ AvailableOutputDevices Excludes UsbAccessory
+ AvailableOutputDevices Includes UsbDevice
+
+ component: /Policy/policy/strategies/sonification_respectful/selected_output_devices/mask
+ earpiece = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ bluetooth_a2dp = 0
+ wired_headset = 0
+ wired_headphone = 0
+ line = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 1
+ hdmi = 0
+
+ conf: UsbAccessory
+ #
+ # SonificationRespectful Follows Phone strategy if in call (widely speaking)
+ # but UsbAccessory not reachable in call.
+ #
+ # SonificationRespectful Follows Sonification that falls through Media strategy if not in call
+ # SonificationRespectful follows media if music stream is active
+ #
+ TelephonyMode IsNot InCall
+ TelephonyMode IsNot InCommunication
+ ForceUseForMedia IsNot ForceSpeaker
+ AvailableOutputDevices Includes UsbAccessory
+
+ component: /Policy/policy/strategies/sonification_respectful/selected_output_devices/mask
+ earpiece = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ bluetooth_a2dp = 0
+ wired_headset = 0
+ wired_headphone = 0
+ line = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 1
+ usb_device = 0
+ hdmi = 0
+
+ conf: DgtlDockHeadset
+ #
+ # SonificationRespectful Follows Phone strategy if in call (widely speaking)
+ # but DgtlDockHeadset not reachable in call.
+ #
+ # SonificationRespectful Follows Sonification that falls through Media strategy if not in call
+ # SonificationRespectful follows media if music stream is active
+ #
+ TelephonyMode IsNot InCall
+ TelephonyMode IsNot InCommunication
+ ForceUseForMedia IsNot ForceSpeaker
+ AvailableOutputDevices Includes DgtlDockHeadset
+
+ component: /Policy/policy/strategies/sonification_respectful/selected_output_devices/mask
+ earpiece = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ bluetooth_a2dp = 0
+ wired_headset = 0
+ wired_headphone = 0
+ line = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 1
+ usb_accessory = 0
+ usb_device = 0
+ hdmi = 0
+
+ conf: AuxDigital
+ #
+ # SonificationRespectful Follows Phone strategy if in call (widely speaking)
+ # but HDMI not reachable in call.
+ #
+ # SonificationRespectful Follows Sonification that falls through Media strategy if not in call
+ # SonificationRespectful follows media if music stream is active
+ #
+ TelephonyMode IsNot InCall
+ TelephonyMode IsNot InCommunication
+ ForceUseForMedia IsNot ForceSpeaker
+ AvailableOutputDevices Includes Hdmi
+
+ component: /Policy/policy/strategies/sonification_respectful/selected_output_devices/mask
+ earpiece = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ bluetooth_a2dp = 0
+ wired_headset = 0
+ wired_headphone = 0
+ line = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ hdmi = 1
+
+ conf: AnlgDockHeadset
+ #
+ # SonificationRespectful Follows Phone strategy if in call (widely speaking)
+ # but AnlgDockHeadset not reachable in call.
+ #
+ # SonificationRespectful Follows Sonification that falls through Media strategy if not in call
+ # SonificationRespectful follows media if music stream is active
+ #
+ TelephonyMode IsNot InCall
+ TelephonyMode IsNot InCommunication
+ ForceUseForMedia IsNot ForceSpeaker
+ ForceUseForDock Is ForceAnalogDock
+ AvailableOutputDevices Includes AnlgDockHeadset
+
+ component: /Policy/policy/strategies/sonification_respectful/selected_output_devices/mask
+ earpiece = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ bluetooth_a2dp = 0
+ wired_headset = 0
+ wired_headphone = 0
+ line = 0
+ angl_dock_headset = 1
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ hdmi = 0
+
+ conf: Earpiece
+ #
+ # SonificationRespectful Follows Phone strategy if in call
+ #
+ ANY
+ TelephonyMode Is InCall
+ TelephonyMode Is InCommunication
+ ForceUseForCommunication IsNot ForceSpeaker
+ AvailableOutputDevices Includes Earpiece
+
+ component: /Policy/policy/strategies/sonification_respectful/selected_output_devices/mask
+ earpiece = 1
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ bluetooth_a2dp = 0
+ wired_headset = 0
+ wired_headphone = 0
+ line = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ hdmi = 0
+
+ conf: Line
+ #
+ # SonificationRespectful Follows Phone strategy if in call
+ #
+ ANY
+ TelephonyMode Is InCall
+ TelephonyMode Is InCommunication
+ ForceUseForCommunication Is ForceSpeaker
+ AvailableOutputDevices Includes Line
+
+ component: /Policy/policy/strategies/sonification_respectful/selected_output_devices/mask
+ earpiece = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ bluetooth_a2dp = 0
+ wired_headset = 0
+ wired_headphone = 0
+ line = 1
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ hdmi = 0
diff --git a/services/audiopolicy/engineconfigurable/parameter-framework/example/Settings/device_for_strategy_transmitted_through_speaker.pfw b/services/audiopolicy/engineconfigurable/parameter-framework/example/Settings/device_for_strategy_transmitted_through_speaker.pfw
new file mode 100644
index 0000000..e5ae9d9
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/parameter-framework/example/Settings/device_for_strategy_transmitted_through_speaker.pfw
@@ -0,0 +1,40 @@
+supDomain: DeviceForStrategy
+
+ supDomain: TransmittedThroughSpeaker
+ domain: UnreacheableDevices
+ conf: Calibration
+ component: /Policy/policy/strategies/transmitted_through_speaker/selected_output_devices/mask
+ remote_submix = 0
+ hdmi_arc = 0
+ spdif = 0
+ aux_line = 0
+ fm = 0
+ speaker_safe = 0
+ earpiece = 0
+ wired_headset = 1
+ wired_headphone = 0
+ bluetooth_sco = 0
+ bluetooth_sco_headset = 0
+ bluetooth_sco_carkit = 0
+ bluetooth_a2dp = 0
+ bluetooth_a2dp_headphones = 0
+ bluetooth_a2dp_speaker = 0
+ hdmi = 0
+ angl_dock_headset = 0
+ dgtl_dock_headset = 0
+ usb_accessory = 0
+ usb_device = 0
+ telephony_tx = 0
+ line = 0
+
+ domain: Speaker
+ conf: Selected
+ AvailableOutputDevices Includes Speaker
+
+ component: /Policy/policy/strategies/transmitted_through_speaker/selected_output_devices/mask
+ speaker = 1
+
+ conf: NotSelected
+ component: /Policy/policy/strategies/transmitted_through_speaker/selected_output_devices/mask
+ speaker = 0
+
diff --git a/services/audiopolicy/engineconfigurable/parameter-framework/example/Settings/strategy_for_stream.pfw b/services/audiopolicy/engineconfigurable/parameter-framework/example/Settings/strategy_for_stream.pfw
new file mode 100755
index 0000000..3940b9d
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/parameter-framework/example/Settings/strategy_for_stream.pfw
@@ -0,0 +1,20 @@
+domain: StrategyForStream
+
+ conf: Calibration
+ /Policy/policy/streams/voice_call/applicable_strategy/strategy = phone
+ #
+ # NOTE: SYSTEM stream uses MEDIA strategy because muting music and switching outputs
+ # while key clicks are played produces a poor result
+ #
+ /Policy/policy/streams/system/applicable_strategy/strategy = media
+ /Policy/policy/streams/ring/applicable_strategy/strategy = sonification
+ /Policy/policy/streams/music/applicable_strategy/strategy = media
+ /Policy/policy/streams/alarm/applicable_strategy/strategy = sonification
+ /Policy/policy/streams/notification/applicable_strategy/strategy = sonification_respectful
+ /Policy/policy/streams/bluetooth_sco/applicable_strategy/strategy = phone
+ /Policy/policy/streams/enforced_audible/applicable_strategy/strategy = enforced_audible
+ /Policy/policy/streams/dtmf/applicable_strategy/strategy = dtmf
+ /Policy/policy/streams/tts/applicable_strategy/strategy = transmitted_through_speaker
+ /Policy/policy/streams/accessibility/applicable_strategy/strategy = accessibility
+ /Policy/policy/streams/rerouting/applicable_strategy/strategy = rerouting
+
diff --git a/services/audiopolicy/engineconfigurable/parameter-framework/example/Settings/strategy_for_usage.pfw b/services/audiopolicy/engineconfigurable/parameter-framework/example/Settings/strategy_for_usage.pfw
new file mode 100644
index 0000000..3f5da13
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/parameter-framework/example/Settings/strategy_for_usage.pfw
@@ -0,0 +1,39 @@
+supDomain: SelectedStrategyForUsages
+
+ domain: Calibration
+ conf: Calibration
+ /Policy/policy/usages/unknown/applicable_strategy/strategy = media
+ /Policy/policy/usages/media/applicable_strategy/strategy = media
+ /Policy/policy/usages/voice_communication/applicable_strategy/strategy = phone
+ /Policy/policy/usages/voice_communication_signalling/applicable_strategy/strategy = dtmf
+ /Policy/policy/usages/alarm/applicable_strategy/strategy = sonification
+ /Policy/policy/usages/notification/applicable_strategy/strategy = sonification_respectful
+ /Policy/policy/usages/notification_telephony_ringtone/applicable_strategy/strategy = sonification
+ /Policy/policy/usages/notification_communication_request/applicable_strategy/strategy = sonification_respectful
+ /Policy/policy/usages/notification_communication_instant/applicable_strategy/strategy = sonification_respectful
+ /Policy/policy/usages/notification_communication_delayed/applicable_strategy/strategy = sonification_respectful
+ /Policy/policy/usages/notification_event/applicable_strategy/strategy = sonification_respectful
+ /Policy/policy/usages/assistance_navigation_guidance/applicable_strategy/strategy = media
+ /Policy/policy/usages/assistance_sonification/applicable_strategy/strategy = media
+ /Policy/policy/usages/game/applicable_strategy/strategy = media
+
+ domain: AssistanceAccessibility
+ conf: Sonification
+ #
+ # In case of Ring or Alarm stream type active, switching to sonification
+ # @todo: handle this dynamic case. As a WA, using Ringtone mode...
+ #
+ TelephonyMode Is RingTone
+
+ /Policy/policy/usages/assistance_accessibility/applicable_strategy/strategy = sonification
+
+ conf: Phone
+ ANY
+ TelephonyMode Is InCall
+ TelephonyMode Is InCommunication
+
+ /Policy/policy/usages/assistance_accessibility/applicable_strategy/strategy = phone
+
+ conf: Accessibility
+ /Policy/policy/usages/assistance_accessibility/applicable_strategy/strategy = accessibility
+
diff --git a/services/audiopolicy/engineconfigurable/parameter-framework/example/Settings/volumes.pfw b/services/audiopolicy/engineconfigurable/parameter-framework/example/Settings/volumes.pfw
new file mode 100644
index 0000000..1049564
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/parameter-framework/example/Settings/volumes.pfw
@@ -0,0 +1,545 @@
+supDomain: VolumeProfilesForStream
+ domain: Calibration
+ conf: Calibration
+ component: /Policy/policy/streams
+ component: voice_call/volume_profiles
+ component: headset_device_category/curve_points
+ 0/index = 0
+ 0/db_attenuation = -24.0
+ 1/index = 33
+ 1/db_attenuation = -18.0
+ 2/index = 66
+ 2/db_attenuation = -12.0
+ 3/index = 100
+ 3/db_attenuation = -6.0
+ component: speaker_device_category/curve_points
+ 0/index = 0
+ 0/db_attenuation = -24.0
+ 1/index = 33
+ 1/db_attenuation = -16.0
+ 2/index = 66
+ 2/db_attenuation = -8.0
+ 3/index = 100
+ 3/db_attenuation = 0.0
+ component: earpiece_device_category/curve_points
+ 0/index = 0
+ 0/db_attenuation = -24.0
+ 1/index = 33
+ 1/db_attenuation = -18.0
+ 2/index = 66
+ 2/db_attenuation = -12.0
+ 3/index = 100
+ 3/db_attenuation = -6.0
+ component: extmedia_device_category/curve_points
+ 0/index = 1
+ 0/db_attenuation = -58.0
+ 1/index = 33
+ 1/db_attenuation = -40.0
+ 2/index = 66
+ 2/db_attenuation = -17.0
+ 3/index = 100
+ 3/db_attenuation = 0.0
+
+ component: system/volume_profiles
+ component: headset_device_category/curve_points
+ 0/index = 1
+ 0/db_attenuation = -30.0
+ 1/index = 33
+ 1/db_attenuation = -26.0
+ 2/index = 66
+ 2/db_attenuation = -22.0
+ 3/index = 100
+ 3/db_attenuation = -18.0
+ component: speaker_device_category/curve_points
+ 0/index = 1
+ 0/db_attenuation = -24.0
+ 1/index = 33
+ 1/db_attenuation = -18.0
+ 2/index = 66
+ 2/db_attenuation = -12.0
+ 3/index = 100
+ 3/db_attenuation = -6.0
+ component: earpiece_device_category/curve_points
+ 0/index = 1
+ 0/db_attenuation = -24.0
+ 1/index = 33
+ 1/db_attenuation = -18.0
+ 2/index = 66
+ 2/db_attenuation = -12.0
+ 3/index = 100
+ 3/db_attenuation = -6.0
+ component: extmedia_device_category/curve_points
+ 0/index = 1
+ 0/db_attenuation = -58.0
+ 1/index = 33
+ 1/db_attenuation = -40.0
+ 2/index = 66
+ 2/db_attenuation = -21.0
+ 3/index = 100
+ 3/db_attenuation = -10.0
+
+ component: ring/volume_profiles
+ component: headset_device_category/curve_points
+ 0/index = 1
+ 0/db_attenuation = -49.5
+ 1/index = 33
+ 1/db_attenuation = -33.5
+ 2/index = 66
+ 2/db_attenuation = -17.0
+ 3/index = 100
+ 3/db_attenuation = 0.0
+ component: speaker_device_category/curve_points
+ 0/index = 1
+ 0/db_attenuation = -35.7
+ 1/index = 33
+ 1/db_attenuation = -26.1
+ 2/index = 66
+ 2/db_attenuation = -13.2
+ 3/index = 100
+ 3/db_attenuation = 0.0
+ component: earpiece_device_category/curve_points
+ 0/index = 1
+ 0/db_attenuation = -49.5
+ 1/index = 33
+ 1/db_attenuation = -33.5
+ 2/index = 66
+ 2/db_attenuation = -17.0
+ 3/index = 100
+ 3/db_attenuation = 0.0
+ component: extmedia_device_category/curve_points
+ 0/index = 1
+ 0/db_attenuation = -58.0
+ 1/index = 33
+ 1/db_attenuation = -40.0
+ 2/index = 66
+ 2/db_attenuation = -27.0
+ 3/index = 100
+ 3/db_attenuation = -10.0
+
+ component: music/volume_profiles
+ component: headset_device_category/curve_points
+ 0/index = 1
+ 0/db_attenuation = -58.0
+ 1/index = 33
+ 1/db_attenuation = -40.0
+ 2/index = 66
+ 2/db_attenuation = -17.0
+ 3/index = 100
+ 3/db_attenuation = 0.0
+ component: speaker_device_category/curve_points
+ 0/index = 1
+ 0/db_attenuation = -56.0
+ 1/index = 33
+ 1/db_attenuation = -34.0
+ 2/index = 66
+ 2/db_attenuation = -11.0
+ 3/index = 100
+ 3/db_attenuation = 0.0
+ component: earpiece_device_category/curve_points
+ 0/index = 1
+ 0/db_attenuation = -58.0
+ 1/index = 33
+ 1/db_attenuation = -40.0
+ 2/index = 66
+ 2/db_attenuation = -17.0
+ 3/index = 100
+ 3/db_attenuation = 0.0
+ component: extmedia_device_category/curve_points
+ 0/index = 1
+ 0/db_attenuation = -58.0
+ 1/index = 33
+ 1/db_attenuation = -40.0
+ 2/index = 66
+ 2/db_attenuation = -17.0
+ 3/index = 100
+ 3/db_attenuation = 0.0
+
+ component: alarm/volume_profiles
+ component: headset_device_category/curve_points
+ 0/index = 1
+ 0/db_attenuation = -49.5
+ 1/index = 33
+ 1/db_attenuation = -33.5
+ 2/index = 66
+ 2/db_attenuation = -17.0
+ 3/index = 100
+ 3/db_attenuation = 0.0
+ component: speaker_device_category/curve_points
+ 0/index = 1
+ 0/db_attenuation = -35.7
+ 1/index = 33
+ 1/db_attenuation = -26.1
+ 2/index = 66
+ 2/db_attenuation = -13.2
+ 3/index = 100
+ 3/db_attenuation = 0.0
+ component: earpiece_device_category/curve_points
+ 0/index = 1
+ 0/db_attenuation = -49.5
+ 1/index = 33
+ 1/db_attenuation = -33.5
+ 2/index = 66
+ 2/db_attenuation = -17.0
+ 3/index = 100
+ 3/db_attenuation = 0.0
+ component: extmedia_device_category/curve_points
+ 0/index = 1
+ 0/db_attenuation = -58.0
+ 1/index = 33
+ 1/db_attenuation = -40.0
+ 2/index = 66
+ 2/db_attenuation = -27.0
+ 3/index = 100
+ 3/db_attenuation = -10.0
+
+ component: notification/volume_profiles
+ component: headset_device_category/curve_points
+ 0/index = 1
+ 0/db_attenuation = -49.5
+ 1/index = 33
+ 1/db_attenuation = -33.5
+ 2/index = 66
+ 2/db_attenuation = -17.0
+ 3/index = 100
+ 3/db_attenuation = 0.0
+ component: speaker_device_category/curve_points
+ 0/index = 1
+ 0/db_attenuation = -35.7
+ 1/index = 33
+ 1/db_attenuation = -26.1
+ 2/index = 66
+ 2/db_attenuation = -13.2
+ 3/index = 100
+ 3/db_attenuation = 0.0
+ component: earpiece_device_category/curve_points
+ 0/index = 1
+ 0/db_attenuation = -49.5
+ 1/index = 33
+ 1/db_attenuation = -33.5
+ 2/index = 66
+ 2/db_attenuation = -17.0
+ 3/index = 100
+ 3/db_attenuation = 0.0
+ component: extmedia_device_category/curve_points
+ 0/index = 1
+ 0/db_attenuation = -58.0
+ 1/index = 33
+ 1/db_attenuation = -40.0
+ 2/index = 66
+ 2/db_attenuation = -27.0
+ 3/index = 100
+ 3/db_attenuation = -10.0
+
+ component: bluetooth_sco/volume_profiles
+ component: headset_device_category/curve_points
+ 0/index = 0
+ 0/db_attenuation = -24.0
+ 1/index = 33
+ 1/db_attenuation = -18.0
+ 2/index = 66
+ 2/db_attenuation = -12.0
+ 3/index = 100
+ 3/db_attenuation = -6.0
+ component: speaker_device_category/curve_points
+ 0/index = 0
+ 0/db_attenuation = -24.0
+ 1/index = 33
+ 1/db_attenuation = -16.0
+ 2/index = 66
+ 2/db_attenuation = -8.0
+ 3/index = 100
+ 3/db_attenuation = 0.0
+ component: earpiece_device_category/curve_points
+ 0/index = 0
+ 0/db_attenuation = -24.0
+ 1/index = 33
+ 1/db_attenuation = -18.0
+ 2/index = 66
+ 2/db_attenuation = -12.0
+ 3/index = 100
+ 3/db_attenuation = -6.0
+ component: extmedia_device_category/curve_points
+ 0/index = 1
+ 0/db_attenuation = -58.0
+ 1/index = 33
+ 1/db_attenuation = -40.0
+ 2/index = 66
+ 2/db_attenuation = -17.0
+ 3/index = 100
+ 3/db_attenuation = 0.0
+
+ component: enforced_audible/volume_profiles
+ component: headset_device_category/curve_points
+ 0/index = 1
+ 0/db_attenuation = -30.0
+ 1/index = 33
+ 1/db_attenuation = -26.0
+ 2/index = 66
+ 2/db_attenuation = -22.0
+ 3/index = 100
+ 3/db_attenuation = -18.0
+ component: speaker_device_category/curve_points
+ 0/index = 1
+ 0/db_attenuation = -24.0
+ 1/index = 33
+ 1/db_attenuation = -18.0
+ 2/index = 66
+ 2/db_attenuation = -12.0
+ 3/index = 100
+ 3/db_attenuation = -6.0
+ component: earpiece_device_category/curve_points
+ 0/index = 1
+ 0/db_attenuation = -24.0
+ 1/index = 33
+ 1/db_attenuation = -18.0
+ 2/index = 66
+ 2/db_attenuation = -12.0
+ 3/index = 100
+ 3/db_attenuation = -6.0
+ component: extmedia_device_category/curve_points
+ 0/index = 1
+ 0/db_attenuation = -58.0
+ 1/index = 33
+ 1/db_attenuation = -40.0
+ 2/index = 66
+ 2/db_attenuation = -27.0
+ 3/index = 100
+ 3/db_attenuation = -10.0
+
+ component: tts/volume_profiles
+ component: headset_device_category/curve_points
+ 0/index = 0
+ 0/db_attenuation = -96.0
+ 1/index = 1
+ 1/db_attenuation = -96.0
+ 2/index = 2
+ 2/db_attenuation = -96.0
+ 3/index = 100
+ 3/db_attenuation = -96.0
+ component: speaker_device_category/curve_points
+ 0/index = 0
+ 0/db_attenuation = -96.0
+ 1/index = 33
+ 1/db_attenuation = -68.0
+ 2/index = 66
+ 2/db_attenuation = -34.0
+ 3/index = 100
+ 3/db_attenuation = 0.0
+ component: earpiece_device_category/curve_points
+ 0/index = 0
+ 0/db_attenuation = -96.0
+ 1/index = 1
+ 1/db_attenuation = -96.0
+ 2/index = 2
+ 2/db_attenuation = -96.0
+ 3/index = 100
+ 3/db_attenuation = -96.0
+ component: extmedia_device_category/curve_points
+ 0/index = 0
+ 0/db_attenuation = -96.0
+ 1/index = 1
+ 1/db_attenuation = -96.0
+ 2/index = 2
+ 2/db_attenuation = -96.0
+ 3/index = 100
+ 3/db_attenuation = -96.0
+
+ component: accessibility/volume_profiles
+ component: headset_device_category/curve_points
+ 0/index = 1
+ 0/db_attenuation = -58.0
+ 1/index = 33
+ 1/db_attenuation = -40.0
+ 2/index = 66
+ 2/db_attenuation = -17.0
+ 3/index = 100
+ 3/db_attenuation = 0.0
+ component: speaker_device_category/curve_points
+ 0/index = 1
+ 0/db_attenuation = -56.0
+ 1/index = 33
+ 1/db_attenuation = -34.0
+ 2/index = 66
+ 2/db_attenuation = -11.0
+ 3/index = 100
+ 3/db_attenuation = 0.0
+ component: earpiece_device_category/curve_points
+ 0/index = 1
+ 0/db_attenuation = -58.0
+ 1/index = 33
+ 1/db_attenuation = -40.0
+ 2/index = 66
+ 2/db_attenuation = -17.0
+ 3/index = 100
+ 3/db_attenuation = 0.0
+ component: extmedia_device_category/curve_points
+ 0/index = 1
+ 0/db_attenuation = -58.0
+ 1/index = 33
+ 1/db_attenuation = -40.0
+ 2/index = 66
+ 2/db_attenuation = -17.0
+ 3/index = 100
+ 3/db_attenuation = 0.0
+
+ component: rerouting/volume_profiles
+ component: headset_device_category/curve_points
+ 0/index = 0
+ 0/db_attenuation = 0.0
+ 1/index = 1
+ 1/db_attenuation = 0.0
+ 2/index = 2
+ 2/db_attenuation = 0.0
+ 3/index = 100
+ 3/db_attenuation = 0.0
+ component: speaker_device_category/curve_points
+ 0/index = 0
+ 0/db_attenuation = 0.0
+ 1/index = 1
+ 1/db_attenuation = 0.0
+ 2/index = 2
+ 2/db_attenuation = 0.0
+ 3/index = 100
+ 3/db_attenuation = 0.0
+ component: earpiece_device_category/curve_points
+ 0/index = 0
+ 0/db_attenuation = 0.0
+ 1/index = 1
+ 1/db_attenuation = 0.0
+ 2/index = 2
+ 2/db_attenuation = 0.0
+ 3/index = 100
+ 3/db_attenuation = 0.0
+ component: extmedia_device_category/curve_points
+ 0/index = 0
+ 0/db_attenuation = 0.0
+ 1/index = 1
+ 1/db_attenuation = 0.0
+ 2/index = 2
+ 2/db_attenuation = 0.0
+ 3/index = 100
+ 3/db_attenuation = 0.0
+
+ component: patch/volume_profiles
+ component: headset_device_category/curve_points
+ 0/index = 0
+ 0/db_attenuation = 0.0
+ 1/index = 1
+ 1/db_attenuation = 0.0
+ 2/index = 2
+ 2/db_attenuation = 0.0
+ 3/index = 100
+ 3/db_attenuation = 0.0
+ component: speaker_device_category/curve_points
+ 0/index = 0
+ 0/db_attenuation = 0.0
+ 1/index = 1
+ 1/db_attenuation = 0.0
+ 2/index = 2
+ 2/db_attenuation = 0.0
+ 3/index = 100
+ 3/db_attenuation = 0.0
+ component: earpiece_device_category/curve_points
+ 0/index = 0
+ 0/db_attenuation = 0.0
+ 1/index = 1
+ 1/db_attenuation = 0.0
+ 2/index = 2
+ 2/db_attenuation = 0.0
+ 3/index = 100
+ 3/db_attenuation = 0.0
+ component: extmedia_device_category/curve_points
+ 0/index = 0
+ 0/db_attenuation = 0.0
+ 1/index = 1
+ 1/db_attenuation = 0.0
+ 2/index = 2
+ 2/db_attenuation = 0.0
+ 3/index = 100
+ 3/db_attenuation = 0.0
+
+ domain: Dtmf
+ conf: InCall
+ ANY
+ TelephonyMode Is InCall
+ TelephonyMode Is InCommunication
+
+ component: /Policy/policy/streams
+ component: dtmf/volume_profiles
+ component: headset_device_category/curve_points
+ 0/index = 1
+ 0/db_attenuation = -30.0
+ 1/index = 33
+ 1/db_attenuation = -26.0
+ 2/index = 66
+ 2/db_attenuation = -22.0
+ 3/index = 100
+ 3/db_attenuation = -18.0
+ component: speaker_device_category/curve_points
+ 0/index = 1
+ 0/db_attenuation = -24.0
+ 1/index = 33
+ 1/db_attenuation = -18.0
+ 2/index = 66
+ 2/db_attenuation = -12.0
+ 3/index = 100
+ 3/db_attenuation = -6.0
+ component: earpiece_device_category/curve_points
+ 0/index = 1
+ 0/db_attenuation = -24.0
+ 1/index = 33
+ 1/db_attenuation = -18.0
+ 2/index = 66
+ 2/db_attenuation = -12.0
+ 3/index = 100
+ 3/db_attenuation = -6.0
+ component: extmedia_device_category/curve_points
+ 0/index = 1
+ 0/db_attenuation = -58.0
+ 1/index = 33
+ 1/db_attenuation = -40.0
+ 2/index = 66
+ 2/db_attenuation = -27.0
+ 3/index = 100
+ 3/db_attenuation = -10.0
+
+ conf: OutOfCall
+ component: /Policy/policy/streams
+ component: dtmf/volume_profiles
+ component: headset_device_category/curve_points
+ 0/index = 0
+ 0/db_attenuation = -24.0
+ 1/index = 33
+ 1/db_attenuation = -18.0
+ 2/index = 66
+ 2/db_attenuation = -12.0
+ 3/index = 100
+ 3/db_attenuation = -6.0
+ component: speaker_device_category/curve_points
+ 0/index = 0
+ 0/db_attenuation = -24.0
+ 1/index = 33
+ 1/db_attenuation = -16.0
+ 2/index = 66
+ 2/db_attenuation = -8.0
+ 3/index = 100
+ 3/db_attenuation = 0.0
+ component: earpiece_device_category/curve_points
+ 0/index = 0
+ 0/db_attenuation = -24.0
+ 1/index = 33
+ 1/db_attenuation = -18.0
+ 2/index = 66
+ 2/db_attenuation = -12.0
+ 3/index = 100
+ 3/db_attenuation = -6.0
+ component: extmedia_device_category/curve_points
+ 0/index = 1
+ 0/db_attenuation = -58.0
+ 1/index = 33
+ 1/db_attenuation = -40.0
+ 2/index = 66
+ 2/db_attenuation = -17.0
+ 3/index = 100
+ 3/db_attenuation = 0.0
+
diff --git a/services/audiopolicy/engineconfigurable/parameter-framework/example/Structure/PolicyClass.xml b/services/audiopolicy/engineconfigurable/parameter-framework/example/Structure/PolicyClass.xml
new file mode 100755
index 0000000..296879f
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/parameter-framework/example/Structure/PolicyClass.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<SystemClass xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="../../Schemas/SystemClass.xsd" Name="Policy">
+ <SubsystemInclude Path="PolicySubsystem.xml"/>
+</SystemClass>
diff --git a/services/audiopolicy/engineconfigurable/parameter-framework/example/Structure/PolicySubsystem-CommonTypes.xml b/services/audiopolicy/engineconfigurable/parameter-framework/example/Structure/PolicySubsystem-CommonTypes.xml
new file mode 100755
index 0000000..821d6ad
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/parameter-framework/example/Structure/PolicySubsystem-CommonTypes.xml
@@ -0,0 +1,170 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ComponentTypeSet xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:xi="http://www.w3.org/2001/XInclude"
+ xsi:noNamespaceSchemaLocation="Schemas/ComponentTypeSet.xsd">
+ <!-- Output devices definition as a bitfield for the supported devices per output
+ profile. It must match with the output device enum parameter.
+ -->
+ <!--#################### GLOBAL COMPONENTS BEGIN ####################-->
+ <!-- Common Types defintion -->
+ <xi:include href="PolicySubsystem-Volume.xml"/>
+
+ <!--#################### GLOBAL COMPONENTS END ####################-->
+
+ <ComponentType Name="OutputDevicesMask" Description="32th bit is not allowed as dedicated
+ for input devices detection">
+ <BitParameterBlock Name="mask" Size="32">
+ <BitParameter Name="earpiece" Size="1" Pos="0"/>
+ <BitParameter Name="speaker" Size="1" Pos="1"/>
+ <BitParameter Name="wired_headset" Size="1" Pos="2"/>
+ <BitParameter Name="wired_headphone" Size="1" Pos="3"/>
+ <BitParameter Name="bluetooth_sco" Size="1" Pos="4"/>
+ <BitParameter Name="bluetooth_sco_headset" Size="1" Pos="5"/>
+ <BitParameter Name="bluetooth_sco_carkit" Size="1" Pos="6"/>
+ <BitParameter Name="bluetooth_a2dp" Size="1" Pos="7"/>
+ <BitParameter Name="bluetooth_a2dp_headphones" Size="1" Pos="8"/>
+ <BitParameter Name="bluetooth_a2dp_speaker" Size="1" Pos="9"/>
+ <BitParameter Name="hdmi" Size="1" Pos="10"/>
+ <BitParameter Name="angl_dock_headset" Size="1" Pos="11"/>
+ <BitParameter Name="dgtl_dock_headset" Size="1" Pos="12"/>
+ <BitParameter Name="usb_accessory" Size="1" Pos="13"/>
+ <BitParameter Name="usb_device" Size="1" Pos="14"/>
+ <BitParameter Name="remote_submix" Size="1" Pos="15"/>
+ <BitParameter Name="telephony_tx" Size="1" Pos="26"/>
+ <BitParameter Name="line" Size="1" Pos="17"/>
+ <BitParameter Name="hdmi_arc" Size="1" Pos="18"/>
+ <BitParameter Name="spdif" Size="1" Pos="19"/>
+ <BitParameter Name="fm" Size="1" Pos="20"/>
+ <BitParameter Name="aux_line" Size="1" Pos="21"/>
+ <BitParameter Name="speaker_safe" Size="1" Pos="22"/>
+ </BitParameterBlock>
+ </ComponentType>
+
+ <!-- Input devices definition as a bitfield for the supported devices per Input
+ profile. It must match with the Input device enum parameter.
+ -->
+ <ComponentType Name="InputDevicesMask">
+ <BitParameterBlock Name="mask" Size="32">
+ <BitParameter Name="communication" Size="1" Pos="0"/>
+ <BitParameter Name="ambient" Size="1" Pos="1"/>
+ <BitParameter Name="builtin_mic" Size="1" Pos="2"/>
+ <BitParameter Name="bluetooth_sco_headset" Size="1" Pos="3"/>
+ <BitParameter Name="wired_headset" Size="1" Pos="4"/>
+ <BitParameter Name="hdmi" Size="1" Pos="5"/>
+ <BitParameter Name="telephony_rx" Size="1" Pos="6"/>
+ <BitParameter Name="back_mic" Size="1" Pos="7"/>
+ <BitParameter Name="remote_submix" Size="1" Pos="8"/>
+ <BitParameter Name="anlg_dock_headset" Size="1" Pos="9"/>
+ <BitParameter Name="dgtl_dock_headset" Size="1" Pos="10"/>
+ <BitParameter Name="usb_accessory" Size="1" Pos="11"/>
+ <BitParameter Name="usb_device" Size="1" Pos="12"/>
+ <BitParameter Name="fm_tuner" Size="1" Pos="13"/>
+ <BitParameter Name="tv_tuner" Size="1" Pos="14"/>
+ <BitParameter Name="line" Size="1" Pos="15"/>
+ <BitParameter Name="spdif" Size="1" Pos="16"/>
+ <BitParameter Name="bluetooth_a2dp" Size="1" Pos="17"/>
+ <BitParameter Name="loopback" Size="1" Pos="18"/>
+ <BitParameter Name="in" Size="1" Pos="31"/>
+ </BitParameterBlock>
+ </ComponentType>
+
+ <ComponentType Name="OutputFlags"
+ Description="the audio output flags serve two purposes:
+ - when an AudioTrack is created they indicate a wish to be connected to an
+ output stream with attributes corresponding to the specified flags.
+ - when present in an output profile descriptor listed for a particular audio
+ hardware module, they indicate that an output stream can be opened that
+ supports the attributes indicated by the flags.
+ The audio policy manager will try to match the flags in the request
+ (when getOuput() is called) to an available output stream.">
+ <BitParameterBlock Name="mask" Size="32">
+ <BitParameter Name="direct" Size="1" Pos="0"/>
+ <BitParameter Name="primary" Size="1" Pos="1"/>
+ <BitParameter Name="fast" Size="1" Pos="2"/>
+ <BitParameter Name="deep_buffer" Size="1" Pos="3"/>
+ <BitParameter Name="compress_offload" Size="1" Pos="4"/>
+ <BitParameter Name="non_blocking" Size="1" Pos="5"/>
+ <BitParameter Name="hw_av_sync" Size="1" Pos="6"/>
+ </BitParameterBlock>
+ </ComponentType>
+
+ <ComponentType Name="InputFlags"
+ Description="The audio input flags are analogous to audio output flags.
+ Currently they are used only when an AudioRecord is created,
+ to indicate a preference to be connected to an input stream with
+ attributes corresponding to the specified flags.">
+ <BitParameterBlock Name="mask" Size="32">
+ <BitParameter Name="fast" Size="1" Pos="0"/>
+ <BitParameter Name="hw_hotword" Size="1" Pos="2"/>
+ </BitParameterBlock>
+ </ComponentType>
+
+ <ComponentType Name="InputSourcesMask" Description="The audio input source is also known
+ as the use case.">
+ <BitParameterBlock Name="mask" Size="32">
+ <BitParameter Name="default" Size="1" Pos="0"/>
+ <BitParameter Name="mic" Size="1" Pos="1"/>
+ <BitParameter Name="voice_uplink" Size="1" Pos="2"/>
+ <BitParameter Name="voice_downlink" Size="1" Pos="3"/>
+ <BitParameter Name="voice_call" Size="1" Pos="4"/>
+ <BitParameter Name="camcorder" Size="1" Pos="5"/>
+ <BitParameter Name="voice_recognition" Size="1" Pos="6"/>
+ <BitParameter Name="voice_communication" Size="1" Pos="7"/>
+ <BitParameter Name="remote_submix" Size="1" Pos="8"/>
+ <BitParameter Name="fm_tuner" Size="1" Pos="9"/>
+ <BitParameter Name="hotword" Size="1" Pos="10"/>
+ </BitParameterBlock>
+ </ComponentType>
+
+ <!-- Routing Strategy definition as an enumeration. Numerical value must match the value
+ of the routing strategy in policy header file. -->
+ <ComponentType Name="Strategy">
+ <EnumParameter Name="strategy" Size="32">
+ <ValuePair Literal="media" Numerical="0"/>
+ <ValuePair Literal="phone" Numerical="1"/>
+ <ValuePair Literal="sonification" Numerical="2"/>
+ <ValuePair Literal="sonification_respectful" Numerical="3"/>
+ <ValuePair Literal="dtmf" Numerical="4"/>
+ <ValuePair Literal="enforced_audible" Numerical="5"/>
+ <ValuePair Literal="transmitted_through_speaker" Numerical="6"/>
+ <ValuePair Literal="accessibility" Numerical="7"/>
+ <ValuePair Literal="rerouting" Numerical="8"/>
+ </EnumParameter>
+ </ComponentType>
+
+ <!--#################### STRATEGY COMMON TYPES BEGIN ####################-->
+
+ <ComponentType Name="StrategyConfig" Mapping="Strategy:'%1'">
+ <Component Name="selected_output_devices" Type="OutputDevicesMask"/>
+ </ComponentType>
+
+ <!--#################### STRATEGY COMMON TYPES END ####################-->
+
+ <!--#################### STREAM COMMON TYPES BEGIN ####################-->
+
+ <ComponentType Name="Stream">
+ <Component Name="applicable_strategy" Type="Strategy" Mapping="Stream:'%1'"/>
+ <Component Name="volume_profiles" Type="VolumeCurvesCategories"
+ Description="A volume profile is refered by the stream type."/>
+ </ComponentType>
+
+ <!--#################### STREAM COMMON TYPES END ####################-->
+
+ <!--#################### USAGE COMMON TYPES BEGIN ####################-->
+
+ <ComponentType Name="Usage">
+ <Component Name="applicable_strategy" Type="Strategy" Mapping="Usage:'%1'"/>
+ </ComponentType>
+
+ <!--#################### USAGE COMMON TYPES END ####################-->
+
+ <!--#################### INPUT SOURCE COMMON TYPES BEGIN ####################-->
+
+ <ComponentType Name="InputSource">
+ <Component Name="applicable_input_device" Type="InputDevicesMask"
+ Mapping="InputSource:'%1'" Description="Selected Input device"/>
+ </ComponentType>
+
+ <!--#################### INPUT SOURCE COMMON TYPES END ####################-->
+
+</ComponentTypeSet>
diff --git a/services/audiopolicy/engineconfigurable/parameter-framework/example/Structure/PolicySubsystem-Volume.xml b/services/audiopolicy/engineconfigurable/parameter-framework/example/Structure/PolicySubsystem-Volume.xml
new file mode 100755
index 0000000..cf39cc2
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/parameter-framework/example/Structure/PolicySubsystem-Volume.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ComponentTypeSet xmlns:xi="http://www.w3.org/2001/XInclude"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="Schemas/ComponentTypeSet.xsd">
+ <ComponentType Name="VolumeCurvePoints">
+ <ParameterBlock Name="curve_points" ArrayLength="4" Mapping="VolumeProfile:'%1'"
+ Description="4 points to define the volume attenuation curve, each
+ characterized by the volume index (from 0 to 100) at which
+ they apply, and the attenuation in dB at that index.
+ We use 100 steps to avoid rounding errors when computing
+ the volume">
+ <IntegerParameter Name="index" Size="32"/>
+ <FixedPointParameter Name="db_attenuation" Size="16" Integral="7" Fractional="8"/>
+ </ParameterBlock>
+ </ComponentType>
+
+ <ComponentType Name="VolumeCurvesCategories">
+ <Component Name="headset_device_category" Type="VolumeCurvePoints" Mapping="Category:0"/>
+ <Component Name="speaker_device_category" Type="VolumeCurvePoints" Mapping="Category:1"/>
+ <Component Name="earpiece_device_category" Type="VolumeCurvePoints" Mapping="Category:2"/>
+ <Component Name="extmedia_device_category" Type="VolumeCurvePoints" Mapping="Category:3"/>
+ </ComponentType>
+
+</ComponentTypeSet>
+
+
diff --git a/services/audiopolicy/engineconfigurable/parameter-framework/example/Structure/PolicySubsystem.xml b/services/audiopolicy/engineconfigurable/parameter-framework/example/Structure/PolicySubsystem.xml
new file mode 100755
index 0000000..b21f6ae
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/parameter-framework/example/Structure/PolicySubsystem.xml
@@ -0,0 +1,137 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Subsystem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:xi="http://www.w3.org/2001/XInclude"
+ xsi:noNamespaceSchemaLocation="Schemas/Subsystem.xsd"
+ Name="policy" Type="Policy" Endianness="Little">
+
+ <ComponentLibrary>
+ <!--#################### GLOBAL COMPONENTS BEGIN ####################-->
+ <!-- Common Types defintion -->
+ <xi:include href="PolicySubsystem-CommonTypes.xml"/>
+
+ <!--#################### GLOBAL COMPONENTS END ####################-->
+
+ <!--#################### STRATEGY BEGIN ####################-->
+
+ <ComponentType Name="Strategies" Description="Identifier must match the enum value to make
+ the link between the PolicyManager and PFW">
+ <Component Name="media" Type="StrategyConfig" Mapping="Amend1:Media,Identifier:0"/>
+ <Component Name="phone" Type="StrategyConfig" Mapping="Amend1:Phone,Identifier:1"/>
+ <Component Name="sonification" Type="StrategyConfig"
+ Mapping="Amend1:Sonification,Identifier:2"/>
+ <Component Name="sonification_respectful" Type="StrategyConfig"
+ Mapping="Amend1:SonificationRespectful,Identifier:3"/>
+ <Component Name="dtmf" Type="StrategyConfig" Mapping="Amend1:Dtmf,Identifier:4"/>
+ <Component Name="enforced_audible" Type="StrategyConfig"
+ Mapping="Amend1:EnforcedAudible,Identifier:5"/>
+ <Component Name="transmitted_through_speaker" Type="StrategyConfig"
+ Mapping="Amend1:TransmittedThroughSpeaker,Identifier:6"/>
+ <Component Name="accessibility" Type="StrategyConfig"
+ Mapping="Amend1:Accessibility,Identifier:7"/>
+ <Component Name="rerouting" Type="StrategyConfig"
+ Mapping="Amend1:Rerouting,Identifier:8"/>
+ </ComponentType>
+
+ <!--#################### STRATEGY END ####################-->
+
+ <!--#################### STREAM BEGIN ####################-->
+
+ <ComponentType Name="Streams" Description="associated to audio_stream_type_t definition,
+ identifier mapping must match the value of the enum">
+ <Component Name="voice_call" Type="Stream" Mapping="Amend1:VoiceCall,Identifier:0"/>
+ <Component Name="system" Type="Stream" Mapping="Amend1:System,Identifier:1"/>
+ <Component Name="ring" Type="Stream" Mapping="Amend1:Ring,Identifier:2"/>
+ <Component Name="music" Type="Stream" Mapping="Amend1:Music,Identifier:3"/>
+ <Component Name="alarm" Type="Stream" Mapping="Amend1:Alarm,Identifier:4"/>
+ <Component Name="notification" Type="Stream"
+ Mapping="Amend1:Notification,Identifier:5"/>
+ <Component Name="bluetooth_sco" Type="Stream"
+ Mapping="Amend1:BluetoothSco,Identifier:6"/>
+ <Component Name="enforced_audible" Type="Stream"
+ Mapping="Amend1:EnforceAudible,Identifier:7"
+ Description="Sounds that cannot be muted by user and must
+ be routed to speaker"/>
+ <Component Name="dtmf" Type="Stream" Mapping="Amend1:Dtmf,Identifier:8"/>
+ <Component Name="tts" Type="Stream" Mapping="Amend1:Tts,Identifier:9"
+ Description="Transmitted Through Speaker.
+ Plays over speaker only, silent on other devices"/>
+ <Component Name="accessibility" Type="Stream"
+ Mapping="Amend1:Accessibility,Identifier:10"
+ Description="For accessibility talk back prompts"/>
+ <Component Name="rerouting" Type="Stream" Mapping="Amend1:Rerouting,Identifier:11"
+ Description="For dynamic policy output mixes"/>
+ <Component Name="patch" Type="Stream" Mapping="Amend1:Patch,Identifier:12"
+ Description="For internal audio flinger tracks. Fixed volume"/>
+ </ComponentType>
+
+ <!--#################### STREAM END ####################-->
+
+ <!--#################### USAGE BEGIN ####################-->
+
+ <ComponentType Name="Usages" Description="associated to audio_stream_type_t definition,
+ identifier mapping must match the value of the enum">
+ <Component Name="unknown" Type="Usage" Mapping="Amend1:Unknown,Identifier:0"/>
+ <Component Name="media" Type="Usage" Mapping="Amend1:Media,Identifier:1"/>
+ <Component Name="voice_communication" Type="Usage"
+ Mapping="Amend1:VoiceCommunication,Identifier:2"/>
+ <Component Name="voice_communication_signalling" Type="Usage"
+ Mapping="Amend1:VoiceCommunicationSignalling,Identifier:3"/>
+ <Component Name="alarm" Type="Usage" Mapping="Amend1:Alarm,Identifier:4"/>
+ <Component Name="notification" Type="Usage" Mapping="Amend1:Notification,Identifier:5"/>
+ <Component Name="notification_telephony_ringtone" Type="Usage"
+ Mapping="Amend1:NotificationTelephonyRingtone,Identifier:6"/>
+ <Component Name="notification_communication_request" Type="Usage"
+ Mapping="Amend1:NotificationCommunicationRequest,Identifier:7"/>
+ <Component Name="notification_communication_instant" Type="Usage"
+ Mapping="Amend1:NotificationCommunicationInstant,Identifier:8"/>
+ <Component Name="notification_communication_delayed" Type="Usage"
+ Mapping="Amend1:NotificationCommunicationDelated,Identifier:9"/>
+ <Component Name="notification_event" Type="Usage"
+ Mapping="Amend1:NotificationEvent,Identifier:10"/>
+ <Component Name="assistance_accessibility" Type="Usage"
+ Mapping="Amend1:AssistanceAccessibility,Identifier:11"/>
+ <Component Name="assistance_navigation_guidance" Type="Usage"
+ Mapping="Amend1:AssistanceNavigationGuidance,Identifier:12"/>
+ <Component Name="assistance_sonification" Type="Usage"
+ Mapping="Amend1:AssistanceSonification,Identifier:13"/>
+ <Component Name="game" Type="Usage" Mapping="Amend1:BluetoothSco,Identifier:14"/>
+ <Component Name="virtual_source" Type="Usage"
+ Mapping="Amend1:VirtualSource,Identifier:15"/>
+ </ComponentType>
+
+ <!--#################### USAGE END ####################-->
+
+ <!--#################### INPUT SOURCE BEGIN ####################-->
+
+ <ComponentType Name="InputSources" Description="associated to audio_source_t definition,
+ identifier mapping must match the value of the enum">
+ <Component Name="default" Type="InputSource" Mapping="Amend1:Default,Identifier:0"/>
+ <Component Name="mic" Type="InputSource" Mapping="Amend1:Mic,Identifier:1"/>
+ <Component Name="voice_uplink" Type="InputSource"
+ Mapping="Amend1:VoiceUplink,Identifier:2"/>
+ <Component Name="voice_downlink" Type="InputSource"
+ Mapping="Amend1:VoiceDownlink,Identifier:3"/>
+ <Component Name="voice_call" Type="InputSource"
+ Mapping="Amend1:VoiceCall,Identifier:4"/>
+ <Component Name="camcorder" Type="InputSource" Mapping="Amend1:Camcorder,Identifier:5"/>
+ <Component Name="voice_recognition" Type="InputSource"
+ Mapping="Amend1:VoiceRecognition,Identifier:6"/>
+ <Component Name="voice_communication" Type="InputSource"
+ Mapping="Amend1:VoiceCommunication,Identifier:7"/>
+ <Component Name="remote_submix" Type="InputSource"
+ Mapping="Amend1:RemoteSubmix,Identifier:8"/>
+ <Component Name="fm_tuner" Type="InputSource" Mapping="Amend1:FmTuner,Identifier:1998"/>
+ <Component Name="hotword" Type="InputSource" Mapping="Amend1:Hotword,Identifier:1999"/>
+ </ComponentType>
+
+ <!--#################### INPUT SOURCE END ####################-->
+
+ </ComponentLibrary>
+
+ <InstanceDefinition>
+ <Component Name="streams" Type="Streams"/>
+ <Component Name="strategies" Type="Strategies"/>
+ <Component Name="input_sources" Type="InputSources"/>
+ <Component Name="usages" Type="Usages"/>
+ </InstanceDefinition>
+</Subsystem>
diff --git a/services/audiopolicy/engineconfigurable/parameter-framework/example/policy_criteria.txt b/services/audiopolicy/engineconfigurable/parameter-framework/example/policy_criteria.txt
new file mode 100755
index 0000000..ef06498
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/parameter-framework/example/policy_criteria.txt
@@ -0,0 +1,9 @@
+ExclusiveCriterion TelephonyMode : Normal RingTone InCall InCommunication
+InclusiveCriterion AvailableInputDevices : Communication Ambient BuiltinMic BluetoothScoHeadset WiredHeadset Hdmi TelephonyRx BackMic RemoteSubmix AnlgDockHeadset DgtlDockHeadset UsbAccessory UsbDevice FmTuner TvTuner Line Spdif BluetoothA2dp Loopback
+InclusiveCriterion AvailableOutputDevices : Earpiece Speaker WiredSpeaker WiredHeadset WiredHeadphone BluetoothSco BluetoothScoHeadset BluetoothScoCarkit BluetoothA2dp BluetoothA2dpHeadphones BluetoothA2dpSpeaker Hdmi AnlgDockHeadset DgtlDockHeadset UsbAccessory UsbDevice RemoteSubmix TelephonyTx Line HdmiArc Spdif Fm AuxLine SpeakerSafe
+ExclusiveCriterion ForceUseForCommunication : ForceNone ForceSpeaker ForceBtSco
+ExclusiveCriterion ForceUseForMedia : ForceNone ForceSpeaker ForceHeadphones ForceBtA2dp ForceWiredAccessory ForceAnalogDock ForceDigitalDock ForceNoBtA2dp ForceSystemEnforced
+ExclusiveCriterion ForceUseForRecord : ForceNone ForceBtSco ForceWiredAccessory
+ExclusiveCriterion ForceUseForDock : ForceNone ForceWiredAccessory ForceBtCarDock ForceBtDeskDock ForceAnalogDock ForceDigitalDock
+ExclusiveCriterion ForceUseForSystem : ForceNone ForceSystemEnforced
+ExclusiveCriterion ForceUseForHdmiSystemAudio : ForceNone ForceHdmiSystemEnforced
diff --git a/services/audiopolicy/engineconfigurable/parameter-framework/plugin/Android.mk b/services/audiopolicy/engineconfigurable/parameter-framework/plugin/Android.mk
new file mode 100755
index 0000000..a523656
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/parameter-framework/plugin/Android.mk
@@ -0,0 +1,36 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_TAGS := optional
+LOCAL_SRC_FILES := \
+ PolicySubsystemBuilder.cpp \
+ PolicySubsystem.cpp \
+ Strategy.cpp \
+ InputSource.cpp \
+ VolumeProfile.cpp \
+ Stream.cpp \
+ Usage.cpp
+
+LOCAL_CFLAGS += \
+ -Wall \
+ -Werror \
+ -Wextra \
+
+LOCAL_C_INCLUDES := \
+ $(TOPDIR)external/parameter-framework/parameter \
+ $(TOPDIR)frameworks/av/services/audiopolicy/common/include \
+ $(TOPDIR)frameworks/av/services/audiopolicy/engineconfigurable/include \
+ $(TOPDIR)frameworks/av/services/audiopolicy/engineconfigurable/interface \
+
+LOCAL_SHARED_LIBRARIES := \
+ libaudiopolicyengineconfigurable \
+ libparameter \
+ libxmlserializer \
+ liblog \
+
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE := libpolicy-subsystem
+
+include $(BUILD_SHARED_LIBRARY)
+
diff --git a/services/audiopolicy/engineconfigurable/parameter-framework/plugin/InputSource.cpp b/services/audiopolicy/engineconfigurable/parameter-framework/plugin/InputSource.cpp
new file mode 100755
index 0000000..497d555
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/parameter-framework/plugin/InputSource.cpp
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "InputSource.h"
+#include "PolicyMappingKeys.h"
+#include "PolicySubsystem.h"
+
+using std::string;
+
+InputSource::InputSource(const string &mappingValue,
+ CInstanceConfigurableElement *instanceConfigurableElement,
+ const CMappingContext &context)
+ : CFormattedSubsystemObject(instanceConfigurableElement,
+ mappingValue,
+ MappingKeyAmend1,
+ (MappingKeyAmendEnd - MappingKeyAmend1 + 1),
+ context),
+ mPolicySubsystem(static_cast<const PolicySubsystem *>(
+ instanceConfigurableElement->getBelongingSubsystem())),
+ mPolicyPluginInterface(mPolicySubsystem->getPolicyPluginInterface()),
+ mApplicableInputDevice(mDefaultApplicableInputDevice)
+{
+ mId = static_cast<audio_source_t>(context.getItemAsInteger(MappingKeyIdentifier));
+ // Declares the strategy to audio policy engine
+ mPolicyPluginInterface->addInputSource(getFormattedMappingValue(), mId);
+}
+
+bool InputSource::receiveFromHW(string & /*error*/)
+{
+ blackboardWrite(&mApplicableInputDevice, sizeof(mApplicableInputDevice));
+ return true;
+}
+
+bool InputSource::sendToHW(string & /*error*/)
+{
+ uint32_t applicableInputDevice;
+ blackboardRead(&applicableInputDevice, sizeof(applicableInputDevice));
+ mApplicableInputDevice = applicableInputDevice;
+ return mPolicyPluginInterface->setDeviceForInputSource(mId, mApplicableInputDevice);
+}
diff --git a/services/audiopolicy/engineconfigurable/parameter-framework/plugin/InputSource.h b/services/audiopolicy/engineconfigurable/parameter-framework/plugin/InputSource.h
new file mode 100755
index 0000000..67c5b50
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/parameter-framework/plugin/InputSource.h
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include "FormattedSubsystemObject.h"
+#include "InstanceConfigurableElement.h"
+#include "MappingContext.h"
+#include <AudioPolicyPluginInterface.h>
+#include <string>
+
+class PolicySubsystem;
+
+class InputSource : public CFormattedSubsystemObject
+{
+public:
+ InputSource(const std::string &mappingValue,
+ CInstanceConfigurableElement *instanceConfigurableElement,
+ const CMappingContext &context);
+
+protected:
+ virtual bool receiveFromHW(std::string &error);
+ virtual bool sendToHW(std::string &error);
+
+private:
+ const PolicySubsystem *mPolicySubsystem; /**< Route subsytem plugin. */
+
+ /**
+ * Interface to communicate with Audio Policy Engine.
+ */
+ android::AudioPolicyPluginInterface *mPolicyPluginInterface;
+
+ audio_source_t mId; /**< input source identifier to link with audio.h. */
+ uint32_t mApplicableInputDevice; /**< applicable input device for this strategy. */
+ static const uint32_t mDefaultApplicableInputDevice = 0; /**< default input device. */
+};
diff --git a/services/audiopolicy/engineconfigurable/parameter-framework/plugin/PolicyMappingKeys.h b/services/audiopolicy/engineconfigurable/parameter-framework/plugin/PolicyMappingKeys.h
new file mode 100755
index 0000000..53944e9
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/parameter-framework/plugin/PolicyMappingKeys.h
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+/**
+ * Mapping item types
+ */
+enum PolicyItemType
+{
+ MappingKeyName,
+ MappingKeyCategory,
+ MappingKeyIdentifier,
+ MappingKeyAmend1,
+ MappingKeyAmend2,
+ MappingKeyAmend3
+};
+
+static const uint8_t MappingKeyAmendEnd = MappingKeyAmend3;
diff --git a/services/audiopolicy/engineconfigurable/parameter-framework/plugin/PolicySubsystem.cpp b/services/audiopolicy/engineconfigurable/parameter-framework/plugin/PolicySubsystem.cpp
new file mode 100755
index 0000000..bf3906d
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/parameter-framework/plugin/PolicySubsystem.cpp
@@ -0,0 +1,99 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "PolicySubsystem.h"
+#include "SubsystemObjectFactory.h"
+#include "PolicyMappingKeys.h"
+#include "Strategy.h"
+#include "Stream.h"
+#include "InputSource.h"
+#include "VolumeProfile.h"
+#include "Usage.h"
+#include <AudioPolicyPluginInterface.h>
+#include <AudioPolicyEngineInstance.h>
+#include <utils/Log.h>
+
+using android::audio_policy::EngineInstance;
+
+const char *const PolicySubsystem::mKeyName = "Name";
+const char *const PolicySubsystem::mKeyIdentifier = "Identifier";
+const char *const PolicySubsystem::mKeyCategory = "Category";
+const char *const PolicySubsystem::mKeyAmend1 = "Amend1";
+const char *const PolicySubsystem::mKeyAmend2 = "Amend2";
+const char *const PolicySubsystem::mKeyAmend3 = "Amend3";
+
+
+const char *const PolicySubsystem::mStreamComponentName = "Stream";
+const char *const PolicySubsystem::mStrategyComponentName = "Strategy";
+const char *const PolicySubsystem::mInputSourceComponentName = "InputSource";
+const char *const PolicySubsystem::mUsageComponentName = "Usage";
+const char *const PolicySubsystem::mVolumeProfileComponentName = "VolumeProfile";
+
+PolicySubsystem::PolicySubsystem(const std::string &name)
+ : CSubsystem(name),
+ mPluginInterface(NULL)
+{
+ // Try to connect a Plugin Interface from Audio Policy Engine
+ EngineInstance *engineInstance = EngineInstance::getInstance();
+
+ ALOG_ASSERT(engineInstance != NULL, "NULL Plugin Interface");
+
+ // Retrieve the Route Interface
+ mPluginInterface = engineInstance->queryInterface<android::AudioPolicyPluginInterface>();
+ ALOG_ASSERT(mPluginInterface != NULL, "NULL Plugin Interface");
+
+ // Provide mapping keys to the core, necessary when parsing the XML Structure files.
+ addContextMappingKey(mKeyName);
+ addContextMappingKey(mKeyCategory);
+ addContextMappingKey(mKeyIdentifier);
+ addContextMappingKey(mKeyAmend1);
+ addContextMappingKey(mKeyAmend2);
+ addContextMappingKey(mKeyAmend3);
+
+ // Provide creators to upper layer
+ addSubsystemObjectFactory(
+ new TSubsystemObjectFactory<Stream>(
+ mStreamComponentName,
+ (1 << MappingKeyAmend1) | (1 << MappingKeyIdentifier))
+ );
+ addSubsystemObjectFactory(
+ new TSubsystemObjectFactory<Strategy>(
+ mStrategyComponentName,
+ (1 << MappingKeyAmend1) | (1 << MappingKeyIdentifier))
+ );
+ addSubsystemObjectFactory(
+ new TSubsystemObjectFactory<Usage>(
+ mUsageComponentName,
+ (1 << MappingKeyAmend1) | (1 << MappingKeyIdentifier))
+ );
+ addSubsystemObjectFactory(
+ new TSubsystemObjectFactory<InputSource>(
+ mInputSourceComponentName,
+ (1 << MappingKeyAmend1) | (1 << MappingKeyIdentifier))
+ );
+ addSubsystemObjectFactory(
+ new TSubsystemObjectFactory<VolumeProfile>(
+ mVolumeProfileComponentName,
+ (1 << MappingKeyAmend1) | (1 << MappingKeyIdentifier) | (1 << MappingKeyIdentifier))
+ );
+}
+
+// Retrieve Route interface
+android::AudioPolicyPluginInterface *PolicySubsystem::getPolicyPluginInterface() const
+{
+ ALOG_ASSERT(mPluginInterface != NULL, "NULL Plugin Interface");
+ return mPluginInterface;
+}
diff --git a/services/audiopolicy/engineconfigurable/parameter-framework/plugin/PolicySubsystem.h b/services/audiopolicy/engineconfigurable/parameter-framework/plugin/PolicySubsystem.h
new file mode 100755
index 0000000..3c26fe1
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/parameter-framework/plugin/PolicySubsystem.h
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include "Subsystem.h"
+#include <string>
+
+namespace android {
+
+class AudioPolicyPluginInterface;
+
+}
+
+class PolicySubsystem : public CSubsystem
+{
+public:
+ PolicySubsystem(const std::string &strName);
+
+ /**
+ * Retrieve Route Manager interface.
+ *
+ * @return RouteManager interface for the route plugin.
+ */
+ android::AudioPolicyPluginInterface *getPolicyPluginInterface() const;
+
+private:
+ /* Copy facilities are put private to disable copy. */
+ PolicySubsystem(const PolicySubsystem &object);
+ PolicySubsystem &operator=(const PolicySubsystem &object);
+
+ android::AudioPolicyPluginInterface *mPluginInterface; /**< Audio Policy Plugin Interface. */
+
+ static const char *const mKeyName; /**< name key mapping string. */
+ static const char *const mKeyIdentifier;
+ static const char *const mKeyCategory;
+
+ static const char *const mKeyAmend1; /**< amend1 key mapping string. */
+ static const char *const mKeyAmend2; /**< amend2 key mapping string. */
+ static const char *const mKeyAmend3; /**< amend3 key mapping string. */
+
+ static const char *const mStreamComponentName;
+ static const char *const mStrategyComponentName;
+ static const char *const mInputSourceComponentName;
+ static const char *const mUsageComponentName;
+ static const char *const mVolumeProfileComponentName;
+};
diff --git a/services/audiopolicy/engineconfigurable/parameter-framework/plugin/PolicySubsystemBuilder.cpp b/services/audiopolicy/engineconfigurable/parameter-framework/plugin/PolicySubsystemBuilder.cpp
new file mode 100755
index 0000000..b14d446
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/parameter-framework/plugin/PolicySubsystemBuilder.cpp
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "SubsystemLibrary.h"
+#include "NamedElementBuilderTemplate.h"
+#include "PolicySubsystem.h"
+
+static const char *const POLICY_SUBSYSTEM_NAME = "Policy";
+extern "C"
+{
+void getPOLICYSubsystemBuilder(CSubsystemLibrary *subsystemLibrary)
+{
+ subsystemLibrary->addElementBuilder(POLICY_SUBSYSTEM_NAME,
+ new TNamedElementBuilderTemplate<PolicySubsystem>());
+}
+}
diff --git a/services/audiopolicy/engineconfigurable/parameter-framework/plugin/Strategy.cpp b/services/audiopolicy/engineconfigurable/parameter-framework/plugin/Strategy.cpp
new file mode 100755
index 0000000..1848813
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/parameter-framework/plugin/Strategy.cpp
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "Strategy.h"
+#include "PolicyMappingKeys.h"
+#include "PolicySubsystem.h"
+
+using std::string;
+using android::routing_strategy;
+
+Strategy::Strategy(const string &mappingValue,
+ CInstanceConfigurableElement *instanceConfigurableElement,
+ const CMappingContext &context)
+ : CFormattedSubsystemObject(instanceConfigurableElement,
+ mappingValue,
+ MappingKeyAmend1,
+ (MappingKeyAmendEnd - MappingKeyAmend1 + 1),
+ context),
+ mPolicySubsystem(static_cast<const PolicySubsystem *>(
+ instanceConfigurableElement->getBelongingSubsystem())),
+ mPolicyPluginInterface(mPolicySubsystem->getPolicyPluginInterface()),
+ mApplicableOutputDevice(mDefaultApplicableOutputDevice)
+{
+ mId = static_cast<routing_strategy>(context.getItemAsInteger(MappingKeyIdentifier));
+
+ // Declares the strategy to audio policy engine
+ mPolicyPluginInterface->addStrategy(getFormattedMappingValue(), mId);
+}
+
+bool Strategy::receiveFromHW(string & /*error*/)
+{
+ blackboardWrite(&mApplicableOutputDevice, sizeof(mApplicableOutputDevice));
+ return true;
+}
+
+bool Strategy::sendToHW(string & /*error*/)
+{
+ uint32_t applicableOutputDevice;
+ blackboardRead(&applicableOutputDevice, sizeof(applicableOutputDevice));
+ return mPolicyPluginInterface->setDeviceForStrategy(mId, applicableOutputDevice);
+}
diff --git a/services/audiopolicy/engineconfigurable/parameter-framework/plugin/Strategy.h b/services/audiopolicy/engineconfigurable/parameter-framework/plugin/Strategy.h
new file mode 100755
index 0000000..9a9b3e4
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/parameter-framework/plugin/Strategy.h
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include "FormattedSubsystemObject.h"
+#include "InstanceConfigurableElement.h"
+#include "MappingContext.h"
+#include <AudioPolicyPluginInterface.h>
+#include <string>
+
+class PolicySubsystem;
+
+class Strategy : public CFormattedSubsystemObject
+{
+public:
+ Strategy(const std::string &mappingValue,
+ CInstanceConfigurableElement *instanceConfigurableElement,
+ const CMappingContext &context);
+
+protected:
+ virtual bool receiveFromHW(std::string &error);
+ virtual bool sendToHW(std::string &error);
+
+private:
+ const PolicySubsystem *mPolicySubsystem; /**< Route subsytem plugin. */
+
+ /**
+ * Interface to communicate with Audio Policy Engine.
+ */
+ android::AudioPolicyPluginInterface *mPolicyPluginInterface;
+
+ android::routing_strategy mId; /**< strategy identifier to link with audio.h.*/
+ uint32_t mApplicableOutputDevice; /**< applicable output device for this strategy. */
+ static const uint32_t mDefaultApplicableOutputDevice = 0; /**< default output device. */
+};
diff --git a/services/audiopolicy/engineconfigurable/parameter-framework/plugin/Stream.cpp b/services/audiopolicy/engineconfigurable/parameter-framework/plugin/Stream.cpp
new file mode 100755
index 0000000..575b0bb
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/parameter-framework/plugin/Stream.cpp
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "Stream.h"
+#include "PolicyMappingKeys.h"
+#include "PolicySubsystem.h"
+
+using std::string;
+using android::routing_strategy;
+
+Stream::Stream(const string &mappingValue,
+ CInstanceConfigurableElement *instanceConfigurableElement,
+ const CMappingContext &context)
+ : CFormattedSubsystemObject(instanceConfigurableElement,
+ mappingValue,
+ MappingKeyAmend1,
+ (MappingKeyAmendEnd - MappingKeyAmend1 + 1),
+ context),
+ mPolicySubsystem(static_cast<const PolicySubsystem *>(
+ instanceConfigurableElement->getBelongingSubsystem())),
+ mPolicyPluginInterface(mPolicySubsystem->getPolicyPluginInterface()),
+ mApplicableStrategy(mDefaultApplicableStrategy)
+{
+ mId = static_cast<audio_stream_type_t>(context.getItemAsInteger(MappingKeyIdentifier));
+
+ // Declares the strategy to audio policy engine
+ mPolicyPluginInterface->addStream(getFormattedMappingValue(), mId);
+}
+
+bool Stream::receiveFromHW(string & /*error*/)
+{
+ blackboardWrite(&mApplicableStrategy, sizeof(mApplicableStrategy));
+ return true;
+}
+
+bool Stream::sendToHW(string & /*error*/)
+{
+ uint32_t applicableStrategy;
+ blackboardRead(&applicableStrategy, sizeof(applicableStrategy));
+ mApplicableStrategy = applicableStrategy;
+ return mPolicyPluginInterface->setStrategyForStream(mId,
+ static_cast<routing_strategy>(mApplicableStrategy));
+}
diff --git a/services/audiopolicy/engineconfigurable/parameter-framework/plugin/Stream.h b/services/audiopolicy/engineconfigurable/parameter-framework/plugin/Stream.h
new file mode 100755
index 0000000..7d90c36
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/parameter-framework/plugin/Stream.h
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include "FormattedSubsystemObject.h"
+#include "InstanceConfigurableElement.h"
+#include "MappingContext.h"
+#include <AudioPolicyPluginInterface.h>
+#include <string>
+
+class PolicySubsystem;
+
+class Stream : public CFormattedSubsystemObject
+{
+public:
+ Stream(const std::string &mappingValue,
+ CInstanceConfigurableElement *instanceConfigurableElement,
+ const CMappingContext &context);
+
+protected:
+ virtual bool receiveFromHW(std::string &error);
+ virtual bool sendToHW(std::string &error);
+
+private:
+ const PolicySubsystem *mPolicySubsystem; /**< Route subsytem plugin. */
+
+ /**
+ * Interface to communicate with Audio Policy Engine.
+ */
+ android::AudioPolicyPluginInterface *mPolicyPluginInterface;
+
+ audio_stream_type_t mId; /**< stream type identifier to link with audio.h. */
+ uint32_t mApplicableStrategy; /**< applicable strategy for this stream. */
+ static const uint32_t mDefaultApplicableStrategy = 0; /**< default strategy. */
+};
diff --git a/services/audiopolicy/engineconfigurable/parameter-framework/plugin/Usage.cpp b/services/audiopolicy/engineconfigurable/parameter-framework/plugin/Usage.cpp
new file mode 100755
index 0000000..1916b9b
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/parameter-framework/plugin/Usage.cpp
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "Usage.h"
+#include "PolicyMappingKeys.h"
+#include "PolicySubsystem.h"
+
+using std::string;
+using android::routing_strategy;
+
+Usage::Usage(const string &mappingValue,
+ CInstanceConfigurableElement *instanceConfigurableElement,
+ const CMappingContext &context)
+ : CFormattedSubsystemObject(instanceConfigurableElement,
+ mappingValue,
+ MappingKeyAmend1,
+ (MappingKeyAmendEnd - MappingKeyAmend1 + 1),
+ context),
+ mPolicySubsystem(static_cast<const PolicySubsystem *>(
+ instanceConfigurableElement->getBelongingSubsystem())),
+ mPolicyPluginInterface(mPolicySubsystem->getPolicyPluginInterface()),
+ mApplicableStrategy(mDefaultApplicableStrategy)
+{
+ mId = static_cast<audio_usage_t>(context.getItemAsInteger(MappingKeyIdentifier));
+
+ // Declares the strategy to audio policy engine
+ mPolicyPluginInterface->addUsage(getFormattedMappingValue(), mId);
+}
+
+bool Usage::receiveFromHW(string & /*error*/)
+{
+ blackboardWrite(&mApplicableStrategy, sizeof(mApplicableStrategy));
+ return true;
+}
+
+bool Usage::sendToHW(string & /*error*/)
+{
+ uint32_t applicableStrategy;
+ blackboardRead(&applicableStrategy, sizeof(applicableStrategy));
+ mApplicableStrategy = applicableStrategy;
+ return mPolicyPluginInterface->setStrategyForUsage(mId,
+ static_cast<routing_strategy>(mApplicableStrategy));
+}
diff --git a/services/audiopolicy/engineconfigurable/parameter-framework/plugin/Usage.h b/services/audiopolicy/engineconfigurable/parameter-framework/plugin/Usage.h
new file mode 100755
index 0000000..8e9b638
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/parameter-framework/plugin/Usage.h
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include "FormattedSubsystemObject.h"
+#include "InstanceConfigurableElement.h"
+#include "MappingContext.h"
+#include <AudioPolicyPluginInterface.h>
+#include <string>
+
+class PolicySubsystem;
+
+class Usage : public CFormattedSubsystemObject
+{
+public:
+ Usage(const std::string &mappingValue,
+ CInstanceConfigurableElement *instanceConfigurableElement,
+ const CMappingContext &context);
+
+protected:
+ virtual bool receiveFromHW(std::string &error);
+ virtual bool sendToHW(std::string &error);
+
+private:
+ const PolicySubsystem *mPolicySubsystem; /**< Route subsytem plugin. */
+
+ /**
+ * Interface to communicate with Audio Policy Engine.
+ */
+ android::AudioPolicyPluginInterface *mPolicyPluginInterface;
+
+ audio_usage_t mId; /**< usage identifier to link with audio.h. */
+ uint32_t mApplicableStrategy; /**< applicable strategy for this usage. */
+ static const uint32_t mDefaultApplicableStrategy = 0; /**< default strategy. */
+};
diff --git a/services/audiopolicy/engineconfigurable/parameter-framework/plugin/VolumeProfile.cpp b/services/audiopolicy/engineconfigurable/parameter-framework/plugin/VolumeProfile.cpp
new file mode 100755
index 0000000..5c155c8
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/parameter-framework/plugin/VolumeProfile.cpp
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "VolumeProfile.h"
+#include "PolicyMappingKeys.h"
+#include "PolicySubsystem.h"
+#include "ParameterBlockType.h"
+#include <Volume.h>
+#include <math.h>
+
+using std::string;
+
+VolumeProfile::VolumeProfile(const string &mappingValue,
+ CInstanceConfigurableElement *instanceConfigurableElement,
+ const CMappingContext &context)
+ : CFormattedSubsystemObject(instanceConfigurableElement,
+ mappingValue,
+ MappingKeyAmend1,
+ (MappingKeyAmendEnd - MappingKeyAmend1 + 1),
+ context),
+ mPolicySubsystem(static_cast<const PolicySubsystem *>(
+ instanceConfigurableElement->getBelongingSubsystem())),
+ mPolicyPluginInterface(mPolicySubsystem->getPolicyPluginInterface())
+{
+ uint32_t categoryKey = context.getItemAsInteger(MappingKeyCategory);
+ if (categoryKey >= Volume::DEVICE_CATEGORY_CNT) {
+ mCategory = Volume::DEVICE_CATEGORY_SPEAKER;
+ } else {
+ mCategory = static_cast<Volume::device_category>(categoryKey);
+ }
+ mId = static_cast<audio_stream_type_t>(context.getItemAsInteger(MappingKeyIdentifier));
+
+ // (no exception support, defer the error)
+ if (instanceConfigurableElement->getType() != CInstanceConfigurableElement::EParameterBlock) {
+ return;
+ }
+ // Get actual element type
+ const CParameterBlockType *parameterType = static_cast<const CParameterBlockType *>(
+ instanceConfigurableElement->getTypeElement());
+ mPoints = parameterType->getArrayLength();
+}
+
+bool VolumeProfile::receiveFromHW(string & /*error*/)
+{
+ return true;
+}
+
+bool VolumeProfile::sendToHW(string & /*error*/)
+{
+ Point points[mPoints];
+ blackboardRead(&points, sizeof(Point) * mPoints);
+
+ VolumeCurvePoints pointsVector;
+ for (size_t i = 0; i < mPoints; i++) {
+ VolumeCurvePoint curvePoint;
+ curvePoint.mIndex = points[i].index;
+ curvePoint.mDBAttenuation = static_cast<float>(points[i].dbAttenuation) /
+ (1UL << gFractional);
+ pointsVector.push_back(curvePoint);
+ }
+ return mPolicyPluginInterface->setVolumeProfileForStream(mId, mCategory, pointsVector);
+}
diff --git a/services/audiopolicy/engineconfigurable/parameter-framework/plugin/VolumeProfile.h b/services/audiopolicy/engineconfigurable/parameter-framework/plugin/VolumeProfile.h
new file mode 100755
index 0000000..a00ae84
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/parameter-framework/plugin/VolumeProfile.h
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include "FormattedSubsystemObject.h"
+#include "InstanceConfigurableElement.h"
+#include "MappingContext.h"
+#include <Volume.h>
+#include <AudioPolicyPluginInterface.h>
+#include <string>
+
+class PolicySubsystem;
+
+class VolumeProfile : public CFormattedSubsystemObject
+{
+private:
+ struct Point
+ {
+ int index;
+ /** Volume is using FixedPointParameter until float parameters are available. */
+ int16_t dbAttenuation;
+ } __attribute__((packed));
+
+public:
+ VolumeProfile(const std::string &mappingValue,
+ CInstanceConfigurableElement *instanceConfigurableElement,
+ const CMappingContext &context);
+
+protected:
+ virtual bool receiveFromHW(std::string &error);
+ virtual bool sendToHW(std::string &error);
+
+private:
+ const PolicySubsystem *mPolicySubsystem; /**< Route subsytem plugin. */
+
+ /**
+ * Interface to communicate with Audio Policy Engine.
+ */
+ android::AudioPolicyPluginInterface *mPolicyPluginInterface;
+
+ /**
+ * volume profile identifier, which is in fact a stream type to link with audio.h.
+ */
+ audio_stream_type_t mId;
+
+ size_t mPoints;
+ Volume::device_category mCategory;
+
+ static const uint32_t gFractional = 8; /**< Beware to align with the structure. */
+};
diff --git a/services/audiopolicy/engineconfigurable/src/Collection.h b/services/audiopolicy/engineconfigurable/src/Collection.h
new file mode 100755
index 0000000..8f17b15
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/src/Collection.h
@@ -0,0 +1,163 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include "Element.h"
+#include "Stream.h"
+#include "Strategy.h"
+#include "Usage.h"
+#include "InputSource.h"
+#include <utils/Errors.h>
+#include <system/audio.h>
+#include <utils/Log.h>
+#include <map>
+#include <stdint.h>
+#include <string>
+
+namespace android
+{
+namespace audio_policy
+{
+
+/**
+ * Collection of policy element as a map indexed with a their UID type.
+ *
+ * @tparam Key type of the policy element indexing the collection.
+ * Policy Element supported are:
+ * - Strategy
+ * - Stream
+ * - InputSource
+ * - Usage.
+ */
+template <typename Key>
+class Collection : public std::map<Key, Element<Key> *>
+{
+private:
+ typedef Element<Key> T;
+ typedef typename std::map<Key, T *>::iterator CollectionIterator;
+ typedef typename std::map<Key, T *>::const_iterator CollectionConstIterator;
+
+public:
+ Collection()
+ {
+ collectionSupported();
+ }
+
+ /**
+ * Add a policy element to the collection. Policy elements are streams, strategies, input
+ * sources, ... Compile time error generated if called with not supported collection.
+ * It also set the key as the unique identifier of the policy element.
+ *
+ * @tparam Key indexing the collection of policy element.
+ * @param[in] name of the policy element to find.
+ * @param[in] key to be used to index this new policy element.
+ *
+ * @return NO_ERROR if the policy element has been successfully added to the collection.
+ */
+ status_t add(const std::string &name, Key key)
+ {
+ if ((*this).find(key) != (*this).end()) {
+ ALOGW("%s: element %s already added", __FUNCTION__, name.c_str());
+ return BAD_VALUE;
+ }
+ (*this)[key] = new T(name);
+ ALOGD("%s: adding element %s to collection", __FUNCTION__, name.c_str());
+ return (*this)[key]->setIdentifier(key);
+ }
+
+ /**
+ * Get a policy element from the collection by its key. Policy elements are streams, strategies,
+ * input sources, ... Compile time error generated if called with not supported collection.
+ *
+ * @tparam Key indexing the collection of policy element.
+ * @param[in] key of the policy element to find.
+ *
+ * @return valid pointer on policy element if found, NULL otherwise.
+ */
+ T *get(Key key) const
+ {
+ CollectionConstIterator it = (*this).find(key);
+ return (it == (*this).end()) ? NULL : it->second;
+ }
+
+ /**
+ * Find a policy element from the collection by its name. Policy elements are streams,
+ * strategies, input sources, ...
+ * Compile time error generated if called with not supported collection.
+ *
+ * @tparam Key indexing the collection of policy element.
+ * @param[in] name of the policy element to find.
+ * @param[in] elementsMap maps of policy elements to search into.
+ *
+ * @return valid pointer on element if found, NULL otherwise.
+ */
+ T *findByName(const std::string &name) const
+ {
+
+ CollectionConstIterator it;
+ for (it = (*this).begin(); it != (*this).end(); ++it) {
+ T *element = it->second;
+ if (element->getName() == name) {
+ return element;
+ }
+ }
+ return NULL;
+ }
+
+ /**
+ * Removes all the elements from the list and destroy them.
+ */
+ void clear()
+ {
+ CollectionIterator it;
+ for (it = (*this).begin(); it != (*this).end(); ++it) {
+ delete it->second;
+ }
+ (*this).clear();
+ }
+
+private:
+ /**
+ * provide a compile time error if no specialization is provided for a given type.
+ *
+ * @tparam T: type of the policyElement. Policy Element supported are:
+ * - Strategy
+ * - Stream
+ * - InputSource
+ * - Usage.
+ */
+ struct collectionSupported;
+};
+
+template <>
+struct Collection<audio_stream_type_t>::collectionSupported {};
+template <>
+struct Collection<std::string>::collectionSupported {};
+template <>
+struct Collection<audio_usage_t>::collectionSupported {};
+template <>
+struct Collection<audio_source_t>::collectionSupported {};
+template <>
+struct Collection<routing_strategy>::collectionSupported {};
+
+typedef Collection<routing_strategy> StrategyCollection;
+typedef Collection<audio_stream_type_t> StreamCollection;
+typedef Collection<audio_usage_t> UsageCollection;
+typedef Collection<audio_source_t> InputSourceCollection;
+
+} // namespace audio_policy
+} // namespace android
diff --git a/services/audiopolicy/engineconfigurable/src/Element.h b/services/audiopolicy/engineconfigurable/src/Element.h
new file mode 100755
index 0000000..52e77e5
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/src/Element.h
@@ -0,0 +1,99 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <stdint.h>
+#include <string>
+#include <utils/Errors.h>
+#include <system/audio.h>
+#include <utils/Log.h>
+
+namespace android
+{
+namespace audio_policy
+{
+
+template <typename Key>
+class Element
+{
+public:
+ Element(const std::string &name)
+ : mName(name)
+ {}
+ ~Element() {}
+
+ /**
+ * Returns identifier of this policy element
+ *
+ * @returns string representing the name of this policy element
+ */
+ const std::string &getName() const { return mName; }
+
+ /**
+ * Set the unique identifier for this policy element.
+ *
+ * @tparam Key type of the unique identifier.
+ * @param[in] identifier to be set.
+ *
+ * @return NO_ERROR if the identifier is valid and set correctly, error code otherwise.
+ */
+ status_t setIdentifier(Key identifier)
+ {
+ mIdentifier = identifier;
+ return NO_ERROR;
+ }
+
+ /**
+ * @return the unique identifier of this policy element.
+ */
+ const Key &getIdentifier() const { return mIdentifier; }
+
+ /**
+ * A Policy element may implement getter/setter function for a given property.
+ * Property may be routing_strategy, audio_stream_type_t, audio_usage_t, audio_source_t
+ * or a string.
+ *
+ * @tparam Property for which this policy element has setter / getter.
+ * @return the property kept track by this policy base element.
+ */
+ template <typename Property>
+ Property get() const;
+
+ /**
+ * A Policy element may implement getter/setter function for a given property.
+ * Property may be routing_strategy, audio_stream_type_t, audio_usage_t, audio_source_t
+ * or a string.
+ *
+ * @tparam Property for which this policy element has setter / getter.
+ *
+ * @param[in] property value to be assigned for this policy base element.
+ *
+ * @return the property kept track by this policy base element.
+ */
+ template <typename Property>
+ status_t set(Property property);
+
+private:
+ /* Copy facilities are put private to disable copy. */
+ Element(const Element &object);
+ Element &operator=(const Element &object);
+
+ std::string mName; /**< Unique literal Identifier of a policy base element*/
+ Key mIdentifier; /**< Unique numerical Identifier of a policy base element*/
+};
+} // namespace audio_policy
+} // namespace android
diff --git a/services/audiopolicy/engineconfigurable/src/Engine.cpp b/services/audiopolicy/engineconfigurable/src/Engine.cpp
new file mode 100755
index 0000000..733cdf6
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/src/Engine.cpp
@@ -0,0 +1,270 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "APM::AudioPolicyEngine"
+//#define LOG_NDEBUG 0
+
+//#define VERY_VERBOSE_LOGGING
+#ifdef VERY_VERBOSE_LOGGING
+#define ALOGVV ALOGV
+#else
+#define ALOGVV(a...) do { } while(0)
+#endif
+
+#include "Engine.h"
+#include "Strategy.h"
+#include "Stream.h"
+#include "InputSource.h"
+#include "Usage.h"
+#include <policy.h>
+#include <ParameterManagerWrapper.h>
+
+using std::string;
+using std::map;
+
+namespace android
+{
+namespace audio_policy
+{
+template <>
+StrategyCollection &Engine::getCollection<routing_strategy>()
+{
+ return mStrategyCollection;
+}
+template <>
+StreamCollection &Engine::getCollection<audio_stream_type_t>()
+{
+ return mStreamCollection;
+}
+template <>
+UsageCollection &Engine::getCollection<audio_usage_t>()
+{
+ return mUsageCollection;
+}
+template <>
+InputSourceCollection &Engine::getCollection<audio_source_t>()
+{
+ return mInputSourceCollection;
+}
+
+template <>
+const StrategyCollection &Engine::getCollection<routing_strategy>() const
+{
+ return mStrategyCollection;
+}
+template <>
+const StreamCollection &Engine::getCollection<audio_stream_type_t>() const
+{
+ return mStreamCollection;
+}
+template <>
+const UsageCollection &Engine::getCollection<audio_usage_t>() const
+{
+ return mUsageCollection;
+}
+template <>
+const InputSourceCollection &Engine::getCollection<audio_source_t>() const
+{
+ return mInputSourceCollection;
+}
+
+Engine::Engine()
+ : mManagerInterface(this),
+ mPluginInterface(this),
+ mPolicyParameterMgr(new ParameterManagerWrapper()),
+ mApmObserver(NULL)
+{
+}
+
+Engine::~Engine()
+{
+ mStrategyCollection.clear();
+ mStreamCollection.clear();
+ mInputSourceCollection.clear();
+ mUsageCollection.clear();
+}
+
+
+void Engine::setObserver(AudioPolicyManagerObserver *observer)
+{
+ ALOG_ASSERT(observer != NULL, "Invalid Audio Policy Manager observer");
+ mApmObserver = observer;
+}
+
+status_t Engine::initCheck()
+{
+ if (mPolicyParameterMgr != NULL && mPolicyParameterMgr->start() != NO_ERROR) {
+ ALOGE("%s: could not start Policy PFW", __FUNCTION__);
+ delete mPolicyParameterMgr;
+ mPolicyParameterMgr = NULL;
+ return NO_INIT;
+ }
+ return (mApmObserver != NULL)? NO_ERROR : NO_INIT;
+}
+
+bool Engine::setVolumeProfileForStream(const audio_stream_type_t &streamType,
+ Volume::device_category deviceCategory,
+ const VolumeCurvePoints &points)
+{
+ Stream *stream = getFromCollection<audio_stream_type_t>(streamType);
+ if (stream == NULL) {
+ ALOGE("%s: stream %d not found", __FUNCTION__, streamType);
+ return false;
+ }
+ return stream->setVolumeProfile(deviceCategory, points) == NO_ERROR;
+}
+
+template <typename Key>
+Element<Key> *Engine::getFromCollection(const Key &key) const
+{
+ const Collection<Key> collection = getCollection<Key>();
+ return collection.get(key);
+}
+
+template <typename Key>
+status_t Engine::add(const std::string &name, const Key &key)
+{
+ Collection<Key> &collection = getCollection<Key>();
+ return collection.add(name, key);
+}
+
+template <typename Property, typename Key>
+Property Engine::getPropertyForKey(Key key) const
+{
+ Element<Key> *element = getFromCollection<Key>(key);
+ if (element == NULL) {
+ ALOGE("%s: Element not found within collection", __FUNCTION__);
+ return static_cast<Property>(0);
+ }
+ return element->template get<Property>();
+}
+
+routing_strategy Engine::ManagerInterfaceImpl::getStrategyForUsage(audio_usage_t usage)
+{
+ const SwAudioOutputCollection &outputs = mPolicyEngine->mApmObserver->getOutputs();
+
+ if (usage == AUDIO_USAGE_ASSISTANCE_ACCESSIBILITY &&
+ (outputs.isStreamActive(AUDIO_STREAM_RING) ||
+ outputs.isStreamActive(AUDIO_STREAM_ALARM))) {
+ return STRATEGY_SONIFICATION;
+ }
+ return mPolicyEngine->getPropertyForKey<routing_strategy, audio_usage_t>(usage);
+}
+
+audio_devices_t Engine::ManagerInterfaceImpl::getDeviceForStrategy(routing_strategy strategy) const
+{
+ const SwAudioOutputCollection &outputs = mPolicyEngine->mApmObserver->getOutputs();
+
+ /** This is the only case handled programmatically because the PFW is unable to know the
+ * activity of streams.
+ *
+ * -While media is playing on a remote device, use the the sonification behavior.
+ * Note that we test this usecase before testing if media is playing because
+ * the isStreamActive() method only informs about the activity of a stream, not
+ * if it's for local playback. Note also that we use the same delay between both tests
+ *
+ * -When media is not playing anymore, fall back on the sonification behavior
+ */
+ if (strategy == STRATEGY_SONIFICATION_RESPECTFUL &&
+ !is_state_in_call(getPhoneState()) &&
+ !outputs.isStreamActiveRemotely(AUDIO_STREAM_MUSIC,
+ SONIFICATION_RESPECTFUL_AFTER_MUSIC_DELAY) &&
+ outputs.isStreamActive(AUDIO_STREAM_MUSIC, SONIFICATION_RESPECTFUL_AFTER_MUSIC_DELAY)) {
+ return mPolicyEngine->getPropertyForKey<audio_devices_t, routing_strategy>(STRATEGY_MEDIA);
+ }
+ return mPolicyEngine->getPropertyForKey<audio_devices_t, routing_strategy>(strategy);
+}
+
+template <typename Property, typename Key>
+bool Engine::setPropertyForKey(const Property &property, const Key &key)
+{
+ Element<Key> *element = getFromCollection<Key>(key);
+ if (element == NULL) {
+ ALOGE("%s: Element not found within collection", __FUNCTION__);
+ return BAD_VALUE;
+ }
+ return element->template set<Property>(property) == NO_ERROR;
+}
+
+float Engine::volIndexToDb(Volume::device_category category,
+ audio_stream_type_t streamType,
+ int indexInUi)
+{
+ Stream *stream = getFromCollection<audio_stream_type_t>(streamType);
+ if (stream == NULL) {
+ ALOGE("%s: Element indexed by key=%d not found", __FUNCTION__, streamType);
+ return 1.0f;
+ }
+ return stream->volIndexToDb(category, indexInUi);
+}
+
+status_t Engine::initStreamVolume(audio_stream_type_t streamType,
+ int indexMin, int indexMax)
+{
+ Stream *stream = getFromCollection<audio_stream_type_t>(streamType);
+ if (stream == NULL) {
+ ALOGE("%s: Stream Type %d not found", __FUNCTION__, streamType);
+ return BAD_TYPE;
+ }
+ mApmObserver->getStreamDescriptors().setVolumeIndexMin(streamType, indexMin);
+ mApmObserver->getStreamDescriptors().setVolumeIndexMax(streamType, indexMax);
+
+ return stream->initVolume(indexMin, indexMax);
+}
+
+status_t Engine::setPhoneState(audio_mode_t mode)
+{
+ return mPolicyParameterMgr->setPhoneState(mode);
+}
+
+audio_mode_t Engine::getPhoneState() const
+{
+ return mPolicyParameterMgr->getPhoneState();
+}
+
+status_t Engine::setForceUse(audio_policy_force_use_t usage,
+ audio_policy_forced_cfg_t config)
+{
+ return mPolicyParameterMgr->setForceUse(usage, config);
+}
+
+audio_policy_forced_cfg_t Engine::getForceUse(audio_policy_force_use_t usage) const
+{
+ return mPolicyParameterMgr->getForceUse(usage);
+}
+
+status_t Engine::setDeviceConnectionState(audio_devices_t devices, audio_policy_dev_state_t state,
+ const char *deviceAddress)
+{
+ return mPolicyParameterMgr->setDeviceConnectionState(devices, state, deviceAddress);
+}
+
+template <>
+AudioPolicyManagerInterface *Engine::queryInterface()
+{
+ return &mManagerInterface;
+}
+
+template <>
+AudioPolicyPluginInterface *Engine::queryInterface()
+{
+ return &mPluginInterface;
+}
+
+} // namespace audio_policy
+} // namespace android
+
+
diff --git a/services/audiopolicy/engineconfigurable/src/Engine.h b/services/audiopolicy/engineconfigurable/src/Engine.h
new file mode 100755
index 0000000..6fa7a13
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/src/Engine.h
@@ -0,0 +1,225 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+
+#include <AudioPolicyManagerInterface.h>
+#include <AudioPolicyPluginInterface.h>
+#include "Collection.h"
+
+namespace android
+{
+class AudioPolicyManagerObserver;
+
+namespace audio_policy
+{
+
+class ParameterManagerWrapper;
+class VolumeProfile;
+
+class Engine
+{
+public:
+ Engine();
+ virtual ~Engine();
+
+ template <class RequestedInterface>
+ RequestedInterface *queryInterface();
+
+private:
+ /// Interface members
+ class ManagerInterfaceImpl : public AudioPolicyManagerInterface
+ {
+ public:
+ ManagerInterfaceImpl(Engine *policyEngine)
+ : mPolicyEngine(policyEngine) {}
+
+ virtual android::status_t initCheck()
+ {
+ return mPolicyEngine->initCheck();
+ }
+ virtual void setObserver(AudioPolicyManagerObserver *observer)
+ {
+ mPolicyEngine->setObserver(observer);
+ }
+ virtual audio_devices_t getDeviceForInputSource(audio_source_t inputSource) const
+ {
+ return mPolicyEngine->getPropertyForKey<audio_devices_t, audio_source_t>(inputSource);
+ }
+ virtual audio_devices_t getDeviceForStrategy(routing_strategy stategy) const;
+ virtual routing_strategy getStrategyForStream(audio_stream_type_t stream)
+ {
+ return mPolicyEngine->getPropertyForKey<routing_strategy, audio_stream_type_t>(stream);
+ }
+ virtual routing_strategy getStrategyForUsage(audio_usage_t usage);
+ virtual status_t setPhoneState(audio_mode_t mode)
+ {
+ return mPolicyEngine->setPhoneState(mode);
+ }
+ virtual audio_mode_t getPhoneState() const
+ {
+ return mPolicyEngine->getPhoneState();
+ }
+ virtual status_t setForceUse(audio_policy_force_use_t usage,
+ audio_policy_forced_cfg_t config)
+ {
+ return mPolicyEngine->setForceUse(usage, config);
+ }
+ virtual audio_policy_forced_cfg_t getForceUse(audio_policy_force_use_t usage) const
+ {
+ return mPolicyEngine->getForceUse(usage);
+ }
+ virtual android::status_t setDeviceConnectionState(const sp<DeviceDescriptor> devDesc,
+ audio_policy_dev_state_t state)
+ {
+ return mPolicyEngine->setDeviceConnectionState(devDesc->type(), state,
+ devDesc->mAddress);
+ }
+ virtual status_t initStreamVolume(audio_stream_type_t stream,
+ int indexMin, int indexMax)
+ {
+ return mPolicyEngine->initStreamVolume(stream, indexMin, indexMax);
+ }
+
+ virtual void initializeVolumeCurves(bool /*isSpeakerDrcEnabled*/) {}
+
+ virtual float volIndexToDb(Volume::device_category deviceCategory,
+ audio_stream_type_t stream,
+ int indexInUi)
+ {
+ return mPolicyEngine->volIndexToDb(deviceCategory, stream, indexInUi);
+ }
+
+ private:
+ Engine *mPolicyEngine;
+ } mManagerInterface;
+
+ class PluginInterfaceImpl : public AudioPolicyPluginInterface
+ {
+ public:
+ PluginInterfaceImpl(Engine *policyEngine)
+ : mPolicyEngine(policyEngine) {}
+
+ virtual status_t addStrategy(const std::string &name, routing_strategy strategy)
+ {
+ return mPolicyEngine->add<routing_strategy>(name, strategy);
+ }
+ virtual status_t addStream(const std::string &name, audio_stream_type_t stream)
+ {
+ return mPolicyEngine->add<audio_stream_type_t>(name, stream);
+ }
+ virtual status_t addUsage(const std::string &name, audio_usage_t usage)
+ {
+ return mPolicyEngine->add<audio_usage_t>(name, usage);
+ }
+ virtual status_t addInputSource(const std::string &name, audio_source_t source)
+ {
+ return mPolicyEngine->add<audio_source_t>(name, source);
+ }
+ virtual bool setDeviceForStrategy(const routing_strategy &strategy, audio_devices_t devices)
+ {
+ return mPolicyEngine->setPropertyForKey<audio_devices_t, routing_strategy>(devices,
+ strategy);
+ }
+ virtual bool setStrategyForStream(const audio_stream_type_t &stream,
+ routing_strategy strategy)
+ {
+ return mPolicyEngine->setPropertyForKey<routing_strategy, audio_stream_type_t>(strategy,
+ stream);
+ }
+ virtual bool setVolumeProfileForStream(const audio_stream_type_t &stream,
+ Volume::device_category deviceCategory,
+ const VolumeCurvePoints &points)
+ {
+ return mPolicyEngine->setVolumeProfileForStream(stream, deviceCategory, points);
+ }
+
+ virtual bool setStrategyForUsage(const audio_usage_t &usage, routing_strategy strategy)
+ {
+ return mPolicyEngine->setPropertyForKey<routing_strategy, audio_usage_t>(strategy,
+ usage);
+ }
+ virtual bool setDeviceForInputSource(const audio_source_t &inputSource,
+ audio_devices_t device)
+ {
+ return mPolicyEngine->setPropertyForKey<audio_devices_t, audio_source_t>(device,
+ inputSource);
+ }
+
+ private:
+ Engine *mPolicyEngine;
+ } mPluginInterface;
+
+private:
+ /* Copy facilities are put private to disable copy. */
+ Engine(const Engine &object);
+ Engine &operator=(const Engine &object);
+
+ void setObserver(AudioPolicyManagerObserver *observer);
+
+ bool setVolumeProfileForStream(const audio_stream_type_t &stream,
+ Volume::device_category deviceCategory,
+ const VolumeCurvePoints &points);
+
+ status_t initCheck();
+ status_t setPhoneState(audio_mode_t mode);
+ audio_mode_t getPhoneState() const;
+ status_t setForceUse(audio_policy_force_use_t usage, audio_policy_forced_cfg_t config);
+ audio_policy_forced_cfg_t getForceUse(audio_policy_force_use_t usage) const;
+ status_t setDeviceConnectionState(audio_devices_t devices, audio_policy_dev_state_t state,
+ const char *deviceAddress);
+
+ float volIndexToDb(Volume::device_category category,
+ audio_stream_type_t stream,
+ int indexInUi);
+ status_t initStreamVolume(audio_stream_type_t stream, int indexMin, int indexMax);
+
+ StrategyCollection mStrategyCollection; /**< Strategies indexed by their enum id. */
+ StreamCollection mStreamCollection; /**< Streams indexed by their enum id. */
+ UsageCollection mUsageCollection; /**< Usages indexed by their enum id. */
+ InputSourceCollection mInputSourceCollection; /**< Input sources indexed by their enum id. */
+
+ template <typename Key>
+ status_t add(const std::string &name, const Key &key);
+
+ template <typename Key>
+ Element<Key> *getFromCollection(const Key &key) const;
+
+ template <typename Key>
+ const Collection<Key> &getCollection() const;
+
+ template <typename Key>
+ Collection<Key> &getCollection();
+
+ template <typename Property, typename Key>
+ Property getPropertyForKey(Key key) const;
+
+ template <typename Property, typename Key>
+ bool setPropertyForKey(const Property &property, const Key &key);
+
+ /**
+ * Policy Parameter Manager hidden through a wrapper.
+ */
+ ParameterManagerWrapper *mPolicyParameterMgr;
+
+ AudioPolicyManagerObserver *mApmObserver;
+};
+
+}; // namespace audio_policy
+
+}; // namespace android
+
diff --git a/services/audiopolicy/engineconfigurable/src/EngineInstance.cpp b/services/audiopolicy/engineconfigurable/src/EngineInstance.cpp
new file mode 100755
index 0000000..9aa89b2
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/src/EngineInstance.cpp
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <AudioPolicyManagerInterface.h>
+#include <AudioPolicyPluginInterface.h>
+#include "AudioPolicyEngineInstance.h"
+#include "Engine.h"
+
+using std::string;
+
+namespace android
+{
+namespace audio_policy
+{
+
+EngineInstance::EngineInstance()
+{
+}
+
+EngineInstance *EngineInstance::getInstance()
+{
+ static EngineInstance instance;
+ return &instance;
+}
+
+EngineInstance::~EngineInstance()
+{
+}
+
+Engine *EngineInstance::getEngine() const
+{
+ static Engine engine;
+ return &engine;
+}
+
+template <>
+AudioPolicyManagerInterface *EngineInstance::queryInterface() const
+{
+ return getEngine()->queryInterface<AudioPolicyManagerInterface>();
+}
+
+template <>
+AudioPolicyPluginInterface *EngineInstance::queryInterface() const
+{
+ return getEngine()->queryInterface<AudioPolicyPluginInterface>();
+}
+
+} // namespace audio_policy
+} // namespace android
+
diff --git a/services/audiopolicy/engineconfigurable/src/InputSource.cpp b/services/audiopolicy/engineconfigurable/src/InputSource.cpp
new file mode 100755
index 0000000..9ff1538
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/src/InputSource.cpp
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "APM::AudioPolicyEngine/InputSource"
+
+#include "InputSource.h"
+
+using std::string;
+
+namespace android
+{
+namespace audio_policy
+{
+status_t Element<audio_source_t>::setIdentifier(audio_source_t identifier)
+{
+ if (identifier > AUDIO_SOURCE_MAX && identifier != AUDIO_SOURCE_HOTWORD) {
+ return BAD_VALUE;
+ }
+ mIdentifier = identifier;
+ ALOGD("%s: InputSource %s identifier 0x%X", __FUNCTION__, getName().c_str(), identifier);
+ return NO_ERROR;
+}
+
+/**
+* Set the device associated to this source.
+* It checks if the input device is valid but allows to set a NONE device
+* (i.e. only the IN BIT is set).
+*
+* @param[in] devices selected for the given input source.
+* @tparam audio_devices_t: Applicable input device for this input source.
+*
+* @return NO_ERROR if the device is either valid or none, error code otherwise.
+*/
+template <>
+status_t Element<audio_source_t>::set(audio_devices_t devices)
+{
+ if (!audio_is_input_device(devices) && devices != AUDIO_DEVICE_BIT_IN) {
+ ALOGE("%s: trying to set an invalid device 0x%X for input source %s",
+ __FUNCTION__, devices, getName().c_str());
+ return BAD_VALUE;
+ }
+ ALOGD("%s: 0x%X for input source %s", __FUNCTION__, devices, getName().c_str());
+ mApplicableDevices = devices;
+ return NO_ERROR;
+}
+
+template <>
+audio_devices_t Element<audio_source_t>::get<audio_devices_t>() const
+{
+ ALOGV("%s: 0x%X for inputSource %s", __FUNCTION__, mApplicableDevices, getName().c_str());
+ return mApplicableDevices;
+}
+} // namespace audio_policy
+} // namespace android
+
+
diff --git a/services/audiopolicy/engineconfigurable/src/InputSource.h b/services/audiopolicy/engineconfigurable/src/InputSource.h
new file mode 100755
index 0000000..6c498dc
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/src/InputSource.h
@@ -0,0 +1,88 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include "Element.h"
+
+namespace android
+{
+namespace audio_policy
+{
+
+/**
+ * Specialization of policy base class element for audio_source_t
+ * @tparam audio_source_t Policy Base Element identified by the audio_source_t definition.
+ */
+template <>
+class Element<audio_source_t>
+{
+public:
+ Element(const std::string &name)
+ : mName(name),
+ mApplicableDevices(AUDIO_DEVICE_NONE)
+ {}
+ ~Element() {}
+
+ /**
+ * Returns identifier of this policy element
+ *
+ * @returns string representing the name of this policy element
+ */
+ const std::string &getName() const { return mName; }
+
+ /**
+ * Set the unique identifier for this policy element.
+ *
+ * @tparam Key type of the unique identifier.
+ * @param[in] identifier to be set.
+ *
+ * @return NO_ERROR if the identifier is valid and set correctly, error code otherwise.
+ */
+ status_t setIdentifier(audio_source_t identifier);
+
+ /**
+ * @return the unique identifier of this policy element.
+ */
+ audio_source_t getIdentifier() const { return mIdentifier; }
+
+ /**
+ * A Policy element may implement getter/setter function for a given property.
+ * Property may be routing_strategy, audio_stream_type_t, audio_usage_t, audio_source_t
+ * or a string.
+ */
+ template <typename Property>
+ Property get() const;
+
+ template <typename Property>
+ status_t set(Property property);
+
+private:
+ /* Copy facilities are put private to disable copy. */
+ Element(const Element &object);
+ Element &operator=(const Element &object);
+
+ std::string mName; /**< Unique literal Identifier of a policy base element*/
+ audio_source_t mIdentifier; /**< Unique numerical Identifier of a policy base element*/
+
+ audio_devices_t mApplicableDevices; /**< Applicable input device for this input source. */
+};
+
+typedef Element<audio_source_t> InputSource;
+
+} // namespace audio_policy
+} // namespace android
+
diff --git a/services/audiopolicy/engineconfigurable/src/Strategy.cpp b/services/audiopolicy/engineconfigurable/src/Strategy.cpp
new file mode 100755
index 0000000..847443a
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/src/Strategy.cpp
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "APM::AudioPolicyEngine/Strategy"
+
+#include "Strategy.h"
+
+using std::string;
+
+namespace android
+{
+namespace audio_policy
+{
+
+status_t Element<routing_strategy>::setIdentifier(routing_strategy identifier)
+{
+ if (identifier >= NUM_STRATEGIES) {
+ return BAD_VALUE;
+ }
+ mIdentifier = identifier;
+ ALOGD("%s: Strategy %s identifier 0x%X", __FUNCTION__, getName().c_str(), identifier);
+ return NO_ERROR;
+}
+
+/**
+ * Set the device associated to this strategy.
+ * It checks if the output device is valid but allows to set a NONE device
+ *
+ * @param[in] devices selected for the given strategy.
+ *
+ * @return NO_ERROR if the device is either valid or none, error code otherwise.
+ */
+template <>
+status_t Element<routing_strategy>::set<audio_devices_t>(audio_devices_t devices)
+{
+ if (!audio_is_output_devices(devices) && devices != AUDIO_DEVICE_NONE) {
+ ALOGE("%s: trying to set an invalid device 0x%X for strategy %s",
+ __FUNCTION__, devices, getName().c_str());
+ return BAD_VALUE;
+ }
+ ALOGD("%s: 0x%X for strategy %s", __FUNCTION__, devices, getName().c_str());
+ mApplicableDevices = devices;
+ return NO_ERROR;
+}
+
+template <>
+audio_devices_t Element<routing_strategy>::get<audio_devices_t>() const
+{
+ ALOGV("%s: 0x%X for strategy %s", __FUNCTION__, mApplicableDevices, getName().c_str());
+ return mApplicableDevices;
+}
+
+} // namespace audio_policy
+} // namespace android
+
diff --git a/services/audiopolicy/engineconfigurable/src/Strategy.h b/services/audiopolicy/engineconfigurable/src/Strategy.h
new file mode 100755
index 0000000..1157d55
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/src/Strategy.h
@@ -0,0 +1,89 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include "Element.h"
+#include <RoutingStrategy.h>
+
+namespace android
+{
+namespace audio_policy
+{
+
+/**
+ * @tparam audio_devices_t: Applicable output device(s) for this strategy.
+ */
+template <>
+class Element<routing_strategy>
+{
+public:
+ Element(const std::string &name)
+ : mName(name),
+ mApplicableDevices(AUDIO_DEVICE_NONE)
+ {}
+ ~Element() {}
+
+ /**
+ * Returns identifier of this policy element
+ *
+ * @returns string representing the name of this policy element
+ */
+ const std::string &getName() const { return mName; }
+
+ /**
+ * Set the unique identifier for this policy element.
+ *
+ * @tparam Key type of the unique identifier.
+ * @param[in] identifier to be set.
+ *
+ * @return NO_ERROR if the identifier is valid and set correctly, error code otherwise.
+ */
+ status_t setIdentifier(routing_strategy identifier);
+
+ /**
+ * @return the unique identifier of this policy element.
+ */
+ routing_strategy getIdentifier() const { return mIdentifier; }
+
+ /**
+ * A Policy element may implement getter/setter function for a given property.
+ * Property may be routing_strategy, audio_stream_type_t, audio_usage_t, audio_source_t
+ * or a string.
+ */
+ template <typename Property>
+ Property get() const;
+
+ template <typename Property>
+ status_t set(Property property);
+
+private:
+ /* Copy facilities are put private to disable copy. */
+ Element(const Element &object);
+ Element &operator=(const Element &object);
+
+ std::string mName; /**< Unique literal Identifier of a policy base element*/
+ routing_strategy mIdentifier; /**< Unique numerical Identifier of a policy base element*/
+
+ audio_devices_t mApplicableDevices; /**< Applicable output device(s) for this strategy. */
+};
+
+typedef Element<routing_strategy> Strategy;
+
+} // namespace audio_policy
+} // namespace android
+
+
diff --git a/services/audiopolicy/engineconfigurable/src/Stream.cpp b/services/audiopolicy/engineconfigurable/src/Stream.cpp
new file mode 100755
index 0000000..bea2c19
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/src/Stream.cpp
@@ -0,0 +1,155 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "APM::AudioPolicyEngine/Stream"
+
+#include "Stream.h"
+#include <system/audio.h>
+
+using std::string;
+
+namespace android
+{
+namespace audio_policy
+{
+
+status_t Element<audio_stream_type_t>::setIdentifier(audio_stream_type_t identifier)
+{
+ if (identifier > AUDIO_STREAM_CNT) {
+ return BAD_VALUE;
+ }
+ mIdentifier = identifier;
+ ALOGD("%s: Stream %s identifier 0x%X", __FUNCTION__, getName().c_str(), identifier);
+ return NO_ERROR;
+}
+
+/**
+* Set the strategy to follow for this stream.
+* It checks if the strategy is valid.
+*
+* @param[in] strategy to be followed.
+*
+* @return NO_ERROR if the strategy is set correctly, error code otherwise.
+*/
+template <>
+status_t Element<audio_stream_type_t>::set<routing_strategy>(routing_strategy strategy)
+{
+ if (strategy >= NUM_STRATEGIES) {
+ return BAD_VALUE;
+ }
+ mApplicableStrategy = strategy;
+ ALOGD("%s: 0x%X for Stream %s", __FUNCTION__, strategy, getName().c_str());
+ return NO_ERROR;
+}
+
+template <>
+routing_strategy Element<audio_stream_type_t>::get<routing_strategy>() const
+{
+ ALOGV("%s: 0x%X for Stream %s", __FUNCTION__, mApplicableStrategy, getName().c_str());
+ return mApplicableStrategy;
+}
+
+status_t Element<audio_stream_type_t>::setVolumeProfile(Volume::device_category category,
+ const VolumeCurvePoints &points)
+{
+ ALOGD("%s: adding volume profile for %s for device category %d, points nb =%d", __FUNCTION__,
+ getName().c_str(), category, points.size());
+ mVolumeProfiles[category] = points;
+
+ for (size_t i = 0; i < points.size(); i++) {
+ ALOGV("%s: %s cat=%d curve index =%d Index=%d dBAttenuation=%f",
+ __FUNCTION__, getName().c_str(), category, i, points[i].mIndex,
+ points[i].mDBAttenuation);
+ }
+ return NO_ERROR;
+}
+
+status_t Element<audio_stream_type_t>::initVolume(int indexMin, int indexMax)
+{
+ ALOGV("initStreamVolume() stream %s, min %d, max %d", getName().c_str(), indexMin, indexMax);
+ if (indexMin < 0 || indexMin >= indexMax) {
+ ALOGW("initStreamVolume() invalid index limits for stream %s, min %d, max %d",
+ getName().c_str(), indexMin, indexMax);
+ return BAD_VALUE;
+ }
+ mIndexMin = indexMin;
+ mIndexMax = indexMax;
+
+ return NO_ERROR;
+}
+
+float Element<audio_stream_type_t>::volIndexToDb(Volume::device_category deviceCategory,
+ int indexInUi)
+{
+ VolumeProfileConstIterator it = mVolumeProfiles.find(deviceCategory);
+ if (it == mVolumeProfiles.end()) {
+ ALOGE("%s: device category %d not found for stream %s", __FUNCTION__, deviceCategory,
+ getName().c_str());
+ return 1.0f;
+ }
+ const VolumeCurvePoints curve = mVolumeProfiles[deviceCategory];
+ if (curve.size() != Volume::VOLCNT) {
+ ALOGE("%s: invalid profile for category %d and for stream %s", __FUNCTION__, deviceCategory,
+ getName().c_str());
+ return 1.0f;
+ }
+
+ // the volume index in the UI is relative to the min and max volume indices for this stream type
+ int nbSteps = 1 + curve[Volume::VOLMAX].mIndex -
+ curve[Volume::VOLMIN].mIndex;
+
+ if (mIndexMax - mIndexMin == 0) {
+ ALOGE("%s: Invalid volume indexes Min=Max=%d", __FUNCTION__, mIndexMin);
+ return 1.0f;
+ }
+ int volIdx = (nbSteps * (indexInUi - mIndexMin)) /
+ (mIndexMax - mIndexMin);
+
+ // find what part of the curve this index volume belongs to, or if it's out of bounds
+ int segment = 0;
+ if (volIdx < curve[Volume::VOLMIN].mIndex) { // out of bounds
+ return 0.0f;
+ } else if (volIdx < curve[Volume::VOLKNEE1].mIndex) {
+ segment = 0;
+ } else if (volIdx < curve[Volume::VOLKNEE2].mIndex) {
+ segment = 1;
+ } else if (volIdx <= curve[Volume::VOLMAX].mIndex) {
+ segment = 2;
+ } else { // out of bounds
+ return 1.0f;
+ }
+
+ // linear interpolation in the attenuation table in dB
+ float decibels = curve[segment].mDBAttenuation +
+ ((float)(volIdx - curve[segment].mIndex)) *
+ ( (curve[segment+1].mDBAttenuation -
+ curve[segment].mDBAttenuation) /
+ ((float)(curve[segment+1].mIndex -
+ curve[segment].mIndex)) );
+
+ ALOGV("VOLUME vol index=[%d %d %d], dB=[%.1f %.1f %.1f]",
+ curve[segment].mIndex, volIdx,
+ curve[segment+1].mIndex,
+ curve[segment].mDBAttenuation,
+ decibels,
+ curve[segment+1].mDBAttenuation);
+
+ return decibels;
+}
+
+} // namespace audio_policy
+} // namespace android
+
diff --git a/services/audiopolicy/engineconfigurable/src/Stream.h b/services/audiopolicy/engineconfigurable/src/Stream.h
new file mode 100755
index 0000000..8c39dc6
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/src/Stream.h
@@ -0,0 +1,115 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include "Element.h"
+#include "EngineDefinition.h"
+#include <Volume.h>
+#include <RoutingStrategy.h>
+#include <map>
+
+namespace android
+{
+namespace audio_policy
+{
+/**
+ * @tparam routing_strategy: Applicable strategy for this stream.
+ */
+template <>
+class Element<audio_stream_type_t>
+{
+private:
+ typedef std::map<Volume::device_category, VolumeCurvePoints> VolumeProfiles;
+ typedef VolumeProfiles::iterator VolumeProfileIterator;
+ typedef VolumeProfiles::const_iterator VolumeProfileConstIterator;
+
+public:
+ Element(const std::string &name)
+ : mName(name),
+ mApplicableStrategy(STRATEGY_MEDIA),
+ mIndexMin(0),
+ mIndexMax(1)
+ {}
+ ~Element() {}
+
+ /**
+ * Returns identifier of this policy element
+ *
+ * @returns string representing the name of this policy element
+ */
+ const std::string &getName() const { return mName; }
+
+ /**
+ * Set the unique identifier for this policy element.
+ *
+ * @tparam Key type of the unique identifier.
+ * @param[in] identifier to be set.
+ *
+ * @return NO_ERROR if the identifier is valid and set correctly, error code otherwise.
+ */
+ status_t setIdentifier(audio_stream_type_t identifier);
+
+ /**
+ * @return the unique identifier of this policy element.
+ */
+ audio_stream_type_t getIdentifier() const { return mIdentifier; }
+
+ /**
+ * A Policy element may implement getter/setter function for a given property.
+ * Property may be routing_strategy, audio_stream_type_t, audio_usage_t, audio_source_t
+ * or a string.
+ */
+ template <typename Property>
+ Property get() const;
+
+ template <typename Property>
+ status_t set(Property property);
+
+ status_t setVolumeProfile(Volume::device_category category, const VolumeCurvePoints &points);
+
+ float volIndexToDb(Volume::device_category deviceCategory, int indexInUi);
+
+ status_t initVolume(int indexMin, int indexMax);
+
+private:
+ /* Copy facilities are put private to disable copy. */
+ Element(const Element &object);
+ Element &operator=(const Element &object);
+
+ std::string mName; /**< Unique literal Identifier of a policy base element*/
+ audio_stream_type_t mIdentifier; /**< Unique numerical Identifier of a policy base element*/
+
+ routing_strategy mApplicableStrategy; /**< Applicable strategy for this stream. */
+
+ /**
+ * Collection of volume profiles indexed by the stream type.
+ * Volume is the only reason why the stream profile was not removed from policy when introducing
+ * attributes.
+ */
+ VolumeProfiles mVolumeProfiles;
+
+ int mIndexMin;
+
+ int mIndexMax;
+};
+
+typedef Element<audio_stream_type_t> Stream;
+
+} // namespace audio_policy
+} // namespace android
+
+
diff --git a/services/audiopolicy/engineconfigurable/src/Usage.cpp b/services/audiopolicy/engineconfigurable/src/Usage.cpp
new file mode 100755
index 0000000..5d20828
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/src/Usage.cpp
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "APM::AudioPolicyEngine/Usage"
+
+#include "Usage.h"
+
+namespace android
+{
+namespace audio_policy
+{
+
+status_t Element<audio_usage_t>::setIdentifier(audio_usage_t identifier)
+{
+ if (identifier > AUDIO_USAGE_MAX) {
+ return BAD_VALUE;
+ }
+ mIdentifier = identifier;
+ ALOGD("%s: Usage %s has identifier 0x%X", __FUNCTION__, getName().c_str(), identifier);
+ return NO_ERROR;
+}
+
+template <>
+status_t Element<audio_usage_t>::set<routing_strategy>(routing_strategy strategy)
+{
+ if (strategy >= NUM_STRATEGIES) {
+ return BAD_VALUE;
+ }
+ ALOGD("%s: %d for Usage %s", __FUNCTION__, strategy, getName().c_str());
+ mApplicableStrategy = strategy;
+ return NO_ERROR;
+}
+
+template <>
+routing_strategy Element<audio_usage_t>::get<routing_strategy>() const
+{
+ ALOGD("%s: %d for Usage %s", __FUNCTION__, mApplicableStrategy, getName().c_str());
+ return mApplicableStrategy;
+}
+
+} // namespace audio_policy
+} // namespace android
+
+
diff --git a/services/audiopolicy/engineconfigurable/src/Usage.h b/services/audiopolicy/engineconfigurable/src/Usage.h
new file mode 100755
index 0000000..d69e0e0
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/src/Usage.h
@@ -0,0 +1,88 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include "Element.h"
+#include <RoutingStrategy.h>
+
+namespace android
+{
+namespace audio_policy
+{
+
+/**
+ * @tparam routing_strategy: Applicable strategy for this usage.
+ */
+template <>
+class Element<audio_usage_t>
+{
+public:
+ Element(const std::string &name)
+ : mName(name),
+ mApplicableStrategy(STRATEGY_MEDIA)
+ {}
+ ~Element() {}
+
+ /**
+ * Returns identifier of this policy element
+ *
+ * @returns string representing the name of this policy element
+ */
+ const std::string &getName() const { return mName; }
+
+ /**
+ * Set the unique identifier for this policy element.
+ *
+ * @tparam Key type of the unique identifier.
+ * @param[in] identifier to be set.
+ *
+ * @return NO_ERROR if the identifier is valid and set correctly, error code otherwise.
+ */
+ status_t setIdentifier(audio_usage_t identifier);
+
+ /**
+ * @return the unique identifier of this policy element.
+ */
+ audio_usage_t getIdentifier() const { return mIdentifier; }
+
+ /**
+ * A Policy element may implement getter/setter function for a given property.
+ * Property may be routing_strategy, audio_stream_type_t, audio_usage_t, audio_source_t
+ * or a string.
+ */
+ template <typename Property>
+ Property get() const;
+
+ template <typename Property>
+ status_t set(Property property);
+
+private:
+ /* Copy facilities are put private to disable copy. */
+ Element(const Element &object);
+ Element &operator=(const Element &object);
+
+ std::string mName; /**< Unique literal Identifier of a policy base element*/
+ audio_usage_t mIdentifier; /**< Unique numerical Identifier of a policy base element*/
+ routing_strategy mApplicableStrategy; /**< Applicable strategy for this usage. */
+};
+
+typedef Element<audio_usage_t> Usage;
+
+} // namespace audio_policy
+} // namespace android
+
+
diff --git a/services/audiopolicy/engineconfigurable/wrapper/Android.mk b/services/audiopolicy/engineconfigurable/wrapper/Android.mk
new file mode 100644
index 0000000..096f913
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/wrapper/Android.mk
@@ -0,0 +1,40 @@
+LOCAL_PATH:= $(call my-dir)
+
+##################################################################
+# WRAPPER LIBRARY
+##################################################################
+
+include $(CLEAR_VARS)
+
+LOCAL_C_INCLUDES := \
+ $(LOCAL_PATH)/include \
+ $(TARGET_OUT_HEADERS)/parameter \
+ $(TOPDIR)frameworks/av/services/audiopolicy/engineconfigurable/include \
+ $(TOPDIR)frameworks/av/services/audiopolicy/engineconfigurable/interface \
+ $(TOPDIR)frameworks/av/services/audiopolicy/utilities/convert \
+
+LOCAL_SRC_FILES:= ParameterManagerWrapper.cpp
+
+LOCAL_STATIC_LIBRARIES := \
+ libmedia_helper \
+
+LOCAL_MODULE:= libaudiopolicypfwwrapper
+LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
+
+LOCAL_MODULE_TAGS := optional
+LOCAL_CFLAGS := -Wall -Werror -Wextra
+
+include $(BUILD_STATIC_LIBRARY)
+
+##################################################################
+# CONFIGURATION FILE
+##################################################################
+
+# specific management of audio_policy_criteria.conf
+include $(CLEAR_VARS)
+LOCAL_MODULE := audio_policy_criteria.conf
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_CLASS := ETC
+LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)
+LOCAL_SRC_FILES := config/$(LOCAL_MODULE)
+include $(BUILD_PREBUILT)
diff --git a/services/audiopolicy/engineconfigurable/wrapper/ParameterManagerWrapper.cpp b/services/audiopolicy/engineconfigurable/wrapper/ParameterManagerWrapper.cpp
new file mode 100755
index 0000000..cfe49d4
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/wrapper/ParameterManagerWrapper.cpp
@@ -0,0 +1,435 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "APM::AudioPolicyEngine/PFWWrapper"
+
+#include "ParameterManagerWrapper.h"
+#include "audio_policy_criteria_conf.h"
+#include <ParameterMgrPlatformConnector.h>
+#include <SelectionCriterionTypeInterface.h>
+#include <SelectionCriterionInterface.h>
+#include <convert.h>
+#include <algorithm>
+#include <cutils/config_utils.h>
+#include <cutils/misc.h>
+#include <fstream>
+#include <limits>
+#include <sstream>
+#include <string>
+#include <vector>
+#include <stdint.h>
+#include <cmath>
+#include <utils/Log.h>
+
+using std::string;
+using std::map;
+using std::vector;
+
+/// PFW related definitions
+// Logger
+class ParameterMgrPlatformConnectorLogger : public CParameterMgrPlatformConnector::ILogger
+{
+public:
+ ParameterMgrPlatformConnectorLogger() {}
+
+ virtual void log(bool isWarning, const string &log)
+ {
+ const static string format("policy-parameter-manager: ");
+
+ if (isWarning) {
+ ALOGW("%s %s", format.c_str(), log.c_str());
+ } else {
+ ALOGD("%s %s", format.c_str(), log.c_str());
+ }
+ }
+};
+
+namespace android
+{
+
+using utilities::convertTo;
+
+namespace audio_policy
+{
+const char *const ParameterManagerWrapper::mPolicyPfwDefaultConfFileName =
+ "/etc/parameter-framework/ParameterFrameworkConfigurationPolicy.xml";
+
+template <>
+struct ParameterManagerWrapper::parameterManagerElementSupported<ISelectionCriterionInterface> {};
+template <>
+struct ParameterManagerWrapper::parameterManagerElementSupported<ISelectionCriterionTypeInterface> {};
+
+ParameterManagerWrapper::ParameterManagerWrapper()
+ : mPfwConnectorLogger(new ParameterMgrPlatformConnectorLogger)
+{
+ // Connector
+ mPfwConnector = new CParameterMgrPlatformConnector(mPolicyPfwDefaultConfFileName);
+
+ // Logger
+ mPfwConnector->setLogger(mPfwConnectorLogger);
+
+ // Load criteria file
+ if ((loadAudioPolicyCriteriaConfig(gAudioPolicyCriteriaVendorConfFilePath) != NO_ERROR) &&
+ (loadAudioPolicyCriteriaConfig(gAudioPolicyCriteriaConfFilePath) != NO_ERROR)) {
+ ALOGE("%s: Neither vendor conf file (%s) nor system conf file (%s) could be found",
+ __FUNCTION__, gAudioPolicyCriteriaVendorConfFilePath,
+ gAudioPolicyCriteriaConfFilePath);
+ }
+ ALOGD("%s: ParameterManagerWrapper instantiated!", __FUNCTION__);
+}
+
+ParameterManagerWrapper::~ParameterManagerWrapper()
+{
+ // Unset logger
+ mPfwConnector->setLogger(NULL);
+ // Remove logger
+ delete mPfwConnectorLogger;
+ // Remove connector
+ delete mPfwConnector;
+}
+
+status_t ParameterManagerWrapper::start()
+{
+ ALOGD("%s: in", __FUNCTION__);
+ /// Start PFW
+ std::string error;
+ if (!mPfwConnector->start(error)) {
+ ALOGE("%s: Policy PFW start error: %s", __FUNCTION__, error.c_str());
+ return NO_INIT;
+ }
+ ALOGD("%s: Policy PFW successfully started!", __FUNCTION__);
+ return NO_ERROR;
+}
+
+
+void ParameterManagerWrapper::addCriterionType(const string &typeName, bool isInclusive)
+{
+ ALOG_ASSERT(mPolicyCriterionTypes.find(typeName) == mPolicyCriterionTypes.end(),
+ "CriterionType " << typeName << " already added");
+ ALOGD("%s: Adding new criterionType %s", __FUNCTION__, typeName.c_str());
+
+ mPolicyCriterionTypes[typeName] = mPfwConnector->createSelectionCriterionType(isInclusive);
+}
+
+void ParameterManagerWrapper::addCriterionTypeValuePair(
+ const string &typeName,
+ uint32_t numericValue,
+ const string &literalValue)
+{
+ ALOG_ASSERT(mPolicyCriterionTypes.find(typeName) != mPolicyCriterionTypes.end(),
+ "CriterionType " << typeName.c_str() << "not found");
+ ALOGV("%s: Adding new value pair (%d,%s) for criterionType %s", __FUNCTION__,
+ numericValue, literalValue.c_str(), typeName.c_str());
+ ISelectionCriterionTypeInterface *criterionType = mPolicyCriterionTypes[typeName];
+ criterionType->addValuePair(numericValue, literalValue.c_str());
+}
+
+void ParameterManagerWrapper::loadCriterionType(cnode *root, bool isInclusive)
+{
+ ALOG_ASSERT(root != NULL, "error in parsing file");
+ cnode *node;
+ for (node = root->first_child; node != NULL; node = node->next) {
+
+ ALOG_ASSERT(node != NULL, "error in parsing file");
+ const char *typeName = node->name;
+ char *valueNames = strndup(node->value, strlen(node->value));
+
+ addCriterionType(typeName, isInclusive);
+
+ uint32_t index = 0;
+ char *ctx;
+ char *valueName = strtok_r(valueNames, ",", &ctx);
+ while (valueName != NULL) {
+ if (strlen(valueName) != 0) {
+
+ // Conf file may use or not pair, if no pair, use incremental index, else
+ // use provided index.
+ if (strchr(valueName, ':') != NULL) {
+
+ char *first = strtok(valueName, ":");
+ char *second = strtok(NULL, ":");
+ ALOG_ASSERT((first != NULL) && (strlen(first) != 0) &&
+ (second != NULL) && (strlen(second) != 0),
+ "invalid value pair");
+
+ if (!convertTo<string, uint32_t>(first, index)) {
+ ALOGE("%s: Invalid index(%s) found", __FUNCTION__, first);
+ }
+ addCriterionTypeValuePair(typeName, index, second);
+ } else {
+
+ uint32_t pfwIndex = isInclusive ? 1 << index : index;
+ addCriterionTypeValuePair(typeName, pfwIndex, valueName);
+ index += 1;
+ }
+ }
+ valueName = strtok_r(NULL, ",", &ctx);
+ }
+ free(valueNames);
+ }
+}
+
+void ParameterManagerWrapper::loadInclusiveCriterionType(cnode *root)
+{
+ ALOG_ASSERT(root != NULL, "error in parsing file");
+ cnode *node = config_find(root, gInclusiveCriterionTypeTag.c_str());
+ if (node == NULL) {
+ return;
+ }
+ loadCriterionType(node, true);
+}
+
+void ParameterManagerWrapper::loadExclusiveCriterionType(cnode *root)
+{
+ ALOG_ASSERT(root != NULL, "error in parsing file");
+ cnode *node = config_find(root, gExclusiveCriterionTypeTag.c_str());
+ if (node == NULL) {
+ return;
+ }
+ loadCriterionType(node, false);
+}
+
+void ParameterManagerWrapper::parseChildren(cnode *root, string &defaultValue, string &type)
+{
+ ALOG_ASSERT(root != NULL, "error in parsing file");
+ cnode *node;
+ for (node = root->first_child; node != NULL; node = node->next) {
+ ALOG_ASSERT(node != NULL, "error in parsing file");
+
+ if (string(node->name) == gDefaultTag) {
+ defaultValue = node->value;
+ } else if (string(node->name) == gTypeTag) {
+ type = node->value;
+ } else {
+ ALOGE("%s: Unrecognized %s %s node", __FUNCTION__, node->name, node->value);
+ }
+ }
+}
+
+template <typename T>
+T *ParameterManagerWrapper::getElement(const string &name, std::map<string, T *> &elementsMap)
+{
+ parameterManagerElementSupported<T>();
+ typename std::map<string, T *>::iterator it = elementsMap.find(name);
+ ALOG_ASSERT(it != elementsMap.end(), "Element " << name << " not found");
+ return it->second;
+}
+
+template <typename T>
+const T *ParameterManagerWrapper::getElement(const string &name, const std::map<string, T *> &elementsMap) const
+{
+ parameterManagerElementSupported<T>();
+ typename std::map<string, T *>::const_iterator it = elementsMap.find(name);
+ ALOG_ASSERT(it != elementsMap.end(), "Element " << name << " not found");
+ return it->second;
+}
+
+void ParameterManagerWrapper::loadCriteria(cnode *root)
+{
+ ALOG_ASSERT(root != NULL, "error in parsing file");
+ cnode *node = config_find(root, gCriterionTag.c_str());
+
+ if (node == NULL) {
+ ALOGW("%s: no inclusive criteria found", __FUNCTION__);
+ return;
+ }
+ for (node = node->first_child; node != NULL; node = node->next) {
+ loadCriterion(node);
+ }
+}
+
+void ParameterManagerWrapper::addCriterion(const string &name, const string &typeName,
+ const string &defaultLiteralValue)
+{
+ ALOG_ASSERT(mPolicyCriteria.find(criterionName) == mPolicyCriteria.end(),
+ "Route Criterion " << criterionName << " already added");
+
+ ISelectionCriterionTypeInterface *criterionType =
+ getElement<ISelectionCriterionTypeInterface>(typeName, mPolicyCriterionTypes);
+
+ ISelectionCriterionInterface *criterion =
+ mPfwConnector->createSelectionCriterion(name, criterionType);
+
+ mPolicyCriteria[name] = criterion;
+ int numericalValue = 0;
+ if (!criterionType->getNumericalValue(defaultLiteralValue.c_str(), numericalValue)) {
+ ALOGE("%s; trying to apply invalid default literal value (%s)", __FUNCTION__,
+ defaultLiteralValue.c_str());
+ }
+ criterion->setCriterionState(numericalValue);
+}
+
+void ParameterManagerWrapper::loadCriterion(cnode *root)
+{
+ ALOG_ASSERT(root != NULL, "error in parsing file");
+ const char *criterionName = root->name;
+
+ ALOG_ASSERT(mPolicyCriteria.find(criterionName) == mPolicyCriteria.end(),
+ "Criterion " << criterionName << " already added");
+
+ string paramKeyName = "";
+ string path = "";
+ string typeName = "";
+ string defaultValue = "";
+
+ parseChildren(root, defaultValue, typeName);
+
+ addCriterion(criterionName, typeName, defaultValue);
+}
+
+void ParameterManagerWrapper::loadConfig(cnode *root)
+{
+ ALOG_ASSERT(root != NULL, "error in parsing file");
+ cnode *node = config_find(root, gPolicyConfTag.c_str());
+ if (node == NULL) {
+ ALOGW("%s: Could not find node for pfw", __FUNCTION__);
+ return;
+ }
+ ALOGD("%s: Loading conf for pfw", __FUNCTION__);
+ loadInclusiveCriterionType(node);
+ loadExclusiveCriterionType(node);
+ loadCriteria(node);
+}
+
+
+status_t ParameterManagerWrapper::loadAudioPolicyCriteriaConfig(const char *path)
+{
+ ALOG_ASSERT(path != NULL, "error in parsing file: empty path");
+ cnode *root;
+ char *data;
+ ALOGD("%s", __FUNCTION__);
+ data = (char *)load_file(path, NULL);
+ if (data == NULL) {
+ return -ENODEV;
+ }
+ root = config_node("", "");
+ ALOG_ASSERT(root != NULL, "Unable to allocate a configuration node");
+ config_load(root, data);
+
+ loadConfig(root);
+
+ config_free(root);
+ free(root);
+ free(data);
+ ALOGD("%s: loaded", __FUNCTION__);
+ return NO_ERROR;
+}
+
+bool ParameterManagerWrapper::isStarted()
+{
+ return mPfwConnector && mPfwConnector->isStarted();
+}
+
+status_t ParameterManagerWrapper::setPhoneState(audio_mode_t mode)
+{
+ ISelectionCriterionInterface *criterion = mPolicyCriteria[gPhoneStateCriterionTag];
+ if (!isValueValidForCriterion(criterion, static_cast<int>(mode))) {
+ return BAD_VALUE;
+ }
+ criterion->setCriterionState((int)(mode));
+ applyPlatformConfiguration();
+ return NO_ERROR;
+}
+
+audio_mode_t ParameterManagerWrapper::getPhoneState() const
+{
+ const ISelectionCriterionInterface *criterion =
+ getElement<ISelectionCriterionInterface>(gPhoneStateCriterionTag, mPolicyCriteria);
+ return static_cast<audio_mode_t>(criterion->getCriterionState());
+}
+
+status_t ParameterManagerWrapper::setForceUse(audio_policy_force_use_t usage,
+ audio_policy_forced_cfg_t config)
+{
+ // @todo: return an error on a unsupported value
+ if (usage > AUDIO_POLICY_FORCE_USE_CNT) {
+ return BAD_VALUE;
+ }
+
+ ISelectionCriterionInterface *criterion = mPolicyCriteria[gForceUseCriterionTag[usage]];
+ if (!isValueValidForCriterion(criterion, static_cast<int>(config))) {
+ return BAD_VALUE;
+ }
+ criterion->setCriterionState((int)config);
+ applyPlatformConfiguration();
+ return NO_ERROR;
+}
+
+audio_policy_forced_cfg_t ParameterManagerWrapper::getForceUse(audio_policy_force_use_t usage) const
+{
+ // @todo: return an error on a unsupported value
+ if (usage > AUDIO_POLICY_FORCE_USE_CNT) {
+ return AUDIO_POLICY_FORCE_NONE;
+ }
+ const ISelectionCriterionInterface *criterion =
+ getElement<ISelectionCriterionInterface>(gForceUseCriterionTag[usage], mPolicyCriteria);
+ return static_cast<audio_policy_forced_cfg_t>(criterion->getCriterionState());
+}
+
+bool ParameterManagerWrapper::isValueValidForCriterion(ISelectionCriterionInterface *criterion,
+ int valueToCheck)
+{
+ const ISelectionCriterionTypeInterface *interface = criterion->getCriterionType();
+ string literalValue;
+ return interface->getLiteralValue(valueToCheck, literalValue);
+}
+
+status_t ParameterManagerWrapper::setDeviceConnectionState(audio_devices_t devices,
+ audio_policy_dev_state_t state,
+ const char */*deviceAddres*/)
+{
+ ISelectionCriterionInterface *criterion = NULL;
+
+ if (audio_is_output_devices(devices)) {
+ criterion = mPolicyCriteria[gOutputDeviceCriterionTag];
+ } else if (devices & AUDIO_DEVICE_BIT_IN) {
+ criterion = mPolicyCriteria[gInputDeviceCriterionTag];
+ } else {
+ return BAD_TYPE;
+ }
+ if (criterion == NULL) {
+ ALOGE("%s: no criterion found for devices", __FUNCTION__);
+ return DEAD_OBJECT;
+ }
+
+ int32_t previousDevices = criterion->getCriterionState();
+ switch (state)
+ {
+ case AUDIO_POLICY_DEVICE_STATE_AVAILABLE:
+ criterion->setCriterionState(previousDevices |= devices);
+ break;
+
+ case AUDIO_POLICY_DEVICE_STATE_UNAVAILABLE:
+ if (devices & AUDIO_DEVICE_BIT_IN) {
+ devices &= ~AUDIO_DEVICE_BIT_IN;
+ }
+ criterion->setCriterionState(previousDevices &= ~devices);
+ break;
+
+ default:
+ return BAD_VALUE;
+ }
+ applyPlatformConfiguration();
+ return NO_ERROR;
+}
+
+void ParameterManagerWrapper::applyPlatformConfiguration()
+{
+ mPfwConnector->applyConfigurations();
+}
+
+} // namespace audio_policy
+} // namespace android
diff --git a/services/audiopolicy/engineconfigurable/wrapper/audio_policy_criteria_conf.h b/services/audiopolicy/engineconfigurable/wrapper/audio_policy_criteria_conf.h
new file mode 100755
index 0000000..58e7135
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/wrapper/audio_policy_criteria_conf.h
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <string>
+#include <system/audio_policy.h>
+
+//////////////////////////////////////////////////////////////////////////////////////////////////
+// Definitions for audio policy criteria configuration file (audio_policy_criteria.conf) //
+// //
+// @TODO: scripted from audio.h & audio_policy,h //
+//////////////////////////////////////////////////////////////////////////////////////////////////
+
+static const char *const gAudioPolicyCriteriaConfFilePath =
+ "/system/etc/audio_policy_criteria.conf";
+static const char *const gAudioPolicyCriteriaVendorConfFilePath =
+ "/vendor/etc/audio_policy_criteria.conf";
+
+/**
+ * PFW instances tags
+ */
+static const std::string &gPolicyConfTag = "Policy";
+static const std::string &gDefaultTag = "Default";
+static const std::string &gTypeTag = "Type";
+
+/**
+ * PFW elements tags
+ */
+static const std::string &gInclusiveCriterionTypeTag = "InclusiveCriterionType";
+static const std::string &gExclusiveCriterionTypeTag = "ExclusiveCriterionType";
+static const std::string &gCriterionTag = "Criterion";
+
+/**
+ * PFW known criterion tags
+ */
+static const std::string &gInputDeviceCriterionTag = "AvailableInputDevices";
+static const std::string &gOutputDeviceCriterionTag = "AvailableOutputDevices";
+static const std::string &gPhoneStateCriterionTag = "TelephonyMode";
+
+/**
+ * Order MUST be align with defintiion of audio_policy_force_use_t within audio_policy.h
+ */
+static const std::string gForceUseCriterionTag[AUDIO_POLICY_FORCE_USE_CNT] =
+{
+ [AUDIO_POLICY_FORCE_FOR_COMMUNICATION] = "ForceUseForCommunication",
+ [AUDIO_POLICY_FORCE_FOR_MEDIA] = "ForceUseForMedia",
+ [AUDIO_POLICY_FORCE_FOR_RECORD] = "ForceUseForRecord",
+ [AUDIO_POLICY_FORCE_FOR_DOCK] = "ForceUseForDock",
+ [AUDIO_POLICY_FORCE_FOR_SYSTEM] = "ForceUseForSystem",
+ [AUDIO_POLICY_FORCE_FOR_HDMI_SYSTEM_AUDIO] = "ForceUseForHdmiSystemAudio"
+};
+
+
+
+
+
+
diff --git a/services/audiopolicy/engineconfigurable/wrapper/config/audio_policy_criteria.conf b/services/audiopolicy/engineconfigurable/wrapper/config/audio_policy_criteria.conf
new file mode 100755
index 0000000..5b046a8
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/wrapper/config/audio_policy_criteria.conf
@@ -0,0 +1,137 @@
+################################################################################################
+#
+# @NOTE:
+# Audio Policy Criteria file example for generic device build
+#
+# Any vendor shall have its own configuration within the corresponding device folder
+#
+################################################################################################
+
+#########################################################
+# Criterion type Example:
+# For each criterion, a couple of numerical, literal values must be provided to the PFW.
+# The numerical part is not mandatory. If not filled by the user, a default numerical value will be
+# automatically provided by audio HAL using the following logic:
+# - Exclusive criterion:
+# * 0 -> first literal value,
+# * 1 -> second literal value,
+# ...
+# * N -> (N+1)th literal value.
+# - Inclusive criterion:
+# * 1 << 0 -> first literal value,
+# * 1 << 1 -> second literal value,
+# ...
+# * 1 << N -> (N+1)th literal value,
+#
+#########################################################
+# Policy {
+# InclusiveCriterionType|ExclusiveCriterionType {
+# <Criterion Name> [numerical value 1:]<literal value 1>,[numerical value 2:]<literal value 2>,<literal value 3>,...
+# }
+# }
+
+#########################################################
+# Criterion:
+#########################################################
+# Policy {
+# Criterion {
+# <Criterion Name> {
+# Type <Criterion type name>
+# Default <default value of the criterion>
+# }
+# }
+# }
+
+Policy {
+ InclusiveCriterionType {
+ #
+ # DO NOT CHANGE ORDER. This definition must be aligned with the definition of
+ # AUDIO_DEVICE_OUT_* within <system/audio.h> file of android.
+ #
+ OutputDevicesMaskType Earpiece,Speaker,WiredHeadset,WiredHeadphone,BluetoothSco,BluetoothScoHeadset,BluetoothScoCarkit,BluetoothA2dp,BluetoothA2dpHeadphones,BluetoothA2dpSpeaker,Hdmi,AnlgDockHeadset,DgtlDockHeadset,UsbAccessory,UsbDevice,RemoteSubmix,TelephonyTx,Line,HdmiArc,Spdif,Fm,AuxLine,SpeakerSafe
+ #
+ # DO NOT CHANGE ORDER. This definition must be aligned with the definition of
+ # AUDIO_DEVICE_IN_* within <system/audio.h> file of android.
+ # Note also that direction bit will be decimated by AudioHAL in order to allow using a mask
+ # with the cardinality of 1 between a bit and an input device.
+ #
+ InputDevicesMaskType Communication,Ambient,BuiltinMic,BluetoothScoHeadset,WiredHeadset,Hdmi,TelephonyRx,BackMic,RemoteSubmix,AnlgDockHeadset,DgtlDockHeadset,UsbAccessory,UsbDevice,FmTuner,TvTune,Line,Spdif,BluetoothA2dp,Loopback
+ }
+ ExclusiveCriterionType {
+ #
+ # The values of the mode MUST be aligned with the definition of the audio_mode_t
+ # from system/audio.h
+ #
+ AndroidModeType 0:Normal,1:RingTone,2:InCall,3:InCommunication
+ #
+ # The values of the mode MUST be aligned with the definition of the
+ # audio_policy_forced_config_t from system/audio.h
+ #
+ ForceUseForCommunicationType 0:ForceNone,1:ForceSpeaker,3:ForceBtSco
+ #
+ # The values of the mode MUST be aligned with the definition of the
+ # audio_policy_forced_config_t from system/audio.h
+ #
+ ForceUseForMediaType 0:ForceNone,1:ForceSpeaker,2:ForceHeadphones,4:ForceBtA2dp,5:ForceWiredAccessory,8:ForceAnalogDock,9:ForceDigitalDock,10:ForceNoBtA2dp
+ #
+ # The values of the mode MUST be aligned with the definition of the
+ # audio_policy_forced_config_t from system/audio.h
+ #
+ ForceUseForRecordType 0:ForceNone,3:ForceBtSco,5:ForceWiredAccessory
+ #
+ # The values of the mode MUST be aligned with the definition of the
+ # audio_policy_forced_config_t from system/audio.h
+ #
+ ForceUseForDockType 0:ForceNone,5:ForceWiredAccessory,6:ForceBtCarDock,7:ForceBtDeskDock,8:ForceAnalogDock,9:ForceDigitalDock
+ #
+ # The values of the mode MUST be aligned with the definition of the
+ # audio_policy_forced_config_t from system/audio.h
+ #
+ ForceUseForSystemType 0:ForceNone,11:ForceSystemEnforced
+ #
+ # The values of the mode MUST be aligned with the definition of the
+ # audio_policy_forced_config_t from system/audio.h
+ #
+ ForceUseForHdmiSystemAudioType 0:ForceNone,12:ForceHdmiSystemEnforced
+ }
+
+ Criterion {
+ AvailableInputDevices {
+ Type InputDevicesMaskType
+ Default none
+ }
+ AvailableOutputDevices {
+ Type OutputDevicesMaskType
+ Default none
+ }
+ TelephonyMode {
+ Type AndroidModeType
+ Default Normal
+ }
+ ForceUseForCommunication {
+ Type ForceUseForCommunicationType
+ Default ForceNone
+ }
+ ForceUseForMedia {
+ Type ForceUseForMediaType
+ Default ForceNone
+ }
+ ForceUseForRecord {
+ Type ForceUseForRecordType
+ Default ForceNone
+ }
+ ForceUseForDock {
+ Type ForceUseForDockType
+ Default ForceNone
+ }
+ ForceUseForSystem {
+ Type ForceUseForSystemType
+ Default ForceNone
+ }
+ ForceUseForHdmiSystemAudio {
+ Type ForceUseForHdmiSystemAudioType
+ Default ForceNone
+ }
+ }
+}
+
diff --git a/services/audiopolicy/engineconfigurable/wrapper/include/ParameterManagerWrapper.h b/services/audiopolicy/engineconfigurable/wrapper/include/ParameterManagerWrapper.h
new file mode 100755
index 0000000..3c5f2c0
--- /dev/null
+++ b/services/audiopolicy/engineconfigurable/wrapper/include/ParameterManagerWrapper.h
@@ -0,0 +1,286 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <system/audio.h>
+#include <system/audio_policy.h>
+#include <utils/Errors.h>
+#include <utils/RWLock.h>
+#include <list>
+#include <map>
+#include <string>
+#include <vector>
+
+class CParameterMgrPlatformConnector;
+class ISelectionCriterionInterface;
+class ISelectionCriterionTypeInterface;
+struct cnode;
+
+class ParameterMgrPlatformConnectorLogger;
+
+namespace android
+{
+namespace audio_policy
+{
+
+class ParameterManagerWrapper
+{
+private:
+ typedef std::pair<int, const char *> CriterionTypeValuePair;
+
+ typedef std::map<std::string, ISelectionCriterionInterface *> CriterionCollection;
+ typedef std::map<std::string, ISelectionCriterionTypeInterface *> CriterionTypeCollection;
+ typedef CriterionCollection::iterator CriterionMapIterator;
+ typedef CriterionCollection::const_iterator CriterionMapConstIterator;
+ typedef CriterionTypeCollection::iterator CriterionTypeMapIterator;
+ typedef CriterionTypeCollection::const_iterator CriteriaTypeMapConstIterator;
+
+public:
+ ParameterManagerWrapper();
+ ~ParameterManagerWrapper();
+
+ /**
+ * Starts the platform state service.
+ * It starts the parameter framework policy instance.
+ *
+ * @return NO_ERROR if success, error code otherwise.
+ */
+ status_t start();
+
+ /**
+ * The following API wrap policy action to criteria
+ */
+
+ /**
+ * Checks if the platform state was correctly started (ie the policy parameter manager
+ * has been instantiated and started correctly).
+ *
+ * @todo: map on initCheck?
+ *
+ * @return true if platform state is started correctly, false otherwise.
+ */
+ bool isStarted();
+
+ /**
+ * Set Telephony Mode.
+ * It will set the telephony mode criterion accordingly and apply the configuration in order
+ * to select the right configuration on domains depending on this mode criterion.
+ *
+ * @param[in] mode: Android Phone state (normal, ringtone, csv, in communication)
+ *
+ * @return NO_ERROR if criterion set correctly, error code otherwise.
+ */
+ status_t setPhoneState(audio_mode_t mode);
+
+ audio_mode_t getPhoneState() const;
+
+ /**
+ * Set Force Use config for a given usage.
+ * It will set the corresponding policy parameter framework criterion.
+ *
+ * @param[in] usage for which a configuration shall be forced.
+ * @param[in] config wished to be forced for the given shall.
+ *
+ * @return NO_ERROR if the criterion was set correctly, error code otherwise (e.g. config not
+ * allowed a given usage...)
+ */
+ status_t setForceUse(audio_policy_force_use_t usage, audio_policy_forced_cfg_t config);
+
+ audio_policy_forced_cfg_t getForceUse(audio_policy_force_use_t usage) const;
+
+ /**
+ * Set the connection state of device(s).
+ * It will set the associated policy parameter framework criterion.
+ *
+ * @param[in] devices mask of devices for which the state has changed.
+ * @param[in] state of availability of this(these) device(s).
+ * @param[in] deviceAddress: the mask might not be enough, as it may represents a type of
+ * device, so address of the device will help precise identification.
+ *
+ * @return NO_ERROR if devices criterion updated correctly, error code otherwise.
+ */
+ status_t setDeviceConnectionState(audio_devices_t devices, audio_policy_dev_state_t state,
+ const char *deviceAddress);
+
+private:
+ /**
+ * Apply the configuration of the platform on the policy parameter manager.
+ * Once all the criteria have been set, the client of the platform state must call
+ * this function in order to have the route PFW taking into account these criteria.
+ *
+ * OPENS: shall we expose this?
+ * - Yes if atomic set operation.
+ * In this case, abstract it behind the "STAGE AND COMMIT" pattern
+ * - no if need to set more than one before triggering an apply configuration.
+ */
+ void applyPlatformConfiguration();
+
+ /**
+ * Load the criterion configuration file.
+ *
+ * @param[in] path Criterion conf file path.
+ *
+ * @return NO_ERROR is parsing successful, error code otherwise.
+ */
+ status_t loadAudioPolicyCriteriaConfig(const char *path);
+
+ /**
+ * Add a criterion type to AudioPolicyPfw.
+ *
+ * @param[in] typeName of the PFW criterion type.
+ * @param[in] isInclusive attribute of the criterion type.
+ */
+ void addCriterionType(const std::string &typeName, bool isInclusive);
+
+ /**
+ * Add a criterion type value pair to AudioPolicyPfw.
+ *
+ * @param[in] typeName criterion type name to which this value pair is added to.
+ * @param[in] numeric part of the value pair.
+ * @param[in] literal part of the value pair.
+ */
+ void addCriterionTypeValuePair(const std::string &typeName, uint32_t numeric,
+ const std::string &literal);
+
+ /**
+ * Add a criterion to AudioPolicyPfw.
+ *
+ * @param[in] name of the PFW criterion.
+ * @param[in] typeName criterion type name to which this criterion is associated to.
+ * @param[in] defaultLiteralValue of the PFW criterion.
+ */
+ void addCriterion(const std::string &name,
+ const std::string &typeName,
+ const std::string &defaultLiteralValue);
+ /**
+ * Parse and load the inclusive criterion type from configuration file.
+ *
+ * @param[in] root node of the configuration file.
+ */
+ void loadInclusiveCriterionType(cnode *root);
+
+ /**
+ * Parse and load the exclusive criterion type from configuration file.
+ *
+ * @param[in] root node of the configuration file.
+ */
+ void loadExclusiveCriterionType(cnode *root);
+
+ /**
+ * Parse and load the criteria from configuration file.
+ *
+ * @param[in] root node of the configuration file.
+ */
+ void loadCriteria(cnode *root);
+
+ /**
+ * Parse and load a criterion from configuration file.
+ *
+ * @param[in] root node of the configuration file.
+ */
+ void loadCriterion(cnode *root);
+
+ /**
+ * Parse and load the criterion types from configuration file.
+ *
+ * @param[in] root node of the configuration file
+ * @param[in] isInclusive true if inclusive, false is exclusive.
+ */
+ void loadCriterionType(cnode *root, bool isInclusive);
+
+ /**
+ * Load the configuration file.
+ *
+ * @param[in] root node of the configuration file.
+ */
+ void loadConfig(cnode *root);
+
+ /**
+ * Parse and load the chidren node from a given root node.
+ *
+ * @param[in] root node of the configuration file
+ * @param[out] defaultValue of the parameter manager element to retrieve.
+ * @param[out] type of the parameter manager element to retrieve.
+ */
+ void parseChildren(cnode *root, std::string &defaultValue, std::string &type);
+
+ /**
+ * Retrieve an element from a map by its name.
+ *
+ * @tparam T type of element to search.
+ * @param[in] name name of the element to find.
+ * @param[in] elementsMap maps of elements to search into.
+ *
+ * @return valid pointer on element if found, NULL otherwise.
+ */
+ template <typename T>
+ T *getElement(const std::string &name, std::map<std::string, T *> &elementsMap);
+
+ /**
+ * Retrieve an element from a map by its name. Const version.
+ *
+ * @tparam T type of element to search.
+ * @param[in] name name of the element to find.
+ * @param[in] elementsMap maps of elements to search into.
+ *
+ * @return valid pointer on element if found, NULL otherwise.
+ */
+ template <typename T>
+ const T *getElement(const std::string &name,
+ const std::map<std::string, T *> &elementsMap) const;
+
+ /**
+ * set the value of a component state.
+ *
+ * @param[in] value new value to set to the component state.
+ * @param[in] stateName of the component state.
+ */
+ void setValue(int value, const std::string &stateName);
+
+ /**
+ * get the value of a component state.
+ *
+ * @param[in] name of the component state.
+ *
+ * @return value of the component state
+ */
+ int getValue(const std::string &stateName) const;
+
+ bool isValueValidForCriterion(ISelectionCriterionInterface *criterion, int valueToCheck);
+
+ CriterionTypeCollection mPolicyCriterionTypes; /**< Policy Criterion Type map. */
+ CriterionCollection mPolicyCriteria; /**< Policy Criterion Map. */
+
+ CParameterMgrPlatformConnector *mPfwConnector; /**< Policy Parameter Manager connector. */
+ ParameterMgrPlatformConnectorLogger *mPfwConnectorLogger; /**< Policy PFW logger. */
+
+
+ /**
+ * provide a compile time error if no specialization is provided for a given type.
+ *
+ * @tparam T: type of the parameter manager element. Supported one are:
+ * - Criterion
+ * - CriterionType.
+ */
+ template <typename T>
+ struct parameterManagerElementSupported;
+
+ static const char *const mPolicyPfwDefaultConfFileName; /**< Default Policy PFW top file name.*/
+};
+
+} // namespace audio_policy
+} // namespace android
diff --git a/services/audiopolicy/enginedefault/Android.mk b/services/audiopolicy/enginedefault/Android.mk
new file mode 100755
index 0000000..8d43b89
--- /dev/null
+++ b/services/audiopolicy/enginedefault/Android.mk
@@ -0,0 +1,46 @@
+LOCAL_PATH := $(call my-dir)
+
+# Component build
+#######################################################################
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+ src/Engine.cpp \
+ src/EngineInstance.cpp \
+ src/Gains.cpp \
+
+
+audio_policy_engine_includes_common := \
+ $(LOCAL_PATH)/include \
+ $(TOPDIR)frameworks/av/services/audiopolicy/engine/interface
+
+LOCAL_CFLAGS += \
+ -Wall \
+ -Werror \
+ -Wextra \
+
+LOCAL_EXPORT_C_INCLUDE_DIRS := \
+ $(audio_policy_engine_includes_common)
+
+LOCAL_C_INCLUDES := \
+ $(audio_policy_engine_includes_common) \
+ $(TARGET_OUT_HEADERS)/hw \
+ $(call include-path-for, frameworks-av) \
+ $(call include-path-for, audio-utils) \
+ $(call include-path-for, bionic) \
+ $(TOPDIR)frameworks/av/services/audiopolicy/common/include
+
+
+LOCAL_MODULE := libaudiopolicyenginedefault
+LOCAL_MODULE_TAGS := optional
+LOCAL_STATIC_LIBRARIES := \
+ libmedia_helper \
+ libaudiopolicycomponents
+
+LOCAL_SHARED_LIBRARIES += \
+ libcutils \
+ libutils \
+ libaudioutils \
+
+include $(BUILD_SHARED_LIBRARY)
diff --git a/services/audiopolicy/enginedefault/include/AudioPolicyEngineInstance.h b/services/audiopolicy/enginedefault/include/AudioPolicyEngineInstance.h
new file mode 100755
index 0000000..1e329f0
--- /dev/null
+++ b/services/audiopolicy/enginedefault/include/AudioPolicyEngineInstance.h
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+class AudioPolicyManagerInterface;
+
+namespace android
+{
+namespace audio_policy
+{
+
+class Engine;
+
+class EngineInstance
+{
+protected:
+ EngineInstance();
+
+public:
+ virtual ~EngineInstance();
+
+ /**
+ * Get Audio Policy Engine instance.
+ *
+ * @return pointer to Route Manager Instance object.
+ */
+ static EngineInstance *getInstance();
+
+ /**
+ * Interface query.
+ * The first client of an interface of the policy engine will start the singleton.
+ *
+ * @tparam RequestedInterface: interface that the client is wishing to retrieve.
+ *
+ * @return interface handle.
+ */
+ template <class RequestedInterface>
+ RequestedInterface *queryInterface() const;
+
+protected:
+ /**
+ * Get Audio Policy Engine instance.
+ *
+ * @return Audio Policy Engine singleton.
+ */
+ Engine *getEngine() const;
+
+private:
+ /* Copy facilities are put private to disable copy. */
+ EngineInstance(const EngineInstance &object);
+ EngineInstance &operator=(const EngineInstance &object);
+};
+
+/**
+ * Limit template instantation to supported type interfaces.
+ * Compile time error will claim if invalid interface is requested.
+ */
+template <>
+AudioPolicyManagerInterface *EngineInstance::queryInterface() const;
+
+} // namespace audio_policy
+} // namespace android
diff --git a/services/audiopolicy/enginedefault/src/Engine.cpp b/services/audiopolicy/enginedefault/src/Engine.cpp
new file mode 100755
index 0000000..0686414
--- /dev/null
+++ b/services/audiopolicy/enginedefault/src/Engine.cpp
@@ -0,0 +1,718 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "APM::AudioPolicyEngine"
+//#define LOG_NDEBUG 0
+
+//#define VERY_VERBOSE_LOGGING
+#ifdef VERY_VERBOSE_LOGGING
+#define ALOGVV ALOGV
+#else
+#define ALOGVV(a...) do { } while(0)
+#endif
+
+#include "Engine.h"
+#include "Gains.h"
+#include <AudioPolicyManagerObserver.h>
+#include <AudioPort.h>
+#include <IOProfile.h>
+#include <policy.h>
+#include <utils/String8.h>
+#include <utils/Log.h>
+
+namespace android
+{
+namespace audio_policy
+{
+
+Engine::Engine()
+ : mManagerInterface(this),
+ mPhoneState(AUDIO_MODE_NORMAL),
+ mApmObserver(NULL)
+{
+ for (int i = 0; i < AUDIO_POLICY_FORCE_USE_CNT; i++) {
+ mForceUse[i] = AUDIO_POLICY_FORCE_NONE;
+ }
+}
+
+Engine::~Engine()
+{
+}
+
+void Engine::setObserver(AudioPolicyManagerObserver *observer)
+{
+ ALOG_ASSERT(observer != NULL, "Invalid Audio Policy Manager observer");
+ mApmObserver = observer;
+}
+
+status_t Engine::initCheck()
+{
+ return (mApmObserver != NULL) ? NO_ERROR : NO_INIT;
+}
+
+float Engine::volIndexToDb(Volume::device_category category, audio_stream_type_t streamType,
+ int indexInUi)
+{
+ const StreamDescriptor &streamDesc = mApmObserver->getStreamDescriptors().valueAt(streamType);
+ return Gains::volIndexToDb(category, streamDesc, indexInUi);
+}
+
+
+status_t Engine::initStreamVolume(audio_stream_type_t stream, int indexMin, int indexMax)
+{
+ ALOGV("initStreamVolume() stream %d, min %d, max %d", stream , indexMin, indexMax);
+ if (indexMin < 0 || indexMin >= indexMax) {
+ ALOGW("initStreamVolume() invalid index limits for stream %d, min %d, max %d",
+ stream , indexMin, indexMax);
+ return BAD_VALUE;
+ }
+ mApmObserver->getStreamDescriptors().setVolumeIndexMin(stream, indexMin);
+ mApmObserver->getStreamDescriptors().setVolumeIndexMax(stream, indexMax);
+ return NO_ERROR;
+}
+
+void Engine::initializeVolumeCurves(bool isSpeakerDrcEnabled)
+{
+ StreamDescriptorCollection &streams = mApmObserver->getStreamDescriptors();
+
+ for (int i = 0; i < AUDIO_STREAM_CNT; i++) {
+ for (int j = 0; j < Volume::DEVICE_CATEGORY_CNT; j++) {
+ streams.setVolumeCurvePoint(static_cast<audio_stream_type_t>(i),
+ static_cast<Volume::device_category>(j),
+ Gains::sVolumeProfiles[i][j]);
+ }
+ }
+
+ // Check availability of DRC on speaker path: if available, override some of the speaker curves
+ if (isSpeakerDrcEnabled) {
+ streams.setVolumeCurvePoint(AUDIO_STREAM_SYSTEM, Volume::DEVICE_CATEGORY_SPEAKER,
+ Gains::sDefaultSystemVolumeCurveDrc);
+ streams.setVolumeCurvePoint(AUDIO_STREAM_RING, Volume::DEVICE_CATEGORY_SPEAKER,
+ Gains::sSpeakerSonificationVolumeCurveDrc);
+ streams.setVolumeCurvePoint(AUDIO_STREAM_ALARM, Volume::DEVICE_CATEGORY_SPEAKER,
+ Gains::sSpeakerSonificationVolumeCurveDrc);
+ streams.setVolumeCurvePoint(AUDIO_STREAM_NOTIFICATION, Volume::DEVICE_CATEGORY_SPEAKER,
+ Gains::sSpeakerSonificationVolumeCurveDrc);
+ streams.setVolumeCurvePoint(AUDIO_STREAM_MUSIC, Volume::DEVICE_CATEGORY_SPEAKER,
+ Gains::sSpeakerMediaVolumeCurveDrc);
+ streams.setVolumeCurvePoint(AUDIO_STREAM_ACCESSIBILITY, Volume::DEVICE_CATEGORY_SPEAKER,
+ Gains::sSpeakerMediaVolumeCurveDrc);
+ }
+}
+
+
+status_t Engine::setPhoneState(audio_mode_t state)
+{
+ ALOGV("setPhoneState() state %d", state);
+
+ if (state < 0 || state >= AUDIO_MODE_CNT) {
+ ALOGW("setPhoneState() invalid state %d", state);
+ return BAD_VALUE;
+ }
+
+ if (state == mPhoneState ) {
+ ALOGW("setPhoneState() setting same state %d", state);
+ return BAD_VALUE;
+ }
+
+ // store previous phone state for management of sonification strategy below
+ int oldState = mPhoneState;
+ mPhoneState = state;
+ StreamDescriptorCollection &streams = mApmObserver->getStreamDescriptors();
+ // are we entering or starting a call
+ if (!is_state_in_call(oldState) && is_state_in_call(state)) {
+ ALOGV(" Entering call in setPhoneState()");
+ for (int j = 0; j < Volume::DEVICE_CATEGORY_CNT; j++) {
+ streams.setVolumeCurvePoint(AUDIO_STREAM_DTMF, static_cast<Volume::device_category>(j),
+ Gains::sVolumeProfiles[AUDIO_STREAM_VOICE_CALL][j]);
+ }
+ } else if (is_state_in_call(oldState) && !is_state_in_call(state)) {
+ ALOGV(" Exiting call in setPhoneState()");
+ for (int j = 0; j < Volume::DEVICE_CATEGORY_CNT; j++) {
+ streams.setVolumeCurvePoint(AUDIO_STREAM_DTMF, static_cast<Volume::device_category>(j),
+ Gains::sVolumeProfiles[AUDIO_STREAM_DTMF][j]);
+ }
+ }
+ return NO_ERROR;
+}
+
+status_t Engine::setForceUse(audio_policy_force_use_t usage, audio_policy_forced_cfg_t config)
+{
+ switch(usage) {
+ case AUDIO_POLICY_FORCE_FOR_COMMUNICATION:
+ if (config != AUDIO_POLICY_FORCE_SPEAKER && config != AUDIO_POLICY_FORCE_BT_SCO &&
+ config != AUDIO_POLICY_FORCE_NONE) {
+ ALOGW("setForceUse() invalid config %d for FOR_COMMUNICATION", config);
+ return BAD_VALUE;
+ }
+ mForceUse[usage] = config;
+ break;
+ case AUDIO_POLICY_FORCE_FOR_MEDIA:
+ if (config != AUDIO_POLICY_FORCE_HEADPHONES && config != AUDIO_POLICY_FORCE_BT_A2DP &&
+ config != AUDIO_POLICY_FORCE_WIRED_ACCESSORY &&
+ config != AUDIO_POLICY_FORCE_ANALOG_DOCK &&
+ config != AUDIO_POLICY_FORCE_DIGITAL_DOCK && config != AUDIO_POLICY_FORCE_NONE &&
+ config != AUDIO_POLICY_FORCE_NO_BT_A2DP && config != AUDIO_POLICY_FORCE_SPEAKER ) {
+ ALOGW("setForceUse() invalid config %d for FOR_MEDIA", config);
+ return BAD_VALUE;
+ }
+ mForceUse[usage] = config;
+ break;
+ case AUDIO_POLICY_FORCE_FOR_RECORD:
+ if (config != AUDIO_POLICY_FORCE_BT_SCO && config != AUDIO_POLICY_FORCE_WIRED_ACCESSORY &&
+ config != AUDIO_POLICY_FORCE_NONE) {
+ ALOGW("setForceUse() invalid config %d for FOR_RECORD", config);
+ return BAD_VALUE;
+ }
+ mForceUse[usage] = config;
+ break;
+ case AUDIO_POLICY_FORCE_FOR_DOCK:
+ if (config != AUDIO_POLICY_FORCE_NONE && config != AUDIO_POLICY_FORCE_BT_CAR_DOCK &&
+ config != AUDIO_POLICY_FORCE_BT_DESK_DOCK &&
+ config != AUDIO_POLICY_FORCE_WIRED_ACCESSORY &&
+ config != AUDIO_POLICY_FORCE_ANALOG_DOCK &&
+ config != AUDIO_POLICY_FORCE_DIGITAL_DOCK) {
+ ALOGW("setForceUse() invalid config %d for FOR_DOCK", config);
+ }
+ mForceUse[usage] = config;
+ break;
+ case AUDIO_POLICY_FORCE_FOR_SYSTEM:
+ if (config != AUDIO_POLICY_FORCE_NONE &&
+ config != AUDIO_POLICY_FORCE_SYSTEM_ENFORCED) {
+ ALOGW("setForceUse() invalid config %d for FOR_SYSTEM", config);
+ }
+ mForceUse[usage] = config;
+ break;
+ case AUDIO_POLICY_FORCE_FOR_HDMI_SYSTEM_AUDIO:
+ if (config != AUDIO_POLICY_FORCE_NONE &&
+ config != AUDIO_POLICY_FORCE_HDMI_SYSTEM_AUDIO_ENFORCED) {
+ ALOGW("setForceUse() invalid config %d forHDMI_SYSTEM_AUDIO", config);
+ }
+ mForceUse[usage] = config;
+ break;
+ default:
+ ALOGW("setForceUse() invalid usage %d", usage);
+ break;
+ }
+ return NO_ERROR;
+}
+
+routing_strategy Engine::getStrategyForStream(audio_stream_type_t stream)
+{
+ // stream to strategy mapping
+ switch (stream) {
+ case AUDIO_STREAM_VOICE_CALL:
+ case AUDIO_STREAM_BLUETOOTH_SCO:
+ return STRATEGY_PHONE;
+ case AUDIO_STREAM_RING:
+ case AUDIO_STREAM_ALARM:
+ return STRATEGY_SONIFICATION;
+ case AUDIO_STREAM_NOTIFICATION:
+ return STRATEGY_SONIFICATION_RESPECTFUL;
+ case AUDIO_STREAM_DTMF:
+ return STRATEGY_DTMF;
+ default:
+ ALOGE("unknown stream type %d", stream);
+ case AUDIO_STREAM_SYSTEM:
+ // NOTE: SYSTEM stream uses MEDIA strategy because muting music and switching outputs
+ // while key clicks are played produces a poor result
+ case AUDIO_STREAM_MUSIC:
+ return STRATEGY_MEDIA;
+ case AUDIO_STREAM_ENFORCED_AUDIBLE:
+ return STRATEGY_ENFORCED_AUDIBLE;
+ case AUDIO_STREAM_TTS:
+ return STRATEGY_TRANSMITTED_THROUGH_SPEAKER;
+ case AUDIO_STREAM_ACCESSIBILITY:
+ return STRATEGY_ACCESSIBILITY;
+ case AUDIO_STREAM_REROUTING:
+ return STRATEGY_REROUTING;
+ }
+}
+
+routing_strategy Engine::getStrategyForUsage(audio_usage_t usage)
+{
+ const SwAudioOutputCollection &outputs = mApmObserver->getOutputs();
+
+ // usage to strategy mapping
+ switch (usage) {
+ case AUDIO_USAGE_ASSISTANCE_ACCESSIBILITY:
+ if (outputs.isStreamActive(AUDIO_STREAM_RING) ||
+ outputs.isStreamActive(AUDIO_STREAM_ALARM)) {
+ return STRATEGY_SONIFICATION;
+ }
+ if (isInCall()) {
+ return STRATEGY_PHONE;
+ }
+ return STRATEGY_ACCESSIBILITY;
+
+ case AUDIO_USAGE_MEDIA:
+ case AUDIO_USAGE_GAME:
+ case AUDIO_USAGE_ASSISTANCE_NAVIGATION_GUIDANCE:
+ case AUDIO_USAGE_ASSISTANCE_SONIFICATION:
+ return STRATEGY_MEDIA;
+
+ case AUDIO_USAGE_VOICE_COMMUNICATION:
+ return STRATEGY_PHONE;
+
+ case AUDIO_USAGE_VOICE_COMMUNICATION_SIGNALLING:
+ return STRATEGY_DTMF;
+
+ case AUDIO_USAGE_ALARM:
+ case AUDIO_USAGE_NOTIFICATION_TELEPHONY_RINGTONE:
+ return STRATEGY_SONIFICATION;
+
+ case AUDIO_USAGE_NOTIFICATION:
+ case AUDIO_USAGE_NOTIFICATION_COMMUNICATION_REQUEST:
+ case AUDIO_USAGE_NOTIFICATION_COMMUNICATION_INSTANT:
+ case AUDIO_USAGE_NOTIFICATION_COMMUNICATION_DELAYED:
+ case AUDIO_USAGE_NOTIFICATION_EVENT:
+ return STRATEGY_SONIFICATION_RESPECTFUL;
+
+ case AUDIO_USAGE_UNKNOWN:
+ default:
+ return STRATEGY_MEDIA;
+ }
+}
+
+audio_devices_t Engine::getDeviceForStrategy(routing_strategy strategy) const
+{
+ const DeviceVector &availableOutputDevices = mApmObserver->getAvailableOutputDevices();
+ const DeviceVector &availableInputDevices = mApmObserver->getAvailableInputDevices();
+
+ const SwAudioOutputCollection &outputs = mApmObserver->getOutputs();
+
+ uint32_t device = AUDIO_DEVICE_NONE;
+ uint32_t availableOutputDevicesType = availableOutputDevices.types();
+
+ switch (strategy) {
+
+ case STRATEGY_TRANSMITTED_THROUGH_SPEAKER:
+ device = availableOutputDevicesType & AUDIO_DEVICE_OUT_SPEAKER;
+ if (!device) {
+ ALOGE("getDeviceForStrategy() no device found for "\
+ "STRATEGY_TRANSMITTED_THROUGH_SPEAKER");
+ }
+ break;
+
+ case STRATEGY_SONIFICATION_RESPECTFUL:
+ if (isInCall()) {
+ device = getDeviceForStrategy(STRATEGY_SONIFICATION);
+ } else if (outputs.isStreamActiveRemotely(AUDIO_STREAM_MUSIC,
+ SONIFICATION_RESPECTFUL_AFTER_MUSIC_DELAY)) {
+ // while media is playing on a remote device, use the the sonification behavior.
+ // Note that we test this usecase before testing if media is playing because
+ // the isStreamActive() method only informs about the activity of a stream, not
+ // if it's for local playback. Note also that we use the same delay between both tests
+ device = getDeviceForStrategy(STRATEGY_SONIFICATION);
+ //user "safe" speaker if available instead of normal speaker to avoid triggering
+ //other acoustic safety mechanisms for notification
+ if ((device & AUDIO_DEVICE_OUT_SPEAKER) &&
+ (availableOutputDevicesType & AUDIO_DEVICE_OUT_SPEAKER_SAFE)) {
+ device |= AUDIO_DEVICE_OUT_SPEAKER_SAFE;
+ device &= ~AUDIO_DEVICE_OUT_SPEAKER;
+ }
+ } else if (outputs.isStreamActive(AUDIO_STREAM_MUSIC, SONIFICATION_RESPECTFUL_AFTER_MUSIC_DELAY)) {
+ // while media is playing (or has recently played), use the same device
+ device = getDeviceForStrategy(STRATEGY_MEDIA);
+ } else {
+ // when media is not playing anymore, fall back on the sonification behavior
+ device = getDeviceForStrategy(STRATEGY_SONIFICATION);
+ //user "safe" speaker if available instead of normal speaker to avoid triggering
+ //other acoustic safety mechanisms for notification
+ if ((device & AUDIO_DEVICE_OUT_SPEAKER) &&
+ (availableOutputDevicesType & AUDIO_DEVICE_OUT_SPEAKER_SAFE)) {
+ device |= AUDIO_DEVICE_OUT_SPEAKER_SAFE;
+ device &= ~AUDIO_DEVICE_OUT_SPEAKER;
+ }
+ }
+ break;
+
+ case STRATEGY_DTMF:
+ if (!isInCall()) {
+ // when off call, DTMF strategy follows the same rules as MEDIA strategy
+ device = getDeviceForStrategy(STRATEGY_MEDIA);
+ break;
+ }
+ // when in call, DTMF and PHONE strategies follow the same rules
+ // FALL THROUGH
+
+ case STRATEGY_PHONE:
+ // Force use of only devices on primary output if:
+ // - in call AND
+ // - cannot route from voice call RX OR
+ // - audio HAL version is < 3.0 and TX device is on the primary HW module
+ if (getPhoneState() == AUDIO_MODE_IN_CALL) {
+ audio_devices_t txDevice = getDeviceForInputSource(AUDIO_SOURCE_VOICE_COMMUNICATION);
+ sp<AudioOutputDescriptor> primaryOutput = outputs.getPrimaryOutput();
+ audio_devices_t availPrimaryInputDevices =
+ availableInputDevices.getDevicesFromHwModule(primaryOutput->getModuleHandle());
+ audio_devices_t availPrimaryOutputDevices =
+ primaryOutput->supportedDevices() & availableOutputDevices.types();
+
+ if (((availableInputDevices.types() &
+ AUDIO_DEVICE_IN_TELEPHONY_RX & ~AUDIO_DEVICE_BIT_IN) == 0) ||
+ (((txDevice & availPrimaryInputDevices & ~AUDIO_DEVICE_BIT_IN) != 0) &&
+ (primaryOutput->getAudioPort()->getModuleVersion() <
+ AUDIO_DEVICE_API_VERSION_3_0))) {
+ availableOutputDevicesType = availPrimaryOutputDevices;
+ }
+ }
+ // for phone strategy, we first consider the forced use and then the available devices by order
+ // of priority
+ switch (mForceUse[AUDIO_POLICY_FORCE_FOR_COMMUNICATION]) {
+ case AUDIO_POLICY_FORCE_BT_SCO:
+ if (!isInCall() || strategy != STRATEGY_DTMF) {
+ device = availableOutputDevicesType & AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT;
+ if (device) break;
+ }
+ device = availableOutputDevicesType & AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET;
+ if (device) break;
+ device = availableOutputDevicesType & AUDIO_DEVICE_OUT_BLUETOOTH_SCO;
+ if (device) break;
+ // if SCO device is requested but no SCO device is available, fall back to default case
+ // FALL THROUGH
+
+ default: // FORCE_NONE
+ // when not in a phone call, phone strategy should route STREAM_VOICE_CALL to A2DP
+ if (!isInCall() &&
+ (mForceUse[AUDIO_POLICY_FORCE_FOR_MEDIA] != AUDIO_POLICY_FORCE_NO_BT_A2DP) &&
+ (outputs.getA2dpOutput() != 0)) {
+ device = availableOutputDevicesType & AUDIO_DEVICE_OUT_BLUETOOTH_A2DP;
+ if (device) break;
+ device = availableOutputDevicesType & AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES;
+ if (device) break;
+ }
+ device = availableOutputDevicesType & AUDIO_DEVICE_OUT_WIRED_HEADPHONE;
+ if (device) break;
+ device = availableOutputDevicesType & AUDIO_DEVICE_OUT_WIRED_HEADSET;
+ if (device) break;
+ device = availableOutputDevicesType & AUDIO_DEVICE_OUT_USB_DEVICE;
+ if (device) break;
+ if (!isInCall()) {
+ device = availableOutputDevicesType & AUDIO_DEVICE_OUT_USB_ACCESSORY;
+ if (device) break;
+ device = availableOutputDevicesType & AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET;
+ if (device) break;
+ device = availableOutputDevicesType & AUDIO_DEVICE_OUT_AUX_DIGITAL;
+ if (device) break;
+ device = availableOutputDevicesType & AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET;
+ if (device) break;
+ }
+ device = availableOutputDevicesType & AUDIO_DEVICE_OUT_EARPIECE;
+ if (device) break;
+ device = mApmObserver->getDefaultOutputDevice()->type();
+ if (device == AUDIO_DEVICE_NONE) {
+ ALOGE("getDeviceForStrategy() no device found for STRATEGY_PHONE");
+ }
+ break;
+
+ case AUDIO_POLICY_FORCE_SPEAKER:
+ // when not in a phone call, phone strategy should route STREAM_VOICE_CALL to
+ // A2DP speaker when forcing to speaker output
+ if (!isInCall() &&
+ (mForceUse[AUDIO_POLICY_FORCE_FOR_MEDIA] != AUDIO_POLICY_FORCE_NO_BT_A2DP) &&
+ (outputs.getA2dpOutput() != 0)) {
+ device = availableOutputDevicesType & AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER;
+ if (device) break;
+ }
+ if (!isInCall()) {
+ device = availableOutputDevicesType & AUDIO_DEVICE_OUT_USB_ACCESSORY;
+ if (device) break;
+ device = availableOutputDevicesType & AUDIO_DEVICE_OUT_USB_DEVICE;
+ if (device) break;
+ device = availableOutputDevicesType & AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET;
+ if (device) break;
+ device = availableOutputDevicesType & AUDIO_DEVICE_OUT_AUX_DIGITAL;
+ if (device) break;
+ device = availableOutputDevicesType & AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET;
+ if (device) break;
+ }
+ device = availableOutputDevicesType & AUDIO_DEVICE_OUT_LINE;
+ if (device) break;
+ device = availableOutputDevicesType & AUDIO_DEVICE_OUT_SPEAKER;
+ if (device) break;
+ device = mApmObserver->getDefaultOutputDevice()->type();
+ if (device == AUDIO_DEVICE_NONE) {
+ ALOGE("getDeviceForStrategy() no device found for STRATEGY_PHONE, FORCE_SPEAKER");
+ }
+ break;
+ }
+ break;
+
+ case STRATEGY_SONIFICATION:
+
+ // If incall, just select the STRATEGY_PHONE device: The rest of the behavior is handled by
+ // handleIncallSonification().
+ if (isInCall()) {
+ device = getDeviceForStrategy(STRATEGY_PHONE);
+ break;
+ }
+ // FALL THROUGH
+
+ case STRATEGY_ENFORCED_AUDIBLE:
+ // strategy STRATEGY_ENFORCED_AUDIBLE uses same routing policy as STRATEGY_SONIFICATION
+ // except:
+ // - when in call where it doesn't default to STRATEGY_PHONE behavior
+ // - in countries where not enforced in which case it follows STRATEGY_MEDIA
+
+ if ((strategy == STRATEGY_SONIFICATION) ||
+ (mForceUse[AUDIO_POLICY_FORCE_FOR_SYSTEM] == AUDIO_POLICY_FORCE_SYSTEM_ENFORCED)) {
+ device = availableOutputDevicesType & AUDIO_DEVICE_OUT_SPEAKER;
+ if (device == AUDIO_DEVICE_NONE) {
+ ALOGE("getDeviceForStrategy() speaker device not found for STRATEGY_SONIFICATION");
+ }
+ }
+ // The second device used for sonification is the same as the device used by media strategy
+ // FALL THROUGH
+
+ // FIXME: STRATEGY_ACCESSIBILITY and STRATEGY_REROUTING follow STRATEGY_MEDIA for now
+ case STRATEGY_ACCESSIBILITY:
+ if (strategy == STRATEGY_ACCESSIBILITY) {
+ // do not route accessibility prompts to a digital output currently configured with a
+ // compressed format as they would likely not be mixed and dropped.
+ for (size_t i = 0; i < outputs.size(); i++) {
+ sp<AudioOutputDescriptor> desc = outputs.valueAt(i);
+ audio_devices_t devices = desc->device() &
+ (AUDIO_DEVICE_OUT_HDMI | AUDIO_DEVICE_OUT_SPDIF | AUDIO_DEVICE_OUT_HDMI_ARC);
+ if (desc->isActive() && !audio_is_linear_pcm(desc->mFormat) &&
+ devices != AUDIO_DEVICE_NONE) {
+ availableOutputDevicesType = availableOutputDevices.types() & ~devices;
+ }
+ }
+ }
+ // FALL THROUGH
+
+ case STRATEGY_REROUTING:
+ case STRATEGY_MEDIA: {
+ uint32_t device2 = AUDIO_DEVICE_NONE;
+ if (strategy != STRATEGY_SONIFICATION) {
+ // no sonification on remote submix (e.g. WFD)
+ if (availableOutputDevices.getDevice(AUDIO_DEVICE_OUT_REMOTE_SUBMIX, String8("0")) != 0) {
+ device2 = availableOutputDevices.types() & AUDIO_DEVICE_OUT_REMOTE_SUBMIX;
+ }
+ }
+ if (isInCall() && (strategy == STRATEGY_MEDIA)) {
+ device = getDeviceForStrategy(STRATEGY_PHONE);
+ break;
+ }
+ if ((device2 == AUDIO_DEVICE_NONE) &&
+ (mForceUse[AUDIO_POLICY_FORCE_FOR_MEDIA] != AUDIO_POLICY_FORCE_NO_BT_A2DP) &&
+ (outputs.getA2dpOutput() != 0)) {
+ device2 = availableOutputDevicesType & AUDIO_DEVICE_OUT_BLUETOOTH_A2DP;
+ if (device2 == AUDIO_DEVICE_NONE) {
+ device2 = availableOutputDevicesType & AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES;
+ }
+ if (device2 == AUDIO_DEVICE_NONE) {
+ device2 = availableOutputDevicesType & AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER;
+ }
+ }
+ if ((device2 == AUDIO_DEVICE_NONE) &&
+ (mForceUse[AUDIO_POLICY_FORCE_FOR_MEDIA] == AUDIO_POLICY_FORCE_SPEAKER)) {
+ device2 = availableOutputDevicesType & AUDIO_DEVICE_OUT_SPEAKER;
+ }
+ if (device2 == AUDIO_DEVICE_NONE) {
+ device2 = availableOutputDevicesType & AUDIO_DEVICE_OUT_WIRED_HEADPHONE;
+ }
+ if (device2 == AUDIO_DEVICE_NONE) {
+ device2 = availableOutputDevicesType & AUDIO_DEVICE_OUT_LINE;
+ }
+ if (device2 == AUDIO_DEVICE_NONE) {
+ device2 = availableOutputDevicesType & AUDIO_DEVICE_OUT_WIRED_HEADSET;
+ }
+ if (device2 == AUDIO_DEVICE_NONE) {
+ device2 = availableOutputDevicesType & AUDIO_DEVICE_OUT_USB_ACCESSORY;
+ }
+ if (device2 == AUDIO_DEVICE_NONE) {
+ device2 = availableOutputDevicesType & AUDIO_DEVICE_OUT_USB_DEVICE;
+ }
+ if (device2 == AUDIO_DEVICE_NONE) {
+ device2 = availableOutputDevicesType & AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET;
+ }
+ if ((device2 == AUDIO_DEVICE_NONE) && (strategy != STRATEGY_SONIFICATION)) {
+ // no sonification on aux digital (e.g. HDMI)
+ device2 = availableOutputDevicesType & AUDIO_DEVICE_OUT_AUX_DIGITAL;
+ }
+ if ((device2 == AUDIO_DEVICE_NONE) &&
+ (mForceUse[AUDIO_POLICY_FORCE_FOR_DOCK] == AUDIO_POLICY_FORCE_ANALOG_DOCK)) {
+ device2 = availableOutputDevicesType & AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET;
+ }
+ if (device2 == AUDIO_DEVICE_NONE) {
+ device2 = availableOutputDevicesType & AUDIO_DEVICE_OUT_SPEAKER;
+ }
+ int device3 = AUDIO_DEVICE_NONE;
+ if (strategy == STRATEGY_MEDIA) {
+ // ARC, SPDIF and AUX_LINE can co-exist with others.
+ device3 = availableOutputDevicesType & AUDIO_DEVICE_OUT_HDMI_ARC;
+ device3 |= (availableOutputDevicesType & AUDIO_DEVICE_OUT_SPDIF);
+ device3 |= (availableOutputDevicesType & AUDIO_DEVICE_OUT_AUX_LINE);
+ }
+
+ device2 |= device3;
+ // device is DEVICE_OUT_SPEAKER if we come from case STRATEGY_SONIFICATION or
+ // STRATEGY_ENFORCED_AUDIBLE, AUDIO_DEVICE_NONE otherwise
+ device |= device2;
+
+ // If hdmi system audio mode is on, remove speaker out of output list.
+ if ((strategy == STRATEGY_MEDIA) &&
+ (mForceUse[AUDIO_POLICY_FORCE_FOR_HDMI_SYSTEM_AUDIO] ==
+ AUDIO_POLICY_FORCE_HDMI_SYSTEM_AUDIO_ENFORCED)) {
+ device &= ~AUDIO_DEVICE_OUT_SPEAKER;
+ }
+
+ if (device) break;
+ device = mApmObserver->getDefaultOutputDevice()->type();
+ if (device == AUDIO_DEVICE_NONE) {
+ ALOGE("getDeviceForStrategy() no device found for STRATEGY_MEDIA");
+ }
+ } break;
+
+ default:
+ ALOGW("getDeviceForStrategy() unknown strategy: %d", strategy);
+ break;
+ }
+
+ ALOGVV("getDeviceForStrategy() strategy %d, device %x", strategy, device);
+ return device;
+}
+
+
+audio_devices_t Engine::getDeviceForInputSource(audio_source_t inputSource) const
+{
+ const DeviceVector &availableOutputDevices = mApmObserver->getAvailableOutputDevices();
+ const DeviceVector &availableInputDevices = mApmObserver->getAvailableInputDevices();
+ const SwAudioOutputCollection &outputs = mApmObserver->getOutputs();
+ audio_devices_t availableDeviceTypes = availableInputDevices.types() & ~AUDIO_DEVICE_BIT_IN;
+
+ uint32_t device = AUDIO_DEVICE_NONE;
+
+ switch (inputSource) {
+ case AUDIO_SOURCE_VOICE_UPLINK:
+ if (availableDeviceTypes & AUDIO_DEVICE_IN_VOICE_CALL) {
+ device = AUDIO_DEVICE_IN_VOICE_CALL;
+ break;
+ }
+ break;
+
+ case AUDIO_SOURCE_DEFAULT:
+ case AUDIO_SOURCE_MIC:
+ if (availableDeviceTypes & AUDIO_DEVICE_IN_BLUETOOTH_A2DP) {
+ device = AUDIO_DEVICE_IN_BLUETOOTH_A2DP;
+ } else if ((mForceUse[AUDIO_POLICY_FORCE_FOR_RECORD] == AUDIO_POLICY_FORCE_BT_SCO) &&
+ (availableDeviceTypes & AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET)) {
+ device = AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET;
+ } else if (availableDeviceTypes & AUDIO_DEVICE_IN_WIRED_HEADSET) {
+ device = AUDIO_DEVICE_IN_WIRED_HEADSET;
+ } else if (availableDeviceTypes & AUDIO_DEVICE_IN_USB_DEVICE) {
+ device = AUDIO_DEVICE_IN_USB_DEVICE;
+ } else if (availableDeviceTypes & AUDIO_DEVICE_IN_BUILTIN_MIC) {
+ device = AUDIO_DEVICE_IN_BUILTIN_MIC;
+ }
+ break;
+
+ case AUDIO_SOURCE_VOICE_COMMUNICATION:
+ // Allow only use of devices on primary input if in call and HAL does not support routing
+ // to voice call path.
+ if ((getPhoneState() == AUDIO_MODE_IN_CALL) &&
+ (availableOutputDevices.types() & AUDIO_DEVICE_OUT_TELEPHONY_TX) == 0) {
+ sp<AudioOutputDescriptor> primaryOutput = outputs.getPrimaryOutput();
+ availableDeviceTypes =
+ availableInputDevices.getDevicesFromHwModule(primaryOutput->getModuleHandle())
+ & ~AUDIO_DEVICE_BIT_IN;
+ }
+
+ switch (mForceUse[AUDIO_POLICY_FORCE_FOR_COMMUNICATION]) {
+ case AUDIO_POLICY_FORCE_BT_SCO:
+ // if SCO device is requested but no SCO device is available, fall back to default case
+ if (availableDeviceTypes & AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET) {
+ device = AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET;
+ break;
+ }
+ // FALL THROUGH
+
+ default: // FORCE_NONE
+ if (availableDeviceTypes & AUDIO_DEVICE_IN_WIRED_HEADSET) {
+ device = AUDIO_DEVICE_IN_WIRED_HEADSET;
+ } else if (availableDeviceTypes & AUDIO_DEVICE_IN_USB_DEVICE) {
+ device = AUDIO_DEVICE_IN_USB_DEVICE;
+ } else if (availableDeviceTypes & AUDIO_DEVICE_IN_BUILTIN_MIC) {
+ device = AUDIO_DEVICE_IN_BUILTIN_MIC;
+ }
+ break;
+
+ case AUDIO_POLICY_FORCE_SPEAKER:
+ if (availableDeviceTypes & AUDIO_DEVICE_IN_BACK_MIC) {
+ device = AUDIO_DEVICE_IN_BACK_MIC;
+ } else if (availableDeviceTypes & AUDIO_DEVICE_IN_BUILTIN_MIC) {
+ device = AUDIO_DEVICE_IN_BUILTIN_MIC;
+ }
+ break;
+ }
+ break;
+
+ case AUDIO_SOURCE_VOICE_RECOGNITION:
+ case AUDIO_SOURCE_HOTWORD:
+ if (mForceUse[AUDIO_POLICY_FORCE_FOR_RECORD] == AUDIO_POLICY_FORCE_BT_SCO &&
+ availableDeviceTypes & AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET) {
+ device = AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET;
+ } else if (availableDeviceTypes & AUDIO_DEVICE_IN_WIRED_HEADSET) {
+ device = AUDIO_DEVICE_IN_WIRED_HEADSET;
+ } else if (availableDeviceTypes & AUDIO_DEVICE_IN_USB_DEVICE) {
+ device = AUDIO_DEVICE_IN_USB_DEVICE;
+ } else if (availableDeviceTypes & AUDIO_DEVICE_IN_BUILTIN_MIC) {
+ device = AUDIO_DEVICE_IN_BUILTIN_MIC;
+ }
+ break;
+ case AUDIO_SOURCE_CAMCORDER:
+ if (availableDeviceTypes & AUDIO_DEVICE_IN_BACK_MIC) {
+ device = AUDIO_DEVICE_IN_BACK_MIC;
+ } else if (availableDeviceTypes & AUDIO_DEVICE_IN_BUILTIN_MIC) {
+ device = AUDIO_DEVICE_IN_BUILTIN_MIC;
+ }
+ break;
+ case AUDIO_SOURCE_VOICE_DOWNLINK:
+ case AUDIO_SOURCE_VOICE_CALL:
+ if (availableDeviceTypes & AUDIO_DEVICE_IN_VOICE_CALL) {
+ device = AUDIO_DEVICE_IN_VOICE_CALL;
+ }
+ break;
+ case AUDIO_SOURCE_REMOTE_SUBMIX:
+ if (availableDeviceTypes & AUDIO_DEVICE_IN_REMOTE_SUBMIX) {
+ device = AUDIO_DEVICE_IN_REMOTE_SUBMIX;
+ }
+ break;
+ case AUDIO_SOURCE_FM_TUNER:
+ if (availableDeviceTypes & AUDIO_DEVICE_IN_FM_TUNER) {
+ device = AUDIO_DEVICE_IN_FM_TUNER;
+ }
+ break;
+ default:
+ ALOGW("getDeviceForInputSource() invalid input source %d", inputSource);
+ break;
+ }
+ ALOGV("getDeviceForInputSource()input source %d, device %08x", inputSource, device);
+ return device;
+}
+
+template <>
+AudioPolicyManagerInterface *Engine::queryInterface()
+{
+ return &mManagerInterface;
+}
+
+} // namespace audio_policy
+} // namespace android
+
+
diff --git a/services/audiopolicy/enginedefault/src/Engine.h b/services/audiopolicy/enginedefault/src/Engine.h
new file mode 100755
index 0000000..56a4748
--- /dev/null
+++ b/services/audiopolicy/enginedefault/src/Engine.h
@@ -0,0 +1,158 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+
+#include "AudioPolicyManagerInterface.h"
+#include "Gains.h"
+#include <AudioGain.h>
+#include <policy.h>
+
+namespace android
+{
+
+class AudioPolicyManagerObserver;
+
+namespace audio_policy
+{
+
+class Engine
+{
+public:
+ Engine();
+ virtual ~Engine();
+
+ template <class RequestedInterface>
+ RequestedInterface *queryInterface();
+
+private:
+ /// Interface members
+ class ManagerInterfaceImpl : public AudioPolicyManagerInterface
+ {
+ public:
+ ManagerInterfaceImpl(Engine *policyEngine)
+ : mPolicyEngine(policyEngine) {}
+
+ virtual void setObserver(AudioPolicyManagerObserver *observer)
+ {
+ mPolicyEngine->setObserver(observer);
+ }
+ virtual status_t initCheck()
+ {
+ return mPolicyEngine->initCheck();
+ }
+ virtual audio_devices_t getDeviceForInputSource(audio_source_t inputSource) const
+ {
+ return mPolicyEngine->getDeviceForInputSource(inputSource);
+ }
+ virtual audio_devices_t getDeviceForStrategy(routing_strategy strategy) const
+ {
+ return mPolicyEngine->getDeviceForStrategy(strategy);
+ }
+ virtual routing_strategy getStrategyForStream(audio_stream_type_t stream)
+ {
+ return mPolicyEngine->getStrategyForStream(stream);
+ }
+ virtual routing_strategy getStrategyForUsage(audio_usage_t usage)
+ {
+ return mPolicyEngine->getStrategyForUsage(usage);
+ }
+ virtual status_t setPhoneState(audio_mode_t mode)
+ {
+ return mPolicyEngine->setPhoneState(mode);
+ }
+ virtual audio_mode_t getPhoneState() const
+ {
+ return mPolicyEngine->getPhoneState();
+ }
+ virtual status_t setForceUse(audio_policy_force_use_t usage,
+ audio_policy_forced_cfg_t config)
+ {
+ return mPolicyEngine->setForceUse(usage, config);
+ }
+ virtual audio_policy_forced_cfg_t getForceUse(audio_policy_force_use_t usage) const
+ {
+ return mPolicyEngine->getForceUse(usage);
+ }
+ virtual status_t setDeviceConnectionState(const sp<DeviceDescriptor> /*devDesc*/,
+ audio_policy_dev_state_t /*state*/)
+ {
+ return NO_ERROR;
+ }
+ virtual status_t initStreamVolume(audio_stream_type_t stream, int indexMin, int indexMax)
+ {
+ return mPolicyEngine->initStreamVolume(stream, indexMin, indexMax);
+ }
+ virtual void initializeVolumeCurves(bool isSpeakerDrcEnabled)
+ {
+ return mPolicyEngine->initializeVolumeCurves(isSpeakerDrcEnabled);
+ }
+ virtual float volIndexToDb(Volume::device_category deviceCategory,
+ audio_stream_type_t stream,int indexInUi)
+ {
+ return mPolicyEngine->volIndexToDb(deviceCategory, stream, indexInUi);
+ }
+ private:
+ Engine *mPolicyEngine;
+ } mManagerInterface;
+
+private:
+ /* Copy facilities are put private to disable copy. */
+ Engine(const Engine &object);
+ Engine &operator=(const Engine &object);
+
+ void setObserver(AudioPolicyManagerObserver *observer);
+
+ status_t initCheck();
+
+ inline bool isInCall() const
+ {
+ return is_state_in_call(mPhoneState);
+ }
+
+ status_t setPhoneState(audio_mode_t mode);
+ audio_mode_t getPhoneState() const
+ {
+ return mPhoneState;
+ }
+ status_t setForceUse(audio_policy_force_use_t usage, audio_policy_forced_cfg_t config);
+ audio_policy_forced_cfg_t getForceUse(audio_policy_force_use_t usage) const
+ {
+ return mForceUse[usage];
+ }
+ status_t setDefaultDevice(audio_devices_t device);
+
+ routing_strategy getStrategyForStream(audio_stream_type_t stream);
+ routing_strategy getStrategyForUsage(audio_usage_t usage);
+ audio_devices_t getDeviceForStrategy(routing_strategy strategy) const;
+ audio_devices_t getDeviceForInputSource(audio_source_t inputSource) const;
+
+ float volIndexToDb(Volume::device_category category,
+ audio_stream_type_t stream, int indexInUi);
+ status_t initStreamVolume(audio_stream_type_t stream, int indexMin, int indexMax);
+ void initializeVolumeCurves(bool isSpeakerDrcEnabled);
+
+ audio_mode_t mPhoneState; /**< current phone state. */
+
+ /** current forced use configuration. */
+ audio_policy_forced_cfg_t mForceUse[AUDIO_POLICY_FORCE_USE_CNT];
+
+ AudioPolicyManagerObserver *mApmObserver;
+};
+} // namespace audio_policy
+} // namespace android
+
diff --git a/services/audiopolicy/enginedefault/src/EngineInstance.cpp b/services/audiopolicy/enginedefault/src/EngineInstance.cpp
new file mode 100755
index 0000000..17e9832
--- /dev/null
+++ b/services/audiopolicy/enginedefault/src/EngineInstance.cpp
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <AudioPolicyManagerInterface.h>
+#include "AudioPolicyEngineInstance.h"
+#include "Engine.h"
+
+namespace android
+{
+namespace audio_policy
+{
+
+EngineInstance::EngineInstance()
+{
+}
+
+EngineInstance *EngineInstance::getInstance()
+{
+ static EngineInstance instance;
+ return &instance;
+}
+
+EngineInstance::~EngineInstance()
+{
+}
+
+Engine *EngineInstance::getEngine() const
+{
+ static Engine engine;
+ return &engine;
+}
+
+template <>
+AudioPolicyManagerInterface *EngineInstance::queryInterface() const
+{
+ return getEngine()->queryInterface<AudioPolicyManagerInterface>();
+}
+
+} // namespace audio_policy
+} // namespace android
+
diff --git a/services/audiopolicy/enginedefault/src/Gains.cpp b/services/audiopolicy/enginedefault/src/Gains.cpp
new file mode 100644
index 0000000..78f2909
--- /dev/null
+++ b/services/audiopolicy/enginedefault/src/Gains.cpp
@@ -0,0 +1,255 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "APM::Gains"
+//#define LOG_NDEBUG 0
+
+//#define VERY_VERBOSE_LOGGING
+#ifdef VERY_VERBOSE_LOGGING
+#define ALOGVV ALOGV
+#else
+#define ALOGVV(a...) do { } while(0)
+#endif
+
+#include "Gains.h"
+#include <Volume.h>
+#include <math.h>
+#include <utils/String8.h>
+
+namespace android {
+
+// Enginedefault
+const VolumeCurvePoint
+Gains::sDefaultVolumeCurve[Volume::VOLCNT] = {
+ {1, -49.5f}, {33, -33.5f}, {66, -17.0f}, {100, 0.0f}
+};
+
+
+const VolumeCurvePoint
+Gains::sDefaultMediaVolumeCurve[Volume::VOLCNT] = {
+ {1, -58.0f}, {20, -40.0f}, {60, -17.0f}, {100, 0.0f}
+};
+
+const VolumeCurvePoint
+Gains::sExtMediaSystemVolumeCurve[Volume::VOLCNT] = {
+ {1, -58.0f}, {20, -40.0f}, {60, -21.0f}, {100, -10.0f}
+};
+
+const VolumeCurvePoint
+Gains::sSpeakerMediaVolumeCurve[Volume::VOLCNT] = {
+ {1, -56.0f}, {20, -34.0f}, {60, -11.0f}, {100, 0.0f}
+};
+
+const VolumeCurvePoint
+Gains::sSpeakerMediaVolumeCurveDrc[Volume::VOLCNT] = {
+ {1, -55.0f}, {20, -43.0f}, {86, -12.0f}, {100, 0.0f}
+};
+
+const VolumeCurvePoint
+Gains::sSpeakerSonificationVolumeCurve[Volume::VOLCNT] = {
+ {1, -29.7f}, {33, -20.1f}, {66, -10.2f}, {100, 0.0f}
+};
+
+const VolumeCurvePoint
+Gains::sSpeakerSonificationVolumeCurveDrc[Volume::VOLCNT] = {
+ {1, -35.7f}, {33, -26.1f}, {66, -13.2f}, {100, 0.0f}
+};
+
+// AUDIO_STREAM_SYSTEM, AUDIO_STREAM_ENFORCED_AUDIBLE and AUDIO_STREAM_DTMF volume tracks
+// AUDIO_STREAM_RING on phones and AUDIO_STREAM_MUSIC on tablets.
+// AUDIO_STREAM_DTMF tracks AUDIO_STREAM_VOICE_CALL while in call (See AudioService.java).
+// The range is constrained between -24dB and -6dB over speaker and -30dB and -18dB over headset.
+
+const VolumeCurvePoint
+Gains::sDefaultSystemVolumeCurve[Volume::VOLCNT] = {
+ {1, -24.0f}, {33, -18.0f}, {66, -12.0f}, {100, -6.0f}
+};
+
+const VolumeCurvePoint
+Gains::sDefaultSystemVolumeCurveDrc[Volume::VOLCNT] = {
+ {1, -34.0f}, {33, -24.0f}, {66, -15.0f}, {100, -6.0f}
+};
+
+const VolumeCurvePoint
+Gains::sHeadsetSystemVolumeCurve[Volume::VOLCNT] = {
+ {1, -30.0f}, {33, -26.0f}, {66, -22.0f}, {100, -18.0f}
+};
+
+const VolumeCurvePoint
+Gains::sDefaultVoiceVolumeCurve[Volume::VOLCNT] = {
+ {0, -42.0f}, {33, -28.0f}, {66, -14.0f}, {100, 0.0f}
+};
+
+const VolumeCurvePoint
+Gains::sSpeakerVoiceVolumeCurve[Volume::VOLCNT] = {
+ {0, -24.0f}, {33, -16.0f}, {66, -8.0f}, {100, 0.0f}
+};
+
+const VolumeCurvePoint
+Gains::sLinearVolumeCurve[Volume::VOLCNT] = {
+ {0, -96.0f}, {33, -68.0f}, {66, -34.0f}, {100, 0.0f}
+};
+
+const VolumeCurvePoint
+Gains::sSilentVolumeCurve[Volume::VOLCNT] = {
+ {0, -96.0f}, {1, -96.0f}, {2, -96.0f}, {100, -96.0f}
+};
+
+const VolumeCurvePoint
+Gains::sFullScaleVolumeCurve[Volume::VOLCNT] = {
+ {0, 0.0f}, {1, 0.0f}, {2, 0.0f}, {100, 0.0f}
+};
+
+const VolumeCurvePoint *Gains::sVolumeProfiles[AUDIO_STREAM_CNT]
+ [Volume::DEVICE_CATEGORY_CNT] = {
+ { // AUDIO_STREAM_VOICE_CALL
+ Gains::sDefaultVoiceVolumeCurve, // DEVICE_CATEGORY_HEADSET
+ Gains::sSpeakerVoiceVolumeCurve, // DEVICE_CATEGORY_SPEAKER
+ Gains::sSpeakerVoiceVolumeCurve, // DEVICE_CATEGORY_EARPIECE
+ Gains::sDefaultMediaVolumeCurve // DEVICE_CATEGORY_EXT_MEDIA
+ },
+ { // AUDIO_STREAM_SYSTEM
+ Gains::sHeadsetSystemVolumeCurve, // DEVICE_CATEGORY_HEADSET
+ Gains::sDefaultSystemVolumeCurve, // DEVICE_CATEGORY_SPEAKER
+ Gains::sDefaultSystemVolumeCurve, // DEVICE_CATEGORY_EARPIECE
+ Gains::sExtMediaSystemVolumeCurve // DEVICE_CATEGORY_EXT_MEDIA
+ },
+ { // AUDIO_STREAM_RING
+ Gains::sDefaultVolumeCurve, // DEVICE_CATEGORY_HEADSET
+ Gains::sSpeakerSonificationVolumeCurve, // DEVICE_CATEGORY_SPEAKER
+ Gains::sDefaultVolumeCurve, // DEVICE_CATEGORY_EARPIECE
+ Gains::sExtMediaSystemVolumeCurve // DEVICE_CATEGORY_EXT_MEDIA
+ },
+ { // AUDIO_STREAM_MUSIC
+ Gains::sDefaultMediaVolumeCurve, // DEVICE_CATEGORY_HEADSET
+ Gains::sSpeakerMediaVolumeCurve, // DEVICE_CATEGORY_SPEAKER
+ Gains::sDefaultMediaVolumeCurve, // DEVICE_CATEGORY_EARPIECE
+ Gains::sDefaultMediaVolumeCurve // DEVICE_CATEGORY_EXT_MEDIA
+ },
+ { // AUDIO_STREAM_ALARM
+ Gains::sDefaultVolumeCurve, // DEVICE_CATEGORY_HEADSET
+ Gains::sSpeakerSonificationVolumeCurve, // DEVICE_CATEGORY_SPEAKER
+ Gains::sDefaultVolumeCurve, // DEVICE_CATEGORY_EARPIECE
+ Gains::sExtMediaSystemVolumeCurve // DEVICE_CATEGORY_EXT_MEDIA
+ },
+ { // AUDIO_STREAM_NOTIFICATION
+ Gains::sDefaultVolumeCurve, // DEVICE_CATEGORY_HEADSET
+ Gains::sSpeakerSonificationVolumeCurve, // DEVICE_CATEGORY_SPEAKER
+ Gains::sDefaultVolumeCurve, // DEVICE_CATEGORY_EARPIECE
+ Gains::sExtMediaSystemVolumeCurve // DEVICE_CATEGORY_EXT_MEDIA
+ },
+ { // AUDIO_STREAM_BLUETOOTH_SCO
+ Gains::sDefaultVoiceVolumeCurve, // DEVICE_CATEGORY_HEADSET
+ Gains::sSpeakerVoiceVolumeCurve, // DEVICE_CATEGORY_SPEAKER
+ Gains::sDefaultVoiceVolumeCurve, // DEVICE_CATEGORY_EARPIECE
+ Gains::sDefaultMediaVolumeCurve // DEVICE_CATEGORY_EXT_MEDIA
+ },
+ { // AUDIO_STREAM_ENFORCED_AUDIBLE
+ Gains::sHeadsetSystemVolumeCurve, // DEVICE_CATEGORY_HEADSET
+ Gains::sDefaultSystemVolumeCurve, // DEVICE_CATEGORY_SPEAKER
+ Gains::sDefaultSystemVolumeCurve, // DEVICE_CATEGORY_EARPIECE
+ Gains::sExtMediaSystemVolumeCurve // DEVICE_CATEGORY_EXT_MEDIA
+ },
+ { // AUDIO_STREAM_DTMF
+ Gains::sHeadsetSystemVolumeCurve, // DEVICE_CATEGORY_HEADSET
+ Gains::sDefaultSystemVolumeCurve, // DEVICE_CATEGORY_SPEAKER
+ Gains::sDefaultSystemVolumeCurve, // DEVICE_CATEGORY_EARPIECE
+ Gains::sExtMediaSystemVolumeCurve // DEVICE_CATEGORY_EXT_MEDIA
+ },
+ { // AUDIO_STREAM_TTS
+ // "Transmitted Through Speaker": always silent except on DEVICE_CATEGORY_SPEAKER
+ Gains::sSilentVolumeCurve, // DEVICE_CATEGORY_HEADSET
+ Gains::sLinearVolumeCurve, // DEVICE_CATEGORY_SPEAKER
+ Gains::sSilentVolumeCurve, // DEVICE_CATEGORY_EARPIECE
+ Gains::sSilentVolumeCurve // DEVICE_CATEGORY_EXT_MEDIA
+ },
+ { // AUDIO_STREAM_ACCESSIBILITY
+ Gains::sDefaultMediaVolumeCurve, // DEVICE_CATEGORY_HEADSET
+ Gains::sSpeakerMediaVolumeCurve, // DEVICE_CATEGORY_SPEAKER
+ Gains::sDefaultMediaVolumeCurve, // DEVICE_CATEGORY_EARPIECE
+ Gains::sDefaultMediaVolumeCurve // DEVICE_CATEGORY_EXT_MEDIA
+ },
+ { // AUDIO_STREAM_REROUTING
+ Gains::sFullScaleVolumeCurve, // DEVICE_CATEGORY_HEADSET
+ Gains::sFullScaleVolumeCurve, // DEVICE_CATEGORY_SPEAKER
+ Gains::sFullScaleVolumeCurve, // DEVICE_CATEGORY_EARPIECE
+ Gains::sFullScaleVolumeCurve // DEVICE_CATEGORY_EXT_MEDIA
+ },
+ { // AUDIO_STREAM_PATCH
+ Gains::sFullScaleVolumeCurve, // DEVICE_CATEGORY_HEADSET
+ Gains::sFullScaleVolumeCurve, // DEVICE_CATEGORY_SPEAKER
+ Gains::sFullScaleVolumeCurve, // DEVICE_CATEGORY_EARPIECE
+ Gains::sFullScaleVolumeCurve // DEVICE_CATEGORY_EXT_MEDIA
+ },
+};
+
+//static
+float Gains::volIndexToDb(Volume::device_category deviceCategory,
+ const StreamDescriptor& streamDesc,
+ int indexInUi)
+{
+ const VolumeCurvePoint *curve = streamDesc.getVolumeCurvePoint(deviceCategory);
+
+ // the volume index in the UI is relative to the min and max volume indices for this stream type
+ int nbSteps = 1 + curve[Volume::VOLMAX].mIndex -
+ curve[Volume::VOLMIN].mIndex;
+ int volIdx = (nbSteps * (indexInUi - streamDesc.getVolumeIndexMin())) /
+ (streamDesc.getVolumeIndexMax() - streamDesc.getVolumeIndexMin());
+
+ // find what part of the curve this index volume belongs to, or if it's out of bounds
+ int segment = 0;
+ if (volIdx < curve[Volume::VOLMIN].mIndex) { // out of bounds
+ return VOLUME_MIN_DB;
+ } else if (volIdx < curve[Volume::VOLKNEE1].mIndex) {
+ segment = 0;
+ } else if (volIdx < curve[Volume::VOLKNEE2].mIndex) {
+ segment = 1;
+ } else if (volIdx <= curve[Volume::VOLMAX].mIndex) {
+ segment = 2;
+ } else { // out of bounds
+ return 0.0f;
+ }
+
+ // linear interpolation in the attenuation table in dB
+ float decibels = curve[segment].mDBAttenuation +
+ ((float)(volIdx - curve[segment].mIndex)) *
+ ( (curve[segment+1].mDBAttenuation -
+ curve[segment].mDBAttenuation) /
+ ((float)(curve[segment+1].mIndex -
+ curve[segment].mIndex)) );
+
+ ALOGVV("VOLUME vol index=[%d %d %d], dB=[%.1f %.1f %.1f]",
+ curve[segment].mIndex, volIdx,
+ curve[segment+1].mIndex,
+ curve[segment].mDBAttenuation,
+ decibels,
+ curve[segment+1].mDBAttenuation);
+
+ return decibels;
+}
+
+
+//static
+float Gains::volIndexToAmpl(Volume::device_category deviceCategory,
+ const StreamDescriptor& streamDesc,
+ int indexInUi)
+{
+ return Volume::DbToAmpl(volIndexToDb(deviceCategory, streamDesc, indexInUi));
+}
+
+
+
+}; // namespace android
diff --git a/services/audiopolicy/enginedefault/src/Gains.h b/services/audiopolicy/enginedefault/src/Gains.h
new file mode 100644
index 0000000..7620b7d
--- /dev/null
+++ b/services/audiopolicy/enginedefault/src/Gains.h
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <StreamDescriptor.h>
+#include <utils/KeyedVector.h>
+#include <system/audio.h>
+#include <utils/Errors.h>
+#include <utils/RefBase.h>
+
+namespace android {
+
+class StreamDescriptor;
+
+class Gains
+{
+public :
+ static float volIndexToAmpl(Volume::device_category deviceCategory,
+ const StreamDescriptor& streamDesc,
+ int indexInUi);
+
+ static float volIndexToDb(Volume::device_category deviceCategory,
+ const StreamDescriptor& streamDesc,
+ int indexInUi);
+
+ // default volume curve
+ static const VolumeCurvePoint sDefaultVolumeCurve[Volume::VOLCNT];
+ // default volume curve for media strategy
+ static const VolumeCurvePoint sDefaultMediaVolumeCurve[Volume::VOLCNT];
+ // volume curve for non-media audio on ext media outputs (HDMI, Line, etc)
+ static const VolumeCurvePoint sExtMediaSystemVolumeCurve[Volume::VOLCNT];
+ // volume curve for media strategy on speakers
+ static const VolumeCurvePoint sSpeakerMediaVolumeCurve[Volume::VOLCNT];
+ static const VolumeCurvePoint sSpeakerMediaVolumeCurveDrc[Volume::VOLCNT];
+ // volume curve for sonification strategy on speakers
+ static const VolumeCurvePoint sSpeakerSonificationVolumeCurve[Volume::VOLCNT];
+ static const VolumeCurvePoint sSpeakerSonificationVolumeCurveDrc[Volume::VOLCNT];
+ static const VolumeCurvePoint sDefaultSystemVolumeCurve[Volume::VOLCNT];
+ static const VolumeCurvePoint sDefaultSystemVolumeCurveDrc[Volume::VOLCNT];
+ static const VolumeCurvePoint sHeadsetSystemVolumeCurve[Volume::VOLCNT];
+ static const VolumeCurvePoint sDefaultVoiceVolumeCurve[Volume::VOLCNT];
+ static const VolumeCurvePoint sSpeakerVoiceVolumeCurve[Volume::VOLCNT];
+ static const VolumeCurvePoint sLinearVolumeCurve[Volume::VOLCNT];
+ static const VolumeCurvePoint sSilentVolumeCurve[Volume::VOLCNT];
+ static const VolumeCurvePoint sFullScaleVolumeCurve[Volume::VOLCNT];
+ // default volume curves per stream and device category. See initializeVolumeCurves()
+ static const VolumeCurvePoint *sVolumeProfiles[AUDIO_STREAM_CNT][Volume::DEVICE_CATEGORY_CNT];
+};
+
+}; // namespace android
diff --git a/services/audiopolicy/AudioPolicyFactory.cpp b/services/audiopolicy/manager/AudioPolicyFactory.cpp
index 2ae7bc1..9910a1f 100644
--- a/services/audiopolicy/AudioPolicyFactory.cpp
+++ b/services/audiopolicy/manager/AudioPolicyFactory.cpp
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "AudioPolicyManager.h"
+#include "managerdefault/AudioPolicyManager.h"
namespace android {
diff --git a/services/audiopolicy/AudioPolicyManager.cpp b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
index 6ebd0ed..fc27789 100644
--- a/services/audiopolicy/AudioPolicyManager.cpp
+++ b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#define LOG_TAG "AudioPolicyManager"
+#define LOG_TAG "APM::AudioPolicyManager"
//#define LOG_NDEBUG 0
//#define VERY_VERBOSE_LOGGING
@@ -24,20 +24,11 @@
#define ALOGVV(a...) do { } while(0)
#endif
-// A device mask for all audio input devices that are considered "virtual" when evaluating
-// active inputs in getActiveInput()
-#define APM_AUDIO_IN_DEVICE_VIRTUAL_ALL (AUDIO_DEVICE_IN_REMOTE_SUBMIX|AUDIO_DEVICE_IN_FM_TUNER)
-// A device mask for all audio output devices that are considered "remote" when evaluating
-// active output devices in isStreamActiveRemotely()
-#define APM_AUDIO_OUT_DEVICE_REMOTE_ALL AUDIO_DEVICE_OUT_REMOTE_SUBMIX
-// A device mask for all audio input and output devices where matching inputs/outputs on device
-// type alone is not enough: the address must match too
-#define APM_AUDIO_DEVICE_MATCH_ADDRESS_ALL (AUDIO_DEVICE_IN_REMOTE_SUBMIX | \
- AUDIO_DEVICE_OUT_REMOTE_SUBMIX)
-
#include <inttypes.h>
#include <math.h>
+#include <AudioPolicyManagerInterface.h>
+#include <AudioPolicyEngineInstance.h>
#include <cutils/properties.h>
#include <utils/Log.h>
#include <hardware/audio.h>
@@ -47,188 +38,36 @@
#include <soundtrigger/SoundTrigger.h>
#include "AudioPolicyManager.h"
#include "audio_policy_conf.h"
+#include <ConfigParsingUtils.h>
+#include <policy.h>
namespace android {
// ----------------------------------------------------------------------------
-// Definitions for audio_policy.conf file parsing
-// ----------------------------------------------------------------------------
-
-struct StringToEnum {
- const char *name;
- uint32_t value;
-};
-
-#define STRING_TO_ENUM(string) { #string, string }
-#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
-
-const StringToEnum sDeviceNameToEnumTable[] = {
- STRING_TO_ENUM(AUDIO_DEVICE_OUT_EARPIECE),
- STRING_TO_ENUM(AUDIO_DEVICE_OUT_SPEAKER),
- STRING_TO_ENUM(AUDIO_DEVICE_OUT_SPEAKER_SAFE),
- STRING_TO_ENUM(AUDIO_DEVICE_OUT_WIRED_HEADSET),
- STRING_TO_ENUM(AUDIO_DEVICE_OUT_WIRED_HEADPHONE),
- STRING_TO_ENUM(AUDIO_DEVICE_OUT_BLUETOOTH_SCO),
- STRING_TO_ENUM(AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET),
- STRING_TO_ENUM(AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT),
- STRING_TO_ENUM(AUDIO_DEVICE_OUT_ALL_SCO),
- STRING_TO_ENUM(AUDIO_DEVICE_OUT_BLUETOOTH_A2DP),
- STRING_TO_ENUM(AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES),
- STRING_TO_ENUM(AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER),
- STRING_TO_ENUM(AUDIO_DEVICE_OUT_ALL_A2DP),
- STRING_TO_ENUM(AUDIO_DEVICE_OUT_AUX_DIGITAL),
- STRING_TO_ENUM(AUDIO_DEVICE_OUT_HDMI),
- STRING_TO_ENUM(AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET),
- STRING_TO_ENUM(AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET),
- STRING_TO_ENUM(AUDIO_DEVICE_OUT_USB_ACCESSORY),
- STRING_TO_ENUM(AUDIO_DEVICE_OUT_USB_DEVICE),
- STRING_TO_ENUM(AUDIO_DEVICE_OUT_ALL_USB),
- STRING_TO_ENUM(AUDIO_DEVICE_OUT_REMOTE_SUBMIX),
- STRING_TO_ENUM(AUDIO_DEVICE_OUT_TELEPHONY_TX),
- STRING_TO_ENUM(AUDIO_DEVICE_OUT_LINE),
- STRING_TO_ENUM(AUDIO_DEVICE_OUT_HDMI_ARC),
- STRING_TO_ENUM(AUDIO_DEVICE_OUT_SPDIF),
- STRING_TO_ENUM(AUDIO_DEVICE_OUT_FM),
- STRING_TO_ENUM(AUDIO_DEVICE_OUT_AUX_LINE),
- STRING_TO_ENUM(AUDIO_DEVICE_IN_AMBIENT),
- STRING_TO_ENUM(AUDIO_DEVICE_IN_BUILTIN_MIC),
- STRING_TO_ENUM(AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET),
- STRING_TO_ENUM(AUDIO_DEVICE_IN_ALL_SCO),
- STRING_TO_ENUM(AUDIO_DEVICE_IN_WIRED_HEADSET),
- STRING_TO_ENUM(AUDIO_DEVICE_IN_AUX_DIGITAL),
- STRING_TO_ENUM(AUDIO_DEVICE_IN_HDMI),
- STRING_TO_ENUM(AUDIO_DEVICE_IN_TELEPHONY_RX),
- STRING_TO_ENUM(AUDIO_DEVICE_IN_VOICE_CALL),
- STRING_TO_ENUM(AUDIO_DEVICE_IN_BACK_MIC),
- STRING_TO_ENUM(AUDIO_DEVICE_IN_REMOTE_SUBMIX),
- STRING_TO_ENUM(AUDIO_DEVICE_IN_ANLG_DOCK_HEADSET),
- STRING_TO_ENUM(AUDIO_DEVICE_IN_DGTL_DOCK_HEADSET),
- STRING_TO_ENUM(AUDIO_DEVICE_IN_USB_ACCESSORY),
- STRING_TO_ENUM(AUDIO_DEVICE_IN_USB_DEVICE),
- STRING_TO_ENUM(AUDIO_DEVICE_IN_FM_TUNER),
- STRING_TO_ENUM(AUDIO_DEVICE_IN_TV_TUNER),
- STRING_TO_ENUM(AUDIO_DEVICE_IN_LINE),
- STRING_TO_ENUM(AUDIO_DEVICE_IN_SPDIF),
- STRING_TO_ENUM(AUDIO_DEVICE_IN_BLUETOOTH_A2DP),
- STRING_TO_ENUM(AUDIO_DEVICE_IN_LOOPBACK),
-};
-
-const StringToEnum sOutputFlagNameToEnumTable[] = {
- STRING_TO_ENUM(AUDIO_OUTPUT_FLAG_DIRECT),
- STRING_TO_ENUM(AUDIO_OUTPUT_FLAG_PRIMARY),
- STRING_TO_ENUM(AUDIO_OUTPUT_FLAG_FAST),
- STRING_TO_ENUM(AUDIO_OUTPUT_FLAG_DEEP_BUFFER),
- STRING_TO_ENUM(AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD),
- STRING_TO_ENUM(AUDIO_OUTPUT_FLAG_NON_BLOCKING),
- STRING_TO_ENUM(AUDIO_OUTPUT_FLAG_HW_AV_SYNC),
-};
-
-const StringToEnum sInputFlagNameToEnumTable[] = {
- STRING_TO_ENUM(AUDIO_INPUT_FLAG_FAST),
- STRING_TO_ENUM(AUDIO_INPUT_FLAG_HW_HOTWORD),
-};
-
-const StringToEnum sFormatNameToEnumTable[] = {
- STRING_TO_ENUM(AUDIO_FORMAT_PCM_16_BIT),
- STRING_TO_ENUM(AUDIO_FORMAT_PCM_8_BIT),
- STRING_TO_ENUM(AUDIO_FORMAT_PCM_32_BIT),
- STRING_TO_ENUM(AUDIO_FORMAT_PCM_8_24_BIT),
- STRING_TO_ENUM(AUDIO_FORMAT_PCM_FLOAT),
- STRING_TO_ENUM(AUDIO_FORMAT_PCM_24_BIT_PACKED),
- STRING_TO_ENUM(AUDIO_FORMAT_MP3),
- STRING_TO_ENUM(AUDIO_FORMAT_AAC),
- STRING_TO_ENUM(AUDIO_FORMAT_AAC_MAIN),
- STRING_TO_ENUM(AUDIO_FORMAT_AAC_LC),
- STRING_TO_ENUM(AUDIO_FORMAT_AAC_SSR),
- STRING_TO_ENUM(AUDIO_FORMAT_AAC_LTP),
- STRING_TO_ENUM(AUDIO_FORMAT_AAC_HE_V1),
- STRING_TO_ENUM(AUDIO_FORMAT_AAC_SCALABLE),
- STRING_TO_ENUM(AUDIO_FORMAT_AAC_ERLC),
- STRING_TO_ENUM(AUDIO_FORMAT_AAC_LD),
- STRING_TO_ENUM(AUDIO_FORMAT_AAC_HE_V2),
- STRING_TO_ENUM(AUDIO_FORMAT_AAC_ELD),
- STRING_TO_ENUM(AUDIO_FORMAT_VORBIS),
- STRING_TO_ENUM(AUDIO_FORMAT_HE_AAC_V1),
- STRING_TO_ENUM(AUDIO_FORMAT_HE_AAC_V2),
- STRING_TO_ENUM(AUDIO_FORMAT_OPUS),
- STRING_TO_ENUM(AUDIO_FORMAT_AC3),
- STRING_TO_ENUM(AUDIO_FORMAT_E_AC3),
-};
-
-const StringToEnum sOutChannelsNameToEnumTable[] = {
- STRING_TO_ENUM(AUDIO_CHANNEL_OUT_MONO),
- STRING_TO_ENUM(AUDIO_CHANNEL_OUT_STEREO),
- STRING_TO_ENUM(AUDIO_CHANNEL_OUT_QUAD),
- STRING_TO_ENUM(AUDIO_CHANNEL_OUT_5POINT1),
- STRING_TO_ENUM(AUDIO_CHANNEL_OUT_7POINT1),
-};
-
-const StringToEnum sInChannelsNameToEnumTable[] = {
- STRING_TO_ENUM(AUDIO_CHANNEL_IN_MONO),
- STRING_TO_ENUM(AUDIO_CHANNEL_IN_STEREO),
- STRING_TO_ENUM(AUDIO_CHANNEL_IN_FRONT_BACK),
-};
-
-const StringToEnum sGainModeNameToEnumTable[] = {
- STRING_TO_ENUM(AUDIO_GAIN_MODE_JOINT),
- STRING_TO_ENUM(AUDIO_GAIN_MODE_CHANNELS),
- STRING_TO_ENUM(AUDIO_GAIN_MODE_RAMP),
-};
-
-
-uint32_t AudioPolicyManager::stringToEnum(const struct StringToEnum *table,
- size_t size,
- const char *name)
-{
- for (size_t i = 0; i < size; i++) {
- if (strcmp(table[i].name, name) == 0) {
- ALOGV("stringToEnum() found %s", table[i].name);
- return table[i].value;
- }
- }
- return 0;
-}
-
-const char *AudioPolicyManager::enumToString(const struct StringToEnum *table,
- size_t size,
- uint32_t value)
-{
- for (size_t i = 0; i < size; i++) {
- if (table[i].value == value) {
- return table[i].name;
- }
- }
- return "";
-}
-
-bool AudioPolicyManager::stringToBool(const char *value)
-{
- return ((strcasecmp("true", value) == 0) || (strcmp("1", value) == 0));
-}
-
-
-// ----------------------------------------------------------------------------
// AudioPolicyInterface implementation
// ----------------------------------------------------------------------------
status_t AudioPolicyManager::setDeviceConnectionState(audio_devices_t device,
- audio_policy_dev_state_t state,
- const char *device_address)
+ audio_policy_dev_state_t state,
+ const char *device_address,
+ const char *device_name)
{
- return setDeviceConnectionStateInt(device, state, device_address);
+ return setDeviceConnectionStateInt(device, state, device_address, device_name);
}
status_t AudioPolicyManager::setDeviceConnectionStateInt(audio_devices_t device,
audio_policy_dev_state_t state,
- const char *device_address)
+ const char *device_address,
+ const char *device_name)
{
- ALOGV("setDeviceConnectionState() device: %x, state %d, address %s",
- device, state, device_address != NULL ? device_address : "");
+ ALOGV("setDeviceConnectionStateInt() device: 0x%X, state %d, address %s name %s",
+- device, state, device_address, device_name);
// connect/disconnect only 1 device at a time
if (!audio_is_output_device(device) && !audio_is_input_device(device)) return BAD_VALUE;
- sp<DeviceDescriptor> devDesc = getDeviceDescriptor(device, device_address);
+ sp<DeviceDescriptor> devDesc =
+ mHwModules.getDeviceDescriptor(device, device_address, device_name);
// handle output devices
if (audio_is_output_device(device)) {
@@ -252,15 +91,14 @@ status_t AudioPolicyManager::setDeviceConnectionStateInt(audio_devices_t device,
// register new device as available
index = mAvailableOutputDevices.add(devDesc);
if (index >= 0) {
- sp<HwModule> module = getModuleForDevice(device);
+ sp<HwModule> module = mHwModules.getModuleForDevice(device);
if (module == 0) {
ALOGD("setDeviceConnectionState() could not find HW module for device %08x",
device);
mAvailableOutputDevices.remove(devDesc);
return INVALID_OPERATION;
}
- mAvailableOutputDevices[index]->mId = nextUniqueId();
- mAvailableOutputDevices[index]->mModule = module;
+ mAvailableOutputDevices[index]->attach(module);
} else {
return NO_MEMORY;
}
@@ -269,14 +107,16 @@ status_t AudioPolicyManager::setDeviceConnectionStateInt(audio_devices_t device,
mAvailableOutputDevices.remove(devDesc);
return INVALID_OPERATION;
}
+ // Propagate device availability to Engine
+ mEngine->setDeviceConnectionState(devDesc, state);
+
// outputs should never be empty here
ALOG_ASSERT(outputs.size() != 0, "setDeviceConnectionState():"
"checkOutputsForDevice() returned no outputs but status OK");
ALOGV("setDeviceConnectionState() checkOutputsForDevice() returned %zu outputs",
outputs.size());
-
- // Set connect to HALs
+ // Send connect to HALs
AudioParameter param = AudioParameter(devDesc->mAddress);
param.addInt(String8(AUDIO_PARAMETER_DEVICE_CONNECT), device);
mpClientInterface->setParameters(AUDIO_IO_HANDLE_NONE, param.toString());
@@ -291,7 +131,7 @@ status_t AudioPolicyManager::setDeviceConnectionStateInt(audio_devices_t device,
ALOGV("setDeviceConnectionState() disconnecting output device %x", device);
- // Set Disconnect to HALs
+ // Send Disconnect to HALs
AudioParameter param = AudioParameter(devDesc->mAddress);
param.addInt(String8(AUDIO_PARAMETER_DEVICE_DISCONNECT), device);
mpClientInterface->setParameters(AUDIO_IO_HANDLE_NONE, param.toString());
@@ -300,6 +140,9 @@ status_t AudioPolicyManager::setDeviceConnectionStateInt(audio_devices_t device,
mAvailableOutputDevices.remove(devDesc);
checkOutputsForDevice(devDesc, state, outputs, devDesc->mAddress);
+
+ // Propagate device availability to Engine
+ mEngine->setDeviceConnectionState(devDesc, state);
} break;
default:
@@ -314,7 +157,7 @@ status_t AudioPolicyManager::setDeviceConnectionStateInt(audio_devices_t device,
// outputs must be closed after checkOutputForAllStrategies() is executed
if (!outputs.isEmpty()) {
for (size_t i = 0; i < outputs.size(); i++) {
- sp<AudioOutputDescriptor> desc = mOutputs.valueFor(outputs[i]);
+ sp<SwAudioOutputDescriptor> desc = mOutputs.valueFor(outputs[i]);
// close unused outputs after device disconnection or direct outputs that have been
// opened by checkOutputsForDevice() to query dynamic parameters
if ((state == AUDIO_POLICY_DEVICE_STATE_UNAVAILABLE) ||
@@ -328,23 +171,22 @@ status_t AudioPolicyManager::setDeviceConnectionStateInt(audio_devices_t device,
}
updateDevicesAndOutputs();
- if (mPhoneState == AUDIO_MODE_IN_CALL) {
+ if (mEngine->getPhoneState() == AUDIO_MODE_IN_CALL && hasPrimaryOutput()) {
audio_devices_t newDevice = getNewOutputDevice(mPrimaryOutput, false /*fromCache*/);
updateCallRouting(newDevice);
}
for (size_t i = 0; i < mOutputs.size(); i++) {
- audio_io_handle_t output = mOutputs.keyAt(i);
- if ((mPhoneState != AUDIO_MODE_IN_CALL) || (output != mPrimaryOutput)) {
- audio_devices_t newDevice = getNewOutputDevice(mOutputs.keyAt(i),
- true /*fromCache*/);
+ sp<SwAudioOutputDescriptor> desc = mOutputs.valueAt(i);
+ if ((mEngine->getPhoneState() != AUDIO_MODE_IN_CALL) || (desc != mPrimaryOutput)) {
+ audio_devices_t newDevice = getNewOutputDevice(desc, true /*fromCache*/);
// do not force device change on duplicated output because if device is 0, it will
// also force a device 0 for the two outputs it is duplicated to which may override
// a valid device selection on those outputs.
- bool force = !mOutputs.valueAt(i)->isDuplicated()
- && (!deviceDistinguishesOnAddress(device)
+ bool force = !desc->isDuplicated()
+ && (!device_distinguishes_on_address(device)
// always force when disconnecting (a non-duplicated device)
|| (state == AUDIO_POLICY_DEVICE_STATE_UNAVAILABLE));
- setOutputDevice(output, newDevice, force, 0);
+ setOutputDevice(desc, newDevice, force, 0);
}
}
@@ -365,20 +207,19 @@ status_t AudioPolicyManager::setDeviceConnectionStateInt(audio_devices_t device,
ALOGW("setDeviceConnectionState() device already connected: %d", device);
return INVALID_OPERATION;
}
- sp<HwModule> module = getModuleForDevice(device);
+ sp<HwModule> module = mHwModules.getModuleForDevice(device);
if (module == NULL) {
ALOGW("setDeviceConnectionState(): could not find HW module for device %08x",
device);
return INVALID_OPERATION;
}
- if (checkInputsForDevice(device, state, inputs, devDesc->mAddress) != NO_ERROR) {
+ if (checkInputsForDevice(devDesc, state, inputs, devDesc->mAddress) != NO_ERROR) {
return INVALID_OPERATION;
}
index = mAvailableInputDevices.add(devDesc);
if (index >= 0) {
- mAvailableInputDevices[index]->mId = nextUniqueId();
- mAvailableInputDevices[index]->mModule = module;
+ mAvailableInputDevices[index]->attach(module);
} else {
return NO_MEMORY;
}
@@ -388,6 +229,8 @@ status_t AudioPolicyManager::setDeviceConnectionStateInt(audio_devices_t device,
param.addInt(String8(AUDIO_PARAMETER_DEVICE_CONNECT), device);
mpClientInterface->setParameters(AUDIO_IO_HANDLE_NONE, param.toString());
+ // Propagate device availability to Engine
+ mEngine->setDeviceConnectionState(devDesc, state);
} break;
// handle input device disconnection
@@ -404,9 +247,11 @@ status_t AudioPolicyManager::setDeviceConnectionStateInt(audio_devices_t device,
param.addInt(String8(AUDIO_PARAMETER_DEVICE_DISCONNECT), device);
mpClientInterface->setParameters(AUDIO_IO_HANDLE_NONE, param.toString());
- checkInputsForDevice(device, state, inputs, devDesc->mAddress);
+ checkInputsForDevice(devDesc, state, inputs, devDesc->mAddress);
mAvailableInputDevices.remove(devDesc);
+ // Propagate device availability to Engine
+ mEngine->setDeviceConnectionState(devDesc, state);
} break;
default:
@@ -416,7 +261,7 @@ status_t AudioPolicyManager::setDeviceConnectionStateInt(audio_devices_t device,
closeAllInputs();
- if (mPhoneState == AUDIO_MODE_IN_CALL) {
+ if (mEngine->getPhoneState() == AUDIO_MODE_IN_CALL && hasPrimaryOutput()) {
audio_devices_t newDevice = getNewOutputDevice(mPrimaryOutput, false /*fromCache*/);
updateCallRouting(newDevice);
}
@@ -430,9 +275,10 @@ status_t AudioPolicyManager::setDeviceConnectionStateInt(audio_devices_t device,
}
audio_policy_dev_state_t AudioPolicyManager::getDeviceConnectionState(audio_devices_t device,
- const char *device_address)
+ const char *device_address)
{
- sp<DeviceDescriptor> devDesc = getDeviceDescriptor(device, device_address);
+ sp<DeviceDescriptor> devDesc = mHwModules.getDeviceDescriptor(device, device_address, "");
+
DeviceVector *deviceVector;
if (audio_is_output_device(device)) {
@@ -443,43 +289,7 @@ audio_policy_dev_state_t AudioPolicyManager::getDeviceConnectionState(audio_devi
ALOGW("getDeviceConnectionState() invalid device type %08x", device);
return AUDIO_POLICY_DEVICE_STATE_UNAVAILABLE;
}
-
- ssize_t index = deviceVector->indexOf(devDesc);
- if (index >= 0) {
- return AUDIO_POLICY_DEVICE_STATE_AVAILABLE;
- } else {
- return AUDIO_POLICY_DEVICE_STATE_UNAVAILABLE;
- }
-}
-
-sp<AudioPolicyManager::DeviceDescriptor> AudioPolicyManager::getDeviceDescriptor(
- const audio_devices_t device,
- const char *device_address)
-{
- String8 address = (device_address == NULL) ? String8("") : String8(device_address);
- // handle legacy remote submix case where the address was not always specified
- if (deviceDistinguishesOnAddress(device) && (address.length() == 0)) {
- address = String8("0");
- }
-
- for (size_t i = 0; i < mHwModules.size(); i++) {
- if (mHwModules[i]->mHandle == 0) {
- continue;
- }
- DeviceVector deviceList =
- mHwModules[i]->mDeclaredDevices.getDevicesFromTypeAddr(device, address);
- if (!deviceList.isEmpty()) {
- return deviceList.itemAt(0);
- }
- deviceList = mHwModules[i]->mDeclaredDevices.getDevicesFromType(device);
- if (!deviceList.isEmpty()) {
- return deviceList.itemAt(0);
- }
- }
-
- sp<DeviceDescriptor> devDesc = new DeviceDescriptor(String8(""), device);
- devDesc->mAddress = address;
- return devDesc;
+ return deviceVector->getDeviceConnectionState(devDesc);
}
void AudioPolicyManager::updateCallRouting(audio_devices_t rxDevice, int delayMs)
@@ -492,6 +302,9 @@ void AudioPolicyManager::updateCallRouting(audio_devices_t rxDevice, int delayMs
audio_patch_handle_t afPatchHandle;
DeviceVector deviceList;
+ if(!hasPrimaryOutput()) {
+ return;
+ }
audio_devices_t txDevice = getDeviceAndMixForInputSource(AUDIO_SOURCE_VOICE_COMMUNICATION);
ALOGV("updateCallRouting device rxDevice %08x txDevice %08x", rxDevice, txDevice);
@@ -538,10 +351,11 @@ void AudioPolicyManager::updateCallRouting(audio_devices_t rxDevice, int delayMs
AUDIO_OUTPUT_FLAG_NONE,
AUDIO_FORMAT_INVALID);
if (output != AUDIO_IO_HANDLE_NONE) {
- sp<AudioOutputDescriptor> outputDesc = mOutputs.valueFor(output);
+ sp<SwAudioOutputDescriptor> outputDesc = mOutputs.valueFor(output);
ALOG_ASSERT(!outputDesc->isDuplicated(),
"updateCallRouting() RX device output is duplicated");
outputDesc->toAudioPortConfig(&patch.sources[1]);
+ patch.sources[1].ext.mix.usecase.stream = AUDIO_STREAM_PATCH;
patch.num_sources = 2;
}
@@ -550,8 +364,7 @@ void AudioPolicyManager::updateCallRouting(audio_devices_t rxDevice, int delayMs
ALOGW_IF(status != NO_ERROR, "updateCallRouting() error %d creating RX audio patch",
status);
if (status == NO_ERROR) {
- mCallRxPatch = new AudioPatch((audio_patch_handle_t)nextUniqueId(),
- &patch, mUidCached);
+ mCallRxPatch = new AudioPatch(&patch, mUidCached);
mCallRxPatch->mAfPatchHandle = afPatchHandle;
mCallRxPatch->mUid = mUidCached;
}
@@ -585,6 +398,7 @@ void AudioPolicyManager::updateCallRouting(audio_devices_t rxDevice, int delayMs
ALOG_ASSERT(!outputDesc->isDuplicated(),
"updateCallRouting() RX device output is duplicated");
outputDesc->toAudioPortConfig(&patch.sources[1]);
+ patch.sources[1].ext.mix.usecase.stream = AUDIO_STREAM_PATCH;
patch.num_sources = 2;
}
@@ -593,8 +407,7 @@ void AudioPolicyManager::updateCallRouting(audio_devices_t rxDevice, int delayMs
ALOGW_IF(status != NO_ERROR, "setPhoneState() error %d creating TX audio patch",
status);
if (status == NO_ERROR) {
- mCallTxPatch = new AudioPatch((audio_patch_handle_t)nextUniqueId(),
- &patch, mUidCached);
+ mCallTxPatch = new AudioPatch(&patch, mUidCached);
mCallTxPatch->mAfPatchHandle = afPatchHandle;
mCallTxPatch->mUid = mUidCached;
}
@@ -604,19 +417,17 @@ void AudioPolicyManager::updateCallRouting(audio_devices_t rxDevice, int delayMs
void AudioPolicyManager::setPhoneState(audio_mode_t state)
{
ALOGV("setPhoneState() state %d", state);
- if (state < 0 || state >= AUDIO_MODE_CNT) {
- ALOGW("setPhoneState() invalid state %d", state);
- return;
- }
+ // store previous phone state for management of sonification strategy below
+ int oldState = mEngine->getPhoneState();
- if (state == mPhoneState ) {
- ALOGW("setPhoneState() setting same state %d", state);
+ if (mEngine->setPhoneState(state) != NO_ERROR) {
+ ALOGW("setPhoneState() invalid or same state %d", state);
return;
}
-
+ /// Opens: can these line be executed after the switch of volume curves???
// if leaving call state, handle special case of active streams
// pertaining to sonification strategy see handleIncallSonification()
- if (isInCall()) {
+ if (isStateInCall(oldState)) {
ALOGV("setPhoneState() in call state management: new state is %d", state);
for (int stream = 0; stream < AUDIO_STREAM_CNT; stream++) {
if (stream == AUDIO_STREAM_PATCH) {
@@ -625,97 +436,73 @@ void AudioPolicyManager::setPhoneState(audio_mode_t state)
handleIncallSonification((audio_stream_type_t)stream, false, true);
}
- // force reevaluating accessibility routing when call starts
+ // force reevaluating accessibility routing when call stops
mpClientInterface->invalidateStream(AUDIO_STREAM_ACCESSIBILITY);
}
- // store previous phone state for management of sonification strategy below
- int oldState = mPhoneState;
- mPhoneState = state;
- bool force = false;
-
- // are we entering or starting a call
- if (!isStateInCall(oldState) && isStateInCall(state)) {
- ALOGV(" Entering call in setPhoneState()");
- // force routing command to audio hardware when starting a call
- // even if no device change is needed
- force = true;
- for (int j = 0; j < DEVICE_CATEGORY_CNT; j++) {
- mStreams[AUDIO_STREAM_DTMF].mVolumeCurve[j] =
- sVolumeProfiles[AUDIO_STREAM_VOICE_CALL][j];
- }
- } else if (isStateInCall(oldState) && !isStateInCall(state)) {
- ALOGV(" Exiting call in setPhoneState()");
- // force routing command to audio hardware when exiting a call
- // even if no device change is needed
- force = true;
- for (int j = 0; j < DEVICE_CATEGORY_CNT; j++) {
- mStreams[AUDIO_STREAM_DTMF].mVolumeCurve[j] =
- sVolumeProfiles[AUDIO_STREAM_DTMF][j];
- }
- } else if (isStateInCall(state) && (state != oldState)) {
- ALOGV(" Switching between telephony and VoIP in setPhoneState()");
- // force routing command to audio hardware when switching between telephony and VoIP
- // even if no device change is needed
- force = true;
- }
+ /**
+ * Switching to or from incall state or switching between telephony and VoIP lead to force
+ * routing command.
+ */
+ bool force = ((is_state_in_call(oldState) != is_state_in_call(state))
+ || (is_state_in_call(state) && (state != oldState)));
// check for device and output changes triggered by new phone state
checkA2dpSuspend();
checkOutputForAllStrategies();
updateDevicesAndOutputs();
- sp<AudioOutputDescriptor> hwOutputDesc = mOutputs.valueFor(mPrimaryOutput);
-
int delayMs = 0;
if (isStateInCall(state)) {
nsecs_t sysTime = systemTime();
for (size_t i = 0; i < mOutputs.size(); i++) {
- sp<AudioOutputDescriptor> desc = mOutputs.valueAt(i);
+ sp<SwAudioOutputDescriptor> desc = mOutputs.valueAt(i);
// mute media and sonification strategies and delay device switch by the largest
// latency of any output where either strategy is active.
// This avoid sending the ring tone or music tail into the earpiece or headset.
- if ((desc->isStrategyActive(STRATEGY_MEDIA,
- SONIFICATION_HEADSET_MUSIC_DELAY,
- sysTime) ||
- desc->isStrategyActive(STRATEGY_SONIFICATION,
- SONIFICATION_HEADSET_MUSIC_DELAY,
- sysTime)) &&
- (delayMs < (int)desc->mLatency*2)) {
- delayMs = desc->mLatency*2;
- }
- setStrategyMute(STRATEGY_MEDIA, true, mOutputs.keyAt(i));
- setStrategyMute(STRATEGY_MEDIA, false, mOutputs.keyAt(i), MUTE_TIME_MS,
+ if ((isStrategyActive(desc, STRATEGY_MEDIA,
+ SONIFICATION_HEADSET_MUSIC_DELAY,
+ sysTime) ||
+ isStrategyActive(desc, STRATEGY_SONIFICATION,
+ SONIFICATION_HEADSET_MUSIC_DELAY,
+ sysTime)) &&
+ (delayMs < (int)desc->latency()*2)) {
+ delayMs = desc->latency()*2;
+ }
+ setStrategyMute(STRATEGY_MEDIA, true, desc);
+ setStrategyMute(STRATEGY_MEDIA, false, desc, MUTE_TIME_MS,
getDeviceForStrategy(STRATEGY_MEDIA, true /*fromCache*/));
- setStrategyMute(STRATEGY_SONIFICATION, true, mOutputs.keyAt(i));
- setStrategyMute(STRATEGY_SONIFICATION, false, mOutputs.keyAt(i), MUTE_TIME_MS,
+ setStrategyMute(STRATEGY_SONIFICATION, true, desc);
+ setStrategyMute(STRATEGY_SONIFICATION, false, desc, MUTE_TIME_MS,
getDeviceForStrategy(STRATEGY_SONIFICATION, true /*fromCache*/));
}
}
- // Note that despite the fact that getNewOutputDevice() is called on the primary output,
- // the device returned is not necessarily reachable via this output
- audio_devices_t rxDevice = getNewOutputDevice(mPrimaryOutput, false /*fromCache*/);
- // force routing command to audio hardware when ending call
- // even if no device change is needed
- if (isStateInCall(oldState) && rxDevice == AUDIO_DEVICE_NONE) {
- rxDevice = hwOutputDesc->device();
- }
-
- if (state == AUDIO_MODE_IN_CALL) {
- updateCallRouting(rxDevice, delayMs);
- } else if (oldState == AUDIO_MODE_IN_CALL) {
- if (mCallRxPatch != 0) {
- mpClientInterface->releaseAudioPatch(mCallRxPatch->mAfPatchHandle, 0);
- mCallRxPatch.clear();
+ if (hasPrimaryOutput()) {
+ // Note that despite the fact that getNewOutputDevice() is called on the primary output,
+ // the device returned is not necessarily reachable via this output
+ audio_devices_t rxDevice = getNewOutputDevice(mPrimaryOutput, false /*fromCache*/);
+ // force routing command to audio hardware when ending call
+ // even if no device change is needed
+ if (isStateInCall(oldState) && rxDevice == AUDIO_DEVICE_NONE) {
+ rxDevice = mPrimaryOutput->device();
}
- if (mCallTxPatch != 0) {
- mpClientInterface->releaseAudioPatch(mCallTxPatch->mAfPatchHandle, 0);
- mCallTxPatch.clear();
+
+ if (state == AUDIO_MODE_IN_CALL) {
+ updateCallRouting(rxDevice, delayMs);
+ } else if (oldState == AUDIO_MODE_IN_CALL) {
+ if (mCallRxPatch != 0) {
+ mpClientInterface->releaseAudioPatch(mCallRxPatch->mAfPatchHandle, 0);
+ mCallRxPatch.clear();
+ }
+ if (mCallTxPatch != 0) {
+ mpClientInterface->releaseAudioPatch(mCallTxPatch->mAfPatchHandle, 0);
+ mCallTxPatch.clear();
+ }
+ setOutputDevice(mPrimaryOutput, rxDevice, force, 0);
+ } else {
+ setOutputDevice(mPrimaryOutput, rxDevice, force, 0);
}
- setOutputDevice(mPrimaryOutput, rxDevice, force, 0);
- } else {
- setOutputDevice(mPrimaryOutput, rxDevice, force, 0);
}
// if entering in call state, handle special case of active streams
// pertaining to sonification strategy see handleIncallSonification()
@@ -727,6 +514,9 @@ void AudioPolicyManager::setPhoneState(audio_mode_t state)
}
handleIncallSonification((audio_stream_type_t)stream, true, true);
}
+
+ // force reevaluating accessibility routing when call starts
+ mpClientInterface->invalidateStream(AUDIO_STREAM_ACCESSIBILITY);
}
// Flag that ringtone volume must be limited to music volume until we exit MODE_RINGTONE
@@ -738,103 +528,49 @@ void AudioPolicyManager::setPhoneState(audio_mode_t state)
}
}
+audio_mode_t AudioPolicyManager::getPhoneState() {
+ return mEngine->getPhoneState();
+}
+
void AudioPolicyManager::setForceUse(audio_policy_force_use_t usage,
audio_policy_forced_cfg_t config)
{
- ALOGV("setForceUse() usage %d, config %d, mPhoneState %d", usage, config, mPhoneState);
-
- bool forceVolumeReeval = false;
- switch(usage) {
- case AUDIO_POLICY_FORCE_FOR_COMMUNICATION:
- if (config != AUDIO_POLICY_FORCE_SPEAKER && config != AUDIO_POLICY_FORCE_BT_SCO &&
- config != AUDIO_POLICY_FORCE_NONE) {
- ALOGW("setForceUse() invalid config %d for FOR_COMMUNICATION", config);
- return;
- }
- forceVolumeReeval = true;
- mForceUse[usage] = config;
- break;
- case AUDIO_POLICY_FORCE_FOR_MEDIA:
- if (config != AUDIO_POLICY_FORCE_HEADPHONES && config != AUDIO_POLICY_FORCE_BT_A2DP &&
- config != AUDIO_POLICY_FORCE_WIRED_ACCESSORY &&
- config != AUDIO_POLICY_FORCE_ANALOG_DOCK &&
- config != AUDIO_POLICY_FORCE_DIGITAL_DOCK && config != AUDIO_POLICY_FORCE_NONE &&
- config != AUDIO_POLICY_FORCE_NO_BT_A2DP && config != AUDIO_POLICY_FORCE_SPEAKER ) {
- ALOGW("setForceUse() invalid config %d for FOR_MEDIA", config);
- return;
- }
- mForceUse[usage] = config;
- break;
- case AUDIO_POLICY_FORCE_FOR_RECORD:
- if (config != AUDIO_POLICY_FORCE_BT_SCO && config != AUDIO_POLICY_FORCE_WIRED_ACCESSORY &&
- config != AUDIO_POLICY_FORCE_NONE) {
- ALOGW("setForceUse() invalid config %d for FOR_RECORD", config);
- return;
- }
- mForceUse[usage] = config;
- break;
- case AUDIO_POLICY_FORCE_FOR_DOCK:
- if (config != AUDIO_POLICY_FORCE_NONE && config != AUDIO_POLICY_FORCE_BT_CAR_DOCK &&
- config != AUDIO_POLICY_FORCE_BT_DESK_DOCK &&
- config != AUDIO_POLICY_FORCE_WIRED_ACCESSORY &&
- config != AUDIO_POLICY_FORCE_ANALOG_DOCK &&
- config != AUDIO_POLICY_FORCE_DIGITAL_DOCK) {
- ALOGW("setForceUse() invalid config %d for FOR_DOCK", config);
- }
- forceVolumeReeval = true;
- mForceUse[usage] = config;
- break;
- case AUDIO_POLICY_FORCE_FOR_SYSTEM:
- if (config != AUDIO_POLICY_FORCE_NONE &&
- config != AUDIO_POLICY_FORCE_SYSTEM_ENFORCED) {
- ALOGW("setForceUse() invalid config %d for FOR_SYSTEM", config);
- }
- forceVolumeReeval = true;
- mForceUse[usage] = config;
- break;
- case AUDIO_POLICY_FORCE_FOR_HDMI_SYSTEM_AUDIO:
- if (config != AUDIO_POLICY_FORCE_NONE &&
- config != AUDIO_POLICY_FORCE_HDMI_SYSTEM_AUDIO_ENFORCED) {
- ALOGW("setForceUse() invalid config %d forHDMI_SYSTEM_AUDIO", config);
- }
- mForceUse[usage] = config;
- break;
- default:
- ALOGW("setForceUse() invalid usage %d", usage);
- break;
+ ALOGV("setForceUse() usage %d, config %d, mPhoneState %d", usage, config, mEngine->getPhoneState());
+
+ if (mEngine->setForceUse(usage, config) != NO_ERROR) {
+ ALOGW("setForceUse() could not set force cfg %d for usage %d", config, usage);
+ return;
}
+ bool forceVolumeReeval = (usage == AUDIO_POLICY_FORCE_FOR_COMMUNICATION) ||
+ (usage == AUDIO_POLICY_FORCE_FOR_DOCK) ||
+ (usage == AUDIO_POLICY_FORCE_FOR_SYSTEM);
// check for device and output changes triggered by new force usage
checkA2dpSuspend();
checkOutputForAllStrategies();
updateDevicesAndOutputs();
- if (mPhoneState == AUDIO_MODE_IN_CALL) {
+ if (mEngine->getPhoneState() == AUDIO_MODE_IN_CALL && hasPrimaryOutput()) {
audio_devices_t newDevice = getNewOutputDevice(mPrimaryOutput, true /*fromCache*/);
updateCallRouting(newDevice);
}
for (size_t i = 0; i < mOutputs.size(); i++) {
- audio_io_handle_t output = mOutputs.keyAt(i);
- audio_devices_t newDevice = getNewOutputDevice(output, true /*fromCache*/);
- if ((mPhoneState != AUDIO_MODE_IN_CALL) || (output != mPrimaryOutput)) {
- setOutputDevice(output, newDevice, (newDevice != AUDIO_DEVICE_NONE));
+ sp<SwAudioOutputDescriptor> outputDesc = mOutputs.valueAt(i);
+ audio_devices_t newDevice = getNewOutputDevice(outputDesc, true /*fromCache*/);
+ if ((mEngine->getPhoneState() != AUDIO_MODE_IN_CALL) || (outputDesc != mPrimaryOutput)) {
+ setOutputDevice(outputDesc, newDevice, (newDevice != AUDIO_DEVICE_NONE));
}
if (forceVolumeReeval && (newDevice != AUDIO_DEVICE_NONE)) {
- applyStreamVolumes(output, newDevice, 0, true);
+ applyStreamVolumes(outputDesc, newDevice, 0, true);
}
}
- audio_io_handle_t activeInput = getActiveInput();
+ audio_io_handle_t activeInput = mInputs.getActiveInput();
if (activeInput != 0) {
setInputDevice(activeInput, getNewInputDevice(activeInput));
}
}
-audio_policy_forced_cfg_t AudioPolicyManager::getForceUse(audio_policy_force_use_t usage)
-{
- return mForceUse[usage];
-}
-
void AudioPolicyManager::setSystemProperty(const char* property, const char* value)
{
ALOGV("setSystemProperty() property %s, value %s", property, value);
@@ -842,37 +578,58 @@ void AudioPolicyManager::setSystemProperty(const char* property, const char* val
// Find a direct output profile compatible with the parameters passed, even if the input flags do
// not explicitly request a direct output
-sp<AudioPolicyManager::IOProfile> AudioPolicyManager::getProfileForDirectOutput(
+sp<IOProfile> AudioPolicyManager::getProfileForDirectOutput(
audio_devices_t device,
uint32_t samplingRate,
audio_format_t format,
audio_channel_mask_t channelMask,
audio_output_flags_t flags)
{
+ // only retain flags that will drive the direct output profile selection
+ // if explicitly requested
+ static const uint32_t kRelevantFlags =
+ (AUDIO_OUTPUT_FLAG_HW_AV_SYNC | AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD);
+ flags =
+ (audio_output_flags_t)((flags & kRelevantFlags) | AUDIO_OUTPUT_FLAG_DIRECT);
+
+ sp<IOProfile> profile;
+
for (size_t i = 0; i < mHwModules.size(); i++) {
if (mHwModules[i]->mHandle == 0) {
continue;
}
for (size_t j = 0; j < mHwModules[i]->mOutputProfiles.size(); j++) {
- sp<IOProfile> profile = mHwModules[i]->mOutputProfiles[j];
- bool found = profile->isCompatibleProfile(device, String8(""), samplingRate,
- NULL /*updatedSamplingRate*/, format, channelMask,
- flags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD ?
- AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD : AUDIO_OUTPUT_FLAG_DIRECT);
- if (found && (mAvailableOutputDevices.types() & profile->mSupportedDevices.types())) {
- return profile;
+ sp<IOProfile> curProfile = mHwModules[i]->mOutputProfiles[j];
+ if (!curProfile->isCompatibleProfile(device, String8(""),
+ samplingRate, NULL /*updatedSamplingRate*/,
+ format, NULL /*updatedFormat*/,
+ channelMask, NULL /*updatedChannelMask*/,
+ flags)) {
+ continue;
+ }
+ // reject profiles not corresponding to a device currently available
+ if ((mAvailableOutputDevices.types() & curProfile->mSupportedDevices.types()) == 0) {
+ continue;
+ }
+ // if several profiles are compatible, give priority to one with offload capability
+ if (profile != 0 && ((curProfile->mFlags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD) == 0)) {
+ continue;
+ }
+ profile = curProfile;
+ if ((profile->mFlags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD) != 0) {
+ break;
}
}
}
- return 0;
+ return profile;
}
audio_io_handle_t AudioPolicyManager::getOutput(audio_stream_type_t stream,
- uint32_t samplingRate,
- audio_format_t format,
- audio_channel_mask_t channelMask,
- audio_output_flags_t flags,
- const audio_offload_info_t *offloadInfo)
+ uint32_t samplingRate,
+ audio_format_t format,
+ audio_channel_mask_t channelMask,
+ audio_output_flags_t flags,
+ const audio_offload_info_t *offloadInfo)
{
routing_strategy strategy = getStrategy(stream);
audio_devices_t device = getDeviceForStrategy(strategy, false /*fromCache*/);
@@ -888,10 +645,12 @@ status_t AudioPolicyManager::getOutputForAttr(const audio_attributes_t *attr,
audio_io_handle_t *output,
audio_session_t session,
audio_stream_type_t *stream,
+ uid_t uid,
uint32_t samplingRate,
audio_format_t format,
audio_channel_mask_t channelMask,
audio_output_flags_t flags,
+ audio_port_handle_t selectedDeviceId,
const audio_offload_info_t *offloadInfo)
{
audio_attributes_t attributes;
@@ -910,53 +669,38 @@ status_t AudioPolicyManager::getOutputForAttr(const audio_attributes_t *attr,
}
stream_type_to_audio_attributes(*stream, &attributes);
}
-
- for (size_t i = 0; i < mPolicyMixes.size(); i++) {
- sp<AudioOutputDescriptor> desc;
- if (mPolicyMixes[i]->mMix.mMixType == MIX_TYPE_PLAYERS) {
- for (size_t j = 0; j < mPolicyMixes[i]->mMix.mCriteria.size(); j++) {
- if ((RULE_MATCH_ATTRIBUTE_USAGE == mPolicyMixes[i]->mMix.mCriteria[j].mRule &&
- mPolicyMixes[i]->mMix.mCriteria[j].mAttr.mUsage == attributes.usage) ||
- (RULE_EXCLUDE_ATTRIBUTE_USAGE == mPolicyMixes[i]->mMix.mCriteria[j].mRule &&
- mPolicyMixes[i]->mMix.mCriteria[j].mAttr.mUsage != attributes.usage)) {
- desc = mPolicyMixes[i]->mOutput;
- break;
- }
- if (strncmp(attributes.tags, "addr=", strlen("addr=")) == 0 &&
- strncmp(attributes.tags + strlen("addr="),
- mPolicyMixes[i]->mMix.mRegistrationId.string(),
- AUDIO_ATTRIBUTES_TAGS_MAX_SIZE - strlen("addr=") - 1) == 0) {
- desc = mPolicyMixes[i]->mOutput;
- break;
- }
- }
- } else if (mPolicyMixes[i]->mMix.mMixType == MIX_TYPE_RECORDERS) {
- if (attributes.usage == AUDIO_USAGE_VIRTUAL_SOURCE &&
- strncmp(attributes.tags, "addr=", strlen("addr=")) == 0 &&
- strncmp(attributes.tags + strlen("addr="),
- mPolicyMixes[i]->mMix.mRegistrationId.string(),
- AUDIO_ATTRIBUTES_TAGS_MAX_SIZE - strlen("addr=") - 1) == 0) {
- desc = mPolicyMixes[i]->mOutput;
- }
- }
- if (desc != 0) {
- if (!audio_is_linear_pcm(format)) {
- return BAD_VALUE;
- }
- desc->mPolicyMix = &mPolicyMixes[i]->mMix;
- *stream = streamTypefromAttributesInt(&attributes);
- *output = desc->mIoHandle;
- ALOGV("getOutputForAttr() returns output %d", *output);
- return NO_ERROR;
+ sp<SwAudioOutputDescriptor> desc;
+ if (mPolicyMixes.getOutputForAttr(attributes, desc) == NO_ERROR) {
+ ALOG_ASSERT(desc != 0, "Invalid desc returned by getOutputForAttr");
+ if (!audio_is_linear_pcm(format)) {
+ return BAD_VALUE;
}
+ *stream = streamTypefromAttributesInt(&attributes);
+ *output = desc->mIoHandle;
+ ALOGV("getOutputForAttr() returns output %d", *output);
+ return NO_ERROR;
}
if (attributes.usage == AUDIO_USAGE_VIRTUAL_SOURCE) {
ALOGW("getOutputForAttr() no policy mix found for usage AUDIO_USAGE_VIRTUAL_SOURCE");
return BAD_VALUE;
}
- ALOGV("getOutputForAttr() usage=%d, content=%d, tag=%s flags=%08x",
- attributes.usage, attributes.content_type, attributes.tags, attributes.flags);
+ ALOGV("getOutputForAttr() usage=%d, content=%d, tag=%s flags=%08x"
+ " session %d selectedDeviceId %d",
+ attributes.usage, attributes.content_type, attributes.tags, attributes.flags,
+ session, selectedDeviceId);
+
+ *stream = streamTypefromAttributesInt(&attributes);
+
+ // Explicit routing?
+ sp<DeviceDescriptor> deviceDesc;
+ for (size_t i = 0; i < mAvailableOutputDevices.size(); i++) {
+ if (mAvailableOutputDevices[i]->getId() == selectedDeviceId) {
+ deviceDesc = mAvailableOutputDevices[i];
+ break;
+ }
+ }
+ mOutputRoutes.addRoute(session, *stream, SessionRoute::SOURCE_TYPE_NA, deviceDesc, uid);
routing_strategy strategy = (routing_strategy) getStrategyForAttr(&attributes);
audio_devices_t device = getDeviceForStrategy(strategy, false /*fromCache*/);
@@ -968,13 +712,14 @@ status_t AudioPolicyManager::getOutputForAttr(const audio_attributes_t *attr,
ALOGV("getOutputForAttr() device 0x%x, samplingRate %d, format %x, channelMask %x, flags %x",
device, samplingRate, format, channelMask, flags);
- *stream = streamTypefromAttributesInt(&attributes);
*output = getOutputForDevice(device, session, *stream,
samplingRate, format, channelMask,
flags, offloadInfo);
if (*output == AUDIO_IO_HANDLE_NONE) {
+ mOutputRoutes.removeRoute(session);
return INVALID_OPERATION;
}
+
return NO_ERROR;
}
@@ -999,7 +744,8 @@ audio_io_handle_t AudioPolicyManager::getOutputForDevice(
if (mTestOutputs[mCurOutput] == 0) {
ALOGV("getOutput() opening test output");
- sp<AudioOutputDescriptor> outputDesc = new AudioOutputDescriptor(NULL);
+ sp<AudioOutputDescriptor> outputDesc = new SwAudioOutputDescriptor(NULL,
+ mpClientInterface);
outputDesc->mDevice = mTestDevice;
outputDesc->mLatency = mTestLatencyMs;
outputDesc->mFlags =
@@ -1046,6 +792,14 @@ audio_io_handle_t AudioPolicyManager::getOutputForDevice(
// only allow deep buffering for music stream type
if (stream != AUDIO_STREAM_MUSIC) {
flags = (audio_output_flags_t)(flags &~AUDIO_OUTPUT_FLAG_DEEP_BUFFER);
+ } else if (/* stream == AUDIO_STREAM_MUSIC && */
+ flags == AUDIO_OUTPUT_FLAG_NONE &&
+ property_get_bool("audio.deep_buffer.media", false /* default_value */)) {
+ // use DEEP_BUFFER as default output for music stream type
+ flags = (audio_output_flags_t)AUDIO_OUTPUT_FLAG_DEEP_BUFFER;
+ }
+ if (stream == AUDIO_STREAM_TTS) {
+ flags = AUDIO_OUTPUT_FLAG_TTS;
}
sp<IOProfile> profile;
@@ -1066,7 +820,7 @@ audio_io_handle_t AudioPolicyManager::getOutputForDevice(
// in the background.
if (((flags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD) == 0) ||
- !isNonOffloadableEffectEnabled()) {
+ !mEffects.isNonOffloadableEffectEnabled()) {
profile = getProfileForDirectOutput(device,
samplingRate,
format,
@@ -1075,10 +829,10 @@ audio_io_handle_t AudioPolicyManager::getOutputForDevice(
}
if (profile != 0) {
- sp<AudioOutputDescriptor> outputDesc = NULL;
+ sp<SwAudioOutputDescriptor> outputDesc = NULL;
for (size_t i = 0; i < mOutputs.size(); i++) {
- sp<AudioOutputDescriptor> desc = mOutputs.valueAt(i);
+ sp<SwAudioOutputDescriptor> desc = mOutputs.valueAt(i);
if (!desc->isDuplicated() && (profile == desc->mProfile)) {
outputDesc = desc;
// reuse direct output if currently open and configured with same parameters
@@ -1095,10 +849,27 @@ audio_io_handle_t AudioPolicyManager::getOutputForDevice(
if (outputDesc != NULL) {
closeOutput(outputDesc->mIoHandle);
}
- outputDesc = new AudioOutputDescriptor(profile);
+
+ // if the selected profile is offloaded and no offload info was specified,
+ // create a default one
+ audio_offload_info_t defaultOffloadInfo = AUDIO_INFO_INITIALIZER;
+ if ((profile->mFlags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD) && !offloadInfo) {
+ flags = (audio_output_flags_t)(flags | AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD);
+ defaultOffloadInfo.sample_rate = samplingRate;
+ defaultOffloadInfo.channel_mask = channelMask;
+ defaultOffloadInfo.format = format;
+ defaultOffloadInfo.stream_type = stream;
+ defaultOffloadInfo.bit_rate = 0;
+ defaultOffloadInfo.duration_us = -1;
+ defaultOffloadInfo.has_video = true; // conservative
+ defaultOffloadInfo.is_streaming = true; // likely
+ offloadInfo = &defaultOffloadInfo;
+ }
+
+ outputDesc = new SwAudioOutputDescriptor(profile, mpClientInterface);
outputDesc->mDevice = device;
outputDesc->mLatency = 0;
- outputDesc->mFlags =(audio_output_flags_t) (outputDesc->mFlags | flags);
+ outputDesc->mFlags = (audio_output_flags_t)(outputDesc->mFlags | flags);
audio_config_t config = AUDIO_CONFIG_INITIALIZER;
config.sample_rate = samplingRate;
config.channel_mask = channelMask;
@@ -1106,7 +877,7 @@ audio_io_handle_t AudioPolicyManager::getOutputForDevice(
if (offloadInfo != NULL) {
config.offload_info = *offloadInfo;
}
- status = mpClientInterface->openOutput(profile->mModule->mHandle,
+ status = mpClientInterface->openOutput(profile->getModuleHandle(),
&output,
&config,
&outputDesc->mDevice,
@@ -1152,7 +923,6 @@ audio_io_handle_t AudioPolicyManager::getOutputForDevice(
}
non_direct_output:
-
// ignoring channel mask due to downmix capability in mixer
// open a non direct output
@@ -1170,7 +940,7 @@ non_direct_output:
ALOGW_IF((output == 0), "getOutput() could not find output for stream %d, samplingRate %d,"
"format %d, channels %x, flags %x", stream, samplingRate, format, channelMask, flags);
- ALOGV("getOutput() returns output %d", output);
+ ALOGV(" getOutputForDevice() returns output %d", output);
return output;
}
@@ -1198,7 +968,7 @@ audio_io_handle_t AudioPolicyManager::selectOutput(const SortedVector<audio_io_h
audio_io_handle_t outputPrimary = 0;
for (size_t i = 0; i < outputs.size(); i++) {
- sp<AudioOutputDescriptor> outputDesc = mOutputs.valueFor(outputs[i]);
+ sp<SwAudioOutputDescriptor> outputDesc = mOutputs.valueFor(outputs[i]);
if (!outputDesc->isDuplicated()) {
// if a valid format is specified, skip output if not compatible
if (format != AUDIO_FORMAT_INVALID) {
@@ -1237,18 +1007,66 @@ status_t AudioPolicyManager::startOutput(audio_io_handle_t output,
audio_stream_type_t stream,
audio_session_t session)
{
- ALOGV("startOutput() output %d, stream %d, session %d", output, stream, session);
+ ALOGV("startOutput() output %d, stream %d, session %d",
+ output, stream, session);
ssize_t index = mOutputs.indexOfKey(output);
if (index < 0) {
ALOGW("startOutput() unknown output %d", output);
return BAD_VALUE;
}
+ sp<SwAudioOutputDescriptor> outputDesc = mOutputs.valueAt(index);
+
+ // Routing?
+ mOutputRoutes.incRouteActivity(session);
+
+ audio_devices_t newDevice;
+ if (outputDesc->mPolicyMix != NULL) {
+ newDevice = AUDIO_DEVICE_OUT_REMOTE_SUBMIX;
+ } else if (mOutputRoutes.hasRouteChanged(session)) {
+ newDevice = getNewOutputDevice(outputDesc, false /*fromCache*/);
+ checkStrategyRoute(getStrategy(stream), output);
+ } else {
+ newDevice = AUDIO_DEVICE_NONE;
+ }
+
+ uint32_t delayMs = 0;
+
+ status_t status = startSource(outputDesc, stream, newDevice, &delayMs);
+
+ if (status != NO_ERROR) {
+ mOutputRoutes.decRouteActivity(session);
+ return status;
+ }
+ // Automatically enable the remote submix input when output is started on a re routing mix
+ // of type MIX_TYPE_RECORDERS
+ if (audio_is_remote_submix_device(newDevice) && outputDesc->mPolicyMix != NULL &&
+ outputDesc->mPolicyMix->mMixType == MIX_TYPE_RECORDERS) {
+ setDeviceConnectionStateInt(AUDIO_DEVICE_IN_REMOTE_SUBMIX,
+ AUDIO_POLICY_DEVICE_STATE_AVAILABLE,
+ outputDesc->mPolicyMix->mRegistrationId,
+ "remote-submix");
+ }
+
+ if (delayMs != 0) {
+ usleep(delayMs * 1000);
+ }
+
+ return status;
+}
+
+status_t AudioPolicyManager::startSource(sp<AudioOutputDescriptor> outputDesc,
+ audio_stream_type_t stream,
+ audio_devices_t device,
+ uint32_t *delayMs)
+{
// cannot start playback of STREAM_TTS if any other output is being used
uint32_t beaconMuteLatency = 0;
+
+ *delayMs = 0;
if (stream == AUDIO_STREAM_TTS) {
ALOGV("\t found BEACON stream");
- if (isAnyOutputActive(AUDIO_STREAM_TTS /*streamToIgnore*/)) {
+ if (mOutputs.isAnyOutputActive(AUDIO_STREAM_TTS /*streamToIgnore*/)) {
return INVALID_OPERATION;
} else {
beaconMuteLatency = handleEventForBeacon(STARTING_BEACON);
@@ -1258,27 +1076,24 @@ status_t AudioPolicyManager::startOutput(audio_io_handle_t output,
beaconMuteLatency = handleEventForBeacon(STARTING_OUTPUT);
}
- sp<AudioOutputDescriptor> outputDesc = mOutputs.valueAt(index);
+ // check active before incrementing usage count
+ bool force = !outputDesc->isActive();
// increment usage count for this stream on the requested output:
// NOTE that the usage count is the same for duplicated output and hardware output which is
// necessary for a correct control of hardware output routing by startOutput() and stopOutput()
outputDesc->changeRefCount(stream, 1);
- if (outputDesc->mRefCount[stream] == 1) {
+ if (outputDesc->mRefCount[stream] == 1 || device != AUDIO_DEVICE_NONE) {
// starting an output being rerouted?
- audio_devices_t newDevice;
- if (outputDesc->mPolicyMix != NULL) {
- newDevice = AUDIO_DEVICE_OUT_REMOTE_SUBMIX;
- } else {
- newDevice = getNewOutputDevice(output, false /*fromCache*/);
+ if (device == AUDIO_DEVICE_NONE) {
+ device = getNewOutputDevice(outputDesc, false /*fromCache*/);
}
routing_strategy strategy = getStrategy(stream);
bool shouldWait = (strategy == STRATEGY_SONIFICATION) ||
(strategy == STRATEGY_SONIFICATION_RESPECTFUL) ||
(beaconMuteLatency > 0);
uint32_t waitMs = beaconMuteLatency;
- bool force = false;
for (size_t i = 0; i < mOutputs.size(); i++) {
sp<AudioOutputDescriptor> desc = mOutputs.valueAt(i);
if (desc != outputDesc) {
@@ -1287,7 +1102,7 @@ status_t AudioPolicyManager::startOutput(audio_io_handle_t output,
// In this case, the audio HAL must receive the new device selection so that it can
// change the device currently selected by the other active output.
if (outputDesc->sharesHwModuleWith(desc) &&
- desc->device() != newDevice) {
+ desc->device() != device) {
force = true;
}
// wait for audio on other active outputs to be presented when starting
@@ -1299,7 +1114,7 @@ status_t AudioPolicyManager::startOutput(audio_io_handle_t output,
}
}
}
- uint32_t muteWaitMs = setOutputDevice(output, newDevice, force);
+ uint32_t muteWaitMs = setOutputDevice(outputDesc, device, force);
// handle special case for sonification while in call
if (isInCall()) {
@@ -1308,31 +1123,18 @@ status_t AudioPolicyManager::startOutput(audio_io_handle_t output,
// apply volume rules for current stream and device if necessary
checkAndSetVolume(stream,
- mStreams[stream].getVolumeIndex(newDevice),
- output,
- newDevice);
+ mStreams.valueFor(stream).getVolumeIndex(device),
+ outputDesc,
+ device);
// update the outputs if starting an output with a stream that can affect notification
// routing
handleNotificationRoutingForStream(stream);
- // Automatically enable the remote submix input when output is started on a re routing mix
- // of type MIX_TYPE_RECORDERS
- if (audio_is_remote_submix_device(newDevice) && outputDesc->mPolicyMix != NULL &&
- outputDesc->mPolicyMix->mMixType == MIX_TYPE_RECORDERS) {
- setDeviceConnectionStateInt(AUDIO_DEVICE_IN_REMOTE_SUBMIX,
- AUDIO_POLICY_DEVICE_STATE_AVAILABLE,
- outputDesc->mPolicyMix->mRegistrationId);
- }
-
// force reevaluating accessibility routing when ringtone or alarm starts
if (strategy == STRATEGY_SONIFICATION) {
mpClientInterface->invalidateStream(AUDIO_STREAM_ACCESSIBILITY);
}
-
- if (waitMs > muteWaitMs) {
- usleep((waitMs - muteWaitMs) * 2 * 1000);
- }
}
return NO_ERROR;
}
@@ -1349,8 +1151,39 @@ status_t AudioPolicyManager::stopOutput(audio_io_handle_t output,
return BAD_VALUE;
}
- sp<AudioOutputDescriptor> outputDesc = mOutputs.valueAt(index);
+ sp<SwAudioOutputDescriptor> outputDesc = mOutputs.valueAt(index);
+
+ if (outputDesc->mRefCount[stream] == 1) {
+ // Automatically disable the remote submix input when output is stopped on a
+ // re routing mix of type MIX_TYPE_RECORDERS
+ if (audio_is_remote_submix_device(outputDesc->mDevice) &&
+ outputDesc->mPolicyMix != NULL &&
+ outputDesc->mPolicyMix->mMixType == MIX_TYPE_RECORDERS) {
+ setDeviceConnectionStateInt(AUDIO_DEVICE_IN_REMOTE_SUBMIX,
+ AUDIO_POLICY_DEVICE_STATE_UNAVAILABLE,
+ outputDesc->mPolicyMix->mRegistrationId,
+ "remote-submix");
+ }
+ }
+
+ // Routing?
+ bool forceDeviceUpdate = false;
+ if (outputDesc->mRefCount[stream] > 0) {
+ int activityCount = mOutputRoutes.decRouteActivity(session);
+ forceDeviceUpdate = (mOutputRoutes.hasRoute(session) && (activityCount == 0));
+
+ if (forceDeviceUpdate) {
+ checkStrategyRoute(getStrategy(stream), AUDIO_IO_HANDLE_NONE);
+ }
+ }
+
+ return stopSource(outputDesc, stream, forceDeviceUpdate);
+}
+status_t AudioPolicyManager::stopSource(sp<AudioOutputDescriptor> outputDesc,
+ audio_stream_type_t stream,
+ bool forceDeviceUpdate)
+{
// always handle stream stop, check which stream type is stopping
handleEventForBeacon(stream == AUDIO_STREAM_TTS ? STOPPING_BEACON : STOPPING_OUTPUT);
@@ -1362,40 +1195,31 @@ status_t AudioPolicyManager::stopOutput(audio_io_handle_t output,
if (outputDesc->mRefCount[stream] > 0) {
// decrement usage count of this stream on the output
outputDesc->changeRefCount(stream, -1);
- // store time at which the stream was stopped - see isStreamActive()
- if (outputDesc->mRefCount[stream] == 0) {
- // Automatically disable the remote submix input when output is stopped on a
- // re routing mix of type MIX_TYPE_RECORDERS
- if (audio_is_remote_submix_device(outputDesc->mDevice) &&
- outputDesc->mPolicyMix != NULL &&
- outputDesc->mPolicyMix->mMixType == MIX_TYPE_RECORDERS) {
- setDeviceConnectionStateInt(AUDIO_DEVICE_IN_REMOTE_SUBMIX,
- AUDIO_POLICY_DEVICE_STATE_UNAVAILABLE,
- outputDesc->mPolicyMix->mRegistrationId);
- }
+ // store time at which the stream was stopped - see isStreamActive()
+ if (outputDesc->mRefCount[stream] == 0 || forceDeviceUpdate) {
outputDesc->mStopTime[stream] = systemTime();
- audio_devices_t newDevice = getNewOutputDevice(output, false /*fromCache*/);
+ audio_devices_t newDevice = getNewOutputDevice(outputDesc, false /*fromCache*/);
// delay the device switch by twice the latency because stopOutput() is executed when
// the track stop() command is received and at that time the audio track buffer can
// still contain data that needs to be drained. The latency only covers the audio HAL
// and kernel buffers. Also the latency does not always include additional delay in the
// audio path (audio DSP, CODEC ...)
- setOutputDevice(output, newDevice, false, outputDesc->mLatency*2);
+ setOutputDevice(outputDesc, newDevice, false, outputDesc->latency()*2);
// force restoring the device selection on other active outputs if it differs from the
// one being selected for this output
for (size_t i = 0; i < mOutputs.size(); i++) {
audio_io_handle_t curOutput = mOutputs.keyAt(i);
sp<AudioOutputDescriptor> desc = mOutputs.valueAt(i);
- if (curOutput != output &&
+ if (desc != outputDesc &&
desc->isActive() &&
outputDesc->sharesHwModuleWith(desc) &&
(newDevice != desc->device())) {
- setOutputDevice(curOutput,
- getNewOutputDevice(curOutput, false /*fromCache*/),
+ setOutputDevice(desc,
+ getNewOutputDevice(desc, false /*fromCache*/),
true,
- outputDesc->mLatency*2);
+ outputDesc->latency()*2);
}
}
// update the outputs if stopping one with a stream that can affect notification routing
@@ -1403,7 +1227,7 @@ status_t AudioPolicyManager::stopOutput(audio_io_handle_t output,
}
return NO_ERROR;
} else {
- ALOGW("stopOutput() refcount is already 0 for output %d", output);
+ ALOGW("stopOutput() refcount is already 0");
return INVALID_OPERATION;
}
}
@@ -1425,14 +1249,17 @@ void AudioPolicyManager::releaseOutput(audio_io_handle_t output,
sp<AudioOutputDescriptor> outputDesc = mOutputs.valueAt(index);
if (outputDesc->isActive()) {
mpClientInterface->closeOutput(output);
- mOutputs.removeItem(output);
+ removeOutput(output);
mTestOutputs[testIndex] = 0;
}
return;
}
#endif //AUDIO_POLICY_TEST
- sp<AudioOutputDescriptor> desc = mOutputs.valueAt(index);
+ // Routing
+ mOutputRoutes.removeRoute(session);
+
+ sp<SwAudioOutputDescriptor> desc = mOutputs.valueAt(index);
if (desc->mFlags & AUDIO_OUTPUT_FLAG_DIRECT) {
if (desc->mDirectOpenCount <= 0) {
ALOGW("releaseOutput() invalid open count %d for output %d",
@@ -1444,8 +1271,9 @@ void AudioPolicyManager::releaseOutput(audio_io_handle_t output,
// If effects where present on the output, audioflinger moved them to the primary
// output by default: move them back to the appropriate output.
audio_io_handle_t dstOutput = getOutputForEffect();
- if (dstOutput != mPrimaryOutput) {
- mpClientInterface->moveEffects(AUDIO_SESSION_OUTPUT_MIX, mPrimaryOutput, dstOutput);
+ if (hasPrimaryOutput() && dstOutput != mPrimaryOutput->mIoHandle) {
+ mpClientInterface->moveEffects(AUDIO_SESSION_OUTPUT_MIX,
+ mPrimaryOutput->mIoHandle, dstOutput);
}
mpClientInterface->onAudioPortListUpdate();
}
@@ -1456,10 +1284,12 @@ void AudioPolicyManager::releaseOutput(audio_io_handle_t output,
status_t AudioPolicyManager::getInputForAttr(const audio_attributes_t *attr,
audio_io_handle_t *input,
audio_session_t session,
+ uid_t uid,
uint32_t samplingRate,
audio_format_t format,
audio_channel_mask_t channelMask,
audio_input_flags_t flags,
+ audio_port_handle_t selectedDeviceId,
input_type_t *inputType)
{
ALOGV("getInputForAttr() source %d, samplingRate %d, format %d, channelMask %x,"
@@ -1481,21 +1311,25 @@ status_t AudioPolicyManager::getInputForAttr(const audio_attributes_t *attr,
}
halInputSource = inputSource;
+ // Explicit routing?
+ sp<DeviceDescriptor> deviceDesc;
+ for (size_t i = 0; i < mAvailableInputDevices.size(); i++) {
+ if (mAvailableInputDevices[i]->getId() == selectedDeviceId) {
+ deviceDesc = mAvailableInputDevices[i];
+ break;
+ }
+ }
+ mInputRoutes.addRoute(session, SessionRoute::STREAM_TYPE_NA, inputSource, deviceDesc, uid);
+
if (inputSource == AUDIO_SOURCE_REMOTE_SUBMIX &&
strncmp(attr->tags, "addr=", strlen("addr=")) == 0) {
- device = AUDIO_DEVICE_IN_REMOTE_SUBMIX;
- address = String8(attr->tags + strlen("addr="));
- ssize_t index = mPolicyMixes.indexOfKey(address);
- if (index < 0) {
- ALOGW("getInputForAttr() no policy for address %s", address.string());
- return BAD_VALUE;
- }
- if (mPolicyMixes[index]->mMix.mMixType != MIX_TYPE_PLAYERS) {
- ALOGW("getInputForAttr() bad policy mix type for address %s", address.string());
- return BAD_VALUE;
+ status_t ret = mPolicyMixes.getInputMixForAttr(*attr, &policyMix);
+ if (ret != NO_ERROR) {
+ return ret;
}
- policyMix = &mPolicyMixes[index]->mMix;
*inputType = API_INPUT_MIX_EXT_POLICY_REROUTE;
+ device = AUDIO_DEVICE_IN_REMOTE_SUBMIX;
+ address = String8(attr->tags + strlen("addr="));
} else {
device = getDeviceAndMixForInputSource(inputSource, &policyMix);
if (device == AUDIO_DEVICE_NONE) {
@@ -1547,48 +1381,54 @@ status_t AudioPolicyManager::getInputForAttr(const audio_attributes_t *attr,
}
}
- sp<IOProfile> profile = getInputProfile(device, address,
- samplingRate, format, channelMask,
- flags);
- if (profile == 0) {
- //retry without flags
- audio_input_flags_t log_flags = flags;
- flags = AUDIO_INPUT_FLAG_NONE;
+ // find a compatible input profile (not necessarily identical in parameters)
+ sp<IOProfile> profile;
+ // samplingRate and flags may be updated by getInputProfile
+ uint32_t profileSamplingRate = samplingRate;
+ audio_format_t profileFormat = format;
+ audio_channel_mask_t profileChannelMask = channelMask;
+ audio_input_flags_t profileFlags = flags;
+ for (;;) {
profile = getInputProfile(device, address,
- samplingRate, format, channelMask,
- flags);
- if (profile == 0) {
+ profileSamplingRate, profileFormat, profileChannelMask,
+ profileFlags);
+ if (profile != 0) {
+ break; // success
+ } else if (profileFlags != AUDIO_INPUT_FLAG_NONE) {
+ profileFlags = AUDIO_INPUT_FLAG_NONE; // retry
+ } else { // fail
ALOGW("getInputForAttr() could not find profile for device 0x%X, samplingRate %u,"
"format %#x, channelMask 0x%X, flags %#x",
- device, samplingRate, format, channelMask, log_flags);
+ device, samplingRate, format, channelMask, flags);
return BAD_VALUE;
}
}
- if (profile->mModule->mHandle == 0) {
- ALOGE("getInputForAttr(): HW module %s not opened", profile->mModule->mName);
+ if (profile->getModuleHandle() == 0) {
+ ALOGE("getInputForAttr(): HW module %s not opened", profile->getModuleName());
return NO_INIT;
}
audio_config_t config = AUDIO_CONFIG_INITIALIZER;
- config.sample_rate = samplingRate;
- config.channel_mask = channelMask;
- config.format = format;
+ config.sample_rate = profileSamplingRate;
+ config.channel_mask = profileChannelMask;
+ config.format = profileFormat;
- status_t status = mpClientInterface->openInput(profile->mModule->mHandle,
+ status_t status = mpClientInterface->openInput(profile->getModuleHandle(),
input,
&config,
&device,
address,
halInputSource,
- flags);
+ profileFlags);
// only accept input with the exact requested set of parameters
if (status != NO_ERROR || *input == AUDIO_IO_HANDLE_NONE ||
- (samplingRate != config.sample_rate) ||
- (format != config.format) ||
- (channelMask != config.channel_mask)) {
- ALOGW("getInputForAttr() failed opening input: samplingRate %d, format %d, channelMask %x",
+ (profileSamplingRate != config.sample_rate) ||
+ (profileFormat != config.format) ||
+ (profileChannelMask != config.channel_mask)) {
+ ALOGW("getInputForAttr() failed opening input: samplingRate %d, format %d,"
+ " channelMask %x",
samplingRate, format, channelMask);
if (*input != AUDIO_IO_HANDLE_NONE) {
mpClientInterface->closeInput(*input);
@@ -1600,18 +1440,19 @@ status_t AudioPolicyManager::getInputForAttr(const audio_attributes_t *attr,
inputDesc->mInputSource = inputSource;
inputDesc->mRefCount = 0;
inputDesc->mOpenRefCount = 1;
- inputDesc->mSamplingRate = samplingRate;
- inputDesc->mFormat = format;
- inputDesc->mChannelMask = channelMask;
+ inputDesc->mSamplingRate = profileSamplingRate;
+ inputDesc->mFormat = profileFormat;
+ inputDesc->mChannelMask = profileChannelMask;
inputDesc->mDevice = device;
inputDesc->mSessions.add(session);
inputDesc->mIsSoundTrigger = isSoundTrigger;
inputDesc->mPolicyMix = policyMix;
- ALOGV("getInputForAttr() returns input type = %d", inputType);
+ ALOGV("getInputForAttr() returns input type = %d", *inputType);
addInput(*input, inputDesc);
mpClientInterface->onAudioPortListUpdate();
+
return NO_ERROR;
}
@@ -1633,10 +1474,10 @@ status_t AudioPolicyManager::startInput(audio_io_handle_t input,
}
// virtual input devices are compatible with other input devices
- if (!isVirtualInputDevice(inputDesc->mDevice)) {
+ if (!is_virtual_input_device(inputDesc->mDevice)) {
// for a non-virtual input device, check if there is another (non-virtual) active input
- audio_io_handle_t activeInput = getActiveInput();
+ audio_io_handle_t activeInput = mInputs.getActiveInput();
if (activeInput != 0 && activeInput != input) {
// If the already active input uses AUDIO_SOURCE_HOTWORD then it is closed,
@@ -1653,8 +1494,18 @@ status_t AudioPolicyManager::startInput(audio_io_handle_t input,
}
}
- if (inputDesc->mRefCount == 0) {
- if (activeInputsCount() == 0) {
+ // Routing?
+ mInputRoutes.incRouteActivity(session);
+
+ if (inputDesc->mRefCount == 0 || mInputRoutes.hasRouteChanged(session)) {
+ // if input maps to a dynamic policy with an activity listener, notify of state change
+ if ((inputDesc->mPolicyMix != NULL)
+ && ((inputDesc->mPolicyMix->mCbFlags & AudioMix::kCbFlagNotifyActivity) != 0)) {
+ mpClientInterface->onDynamicPolicyMixStateUpdate(inputDesc->mPolicyMix->mRegistrationId,
+ MIX_STATE_MIXING);
+ }
+
+ if (mInputs.activeInputsCount() == 0) {
SoundTrigger::setCaptureState(true);
}
setInputDevice(input, getNewInputDevice(input), true /* force */);
@@ -1672,7 +1523,7 @@ status_t AudioPolicyManager::startInput(audio_io_handle_t input,
if (address != "") {
setDeviceConnectionStateInt(AUDIO_DEVICE_OUT_REMOTE_SUBMIX,
AUDIO_POLICY_DEVICE_STATE_AVAILABLE,
- address);
+ address, "remote-submix");
}
}
}
@@ -1706,7 +1557,17 @@ status_t AudioPolicyManager::stopInput(audio_io_handle_t input,
}
inputDesc->mRefCount--;
+
+ // Routing?
+ mInputRoutes.decRouteActivity(session);
+
if (inputDesc->mRefCount == 0) {
+ // if input maps to a dynamic policy with an activity listener, notify of state change
+ if ((inputDesc->mPolicyMix != NULL)
+ && ((inputDesc->mPolicyMix->mCbFlags & AudioMix::kCbFlagNotifyActivity) != 0)) {
+ mpClientInterface->onDynamicPolicyMixStateUpdate(inputDesc->mPolicyMix->mRegistrationId,
+ MIX_STATE_IDLE);
+ }
// automatically disable the remote submix output when input is stopped if not
// used by a policy mix of type MIX_TYPE_RECORDERS
@@ -1720,13 +1581,13 @@ status_t AudioPolicyManager::stopInput(audio_io_handle_t input,
if (address != "") {
setDeviceConnectionStateInt(AUDIO_DEVICE_OUT_REMOTE_SUBMIX,
AUDIO_POLICY_DEVICE_STATE_UNAVAILABLE,
- address);
+ address, "remote-submix");
}
}
resetInputDevice(input);
- if (activeInputsCount() == 0) {
+ if (mInputs.activeInputsCount() == 0) {
SoundTrigger::setCaptureState(false);
}
}
@@ -1742,6 +1603,10 @@ void AudioPolicyManager::releaseInput(audio_io_handle_t input,
ALOGW("releaseInput() releasing unknown input %d", input);
return;
}
+
+ // Routing
+ mInputRoutes.removeRoute(session);
+
sp<AudioInputDescriptor> inputDesc = mInputs.valueAt(index);
ALOG_ASSERT(inputDesc != 0);
@@ -1793,25 +1658,20 @@ void AudioPolicyManager::initStreamVolume(audio_stream_type_t stream,
int indexMax)
{
ALOGV("initStreamVolume() stream %d, min %d, max %d", stream , indexMin, indexMax);
- if (indexMin < 0 || indexMin >= indexMax) {
- ALOGW("initStreamVolume() invalid index limits for stream %d, min %d, max %d", stream , indexMin, indexMax);
- return;
- }
- mStreams[stream].mIndexMin = indexMin;
- mStreams[stream].mIndexMax = indexMax;
+ mEngine->initStreamVolume(stream, indexMin, indexMax);
//FIXME: AUDIO_STREAM_ACCESSIBILITY volume follows AUDIO_STREAM_MUSIC for now
if (stream == AUDIO_STREAM_MUSIC) {
- mStreams[AUDIO_STREAM_ACCESSIBILITY].mIndexMin = indexMin;
- mStreams[AUDIO_STREAM_ACCESSIBILITY].mIndexMax = indexMax;
+ mEngine->initStreamVolume(AUDIO_STREAM_ACCESSIBILITY, indexMin, indexMax);
}
}
status_t AudioPolicyManager::setStreamVolumeIndex(audio_stream_type_t stream,
- int index,
- audio_devices_t device)
+ int index,
+ audio_devices_t device)
{
- if ((index < mStreams[stream].mIndexMin) || (index > mStreams[stream].mIndexMax)) {
+ if ((index < mStreams.valueFor(stream).getVolumeIndexMin()) ||
+ (index > mStreams.valueFor(stream).getVolumeIndexMax())) {
return BAD_VALUE;
}
if (!audio_is_output_device(device)) {
@@ -1819,7 +1679,7 @@ status_t AudioPolicyManager::setStreamVolumeIndex(audio_stream_type_t stream,
}
// Force max volume if stream cannot be muted
- if (!mStreams[stream].mCanBeMuted) index = mStreams[stream].mIndexMax;
+ if (!mStreams.canBeMuted(stream)) index = mStreams.valueFor(stream).getVolumeIndexMax();
ALOGV("setStreamVolumeIndex() stream %d, device %04x, index %d",
stream, device, index);
@@ -1827,9 +1687,9 @@ status_t AudioPolicyManager::setStreamVolumeIndex(audio_stream_type_t stream,
// if device is AUDIO_DEVICE_OUT_DEFAULT set default value and
// clear all device specific values
if (device == AUDIO_DEVICE_OUT_DEFAULT) {
- mStreams[stream].mIndexCur.clear();
+ mStreams.clearCurrentVolumeIndex(stream);
}
- mStreams[stream].mIndexCur.add(device, index);
+ mStreams.addCurrentVolumeIndex(stream, device, index);
// update volume on all outputs whose current device is also selected by the same
// strategy as the device specified by the caller
@@ -1839,7 +1699,7 @@ status_t AudioPolicyManager::setStreamVolumeIndex(audio_stream_type_t stream,
//FIXME: AUDIO_STREAM_ACCESSIBILITY volume follows AUDIO_STREAM_MUSIC for now
audio_devices_t accessibilityDevice = AUDIO_DEVICE_NONE;
if (stream == AUDIO_STREAM_MUSIC) {
- mStreams[AUDIO_STREAM_ACCESSIBILITY].mIndexCur.add(device, index);
+ mStreams.addCurrentVolumeIndex(AUDIO_STREAM_ACCESSIBILITY, device, index);
accessibilityDevice = getDeviceForStrategy(STRATEGY_ACCESSIBILITY, true /*fromCache*/);
}
if ((device != AUDIO_DEVICE_OUT_DEFAULT) &&
@@ -1848,17 +1708,17 @@ status_t AudioPolicyManager::setStreamVolumeIndex(audio_stream_type_t stream,
}
status_t status = NO_ERROR;
for (size_t i = 0; i < mOutputs.size(); i++) {
- audio_devices_t curDevice =
- getDeviceForVolume(mOutputs.valueAt(i)->device());
+ sp<SwAudioOutputDescriptor> desc = mOutputs.valueAt(i);
+ audio_devices_t curDevice = Volume::getDeviceForVolume(desc->device());
if ((device == AUDIO_DEVICE_OUT_DEFAULT) || ((curDevice & strategyDevice) != 0)) {
- status_t volStatus = checkAndSetVolume(stream, index, mOutputs.keyAt(i), curDevice);
+ status_t volStatus = checkAndSetVolume(stream, index, desc, curDevice);
if (volStatus != NO_ERROR) {
status = volStatus;
}
}
if ((device == AUDIO_DEVICE_OUT_DEFAULT) || ((curDevice & accessibilityDevice) != 0)) {
status_t volStatus = checkAndSetVolume(AUDIO_STREAM_ACCESSIBILITY,
- index, mOutputs.keyAt(i), curDevice);
+ index, desc, curDevice);
}
}
return status;
@@ -1879,9 +1739,9 @@ status_t AudioPolicyManager::getStreamVolumeIndex(audio_stream_type_t stream,
if (device == AUDIO_DEVICE_OUT_DEFAULT) {
device = getDeviceForStrategy(getStrategy(stream), true /*fromCache*/);
}
- device = getDeviceForVolume(device);
+ device = Volume::getDeviceForVolume(device);
- *index = mStreams[stream].getVolumeIndex(device);
+ *index = mStreams.valueFor(stream).getVolumeIndex(device);
ALOGV("getStreamVolumeIndex() stream %d device %08x index %d", stream, device, *index);
return NO_ERROR;
}
@@ -1905,7 +1765,7 @@ audio_io_handle_t AudioPolicyManager::selectOutputForEffects(
audio_io_handle_t outputDeepBuffer = 0;
for (size_t i = 0; i < outputs.size(); i++) {
- sp<AudioOutputDescriptor> desc = mOutputs.valueFor(outputs[i]);
+ sp<SwAudioOutputDescriptor> desc = mOutputs.valueFor(outputs[i]);
ALOGV("selectOutputForEffects outputs[%zu] flags %x", i, desc->mFlags);
if ((desc->mFlags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD) != 0) {
outputOffloaded = outputs[i];
@@ -1956,137 +1816,17 @@ status_t AudioPolicyManager::registerEffect(const effect_descriptor_t *desc,
return INVALID_OPERATION;
}
}
-
- if (mTotalEffectsMemory + desc->memoryUsage > getMaxEffectsMemory()) {
- ALOGW("registerEffect() memory limit exceeded for Fx %s, Memory %d KB",
- desc->name, desc->memoryUsage);
- return INVALID_OPERATION;
- }
- mTotalEffectsMemory += desc->memoryUsage;
- ALOGV("registerEffect() effect %s, io %d, strategy %d session %d id %d",
- desc->name, io, strategy, session, id);
- ALOGV("registerEffect() memory %d, total memory %d", desc->memoryUsage, mTotalEffectsMemory);
-
- sp<EffectDescriptor> effectDesc = new EffectDescriptor();
- memcpy (&effectDesc->mDesc, desc, sizeof(effect_descriptor_t));
- effectDesc->mIo = io;
- effectDesc->mStrategy = (routing_strategy)strategy;
- effectDesc->mSession = session;
- effectDesc->mEnabled = false;
-
- mEffects.add(id, effectDesc);
-
- return NO_ERROR;
-}
-
-status_t AudioPolicyManager::unregisterEffect(int id)
-{
- ssize_t index = mEffects.indexOfKey(id);
- if (index < 0) {
- ALOGW("unregisterEffect() unknown effect ID %d", id);
- return INVALID_OPERATION;
- }
-
- sp<EffectDescriptor> effectDesc = mEffects.valueAt(index);
-
- setEffectEnabled(effectDesc, false);
-
- if (mTotalEffectsMemory < effectDesc->mDesc.memoryUsage) {
- ALOGW("unregisterEffect() memory %d too big for total %d",
- effectDesc->mDesc.memoryUsage, mTotalEffectsMemory);
- effectDesc->mDesc.memoryUsage = mTotalEffectsMemory;
- }
- mTotalEffectsMemory -= effectDesc->mDesc.memoryUsage;
- ALOGV("unregisterEffect() effect %s, ID %d, memory %d total memory %d",
- effectDesc->mDesc.name, id, effectDesc->mDesc.memoryUsage, mTotalEffectsMemory);
-
- mEffects.removeItem(id);
-
- return NO_ERROR;
-}
-
-status_t AudioPolicyManager::setEffectEnabled(int id, bool enabled)
-{
- ssize_t index = mEffects.indexOfKey(id);
- if (index < 0) {
- ALOGW("unregisterEffect() unknown effect ID %d", id);
- return INVALID_OPERATION;
- }
-
- return setEffectEnabled(mEffects.valueAt(index), enabled);
-}
-
-status_t AudioPolicyManager::setEffectEnabled(const sp<EffectDescriptor>& effectDesc, bool enabled)
-{
- if (enabled == effectDesc->mEnabled) {
- ALOGV("setEffectEnabled(%s) effect already %s",
- enabled?"true":"false", enabled?"enabled":"disabled");
- return INVALID_OPERATION;
- }
-
- if (enabled) {
- if (mTotalEffectsCpuLoad + effectDesc->mDesc.cpuLoad > getMaxEffectsCpuLoad()) {
- ALOGW("setEffectEnabled(true) CPU Load limit exceeded for Fx %s, CPU %f MIPS",
- effectDesc->mDesc.name, (float)effectDesc->mDesc.cpuLoad/10);
- return INVALID_OPERATION;
- }
- mTotalEffectsCpuLoad += effectDesc->mDesc.cpuLoad;
- ALOGV("setEffectEnabled(true) total CPU %d", mTotalEffectsCpuLoad);
- } else {
- if (mTotalEffectsCpuLoad < effectDesc->mDesc.cpuLoad) {
- ALOGW("setEffectEnabled(false) CPU load %d too high for total %d",
- effectDesc->mDesc.cpuLoad, mTotalEffectsCpuLoad);
- effectDesc->mDesc.cpuLoad = mTotalEffectsCpuLoad;
- }
- mTotalEffectsCpuLoad -= effectDesc->mDesc.cpuLoad;
- ALOGV("setEffectEnabled(false) total CPU %d", mTotalEffectsCpuLoad);
- }
- effectDesc->mEnabled = enabled;
- return NO_ERROR;
-}
-
-bool AudioPolicyManager::isNonOffloadableEffectEnabled()
-{
- for (size_t i = 0; i < mEffects.size(); i++) {
- sp<EffectDescriptor> effectDesc = mEffects.valueAt(i);
- if (effectDesc->mEnabled && (effectDesc->mStrategy == STRATEGY_MEDIA) &&
- ((effectDesc->mDesc.flags & EFFECT_FLAG_OFFLOAD_SUPPORTED) == 0)) {
- ALOGV("isNonOffloadableEffectEnabled() non offloadable effect %s enabled on session %d",
- effectDesc->mDesc.name, effectDesc->mSession);
- return true;
- }
- }
- return false;
+ return mEffects.registerEffect(desc, io, strategy, session, id);
}
bool AudioPolicyManager::isStreamActive(audio_stream_type_t stream, uint32_t inPastMs) const
{
- nsecs_t sysTime = systemTime();
- for (size_t i = 0; i < mOutputs.size(); i++) {
- const sp<AudioOutputDescriptor> outputDesc = mOutputs.valueAt(i);
- if (outputDesc->isStreamActive(stream, inPastMs, sysTime)) {
- return true;
- }
- }
- return false;
+ return mOutputs.isStreamActive(stream, inPastMs);
}
-bool AudioPolicyManager::isStreamActiveRemotely(audio_stream_type_t stream,
- uint32_t inPastMs) const
+bool AudioPolicyManager::isStreamActiveRemotely(audio_stream_type_t stream, uint32_t inPastMs) const
{
- nsecs_t sysTime = systemTime();
- for (size_t i = 0; i < mOutputs.size(); i++) {
- const sp<AudioOutputDescriptor> outputDesc = mOutputs.valueAt(i);
- if (((outputDesc->device() & APM_AUDIO_OUT_DEVICE_REMOTE_ALL) != 0) &&
- outputDesc->isStreamActive(stream, inPastMs, sysTime)) {
- // do not consider re routing (when the output is going to a dynamic policy)
- // as "remote playback"
- if (outputDesc->mPolicyMix == NULL) {
- return true;
- }
- }
- }
- return false;
+ return mOutputs.isStreamActiveRemotely(stream, inPastMs);
}
bool AudioPolicyManager::isSourceActive(audio_source_t source) const
@@ -2156,9 +1896,8 @@ status_t AudioPolicyManager::registerPolicyMixes(Vector<AudioMix> mixes)
for (size_t i = 0; i < mixes.size(); i++) {
String8 address = mixes[i].mRegistrationId;
- ssize_t index = mPolicyMixes.indexOfKey(address);
- if (index >= 0) {
- ALOGE("registerPolicyMixes(): mix for address %s already registered", address.string());
+
+ if (mPolicyMixes.registerMix(address, mixes[i]) != NO_ERROR) {
continue;
}
audio_config_t outputConfig = mixes[i].mFormat;
@@ -2171,17 +1910,15 @@ status_t AudioPolicyManager::registerPolicyMixes(Vector<AudioMix> mixes)
AUDIO_DEVICE_OUT_REMOTE_SUBMIX, address);
module->addInputProfile(address, &inputConfig,
AUDIO_DEVICE_IN_REMOTE_SUBMIX, address);
- sp<AudioPolicyMix> policyMix = new AudioPolicyMix();
- policyMix->mMix = mixes[i];
- mPolicyMixes.add(address, policyMix);
+
if (mixes[i].mMixType == MIX_TYPE_PLAYERS) {
setDeviceConnectionStateInt(AUDIO_DEVICE_IN_REMOTE_SUBMIX,
AUDIO_POLICY_DEVICE_STATE_AVAILABLE,
- address.string());
+ address.string(), "remote-submix");
} else {
setDeviceConnectionStateInt(AUDIO_DEVICE_OUT_REMOTE_SUBMIX,
AUDIO_POLICY_DEVICE_STATE_AVAILABLE,
- address.string());
+ address.string(), "remote-submix");
}
}
return NO_ERROR;
@@ -2206,20 +1943,17 @@ status_t AudioPolicyManager::unregisterPolicyMixes(Vector<AudioMix> mixes)
for (size_t i = 0; i < mixes.size(); i++) {
String8 address = mixes[i].mRegistrationId;
- ssize_t index = mPolicyMixes.indexOfKey(address);
- if (index < 0) {
- ALOGE("unregisterPolicyMixes(): mix for address %s not registered", address.string());
+
+ if (mPolicyMixes.unregisterMix(address) != NO_ERROR) {
continue;
}
- mPolicyMixes.removeItemsAt(index);
-
if (getDeviceConnectionState(AUDIO_DEVICE_IN_REMOTE_SUBMIX, address.string()) ==
AUDIO_POLICY_DEVICE_STATE_AVAILABLE)
{
setDeviceConnectionStateInt(AUDIO_DEVICE_IN_REMOTE_SUBMIX,
AUDIO_POLICY_DEVICE_STATE_UNAVAILABLE,
- address.string());
+ address.string(), "remote-submix");
}
if (getDeviceConnectionState(AUDIO_DEVICE_OUT_REMOTE_SUBMIX, address.string()) ==
@@ -2227,7 +1961,7 @@ status_t AudioPolicyManager::unregisterPolicyMixes(Vector<AudioMix> mixes)
{
setDeviceConnectionStateInt(AUDIO_DEVICE_OUT_REMOTE_SUBMIX,
AUDIO_POLICY_DEVICE_STATE_UNAVAILABLE,
- address.string());
+ address.string(), "remote-submix");
}
module->removeOutputProfile(address);
module->removeInputProfile(address);
@@ -2245,89 +1979,35 @@ status_t AudioPolicyManager::dump(int fd)
snprintf(buffer, SIZE, "\nAudioPolicyManager Dump: %p\n", this);
result.append(buffer);
- snprintf(buffer, SIZE, " Primary Output: %d\n", mPrimaryOutput);
+ snprintf(buffer, SIZE, " Primary Output: %d\n",
+ hasPrimaryOutput() ? mPrimaryOutput->mIoHandle : AUDIO_IO_HANDLE_NONE);
result.append(buffer);
- snprintf(buffer, SIZE, " Phone state: %d\n", mPhoneState);
+ snprintf(buffer, SIZE, " Phone state: %d\n", mEngine->getPhoneState());
result.append(buffer);
snprintf(buffer, SIZE, " Force use for communications %d\n",
- mForceUse[AUDIO_POLICY_FORCE_FOR_COMMUNICATION]);
+ mEngine->getForceUse(AUDIO_POLICY_FORCE_FOR_COMMUNICATION));
result.append(buffer);
- snprintf(buffer, SIZE, " Force use for media %d\n", mForceUse[AUDIO_POLICY_FORCE_FOR_MEDIA]);
+ snprintf(buffer, SIZE, " Force use for media %d\n", mEngine->getForceUse(AUDIO_POLICY_FORCE_FOR_MEDIA));
result.append(buffer);
- snprintf(buffer, SIZE, " Force use for record %d\n", mForceUse[AUDIO_POLICY_FORCE_FOR_RECORD]);
+ snprintf(buffer, SIZE, " Force use for record %d\n", mEngine->getForceUse(AUDIO_POLICY_FORCE_FOR_RECORD));
result.append(buffer);
- snprintf(buffer, SIZE, " Force use for dock %d\n", mForceUse[AUDIO_POLICY_FORCE_FOR_DOCK]);
+ snprintf(buffer, SIZE, " Force use for dock %d\n", mEngine->getForceUse(AUDIO_POLICY_FORCE_FOR_DOCK));
result.append(buffer);
- snprintf(buffer, SIZE, " Force use for system %d\n", mForceUse[AUDIO_POLICY_FORCE_FOR_SYSTEM]);
+ snprintf(buffer, SIZE, " Force use for system %d\n", mEngine->getForceUse(AUDIO_POLICY_FORCE_FOR_SYSTEM));
result.append(buffer);
snprintf(buffer, SIZE, " Force use for hdmi system audio %d\n",
- mForceUse[AUDIO_POLICY_FORCE_FOR_HDMI_SYSTEM_AUDIO]);
- result.append(buffer);
-
- snprintf(buffer, SIZE, " Available output devices:\n");
+ mEngine->getForceUse(AUDIO_POLICY_FORCE_FOR_HDMI_SYSTEM_AUDIO));
result.append(buffer);
write(fd, result.string(), result.size());
- for (size_t i = 0; i < mAvailableOutputDevices.size(); i++) {
- mAvailableOutputDevices[i]->dump(fd, 2, i);
- }
- snprintf(buffer, SIZE, "\n Available input devices:\n");
- write(fd, buffer, strlen(buffer));
- for (size_t i = 0; i < mAvailableInputDevices.size(); i++) {
- mAvailableInputDevices[i]->dump(fd, 2, i);
- }
-
- snprintf(buffer, SIZE, "\nHW Modules dump:\n");
- write(fd, buffer, strlen(buffer));
- for (size_t i = 0; i < mHwModules.size(); i++) {
- snprintf(buffer, SIZE, "- HW Module %zu:\n", i + 1);
- write(fd, buffer, strlen(buffer));
- mHwModules[i]->dump(fd);
- }
-
- snprintf(buffer, SIZE, "\nOutputs dump:\n");
- write(fd, buffer, strlen(buffer));
- for (size_t i = 0; i < mOutputs.size(); i++) {
- snprintf(buffer, SIZE, "- Output %d dump:\n", mOutputs.keyAt(i));
- write(fd, buffer, strlen(buffer));
- mOutputs.valueAt(i)->dump(fd);
- }
- snprintf(buffer, SIZE, "\nInputs dump:\n");
- write(fd, buffer, strlen(buffer));
- for (size_t i = 0; i < mInputs.size(); i++) {
- snprintf(buffer, SIZE, "- Input %d dump:\n", mInputs.keyAt(i));
- write(fd, buffer, strlen(buffer));
- mInputs.valueAt(i)->dump(fd);
- }
-
- snprintf(buffer, SIZE, "\nStreams dump:\n");
- write(fd, buffer, strlen(buffer));
- snprintf(buffer, SIZE,
- " Stream Can be muted Index Min Index Max Index Cur [device : index]...\n");
- write(fd, buffer, strlen(buffer));
- for (size_t i = 0; i < AUDIO_STREAM_CNT; i++) {
- snprintf(buffer, SIZE, " %02zu ", i);
- write(fd, buffer, strlen(buffer));
- mStreams[i].dump(fd);
- }
-
- snprintf(buffer, SIZE, "\nTotal Effects CPU: %f MIPS, Total Effects memory: %d KB\n",
- (float)mTotalEffectsCpuLoad/10, mTotalEffectsMemory);
- write(fd, buffer, strlen(buffer));
-
- snprintf(buffer, SIZE, "Registered effects:\n");
- write(fd, buffer, strlen(buffer));
- for (size_t i = 0; i < mEffects.size(); i++) {
- snprintf(buffer, SIZE, "- Effect %d dump:\n", mEffects.keyAt(i));
- write(fd, buffer, strlen(buffer));
- mEffects.valueAt(i)->dump(fd);
- }
-
- snprintf(buffer, SIZE, "\nAudio Patches:\n");
- write(fd, buffer, strlen(buffer));
- for (size_t i = 0; i < mAudioPatches.size(); i++) {
- mAudioPatches[i]->dump(fd, 2, i);
- }
+ mAvailableOutputDevices.dump(fd, String8("output"));
+ mAvailableInputDevices.dump(fd, String8("input"));
+ mHwModules.dump(fd);
+ mOutputs.dump(fd);
+ mInputs.dump(fd);
+ mStreams.dump(fd);
+ mEffects.dump(fd);
+ mAudioPatches.dump(fd);
return NO_ERROR;
}
@@ -2361,8 +2041,9 @@ bool AudioPolicyManager::isOffloadSupported(const audio_offload_info_t& offloadI
}
//TODO: enable audio offloading with video when ready
- if (offloadInfo.has_video)
- {
+ const bool allowOffloadWithVideo =
+ property_get_bool("audio.offload.video", false /* default_value */);
+ if (offloadInfo.has_video && !allowOffloadWithVideo) {
ALOGV("isOffloadSupported: has_video == true, returning false");
return false;
}
@@ -2384,7 +2065,7 @@ bool AudioPolicyManager::isOffloadSupported(const audio_offload_info_t& offloadI
// FIXME: We should check the audio session here but we do not have it in this context.
// This may prevent offloading in rare situations where effects are left active by apps
// in the background.
- if (isNonOffloadableEffectEnabled()) {
+ if (mEffects.isNonOffloadableEffectEnabled()) {
return false;
}
@@ -2463,93 +2144,6 @@ status_t AudioPolicyManager::getAudioPort(struct audio_port *port __unused)
return NO_ERROR;
}
-sp<AudioPolicyManager::AudioOutputDescriptor> AudioPolicyManager::getOutputFromId(
- audio_port_handle_t id) const
-{
- sp<AudioOutputDescriptor> outputDesc = NULL;
- for (size_t i = 0; i < mOutputs.size(); i++) {
- outputDesc = mOutputs.valueAt(i);
- if (outputDesc->mId == id) {
- break;
- }
- }
- return outputDesc;
-}
-
-sp<AudioPolicyManager::AudioInputDescriptor> AudioPolicyManager::getInputFromId(
- audio_port_handle_t id) const
-{
- sp<AudioInputDescriptor> inputDesc = NULL;
- for (size_t i = 0; i < mInputs.size(); i++) {
- inputDesc = mInputs.valueAt(i);
- if (inputDesc->mId == id) {
- break;
- }
- }
- return inputDesc;
-}
-
-sp <AudioPolicyManager::HwModule> AudioPolicyManager::getModuleForDevice(
- audio_devices_t device) const
-{
- sp <HwModule> module;
-
- for (size_t i = 0; i < mHwModules.size(); i++) {
- if (mHwModules[i]->mHandle == 0) {
- continue;
- }
- if (audio_is_output_device(device)) {
- for (size_t j = 0; j < mHwModules[i]->mOutputProfiles.size(); j++)
- {
- if (mHwModules[i]->mOutputProfiles[j]->mSupportedDevices.types() & device) {
- return mHwModules[i];
- }
- }
- } else {
- for (size_t j = 0; j < mHwModules[i]->mInputProfiles.size(); j++) {
- if (mHwModules[i]->mInputProfiles[j]->mSupportedDevices.types() &
- device & ~AUDIO_DEVICE_BIT_IN) {
- return mHwModules[i];
- }
- }
- }
- }
- return module;
-}
-
-sp <AudioPolicyManager::HwModule> AudioPolicyManager::getModuleFromName(const char *name) const
-{
- sp <HwModule> module;
-
- for (size_t i = 0; i < mHwModules.size(); i++)
- {
- if (strcmp(mHwModules[i]->mName, name) == 0) {
- return mHwModules[i];
- }
- }
- return module;
-}
-
-audio_devices_t AudioPolicyManager::availablePrimaryOutputDevices()
-{
- sp<AudioOutputDescriptor> outputDesc = mOutputs.valueFor(mPrimaryOutput);
- audio_devices_t devices = outputDesc->mProfile->mSupportedDevices.types();
- return devices & mAvailableOutputDevices.types();
-}
-
-audio_devices_t AudioPolicyManager::availablePrimaryInputDevices()
-{
- audio_module_handle_t primaryHandle =
- mOutputs.valueFor(mPrimaryOutput)->mProfile->mModule->mHandle;
- audio_devices_t devices = AUDIO_DEVICE_NONE;
- for (size_t i = 0; i < mAvailableInputDevices.size(); i++) {
- if (mAvailableInputDevices[i]->mModule->mHandle == primaryHandle) {
- devices |= mAvailableInputDevices[i]->mDeviceType;
- }
- }
- return devices;
-}
-
status_t AudioPolicyManager::createAudioPatch(const struct audio_patch *patch,
audio_patch_handle_t *handle,
uid_t uid)
@@ -2605,7 +2199,7 @@ status_t AudioPolicyManager::createAudioPatch(const struct audio_patch *patch,
}
if (patch->sources[0].type == AUDIO_PORT_TYPE_MIX) {
- sp<AudioOutputDescriptor> outputDesc = getOutputFromId(patch->sources[0].id);
+ sp<SwAudioOutputDescriptor> outputDesc = mOutputs.getOutputFromId(patch->sources[0].id);
if (outputDesc == NULL) {
ALOGV("createAudioPatch() output not found for id %d", patch->sources[0].id);
return BAD_VALUE;
@@ -2634,15 +2228,17 @@ status_t AudioPolicyManager::createAudioPatch(const struct audio_patch *patch,
return BAD_VALUE;
}
- if (!outputDesc->mProfile->isCompatibleProfile(devDesc->mDeviceType,
+ if (!outputDesc->mProfile->isCompatibleProfile(devDesc->type(),
devDesc->mAddress,
patch->sources[0].sample_rate,
- NULL, // updatedSamplingRate
- patch->sources[0].format,
- patch->sources[0].channel_mask,
- AUDIO_OUTPUT_FLAG_NONE /*FIXME*/)) {
+ NULL, // updatedSamplingRate
+ patch->sources[0].format,
+ NULL, // updatedFormat
+ patch->sources[0].channel_mask,
+ NULL, // updatedChannelMask
+ AUDIO_OUTPUT_FLAG_NONE /*FIXME*/)) {
ALOGV("createAudioPatch() profile not supported for device %08x",
- devDesc->mDeviceType);
+ devDesc->type());
return INVALID_OPERATION;
}
devices.add(devDesc);
@@ -2654,7 +2250,7 @@ status_t AudioPolicyManager::createAudioPatch(const struct audio_patch *patch,
// TODO: reconfigure output format and channels here
ALOGV("createAudioPatch() setting device %08x on output %d",
devices.types(), outputDesc->mIoHandle);
- setOutputDevice(outputDesc->mIoHandle, devices.types(), true, 0, handle);
+ setOutputDevice(outputDesc, devices.types(), true, 0, handle);
index = mAudioPatches.indexOfKey(*handle);
if (index >= 0) {
if (patchDesc != 0 && patchDesc != mAudioPatches.valueAt(index)) {
@@ -2674,7 +2270,7 @@ status_t AudioPolicyManager::createAudioPatch(const struct audio_patch *patch,
if (patch->num_sinks > 1) {
return INVALID_OPERATION;
}
- sp<AudioInputDescriptor> inputDesc = getInputFromId(patch->sinks[0].id);
+ sp<AudioInputDescriptor> inputDesc = mInputs.getInputFromId(patch->sinks[0].id);
if (inputDesc == NULL) {
return BAD_VALUE;
}
@@ -2689,12 +2285,14 @@ status_t AudioPolicyManager::createAudioPatch(const struct audio_patch *patch,
return BAD_VALUE;
}
- if (!inputDesc->mProfile->isCompatibleProfile(devDesc->mDeviceType,
+ if (!inputDesc->mProfile->isCompatibleProfile(devDesc->type(),
devDesc->mAddress,
patch->sinks[0].sample_rate,
NULL, /*updatedSampleRate*/
patch->sinks[0].format,
+ NULL, /*updatedFormat*/
patch->sinks[0].channel_mask,
+ NULL, /*updatedChannelMask*/
// FIXME for the parameter type,
// and the NONE
(audio_output_flags_t)
@@ -2703,8 +2301,8 @@ status_t AudioPolicyManager::createAudioPatch(const struct audio_patch *patch,
}
// TODO: reconfigure output format and channels here
ALOGV("createAudioPatch() setting device %08x on output %d",
- devDesc->mDeviceType, inputDesc->mIoHandle);
- setInputDevice(inputDesc->mIoHandle, devDesc->mDeviceType, true, handle);
+ devDesc->type(), inputDesc->mIoHandle);
+ setInputDevice(inputDesc->mIoHandle, devDesc->type(), true, handle);
index = mAudioPatches.indexOfKey(*handle);
if (index >= 0) {
if (patchDesc != 0 && patchDesc != mAudioPatches.valueAt(index)) {
@@ -2748,14 +2346,17 @@ status_t AudioPolicyManager::createAudioPatch(const struct audio_patch *patch,
}
sinkDeviceDesc->toAudioPortConfig(&newPatch.sinks[i], &patch->sinks[i]);
- if (srcDeviceDesc->mModule != sinkDeviceDesc->mModule) {
- // only one sink supported when connected devices across HW modules
+ // create a software bridge in PatchPanel if:
+ // - source and sink devices are on differnt HW modules OR
+ // - audio HAL version is < 3.0
+ if ((srcDeviceDesc->getModuleHandle() != sinkDeviceDesc->getModuleHandle()) ||
+ (srcDeviceDesc->mModule->mHalVersion < AUDIO_DEVICE_API_VERSION_3_0)) {
+ // support only one sink device for now to simplify output selection logic
if (patch->num_sinks > 1) {
return INVALID_OPERATION;
}
SortedVector<audio_io_handle_t> outputs =
- getOutputsForDevice(sinkDeviceDesc->mDeviceType,
- mOutputs);
+ getOutputsForDevice(sinkDeviceDesc->type(), mOutputs);
// if the sink device is reachable via an opened output stream, request to go via
// this output stream by adding a second source to the patch description
audio_io_handle_t output = selectOutput(outputs,
@@ -2767,6 +2368,7 @@ status_t AudioPolicyManager::createAudioPatch(const struct audio_patch *patch,
return INVALID_OPERATION;
}
outputDesc->toAudioPortConfig(&newPatch.sources[1], &patch->sources[0]);
+ newPatch.sources[1].ext.mix.usecase.stream = AUDIO_STREAM_PATCH;
newPatch.num_sources = 2;
}
}
@@ -2785,8 +2387,7 @@ status_t AudioPolicyManager::createAudioPatch(const struct audio_patch *patch,
status, afPatchHandle);
if (status == NO_ERROR) {
if (index < 0) {
- patchDesc = new AudioPatch((audio_patch_handle_t)nextUniqueId(),
- &newPatch, uid);
+ patchDesc = new AudioPatch(&newPatch, uid);
addAudioPatch(patchDesc->mHandle, patchDesc);
} else {
patchDesc->mPatch = newPatch;
@@ -2829,20 +2430,20 @@ status_t AudioPolicyManager::releaseAudioPatch(audio_patch_handle_t handle,
struct audio_patch *patch = &patchDesc->mPatch;
patchDesc->mUid = mUidCached;
if (patch->sources[0].type == AUDIO_PORT_TYPE_MIX) {
- sp<AudioOutputDescriptor> outputDesc = getOutputFromId(patch->sources[0].id);
+ sp<SwAudioOutputDescriptor> outputDesc = mOutputs.getOutputFromId(patch->sources[0].id);
if (outputDesc == NULL) {
ALOGV("releaseAudioPatch() output not found for id %d", patch->sources[0].id);
return BAD_VALUE;
}
- setOutputDevice(outputDesc->mIoHandle,
- getNewOutputDevice(outputDesc->mIoHandle, true /*fromCache*/),
+ setOutputDevice(outputDesc,
+ getNewOutputDevice(outputDesc, true /*fromCache*/),
true,
0,
NULL);
} else if (patch->sources[0].type == AUDIO_PORT_TYPE_DEVICE) {
if (patch->sinks[0].type == AUDIO_PORT_TYPE_MIX) {
- sp<AudioInputDescriptor> inputDesc = getInputFromId(patch->sinks[0].id);
+ sp<AudioInputDescriptor> inputDesc = mInputs.getInputFromId(patch->sinks[0].id);
if (inputDesc == NULL) {
ALOGV("releaseAudioPatch() input not found for id %d", patch->sinks[0].id);
return BAD_VALUE;
@@ -2872,30 +2473,11 @@ status_t AudioPolicyManager::listAudioPatches(unsigned int *num_patches,
struct audio_patch *patches,
unsigned int *generation)
{
- if (num_patches == NULL || (*num_patches != 0 && patches == NULL) ||
- generation == NULL) {
+ if (generation == NULL) {
return BAD_VALUE;
}
- ALOGV("listAudioPatches() num_patches %d patches %p available patches %zu",
- *num_patches, patches, mAudioPatches.size());
- if (patches == NULL) {
- *num_patches = 0;
- }
-
- size_t patchesWritten = 0;
- size_t patchesMax = *num_patches;
- for (size_t i = 0;
- i < mAudioPatches.size() && patchesWritten < patchesMax; i++) {
- patches[patchesWritten] = mAudioPatches[i]->mPatch;
- patches[patchesWritten++].id = mAudioPatches[i]->mHandle;
- ALOGV("listAudioPatches() patch %zu num_sources %d num_sinks %d",
- i, mAudioPatches[i]->mPatch.num_sources, mAudioPatches[i]->mPatch.num_sinks);
- }
- *num_patches = mAudioPatches.size();
-
*generation = curAudioPortGeneration();
- ALOGV("listAudioPatches() got %zu patches needed %d", patchesWritten, *num_patches);
- return NO_ERROR;
+ return mAudioPatches.listAudioPatches(num_patches, patches);
}
status_t AudioPolicyManager::setAudioPortConfig(const struct audio_port_config *config)
@@ -2914,7 +2496,7 @@ status_t AudioPolicyManager::setAudioPortConfig(const struct audio_port_config *
sp<AudioPortConfig> audioPortConfig;
if (config->type == AUDIO_PORT_TYPE_MIX) {
if (config->role == AUDIO_PORT_ROLE_SOURCE) {
- sp<AudioOutputDescriptor> outputDesc = getOutputFromId(config->id);
+ sp<SwAudioOutputDescriptor> outputDesc = mOutputs.getOutputFromId(config->id);
if (outputDesc == NULL) {
return BAD_VALUE;
}
@@ -2923,7 +2505,7 @@ status_t AudioPolicyManager::setAudioPortConfig(const struct audio_port_config *
outputDesc->mIoHandle);
audioPortConfig = outputDesc;
} else if (config->role == AUDIO_PORT_ROLE_SINK) {
- sp<AudioInputDescriptor> inputDesc = getInputFromId(config->id);
+ sp<AudioInputDescriptor> inputDesc = mInputs.getInputFromId(config->id);
if (inputDesc == NULL) {
return BAD_VALUE;
}
@@ -2962,6 +2544,12 @@ status_t AudioPolicyManager::setAudioPortConfig(const struct audio_port_config *
return status;
}
+void AudioPolicyManager::releaseResourcesForUid(uid_t uid)
+{
+ clearAudioPatches(uid);
+ clearSessionRoutes(uid);
+}
+
void AudioPolicyManager::clearAudioPatches(uid_t uid)
{
for (ssize_t i = (ssize_t)mAudioPatches.size() - 1; i >= 0; i--) {
@@ -2972,71 +2560,108 @@ void AudioPolicyManager::clearAudioPatches(uid_t uid)
}
}
-status_t AudioPolicyManager::acquireSoundTriggerSession(audio_session_t *session,
- audio_io_handle_t *ioHandle,
- audio_devices_t *device)
-{
- *session = (audio_session_t)mpClientInterface->newAudioUniqueId();
- *ioHandle = (audio_io_handle_t)mpClientInterface->newAudioUniqueId();
- *device = getDeviceAndMixForInputSource(AUDIO_SOURCE_HOTWORD);
-
- mSoundTriggerSessions.add(*session, *ioHandle);
- return NO_ERROR;
+void AudioPolicyManager::checkStrategyRoute(routing_strategy strategy,
+ audio_io_handle_t ouptutToSkip)
+{
+ audio_devices_t device = getDeviceForStrategy(strategy, false /*fromCache*/);
+ SortedVector<audio_io_handle_t> outputs = getOutputsForDevice(device, mOutputs);
+ for (size_t j = 0; j < mOutputs.size(); j++) {
+ if (mOutputs.keyAt(j) == ouptutToSkip) {
+ continue;
+ }
+ sp<SwAudioOutputDescriptor> outputDesc = mOutputs.valueAt(j);
+ if (!isStrategyActive(outputDesc, (routing_strategy)strategy)) {
+ continue;
+ }
+ // If the default device for this strategy is on another output mix,
+ // invalidate all tracks in this strategy to force re connection.
+ // Otherwise select new device on the output mix.
+ if (outputs.indexOf(mOutputs.keyAt(j)) < 0) {
+ for (int stream = 0; stream < AUDIO_STREAM_CNT; stream++) {
+ if (stream == AUDIO_STREAM_PATCH) {
+ continue;
+ }
+ if (getStrategy((audio_stream_type_t)stream) == strategy) {
+ mpClientInterface->invalidateStream((audio_stream_type_t)stream);
+ }
+ }
+ } else {
+ audio_devices_t newDevice = getNewOutputDevice(outputDesc, false /*fromCache*/);
+ setOutputDevice(outputDesc, newDevice, false);
+ }
+ }
}
-status_t AudioPolicyManager::releaseSoundTriggerSession(audio_session_t session)
+void AudioPolicyManager::clearSessionRoutes(uid_t uid)
{
- ssize_t index = mSoundTriggerSessions.indexOfKey(session);
- if (index < 0) {
- ALOGW("acquireSoundTriggerSession() session %d not registered", session);
- return BAD_VALUE;
+ // remove output routes associated with this uid
+ SortedVector<routing_strategy> affectedStrategies;
+ for (ssize_t i = (ssize_t)mOutputRoutes.size() - 1; i >= 0; i--) {
+ sp<SessionRoute> route = mOutputRoutes.valueAt(i);
+ if (route->mUid == uid) {
+ mOutputRoutes.removeItemsAt(i);
+ if (route->mDeviceDescriptor != 0) {
+ affectedStrategies.add(getStrategy(route->mStreamType));
+ }
+ }
+ }
+ // reroute outputs if necessary
+ for (size_t i = 0; i < affectedStrategies.size(); i++) {
+ checkStrategyRoute(affectedStrategies[i], AUDIO_IO_HANDLE_NONE);
}
- mSoundTriggerSessions.removeItem(session);
- return NO_ERROR;
+ // remove input routes associated with this uid
+ SortedVector<audio_source_t> affectedSources;
+ for (ssize_t i = (ssize_t)mInputRoutes.size() - 1; i >= 0; i--) {
+ sp<SessionRoute> route = mInputRoutes.valueAt(i);
+ if (route->mUid == uid) {
+ mInputRoutes.removeItemsAt(i);
+ if (route->mDeviceDescriptor != 0) {
+ affectedSources.add(route->mSource);
+ }
+ }
+ }
+ // reroute inputs if necessary
+ SortedVector<audio_io_handle_t> inputsToClose;
+ for (size_t i = 0; i < mInputs.size(); i++) {
+ sp<AudioInputDescriptor> inputDesc = mInputs.valueAt(i);
+ if (affectedSources.indexOf(inputDesc->mInputSource) >= 0) {
+ inputsToClose.add(inputDesc->mIoHandle);
+ }
+ }
+ for (size_t i = 0; i < inputsToClose.size(); i++) {
+ closeInput(inputsToClose[i]);
+ }
}
-status_t AudioPolicyManager::addAudioPatch(audio_patch_handle_t handle,
- const sp<AudioPatch>& patch)
+
+status_t AudioPolicyManager::acquireSoundTriggerSession(audio_session_t *session,
+ audio_io_handle_t *ioHandle,
+ audio_devices_t *device)
{
- ssize_t index = mAudioPatches.indexOfKey(handle);
+ *session = (audio_session_t)mpClientInterface->newAudioUniqueId();
+ *ioHandle = (audio_io_handle_t)mpClientInterface->newAudioUniqueId();
+ *device = getDeviceAndMixForInputSource(AUDIO_SOURCE_HOTWORD);
- if (index >= 0) {
- ALOGW("addAudioPatch() patch %d already in", handle);
- return ALREADY_EXISTS;
- }
- mAudioPatches.add(handle, patch);
- ALOGV("addAudioPatch() handle %d af handle %d num_sources %d num_sinks %d source handle %d"
- "sink handle %d",
- handle, patch->mAfPatchHandle, patch->mPatch.num_sources, patch->mPatch.num_sinks,
- patch->mPatch.sources[0].id, patch->mPatch.sinks[0].id);
- return NO_ERROR;
+ return mSoundTriggerSessions.acquireSession(*session, *ioHandle);
}
-status_t AudioPolicyManager::removeAudioPatch(audio_patch_handle_t handle)
+status_t AudioPolicyManager::startAudioSource(const struct audio_port_config *source __unused,
+ const audio_attributes_t *attributes __unused,
+ audio_io_handle_t *handle __unused)
{
- ssize_t index = mAudioPatches.indexOfKey(handle);
+ return INVALID_OPERATION;
+}
- if (index < 0) {
- ALOGW("removeAudioPatch() patch %d not in", handle);
- return ALREADY_EXISTS;
- }
- ALOGV("removeAudioPatch() handle %d af handle %d", handle,
- mAudioPatches.valueAt(index)->mAfPatchHandle);
- mAudioPatches.removeItemsAt(index);
- return NO_ERROR;
+status_t AudioPolicyManager::stopAudioSource(audio_io_handle_t handle __unused)
+{
+ return INVALID_OPERATION;
}
// ----------------------------------------------------------------------------
// AudioPolicyManager
// ----------------------------------------------------------------------------
-
-uint32_t AudioPolicyManager::nextUniqueId()
-{
- return android_atomic_inc(&mNextUniqueId);
-}
-
uint32_t AudioPolicyManager::nextAudioPortGeneration()
{
return android_atomic_inc(&mAudioPortGeneration);
@@ -3047,35 +2672,47 @@ AudioPolicyManager::AudioPolicyManager(AudioPolicyClientInterface *clientInterfa
#ifdef AUDIO_POLICY_TEST
Thread(false),
#endif //AUDIO_POLICY_TEST
- mPrimaryOutput((audio_io_handle_t)0),
- mPhoneState(AUDIO_MODE_NORMAL),
mLimitRingtoneVolume(false), mLastVoiceVolume(-1.0f),
- mTotalEffectsCpuLoad(0), mTotalEffectsMemory(0),
mA2dpSuspended(false),
- mSpeakerDrcEnabled(false), mNextUniqueId(1),
+ mSpeakerDrcEnabled(false),
mAudioPortGeneration(1),
mBeaconMuteRefCount(0),
mBeaconPlayingRefCount(0),
mBeaconMuted(false)
{
+ audio_policy::EngineInstance *engineInstance = audio_policy::EngineInstance::getInstance();
+ if (!engineInstance) {
+ ALOGE("%s: Could not get an instance of policy engine", __FUNCTION__);
+ return;
+ }
+ // Retrieve the Policy Manager Interface
+ mEngine = engineInstance->queryInterface<AudioPolicyManagerInterface>();
+ if (mEngine == NULL) {
+ ALOGE("%s: Failed to get Policy Engine Interface", __FUNCTION__);
+ return;
+ }
+ mEngine->setObserver(this);
+ status_t status = mEngine->initCheck();
+ ALOG_ASSERT(status == NO_ERROR, "Policy engine not initialized(err=%d)", status);
+
mUidCached = getuid();
mpClientInterface = clientInterface;
- for (int i = 0; i < AUDIO_POLICY_FORCE_USE_CNT; i++) {
- mForceUse[i] = AUDIO_POLICY_FORCE_NONE;
- }
-
- mDefaultOutputDevice = new DeviceDescriptor(String8(""), AUDIO_DEVICE_OUT_SPEAKER);
- if (loadAudioPolicyConfig(AUDIO_POLICY_VENDOR_CONFIG_FILE) != NO_ERROR) {
- if (loadAudioPolicyConfig(AUDIO_POLICY_CONFIG_FILE) != NO_ERROR) {
+ mDefaultOutputDevice = new DeviceDescriptor(AUDIO_DEVICE_OUT_SPEAKER);
+ if (ConfigParsingUtils::loadAudioPolicyConfig(AUDIO_POLICY_VENDOR_CONFIG_FILE,
+ mHwModules, mAvailableInputDevices, mAvailableOutputDevices,
+ mDefaultOutputDevice, mSpeakerDrcEnabled) != NO_ERROR) {
+ if (ConfigParsingUtils::loadAudioPolicyConfig(AUDIO_POLICY_CONFIG_FILE,
+ mHwModules, mAvailableInputDevices, mAvailableOutputDevices,
+ mDefaultOutputDevice, mSpeakerDrcEnabled) != NO_ERROR) {
ALOGE("could not load audio policy configuration file, setting defaults");
defaultAudioPolicyConfig();
}
}
// mAvailableOutputDevices and mAvailableInputDevices now contain all attached devices
- // must be done after reading the policy
- initializeVolumeCurves();
+ // must be done after reading the policy (since conditionned by Speaker Drc Enabling)
+ mEngine->initializeVolumeCurves(mSpeakerDrcEnabled);
// open all output streams needed to access attached devices
audio_devices_t outputDeviceTypes = mAvailableOutputDevices.types();
@@ -3103,13 +2740,13 @@ AudioPolicyManager::AudioPolicyManager(AudioPolicyClientInterface *clientInterfa
continue;
}
audio_devices_t profileType = outProfile->mSupportedDevices.types();
- if ((profileType & mDefaultOutputDevice->mDeviceType) != AUDIO_DEVICE_NONE) {
- profileType = mDefaultOutputDevice->mDeviceType;
+ if ((profileType & mDefaultOutputDevice->type()) != AUDIO_DEVICE_NONE) {
+ profileType = mDefaultOutputDevice->type();
} else {
// chose first device present in mSupportedDevices also part of
// outputDeviceTypes
for (size_t k = 0; k < outProfile->mSupportedDevices.size(); k++) {
- profileType = outProfile->mSupportedDevices[k]->mDeviceType;
+ profileType = outProfile->mSupportedDevices[k]->type();
if ((profileType & outputDeviceTypes) != 0) {
break;
}
@@ -3118,7 +2755,8 @@ AudioPolicyManager::AudioPolicyManager(AudioPolicyClientInterface *clientInterfa
if ((profileType & outputDeviceTypes) == 0) {
continue;
}
- sp<AudioOutputDescriptor> outputDesc = new AudioOutputDescriptor(outProfile);
+ sp<SwAudioOutputDescriptor> outputDesc = new SwAudioOutputDescriptor(outProfile,
+ mpClientInterface);
outputDesc->mDevice = profileType;
audio_config_t config = AUDIO_CONFIG_INITIALIZER;
@@ -3126,7 +2764,7 @@ AudioPolicyManager::AudioPolicyManager(AudioPolicyClientInterface *clientInterfa
config.channel_mask = outputDesc->mChannelMask;
config.format = outputDesc->mFormat;
audio_io_handle_t output = AUDIO_IO_HANDLE_NONE;
- status_t status = mpClientInterface->openOutput(outProfile->mModule->mHandle,
+ status_t status = mpClientInterface->openOutput(outProfile->getModuleHandle(),
&output,
&config,
&outputDesc->mDevice,
@@ -3144,21 +2782,20 @@ AudioPolicyManager::AudioPolicyManager(AudioPolicyClientInterface *clientInterfa
outputDesc->mFormat = config.format;
for (size_t k = 0; k < outProfile->mSupportedDevices.size(); k++) {
- audio_devices_t type = outProfile->mSupportedDevices[k]->mDeviceType;
+ audio_devices_t type = outProfile->mSupportedDevices[k]->type();
ssize_t index =
mAvailableOutputDevices.indexOf(outProfile->mSupportedDevices[k]);
// give a valid ID to an attached device once confirmed it is reachable
- if ((index >= 0) && (mAvailableOutputDevices[index]->mId == 0)) {
- mAvailableOutputDevices[index]->mId = nextUniqueId();
- mAvailableOutputDevices[index]->mModule = mHwModules[i];
+ if (index >= 0 && !mAvailableOutputDevices[index]->isAttached()) {
+ mAvailableOutputDevices[index]->attach(mHwModules[i]);
}
}
if (mPrimaryOutput == 0 &&
outProfile->mFlags & AUDIO_OUTPUT_FLAG_PRIMARY) {
- mPrimaryOutput = output;
+ mPrimaryOutput = outputDesc;
}
addOutput(output, outputDesc);
- setOutputDevice(output,
+ setOutputDevice(outputDesc,
outputDesc->mDevice,
true);
}
@@ -3177,7 +2814,7 @@ AudioPolicyManager::AudioPolicyManager(AudioPolicyClientInterface *clientInterfa
// inputDeviceTypes
audio_devices_t profileType = AUDIO_DEVICE_NONE;
for (size_t k = 0; k < inProfile->mSupportedDevices.size(); k++) {
- profileType = inProfile->mSupportedDevices[k]->mDeviceType;
+ profileType = inProfile->mSupportedDevices[k]->type();
if (profileType & inputDeviceTypes) {
break;
}
@@ -3203,7 +2840,7 @@ AudioPolicyManager::AudioPolicyManager(AudioPolicyClientInterface *clientInterfa
config.channel_mask = inputDesc->mChannelMask;
config.format = inputDesc->mFormat;
audio_io_handle_t input = AUDIO_IO_HANDLE_NONE;
- status_t status = mpClientInterface->openInput(inProfile->mModule->mHandle,
+ status_t status = mpClientInterface->openInput(inProfile->getModuleHandle(),
&input,
&config,
&inputDesc->mDevice,
@@ -3213,13 +2850,16 @@ AudioPolicyManager::AudioPolicyManager(AudioPolicyClientInterface *clientInterfa
if (status == NO_ERROR) {
for (size_t k = 0; k < inProfile->mSupportedDevices.size(); k++) {
- audio_devices_t type = inProfile->mSupportedDevices[k]->mDeviceType;
+ audio_devices_t type = inProfile->mSupportedDevices[k]->type();
ssize_t index =
mAvailableInputDevices.indexOf(inProfile->mSupportedDevices[k]);
// give a valid ID to an attached device once confirmed it is reachable
- if ((index >= 0) && (mAvailableInputDevices[index]->mId == 0)) {
- mAvailableInputDevices[index]->mId = nextUniqueId();
- mAvailableInputDevices[index]->mModule = mHwModules[i];
+ if (index >= 0) {
+ sp<DeviceDescriptor> devDesc = mAvailableInputDevices[index];
+ if (!devDesc->isAttached()) {
+ devDesc->attach(mHwModules[i]);
+ devDesc->importAudioPort(inProfile);
+ }
}
}
mpClientInterface->closeInput(input);
@@ -3232,24 +2872,30 @@ AudioPolicyManager::AudioPolicyManager(AudioPolicyClientInterface *clientInterfa
}
// make sure all attached devices have been allocated a unique ID
for (size_t i = 0; i < mAvailableOutputDevices.size();) {
- if (mAvailableOutputDevices[i]->mId == 0) {
- ALOGW("Input device %08x unreachable", mAvailableOutputDevices[i]->mDeviceType);
+ if (!mAvailableOutputDevices[i]->isAttached()) {
+ ALOGW("Input device %08x unreachable", mAvailableOutputDevices[i]->type());
mAvailableOutputDevices.remove(mAvailableOutputDevices[i]);
continue;
}
+ // The device is now validated and can be appended to the available devices of the engine
+ mEngine->setDeviceConnectionState(mAvailableOutputDevices[i],
+ AUDIO_POLICY_DEVICE_STATE_AVAILABLE);
i++;
}
for (size_t i = 0; i < mAvailableInputDevices.size();) {
- if (mAvailableInputDevices[i]->mId == 0) {
- ALOGW("Input device %08x unreachable", mAvailableInputDevices[i]->mDeviceType);
+ if (!mAvailableInputDevices[i]->isAttached()) {
+ ALOGW("Input device %08x unreachable", mAvailableInputDevices[i]->type());
mAvailableInputDevices.remove(mAvailableInputDevices[i]);
continue;
}
+ // The device is now validated and can be appended to the available devices of the engine
+ mEngine->setDeviceConnectionState(mAvailableInputDevices[i],
+ AUDIO_POLICY_DEVICE_STATE_AVAILABLE);
i++;
}
// make sure default device is reachable
if (mAvailableOutputDevices.indexOf(mDefaultOutputDevice) < 0) {
- ALOGE("Default device %08x is unreachable", mDefaultOutputDevice->mDeviceType);
+ ALOGE("Default device %08x is unreachable", mDefaultOutputDevice->type());
}
ALOGE_IF((mPrimaryOutput == 0), "Failed to open primary output");
@@ -3260,7 +2906,7 @@ AudioPolicyManager::AudioPolicyManager(AudioPolicyClientInterface *clientInterfa
if (mPrimaryOutput != 0) {
AudioParameter outputCmd = AudioParameter();
outputCmd.addInt(String8("set_id"), 0);
- mpClientInterface->setParameters(mPrimaryOutput, outputCmd.toString());
+ mpClientInterface->setParameters(mPrimaryOutput->mIoHandle, outputCmd.toString());
mTestDevice = AUDIO_DEVICE_OUT_SPEAKER;
mTestSamplingRate = 44100;
@@ -3301,7 +2947,7 @@ AudioPolicyManager::~AudioPolicyManager()
status_t AudioPolicyManager::initCheck()
{
- return (mPrimaryOutput == 0) ? NO_INIT : NO_ERROR;
+ return hasPrimaryOutput() ? NO_ERROR : NO_INIT;
}
#ifdef AUDIO_POLICY_TEST
@@ -3400,21 +3046,21 @@ bool AudioPolicyManager::threadLoop()
if (param.get(String8("test_cmd_policy_reopen"), value) == NO_ERROR) {
param.remove(String8("test_cmd_policy_reopen"));
- sp<AudioOutputDescriptor> outputDesc = mOutputs.valueFor(mPrimaryOutput);
- mpClientInterface->closeOutput(mPrimaryOutput);
-
- audio_module_handle_t moduleHandle = outputDesc->mModule->mHandle;
+ mpClientInterface->closeOutput(mpClientInterface->closeOutput(mPrimaryOutput););
- mOutputs.removeItem(mPrimaryOutput);
+ audio_module_handle_t moduleHandle = mPrimaryOutput->getModuleHandle();
- sp<AudioOutputDescriptor> outputDesc = new AudioOutputDescriptor(NULL);
+ removeOutput(mPrimaryOutput->mIoHandle);
+ sp<SwAudioOutputDescriptor> outputDesc = new AudioOutputDescriptor(NULL,
+ mpClientInterface);
outputDesc->mDevice = AUDIO_DEVICE_OUT_SPEAKER;
audio_config_t config = AUDIO_CONFIG_INITIALIZER;
config.sample_rate = outputDesc->mSamplingRate;
config.channel_mask = outputDesc->mChannelMask;
config.format = outputDesc->mFormat;
+ audio_io_handle_t handle;
status_t status = mpClientInterface->openOutput(moduleHandle,
- &mPrimaryOutput,
+ &handle,
&config,
&outputDesc->mDevice,
String8(""),
@@ -3428,10 +3074,11 @@ bool AudioPolicyManager::threadLoop()
outputDesc->mSamplingRate = config.sample_rate;
outputDesc->mChannelMask = config.channel_mask;
outputDesc->mFormat = config.format;
+ mPrimaryOutput = outputDesc;
AudioParameter outputCmd = AudioParameter();
outputCmd.addInt(String8("set_id"), 0);
- mpClientInterface->setParameters(mPrimaryOutput, outputCmd.toString());
- addOutput(mPrimaryOutput, outputDesc);
+ mpClientInterface->setParameters(handle, outputCmd.toString());
+ addOutput(handle, outputDesc);
}
}
@@ -3463,23 +3110,26 @@ int AudioPolicyManager::testOutputIndex(audio_io_handle_t output)
// ---
-void AudioPolicyManager::addOutput(audio_io_handle_t output, sp<AudioOutputDescriptor> outputDesc)
+void AudioPolicyManager::addOutput(audio_io_handle_t output, sp<SwAudioOutputDescriptor> outputDesc)
{
- outputDesc->mIoHandle = output;
- outputDesc->mId = nextUniqueId();
+ outputDesc->setIoHandle(output);
mOutputs.add(output, outputDesc);
nextAudioPortGeneration();
}
+void AudioPolicyManager::removeOutput(audio_io_handle_t output)
+{
+ mOutputs.removeItem(output);
+}
+
void AudioPolicyManager::addInput(audio_io_handle_t input, sp<AudioInputDescriptor> inputDesc)
{
- inputDesc->mIoHandle = input;
- inputDesc->mId = nextUniqueId();
+ inputDesc->setIoHandle(input);
mInputs.add(input, inputDesc);
nextAudioPortGeneration();
}
-void AudioPolicyManager::findIoHandlesByAddress(sp<AudioOutputDescriptor> desc /*in*/,
+void AudioPolicyManager::findIoHandlesByAddress(sp<SwAudioOutputDescriptor> desc /*in*/,
const audio_devices_t device /*in*/,
const String8 address /*in*/,
SortedVector<audio_io_handle_t>& outputs /*out*/) {
@@ -3493,21 +3143,24 @@ void AudioPolicyManager::findIoHandlesByAddress(sp<AudioOutputDescriptor> desc /
}
status_t AudioPolicyManager::checkOutputsForDevice(const sp<DeviceDescriptor> devDesc,
- audio_policy_dev_state_t state,
- SortedVector<audio_io_handle_t>& outputs,
- const String8 address)
+ audio_policy_dev_state_t state,
+ SortedVector<audio_io_handle_t>& outputs,
+ const String8 address)
{
- audio_devices_t device = devDesc->mDeviceType;
- sp<AudioOutputDescriptor> desc;
- // erase all current sample rates, formats and channel masks
- devDesc->clearCapabilities();
+ audio_devices_t device = devDesc->type();
+ sp<SwAudioOutputDescriptor> desc;
+
+ if (audio_device_is_digital(device)) {
+ // erase all current sample rates, formats and channel masks
+ devDesc->clearCapabilities();
+ }
if (state == AUDIO_POLICY_DEVICE_STATE_AVAILABLE) {
// first list already open outputs that can be routed to this device
for (size_t i = 0; i < mOutputs.size(); i++) {
desc = mOutputs.valueAt(i);
- if (!desc->isDuplicated() && (desc->mProfile->mSupportedDevices.types() & device)) {
- if (!deviceDistinguishesOnAddress(device)) {
+ if (!desc->isDuplicated() && (desc->supportedDevices() & device)) {
+ if (!device_distinguishes_on_address(device)) {
ALOGV("checkOutputsForDevice(): adding opened output %d", mOutputs.keyAt(i));
outputs.add(mOutputs.keyAt(i));
} else {
@@ -3527,7 +3180,7 @@ status_t AudioPolicyManager::checkOutputsForDevice(const sp<DeviceDescriptor> de
{
sp<IOProfile> profile = mHwModules[i]->mOutputProfiles[j];
if (profile->mSupportedDevices.types() & device) {
- if (!deviceDistinguishesOnAddress(device) ||
+ if (!device_distinguishes_on_address(device) ||
address == profile->mSupportedDevices[0]->mAddress) {
profiles.add(profile);
ALOGV("checkOutputsForDevice(): adding profile %zu from module %zu", j, i);
@@ -3555,7 +3208,9 @@ status_t AudioPolicyManager::checkOutputsForDevice(const sp<DeviceDescriptor> de
if (!desc->isDuplicated() && desc->mProfile == profile) {
// matching profile: save the sample rates, format and channel masks supported
// by the profile in our device descriptor
- devDesc->importAudioPort(profile);
+ if (audio_device_is_digital(device)) {
+ devDesc->importAudioPort(profile);
+ }
break;
}
}
@@ -3565,7 +3220,7 @@ status_t AudioPolicyManager::checkOutputsForDevice(const sp<DeviceDescriptor> de
ALOGV("opening output for device %08x with params %s profile %p",
device, address.string(), profile.get());
- desc = new AudioOutputDescriptor(profile);
+ desc = new SwAudioOutputDescriptor(profile, mpClientInterface);
desc->mDevice = device;
audio_config_t config = AUDIO_CONFIG_INITIALIZER;
config.sample_rate = desc->mSamplingRate;
@@ -3575,7 +3230,7 @@ status_t AudioPolicyManager::checkOutputsForDevice(const sp<DeviceDescriptor> de
config.offload_info.channel_mask = desc->mChannelMask;
config.offload_info.format = desc->mFormat;
audio_io_handle_t output = AUDIO_IO_HANDLE_NONE;
- status_t status = mpClientInterface->openOutput(profile->mModule->mHandle,
+ status_t status = mpClientInterface->openOutput(profile->getModuleHandle(),
&output,
&config,
&desc->mDevice,
@@ -3645,7 +3300,7 @@ status_t AudioPolicyManager::checkOutputsForDevice(const sp<DeviceDescriptor> de
config.offload_info.sample_rate = config.sample_rate;
config.offload_info.channel_mask = config.channel_mask;
config.offload_info.format = config.format;
- status = mpClientInterface->openOutput(profile->mModule->mHandle,
+ status = mpClientInterface->openOutput(profile->getModuleHandle(),
&output,
&config,
&desc->mDevice,
@@ -3663,45 +3318,47 @@ status_t AudioPolicyManager::checkOutputsForDevice(const sp<DeviceDescriptor> de
if (output != AUDIO_IO_HANDLE_NONE) {
addOutput(output, desc);
- if (deviceDistinguishesOnAddress(device) && address != "0") {
- ssize_t index = mPolicyMixes.indexOfKey(address);
- if (index >= 0) {
- mPolicyMixes[index]->mOutput = desc;
- desc->mPolicyMix = &mPolicyMixes[index]->mMix;
- } else {
+ if (device_distinguishes_on_address(device) && address != "0") {
+ sp<AudioPolicyMix> policyMix;
+ if (mPolicyMixes.getAudioPolicyMix(address, policyMix) != NO_ERROR) {
ALOGE("checkOutputsForDevice() cannot find policy for address %s",
address.string());
}
- } else if ((desc->mFlags & AUDIO_OUTPUT_FLAG_DIRECT) == 0) {
+ policyMix->setOutput(desc);
+ desc->mPolicyMix = policyMix->getMix();
+
+ } else if (((desc->mFlags & AUDIO_OUTPUT_FLAG_DIRECT) == 0) &&
+ hasPrimaryOutput()) {
// no duplicated output for direct outputs and
// outputs used by dynamic policy mixes
audio_io_handle_t duplicatedOutput = AUDIO_IO_HANDLE_NONE;
// set initial stream volume for device
- applyStreamVolumes(output, device, 0, true);
+ applyStreamVolumes(desc, device, 0, true);
//TODO: configure audio effect output stage here
// open a duplicating output thread for the new output and the primary output
- duplicatedOutput = mpClientInterface->openDuplicateOutput(output,
- mPrimaryOutput);
+ duplicatedOutput =
+ mpClientInterface->openDuplicateOutput(output,
+ mPrimaryOutput->mIoHandle);
if (duplicatedOutput != AUDIO_IO_HANDLE_NONE) {
// add duplicated output descriptor
- sp<AudioOutputDescriptor> dupOutputDesc =
- new AudioOutputDescriptor(NULL);
- dupOutputDesc->mOutput1 = mOutputs.valueFor(mPrimaryOutput);
- dupOutputDesc->mOutput2 = mOutputs.valueFor(output);
+ sp<SwAudioOutputDescriptor> dupOutputDesc =
+ new SwAudioOutputDescriptor(NULL, mpClientInterface);
+ dupOutputDesc->mOutput1 = mPrimaryOutput;
+ dupOutputDesc->mOutput2 = desc;
dupOutputDesc->mSamplingRate = desc->mSamplingRate;
dupOutputDesc->mFormat = desc->mFormat;
dupOutputDesc->mChannelMask = desc->mChannelMask;
dupOutputDesc->mLatency = desc->mLatency;
addOutput(duplicatedOutput, dupOutputDesc);
- applyStreamVolumes(duplicatedOutput, device, 0, true);
+ applyStreamVolumes(dupOutputDesc, device, 0, true);
} else {
ALOGW("checkOutputsForDevice() could not open dup output for %d and %d",
- mPrimaryOutput, output);
+ mPrimaryOutput->mIoHandle, output);
mpClientInterface->closeOutput(output);
- mOutputs.removeItem(output);
+ removeOutput(output);
nextAudioPortGeneration();
output = AUDIO_IO_HANDLE_NONE;
}
@@ -3716,12 +3373,15 @@ status_t AudioPolicyManager::checkOutputsForDevice(const sp<DeviceDescriptor> de
profile_index--;
} else {
outputs.add(output);
- devDesc->importAudioPort(profile);
+ // Load digital format info only for digital devices
+ if (audio_device_is_digital(device)) {
+ devDesc->importAudioPort(profile);
+ }
- if (deviceDistinguishesOnAddress(device)) {
+ if (device_distinguishes_on_address(device)) {
ALOGV("checkOutputsForDevice(): setOutputDevice(dev=0x%x, addr=%s)",
device, address.string());
- setOutputDevice(output, device, true/*force*/, 0/*delay*/,
+ setOutputDevice(desc, device, true/*force*/, 0/*delay*/,
NULL/*patch handle*/, address.string());
}
ALOGV("checkOutputsForDevice(): adding output %d", output);
@@ -3738,11 +3398,10 @@ status_t AudioPolicyManager::checkOutputsForDevice(const sp<DeviceDescriptor> de
desc = mOutputs.valueAt(i);
if (!desc->isDuplicated()) {
// exact match on device
- if (deviceDistinguishesOnAddress(device) &&
- (desc->mProfile->mSupportedDevices.types() == device)) {
+ if (device_distinguishes_on_address(device) &&
+ (desc->supportedDevices() == device)) {
findIoHandlesByAddress(desc, device, address, outputs);
- } else if (!(desc->mProfile->mSupportedDevices.types()
- & mAvailableOutputDevices.types())) {
+ } else if (!(desc->supportedDevices() & mAvailableOutputDevices.types())) {
ALOGV("checkOutputsForDevice(): disconnecting adding output %d",
mOutputs.keyAt(i));
outputs.add(mOutputs.keyAt(i));
@@ -3780,12 +3439,19 @@ status_t AudioPolicyManager::checkOutputsForDevice(const sp<DeviceDescriptor> de
return NO_ERROR;
}
-status_t AudioPolicyManager::checkInputsForDevice(audio_devices_t device,
- audio_policy_dev_state_t state,
- SortedVector<audio_io_handle_t>& inputs,
- const String8 address)
+status_t AudioPolicyManager::checkInputsForDevice(const sp<DeviceDescriptor> devDesc,
+ audio_policy_dev_state_t state,
+ SortedVector<audio_io_handle_t>& inputs,
+ const String8 address)
{
+ audio_devices_t device = devDesc->type();
sp<AudioInputDescriptor> desc;
+
+ if (audio_device_is_digital(device)) {
+ // erase all current sample rates, formats and channel masks
+ devDesc->clearCapabilities();
+ }
+
if (state == AUDIO_POLICY_DEVICE_STATE_AVAILABLE) {
// first list already open inputs that can be routed to this device
for (size_t input_index = 0; input_index < mInputs.size(); input_index++) {
@@ -3810,7 +3476,7 @@ status_t AudioPolicyManager::checkInputsForDevice(audio_devices_t device,
sp<IOProfile> profile = mHwModules[module_idx]->mInputProfiles[profile_index];
if (profile->mSupportedDevices.types() & (device & ~AUDIO_DEVICE_BIT_IN)) {
- if (!deviceDistinguishesOnAddress(device) ||
+ if (!device_distinguishes_on_address(device) ||
address == profile->mSupportedDevices[0]->mAddress) {
profiles.add(profile);
ALOGV("checkInputsForDevice(): adding profile %zu from module %zu",
@@ -3835,6 +3501,9 @@ status_t AudioPolicyManager::checkInputsForDevice(audio_devices_t device,
for (input_index = 0; input_index < mInputs.size(); input_index++) {
desc = mInputs.valueAt(input_index);
if (desc->mProfile == profile) {
+ if (audio_device_is_digital(device)) {
+ devDesc->importAudioPort(profile);
+ }
break;
}
}
@@ -3850,7 +3519,7 @@ status_t AudioPolicyManager::checkInputsForDevice(audio_devices_t device,
config.channel_mask = desc->mChannelMask;
config.format = desc->mFormat;
audio_io_handle_t input = AUDIO_IO_HANDLE_NONE;
- status_t status = mpClientInterface->openInput(profile->mModule->mHandle,
+ status_t status = mpClientInterface->openInput(profile->getModuleHandle(),
&input,
&config,
&desc->mDevice,
@@ -3920,6 +3589,9 @@ status_t AudioPolicyManager::checkInputsForDevice(audio_devices_t device,
profile_index--;
} else {
inputs.add(input);
+ if (audio_device_is_digital(device)) {
+ devDesc->importAudioPort(profile);
+ }
ALOGV("checkInputsForDevice(): adding input %d", input);
}
} // end scan profiles
@@ -3949,7 +3621,7 @@ status_t AudioPolicyManager::checkInputsForDevice(audio_devices_t device,
profile_index < mHwModules[module_index]->mInputProfiles.size();
profile_index++) {
sp<IOProfile> profile = mHwModules[module_index]->mInputProfiles[profile_index];
- if (profile->mSupportedDevices.types() & device & ~AUDIO_DEVICE_BIT_IN) {
+ if (profile->mSupportedDevices.types() & (device & ~AUDIO_DEVICE_BIT_IN)) {
ALOGV("checkInputsForDevice(): clearing direct input profile %zu on module %zu",
profile_index, module_index);
if (profile->mSamplingRates[0] == 0) {
@@ -3977,21 +3649,16 @@ void AudioPolicyManager::closeOutput(audio_io_handle_t output)
{
ALOGV("closeOutput(%d)", output);
- sp<AudioOutputDescriptor> outputDesc = mOutputs.valueFor(output);
+ sp<SwAudioOutputDescriptor> outputDesc = mOutputs.valueFor(output);
if (outputDesc == NULL) {
ALOGW("closeOutput() unknown output %d", output);
return;
}
-
- for (size_t i = 0; i < mPolicyMixes.size(); i++) {
- if (mPolicyMixes[i]->mOutput == outputDesc) {
- mPolicyMixes[i]->mOutput.clear();
- }
- }
+ mPolicyMixes.closeOutput(outputDesc);
// look for duplicated outputs connected to the output being removed.
for (size_t i = 0; i < mOutputs.size(); i++) {
- sp<AudioOutputDescriptor> dupOutputDesc = mOutputs.valueAt(i);
+ sp<SwAudioOutputDescriptor> dupOutputDesc = mOutputs.valueAt(i);
if (dupOutputDesc->isDuplicated() &&
(dupOutputDesc->mOutput1 == outputDesc ||
dupOutputDesc->mOutput2 == outputDesc)) {
@@ -4013,7 +3680,7 @@ void AudioPolicyManager::closeOutput(audio_io_handle_t output)
ALOGV("closeOutput() closing also duplicated output %d", duplicatedOutput);
mpClientInterface->closeOutput(duplicatedOutput);
- mOutputs.removeItem(duplicatedOutput);
+ removeOutput(duplicatedOutput);
}
}
@@ -4032,7 +3699,7 @@ void AudioPolicyManager::closeOutput(audio_io_handle_t output)
mpClientInterface->setParameters(output, param.toString());
mpClientInterface->closeOutput(output);
- mOutputs.removeItem(output);
+ removeOutput(output);
mPreviousOutputs = mOutputs;
}
@@ -4060,15 +3727,17 @@ void AudioPolicyManager::closeInput(audio_io_handle_t input)
mInputs.removeItem(input);
}
-SortedVector<audio_io_handle_t> AudioPolicyManager::getOutputsForDevice(audio_devices_t device,
- DefaultKeyedVector<audio_io_handle_t, sp<AudioOutputDescriptor> > openOutputs)
+SortedVector<audio_io_handle_t> AudioPolicyManager::getOutputsForDevice(
+ audio_devices_t device,
+ SwAudioOutputCollection openOutputs)
{
SortedVector<audio_io_handle_t> outputs;
ALOGVV("getOutputsForDevice() device %04x", device);
for (size_t i = 0; i < openOutputs.size(); i++) {
ALOGVV("output %d isDuplicated=%d device=%04x",
- i, openOutputs.valueAt(i)->isDuplicated(), openOutputs.valueAt(i)->supportedDevices());
+ i, openOutputs.valueAt(i)->isDuplicated(),
+ openOutputs.valueAt(i)->supportedDevices());
if ((device & openOutputs.valueAt(i)->supportedDevices()) == device) {
ALOGVV("getOutputsForDevice() found output %d", openOutputs.keyAt(i));
outputs.add(openOutputs.keyAt(i));
@@ -4078,7 +3747,7 @@ SortedVector<audio_io_handle_t> AudioPolicyManager::getOutputsForDevice(audio_de
}
bool AudioPolicyManager::vectorsEqual(SortedVector<audio_io_handle_t>& outputs1,
- SortedVector<audio_io_handle_t>& outputs2)
+ SortedVector<audio_io_handle_t>& outputs2)
{
if (outputs1.size() != outputs2.size()) {
return false;
@@ -4102,14 +3771,14 @@ void AudioPolicyManager::checkOutputForStrategy(routing_strategy strategy)
// associated with policies in the "before" and "after" output vectors
ALOGVV("checkOutputForStrategy(): policy related outputs");
for (size_t i = 0 ; i < mPreviousOutputs.size() ; i++) {
- const sp<AudioOutputDescriptor> desc = mPreviousOutputs.valueAt(i);
+ const sp<SwAudioOutputDescriptor> desc = mPreviousOutputs.valueAt(i);
if (desc != 0 && desc->mPolicyMix != NULL) {
srcOutputs.add(desc->mIoHandle);
ALOGVV(" previous outputs: adding %d", desc->mIoHandle);
}
}
for (size_t i = 0 ; i < mOutputs.size() ; i++) {
- const sp<AudioOutputDescriptor> desc = mOutputs.valueAt(i);
+ const sp<SwAudioOutputDescriptor> desc = mOutputs.valueAt(i);
if (desc != 0 && desc->mPolicyMix != NULL) {
dstOutputs.add(desc->mIoHandle);
ALOGVV(" new outputs: adding %d", desc->mIoHandle);
@@ -4121,10 +3790,10 @@ void AudioPolicyManager::checkOutputForStrategy(routing_strategy strategy)
strategy, srcOutputs[0], dstOutputs[0]);
// mute strategy while moving tracks from one output to another
for (size_t i = 0; i < srcOutputs.size(); i++) {
- sp<AudioOutputDescriptor> desc = mOutputs.valueFor(srcOutputs[i]);
- if (desc->isStrategyActive(strategy)) {
- setStrategyMute(strategy, true, srcOutputs[i]);
- setStrategyMute(strategy, false, srcOutputs[i], MUTE_TIME_MS, newDevice);
+ sp<SwAudioOutputDescriptor> desc = mOutputs.valueFor(srcOutputs[i]);
+ if (isStrategyActive(desc, strategy)) {
+ setStrategyMute(strategy, true, desc);
+ setStrategyMute(strategy, false, desc, MUTE_TIME_MS, newDevice);
}
}
@@ -4161,10 +3830,10 @@ void AudioPolicyManager::checkOutputForStrategy(routing_strategy strategy)
void AudioPolicyManager::checkOutputForAllStrategies()
{
- if (mForceUse[AUDIO_POLICY_FORCE_FOR_SYSTEM] == AUDIO_POLICY_FORCE_SYSTEM_ENFORCED)
+ if (mEngine->getForceUse(AUDIO_POLICY_FORCE_FOR_SYSTEM) == AUDIO_POLICY_FORCE_SYSTEM_ENFORCED)
checkOutputForStrategy(STRATEGY_ENFORCED_AUDIBLE);
checkOutputForStrategy(STRATEGY_PHONE);
- if (mForceUse[AUDIO_POLICY_FORCE_FOR_SYSTEM] != AUDIO_POLICY_FORCE_SYSTEM_ENFORCED)
+ if (mEngine->getForceUse(AUDIO_POLICY_FORCE_FOR_SYSTEM) != AUDIO_POLICY_FORCE_SYSTEM_ENFORCED)
checkOutputForStrategy(STRATEGY_ENFORCED_AUDIBLE);
checkOutputForStrategy(STRATEGY_SONIFICATION);
checkOutputForStrategy(STRATEGY_SONIFICATION_RESPECTFUL);
@@ -4174,21 +3843,9 @@ void AudioPolicyManager::checkOutputForAllStrategies()
checkOutputForStrategy(STRATEGY_REROUTING);
}
-audio_io_handle_t AudioPolicyManager::getA2dpOutput()
-{
- for (size_t i = 0; i < mOutputs.size(); i++) {
- sp<AudioOutputDescriptor> outputDesc = mOutputs.valueAt(i);
- if (!outputDesc->isDuplicated() && outputDesc->device() & AUDIO_DEVICE_OUT_ALL_A2DP) {
- return mOutputs.keyAt(i);
- }
- }
-
- return 0;
-}
-
void AudioPolicyManager::checkA2dpSuspend()
{
- audio_io_handle_t a2dpOutput = getA2dpOutput();
+ audio_io_handle_t a2dpOutput = mOutputs.getA2dpOutput();
if (a2dpOutput == 0) {
mA2dpSuspended = false;
return;
@@ -4212,20 +3869,20 @@ void AudioPolicyManager::checkA2dpSuspend()
//
if (mA2dpSuspended) {
if ((!isScoConnected ||
- ((mForceUse[AUDIO_POLICY_FORCE_FOR_COMMUNICATION] != AUDIO_POLICY_FORCE_BT_SCO) &&
- (mForceUse[AUDIO_POLICY_FORCE_FOR_RECORD] != AUDIO_POLICY_FORCE_BT_SCO))) &&
- ((mPhoneState != AUDIO_MODE_IN_CALL) &&
- (mPhoneState != AUDIO_MODE_RINGTONE))) {
+ ((mEngine->getForceUse(AUDIO_POLICY_FORCE_FOR_COMMUNICATION) != AUDIO_POLICY_FORCE_BT_SCO) &&
+ (mEngine->getForceUse(AUDIO_POLICY_FORCE_FOR_RECORD) != AUDIO_POLICY_FORCE_BT_SCO))) &&
+ ((mEngine->getPhoneState() != AUDIO_MODE_IN_CALL) &&
+ (mEngine->getPhoneState() != AUDIO_MODE_RINGTONE))) {
mpClientInterface->restoreOutput(a2dpOutput);
mA2dpSuspended = false;
}
} else {
if ((isScoConnected &&
- ((mForceUse[AUDIO_POLICY_FORCE_FOR_COMMUNICATION] == AUDIO_POLICY_FORCE_BT_SCO) ||
- (mForceUse[AUDIO_POLICY_FORCE_FOR_RECORD] == AUDIO_POLICY_FORCE_BT_SCO))) ||
- ((mPhoneState == AUDIO_MODE_IN_CALL) ||
- (mPhoneState == AUDIO_MODE_RINGTONE))) {
+ ((mEngine->getForceUse(AUDIO_POLICY_FORCE_FOR_COMMUNICATION) == AUDIO_POLICY_FORCE_BT_SCO) ||
+ (mEngine->getForceUse(AUDIO_POLICY_FORCE_FOR_RECORD) == AUDIO_POLICY_FORCE_BT_SCO))) ||
+ ((mEngine->getPhoneState() == AUDIO_MODE_IN_CALL) ||
+ (mEngine->getPhoneState() == AUDIO_MODE_RINGTONE))) {
mpClientInterface->suspendOutput(a2dpOutput);
mA2dpSuspended = true;
@@ -4233,12 +3890,11 @@ void AudioPolicyManager::checkA2dpSuspend()
}
}
-audio_devices_t AudioPolicyManager::getNewOutputDevice(audio_io_handle_t output, bool fromCache)
+audio_devices_t AudioPolicyManager::getNewOutputDevice(const sp<AudioOutputDescriptor>& outputDesc,
+ bool fromCache)
{
audio_devices_t device = AUDIO_DEVICE_NONE;
- sp<AudioOutputDescriptor> outputDesc = mOutputs.valueFor(output);
-
ssize_t index = mAudioPatches.indexOfKey(outputDesc->mPatchHandle);
if (index >= 0) {
sp<AudioPatch> patchDesc = mAudioPatches.valueAt(index);
@@ -4256,39 +3912,39 @@ audio_devices_t AudioPolicyManager::getNewOutputDevice(audio_io_handle_t output,
// use device for strategy phone
// 3: the strategy for enforced audible is active but not enforced on the output:
// use the device for strategy enforced audible
- // 4: the strategy sonification is active on the output:
+ // 4: the strategy accessibility is active on the output:
+ // use device for strategy accessibility
+ // 5: the strategy sonification is active on the output:
// use device for strategy sonification
- // 5: the strategy "respectful" sonification is active on the output:
+ // 6: the strategy "respectful" sonification is active on the output:
// use device for strategy "respectful" sonification
- // 6: the strategy accessibility is active on the output:
- // use device for strategy accessibility
// 7: the strategy media is active on the output:
// use device for strategy media
// 8: the strategy DTMF is active on the output:
// use device for strategy DTMF
// 9: the strategy for beacon, a.k.a. "transmitted through speaker" is active on the output:
// use device for strategy t-t-s
- if (outputDesc->isStrategyActive(STRATEGY_ENFORCED_AUDIBLE) &&
- mForceUse[AUDIO_POLICY_FORCE_FOR_SYSTEM] == AUDIO_POLICY_FORCE_SYSTEM_ENFORCED) {
+ if (isStrategyActive(outputDesc, STRATEGY_ENFORCED_AUDIBLE) &&
+ mEngine->getForceUse(AUDIO_POLICY_FORCE_FOR_SYSTEM) == AUDIO_POLICY_FORCE_SYSTEM_ENFORCED) {
device = getDeviceForStrategy(STRATEGY_ENFORCED_AUDIBLE, fromCache);
} else if (isInCall() ||
- outputDesc->isStrategyActive(STRATEGY_PHONE)) {
+ isStrategyActive(outputDesc, STRATEGY_PHONE)) {
device = getDeviceForStrategy(STRATEGY_PHONE, fromCache);
- } else if (outputDesc->isStrategyActive(STRATEGY_ENFORCED_AUDIBLE)) {
+ } else if (isStrategyActive(outputDesc, STRATEGY_ENFORCED_AUDIBLE)) {
device = getDeviceForStrategy(STRATEGY_ENFORCED_AUDIBLE, fromCache);
- } else if (outputDesc->isStrategyActive(STRATEGY_SONIFICATION)) {
+ } else if (isStrategyActive(outputDesc, STRATEGY_ACCESSIBILITY)) {
+ device = getDeviceForStrategy(STRATEGY_ACCESSIBILITY, fromCache);
+ } else if (isStrategyActive(outputDesc, STRATEGY_SONIFICATION)) {
device = getDeviceForStrategy(STRATEGY_SONIFICATION, fromCache);
- } else if (outputDesc->isStrategyActive(STRATEGY_SONIFICATION_RESPECTFUL)) {
+ } else if (isStrategyActive(outputDesc, STRATEGY_SONIFICATION_RESPECTFUL)) {
device = getDeviceForStrategy(STRATEGY_SONIFICATION_RESPECTFUL, fromCache);
- } else if (outputDesc->isStrategyActive(STRATEGY_ACCESSIBILITY)) {
- device = getDeviceForStrategy(STRATEGY_ACCESSIBILITY, fromCache);
- } else if (outputDesc->isStrategyActive(STRATEGY_MEDIA)) {
+ } else if (isStrategyActive(outputDesc, STRATEGY_MEDIA)) {
device = getDeviceForStrategy(STRATEGY_MEDIA, fromCache);
- } else if (outputDesc->isStrategyActive(STRATEGY_DTMF)) {
+ } else if (isStrategyActive(outputDesc, STRATEGY_DTMF)) {
device = getDeviceForStrategy(STRATEGY_DTMF, fromCache);
- } else if (outputDesc->isStrategyActive(STRATEGY_TRANSMITTED_THROUGH_SPEAKER)) {
+ } else if (isStrategyActive(outputDesc, STRATEGY_TRANSMITTED_THROUGH_SPEAKER)) {
device = getDeviceForStrategy(STRATEGY_TRANSMITTED_THROUGH_SPEAKER, fromCache);
- } else if (outputDesc->isStrategyActive(STRATEGY_REROUTING)) {
+ } else if (isStrategyActive(outputDesc, STRATEGY_REROUTING)) {
device = getDeviceForStrategy(STRATEGY_REROUTING, fromCache);
}
@@ -4312,7 +3968,6 @@ audio_devices_t AudioPolicyManager::getNewInputDevice(audio_io_handle_t input)
audio_devices_t device = getDeviceAndMixForInputSource(inputDesc->mInputSource);
- ALOGV("getNewInputDevice() selected device %x", device);
return device;
}
@@ -4328,12 +3983,12 @@ audio_devices_t AudioPolicyManager::getDevicesForStream(audio_stream_type_t stre
return AUDIO_DEVICE_NONE;
}
audio_devices_t devices;
- AudioPolicyManager::routing_strategy strategy = getStrategy(stream);
+ routing_strategy strategy = getStrategy(stream);
devices = getDeviceForStrategy(strategy, true /*fromCache*/);
SortedVector<audio_io_handle_t> outputs = getOutputsForDevice(devices, mOutputs);
for (size_t i = 0; i < outputs.size(); i++) {
sp<AudioOutputDescriptor> outputDesc = mOutputs.valueFor(outputs[i]);
- if (outputDesc->isStrategyActive(strategy)) {
+ if (isStrategyActive(outputDesc, strategy)) {
devices = outputDesc->device();
break;
}
@@ -4349,39 +4004,10 @@ audio_devices_t AudioPolicyManager::getDevicesForStream(audio_stream_type_t stre
return devices;
}
-AudioPolicyManager::routing_strategy AudioPolicyManager::getStrategy(
- audio_stream_type_t stream) {
-
+routing_strategy AudioPolicyManager::getStrategy(audio_stream_type_t stream) const
+{
ALOG_ASSERT(stream != AUDIO_STREAM_PATCH,"getStrategy() called for AUDIO_STREAM_PATCH");
-
- // stream to strategy mapping
- switch (stream) {
- case AUDIO_STREAM_VOICE_CALL:
- case AUDIO_STREAM_BLUETOOTH_SCO:
- return STRATEGY_PHONE;
- case AUDIO_STREAM_RING:
- case AUDIO_STREAM_ALARM:
- return STRATEGY_SONIFICATION;
- case AUDIO_STREAM_NOTIFICATION:
- return STRATEGY_SONIFICATION_RESPECTFUL;
- case AUDIO_STREAM_DTMF:
- return STRATEGY_DTMF;
- default:
- ALOGE("unknown stream type %d", stream);
- case AUDIO_STREAM_SYSTEM:
- // NOTE: SYSTEM stream uses MEDIA strategy because muting music and switching outputs
- // while key clicks are played produces a poor result
- case AUDIO_STREAM_MUSIC:
- return STRATEGY_MEDIA;
- case AUDIO_STREAM_ENFORCED_AUDIBLE:
- return STRATEGY_ENFORCED_AUDIBLE;
- case AUDIO_STREAM_TTS:
- return STRATEGY_TRANSMITTED_THROUGH_SPEAKER;
- case AUDIO_STREAM_ACCESSIBILITY:
- return STRATEGY_ACCESSIBILITY;
- case AUDIO_STREAM_REROUTING:
- return STRATEGY_REROUTING;
- }
+ return mEngine->getStrategyForStream(stream);
}
uint32_t AudioPolicyManager::getStrategyForAttr(const audio_attributes_t *attr) {
@@ -4392,45 +4018,8 @@ uint32_t AudioPolicyManager::getStrategyForAttr(const audio_attributes_t *attr)
if ((attr->flags & AUDIO_FLAG_AUDIBILITY_ENFORCED) == AUDIO_FLAG_AUDIBILITY_ENFORCED) {
return (uint32_t) STRATEGY_ENFORCED_AUDIBLE;
}
-
// usage to strategy mapping
- switch (attr->usage) {
- case AUDIO_USAGE_ASSISTANCE_ACCESSIBILITY:
- if (isStreamActive(AUDIO_STREAM_RING) || isStreamActive(AUDIO_STREAM_ALARM)) {
- return (uint32_t) STRATEGY_SONIFICATION;
- }
- if (isInCall()) {
- return (uint32_t) STRATEGY_PHONE;
- }
- return (uint32_t) STRATEGY_ACCESSIBILITY;
-
- case AUDIO_USAGE_MEDIA:
- case AUDIO_USAGE_GAME:
- case AUDIO_USAGE_ASSISTANCE_NAVIGATION_GUIDANCE:
- case AUDIO_USAGE_ASSISTANCE_SONIFICATION:
- return (uint32_t) STRATEGY_MEDIA;
-
- case AUDIO_USAGE_VOICE_COMMUNICATION:
- return (uint32_t) STRATEGY_PHONE;
-
- case AUDIO_USAGE_VOICE_COMMUNICATION_SIGNALLING:
- return (uint32_t) STRATEGY_DTMF;
-
- case AUDIO_USAGE_ALARM:
- case AUDIO_USAGE_NOTIFICATION_TELEPHONY_RINGTONE:
- return (uint32_t) STRATEGY_SONIFICATION;
-
- case AUDIO_USAGE_NOTIFICATION:
- case AUDIO_USAGE_NOTIFICATION_COMMUNICATION_REQUEST:
- case AUDIO_USAGE_NOTIFICATION_COMMUNICATION_INSTANT:
- case AUDIO_USAGE_NOTIFICATION_COMMUNICATION_DELAYED:
- case AUDIO_USAGE_NOTIFICATION_EVENT:
- return (uint32_t) STRATEGY_SONIFICATION_RESPECTFUL;
-
- case AUDIO_USAGE_UNKNOWN:
- default:
- return (uint32_t) STRATEGY_MEDIA;
- }
+ return static_cast<uint32_t>(mEngine->getStrategyForUsage(attr->usage));
}
void AudioPolicyManager::handleNotificationRoutingForStream(audio_stream_type_t stream) {
@@ -4444,21 +4033,6 @@ void AudioPolicyManager::handleNotificationRoutingForStream(audio_stream_type_t
}
}
-bool AudioPolicyManager::isAnyOutputActive(audio_stream_type_t streamToIgnore) {
- for (size_t s = 0 ; s < AUDIO_STREAM_CNT ; s++) {
- if (s == (size_t) streamToIgnore) {
- continue;
- }
- for (size_t i = 0; i < mOutputs.size(); i++) {
- const sp<AudioOutputDescriptor> outputDesc = mOutputs.valueAt(i);
- if (outputDesc->mRefCount[s] != 0) {
- return true;
- }
- }
- }
- return false;
-}
-
uint32_t AudioPolicyManager::handleEventForBeacon(int event) {
switch(event) {
case STARTING_OUTPUT:
@@ -4497,9 +4071,9 @@ uint32_t AudioPolicyManager::setBeaconMute(bool mute) {
ALOGV("\t muting %d", mute);
uint32_t maxLatency = 0;
for (size_t i = 0; i < mOutputs.size(); i++) {
- sp<AudioOutputDescriptor> desc = mOutputs.valueAt(i);
+ sp<SwAudioOutputDescriptor> desc = mOutputs.valueAt(i);
setStreamMute(AUDIO_STREAM_TTS, mute/*on*/,
- desc->mIoHandle,
+ desc,
0 /*delay*/, AUDIO_DEVICE_NONE);
const uint32_t latency = desc->latency() * 2;
if (latency > maxLatency) {
@@ -4513,292 +4087,36 @@ uint32_t AudioPolicyManager::setBeaconMute(bool mute) {
}
audio_devices_t AudioPolicyManager::getDeviceForStrategy(routing_strategy strategy,
- bool fromCache)
-{
- uint32_t device = AUDIO_DEVICE_NONE;
+ bool fromCache)
+{
+ // Routing
+ // see if we have an explicit route
+ // scan the whole RouteMap, for each entry, convert the stream type to a strategy
+ // (getStrategy(stream)).
+ // if the strategy from the stream type in the RouteMap is the same as the argument above,
+ // and activity count is non-zero
+ // the device = the device from the descriptor in the RouteMap, and exit.
+ for (size_t routeIndex = 0; routeIndex < mOutputRoutes.size(); routeIndex++) {
+ sp<SessionRoute> route = mOutputRoutes.valueAt(routeIndex);
+ routing_strategy strat = getStrategy(route->mStreamType);
+ // Special case for accessibility strategy which must follow any strategy it is
+ // currently remapped to
+ bool strategyMatch = (strat == strategy) ||
+ ((strategy == STRATEGY_ACCESSIBILITY) &&
+ ((mEngine->getStrategyForUsage(
+ AUDIO_USAGE_ASSISTANCE_ACCESSIBILITY) == strat) ||
+ (strat == STRATEGY_MEDIA)));
+ if (strategyMatch && route->isActive()) {
+ return route->mDeviceDescriptor->type();
+ }
+ }
if (fromCache) {
ALOGVV("getDeviceForStrategy() from cache strategy %d, device %x",
strategy, mDeviceForStrategy[strategy]);
return mDeviceForStrategy[strategy];
}
- audio_devices_t availableOutputDeviceTypes = mAvailableOutputDevices.types();
- switch (strategy) {
-
- case STRATEGY_TRANSMITTED_THROUGH_SPEAKER:
- device = availableOutputDeviceTypes & AUDIO_DEVICE_OUT_SPEAKER;
- if (!device) {
- ALOGE("getDeviceForStrategy() no device found for "\
- "STRATEGY_TRANSMITTED_THROUGH_SPEAKER");
- }
- break;
-
- case STRATEGY_SONIFICATION_RESPECTFUL:
- if (isInCall()) {
- device = getDeviceForStrategy(STRATEGY_SONIFICATION, false /*fromCache*/);
- } else if (isStreamActiveRemotely(AUDIO_STREAM_MUSIC,
- SONIFICATION_RESPECTFUL_AFTER_MUSIC_DELAY)) {
- // while media is playing on a remote device, use the the sonification behavior.
- // Note that we test this usecase before testing if media is playing because
- // the isStreamActive() method only informs about the activity of a stream, not
- // if it's for local playback. Note also that we use the same delay between both tests
- device = getDeviceForStrategy(STRATEGY_SONIFICATION, false /*fromCache*/);
- //user "safe" speaker if available instead of normal speaker to avoid triggering
- //other acoustic safety mechanisms for notification
- if (device == AUDIO_DEVICE_OUT_SPEAKER && (availableOutputDeviceTypes & AUDIO_DEVICE_OUT_SPEAKER_SAFE))
- device = AUDIO_DEVICE_OUT_SPEAKER_SAFE;
- } else if (isStreamActive(AUDIO_STREAM_MUSIC, SONIFICATION_RESPECTFUL_AFTER_MUSIC_DELAY)) {
- // while media is playing (or has recently played), use the same device
- device = getDeviceForStrategy(STRATEGY_MEDIA, false /*fromCache*/);
- } else {
- // when media is not playing anymore, fall back on the sonification behavior
- device = getDeviceForStrategy(STRATEGY_SONIFICATION, false /*fromCache*/);
- //user "safe" speaker if available instead of normal speaker to avoid triggering
- //other acoustic safety mechanisms for notification
- if (device == AUDIO_DEVICE_OUT_SPEAKER && (availableOutputDeviceTypes & AUDIO_DEVICE_OUT_SPEAKER_SAFE))
- device = AUDIO_DEVICE_OUT_SPEAKER_SAFE;
- }
-
- break;
-
- case STRATEGY_DTMF:
- if (!isInCall()) {
- // when off call, DTMF strategy follows the same rules as MEDIA strategy
- device = getDeviceForStrategy(STRATEGY_MEDIA, false /*fromCache*/);
- break;
- }
- // when in call, DTMF and PHONE strategies follow the same rules
- // FALL THROUGH
-
- case STRATEGY_PHONE:
- // Force use of only devices on primary output if:
- // - in call AND
- // - cannot route from voice call RX OR
- // - audio HAL version is < 3.0 and TX device is on the primary HW module
- if (mPhoneState == AUDIO_MODE_IN_CALL) {
- audio_devices_t txDevice =
- getDeviceAndMixForInputSource(AUDIO_SOURCE_VOICE_COMMUNICATION);
- sp<AudioOutputDescriptor> hwOutputDesc = mOutputs.valueFor(mPrimaryOutput);
- if (((mAvailableInputDevices.types() &
- AUDIO_DEVICE_IN_TELEPHONY_RX & ~AUDIO_DEVICE_BIT_IN) == 0) ||
- (((txDevice & availablePrimaryInputDevices() & ~AUDIO_DEVICE_BIT_IN) != 0) &&
- (hwOutputDesc->getAudioPort()->mModule->mHalVersion <
- AUDIO_DEVICE_API_VERSION_3_0))) {
- availableOutputDeviceTypes = availablePrimaryOutputDevices();
- }
- }
- // for phone strategy, we first consider the forced use and then the available devices by order
- // of priority
- switch (mForceUse[AUDIO_POLICY_FORCE_FOR_COMMUNICATION]) {
- case AUDIO_POLICY_FORCE_BT_SCO:
- if (!isInCall() || strategy != STRATEGY_DTMF) {
- device = availableOutputDeviceTypes & AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT;
- if (device) break;
- }
- device = availableOutputDeviceTypes & AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET;
- if (device) break;
- device = availableOutputDeviceTypes & AUDIO_DEVICE_OUT_BLUETOOTH_SCO;
- if (device) break;
- // if SCO device is requested but no SCO device is available, fall back to default case
- // FALL THROUGH
-
- default: // FORCE_NONE
- // when not in a phone call, phone strategy should route STREAM_VOICE_CALL to A2DP
- if (!isInCall() &&
- (mForceUse[AUDIO_POLICY_FORCE_FOR_MEDIA] != AUDIO_POLICY_FORCE_NO_BT_A2DP) &&
- (getA2dpOutput() != 0)) {
- device = availableOutputDeviceTypes & AUDIO_DEVICE_OUT_BLUETOOTH_A2DP;
- if (device) break;
- device = availableOutputDeviceTypes & AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES;
- if (device) break;
- }
- device = availableOutputDeviceTypes & AUDIO_DEVICE_OUT_WIRED_HEADPHONE;
- if (device) break;
- device = availableOutputDeviceTypes & AUDIO_DEVICE_OUT_WIRED_HEADSET;
- if (device) break;
- device = availableOutputDeviceTypes & AUDIO_DEVICE_OUT_USB_DEVICE;
- if (device) break;
- if (mPhoneState != AUDIO_MODE_IN_CALL) {
- device = availableOutputDeviceTypes & AUDIO_DEVICE_OUT_USB_ACCESSORY;
- if (device) break;
- device = availableOutputDeviceTypes & AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET;
- if (device) break;
- device = availableOutputDeviceTypes & AUDIO_DEVICE_OUT_AUX_DIGITAL;
- if (device) break;
- device = availableOutputDeviceTypes & AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET;
- if (device) break;
- }
- device = availableOutputDeviceTypes & AUDIO_DEVICE_OUT_EARPIECE;
- if (device) break;
- device = mDefaultOutputDevice->mDeviceType;
- if (device == AUDIO_DEVICE_NONE) {
- ALOGE("getDeviceForStrategy() no device found for STRATEGY_PHONE");
- }
- break;
-
- case AUDIO_POLICY_FORCE_SPEAKER:
- // when not in a phone call, phone strategy should route STREAM_VOICE_CALL to
- // A2DP speaker when forcing to speaker output
- if (!isInCall() &&
- (mForceUse[AUDIO_POLICY_FORCE_FOR_MEDIA] != AUDIO_POLICY_FORCE_NO_BT_A2DP) &&
- (getA2dpOutput() != 0)) {
- device = availableOutputDeviceTypes & AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER;
- if (device) break;
- }
- if (!isInCall()) {
- device = availableOutputDeviceTypes & AUDIO_DEVICE_OUT_USB_ACCESSORY;
- if (device) break;
- device = availableOutputDeviceTypes & AUDIO_DEVICE_OUT_USB_DEVICE;
- if (device) break;
- device = availableOutputDeviceTypes & AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET;
- if (device) break;
- device = availableOutputDeviceTypes & AUDIO_DEVICE_OUT_AUX_DIGITAL;
- if (device) break;
- device = availableOutputDeviceTypes & AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET;
- if (device) break;
- }
- device = availableOutputDeviceTypes & AUDIO_DEVICE_OUT_LINE;
- if (device) break;
- device = availableOutputDeviceTypes & AUDIO_DEVICE_OUT_SPEAKER;
- if (device) break;
- device = mDefaultOutputDevice->mDeviceType;
- if (device == AUDIO_DEVICE_NONE) {
- ALOGE("getDeviceForStrategy() no device found for STRATEGY_PHONE, FORCE_SPEAKER");
- }
- break;
- }
- break;
-
- case STRATEGY_SONIFICATION:
-
- // If incall, just select the STRATEGY_PHONE device: The rest of the behavior is handled by
- // handleIncallSonification().
- if (isInCall()) {
- device = getDeviceForStrategy(STRATEGY_PHONE, false /*fromCache*/);
- break;
- }
- // FALL THROUGH
-
- case STRATEGY_ENFORCED_AUDIBLE:
- // strategy STRATEGY_ENFORCED_AUDIBLE uses same routing policy as STRATEGY_SONIFICATION
- // except:
- // - when in call where it doesn't default to STRATEGY_PHONE behavior
- // - in countries where not enforced in which case it follows STRATEGY_MEDIA
-
- if ((strategy == STRATEGY_SONIFICATION) ||
- (mForceUse[AUDIO_POLICY_FORCE_FOR_SYSTEM] == AUDIO_POLICY_FORCE_SYSTEM_ENFORCED)) {
- device = availableOutputDeviceTypes & AUDIO_DEVICE_OUT_SPEAKER;
- if (device == AUDIO_DEVICE_NONE) {
- ALOGE("getDeviceForStrategy() speaker device not found for STRATEGY_SONIFICATION");
- }
- }
- // The second device used for sonification is the same as the device used by media strategy
- // FALL THROUGH
-
- // FIXME: STRATEGY_ACCESSIBILITY and STRATEGY_REROUTING follow STRATEGY_MEDIA for now
- case STRATEGY_ACCESSIBILITY:
- if (strategy == STRATEGY_ACCESSIBILITY) {
- // do not route accessibility prompts to a digital output currently configured with a
- // compressed format as they would likely not be mixed and dropped.
- for (size_t i = 0; i < mOutputs.size(); i++) {
- sp<AudioOutputDescriptor> desc = mOutputs.valueAt(i);
- audio_devices_t devices = desc->device() &
- (AUDIO_DEVICE_OUT_HDMI | AUDIO_DEVICE_OUT_SPDIF | AUDIO_DEVICE_OUT_HDMI_ARC);
- if (desc->isActive() && !audio_is_linear_pcm(desc->mFormat) &&
- devices != AUDIO_DEVICE_NONE) {
- availableOutputDeviceTypes = availableOutputDeviceTypes & ~devices;
- }
- }
- }
- // FALL THROUGH
-
- case STRATEGY_REROUTING:
- case STRATEGY_MEDIA: {
- uint32_t device2 = AUDIO_DEVICE_NONE;
- if (strategy != STRATEGY_SONIFICATION) {
- // no sonification on remote submix (e.g. WFD)
- if (mAvailableOutputDevices.getDevice(AUDIO_DEVICE_OUT_REMOTE_SUBMIX, String8("0")) != 0) {
- device2 = availableOutputDeviceTypes & AUDIO_DEVICE_OUT_REMOTE_SUBMIX;
- }
- }
- if ((device2 == AUDIO_DEVICE_NONE) &&
- (mForceUse[AUDIO_POLICY_FORCE_FOR_MEDIA] != AUDIO_POLICY_FORCE_NO_BT_A2DP) &&
- (getA2dpOutput() != 0)) {
- device2 = availableOutputDeviceTypes & AUDIO_DEVICE_OUT_BLUETOOTH_A2DP;
- if (device2 == AUDIO_DEVICE_NONE) {
- device2 = availableOutputDeviceTypes & AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES;
- }
- if (device2 == AUDIO_DEVICE_NONE) {
- device2 = availableOutputDeviceTypes & AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER;
- }
- }
- if ((device2 == AUDIO_DEVICE_NONE) &&
- (mForceUse[AUDIO_POLICY_FORCE_FOR_MEDIA] == AUDIO_POLICY_FORCE_SPEAKER)) {
- device2 = availableOutputDeviceTypes & AUDIO_DEVICE_OUT_SPEAKER;
- }
- if (device2 == AUDIO_DEVICE_NONE) {
- device2 = availableOutputDeviceTypes & AUDIO_DEVICE_OUT_WIRED_HEADPHONE;
- }
- if ((device2 == AUDIO_DEVICE_NONE)) {
- device2 = availableOutputDeviceTypes & AUDIO_DEVICE_OUT_LINE;
- }
- if (device2 == AUDIO_DEVICE_NONE) {
- device2 = availableOutputDeviceTypes & AUDIO_DEVICE_OUT_WIRED_HEADSET;
- }
- if (device2 == AUDIO_DEVICE_NONE) {
- device2 = availableOutputDeviceTypes & AUDIO_DEVICE_OUT_USB_ACCESSORY;
- }
- if (device2 == AUDIO_DEVICE_NONE) {
- device2 = availableOutputDeviceTypes & AUDIO_DEVICE_OUT_USB_DEVICE;
- }
- if (device2 == AUDIO_DEVICE_NONE) {
- device2 = availableOutputDeviceTypes & AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET;
- }
- if ((device2 == AUDIO_DEVICE_NONE) && (strategy != STRATEGY_SONIFICATION)) {
- // no sonification on aux digital (e.g. HDMI)
- device2 = availableOutputDeviceTypes & AUDIO_DEVICE_OUT_AUX_DIGITAL;
- }
- if ((device2 == AUDIO_DEVICE_NONE) &&
- (mForceUse[AUDIO_POLICY_FORCE_FOR_DOCK] == AUDIO_POLICY_FORCE_ANALOG_DOCK)) {
- device2 = availableOutputDeviceTypes & AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET;
- }
- if (device2 == AUDIO_DEVICE_NONE) {
- device2 = availableOutputDeviceTypes & AUDIO_DEVICE_OUT_SPEAKER;
- }
- int device3 = AUDIO_DEVICE_NONE;
- if (strategy == STRATEGY_MEDIA) {
- // ARC, SPDIF and AUX_LINE can co-exist with others.
- device3 = availableOutputDeviceTypes & AUDIO_DEVICE_OUT_HDMI_ARC;
- device3 |= (availableOutputDeviceTypes & AUDIO_DEVICE_OUT_SPDIF);
- device3 |= (availableOutputDeviceTypes & AUDIO_DEVICE_OUT_AUX_LINE);
- }
-
- device2 |= device3;
- // device is DEVICE_OUT_SPEAKER if we come from case STRATEGY_SONIFICATION or
- // STRATEGY_ENFORCED_AUDIBLE, AUDIO_DEVICE_NONE otherwise
- device |= device2;
-
- // If hdmi system audio mode is on, remove speaker out of output list.
- if ((strategy == STRATEGY_MEDIA) &&
- (mForceUse[AUDIO_POLICY_FORCE_FOR_HDMI_SYSTEM_AUDIO] ==
- AUDIO_POLICY_FORCE_HDMI_SYSTEM_AUDIO_ENFORCED)) {
- device &= ~AUDIO_DEVICE_OUT_SPEAKER;
- }
-
- if (device) break;
- device = mDefaultOutputDevice->mDeviceType;
- if (device == AUDIO_DEVICE_NONE) {
- ALOGE("getDeviceForStrategy() no device found for STRATEGY_MEDIA");
- }
- } break;
-
- default:
- ALOGW("getDeviceForStrategy() unknown strategy: %d", strategy);
- break;
- }
-
- ALOGVV("getDeviceForStrategy() strategy %d, device %x", strategy, device);
- return device;
+ return mEngine->getDeviceForStrategy(strategy);
}
void AudioPolicyManager::updateDevicesAndOutputs()
@@ -4826,7 +4144,7 @@ uint32_t AudioPolicyManager::checkDeviceMuteStrategies(sp<AudioOutputDescriptor>
for (size_t i = 0; i < NUM_STRATEGIES; i++) {
audio_devices_t curDevice = getDeviceForStrategy((routing_strategy)i, false /*fromCache*/);
- curDevice = curDevice & outputDesc->mProfile->mSupportedDevices.types();
+ curDevice = curDevice & outputDesc->supportedDevices();
bool mute = shouldMute && (curDevice & device) && (curDevice != device);
bool doMute = false;
@@ -4845,11 +4163,10 @@ uint32_t AudioPolicyManager::checkDeviceMuteStrategies(sp<AudioOutputDescriptor>
== AUDIO_DEVICE_NONE) {
continue;
}
- audio_io_handle_t curOutput = mOutputs.keyAt(j);
- ALOGVV("checkDeviceMuteStrategies() %s strategy %d (curDevice %04x) on output %d",
- mute ? "muting" : "unmuting", i, curDevice, curOutput);
- setStrategyMute((routing_strategy)i, mute, curOutput, mute ? 0 : delayMs);
- if (desc->isStrategyActive((routing_strategy)i)) {
+ ALOGVV("checkDeviceMuteStrategies() %s strategy %d (curDevice %04x)",
+ mute ? "muting" : "unmuting", i, curDevice);
+ setStrategyMute((routing_strategy)i, mute, desc, mute ? 0 : delayMs);
+ if (isStrategyActive(desc, (routing_strategy)i)) {
if (mute) {
// FIXME: should not need to double latency if volume could be applied
// immediately by the audioflinger mixer. We must account for the delay
@@ -4872,10 +4189,10 @@ uint32_t AudioPolicyManager::checkDeviceMuteStrategies(sp<AudioOutputDescriptor>
muteWaitMs = outputDesc->latency() * 2;
}
for (size_t i = 0; i < NUM_STRATEGIES; i++) {
- if (outputDesc->isStrategyActive((routing_strategy)i)) {
- setStrategyMute((routing_strategy)i, true, outputDesc->mIoHandle);
+ if (isStrategyActive(outputDesc, (routing_strategy)i)) {
+ setStrategyMute((routing_strategy)i, true, outputDesc);
// do tempMute unmute after twice the mute wait time
- setStrategyMute((routing_strategy)i, false, outputDesc->mIoHandle,
+ setStrategyMute((routing_strategy)i, false, outputDesc,
muteWaitMs *2, device);
}
}
@@ -4890,36 +4207,35 @@ uint32_t AudioPolicyManager::checkDeviceMuteStrategies(sp<AudioOutputDescriptor>
return 0;
}
-uint32_t AudioPolicyManager::setOutputDevice(audio_io_handle_t output,
+uint32_t AudioPolicyManager::setOutputDevice(const sp<AudioOutputDescriptor>& outputDesc,
audio_devices_t device,
bool force,
int delayMs,
audio_patch_handle_t *patchHandle,
const char* address)
{
- ALOGV("setOutputDevice() output %d device %04x delayMs %d", output, device, delayMs);
- sp<AudioOutputDescriptor> outputDesc = mOutputs.valueFor(output);
+ ALOGV("setOutputDevice() device %04x delayMs %d", device, delayMs);
AudioParameter param;
uint32_t muteWaitMs;
if (outputDesc->isDuplicated()) {
- muteWaitMs = setOutputDevice(outputDesc->mOutput1->mIoHandle, device, force, delayMs);
- muteWaitMs += setOutputDevice(outputDesc->mOutput2->mIoHandle, device, force, delayMs);
+ muteWaitMs = setOutputDevice(outputDesc->subOutput1(), device, force, delayMs);
+ muteWaitMs += setOutputDevice(outputDesc->subOutput2(), device, force, delayMs);
return muteWaitMs;
}
// no need to proceed if new device is not AUDIO_DEVICE_NONE and not supported by current
// output profile
if ((device != AUDIO_DEVICE_NONE) &&
- ((device & outputDesc->mProfile->mSupportedDevices.types()) == 0)) {
+ ((device & outputDesc->supportedDevices()) == 0)) {
return 0;
}
// filter devices according to output selected
- device = (audio_devices_t)(device & outputDesc->mProfile->mSupportedDevices.types());
+ device = (audio_devices_t)(device & outputDesc->supportedDevices());
audio_devices_t prevDevice = outputDesc->mDevice;
- ALOGV("setOutputDevice() prevDevice %04x", prevDevice);
+ ALOGV("setOutputDevice() prevDevice 0x%04x", prevDevice);
if (device != AUDIO_DEVICE_NONE) {
outputDesc->mDevice = device;
@@ -4932,10 +4248,10 @@ uint32_t AudioPolicyManager::setOutputDevice(audio_io_handle_t output,
// AND force is not specified
// AND the output is connected by a valid audio patch.
// Doing this check here allows the caller to call setOutputDevice() without conditions
- if ((device == AUDIO_DEVICE_NONE || device == prevDevice) && !force &&
- outputDesc->mPatchHandle != 0) {
- ALOGV("setOutputDevice() setting same device %04x or null device for output %d",
- device, output);
+ if ((device == AUDIO_DEVICE_NONE || device == prevDevice) &&
+ !force &&
+ outputDesc->mPatchHandle != 0) {
+ ALOGV("setOutputDevice() setting same device 0x%04x or null device", device);
return muteWaitMs;
}
@@ -4943,7 +4259,7 @@ uint32_t AudioPolicyManager::setOutputDevice(audio_io_handle_t output,
// do the routing
if (device == AUDIO_DEVICE_NONE) {
- resetOutputDevice(output, delayMs, NULL);
+ resetOutputDevice(outputDesc, delayMs, NULL);
} else {
DeviceVector deviceList = (address == NULL) ?
mAvailableOutputDevices.getDevicesFromType(device)
@@ -4978,8 +4294,7 @@ uint32_t AudioPolicyManager::setOutputDevice(audio_io_handle_t output,
status, afPatchHandle, patch.num_sources, patch.num_sinks);
if (status == NO_ERROR) {
if (index < 0) {
- patchDesc = new AudioPatch((audio_patch_handle_t)nextUniqueId(),
- &patch, mUidCached);
+ patchDesc = new AudioPatch(&patch, mUidCached);
addAudioPatch(patchDesc->mHandle, patchDesc);
} else {
patchDesc->mPatch = patch;
@@ -4998,7 +4313,7 @@ uint32_t AudioPolicyManager::setOutputDevice(audio_io_handle_t output,
// inform all input as well
for (size_t i = 0; i < mInputs.size(); i++) {
const sp<AudioInputDescriptor> inputDescriptor = mInputs.valueAt(i);
- if (!isVirtualInputDevice(inputDescriptor->mDevice)) {
+ if (!is_virtual_input_device(inputDescriptor->mDevice)) {
AudioParameter inputCmd = AudioParameter();
ALOGV("%s: inform input %d of device:%d", __func__,
inputDescriptor->mIoHandle, device);
@@ -5011,16 +4326,15 @@ uint32_t AudioPolicyManager::setOutputDevice(audio_io_handle_t output,
}
// update stream volumes according to new device
- applyStreamVolumes(output, device, delayMs);
+ applyStreamVolumes(outputDesc, device, delayMs);
return muteWaitMs;
}
-status_t AudioPolicyManager::resetOutputDevice(audio_io_handle_t output,
+status_t AudioPolicyManager::resetOutputDevice(const sp<AudioOutputDescriptor>& outputDesc,
int delayMs,
audio_patch_handle_t *patchHandle)
{
- sp<AudioOutputDescriptor> outputDesc = mOutputs.valueFor(output);
ssize_t index;
if (patchHandle) {
index = mAudioPatches.indexOfKey(*patchHandle);
@@ -5085,8 +4399,7 @@ status_t AudioPolicyManager::setInputDevice(audio_io_handle_t input,
status, afPatchHandle);
if (status == NO_ERROR) {
if (index < 0) {
- patchDesc = new AudioPatch((audio_patch_handle_t)nextUniqueId(),
- &patch, mUidCached);
+ patchDesc = new AudioPatch(&patch, mUidCached);
addAudioPatch(patchDesc->mHandle, patchDesc);
} else {
patchDesc->mPatch = patch;
@@ -5128,15 +4441,18 @@ status_t AudioPolicyManager::resetInputDevice(audio_io_handle_t input,
return status;
}
-sp<AudioPolicyManager::IOProfile> AudioPolicyManager::getInputProfile(audio_devices_t device,
- String8 address,
- uint32_t& samplingRate,
- audio_format_t format,
- audio_channel_mask_t channelMask,
- audio_input_flags_t flags)
+sp<IOProfile> AudioPolicyManager::getInputProfile(audio_devices_t device,
+ String8 address,
+ uint32_t& samplingRate,
+ audio_format_t& format,
+ audio_channel_mask_t& channelMask,
+ audio_input_flags_t flags)
{
// Choose an input profile based on the requested capture parameters: select the first available
// profile supporting all requested parameters.
+ //
+ // TODO: perhaps isCompatibleProfile should return a "matching" score so we can return
+ // the best matching profile, not the first one.
for (size_t i = 0; i < mHwModules.size(); i++)
{
@@ -5149,7 +4465,11 @@ sp<AudioPolicyManager::IOProfile> AudioPolicyManager::getInputProfile(audio_devi
// profile->log();
if (profile->isCompatibleProfile(device, address, samplingRate,
&samplingRate /*updatedSamplingRate*/,
- format, channelMask, (audio_output_flags_t) flags)) {
+ format,
+ &format /*updatedFormat*/,
+ channelMask,
+ &channelMask /*updatedChannelMask*/,
+ (audio_output_flags_t) flags)) {
return profile;
}
@@ -5160,500 +4480,35 @@ sp<AudioPolicyManager::IOProfile> AudioPolicyManager::getInputProfile(audio_devi
audio_devices_t AudioPolicyManager::getDeviceAndMixForInputSource(audio_source_t inputSource,
- AudioMix **policyMix)
+ AudioMix **policyMix)
{
- audio_devices_t availableDeviceTypes = mAvailableInputDevices.types() &
- ~AUDIO_DEVICE_BIT_IN;
+ audio_devices_t availableDeviceTypes = mAvailableInputDevices.types() & ~AUDIO_DEVICE_BIT_IN;
+ audio_devices_t selectedDeviceFromMix =
+ mPolicyMixes.getDeviceAndMixForInputSource(inputSource, availableDeviceTypes, policyMix);
- for (size_t i = 0; i < mPolicyMixes.size(); i++) {
- if (mPolicyMixes[i]->mMix.mMixType != MIX_TYPE_RECORDERS) {
- continue;
- }
- for (size_t j = 0; j < mPolicyMixes[i]->mMix.mCriteria.size(); j++) {
- if ((RULE_MATCH_ATTRIBUTE_CAPTURE_PRESET == mPolicyMixes[i]->mMix.mCriteria[j].mRule &&
- mPolicyMixes[i]->mMix.mCriteria[j].mAttr.mSource == inputSource) ||
- (RULE_EXCLUDE_ATTRIBUTE_CAPTURE_PRESET == mPolicyMixes[i]->mMix.mCriteria[j].mRule &&
- mPolicyMixes[i]->mMix.mCriteria[j].mAttr.mSource != inputSource)) {
- if (availableDeviceTypes & AUDIO_DEVICE_IN_REMOTE_SUBMIX) {
- if (policyMix != NULL) {
- *policyMix = &mPolicyMixes[i]->mMix;
- }
- return AUDIO_DEVICE_IN_REMOTE_SUBMIX;
- }
- break;
- }
- }
+ if (selectedDeviceFromMix != AUDIO_DEVICE_NONE) {
+ return selectedDeviceFromMix;
}
-
return getDeviceForInputSource(inputSource);
}
audio_devices_t AudioPolicyManager::getDeviceForInputSource(audio_source_t inputSource)
{
- uint32_t device = AUDIO_DEVICE_NONE;
- audio_devices_t availableDeviceTypes = mAvailableInputDevices.types() &
- ~AUDIO_DEVICE_BIT_IN;
-
- switch (inputSource) {
- case AUDIO_SOURCE_VOICE_UPLINK:
- if (availableDeviceTypes & AUDIO_DEVICE_IN_VOICE_CALL) {
- device = AUDIO_DEVICE_IN_VOICE_CALL;
- break;
- }
- break;
-
- case AUDIO_SOURCE_DEFAULT:
- case AUDIO_SOURCE_MIC:
- if (availableDeviceTypes & AUDIO_DEVICE_IN_BLUETOOTH_A2DP) {
- device = AUDIO_DEVICE_IN_BLUETOOTH_A2DP;
- } else if ((mForceUse[AUDIO_POLICY_FORCE_FOR_RECORD] == AUDIO_POLICY_FORCE_BT_SCO) &&
- (availableDeviceTypes & AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET)) {
- device = AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET;
- } else if (availableDeviceTypes & AUDIO_DEVICE_IN_WIRED_HEADSET) {
- device = AUDIO_DEVICE_IN_WIRED_HEADSET;
- } else if (availableDeviceTypes & AUDIO_DEVICE_IN_USB_DEVICE) {
- device = AUDIO_DEVICE_IN_USB_DEVICE;
- } else if (availableDeviceTypes & AUDIO_DEVICE_IN_BUILTIN_MIC) {
- device = AUDIO_DEVICE_IN_BUILTIN_MIC;
- }
- break;
-
- case AUDIO_SOURCE_VOICE_COMMUNICATION:
- // Allow only use of devices on primary input if in call and HAL does not support routing
- // to voice call path.
- if ((mPhoneState == AUDIO_MODE_IN_CALL) &&
- (mAvailableOutputDevices.types() & AUDIO_DEVICE_OUT_TELEPHONY_TX) == 0) {
- availableDeviceTypes = availablePrimaryInputDevices() & ~AUDIO_DEVICE_BIT_IN;
- }
-
- switch (mForceUse[AUDIO_POLICY_FORCE_FOR_COMMUNICATION]) {
- case AUDIO_POLICY_FORCE_BT_SCO:
- // if SCO device is requested but no SCO device is available, fall back to default case
- if (availableDeviceTypes & AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET) {
- device = AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET;
- break;
- }
- // FALL THROUGH
-
- default: // FORCE_NONE
- if (availableDeviceTypes & AUDIO_DEVICE_IN_WIRED_HEADSET) {
- device = AUDIO_DEVICE_IN_WIRED_HEADSET;
- } else if (availableDeviceTypes & AUDIO_DEVICE_IN_USB_DEVICE) {
- device = AUDIO_DEVICE_IN_USB_DEVICE;
- } else if (availableDeviceTypes & AUDIO_DEVICE_IN_BUILTIN_MIC) {
- device = AUDIO_DEVICE_IN_BUILTIN_MIC;
- }
- break;
-
- case AUDIO_POLICY_FORCE_SPEAKER:
- if (availableDeviceTypes & AUDIO_DEVICE_IN_BACK_MIC) {
- device = AUDIO_DEVICE_IN_BACK_MIC;
- } else if (availableDeviceTypes & AUDIO_DEVICE_IN_BUILTIN_MIC) {
- device = AUDIO_DEVICE_IN_BUILTIN_MIC;
- }
- break;
- }
- break;
-
- case AUDIO_SOURCE_VOICE_RECOGNITION:
- case AUDIO_SOURCE_HOTWORD:
- if (mForceUse[AUDIO_POLICY_FORCE_FOR_RECORD] == AUDIO_POLICY_FORCE_BT_SCO &&
- availableDeviceTypes & AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET) {
- device = AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET;
- } else if (availableDeviceTypes & AUDIO_DEVICE_IN_WIRED_HEADSET) {
- device = AUDIO_DEVICE_IN_WIRED_HEADSET;
- } else if (availableDeviceTypes & AUDIO_DEVICE_IN_USB_DEVICE) {
- device = AUDIO_DEVICE_IN_USB_DEVICE;
- } else if (availableDeviceTypes & AUDIO_DEVICE_IN_BUILTIN_MIC) {
- device = AUDIO_DEVICE_IN_BUILTIN_MIC;
- }
- break;
- case AUDIO_SOURCE_CAMCORDER:
- if (availableDeviceTypes & AUDIO_DEVICE_IN_BACK_MIC) {
- device = AUDIO_DEVICE_IN_BACK_MIC;
- } else if (availableDeviceTypes & AUDIO_DEVICE_IN_BUILTIN_MIC) {
- device = AUDIO_DEVICE_IN_BUILTIN_MIC;
- }
- break;
- case AUDIO_SOURCE_VOICE_DOWNLINK:
- case AUDIO_SOURCE_VOICE_CALL:
- if (availableDeviceTypes & AUDIO_DEVICE_IN_VOICE_CALL) {
- device = AUDIO_DEVICE_IN_VOICE_CALL;
- }
- break;
- case AUDIO_SOURCE_REMOTE_SUBMIX:
- if (availableDeviceTypes & AUDIO_DEVICE_IN_REMOTE_SUBMIX) {
- device = AUDIO_DEVICE_IN_REMOTE_SUBMIX;
- }
- break;
- case AUDIO_SOURCE_FM_TUNER:
- if (availableDeviceTypes & AUDIO_DEVICE_IN_FM_TUNER) {
- device = AUDIO_DEVICE_IN_FM_TUNER;
- }
- break;
- default:
- ALOGW("getDeviceForInputSource() invalid input source %d", inputSource);
- break;
- }
- ALOGV("getDeviceForInputSource()input source %d, device %08x", inputSource, device);
- return device;
-}
-
-bool AudioPolicyManager::isVirtualInputDevice(audio_devices_t device)
-{
- if ((device & AUDIO_DEVICE_BIT_IN) != 0) {
- device &= ~AUDIO_DEVICE_BIT_IN;
- if ((popcount(device) == 1) && ((device & ~APM_AUDIO_IN_DEVICE_VIRTUAL_ALL) == 0))
- return true;
- }
- return false;
-}
-
-bool AudioPolicyManager::deviceDistinguishesOnAddress(audio_devices_t device) {
- return ((device & APM_AUDIO_DEVICE_MATCH_ADDRESS_ALL & ~AUDIO_DEVICE_BIT_IN) != 0);
-}
-
-audio_io_handle_t AudioPolicyManager::getActiveInput(bool ignoreVirtualInputs)
-{
- for (size_t i = 0; i < mInputs.size(); i++) {
- const sp<AudioInputDescriptor> input_descriptor = mInputs.valueAt(i);
- if ((input_descriptor->mRefCount > 0)
- && (!ignoreVirtualInputs || !isVirtualInputDevice(input_descriptor->mDevice))) {
- return mInputs.keyAt(i);
- }
- }
- return 0;
-}
-
-uint32_t AudioPolicyManager::activeInputsCount() const
-{
- uint32_t count = 0;
- for (size_t i = 0; i < mInputs.size(); i++) {
- const sp<AudioInputDescriptor> desc = mInputs.valueAt(i);
- if (desc->mRefCount > 0) {
- count++;
- }
- }
- return count;
-}
-
-
-audio_devices_t AudioPolicyManager::getDeviceForVolume(audio_devices_t device)
-{
- if (device == AUDIO_DEVICE_NONE) {
- // this happens when forcing a route update and no track is active on an output.
- // In this case the returned category is not important.
- device = AUDIO_DEVICE_OUT_SPEAKER;
- } else if (popcount(device) > 1) {
- // Multiple device selection is either:
- // - speaker + one other device: give priority to speaker in this case.
- // - one A2DP device + another device: happens with duplicated output. In this case
- // retain the device on the A2DP output as the other must not correspond to an active
- // selection if not the speaker.
- // - HDMI-CEC system audio mode only output: give priority to available item in order.
- if (device & AUDIO_DEVICE_OUT_SPEAKER) {
- device = AUDIO_DEVICE_OUT_SPEAKER;
- } else if (device & AUDIO_DEVICE_OUT_HDMI_ARC) {
- device = AUDIO_DEVICE_OUT_HDMI_ARC;
- } else if (device & AUDIO_DEVICE_OUT_AUX_LINE) {
- device = AUDIO_DEVICE_OUT_AUX_LINE;
- } else if (device & AUDIO_DEVICE_OUT_SPDIF) {
- device = AUDIO_DEVICE_OUT_SPDIF;
- } else {
- device = (audio_devices_t)(device & AUDIO_DEVICE_OUT_ALL_A2DP);
- }
- }
-
- /*SPEAKER_SAFE is an alias of SPEAKER for purposes of volume control*/
- if (device == AUDIO_DEVICE_OUT_SPEAKER_SAFE)
- device = AUDIO_DEVICE_OUT_SPEAKER;
-
- ALOGW_IF(popcount(device) != 1,
- "getDeviceForVolume() invalid device combination: %08x",
- device);
-
- return device;
-}
-
-AudioPolicyManager::device_category AudioPolicyManager::getDeviceCategory(audio_devices_t device)
-{
- switch(getDeviceForVolume(device)) {
- case AUDIO_DEVICE_OUT_EARPIECE:
- return DEVICE_CATEGORY_EARPIECE;
- case AUDIO_DEVICE_OUT_WIRED_HEADSET:
- case AUDIO_DEVICE_OUT_WIRED_HEADPHONE:
- case AUDIO_DEVICE_OUT_BLUETOOTH_SCO:
- case AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET:
- case AUDIO_DEVICE_OUT_BLUETOOTH_A2DP:
- case AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES:
- return DEVICE_CATEGORY_HEADSET;
- case AUDIO_DEVICE_OUT_LINE:
- case AUDIO_DEVICE_OUT_AUX_DIGITAL:
- /*USB? Remote submix?*/
- return DEVICE_CATEGORY_EXT_MEDIA;
- case AUDIO_DEVICE_OUT_SPEAKER:
- case AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT:
- case AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER:
- case AUDIO_DEVICE_OUT_USB_ACCESSORY:
- case AUDIO_DEVICE_OUT_USB_DEVICE:
- case AUDIO_DEVICE_OUT_REMOTE_SUBMIX:
- default:
- return DEVICE_CATEGORY_SPEAKER;
- }
-}
-
-/* static */
-float AudioPolicyManager::volIndexToAmpl(audio_devices_t device, const StreamDescriptor& streamDesc,
- int indexInUi)
-{
- device_category deviceCategory = getDeviceCategory(device);
- const VolumeCurvePoint *curve = streamDesc.mVolumeCurve[deviceCategory];
-
- // the volume index in the UI is relative to the min and max volume indices for this stream type
- int nbSteps = 1 + curve[VOLMAX].mIndex -
- curve[VOLMIN].mIndex;
- int volIdx = (nbSteps * (indexInUi - streamDesc.mIndexMin)) /
- (streamDesc.mIndexMax - streamDesc.mIndexMin);
-
- // find what part of the curve this index volume belongs to, or if it's out of bounds
- int segment = 0;
- if (volIdx < curve[VOLMIN].mIndex) { // out of bounds
- return 0.0f;
- } else if (volIdx < curve[VOLKNEE1].mIndex) {
- segment = 0;
- } else if (volIdx < curve[VOLKNEE2].mIndex) {
- segment = 1;
- } else if (volIdx <= curve[VOLMAX].mIndex) {
- segment = 2;
- } else { // out of bounds
- return 1.0f;
- }
-
- // linear interpolation in the attenuation table in dB
- float decibels = curve[segment].mDBAttenuation +
- ((float)(volIdx - curve[segment].mIndex)) *
- ( (curve[segment+1].mDBAttenuation -
- curve[segment].mDBAttenuation) /
- ((float)(curve[segment+1].mIndex -
- curve[segment].mIndex)) );
-
- float amplification = exp( decibels * 0.115129f); // exp( dB * ln(10) / 20 )
-
- ALOGVV("VOLUME vol index=[%d %d %d], dB=[%.1f %.1f %.1f] ampl=%.5f",
- curve[segment].mIndex, volIdx,
- curve[segment+1].mIndex,
- curve[segment].mDBAttenuation,
- decibels,
- curve[segment+1].mDBAttenuation,
- amplification);
-
- return amplification;
-}
+ for (size_t routeIndex = 0; routeIndex < mInputRoutes.size(); routeIndex++) {
+ sp<SessionRoute> route = mInputRoutes.valueAt(routeIndex);
+ if (inputSource == route->mSource && route->isActive()) {
+ return route->mDeviceDescriptor->type();
+ }
+ }
-const AudioPolicyManager::VolumeCurvePoint
- AudioPolicyManager::sDefaultVolumeCurve[AudioPolicyManager::VOLCNT] = {
- {1, -49.5f}, {33, -33.5f}, {66, -17.0f}, {100, 0.0f}
-};
-
-const AudioPolicyManager::VolumeCurvePoint
- AudioPolicyManager::sDefaultMediaVolumeCurve[AudioPolicyManager::VOLCNT] = {
- {1, -58.0f}, {20, -40.0f}, {60, -17.0f}, {100, 0.0f}
-};
-
-const AudioPolicyManager::VolumeCurvePoint
- AudioPolicyManager::sExtMediaSystemVolumeCurve[AudioPolicyManager::VOLCNT] = {
- {1, -58.0f}, {20, -40.0f}, {60, -21.0f}, {100, -10.0f}
-};
-
-const AudioPolicyManager::VolumeCurvePoint
- AudioPolicyManager::sSpeakerMediaVolumeCurve[AudioPolicyManager::VOLCNT] = {
- {1, -56.0f}, {20, -34.0f}, {60, -11.0f}, {100, 0.0f}
-};
-
-const AudioPolicyManager::VolumeCurvePoint
- AudioPolicyManager::sSpeakerMediaVolumeCurveDrc[AudioPolicyManager::VOLCNT] = {
- {1, -55.0f}, {20, -43.0f}, {86, -12.0f}, {100, 0.0f}
-};
-
-const AudioPolicyManager::VolumeCurvePoint
- AudioPolicyManager::sSpeakerSonificationVolumeCurve[AudioPolicyManager::VOLCNT] = {
- {1, -29.7f}, {33, -20.1f}, {66, -10.2f}, {100, 0.0f}
-};
-
-const AudioPolicyManager::VolumeCurvePoint
- AudioPolicyManager::sSpeakerSonificationVolumeCurveDrc[AudioPolicyManager::VOLCNT] = {
- {1, -35.7f}, {33, -26.1f}, {66, -13.2f}, {100, 0.0f}
-};
-
-// AUDIO_STREAM_SYSTEM, AUDIO_STREAM_ENFORCED_AUDIBLE and AUDIO_STREAM_DTMF volume tracks
-// AUDIO_STREAM_RING on phones and AUDIO_STREAM_MUSIC on tablets.
-// AUDIO_STREAM_DTMF tracks AUDIO_STREAM_VOICE_CALL while in call (See AudioService.java).
-// The range is constrained between -24dB and -6dB over speaker and -30dB and -18dB over headset.
-
-const AudioPolicyManager::VolumeCurvePoint
- AudioPolicyManager::sDefaultSystemVolumeCurve[AudioPolicyManager::VOLCNT] = {
- {1, -24.0f}, {33, -18.0f}, {66, -12.0f}, {100, -6.0f}
-};
-
-const AudioPolicyManager::VolumeCurvePoint
- AudioPolicyManager::sDefaultSystemVolumeCurveDrc[AudioPolicyManager::VOLCNT] = {
- {1, -34.0f}, {33, -24.0f}, {66, -15.0f}, {100, -6.0f}
-};
-
-const AudioPolicyManager::VolumeCurvePoint
- AudioPolicyManager::sHeadsetSystemVolumeCurve[AudioPolicyManager::VOLCNT] = {
- {1, -30.0f}, {33, -26.0f}, {66, -22.0f}, {100, -18.0f}
-};
-
-const AudioPolicyManager::VolumeCurvePoint
- AudioPolicyManager::sDefaultVoiceVolumeCurve[AudioPolicyManager::VOLCNT] = {
- {0, -42.0f}, {33, -28.0f}, {66, -14.0f}, {100, 0.0f}
-};
-
-const AudioPolicyManager::VolumeCurvePoint
- AudioPolicyManager::sSpeakerVoiceVolumeCurve[AudioPolicyManager::VOLCNT] = {
- {0, -24.0f}, {33, -16.0f}, {66, -8.0f}, {100, 0.0f}
-};
-
-const AudioPolicyManager::VolumeCurvePoint
- AudioPolicyManager::sLinearVolumeCurve[AudioPolicyManager::VOLCNT] = {
- {0, -96.0f}, {33, -68.0f}, {66, -34.0f}, {100, 0.0f}
-};
-
-const AudioPolicyManager::VolumeCurvePoint
- AudioPolicyManager::sSilentVolumeCurve[AudioPolicyManager::VOLCNT] = {
- {0, -96.0f}, {1, -96.0f}, {2, -96.0f}, {100, -96.0f}
-};
-
-const AudioPolicyManager::VolumeCurvePoint
- AudioPolicyManager::sFullScaleVolumeCurve[AudioPolicyManager::VOLCNT] = {
- {0, 0.0f}, {1, 0.0f}, {2, 0.0f}, {100, 0.0f}
-};
-
-const AudioPolicyManager::VolumeCurvePoint
- *AudioPolicyManager::sVolumeProfiles[AUDIO_STREAM_CNT]
- [AudioPolicyManager::DEVICE_CATEGORY_CNT] = {
- { // AUDIO_STREAM_VOICE_CALL
- sDefaultVoiceVolumeCurve, // DEVICE_CATEGORY_HEADSET
- sSpeakerVoiceVolumeCurve, // DEVICE_CATEGORY_SPEAKER
- sDefaultVoiceVolumeCurve, // DEVICE_CATEGORY_EARPIECE
- sDefaultMediaVolumeCurve // DEVICE_CATEGORY_EXT_MEDIA
- },
- { // AUDIO_STREAM_SYSTEM
- sHeadsetSystemVolumeCurve, // DEVICE_CATEGORY_HEADSET
- sDefaultSystemVolumeCurve, // DEVICE_CATEGORY_SPEAKER
- sDefaultSystemVolumeCurve, // DEVICE_CATEGORY_EARPIECE
- sExtMediaSystemVolumeCurve // DEVICE_CATEGORY_EXT_MEDIA
- },
- { // AUDIO_STREAM_RING
- sDefaultVolumeCurve, // DEVICE_CATEGORY_HEADSET
- sSpeakerSonificationVolumeCurve, // DEVICE_CATEGORY_SPEAKER
- sDefaultVolumeCurve, // DEVICE_CATEGORY_EARPIECE
- sExtMediaSystemVolumeCurve // DEVICE_CATEGORY_EXT_MEDIA
- },
- { // AUDIO_STREAM_MUSIC
- sDefaultMediaVolumeCurve, // DEVICE_CATEGORY_HEADSET
- sSpeakerMediaVolumeCurve, // DEVICE_CATEGORY_SPEAKER
- sDefaultMediaVolumeCurve, // DEVICE_CATEGORY_EARPIECE
- sDefaultMediaVolumeCurve // DEVICE_CATEGORY_EXT_MEDIA
- },
- { // AUDIO_STREAM_ALARM
- sDefaultVolumeCurve, // DEVICE_CATEGORY_HEADSET
- sSpeakerSonificationVolumeCurve, // DEVICE_CATEGORY_SPEAKER
- sDefaultVolumeCurve, // DEVICE_CATEGORY_EARPIECE
- sExtMediaSystemVolumeCurve // DEVICE_CATEGORY_EXT_MEDIA
- },
- { // AUDIO_STREAM_NOTIFICATION
- sDefaultVolumeCurve, // DEVICE_CATEGORY_HEADSET
- sSpeakerSonificationVolumeCurve, // DEVICE_CATEGORY_SPEAKER
- sDefaultVolumeCurve, // DEVICE_CATEGORY_EARPIECE
- sExtMediaSystemVolumeCurve // DEVICE_CATEGORY_EXT_MEDIA
- },
- { // AUDIO_STREAM_BLUETOOTH_SCO
- sDefaultVoiceVolumeCurve, // DEVICE_CATEGORY_HEADSET
- sSpeakerVoiceVolumeCurve, // DEVICE_CATEGORY_SPEAKER
- sDefaultVoiceVolumeCurve, // DEVICE_CATEGORY_EARPIECE
- sDefaultMediaVolumeCurve // DEVICE_CATEGORY_EXT_MEDIA
- },
- { // AUDIO_STREAM_ENFORCED_AUDIBLE
- sHeadsetSystemVolumeCurve, // DEVICE_CATEGORY_HEADSET
- sDefaultSystemVolumeCurve, // DEVICE_CATEGORY_SPEAKER
- sDefaultSystemVolumeCurve, // DEVICE_CATEGORY_EARPIECE
- sExtMediaSystemVolumeCurve // DEVICE_CATEGORY_EXT_MEDIA
- },
- { // AUDIO_STREAM_DTMF
- sHeadsetSystemVolumeCurve, // DEVICE_CATEGORY_HEADSET
- sDefaultSystemVolumeCurve, // DEVICE_CATEGORY_SPEAKER
- sDefaultSystemVolumeCurve, // DEVICE_CATEGORY_EARPIECE
- sExtMediaSystemVolumeCurve // DEVICE_CATEGORY_EXT_MEDIA
- },
- { // AUDIO_STREAM_TTS
- // "Transmitted Through Speaker": always silent except on DEVICE_CATEGORY_SPEAKER
- sSilentVolumeCurve, // DEVICE_CATEGORY_HEADSET
- sLinearVolumeCurve, // DEVICE_CATEGORY_SPEAKER
- sSilentVolumeCurve, // DEVICE_CATEGORY_EARPIECE
- sSilentVolumeCurve // DEVICE_CATEGORY_EXT_MEDIA
- },
- { // AUDIO_STREAM_ACCESSIBILITY
- sDefaultMediaVolumeCurve, // DEVICE_CATEGORY_HEADSET
- sSpeakerMediaVolumeCurve, // DEVICE_CATEGORY_SPEAKER
- sDefaultMediaVolumeCurve, // DEVICE_CATEGORY_EARPIECE
- sDefaultMediaVolumeCurve // DEVICE_CATEGORY_EXT_MEDIA
- },
- { // AUDIO_STREAM_REROUTING
- sFullScaleVolumeCurve, // DEVICE_CATEGORY_HEADSET
- sFullScaleVolumeCurve, // DEVICE_CATEGORY_SPEAKER
- sFullScaleVolumeCurve, // DEVICE_CATEGORY_EARPIECE
- sFullScaleVolumeCurve // DEVICE_CATEGORY_EXT_MEDIA
- },
- { // AUDIO_STREAM_PATCH
- sFullScaleVolumeCurve, // DEVICE_CATEGORY_HEADSET
- sFullScaleVolumeCurve, // DEVICE_CATEGORY_SPEAKER
- sFullScaleVolumeCurve, // DEVICE_CATEGORY_EARPIECE
- sFullScaleVolumeCurve // DEVICE_CATEGORY_EXT_MEDIA
- },
-};
-
-void AudioPolicyManager::initializeVolumeCurves()
-{
- for (int i = 0; i < AUDIO_STREAM_CNT; i++) {
- for (int j = 0; j < DEVICE_CATEGORY_CNT; j++) {
- mStreams[i].mVolumeCurve[j] =
- sVolumeProfiles[i][j];
- }
- }
-
- // Check availability of DRC on speaker path: if available, override some of the speaker curves
- if (mSpeakerDrcEnabled) {
- mStreams[AUDIO_STREAM_SYSTEM].mVolumeCurve[DEVICE_CATEGORY_SPEAKER] =
- sDefaultSystemVolumeCurveDrc;
- mStreams[AUDIO_STREAM_RING].mVolumeCurve[DEVICE_CATEGORY_SPEAKER] =
- sSpeakerSonificationVolumeCurveDrc;
- mStreams[AUDIO_STREAM_ALARM].mVolumeCurve[DEVICE_CATEGORY_SPEAKER] =
- sSpeakerSonificationVolumeCurveDrc;
- mStreams[AUDIO_STREAM_NOTIFICATION].mVolumeCurve[DEVICE_CATEGORY_SPEAKER] =
- sSpeakerSonificationVolumeCurveDrc;
- mStreams[AUDIO_STREAM_MUSIC].mVolumeCurve[DEVICE_CATEGORY_SPEAKER] =
- sSpeakerMediaVolumeCurveDrc;
- mStreams[AUDIO_STREAM_ACCESSIBILITY].mVolumeCurve[DEVICE_CATEGORY_SPEAKER] =
- sSpeakerMediaVolumeCurveDrc;
- }
+ return mEngine->getDeviceForInputSource(inputSource);
}
float AudioPolicyManager::computeVolume(audio_stream_type_t stream,
int index,
- audio_io_handle_t output,
audio_devices_t device)
{
- float volume = 1.0;
- sp<AudioOutputDescriptor> outputDesc = mOutputs.valueFor(output);
- StreamDescriptor &streamDesc = mStreams[stream];
-
- if (device == AUDIO_DEVICE_NONE) {
- device = outputDesc->device();
- }
-
- volume = volIndexToAmpl(device, streamDesc, index);
+ float volumeDb = mEngine->volIndexToDb(Volume::getDeviceCategory(device), stream, index);
// if a headset is connected, apply the following rules to ring tones and notifications
// to avoid sound level bursts in user's ears:
@@ -5669,95 +4524,75 @@ float AudioPolicyManager::computeVolume(audio_stream_type_t stream,
|| (stream_strategy == STRATEGY_SONIFICATION_RESPECTFUL)
|| (stream == AUDIO_STREAM_SYSTEM)
|| ((stream_strategy == STRATEGY_ENFORCED_AUDIBLE) &&
- (mForceUse[AUDIO_POLICY_FORCE_FOR_SYSTEM] == AUDIO_POLICY_FORCE_NONE))) &&
- streamDesc.mCanBeMuted) {
- volume *= SONIFICATION_HEADSET_VOLUME_FACTOR;
+ (mEngine->getForceUse(AUDIO_POLICY_FORCE_FOR_SYSTEM) == AUDIO_POLICY_FORCE_NONE))) &&
+ mStreams.canBeMuted(stream)) {
+ volumeDb += SONIFICATION_HEADSET_VOLUME_FACTOR_DB;
// when the phone is ringing we must consider that music could have been paused just before
// by the music application and behave as if music was active if the last music track was
// just stopped
if (isStreamActive(AUDIO_STREAM_MUSIC, SONIFICATION_HEADSET_MUSIC_DELAY) ||
mLimitRingtoneVolume) {
audio_devices_t musicDevice = getDeviceForStrategy(STRATEGY_MEDIA, true /*fromCache*/);
- float musicVol = computeVolume(AUDIO_STREAM_MUSIC,
- mStreams[AUDIO_STREAM_MUSIC].getVolumeIndex(musicDevice),
- output,
+ float musicVolDB = computeVolume(AUDIO_STREAM_MUSIC,
+ mStreams.valueFor(AUDIO_STREAM_MUSIC).getVolumeIndex(musicDevice),
musicDevice);
- float minVol = (musicVol > SONIFICATION_HEADSET_VOLUME_MIN) ?
- musicVol : SONIFICATION_HEADSET_VOLUME_MIN;
- if (volume > minVol) {
- volume = minVol;
- ALOGV("computeVolume limiting volume to %f musicVol %f", minVol, musicVol);
+ float minVolDB = (musicVolDB > SONIFICATION_HEADSET_VOLUME_MIN_DB) ?
+ musicVolDB : SONIFICATION_HEADSET_VOLUME_MIN_DB;
+ if (volumeDb > minVolDB) {
+ volumeDb = minVolDB;
+ ALOGV("computeVolume limiting volume to %f musicVol %f", minVolDB, musicVolDB);
}
}
}
- return volume;
+ return volumeDb;
}
status_t AudioPolicyManager::checkAndSetVolume(audio_stream_type_t stream,
int index,
- audio_io_handle_t output,
+ const sp<AudioOutputDescriptor>& outputDesc,
audio_devices_t device,
int delayMs,
bool force)
{
-
// do not change actual stream volume if the stream is muted
- if (mOutputs.valueFor(output)->mMuteCount[stream] != 0) {
+ if (outputDesc->mMuteCount[stream] != 0) {
ALOGVV("checkAndSetVolume() stream %d muted count %d",
- stream, mOutputs.valueFor(output)->mMuteCount[stream]);
+ stream, outputDesc->mMuteCount[stream]);
return NO_ERROR;
}
-
+ audio_policy_forced_cfg_t forceUseForComm =
+ mEngine->getForceUse(AUDIO_POLICY_FORCE_FOR_COMMUNICATION);
// do not change in call volume if bluetooth is connected and vice versa
- if ((stream == AUDIO_STREAM_VOICE_CALL &&
- mForceUse[AUDIO_POLICY_FORCE_FOR_COMMUNICATION] == AUDIO_POLICY_FORCE_BT_SCO) ||
- (stream == AUDIO_STREAM_BLUETOOTH_SCO &&
- mForceUse[AUDIO_POLICY_FORCE_FOR_COMMUNICATION] != AUDIO_POLICY_FORCE_BT_SCO)) {
+ if ((stream == AUDIO_STREAM_VOICE_CALL && forceUseForComm == AUDIO_POLICY_FORCE_BT_SCO) ||
+ (stream == AUDIO_STREAM_BLUETOOTH_SCO && forceUseForComm != AUDIO_POLICY_FORCE_BT_SCO)) {
ALOGV("checkAndSetVolume() cannot set stream %d volume with force use = %d for comm",
- stream, mForceUse[AUDIO_POLICY_FORCE_FOR_COMMUNICATION]);
+ stream, forceUseForComm);
return INVALID_OPERATION;
}
- float volume = computeVolume(stream, index, output, device);
- // unit gain if rerouting to external policy
- if (device == AUDIO_DEVICE_OUT_REMOTE_SUBMIX) {
- ssize_t index = mOutputs.indexOfKey(output);
- if (index >= 0) {
- sp<AudioOutputDescriptor> outputDesc = mOutputs.valueAt(index);
- if (outputDesc->mPolicyMix != NULL) {
- ALOGV("max gain when rerouting for output=%d", output);
- volume = 1.0f;
- }
- }
-
+ if (device == AUDIO_DEVICE_NONE) {
+ device = outputDesc->device();
}
- // We actually change the volume if:
- // - the float value returned by computeVolume() changed
- // - the force flag is set
- if (volume != mOutputs.valueFor(output)->mCurVolume[stream] ||
- force) {
- mOutputs.valueFor(output)->mCurVolume[stream] = volume;
- ALOGVV("checkAndSetVolume() for output %d stream %d, volume %f, delay %d", output, stream, volume, delayMs);
- // Force VOICE_CALL to track BLUETOOTH_SCO stream volume when bluetooth audio is
- // enabled
- if (stream == AUDIO_STREAM_BLUETOOTH_SCO) {
- mpClientInterface->setStreamVolume(AUDIO_STREAM_VOICE_CALL, volume, output, delayMs);
- }
- mpClientInterface->setStreamVolume(stream, volume, output, delayMs);
+
+ float volumeDb = computeVolume(stream, index, device);
+ if (outputDesc->isFixedVolume(device)) {
+ volumeDb = 0.0f;
}
+ outputDesc->setVolume(volumeDb, stream, device, delayMs, force);
+
if (stream == AUDIO_STREAM_VOICE_CALL ||
stream == AUDIO_STREAM_BLUETOOTH_SCO) {
float voiceVolume;
// Force voice volume to max for bluetooth SCO as volume is managed by the headset
if (stream == AUDIO_STREAM_VOICE_CALL) {
- voiceVolume = (float)index/(float)mStreams[stream].mIndexMax;
+ voiceVolume = (float)index/(float)mStreams.valueFor(stream).getVolumeIndexMax();
} else {
voiceVolume = 1.0;
}
- if (voiceVolume != mLastVoiceVolume && output == mPrimaryOutput) {
+ if (voiceVolume != mLastVoiceVolume && outputDesc == mPrimaryOutput) {
mpClientInterface->setVoiceVolume(voiceVolume, delayMs);
mLastVoiceVolume = voiceVolume;
}
@@ -5766,20 +4601,20 @@ status_t AudioPolicyManager::checkAndSetVolume(audio_stream_type_t stream,
return NO_ERROR;
}
-void AudioPolicyManager::applyStreamVolumes(audio_io_handle_t output,
+void AudioPolicyManager::applyStreamVolumes(const sp<AudioOutputDescriptor>& outputDesc,
audio_devices_t device,
int delayMs,
bool force)
{
- ALOGVV("applyStreamVolumes() for output %d and device %x", output, device);
+ ALOGVV("applyStreamVolumes() for device %08x", device);
for (int stream = 0; stream < AUDIO_STREAM_CNT; stream++) {
if (stream == AUDIO_STREAM_PATCH) {
continue;
}
checkAndSetVolume((audio_stream_type_t)stream,
- mStreams[stream].getVolumeIndex(device),
- output,
+ mStreams.valueFor((audio_stream_type_t)stream).getVolumeIndex(device),
+ outputDesc,
device,
delayMs,
force);
@@ -5788,42 +4623,42 @@ void AudioPolicyManager::applyStreamVolumes(audio_io_handle_t output,
void AudioPolicyManager::setStrategyMute(routing_strategy strategy,
bool on,
- audio_io_handle_t output,
+ const sp<AudioOutputDescriptor>& outputDesc,
int delayMs,
audio_devices_t device)
{
- ALOGVV("setStrategyMute() strategy %d, mute %d, output %d", strategy, on, output);
+ ALOGVV("setStrategyMute() strategy %d, mute %d, output ID %d",
+ strategy, on, outputDesc->getId());
for (int stream = 0; stream < AUDIO_STREAM_CNT; stream++) {
if (stream == AUDIO_STREAM_PATCH) {
continue;
}
if (getStrategy((audio_stream_type_t)stream) == strategy) {
- setStreamMute((audio_stream_type_t)stream, on, output, delayMs, device);
+ setStreamMute((audio_stream_type_t)stream, on, outputDesc, delayMs, device);
}
}
}
void AudioPolicyManager::setStreamMute(audio_stream_type_t stream,
bool on,
- audio_io_handle_t output,
+ const sp<AudioOutputDescriptor>& outputDesc,
int delayMs,
audio_devices_t device)
{
- StreamDescriptor &streamDesc = mStreams[stream];
- sp<AudioOutputDescriptor> outputDesc = mOutputs.valueFor(output);
+ const StreamDescriptor& streamDesc = mStreams.valueFor(stream);
if (device == AUDIO_DEVICE_NONE) {
device = outputDesc->device();
}
- ALOGVV("setStreamMute() stream %d, mute %d, output %d, mMuteCount %d device %04x",
- stream, on, output, outputDesc->mMuteCount[stream], device);
+ ALOGVV("setStreamMute() stream %d, mute %d, mMuteCount %d device %04x",
+ stream, on, outputDesc->mMuteCount[stream], device);
if (on) {
if (outputDesc->mMuteCount[stream] == 0) {
- if (streamDesc.mCanBeMuted &&
+ if (streamDesc.canBeMuted() &&
((stream != AUDIO_STREAM_ENFORCED_AUDIBLE) ||
- (mForceUse[AUDIO_POLICY_FORCE_FOR_SYSTEM] == AUDIO_POLICY_FORCE_NONE))) {
- checkAndSetVolume(stream, 0, output, device, delayMs);
+ (mEngine->getForceUse(AUDIO_POLICY_FORCE_FOR_SYSTEM) == AUDIO_POLICY_FORCE_NONE))) {
+ checkAndSetVolume(stream, 0, outputDesc, device, delayMs);
}
}
// increment mMuteCount after calling checkAndSetVolume() so that volume change is not ignored
@@ -5836,7 +4671,7 @@ void AudioPolicyManager::setStreamMute(audio_stream_type_t stream,
if (--outputDesc->mMuteCount[stream] == 0) {
checkAndSetVolume(stream,
streamDesc.getVolumeIndex(device),
- output,
+ outputDesc,
device,
delayMs);
}
@@ -5846,6 +4681,10 @@ void AudioPolicyManager::setStreamMute(audio_stream_type_t stream,
void AudioPolicyManager::handleIncallSonification(audio_stream_type_t stream,
bool starting, bool stateChange)
{
+ if(!hasPrimaryOutput()) {
+ return;
+ }
+
// if the stream pertains to sonification strategy and we are in call we must
// mute the stream if it is low visibility. If it is high visibility, we must play a tone
// in the device used for phone strategy and play the tone if the selected device does not
@@ -5855,7 +4694,7 @@ void AudioPolicyManager::handleIncallSonification(audio_stream_type_t stream,
const routing_strategy stream_strategy = getStrategy(stream);
if ((stream_strategy == STRATEGY_SONIFICATION) ||
((stream_strategy == STRATEGY_SONIFICATION_RESPECTFUL))) {
- sp<AudioOutputDescriptor> outputDesc = mOutputs.valueFor(mPrimaryOutput);
+ sp<SwAudioOutputDescriptor> outputDesc = mPrimaryOutput;
ALOGV("handleIncallSonification() stream %d starting %d device %x stateChange %d",
stream, starting, outputDesc->mDevice, stateChange);
if (outputDesc->mRefCount[stream]) {
@@ -5888,2109 +4727,21 @@ void AudioPolicyManager::handleIncallSonification(audio_stream_type_t stream,
}
}
-bool AudioPolicyManager::isInCall()
-{
- return isStateInCall(mPhoneState);
-}
-
-bool AudioPolicyManager::isStateInCall(int state) {
- return ((state == AUDIO_MODE_IN_CALL) ||
- (state == AUDIO_MODE_IN_COMMUNICATION));
-}
-
-uint32_t AudioPolicyManager::getMaxEffectsCpuLoad()
-{
- return MAX_EFFECTS_CPU_LOAD;
-}
-
-uint32_t AudioPolicyManager::getMaxEffectsMemory()
-{
- return MAX_EFFECTS_MEMORY;
-}
-
-
-// --- AudioOutputDescriptor class implementation
-
-AudioPolicyManager::AudioOutputDescriptor::AudioOutputDescriptor(
- const sp<IOProfile>& profile)
- : mId(0), mIoHandle(0), mLatency(0),
- mFlags((audio_output_flags_t)0), mDevice(AUDIO_DEVICE_NONE), mPolicyMix(NULL),
- mPatchHandle(0),
- mOutput1(0), mOutput2(0), mProfile(profile), mDirectOpenCount(0)
-{
- // clear usage count for all stream types
- for (int i = 0; i < AUDIO_STREAM_CNT; i++) {
- mRefCount[i] = 0;
- mCurVolume[i] = -1.0;
- mMuteCount[i] = 0;
- mStopTime[i] = 0;
- }
- for (int i = 0; i < NUM_STRATEGIES; i++) {
- mStrategyMutedByDevice[i] = false;
- }
- if (profile != NULL) {
- mFlags = (audio_output_flags_t)profile->mFlags;
- mSamplingRate = profile->pickSamplingRate();
- mFormat = profile->pickFormat();
- mChannelMask = profile->pickChannelMask();
- if (profile->mGains.size() > 0) {
- profile->mGains[0]->getDefaultConfig(&mGain);
- }
- }
-}
-
-audio_devices_t AudioPolicyManager::AudioOutputDescriptor::device() const
-{
- if (isDuplicated()) {
- return (audio_devices_t)(mOutput1->mDevice | mOutput2->mDevice);
- } else {
- return mDevice;
- }
-}
-uint32_t AudioPolicyManager::AudioOutputDescriptor::latency()
-{
- if (isDuplicated()) {
- return (mOutput1->mLatency > mOutput2->mLatency) ? mOutput1->mLatency : mOutput2->mLatency;
- } else {
- return mLatency;
- }
-}
-
-bool AudioPolicyManager::AudioOutputDescriptor::sharesHwModuleWith(
- const sp<AudioOutputDescriptor> outputDesc)
-{
- if (isDuplicated()) {
- return mOutput1->sharesHwModuleWith(outputDesc) || mOutput2->sharesHwModuleWith(outputDesc);
- } else if (outputDesc->isDuplicated()){
- return sharesHwModuleWith(outputDesc->mOutput1) || sharesHwModuleWith(outputDesc->mOutput2);
- } else {
- return (mProfile->mModule == outputDesc->mProfile->mModule);
- }
-}
-
-void AudioPolicyManager::AudioOutputDescriptor::changeRefCount(audio_stream_type_t stream,
- int delta)
-{
- // forward usage count change to attached outputs
- if (isDuplicated()) {
- mOutput1->changeRefCount(stream, delta);
- mOutput2->changeRefCount(stream, delta);
- }
- if ((delta + (int)mRefCount[stream]) < 0) {
- ALOGW("changeRefCount() invalid delta %d for stream %d, refCount %d",
- delta, stream, mRefCount[stream]);
- mRefCount[stream] = 0;
- return;
- }
- mRefCount[stream] += delta;
- ALOGV("changeRefCount() stream %d, count %d", stream, mRefCount[stream]);
-}
-
-audio_devices_t AudioPolicyManager::AudioOutputDescriptor::supportedDevices()
-{
- if (isDuplicated()) {
- return (audio_devices_t)(mOutput1->supportedDevices() | mOutput2->supportedDevices());
- } else {
- return mProfile->mSupportedDevices.types() ;
- }
-}
-
-bool AudioPolicyManager::AudioOutputDescriptor::isActive(uint32_t inPastMs) const
-{
- return isStrategyActive(NUM_STRATEGIES, inPastMs);
-}
-
-bool AudioPolicyManager::AudioOutputDescriptor::isStrategyActive(routing_strategy strategy,
- uint32_t inPastMs,
- nsecs_t sysTime) const
-{
- if ((sysTime == 0) && (inPastMs != 0)) {
- sysTime = systemTime();
- }
- for (int i = 0; i < (int)AUDIO_STREAM_CNT; i++) {
- if (i == AUDIO_STREAM_PATCH) {
- continue;
- }
- if (((getStrategy((audio_stream_type_t)i) == strategy) ||
- (NUM_STRATEGIES == strategy)) &&
- isStreamActive((audio_stream_type_t)i, inPastMs, sysTime)) {
- return true;
- }
- }
- return false;
-}
-
-bool AudioPolicyManager::AudioOutputDescriptor::isStreamActive(audio_stream_type_t stream,
- uint32_t inPastMs,
- nsecs_t sysTime) const
-{
- if (mRefCount[stream] != 0) {
- return true;
- }
- if (inPastMs == 0) {
- return false;
- }
- if (sysTime == 0) {
- sysTime = systemTime();
- }
- if (ns2ms(sysTime - mStopTime[stream]) < inPastMs) {
- return true;
- }
- return false;
-}
-
-void AudioPolicyManager::AudioOutputDescriptor::toAudioPortConfig(
- struct audio_port_config *dstConfig,
- const struct audio_port_config *srcConfig) const
-{
- ALOG_ASSERT(!isDuplicated(), "toAudioPortConfig() called on duplicated output %d", mIoHandle);
-
- dstConfig->config_mask = AUDIO_PORT_CONFIG_SAMPLE_RATE|AUDIO_PORT_CONFIG_CHANNEL_MASK|
- AUDIO_PORT_CONFIG_FORMAT|AUDIO_PORT_CONFIG_GAIN;
- if (srcConfig != NULL) {
- dstConfig->config_mask |= srcConfig->config_mask;
- }
- AudioPortConfig::toAudioPortConfig(dstConfig, srcConfig);
-
- dstConfig->id = mId;
- dstConfig->role = AUDIO_PORT_ROLE_SOURCE;
- dstConfig->type = AUDIO_PORT_TYPE_MIX;
- dstConfig->ext.mix.hw_module = mProfile->mModule->mHandle;
- dstConfig->ext.mix.handle = mIoHandle;
- dstConfig->ext.mix.usecase.stream = AUDIO_STREAM_DEFAULT;
-}
-
-void AudioPolicyManager::AudioOutputDescriptor::toAudioPort(
- struct audio_port *port) const
-{
- ALOG_ASSERT(!isDuplicated(), "toAudioPort() called on duplicated output %d", mIoHandle);
- mProfile->toAudioPort(port);
- port->id = mId;
- toAudioPortConfig(&port->active_config);
- port->ext.mix.hw_module = mProfile->mModule->mHandle;
- port->ext.mix.handle = mIoHandle;
- port->ext.mix.latency_class =
- mFlags & AUDIO_OUTPUT_FLAG_FAST ? AUDIO_LATENCY_LOW : AUDIO_LATENCY_NORMAL;
-}
-
-status_t AudioPolicyManager::AudioOutputDescriptor::dump(int fd)
-{
- const size_t SIZE = 256;
- char buffer[SIZE];
- String8 result;
-
- snprintf(buffer, SIZE, " ID: %d\n", mId);
- result.append(buffer);
- snprintf(buffer, SIZE, " Sampling rate: %d\n", mSamplingRate);
- result.append(buffer);
- snprintf(buffer, SIZE, " Format: %08x\n", mFormat);
- result.append(buffer);
- snprintf(buffer, SIZE, " Channels: %08x\n", mChannelMask);
- result.append(buffer);
- snprintf(buffer, SIZE, " Latency: %d\n", mLatency);
- result.append(buffer);
- snprintf(buffer, SIZE, " Flags %08x\n", mFlags);
- result.append(buffer);
- snprintf(buffer, SIZE, " Devices %08x\n", device());
- result.append(buffer);
- snprintf(buffer, SIZE, " Stream volume refCount muteCount\n");
- result.append(buffer);
- for (int i = 0; i < (int)AUDIO_STREAM_CNT; i++) {
- snprintf(buffer, SIZE, " %02d %.03f %02d %02d\n",
- i, mCurVolume[i], mRefCount[i], mMuteCount[i]);
- result.append(buffer);
- }
- write(fd, result.string(), result.size());
-
- return NO_ERROR;
-}
-
-// --- AudioInputDescriptor class implementation
-
-AudioPolicyManager::AudioInputDescriptor::AudioInputDescriptor(const sp<IOProfile>& profile)
- : mId(0), mIoHandle(0),
- mDevice(AUDIO_DEVICE_NONE), mPolicyMix(NULL), mPatchHandle(0), mRefCount(0),
- mInputSource(AUDIO_SOURCE_DEFAULT), mProfile(profile), mIsSoundTrigger(false)
-{
- if (profile != NULL) {
- mSamplingRate = profile->pickSamplingRate();
- mFormat = profile->pickFormat();
- mChannelMask = profile->pickChannelMask();
- if (profile->mGains.size() > 0) {
- profile->mGains[0]->getDefaultConfig(&mGain);
- }
- }
-}
-
-void AudioPolicyManager::AudioInputDescriptor::toAudioPortConfig(
- struct audio_port_config *dstConfig,
- const struct audio_port_config *srcConfig) const
-{
- ALOG_ASSERT(mProfile != 0,
- "toAudioPortConfig() called on input with null profile %d", mIoHandle);
- dstConfig->config_mask = AUDIO_PORT_CONFIG_SAMPLE_RATE|AUDIO_PORT_CONFIG_CHANNEL_MASK|
- AUDIO_PORT_CONFIG_FORMAT|AUDIO_PORT_CONFIG_GAIN;
- if (srcConfig != NULL) {
- dstConfig->config_mask |= srcConfig->config_mask;
- }
-
- AudioPortConfig::toAudioPortConfig(dstConfig, srcConfig);
-
- dstConfig->id = mId;
- dstConfig->role = AUDIO_PORT_ROLE_SINK;
- dstConfig->type = AUDIO_PORT_TYPE_MIX;
- dstConfig->ext.mix.hw_module = mProfile->mModule->mHandle;
- dstConfig->ext.mix.handle = mIoHandle;
- dstConfig->ext.mix.usecase.source = mInputSource;
-}
-
-void AudioPolicyManager::AudioInputDescriptor::toAudioPort(
- struct audio_port *port) const
-{
- ALOG_ASSERT(mProfile != 0, "toAudioPort() called on input with null profile %d", mIoHandle);
-
- mProfile->toAudioPort(port);
- port->id = mId;
- toAudioPortConfig(&port->active_config);
- port->ext.mix.hw_module = mProfile->mModule->mHandle;
- port->ext.mix.handle = mIoHandle;
- port->ext.mix.latency_class = AUDIO_LATENCY_NORMAL;
-}
-
-status_t AudioPolicyManager::AudioInputDescriptor::dump(int fd)
-{
- const size_t SIZE = 256;
- char buffer[SIZE];
- String8 result;
-
- snprintf(buffer, SIZE, " ID: %d\n", mId);
- result.append(buffer);
- snprintf(buffer, SIZE, " Sampling rate: %d\n", mSamplingRate);
- result.append(buffer);
- snprintf(buffer, SIZE, " Format: %d\n", mFormat);
- result.append(buffer);
- snprintf(buffer, SIZE, " Channels: %08x\n", mChannelMask);
- result.append(buffer);
- snprintf(buffer, SIZE, " Devices %08x\n", mDevice);
- result.append(buffer);
- snprintf(buffer, SIZE, " Ref Count %d\n", mRefCount);
- result.append(buffer);
- snprintf(buffer, SIZE, " Open Ref Count %d\n", mOpenRefCount);
- result.append(buffer);
-
- write(fd, result.string(), result.size());
-
- return NO_ERROR;
-}
-
-// --- StreamDescriptor class implementation
-
-AudioPolicyManager::StreamDescriptor::StreamDescriptor()
- : mIndexMin(0), mIndexMax(1), mCanBeMuted(true)
-{
- mIndexCur.add(AUDIO_DEVICE_OUT_DEFAULT, 0);
-}
-
-int AudioPolicyManager::StreamDescriptor::getVolumeIndex(audio_devices_t device)
-{
- device = AudioPolicyManager::getDeviceForVolume(device);
- // there is always a valid entry for AUDIO_DEVICE_OUT_DEFAULT
- if (mIndexCur.indexOfKey(device) < 0) {
- device = AUDIO_DEVICE_OUT_DEFAULT;
- }
- return mIndexCur.valueFor(device);
-}
-
-void AudioPolicyManager::StreamDescriptor::dump(int fd)
-{
- const size_t SIZE = 256;
- char buffer[SIZE];
- String8 result;
-
- snprintf(buffer, SIZE, "%s %02d %02d ",
- mCanBeMuted ? "true " : "false", mIndexMin, mIndexMax);
- result.append(buffer);
- for (size_t i = 0; i < mIndexCur.size(); i++) {
- snprintf(buffer, SIZE, "%04x : %02d, ",
- mIndexCur.keyAt(i),
- mIndexCur.valueAt(i));
- result.append(buffer);
- }
- result.append("\n");
-
- write(fd, result.string(), result.size());
-}
-
-// --- EffectDescriptor class implementation
-
-status_t AudioPolicyManager::EffectDescriptor::dump(int fd)
-{
- const size_t SIZE = 256;
- char buffer[SIZE];
- String8 result;
-
- snprintf(buffer, SIZE, " I/O: %d\n", mIo);
- result.append(buffer);
- snprintf(buffer, SIZE, " Strategy: %d\n", mStrategy);
- result.append(buffer);
- snprintf(buffer, SIZE, " Session: %d\n", mSession);
- result.append(buffer);
- snprintf(buffer, SIZE, " Name: %s\n", mDesc.name);
- result.append(buffer);
- snprintf(buffer, SIZE, " %s\n", mEnabled ? "Enabled" : "Disabled");
- result.append(buffer);
- write(fd, result.string(), result.size());
-
- return NO_ERROR;
-}
-
-// --- HwModule class implementation
-
-AudioPolicyManager::HwModule::HwModule(const char *name)
- : mName(strndup(name, AUDIO_HARDWARE_MODULE_ID_MAX_LEN)),
- mHalVersion(AUDIO_DEVICE_API_VERSION_MIN), mHandle(0)
-{
-}
-
-AudioPolicyManager::HwModule::~HwModule()
-{
- for (size_t i = 0; i < mOutputProfiles.size(); i++) {
- mOutputProfiles[i]->mSupportedDevices.clear();
- }
- for (size_t i = 0; i < mInputProfiles.size(); i++) {
- mInputProfiles[i]->mSupportedDevices.clear();
- }
- free((void *)mName);
-}
-
-status_t AudioPolicyManager::HwModule::loadInput(cnode *root)
-{
- cnode *node = root->first_child;
-
- sp<IOProfile> profile = new IOProfile(String8(root->name), AUDIO_PORT_ROLE_SINK, this);
-
- while (node) {
- if (strcmp(node->name, SAMPLING_RATES_TAG) == 0) {
- profile->loadSamplingRates((char *)node->value);
- } else if (strcmp(node->name, FORMATS_TAG) == 0) {
- profile->loadFormats((char *)node->value);
- } else if (strcmp(node->name, CHANNELS_TAG) == 0) {
- profile->loadInChannels((char *)node->value);
- } else if (strcmp(node->name, DEVICES_TAG) == 0) {
- profile->mSupportedDevices.loadDevicesFromName((char *)node->value,
- mDeclaredDevices);
- } else if (strcmp(node->name, FLAGS_TAG) == 0) {
- profile->mFlags = parseInputFlagNames((char *)node->value);
- } else if (strcmp(node->name, GAINS_TAG) == 0) {
- profile->loadGains(node);
- }
- node = node->next;
- }
- ALOGW_IF(profile->mSupportedDevices.isEmpty(),
- "loadInput() invalid supported devices");
- ALOGW_IF(profile->mChannelMasks.size() == 0,
- "loadInput() invalid supported channel masks");
- ALOGW_IF(profile->mSamplingRates.size() == 0,
- "loadInput() invalid supported sampling rates");
- ALOGW_IF(profile->mFormats.size() == 0,
- "loadInput() invalid supported formats");
- if (!profile->mSupportedDevices.isEmpty() &&
- (profile->mChannelMasks.size() != 0) &&
- (profile->mSamplingRates.size() != 0) &&
- (profile->mFormats.size() != 0)) {
-
- ALOGV("loadInput() adding input Supported Devices %04x",
- profile->mSupportedDevices.types());
-
- mInputProfiles.add(profile);
- return NO_ERROR;
- } else {
- return BAD_VALUE;
- }
-}
-
-status_t AudioPolicyManager::HwModule::loadOutput(cnode *root)
-{
- cnode *node = root->first_child;
-
- sp<IOProfile> profile = new IOProfile(String8(root->name), AUDIO_PORT_ROLE_SOURCE, this);
-
- while (node) {
- if (strcmp(node->name, SAMPLING_RATES_TAG) == 0) {
- profile->loadSamplingRates((char *)node->value);
- } else if (strcmp(node->name, FORMATS_TAG) == 0) {
- profile->loadFormats((char *)node->value);
- } else if (strcmp(node->name, CHANNELS_TAG) == 0) {
- profile->loadOutChannels((char *)node->value);
- } else if (strcmp(node->name, DEVICES_TAG) == 0) {
- profile->mSupportedDevices.loadDevicesFromName((char *)node->value,
- mDeclaredDevices);
- } else if (strcmp(node->name, FLAGS_TAG) == 0) {
- profile->mFlags = parseOutputFlagNames((char *)node->value);
- } else if (strcmp(node->name, GAINS_TAG) == 0) {
- profile->loadGains(node);
- }
- node = node->next;
- }
- ALOGW_IF(profile->mSupportedDevices.isEmpty(),
- "loadOutput() invalid supported devices");
- ALOGW_IF(profile->mChannelMasks.size() == 0,
- "loadOutput() invalid supported channel masks");
- ALOGW_IF(profile->mSamplingRates.size() == 0,
- "loadOutput() invalid supported sampling rates");
- ALOGW_IF(profile->mFormats.size() == 0,
- "loadOutput() invalid supported formats");
- if (!profile->mSupportedDevices.isEmpty() &&
- (profile->mChannelMasks.size() != 0) &&
- (profile->mSamplingRates.size() != 0) &&
- (profile->mFormats.size() != 0)) {
-
- ALOGV("loadOutput() adding output Supported Devices %04x, mFlags %04x",
- profile->mSupportedDevices.types(), profile->mFlags);
-
- mOutputProfiles.add(profile);
- return NO_ERROR;
- } else {
- return BAD_VALUE;
- }
-}
-
-status_t AudioPolicyManager::HwModule::loadDevice(cnode *root)
-{
- cnode *node = root->first_child;
-
- audio_devices_t type = AUDIO_DEVICE_NONE;
- while (node) {
- if (strcmp(node->name, DEVICE_TYPE) == 0) {
- type = parseDeviceNames((char *)node->value);
- break;
- }
- node = node->next;
- }
- if (type == AUDIO_DEVICE_NONE ||
- (!audio_is_input_device(type) && !audio_is_output_device(type))) {
- ALOGW("loadDevice() bad type %08x", type);
- return BAD_VALUE;
- }
- sp<DeviceDescriptor> deviceDesc = new DeviceDescriptor(String8(root->name), type);
- deviceDesc->mModule = this;
-
- node = root->first_child;
- while (node) {
- if (strcmp(node->name, DEVICE_ADDRESS) == 0) {
- deviceDesc->mAddress = String8((char *)node->value);
- } else if (strcmp(node->name, CHANNELS_TAG) == 0) {
- if (audio_is_input_device(type)) {
- deviceDesc->loadInChannels((char *)node->value);
- } else {
- deviceDesc->loadOutChannels((char *)node->value);
- }
- } else if (strcmp(node->name, GAINS_TAG) == 0) {
- deviceDesc->loadGains(node);
- }
- node = node->next;
- }
-
- ALOGV("loadDevice() adding device name %s type %08x address %s",
- deviceDesc->mName.string(), type, deviceDesc->mAddress.string());
-
- mDeclaredDevices.add(deviceDesc);
-
- return NO_ERROR;
-}
-
-status_t AudioPolicyManager::HwModule::addOutputProfile(String8 name, const audio_config_t *config,
- audio_devices_t device, String8 address)
-{
- sp<IOProfile> profile = new IOProfile(name, AUDIO_PORT_ROLE_SOURCE, this);
-
- profile->mSamplingRates.add(config->sample_rate);
- profile->mChannelMasks.add(config->channel_mask);
- profile->mFormats.add(config->format);
-
- sp<DeviceDescriptor> devDesc = new DeviceDescriptor(String8(""), device);
- devDesc->mAddress = address;
- profile->mSupportedDevices.add(devDesc);
-
- mOutputProfiles.add(profile);
-
- return NO_ERROR;
-}
-
-status_t AudioPolicyManager::HwModule::removeOutputProfile(String8 name)
-{
- for (size_t i = 0; i < mOutputProfiles.size(); i++) {
- if (mOutputProfiles[i]->mName == name) {
- mOutputProfiles.removeAt(i);
- break;
- }
- }
-
- return NO_ERROR;
-}
-
-status_t AudioPolicyManager::HwModule::addInputProfile(String8 name, const audio_config_t *config,
- audio_devices_t device, String8 address)
-{
- sp<IOProfile> profile = new IOProfile(name, AUDIO_PORT_ROLE_SINK, this);
-
- profile->mSamplingRates.add(config->sample_rate);
- profile->mChannelMasks.add(config->channel_mask);
- profile->mFormats.add(config->format);
-
- sp<DeviceDescriptor> devDesc = new DeviceDescriptor(String8(""), device);
- devDesc->mAddress = address;
- profile->mSupportedDevices.add(devDesc);
-
- ALOGV("addInputProfile() name %s rate %d mask 0x08", name.string(), config->sample_rate, config->channel_mask);
-
- mInputProfiles.add(profile);
-
- return NO_ERROR;
-}
-
-status_t AudioPolicyManager::HwModule::removeInputProfile(String8 name)
-{
- for (size_t i = 0; i < mInputProfiles.size(); i++) {
- if (mInputProfiles[i]->mName == name) {
- mInputProfiles.removeAt(i);
- break;
- }
- }
-
- return NO_ERROR;
-}
-
-
-void AudioPolicyManager::HwModule::dump(int fd)
-{
- const size_t SIZE = 256;
- char buffer[SIZE];
- String8 result;
-
- snprintf(buffer, SIZE, " - name: %s\n", mName);
- result.append(buffer);
- snprintf(buffer, SIZE, " - handle: %d\n", mHandle);
- result.append(buffer);
- snprintf(buffer, SIZE, " - version: %u.%u\n", mHalVersion >> 8, mHalVersion & 0xFF);
- result.append(buffer);
- write(fd, result.string(), result.size());
- if (mOutputProfiles.size()) {
- write(fd, " - outputs:\n", strlen(" - outputs:\n"));
- for (size_t i = 0; i < mOutputProfiles.size(); i++) {
- snprintf(buffer, SIZE, " output %zu:\n", i);
- write(fd, buffer, strlen(buffer));
- mOutputProfiles[i]->dump(fd);
- }
- }
- if (mInputProfiles.size()) {
- write(fd, " - inputs:\n", strlen(" - inputs:\n"));
- for (size_t i = 0; i < mInputProfiles.size(); i++) {
- snprintf(buffer, SIZE, " input %zu:\n", i);
- write(fd, buffer, strlen(buffer));
- mInputProfiles[i]->dump(fd);
- }
- }
- if (mDeclaredDevices.size()) {
- write(fd, " - devices:\n", strlen(" - devices:\n"));
- for (size_t i = 0; i < mDeclaredDevices.size(); i++) {
- mDeclaredDevices[i]->dump(fd, 4, i);
- }
- }
-}
-
-// --- AudioPort class implementation
-
-
-AudioPolicyManager::AudioPort::AudioPort(const String8& name, audio_port_type_t type,
- audio_port_role_t role, const sp<HwModule>& module) :
- mName(name), mType(type), mRole(role), mModule(module), mFlags(0)
-{
- mUseInChannelMask = ((type == AUDIO_PORT_TYPE_DEVICE) && (role == AUDIO_PORT_ROLE_SOURCE)) ||
- ((type == AUDIO_PORT_TYPE_MIX) && (role == AUDIO_PORT_ROLE_SINK));
-}
-
-void AudioPolicyManager::AudioPort::toAudioPort(struct audio_port *port) const
-{
- port->role = mRole;
- port->type = mType;
- unsigned int i;
- for (i = 0; i < mSamplingRates.size() && i < AUDIO_PORT_MAX_SAMPLING_RATES; i++) {
- if (mSamplingRates[i] != 0) {
- port->sample_rates[i] = mSamplingRates[i];
- }
- }
- port->num_sample_rates = i;
- for (i = 0; i < mChannelMasks.size() && i < AUDIO_PORT_MAX_CHANNEL_MASKS; i++) {
- if (mChannelMasks[i] != 0) {
- port->channel_masks[i] = mChannelMasks[i];
- }
- }
- port->num_channel_masks = i;
- for (i = 0; i < mFormats.size() && i < AUDIO_PORT_MAX_FORMATS; i++) {
- if (mFormats[i] != 0) {
- port->formats[i] = mFormats[i];
- }
- }
- port->num_formats = i;
-
- ALOGV("AudioPort::toAudioPort() num gains %zu", mGains.size());
-
- for (i = 0; i < mGains.size() && i < AUDIO_PORT_MAX_GAINS; i++) {
- port->gains[i] = mGains[i]->mGain;
- }
- port->num_gains = i;
-}
-
-void AudioPolicyManager::AudioPort::importAudioPort(const sp<AudioPort> port) {
- for (size_t k = 0 ; k < port->mSamplingRates.size() ; k++) {
- const uint32_t rate = port->mSamplingRates.itemAt(k);
- if (rate != 0) { // skip "dynamic" rates
- bool hasRate = false;
- for (size_t l = 0 ; l < mSamplingRates.size() ; l++) {
- if (rate == mSamplingRates.itemAt(l)) {
- hasRate = true;
- break;
- }
- }
- if (!hasRate) { // never import a sampling rate twice
- mSamplingRates.add(rate);
- }
- }
- }
- for (size_t k = 0 ; k < port->mChannelMasks.size() ; k++) {
- const audio_channel_mask_t mask = port->mChannelMasks.itemAt(k);
- if (mask != 0) { // skip "dynamic" masks
- bool hasMask = false;
- for (size_t l = 0 ; l < mChannelMasks.size() ; l++) {
- if (mask == mChannelMasks.itemAt(l)) {
- hasMask = true;
- break;
- }
- }
- if (!hasMask) { // never import a channel mask twice
- mChannelMasks.add(mask);
- }
- }
- }
- for (size_t k = 0 ; k < port->mFormats.size() ; k++) {
- const audio_format_t format = port->mFormats.itemAt(k);
- if (format != 0) { // skip "dynamic" formats
- bool hasFormat = false;
- for (size_t l = 0 ; l < mFormats.size() ; l++) {
- if (format == mFormats.itemAt(l)) {
- hasFormat = true;
- break;
- }
- }
- if (!hasFormat) { // never import a channel mask twice
- mFormats.add(format);
- }
- }
- }
- for (size_t k = 0 ; k < port->mGains.size() ; k++) {
- sp<AudioGain> gain = port->mGains.itemAt(k);
- if (gain != 0) {
- bool hasGain = false;
- for (size_t l = 0 ; l < mGains.size() ; l++) {
- if (gain == mGains.itemAt(l)) {
- hasGain = true;
- break;
- }
- }
- if (!hasGain) { // never import a gain twice
- mGains.add(gain);
- }
- }
- }
-}
-
-void AudioPolicyManager::AudioPort::clearCapabilities() {
- mChannelMasks.clear();
- mFormats.clear();
- mSamplingRates.clear();
- mGains.clear();
-}
-
-void AudioPolicyManager::AudioPort::loadSamplingRates(char *name)
-{
- char *str = strtok(name, "|");
-
- // by convention, "0' in the first entry in mSamplingRates indicates the supported sampling
- // rates should be read from the output stream after it is opened for the first time
- if (str != NULL && strcmp(str, DYNAMIC_VALUE_TAG) == 0) {
- mSamplingRates.add(0);
- return;
- }
-
- while (str != NULL) {
- uint32_t rate = atoi(str);
- if (rate != 0) {
- ALOGV("loadSamplingRates() adding rate %d", rate);
- mSamplingRates.add(rate);
- }
- str = strtok(NULL, "|");
- }
-}
-
-void AudioPolicyManager::AudioPort::loadFormats(char *name)
-{
- char *str = strtok(name, "|");
-
- // by convention, "0' in the first entry in mFormats indicates the supported formats
- // should be read from the output stream after it is opened for the first time
- if (str != NULL && strcmp(str, DYNAMIC_VALUE_TAG) == 0) {
- mFormats.add(AUDIO_FORMAT_DEFAULT);
- return;
- }
-
- while (str != NULL) {
- audio_format_t format = (audio_format_t)stringToEnum(sFormatNameToEnumTable,
- ARRAY_SIZE(sFormatNameToEnumTable),
- str);
- if (format != AUDIO_FORMAT_DEFAULT) {
- mFormats.add(format);
- }
- str = strtok(NULL, "|");
- }
-}
-
-void AudioPolicyManager::AudioPort::loadInChannels(char *name)
-{
- const char *str = strtok(name, "|");
-
- ALOGV("loadInChannels() %s", name);
-
- if (str != NULL && strcmp(str, DYNAMIC_VALUE_TAG) == 0) {
- mChannelMasks.add(0);
- return;
- }
-
- while (str != NULL) {
- audio_channel_mask_t channelMask =
- (audio_channel_mask_t)stringToEnum(sInChannelsNameToEnumTable,
- ARRAY_SIZE(sInChannelsNameToEnumTable),
- str);
- if (channelMask != 0) {
- ALOGV("loadInChannels() adding channelMask %04x", channelMask);
- mChannelMasks.add(channelMask);
- }
- str = strtok(NULL, "|");
- }
-}
-
-void AudioPolicyManager::AudioPort::loadOutChannels(char *name)
-{
- const char *str = strtok(name, "|");
-
- ALOGV("loadOutChannels() %s", name);
-
- // by convention, "0' in the first entry in mChannelMasks indicates the supported channel
- // masks should be read from the output stream after it is opened for the first time
- if (str != NULL && strcmp(str, DYNAMIC_VALUE_TAG) == 0) {
- mChannelMasks.add(0);
- return;
- }
-
- while (str != NULL) {
- audio_channel_mask_t channelMask =
- (audio_channel_mask_t)stringToEnum(sOutChannelsNameToEnumTable,
- ARRAY_SIZE(sOutChannelsNameToEnumTable),
- str);
- if (channelMask != 0) {
- mChannelMasks.add(channelMask);
- }
- str = strtok(NULL, "|");
- }
- return;
-}
-
-audio_gain_mode_t AudioPolicyManager::AudioPort::loadGainMode(char *name)
-{
- const char *str = strtok(name, "|");
-
- ALOGV("loadGainMode() %s", name);
- audio_gain_mode_t mode = 0;
- while (str != NULL) {
- mode |= (audio_gain_mode_t)stringToEnum(sGainModeNameToEnumTable,
- ARRAY_SIZE(sGainModeNameToEnumTable),
- str);
- str = strtok(NULL, "|");
- }
- return mode;
-}
-
-void AudioPolicyManager::AudioPort::loadGain(cnode *root, int index)
-{
- cnode *node = root->first_child;
-
- sp<AudioGain> gain = new AudioGain(index, mUseInChannelMask);
-
- while (node) {
- if (strcmp(node->name, GAIN_MODE) == 0) {
- gain->mGain.mode = loadGainMode((char *)node->value);
- } else if (strcmp(node->name, GAIN_CHANNELS) == 0) {
- if (mUseInChannelMask) {
- gain->mGain.channel_mask =
- (audio_channel_mask_t)stringToEnum(sInChannelsNameToEnumTable,
- ARRAY_SIZE(sInChannelsNameToEnumTable),
- (char *)node->value);
- } else {
- gain->mGain.channel_mask =
- (audio_channel_mask_t)stringToEnum(sOutChannelsNameToEnumTable,
- ARRAY_SIZE(sOutChannelsNameToEnumTable),
- (char *)node->value);
- }
- } else if (strcmp(node->name, GAIN_MIN_VALUE) == 0) {
- gain->mGain.min_value = atoi((char *)node->value);
- } else if (strcmp(node->name, GAIN_MAX_VALUE) == 0) {
- gain->mGain.max_value = atoi((char *)node->value);
- } else if (strcmp(node->name, GAIN_DEFAULT_VALUE) == 0) {
- gain->mGain.default_value = atoi((char *)node->value);
- } else if (strcmp(node->name, GAIN_STEP_VALUE) == 0) {
- gain->mGain.step_value = atoi((char *)node->value);
- } else if (strcmp(node->name, GAIN_MIN_RAMP_MS) == 0) {
- gain->mGain.min_ramp_ms = atoi((char *)node->value);
- } else if (strcmp(node->name, GAIN_MAX_RAMP_MS) == 0) {
- gain->mGain.max_ramp_ms = atoi((char *)node->value);
- }
- node = node->next;
- }
-
- ALOGV("loadGain() adding new gain mode %08x channel mask %08x min mB %d max mB %d",
- gain->mGain.mode, gain->mGain.channel_mask, gain->mGain.min_value, gain->mGain.max_value);
-
- if (gain->mGain.mode == 0) {
- return;
- }
- mGains.add(gain);
-}
-
-void AudioPolicyManager::AudioPort::loadGains(cnode *root)
-{
- cnode *node = root->first_child;
- int index = 0;
- while (node) {
- ALOGV("loadGains() loading gain %s", node->name);
- loadGain(node, index++);
- node = node->next;
- }
-}
-
-status_t AudioPolicyManager::AudioPort::checkExactSamplingRate(uint32_t samplingRate) const
-{
- if (mSamplingRates.isEmpty()) {
- return NO_ERROR;
- }
-
- for (size_t i = 0; i < mSamplingRates.size(); i ++) {
- if (mSamplingRates[i] == samplingRate) {
- return NO_ERROR;
- }
- }
- return BAD_VALUE;
-}
-
-status_t AudioPolicyManager::AudioPort::checkCompatibleSamplingRate(uint32_t samplingRate,
- uint32_t *updatedSamplingRate) const
-{
- if (mSamplingRates.isEmpty()) {
- return NO_ERROR;
- }
-
- // Search for the closest supported sampling rate that is above (preferred)
- // or below (acceptable) the desired sampling rate, within a permitted ratio.
- // The sampling rates do not need to be sorted in ascending order.
- ssize_t maxBelow = -1;
- ssize_t minAbove = -1;
- uint32_t candidate;
- for (size_t i = 0; i < mSamplingRates.size(); i++) {
- candidate = mSamplingRates[i];
- if (candidate == samplingRate) {
- if (updatedSamplingRate != NULL) {
- *updatedSamplingRate = candidate;
- }
- return NO_ERROR;
- }
- // candidate < desired
- if (candidate < samplingRate) {
- if (maxBelow < 0 || candidate > mSamplingRates[maxBelow]) {
- maxBelow = i;
- }
- // candidate > desired
- } else {
- if (minAbove < 0 || candidate < mSamplingRates[minAbove]) {
- minAbove = i;
- }
- }
- }
- // This uses hard-coded knowledge about AudioFlinger resampling ratios.
- // TODO Move these assumptions out.
- static const uint32_t kMaxDownSampleRatio = 6; // beyond this aliasing occurs
- static const uint32_t kMaxUpSampleRatio = 256; // beyond this sample rate inaccuracies occur
- // due to approximation by an int32_t of the
- // phase increments
- // Prefer to down-sample from a higher sampling rate, as we get the desired frequency spectrum.
- if (minAbove >= 0) {
- candidate = mSamplingRates[minAbove];
- if (candidate / kMaxDownSampleRatio <= samplingRate) {
- if (updatedSamplingRate != NULL) {
- *updatedSamplingRate = candidate;
- }
- return NO_ERROR;
- }
- }
- // But if we have to up-sample from a lower sampling rate, that's OK.
- if (maxBelow >= 0) {
- candidate = mSamplingRates[maxBelow];
- if (candidate * kMaxUpSampleRatio >= samplingRate) {
- if (updatedSamplingRate != NULL) {
- *updatedSamplingRate = candidate;
- }
- return NO_ERROR;
- }
- }
- // leave updatedSamplingRate unmodified
- return BAD_VALUE;
-}
-
-status_t AudioPolicyManager::AudioPort::checkExactChannelMask(audio_channel_mask_t channelMask) const
-{
- if (mChannelMasks.isEmpty()) {
- return NO_ERROR;
- }
-
- for (size_t i = 0; i < mChannelMasks.size(); i++) {
- if (mChannelMasks[i] == channelMask) {
- return NO_ERROR;
- }
- }
- return BAD_VALUE;
-}
-
-status_t AudioPolicyManager::AudioPort::checkCompatibleChannelMask(audio_channel_mask_t channelMask)
- const
-{
- if (mChannelMasks.isEmpty()) {
- return NO_ERROR;
- }
-
- const bool isRecordThread = mType == AUDIO_PORT_TYPE_MIX && mRole == AUDIO_PORT_ROLE_SINK;
- for (size_t i = 0; i < mChannelMasks.size(); i ++) {
- // FIXME Does not handle multi-channel automatic conversions yet
- audio_channel_mask_t supported = mChannelMasks[i];
- if (supported == channelMask) {
- return NO_ERROR;
- }
- if (isRecordThread) {
- // This uses hard-coded knowledge that AudioFlinger can silently down-mix and up-mix.
- // FIXME Abstract this out to a table.
- if (((supported == AUDIO_CHANNEL_IN_FRONT_BACK || supported == AUDIO_CHANNEL_IN_STEREO)
- && channelMask == AUDIO_CHANNEL_IN_MONO) ||
- (supported == AUDIO_CHANNEL_IN_MONO && (channelMask == AUDIO_CHANNEL_IN_FRONT_BACK
- || channelMask == AUDIO_CHANNEL_IN_STEREO))) {
- return NO_ERROR;
- }
- }
- }
- return BAD_VALUE;
-}
-
-status_t AudioPolicyManager::AudioPort::checkFormat(audio_format_t format) const
-{
- if (mFormats.isEmpty()) {
- return NO_ERROR;
- }
-
- for (size_t i = 0; i < mFormats.size(); i ++) {
- if (mFormats[i] == format) {
- return NO_ERROR;
- }
- }
- return BAD_VALUE;
-}
-
-
-uint32_t AudioPolicyManager::AudioPort::pickSamplingRate() const
-{
- // special case for uninitialized dynamic profile
- if (mSamplingRates.size() == 1 && mSamplingRates[0] == 0) {
- return 0;
- }
-
- // For direct outputs, pick minimum sampling rate: this helps ensuring that the
- // channel count / sampling rate combination chosen will be supported by the connected
- // sink
- if ((mType == AUDIO_PORT_TYPE_MIX) && (mRole == AUDIO_PORT_ROLE_SOURCE) &&
- (mFlags & (AUDIO_OUTPUT_FLAG_DIRECT | AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD))) {
- uint32_t samplingRate = UINT_MAX;
- for (size_t i = 0; i < mSamplingRates.size(); i ++) {
- if ((mSamplingRates[i] < samplingRate) && (mSamplingRates[i] > 0)) {
- samplingRate = mSamplingRates[i];
- }
- }
- return (samplingRate == UINT_MAX) ? 0 : samplingRate;
- }
-
- uint32_t samplingRate = 0;
- uint32_t maxRate = MAX_MIXER_SAMPLING_RATE;
-
- // For mixed output and inputs, use max mixer sampling rates. Do not
- // limit sampling rate otherwise
- if (mType != AUDIO_PORT_TYPE_MIX) {
- maxRate = UINT_MAX;
- }
- for (size_t i = 0; i < mSamplingRates.size(); i ++) {
- if ((mSamplingRates[i] > samplingRate) && (mSamplingRates[i] <= maxRate)) {
- samplingRate = mSamplingRates[i];
- }
- }
- return samplingRate;
-}
-
-audio_channel_mask_t AudioPolicyManager::AudioPort::pickChannelMask() const
-{
- // special case for uninitialized dynamic profile
- if (mChannelMasks.size() == 1 && mChannelMasks[0] == 0) {
- return AUDIO_CHANNEL_NONE;
- }
- audio_channel_mask_t channelMask = AUDIO_CHANNEL_NONE;
-
- // For direct outputs, pick minimum channel count: this helps ensuring that the
- // channel count / sampling rate combination chosen will be supported by the connected
- // sink
- if ((mType == AUDIO_PORT_TYPE_MIX) && (mRole == AUDIO_PORT_ROLE_SOURCE) &&
- (mFlags & (AUDIO_OUTPUT_FLAG_DIRECT | AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD))) {
- uint32_t channelCount = UINT_MAX;
- for (size_t i = 0; i < mChannelMasks.size(); i ++) {
- uint32_t cnlCount;
- if (mUseInChannelMask) {
- cnlCount = audio_channel_count_from_in_mask(mChannelMasks[i]);
- } else {
- cnlCount = audio_channel_count_from_out_mask(mChannelMasks[i]);
- }
- if ((cnlCount < channelCount) && (cnlCount > 0)) {
- channelMask = mChannelMasks[i];
- channelCount = cnlCount;
- }
- }
- return channelMask;
- }
-
- uint32_t channelCount = 0;
- uint32_t maxCount = MAX_MIXER_CHANNEL_COUNT;
-
- // For mixed output and inputs, use max mixer channel count. Do not
- // limit channel count otherwise
- if (mType != AUDIO_PORT_TYPE_MIX) {
- maxCount = UINT_MAX;
- }
- for (size_t i = 0; i < mChannelMasks.size(); i ++) {
- uint32_t cnlCount;
- if (mUseInChannelMask) {
- cnlCount = audio_channel_count_from_in_mask(mChannelMasks[i]);
- } else {
- cnlCount = audio_channel_count_from_out_mask(mChannelMasks[i]);
- }
- if ((cnlCount > channelCount) && (cnlCount <= maxCount)) {
- channelMask = mChannelMasks[i];
- channelCount = cnlCount;
- }
- }
- return channelMask;
-}
-
-/* format in order of increasing preference */
-const audio_format_t AudioPolicyManager::AudioPort::sPcmFormatCompareTable[] = {
- AUDIO_FORMAT_DEFAULT,
- AUDIO_FORMAT_PCM_16_BIT,
- AUDIO_FORMAT_PCM_8_24_BIT,
- AUDIO_FORMAT_PCM_24_BIT_PACKED,
- AUDIO_FORMAT_PCM_32_BIT,
- AUDIO_FORMAT_PCM_FLOAT,
-};
-
-int AudioPolicyManager::AudioPort::compareFormats(audio_format_t format1,
- audio_format_t format2)
-{
- // NOTE: AUDIO_FORMAT_INVALID is also considered not PCM and will be compared equal to any
- // compressed format and better than any PCM format. This is by design of pickFormat()
- if (!audio_is_linear_pcm(format1)) {
- if (!audio_is_linear_pcm(format2)) {
- return 0;
- }
- return 1;
- }
- if (!audio_is_linear_pcm(format2)) {
- return -1;
- }
-
- int index1 = -1, index2 = -1;
- for (size_t i = 0;
- (i < ARRAY_SIZE(sPcmFormatCompareTable)) && ((index1 == -1) || (index2 == -1));
- i ++) {
- if (sPcmFormatCompareTable[i] == format1) {
- index1 = i;
- }
- if (sPcmFormatCompareTable[i] == format2) {
- index2 = i;
- }
- }
- // format1 not found => index1 < 0 => format2 > format1
- // format2 not found => index2 < 0 => format2 < format1
- return index1 - index2;
-}
-
-audio_format_t AudioPolicyManager::AudioPort::pickFormat() const
-{
- // special case for uninitialized dynamic profile
- if (mFormats.size() == 1 && mFormats[0] == 0) {
- return AUDIO_FORMAT_DEFAULT;
- }
-
- audio_format_t format = AUDIO_FORMAT_DEFAULT;
- audio_format_t bestFormat =
- AudioPolicyManager::AudioPort::sPcmFormatCompareTable[
- ARRAY_SIZE(AudioPolicyManager::AudioPort::sPcmFormatCompareTable) - 1];
- // For mixed output and inputs, use best mixer output format. Do not
- // limit format otherwise
- if ((mType != AUDIO_PORT_TYPE_MIX) ||
- ((mRole == AUDIO_PORT_ROLE_SOURCE) &&
- (((mFlags & (AUDIO_OUTPUT_FLAG_DIRECT | AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD)) != 0)))) {
- bestFormat = AUDIO_FORMAT_INVALID;
- }
-
- for (size_t i = 0; i < mFormats.size(); i ++) {
- if ((compareFormats(mFormats[i], format) > 0) &&
- (compareFormats(mFormats[i], bestFormat) <= 0)) {
- format = mFormats[i];
- }
- }
- return format;
-}
-
-status_t AudioPolicyManager::AudioPort::checkGain(const struct audio_gain_config *gainConfig,
- int index) const
-{
- if (index < 0 || (size_t)index >= mGains.size()) {
- return BAD_VALUE;
- }
- return mGains[index]->checkConfig(gainConfig);
-}
-
-void AudioPolicyManager::AudioPort::dump(int fd, int spaces) const
-{
- const size_t SIZE = 256;
- char buffer[SIZE];
- String8 result;
-
- if (mName.size() != 0) {
- snprintf(buffer, SIZE, "%*s- name: %s\n", spaces, "", mName.string());
- result.append(buffer);
- }
-
- if (mSamplingRates.size() != 0) {
- snprintf(buffer, SIZE, "%*s- sampling rates: ", spaces, "");
- result.append(buffer);
- for (size_t i = 0; i < mSamplingRates.size(); i++) {
- if (i == 0 && mSamplingRates[i] == 0) {
- snprintf(buffer, SIZE, "Dynamic");
- } else {
- snprintf(buffer, SIZE, "%d", mSamplingRates[i]);
- }
- result.append(buffer);
- result.append(i == (mSamplingRates.size() - 1) ? "" : ", ");
- }
- result.append("\n");
- }
-
- if (mChannelMasks.size() != 0) {
- snprintf(buffer, SIZE, "%*s- channel masks: ", spaces, "");
- result.append(buffer);
- for (size_t i = 0; i < mChannelMasks.size(); i++) {
- ALOGV("AudioPort::dump mChannelMasks %zu %08x", i, mChannelMasks[i]);
-
- if (i == 0 && mChannelMasks[i] == 0) {
- snprintf(buffer, SIZE, "Dynamic");
- } else {
- snprintf(buffer, SIZE, "0x%04x", mChannelMasks[i]);
- }
- result.append(buffer);
- result.append(i == (mChannelMasks.size() - 1) ? "" : ", ");
- }
- result.append("\n");
- }
-
- if (mFormats.size() != 0) {
- snprintf(buffer, SIZE, "%*s- formats: ", spaces, "");
- result.append(buffer);
- for (size_t i = 0; i < mFormats.size(); i++) {
- const char *formatStr = enumToString(sFormatNameToEnumTable,
- ARRAY_SIZE(sFormatNameToEnumTable),
- mFormats[i]);
- if (i == 0 && strcmp(formatStr, "") == 0) {
- snprintf(buffer, SIZE, "Dynamic");
- } else {
- snprintf(buffer, SIZE, "%s", formatStr);
- }
- result.append(buffer);
- result.append(i == (mFormats.size() - 1) ? "" : ", ");
- }
- result.append("\n");
- }
- write(fd, result.string(), result.size());
- if (mGains.size() != 0) {
- snprintf(buffer, SIZE, "%*s- gains:\n", spaces, "");
- write(fd, buffer, strlen(buffer) + 1);
- result.append(buffer);
- for (size_t i = 0; i < mGains.size(); i++) {
- mGains[i]->dump(fd, spaces + 2, i);
- }
- }
-}
-
-// --- AudioGain class implementation
-
-AudioPolicyManager::AudioGain::AudioGain(int index, bool useInChannelMask)
-{
- mIndex = index;
- mUseInChannelMask = useInChannelMask;
- memset(&mGain, 0, sizeof(struct audio_gain));
-}
-
-void AudioPolicyManager::AudioGain::getDefaultConfig(struct audio_gain_config *config)
-{
- config->index = mIndex;
- config->mode = mGain.mode;
- config->channel_mask = mGain.channel_mask;
- if ((mGain.mode & AUDIO_GAIN_MODE_JOINT) == AUDIO_GAIN_MODE_JOINT) {
- config->values[0] = mGain.default_value;
- } else {
- uint32_t numValues;
- if (mUseInChannelMask) {
- numValues = audio_channel_count_from_in_mask(mGain.channel_mask);
- } else {
- numValues = audio_channel_count_from_out_mask(mGain.channel_mask);
- }
- for (size_t i = 0; i < numValues; i++) {
- config->values[i] = mGain.default_value;
- }
- }
- if ((mGain.mode & AUDIO_GAIN_MODE_RAMP) == AUDIO_GAIN_MODE_RAMP) {
- config->ramp_duration_ms = mGain.min_ramp_ms;
- }
-}
-
-status_t AudioPolicyManager::AudioGain::checkConfig(const struct audio_gain_config *config)
-{
- if ((config->mode & ~mGain.mode) != 0) {
- return BAD_VALUE;
- }
- if ((config->mode & AUDIO_GAIN_MODE_JOINT) == AUDIO_GAIN_MODE_JOINT) {
- if ((config->values[0] < mGain.min_value) ||
- (config->values[0] > mGain.max_value)) {
- return BAD_VALUE;
- }
- } else {
- if ((config->channel_mask & ~mGain.channel_mask) != 0) {
- return BAD_VALUE;
- }
- uint32_t numValues;
- if (mUseInChannelMask) {
- numValues = audio_channel_count_from_in_mask(config->channel_mask);
- } else {
- numValues = audio_channel_count_from_out_mask(config->channel_mask);
- }
- for (size_t i = 0; i < numValues; i++) {
- if ((config->values[i] < mGain.min_value) ||
- (config->values[i] > mGain.max_value)) {
- return BAD_VALUE;
- }
- }
- }
- if ((config->mode & AUDIO_GAIN_MODE_RAMP) == AUDIO_GAIN_MODE_RAMP) {
- if ((config->ramp_duration_ms < mGain.min_ramp_ms) ||
- (config->ramp_duration_ms > mGain.max_ramp_ms)) {
- return BAD_VALUE;
- }
- }
- return NO_ERROR;
-}
-
-void AudioPolicyManager::AudioGain::dump(int fd, int spaces, int index) const
-{
- const size_t SIZE = 256;
- char buffer[SIZE];
- String8 result;
-
- snprintf(buffer, SIZE, "%*sGain %d:\n", spaces, "", index+1);
- result.append(buffer);
- snprintf(buffer, SIZE, "%*s- mode: %08x\n", spaces, "", mGain.mode);
- result.append(buffer);
- snprintf(buffer, SIZE, "%*s- channel_mask: %08x\n", spaces, "", mGain.channel_mask);
- result.append(buffer);
- snprintf(buffer, SIZE, "%*s- min_value: %d mB\n", spaces, "", mGain.min_value);
- result.append(buffer);
- snprintf(buffer, SIZE, "%*s- max_value: %d mB\n", spaces, "", mGain.max_value);
- result.append(buffer);
- snprintf(buffer, SIZE, "%*s- default_value: %d mB\n", spaces, "", mGain.default_value);
- result.append(buffer);
- snprintf(buffer, SIZE, "%*s- step_value: %d mB\n", spaces, "", mGain.step_value);
- result.append(buffer);
- snprintf(buffer, SIZE, "%*s- min_ramp_ms: %d ms\n", spaces, "", mGain.min_ramp_ms);
- result.append(buffer);
- snprintf(buffer, SIZE, "%*s- max_ramp_ms: %d ms\n", spaces, "", mGain.max_ramp_ms);
- result.append(buffer);
-
- write(fd, result.string(), result.size());
-}
-
-// --- AudioPortConfig class implementation
-
-AudioPolicyManager::AudioPortConfig::AudioPortConfig()
-{
- mSamplingRate = 0;
- mChannelMask = AUDIO_CHANNEL_NONE;
- mFormat = AUDIO_FORMAT_INVALID;
- mGain.index = -1;
-}
-
-status_t AudioPolicyManager::AudioPortConfig::applyAudioPortConfig(
- const struct audio_port_config *config,
- struct audio_port_config *backupConfig)
-{
- struct audio_port_config localBackupConfig;
- status_t status = NO_ERROR;
-
- localBackupConfig.config_mask = config->config_mask;
- toAudioPortConfig(&localBackupConfig);
-
- sp<AudioPort> audioport = getAudioPort();
- if (audioport == 0) {
- status = NO_INIT;
- goto exit;
- }
- if (config->config_mask & AUDIO_PORT_CONFIG_SAMPLE_RATE) {
- status = audioport->checkExactSamplingRate(config->sample_rate);
- if (status != NO_ERROR) {
- goto exit;
- }
- mSamplingRate = config->sample_rate;
- }
- if (config->config_mask & AUDIO_PORT_CONFIG_CHANNEL_MASK) {
- status = audioport->checkExactChannelMask(config->channel_mask);
- if (status != NO_ERROR) {
- goto exit;
- }
- mChannelMask = config->channel_mask;
- }
- if (config->config_mask & AUDIO_PORT_CONFIG_FORMAT) {
- status = audioport->checkFormat(config->format);
- if (status != NO_ERROR) {
- goto exit;
- }
- mFormat = config->format;
- }
- if (config->config_mask & AUDIO_PORT_CONFIG_GAIN) {
- status = audioport->checkGain(&config->gain, config->gain.index);
- if (status != NO_ERROR) {
- goto exit;
- }
- mGain = config->gain;
- }
-
-exit:
- if (status != NO_ERROR) {
- applyAudioPortConfig(&localBackupConfig);
- }
- if (backupConfig != NULL) {
- *backupConfig = localBackupConfig;
- }
- return status;
-}
-
-void AudioPolicyManager::AudioPortConfig::toAudioPortConfig(
- struct audio_port_config *dstConfig,
- const struct audio_port_config *srcConfig) const
-{
- if (dstConfig->config_mask & AUDIO_PORT_CONFIG_SAMPLE_RATE) {
- dstConfig->sample_rate = mSamplingRate;
- if ((srcConfig != NULL) && (srcConfig->config_mask & AUDIO_PORT_CONFIG_SAMPLE_RATE)) {
- dstConfig->sample_rate = srcConfig->sample_rate;
- }
- } else {
- dstConfig->sample_rate = 0;
- }
- if (dstConfig->config_mask & AUDIO_PORT_CONFIG_CHANNEL_MASK) {
- dstConfig->channel_mask = mChannelMask;
- if ((srcConfig != NULL) && (srcConfig->config_mask & AUDIO_PORT_CONFIG_CHANNEL_MASK)) {
- dstConfig->channel_mask = srcConfig->channel_mask;
- }
- } else {
- dstConfig->channel_mask = AUDIO_CHANNEL_NONE;
- }
- if (dstConfig->config_mask & AUDIO_PORT_CONFIG_FORMAT) {
- dstConfig->format = mFormat;
- if ((srcConfig != NULL) && (srcConfig->config_mask & AUDIO_PORT_CONFIG_FORMAT)) {
- dstConfig->format = srcConfig->format;
- }
- } else {
- dstConfig->format = AUDIO_FORMAT_INVALID;
- }
- if (dstConfig->config_mask & AUDIO_PORT_CONFIG_GAIN) {
- dstConfig->gain = mGain;
- if ((srcConfig != NULL) && (srcConfig->config_mask & AUDIO_PORT_CONFIG_GAIN)) {
- dstConfig->gain = srcConfig->gain;
- }
- } else {
- dstConfig->gain.index = -1;
- }
- if (dstConfig->gain.index != -1) {
- dstConfig->config_mask |= AUDIO_PORT_CONFIG_GAIN;
- } else {
- dstConfig->config_mask &= ~AUDIO_PORT_CONFIG_GAIN;
- }
-}
-
-// --- IOProfile class implementation
-
-AudioPolicyManager::IOProfile::IOProfile(const String8& name, audio_port_role_t role,
- const sp<HwModule>& module)
- : AudioPort(name, AUDIO_PORT_TYPE_MIX, role, module)
-{
-}
-
-AudioPolicyManager::IOProfile::~IOProfile()
-{
-}
-
-// checks if the IO profile is compatible with specified parameters.
-// Sampling rate, format and channel mask must be specified in order to
-// get a valid a match
-bool AudioPolicyManager::IOProfile::isCompatibleProfile(audio_devices_t device,
- String8 address,
- uint32_t samplingRate,
- uint32_t *updatedSamplingRate,
- audio_format_t format,
- audio_channel_mask_t channelMask,
- uint32_t flags) const
-{
- const bool isPlaybackThread = mType == AUDIO_PORT_TYPE_MIX && mRole == AUDIO_PORT_ROLE_SOURCE;
- const bool isRecordThread = mType == AUDIO_PORT_TYPE_MIX && mRole == AUDIO_PORT_ROLE_SINK;
- ALOG_ASSERT(isPlaybackThread != isRecordThread);
-
- if (device != AUDIO_DEVICE_NONE && mSupportedDevices.getDevice(device, address) == 0) {
- return false;
- }
-
- if (samplingRate == 0) {
- return false;
- }
- uint32_t myUpdatedSamplingRate = samplingRate;
- if (isPlaybackThread && checkExactSamplingRate(samplingRate) != NO_ERROR) {
- return false;
- }
- if (isRecordThread && checkCompatibleSamplingRate(samplingRate, &myUpdatedSamplingRate) !=
- NO_ERROR) {
- return false;
- }
-
- if (!audio_is_valid_format(format) || checkFormat(format) != NO_ERROR) {
- return false;
- }
-
- if (isPlaybackThread && (!audio_is_output_channel(channelMask) ||
- checkExactChannelMask(channelMask) != NO_ERROR)) {
- return false;
- }
- if (isRecordThread && (!audio_is_input_channel(channelMask) ||
- checkCompatibleChannelMask(channelMask) != NO_ERROR)) {
- return false;
- }
-
- if (isPlaybackThread && (mFlags & flags) != flags) {
- return false;
- }
- // The only input flag that is allowed to be different is the fast flag.
- // An existing fast stream is compatible with a normal track request.
- // An existing normal stream is compatible with a fast track request,
- // but the fast request will be denied by AudioFlinger and converted to normal track.
- if (isRecordThread && ((mFlags ^ flags) &
- ~AUDIO_INPUT_FLAG_FAST)) {
- return false;
- }
-
- if (updatedSamplingRate != NULL) {
- *updatedSamplingRate = myUpdatedSamplingRate;
- }
- return true;
-}
-
-void AudioPolicyManager::IOProfile::dump(int fd)
-{
- const size_t SIZE = 256;
- char buffer[SIZE];
- String8 result;
-
- AudioPort::dump(fd, 4);
-
- snprintf(buffer, SIZE, " - flags: 0x%04x\n", mFlags);
- result.append(buffer);
- snprintf(buffer, SIZE, " - devices:\n");
- result.append(buffer);
- write(fd, result.string(), result.size());
- for (size_t i = 0; i < mSupportedDevices.size(); i++) {
- mSupportedDevices[i]->dump(fd, 6, i);
- }
-}
-
-void AudioPolicyManager::IOProfile::log()
-{
- const size_t SIZE = 256;
- char buffer[SIZE];
- String8 result;
-
- ALOGV(" - sampling rates: ");
- for (size_t i = 0; i < mSamplingRates.size(); i++) {
- ALOGV(" %d", mSamplingRates[i]);
- }
-
- ALOGV(" - channel masks: ");
- for (size_t i = 0; i < mChannelMasks.size(); i++) {
- ALOGV(" 0x%04x", mChannelMasks[i]);
- }
-
- ALOGV(" - formats: ");
- for (size_t i = 0; i < mFormats.size(); i++) {
- ALOGV(" 0x%08x", mFormats[i]);
- }
-
- ALOGV(" - devices: 0x%04x\n", mSupportedDevices.types());
- ALOGV(" - flags: 0x%04x\n", mFlags);
-}
-
-
-// --- DeviceDescriptor implementation
-
-
-AudioPolicyManager::DeviceDescriptor::DeviceDescriptor(const String8& name, audio_devices_t type) :
- AudioPort(name, AUDIO_PORT_TYPE_DEVICE,
- audio_is_output_device(type) ? AUDIO_PORT_ROLE_SINK :
- AUDIO_PORT_ROLE_SOURCE,
- NULL),
- mDeviceType(type), mAddress(""), mId(0)
-{
-}
-
-bool AudioPolicyManager::DeviceDescriptor::equals(const sp<DeviceDescriptor>& other) const
-{
- // Devices are considered equal if they:
- // - are of the same type (a device type cannot be AUDIO_DEVICE_NONE)
- // - have the same address or one device does not specify the address
- // - have the same channel mask or one device does not specify the channel mask
- return (mDeviceType == other->mDeviceType) &&
- (mAddress == "" || other->mAddress == "" || mAddress == other->mAddress) &&
- (mChannelMask == 0 || other->mChannelMask == 0 ||
- mChannelMask == other->mChannelMask);
-}
-
-void AudioPolicyManager::DeviceDescriptor::loadGains(cnode *root)
-{
- AudioPort::loadGains(root);
- if (mGains.size() > 0) {
- mGains[0]->getDefaultConfig(&mGain);
- }
-}
-
-
-void AudioPolicyManager::DeviceVector::refreshTypes()
-{
- mDeviceTypes = AUDIO_DEVICE_NONE;
- for(size_t i = 0; i < size(); i++) {
- mDeviceTypes |= itemAt(i)->mDeviceType;
- }
- ALOGV("DeviceVector::refreshTypes() mDeviceTypes %08x", mDeviceTypes);
-}
-
-ssize_t AudioPolicyManager::DeviceVector::indexOf(const sp<DeviceDescriptor>& item) const
-{
- for(size_t i = 0; i < size(); i++) {
- if (item->equals(itemAt(i))) {
- return i;
- }
- }
- return -1;
-}
-
-ssize_t AudioPolicyManager::DeviceVector::add(const sp<DeviceDescriptor>& item)
-{
- ssize_t ret = indexOf(item);
-
- if (ret < 0) {
- ret = SortedVector::add(item);
- if (ret >= 0) {
- refreshTypes();
- }
- } else {
- ALOGW("DeviceVector::add device %08x already in", item->mDeviceType);
- ret = -1;
- }
- return ret;
-}
-
-ssize_t AudioPolicyManager::DeviceVector::remove(const sp<DeviceDescriptor>& item)
-{
- size_t i;
- ssize_t ret = indexOf(item);
-
- if (ret < 0) {
- ALOGW("DeviceVector::remove device %08x not in", item->mDeviceType);
- } else {
- ret = SortedVector::removeAt(ret);
- if (ret >= 0) {
- refreshTypes();
- }
- }
- return ret;
-}
-
-void AudioPolicyManager::DeviceVector::loadDevicesFromType(audio_devices_t types)
-{
- DeviceVector deviceList;
-
- uint32_t role_bit = AUDIO_DEVICE_BIT_IN & types;
- types &= ~role_bit;
-
- while (types) {
- uint32_t i = 31 - __builtin_clz(types);
- uint32_t type = 1 << i;
- types &= ~type;
- add(new DeviceDescriptor(String8(""), type | role_bit));
- }
-}
-
-void AudioPolicyManager::DeviceVector::loadDevicesFromName(char *name,
- const DeviceVector& declaredDevices)
-{
- char *devName = strtok(name, "|");
- while (devName != NULL) {
- if (strlen(devName) != 0) {
- audio_devices_t type = stringToEnum(sDeviceNameToEnumTable,
- ARRAY_SIZE(sDeviceNameToEnumTable),
- devName);
- if (type != AUDIO_DEVICE_NONE) {
- sp<DeviceDescriptor> dev = new DeviceDescriptor(String8(""), type);
- if (type == AUDIO_DEVICE_IN_REMOTE_SUBMIX ||
- type == AUDIO_DEVICE_OUT_REMOTE_SUBMIX ) {
- dev->mAddress = String8("0");
- }
- add(dev);
- } else {
- sp<DeviceDescriptor> deviceDesc =
- declaredDevices.getDeviceFromName(String8(devName));
- if (deviceDesc != 0) {
- add(deviceDesc);
- }
- }
- }
- devName = strtok(NULL, "|");
- }
-}
-
-sp<AudioPolicyManager::DeviceDescriptor> AudioPolicyManager::DeviceVector::getDevice(
- audio_devices_t type, String8 address) const
-{
- sp<DeviceDescriptor> device;
- for (size_t i = 0; i < size(); i++) {
- if (itemAt(i)->mDeviceType == type) {
- if (address == "" || itemAt(i)->mAddress == address) {
- device = itemAt(i);
- if (itemAt(i)->mAddress == address) {
- break;
- }
- }
- }
- }
- ALOGV("DeviceVector::getDevice() for type %08x address %s found %p",
- type, address.string(), device.get());
- return device;
-}
-
-sp<AudioPolicyManager::DeviceDescriptor> AudioPolicyManager::DeviceVector::getDeviceFromId(
- audio_port_handle_t id) const
-{
- sp<DeviceDescriptor> device;
- for (size_t i = 0; i < size(); i++) {
- ALOGV("DeviceVector::getDeviceFromId(%d) itemAt(%zu)->mId %d", id, i, itemAt(i)->mId);
- if (itemAt(i)->mId == id) {
- device = itemAt(i);
- break;
- }
- }
- return device;
-}
-
-AudioPolicyManager::DeviceVector AudioPolicyManager::DeviceVector::getDevicesFromType(
- audio_devices_t type) const
-{
- DeviceVector devices;
- bool isOutput = audio_is_output_devices(type);
- type &= ~AUDIO_DEVICE_BIT_IN;
- for (size_t i = 0; (i < size()) && (type != AUDIO_DEVICE_NONE); i++) {
- bool curIsOutput = audio_is_output_devices(itemAt(i)->mDeviceType);
- audio_devices_t curType = itemAt(i)->mDeviceType & ~AUDIO_DEVICE_BIT_IN;
- if ((isOutput == curIsOutput) && ((type & curType) != 0)) {
- devices.add(itemAt(i));
- type &= ~curType;
- ALOGV("DeviceVector::getDevicesFromType() for type %x found %p",
- itemAt(i)->mDeviceType, itemAt(i).get());
- }
- }
- return devices;
-}
-
-AudioPolicyManager::DeviceVector AudioPolicyManager::DeviceVector::getDevicesFromTypeAddr(
- audio_devices_t type, String8 address) const
-{
- DeviceVector devices;
- for (size_t i = 0; i < size(); i++) {
- if (itemAt(i)->mDeviceType == type) {
- if (itemAt(i)->mAddress == address) {
- devices.add(itemAt(i));
- }
- }
- }
- return devices;
-}
-
-sp<AudioPolicyManager::DeviceDescriptor> AudioPolicyManager::DeviceVector::getDeviceFromName(
- const String8& name) const
-{
- sp<DeviceDescriptor> device;
- for (size_t i = 0; i < size(); i++) {
- if (itemAt(i)->mName == name) {
- device = itemAt(i);
- break;
- }
- }
- return device;
-}
-
-void AudioPolicyManager::DeviceDescriptor::toAudioPortConfig(
- struct audio_port_config *dstConfig,
- const struct audio_port_config *srcConfig) const
-{
- dstConfig->config_mask = AUDIO_PORT_CONFIG_CHANNEL_MASK|AUDIO_PORT_CONFIG_GAIN;
- if (srcConfig != NULL) {
- dstConfig->config_mask |= srcConfig->config_mask;
- }
-
- AudioPortConfig::toAudioPortConfig(dstConfig, srcConfig);
-
- dstConfig->id = mId;
- dstConfig->role = audio_is_output_device(mDeviceType) ?
- AUDIO_PORT_ROLE_SINK : AUDIO_PORT_ROLE_SOURCE;
- dstConfig->type = AUDIO_PORT_TYPE_DEVICE;
- dstConfig->ext.device.type = mDeviceType;
- dstConfig->ext.device.hw_module = mModule->mHandle;
- strncpy(dstConfig->ext.device.address, mAddress.string(), AUDIO_DEVICE_MAX_ADDRESS_LEN);
-}
-
-void AudioPolicyManager::DeviceDescriptor::toAudioPort(struct audio_port *port) const
-{
- ALOGV("DeviceDescriptor::toAudioPort() handle %d type %x", mId, mDeviceType);
- AudioPort::toAudioPort(port);
- port->id = mId;
- toAudioPortConfig(&port->active_config);
- port->ext.device.type = mDeviceType;
- port->ext.device.hw_module = mModule->mHandle;
- strncpy(port->ext.device.address, mAddress.string(), AUDIO_DEVICE_MAX_ADDRESS_LEN);
-}
-
-status_t AudioPolicyManager::DeviceDescriptor::dump(int fd, int spaces, int index) const
-{
- const size_t SIZE = 256;
- char buffer[SIZE];
- String8 result;
-
- snprintf(buffer, SIZE, "%*sDevice %d:\n", spaces, "", index+1);
- result.append(buffer);
- if (mId != 0) {
- snprintf(buffer, SIZE, "%*s- id: %2d\n", spaces, "", mId);
- result.append(buffer);
- }
- snprintf(buffer, SIZE, "%*s- type: %-48s\n", spaces, "",
- enumToString(sDeviceNameToEnumTable,
- ARRAY_SIZE(sDeviceNameToEnumTable),
- mDeviceType));
- result.append(buffer);
- if (mAddress.size() != 0) {
- snprintf(buffer, SIZE, "%*s- address: %-32s\n", spaces, "", mAddress.string());
- result.append(buffer);
- }
- write(fd, result.string(), result.size());
- AudioPort::dump(fd, spaces);
-
- return NO_ERROR;
-}
-
-status_t AudioPolicyManager::AudioPatch::dump(int fd, int spaces, int index) const
-{
- const size_t SIZE = 256;
- char buffer[SIZE];
- String8 result;
-
-
- snprintf(buffer, SIZE, "%*sAudio patch %d:\n", spaces, "", index+1);
- result.append(buffer);
- snprintf(buffer, SIZE, "%*s- handle: %2d\n", spaces, "", mHandle);
- result.append(buffer);
- snprintf(buffer, SIZE, "%*s- audio flinger handle: %2d\n", spaces, "", mAfPatchHandle);
- result.append(buffer);
- snprintf(buffer, SIZE, "%*s- owner uid: %2d\n", spaces, "", mUid);
- result.append(buffer);
- snprintf(buffer, SIZE, "%*s- %d sources:\n", spaces, "", mPatch.num_sources);
- result.append(buffer);
- for (size_t i = 0; i < mPatch.num_sources; i++) {
- if (mPatch.sources[i].type == AUDIO_PORT_TYPE_DEVICE) {
- snprintf(buffer, SIZE, "%*s- Device ID %d %s\n", spaces + 2, "",
- mPatch.sources[i].id, enumToString(sDeviceNameToEnumTable,
- ARRAY_SIZE(sDeviceNameToEnumTable),
- mPatch.sources[i].ext.device.type));
- } else {
- snprintf(buffer, SIZE, "%*s- Mix ID %d I/O handle %d\n", spaces + 2, "",
- mPatch.sources[i].id, mPatch.sources[i].ext.mix.handle);
- }
- result.append(buffer);
- }
- snprintf(buffer, SIZE, "%*s- %d sinks:\n", spaces, "", mPatch.num_sinks);
- result.append(buffer);
- for (size_t i = 0; i < mPatch.num_sinks; i++) {
- if (mPatch.sinks[i].type == AUDIO_PORT_TYPE_DEVICE) {
- snprintf(buffer, SIZE, "%*s- Device ID %d %s\n", spaces + 2, "",
- mPatch.sinks[i].id, enumToString(sDeviceNameToEnumTable,
- ARRAY_SIZE(sDeviceNameToEnumTable),
- mPatch.sinks[i].ext.device.type));
- } else {
- snprintf(buffer, SIZE, "%*s- Mix ID %d I/O handle %d\n", spaces + 2, "",
- mPatch.sinks[i].id, mPatch.sinks[i].ext.mix.handle);
- }
- result.append(buffer);
- }
-
- write(fd, result.string(), result.size());
- return NO_ERROR;
-}
-
-// --- audio_policy.conf file parsing
-
-uint32_t AudioPolicyManager::parseOutputFlagNames(char *name)
-{
- uint32_t flag = 0;
-
- // it is OK to cast name to non const here as we are not going to use it after
- // strtok() modifies it
- char *flagName = strtok(name, "|");
- while (flagName != NULL) {
- if (strlen(flagName) != 0) {
- flag |= stringToEnum(sOutputFlagNameToEnumTable,
- ARRAY_SIZE(sOutputFlagNameToEnumTable),
- flagName);
- }
- flagName = strtok(NULL, "|");
- }
- //force direct flag if offload flag is set: offloading implies a direct output stream
- // and all common behaviors are driven by checking only the direct flag
- // this should normally be set appropriately in the policy configuration file
- if ((flag & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD) != 0) {
- flag |= AUDIO_OUTPUT_FLAG_DIRECT;
- }
-
- return flag;
-}
-
-uint32_t AudioPolicyManager::parseInputFlagNames(char *name)
-{
- uint32_t flag = 0;
-
- // it is OK to cast name to non const here as we are not going to use it after
- // strtok() modifies it
- char *flagName = strtok(name, "|");
- while (flagName != NULL) {
- if (strlen(flagName) != 0) {
- flag |= stringToEnum(sInputFlagNameToEnumTable,
- ARRAY_SIZE(sInputFlagNameToEnumTable),
- flagName);
- }
- flagName = strtok(NULL, "|");
- }
- return flag;
-}
-
-audio_devices_t AudioPolicyManager::parseDeviceNames(char *name)
-{
- uint32_t device = 0;
-
- char *devName = strtok(name, "|");
- while (devName != NULL) {
- if (strlen(devName) != 0) {
- device |= stringToEnum(sDeviceNameToEnumTable,
- ARRAY_SIZE(sDeviceNameToEnumTable),
- devName);
- }
- devName = strtok(NULL, "|");
- }
- return device;
-}
-
-void AudioPolicyManager::loadHwModule(cnode *root)
-{
- status_t status = NAME_NOT_FOUND;
- cnode *node;
- sp<HwModule> module = new HwModule(root->name);
-
- node = config_find(root, DEVICES_TAG);
- if (node != NULL) {
- node = node->first_child;
- while (node) {
- ALOGV("loadHwModule() loading device %s", node->name);
- status_t tmpStatus = module->loadDevice(node);
- if (status == NAME_NOT_FOUND || status == NO_ERROR) {
- status = tmpStatus;
- }
- node = node->next;
- }
- }
- node = config_find(root, OUTPUTS_TAG);
- if (node != NULL) {
- node = node->first_child;
- while (node) {
- ALOGV("loadHwModule() loading output %s", node->name);
- status_t tmpStatus = module->loadOutput(node);
- if (status == NAME_NOT_FOUND || status == NO_ERROR) {
- status = tmpStatus;
- }
- node = node->next;
- }
- }
- node = config_find(root, INPUTS_TAG);
- if (node != NULL) {
- node = node->first_child;
- while (node) {
- ALOGV("loadHwModule() loading input %s", node->name);
- status_t tmpStatus = module->loadInput(node);
- if (status == NAME_NOT_FOUND || status == NO_ERROR) {
- status = tmpStatus;
- }
- node = node->next;
- }
- }
- loadGlobalConfig(root, module);
-
- if (status == NO_ERROR) {
- mHwModules.add(module);
- }
-}
-
-void AudioPolicyManager::loadHwModules(cnode *root)
-{
- cnode *node = config_find(root, AUDIO_HW_MODULE_TAG);
- if (node == NULL) {
- return;
- }
-
- node = node->first_child;
- while (node) {
- ALOGV("loadHwModules() loading module %s", node->name);
- loadHwModule(node);
- node = node->next;
- }
-}
-
-void AudioPolicyManager::loadGlobalConfig(cnode *root, const sp<HwModule>& module)
-{
- cnode *node = config_find(root, GLOBAL_CONFIG_TAG);
-
- if (node == NULL) {
- return;
- }
- DeviceVector declaredDevices;
- if (module != NULL) {
- declaredDevices = module->mDeclaredDevices;
- }
-
- node = node->first_child;
- while (node) {
- if (strcmp(ATTACHED_OUTPUT_DEVICES_TAG, node->name) == 0) {
- mAvailableOutputDevices.loadDevicesFromName((char *)node->value,
- declaredDevices);
- ALOGV("loadGlobalConfig() Attached Output Devices %08x",
- mAvailableOutputDevices.types());
- } else if (strcmp(DEFAULT_OUTPUT_DEVICE_TAG, node->name) == 0) {
- audio_devices_t device = (audio_devices_t)stringToEnum(sDeviceNameToEnumTable,
- ARRAY_SIZE(sDeviceNameToEnumTable),
- (char *)node->value);
- if (device != AUDIO_DEVICE_NONE) {
- mDefaultOutputDevice = new DeviceDescriptor(String8(""), device);
- } else {
- ALOGW("loadGlobalConfig() default device not specified");
- }
- ALOGV("loadGlobalConfig() mDefaultOutputDevice %08x", mDefaultOutputDevice->mDeviceType);
- } else if (strcmp(ATTACHED_INPUT_DEVICES_TAG, node->name) == 0) {
- mAvailableInputDevices.loadDevicesFromName((char *)node->value,
- declaredDevices);
- ALOGV("loadGlobalConfig() Available InputDevices %08x", mAvailableInputDevices.types());
- } else if (strcmp(SPEAKER_DRC_ENABLED_TAG, node->name) == 0) {
- mSpeakerDrcEnabled = stringToBool((char *)node->value);
- ALOGV("loadGlobalConfig() mSpeakerDrcEnabled = %d", mSpeakerDrcEnabled);
- } else if (strcmp(AUDIO_HAL_VERSION_TAG, node->name) == 0) {
- uint32_t major, minor;
- sscanf((char *)node->value, "%u.%u", &major, &minor);
- module->mHalVersion = HARDWARE_DEVICE_API_VERSION(major, minor);
- ALOGV("loadGlobalConfig() mHalVersion = %04x major %u minor %u",
- module->mHalVersion, major, minor);
- }
- node = node->next;
- }
-}
-
-status_t AudioPolicyManager::loadAudioPolicyConfig(const char *path)
-{
- cnode *root;
- char *data;
-
- data = (char *)load_file(path, NULL);
- if (data == NULL) {
- return -ENODEV;
- }
- root = config_node("", "");
- config_load(root, data);
-
- loadHwModules(root);
- // legacy audio_policy.conf files have one global_configuration section
- loadGlobalConfig(root, getModuleFromName(AUDIO_HARDWARE_MODULE_ID_PRIMARY));
- config_free(root);
- free(root);
- free(data);
-
- ALOGI("loadAudioPolicyConfig() loaded %s\n", path);
-
- return NO_ERROR;
-}
void AudioPolicyManager::defaultAudioPolicyConfig(void)
{
sp<HwModule> module;
sp<IOProfile> profile;
- sp<DeviceDescriptor> defaultInputDevice = new DeviceDescriptor(String8(""),
- AUDIO_DEVICE_IN_BUILTIN_MIC);
+ sp<DeviceDescriptor> defaultInputDevice =
+ new DeviceDescriptor(AUDIO_DEVICE_IN_BUILTIN_MIC);
mAvailableOutputDevices.add(mDefaultOutputDevice);
mAvailableInputDevices.add(defaultInputDevice);
module = new HwModule("primary");
- profile = new IOProfile(String8("primary"), AUDIO_PORT_ROLE_SOURCE, module);
+ profile = new IOProfile(String8("primary"), AUDIO_PORT_ROLE_SOURCE);
+ profile->attach(module);
profile->mSamplingRates.add(44100);
profile->mFormats.add(AUDIO_FORMAT_PCM_16_BIT);
profile->mChannelMasks.add(AUDIO_CHANNEL_OUT_STEREO);
@@ -7998,7 +4749,8 @@ void AudioPolicyManager::defaultAudioPolicyConfig(void)
profile->mFlags = AUDIO_OUTPUT_FLAG_PRIMARY;
module->mOutputProfiles.add(profile);
- profile = new IOProfile(String8("primary"), AUDIO_PORT_ROLE_SINK, module);
+ profile = new IOProfile(String8("primary"), AUDIO_PORT_ROLE_SINK);
+ profile->attach(module);
profile->mSamplingRates.add(8000);
profile->mFormats.add(AUDIO_FORMAT_PCM_16_BIT);
profile->mChannelMasks.add(AUDIO_CHANNEL_IN_MONO);
@@ -8064,7 +4816,8 @@ audio_stream_type_t AudioPolicyManager::streamTypefromAttributesInt(const audio_
}
}
-bool AudioPolicyManager::isValidAttributes(const audio_attributes_t *paa) {
+bool AudioPolicyManager::isValidAttributes(const audio_attributes_t *paa)
+{
// has flags that map to a strategy?
if ((paa->flags & (AUDIO_FLAG_AUDIBILITY_ENFORCED | AUDIO_FLAG_SCO | AUDIO_FLAG_BEACON)) != 0) {
return true;
@@ -8095,4 +4848,39 @@ bool AudioPolicyManager::isValidAttributes(const audio_attributes_t *paa) {
return true;
}
+bool AudioPolicyManager::isStrategyActive(const sp<AudioOutputDescriptor> outputDesc,
+ routing_strategy strategy, uint32_t inPastMs,
+ nsecs_t sysTime) const
+{
+ if ((sysTime == 0) && (inPastMs != 0)) {
+ sysTime = systemTime();
+ }
+ for (int i = 0; i < (int)AUDIO_STREAM_CNT; i++) {
+ if (i == AUDIO_STREAM_PATCH) {
+ continue;
+ }
+ if (((getStrategy((audio_stream_type_t)i) == strategy) ||
+ (NUM_STRATEGIES == strategy)) &&
+ outputDesc->isStreamActive((audio_stream_type_t)i, inPastMs, sysTime)) {
+ return true;
+ }
+ }
+ return false;
+}
+
+audio_policy_forced_cfg_t AudioPolicyManager::getForceUse(audio_policy_force_use_t usage)
+{
+ return mEngine->getForceUse(usage);
+}
+
+bool AudioPolicyManager::isInCall()
+{
+ return isStateInCall(mEngine->getPhoneState());
+}
+
+bool AudioPolicyManager::isStateInCall(int state)
+{
+ return is_state_in_call(state);
+}
+
}; // namespace android
diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.h b/services/audiopolicy/managerdefault/AudioPolicyManager.h
new file mode 100644
index 0000000..bf3ae4a
--- /dev/null
+++ b/services/audiopolicy/managerdefault/AudioPolicyManager.h
@@ -0,0 +1,618 @@
+/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <stdint.h>
+#include <sys/types.h>
+#include <cutils/config_utils.h>
+#include <cutils/misc.h>
+#include <utils/Timers.h>
+#include <utils/Errors.h>
+#include <utils/KeyedVector.h>
+#include <utils/SortedVector.h>
+#include <media/AudioPolicy.h>
+#include "AudioPolicyInterface.h"
+
+#include <AudioPolicyManagerInterface.h>
+#include <AudioPolicyManagerObserver.h>
+#include <AudioGain.h>
+#include <AudioPort.h>
+#include <AudioPatch.h>
+#include <ConfigParsingUtils.h>
+#include <DeviceDescriptor.h>
+#include <IOProfile.h>
+#include <HwModule.h>
+#include <AudioInputDescriptor.h>
+#include <AudioOutputDescriptor.h>
+#include <AudioPolicyMix.h>
+#include <EffectDescriptor.h>
+#include <SoundTriggerSession.h>
+#include <StreamDescriptor.h>
+#include <SessionRoute.h>
+
+namespace android {
+
+// ----------------------------------------------------------------------------
+
+// Attenuation applied to STRATEGY_SONIFICATION streams when a headset is connected: 6dB
+#define SONIFICATION_HEADSET_VOLUME_FACTOR 0.5
+#define SONIFICATION_HEADSET_VOLUME_FACTOR_DB (-6)
+// Min volume for STRATEGY_SONIFICATION streams when limited by music volume: -36dB
+#define SONIFICATION_HEADSET_VOLUME_MIN 0.016
+#define SONIFICATION_HEADSET_VOLUME_MIN_DB (-36)
+
+// Time in milliseconds during which we consider that music is still active after a music
+// track was stopped - see computeVolume()
+#define SONIFICATION_HEADSET_MUSIC_DELAY 5000
+
+// Time in milliseconds during witch some streams are muted while the audio path
+// is switched
+#define MUTE_TIME_MS 2000
+
+#define NUM_TEST_OUTPUTS 5
+
+#define NUM_VOL_CURVE_KNEES 2
+
+// Default minimum length allowed for offloading a compressed track
+// Can be overridden by the audio.offload.min.duration.secs property
+#define OFFLOAD_DEFAULT_MIN_DURATION_SECS 60
+
+// ----------------------------------------------------------------------------
+// AudioPolicyManager implements audio policy manager behavior common to all platforms.
+// ----------------------------------------------------------------------------
+
+class AudioPolicyManager : public AudioPolicyInterface, public AudioPolicyManagerObserver
+
+#ifdef AUDIO_POLICY_TEST
+ , public Thread
+#endif //AUDIO_POLICY_TEST
+{
+
+public:
+ AudioPolicyManager(AudioPolicyClientInterface *clientInterface);
+ virtual ~AudioPolicyManager();
+
+ // AudioPolicyInterface
+ virtual status_t setDeviceConnectionState(audio_devices_t device,
+ audio_policy_dev_state_t state,
+ const char *device_address,
+ const char *device_name);
+ virtual audio_policy_dev_state_t getDeviceConnectionState(audio_devices_t device,
+ const char *device_address);
+ virtual void setPhoneState(audio_mode_t state);
+ virtual void setForceUse(audio_policy_force_use_t usage,
+ audio_policy_forced_cfg_t config);
+ virtual audio_policy_forced_cfg_t getForceUse(audio_policy_force_use_t usage);
+
+ virtual void setSystemProperty(const char* property, const char* value);
+ virtual status_t initCheck();
+ virtual audio_io_handle_t getOutput(audio_stream_type_t stream,
+ uint32_t samplingRate,
+ audio_format_t format,
+ audio_channel_mask_t channelMask,
+ audio_output_flags_t flags,
+ const audio_offload_info_t *offloadInfo);
+ virtual status_t getOutputForAttr(const audio_attributes_t *attr,
+ audio_io_handle_t *output,
+ audio_session_t session,
+ audio_stream_type_t *stream,
+ uid_t uid,
+ uint32_t samplingRate,
+ audio_format_t format,
+ audio_channel_mask_t channelMask,
+ audio_output_flags_t flags,
+ audio_port_handle_t selectedDeviceId,
+ const audio_offload_info_t *offloadInfo);
+ virtual status_t startOutput(audio_io_handle_t output,
+ audio_stream_type_t stream,
+ audio_session_t session);
+ virtual status_t stopOutput(audio_io_handle_t output,
+ audio_stream_type_t stream,
+ audio_session_t session);
+ virtual void releaseOutput(audio_io_handle_t output,
+ audio_stream_type_t stream,
+ audio_session_t session);
+ virtual status_t getInputForAttr(const audio_attributes_t *attr,
+ audio_io_handle_t *input,
+ audio_session_t session,
+ uid_t uid,
+ uint32_t samplingRate,
+ audio_format_t format,
+ audio_channel_mask_t channelMask,
+ audio_input_flags_t flags,
+ audio_port_handle_t selectedDeviceId,
+ input_type_t *inputType);
+
+ // indicates to the audio policy manager that the input starts being used.
+ virtual status_t startInput(audio_io_handle_t input,
+ audio_session_t session);
+
+ // indicates to the audio policy manager that the input stops being used.
+ virtual status_t stopInput(audio_io_handle_t input,
+ audio_session_t session);
+ virtual void releaseInput(audio_io_handle_t input,
+ audio_session_t session);
+ virtual void closeAllInputs();
+ virtual void initStreamVolume(audio_stream_type_t stream,
+ int indexMin,
+ int indexMax);
+ virtual status_t setStreamVolumeIndex(audio_stream_type_t stream,
+ int index,
+ audio_devices_t device);
+ virtual status_t getStreamVolumeIndex(audio_stream_type_t stream,
+ int *index,
+ audio_devices_t device);
+
+ // return the strategy corresponding to a given stream type
+ virtual uint32_t getStrategyForStream(audio_stream_type_t stream);
+ // return the strategy corresponding to the given audio attributes
+ virtual uint32_t getStrategyForAttr(const audio_attributes_t *attr);
+
+ // return the enabled output devices for the given stream type
+ virtual audio_devices_t getDevicesForStream(audio_stream_type_t stream);
+
+ virtual audio_io_handle_t getOutputForEffect(const effect_descriptor_t *desc = NULL);
+ virtual status_t registerEffect(const effect_descriptor_t *desc,
+ audio_io_handle_t io,
+ uint32_t strategy,
+ int session,
+ int id);
+ virtual status_t unregisterEffect(int id)
+ {
+ return mEffects.unregisterEffect(id);
+ }
+ virtual status_t setEffectEnabled(int id, bool enabled)
+ {
+ return mEffects.setEffectEnabled(id, enabled);
+ }
+
+ virtual bool isStreamActive(audio_stream_type_t stream, uint32_t inPastMs = 0) const;
+ // return whether a stream is playing remotely, override to change the definition of
+ // local/remote playback, used for instance by notification manager to not make
+ // media players lose audio focus when not playing locally
+ // For the base implementation, "remotely" means playing during screen mirroring which
+ // uses an output for playback with a non-empty, non "0" address.
+ virtual bool isStreamActiveRemotely(audio_stream_type_t stream,
+ uint32_t inPastMs = 0) const;
+
+ virtual bool isSourceActive(audio_source_t source) const;
+
+ virtual status_t dump(int fd);
+
+ virtual bool isOffloadSupported(const audio_offload_info_t& offloadInfo);
+
+ virtual status_t listAudioPorts(audio_port_role_t role,
+ audio_port_type_t type,
+ unsigned int *num_ports,
+ struct audio_port *ports,
+ unsigned int *generation);
+ virtual status_t getAudioPort(struct audio_port *port);
+ virtual status_t createAudioPatch(const struct audio_patch *patch,
+ audio_patch_handle_t *handle,
+ uid_t uid);
+ virtual status_t releaseAudioPatch(audio_patch_handle_t handle,
+ uid_t uid);
+ virtual status_t listAudioPatches(unsigned int *num_patches,
+ struct audio_patch *patches,
+ unsigned int *generation);
+ virtual status_t setAudioPortConfig(const struct audio_port_config *config);
+
+ virtual status_t acquireSoundTriggerSession(audio_session_t *session,
+ audio_io_handle_t *ioHandle,
+ audio_devices_t *device);
+
+ virtual status_t releaseSoundTriggerSession(audio_session_t session)
+ {
+ return mSoundTriggerSessions.releaseSession(session);
+ }
+
+ virtual status_t registerPolicyMixes(Vector<AudioMix> mixes);
+ virtual status_t unregisterPolicyMixes(Vector<AudioMix> mixes);
+
+ virtual status_t startAudioSource(const struct audio_port_config *source,
+ const audio_attributes_t *attributes,
+ audio_io_handle_t *handle);
+ virtual status_t stopAudioSource(audio_io_handle_t handle);
+
+ virtual void releaseResourcesForUid(uid_t uid);
+
+ // Audio policy configuration file parsing (audio_policy.conf)
+ // TODO candidates to be moved to ConfigParsingUtils
+ void defaultAudioPolicyConfig(void);
+
+ // return the strategy corresponding to a given stream type
+ routing_strategy getStrategy(audio_stream_type_t stream) const;
+
+protected:
+ // From AudioPolicyManagerObserver
+ virtual const AudioPatchCollection &getAudioPatches() const
+ {
+ return mAudioPatches;
+ }
+ virtual const SoundTriggerSessionCollection &getSoundTriggerSessionCollection() const
+ {
+ return mSoundTriggerSessions;
+ }
+ virtual const AudioPolicyMixCollection &getAudioPolicyMixCollection() const
+ {
+ return mPolicyMixes;
+ }
+ virtual const SwAudioOutputCollection &getOutputs() const
+ {
+ return mOutputs;
+ }
+ virtual const AudioInputCollection &getInputs() const
+ {
+ return mInputs;
+ }
+ virtual const DeviceVector &getAvailableOutputDevices() const
+ {
+ return mAvailableOutputDevices;
+ }
+ virtual const DeviceVector &getAvailableInputDevices() const
+ {
+ return mAvailableInputDevices;
+ }
+ virtual StreamDescriptorCollection &getStreamDescriptors()
+ {
+ return mStreams;
+ }
+ virtual const sp<DeviceDescriptor> &getDefaultOutputDevice() const
+ {
+ return mDefaultOutputDevice;
+ }
+protected:
+ void addOutput(audio_io_handle_t output, sp<SwAudioOutputDescriptor> outputDesc);
+ void removeOutput(audio_io_handle_t output);
+ void addInput(audio_io_handle_t input, sp<AudioInputDescriptor> inputDesc);
+
+ // return appropriate device for streams handled by the specified strategy according to current
+ // phone state, connected devices...
+ // if fromCache is true, the device is returned from mDeviceForStrategy[],
+ // otherwise it is determine by current state
+ // (device connected,phone state, force use, a2dp output...)
+ // This allows to:
+ // 1 speed up process when the state is stable (when starting or stopping an output)
+ // 2 access to either current device selection (fromCache == true) or
+ // "future" device selection (fromCache == false) when called from a context
+ // where conditions are changing (setDeviceConnectionState(), setPhoneState()...) AND
+ // before updateDevicesAndOutputs() is called.
+ virtual audio_devices_t getDeviceForStrategy(routing_strategy strategy,
+ bool fromCache);
+
+ bool isStrategyActive(const sp<AudioOutputDescriptor> outputDesc, routing_strategy strategy,
+ uint32_t inPastMs = 0, nsecs_t sysTime = 0) const;
+
+ // change the route of the specified output. Returns the number of ms we have slept to
+ // allow new routing to take effect in certain cases.
+ virtual uint32_t setOutputDevice(const sp<AudioOutputDescriptor>& outputDesc,
+ audio_devices_t device,
+ bool force = false,
+ int delayMs = 0,
+ audio_patch_handle_t *patchHandle = NULL,
+ const char* address = NULL);
+ status_t resetOutputDevice(const sp<AudioOutputDescriptor>& outputDesc,
+ int delayMs = 0,
+ audio_patch_handle_t *patchHandle = NULL);
+ status_t setInputDevice(audio_io_handle_t input,
+ audio_devices_t device,
+ bool force = false,
+ audio_patch_handle_t *patchHandle = NULL);
+ status_t resetInputDevice(audio_io_handle_t input,
+ audio_patch_handle_t *patchHandle = NULL);
+
+ // select input device corresponding to requested audio source
+ virtual audio_devices_t getDeviceForInputSource(audio_source_t inputSource);
+
+ // compute the actual volume for a given stream according to the requested index and a particular
+ // device
+ virtual float computeVolume(audio_stream_type_t stream,
+ int index,
+ audio_devices_t device);
+
+ // check that volume change is permitted, compute and send new volume to audio hardware
+ virtual status_t checkAndSetVolume(audio_stream_type_t stream, int index,
+ const sp<AudioOutputDescriptor>& outputDesc,
+ audio_devices_t device,
+ int delayMs = 0, bool force = false);
+
+ // apply all stream volumes to the specified output and device
+ void applyStreamVolumes(const sp<AudioOutputDescriptor>& outputDesc,
+ audio_devices_t device, int delayMs = 0, bool force = false);
+
+ // Mute or unmute all streams handled by the specified strategy on the specified output
+ void setStrategyMute(routing_strategy strategy,
+ bool on,
+ const sp<AudioOutputDescriptor>& outputDesc,
+ int delayMs = 0,
+ audio_devices_t device = (audio_devices_t)0);
+
+ // Mute or unmute the stream on the specified output
+ void setStreamMute(audio_stream_type_t stream,
+ bool on,
+ const sp<AudioOutputDescriptor>& outputDesc,
+ int delayMs = 0,
+ audio_devices_t device = (audio_devices_t)0);
+
+ // handle special cases for sonification strategy while in call: mute streams or replace by
+ // a special tone in the device used for communication
+ void handleIncallSonification(audio_stream_type_t stream, bool starting, bool stateChange);
+
+ audio_mode_t getPhoneState();
+
+ // true if device is in a telephony or VoIP call
+ virtual bool isInCall();
+ // true if given state represents a device in a telephony or VoIP call
+ virtual bool isStateInCall(int state);
+
+ // when a device is connected, checks if an open output can be routed
+ // to this device. If none is open, tries to open one of the available outputs.
+ // Returns an output suitable to this device or 0.
+ // when a device is disconnected, checks if an output is not used any more and
+ // returns its handle if any.
+ // transfers the audio tracks and effects from one output thread to another accordingly.
+ status_t checkOutputsForDevice(const sp<DeviceDescriptor> devDesc,
+ audio_policy_dev_state_t state,
+ SortedVector<audio_io_handle_t>& outputs,
+ const String8 address);
+
+ status_t checkInputsForDevice(const sp<DeviceDescriptor> devDesc,
+ audio_policy_dev_state_t state,
+ SortedVector<audio_io_handle_t>& inputs,
+ const String8 address);
+
+ // close an output and its companion duplicating output.
+ void closeOutput(audio_io_handle_t output);
+
+ // close an input.
+ void closeInput(audio_io_handle_t input);
+
+ // checks and if necessary changes outputs used for all strategies.
+ // must be called every time a condition that affects the output choice for a given strategy
+ // changes: connected device, phone state, force use...
+ // Must be called before updateDevicesAndOutputs()
+ void checkOutputForStrategy(routing_strategy strategy);
+
+ // Same as checkOutputForStrategy() but for a all strategies in order of priority
+ void checkOutputForAllStrategies();
+
+ // manages A2DP output suspend/restore according to phone state and BT SCO usage
+ void checkA2dpSuspend();
+
+ // selects the most appropriate device on output for current state
+ // must be called every time a condition that affects the device choice for a given output is
+ // changed: connected device, phone state, force use, output start, output stop..
+ // see getDeviceForStrategy() for the use of fromCache parameter
+ audio_devices_t getNewOutputDevice(const sp<AudioOutputDescriptor>& outputDesc,
+ bool fromCache);
+
+ // updates cache of device used by all strategies (mDeviceForStrategy[])
+ // must be called every time a condition that affects the device choice for a given strategy is
+ // changed: connected device, phone state, force use...
+ // cached values are used by getDeviceForStrategy() if parameter fromCache is true.
+ // Must be called after checkOutputForAllStrategies()
+ void updateDevicesAndOutputs();
+
+ // selects the most appropriate device on input for current state
+ audio_devices_t getNewInputDevice(audio_io_handle_t input);
+
+ virtual uint32_t getMaxEffectsCpuLoad()
+ {
+ return mEffects.getMaxEffectsCpuLoad();
+ }
+
+ virtual uint32_t getMaxEffectsMemory()
+ {
+ return mEffects.getMaxEffectsMemory();
+ }
+#ifdef AUDIO_POLICY_TEST
+ virtual bool threadLoop();
+ void exit();
+ int testOutputIndex(audio_io_handle_t output);
+#endif //AUDIO_POLICY_TEST
+
+ SortedVector<audio_io_handle_t> getOutputsForDevice(audio_devices_t device,
+ SwAudioOutputCollection openOutputs);
+ bool vectorsEqual(SortedVector<audio_io_handle_t>& outputs1,
+ SortedVector<audio_io_handle_t>& outputs2);
+
+ // mute/unmute strategies using an incompatible device combination
+ // if muting, wait for the audio in pcm buffer to be drained before proceeding
+ // if unmuting, unmute only after the specified delay
+ // Returns the number of ms waited
+ virtual uint32_t checkDeviceMuteStrategies(sp<AudioOutputDescriptor> outputDesc,
+ audio_devices_t prevDevice,
+ uint32_t delayMs);
+
+ audio_io_handle_t selectOutput(const SortedVector<audio_io_handle_t>& outputs,
+ audio_output_flags_t flags,
+ audio_format_t format);
+ // samplingRate, format, channelMask are in/out and so may be modified
+ sp<IOProfile> getInputProfile(audio_devices_t device,
+ String8 address,
+ uint32_t& samplingRate,
+ audio_format_t& format,
+ audio_channel_mask_t& channelMask,
+ audio_input_flags_t flags);
+ sp<IOProfile> getProfileForDirectOutput(audio_devices_t device,
+ uint32_t samplingRate,
+ audio_format_t format,
+ audio_channel_mask_t channelMask,
+ audio_output_flags_t flags);
+
+ audio_io_handle_t selectOutputForEffects(const SortedVector<audio_io_handle_t>& outputs);
+
+ virtual status_t addAudioPatch(audio_patch_handle_t handle, const sp<AudioPatch>& patch)
+ {
+ return mAudioPatches.addAudioPatch(handle, patch);
+ }
+ virtual status_t removeAudioPatch(audio_patch_handle_t handle)
+ {
+ return mAudioPatches.removeAudioPatch(handle);
+ }
+
+ audio_devices_t availablePrimaryOutputDevices() const
+ {
+ if (!hasPrimaryOutput()) {
+ return AUDIO_DEVICE_NONE;
+ }
+ return mPrimaryOutput->supportedDevices() & mAvailableOutputDevices.types();
+ }
+ audio_devices_t availablePrimaryInputDevices() const
+ {
+ if (!hasPrimaryOutput()) {
+ return AUDIO_DEVICE_NONE;
+ }
+ return mAvailableInputDevices.getDevicesFromHwModule(mPrimaryOutput->getModuleHandle());
+ }
+
+ void updateCallRouting(audio_devices_t rxDevice, int delayMs = 0);
+
+ // if argument "device" is different from AUDIO_DEVICE_NONE, startSource() will force
+ // the re-evaluation of the output device.
+ status_t startSource(sp<AudioOutputDescriptor> outputDesc,
+ audio_stream_type_t stream,
+ audio_devices_t device,
+ uint32_t *delayMs);
+ status_t stopSource(sp<AudioOutputDescriptor> outputDesc,
+ audio_stream_type_t stream,
+ bool forceDeviceUpdate);
+
+ void clearAudioPatches(uid_t uid);
+ void clearSessionRoutes(uid_t uid);
+ void checkStrategyRoute(routing_strategy strategy, audio_io_handle_t ouptutToSkip);
+
+ status_t hasPrimaryOutput() const { return mPrimaryOutput != 0; }
+
+ uid_t mUidCached;
+ AudioPolicyClientInterface *mpClientInterface; // audio policy client interface
+ sp<SwAudioOutputDescriptor> mPrimaryOutput; // primary output descriptor
+ // list of descriptors for outputs currently opened
+
+ SwAudioOutputCollection mOutputs;
+ // copy of mOutputs before setDeviceConnectionState() opens new outputs
+ // reset to mOutputs when updateDevicesAndOutputs() is called.
+ SwAudioOutputCollection mPreviousOutputs;
+ AudioInputCollection mInputs; // list of input descriptors
+
+ DeviceVector mAvailableOutputDevices; // all available output devices
+ DeviceVector mAvailableInputDevices; // all available input devices
+
+ SessionRouteMap mOutputRoutes = SessionRouteMap(SessionRouteMap::MAPTYPE_OUTPUT);
+ SessionRouteMap mInputRoutes = SessionRouteMap(SessionRouteMap::MAPTYPE_INPUT);
+
+ StreamDescriptorCollection mStreams; // stream descriptors for volume control
+ bool mLimitRingtoneVolume; // limit ringtone volume to music volume if headset connected
+ audio_devices_t mDeviceForStrategy[NUM_STRATEGIES];
+ float mLastVoiceVolume; // last voice volume value sent to audio HAL
+
+ EffectDescriptorCollection mEffects; // list of registered audio effects
+ bool mA2dpSuspended; // true if A2DP output is suspended
+ sp<DeviceDescriptor> mDefaultOutputDevice; // output device selected by default at boot time
+ bool mSpeakerDrcEnabled;// true on devices that use DRC on the DEVICE_CATEGORY_SPEAKER path
+ // to boost soft sounds, used to adjust volume curves accordingly
+
+ HwModuleCollection mHwModules;
+
+ volatile int32_t mAudioPortGeneration;
+
+ AudioPatchCollection mAudioPatches;
+
+ SoundTriggerSessionCollection mSoundTriggerSessions;
+
+ sp<AudioPatch> mCallTxPatch;
+ sp<AudioPatch> mCallRxPatch;
+
+ // for supporting "beacon" streams, i.e. streams that only play on speaker, and never
+ // when something other than STREAM_TTS (a.k.a. "Transmitted Through Speaker") is playing
+ enum {
+ STARTING_OUTPUT,
+ STARTING_BEACON,
+ STOPPING_OUTPUT,
+ STOPPING_BEACON
+ };
+ uint32_t mBeaconMuteRefCount; // ref count for stream that would mute beacon
+ uint32_t mBeaconPlayingRefCount;// ref count for the playing beacon streams
+ bool mBeaconMuted; // has STREAM_TTS been muted
+
+ AudioPolicyMixCollection mPolicyMixes; // list of registered mixes
+
+#ifdef AUDIO_POLICY_TEST
+ Mutex mLock;
+ Condition mWaitWorkCV;
+
+ int mCurOutput;
+ bool mDirectOutput;
+ audio_io_handle_t mTestOutputs[NUM_TEST_OUTPUTS];
+ int mTestInput;
+ uint32_t mTestDevice;
+ uint32_t mTestSamplingRate;
+ uint32_t mTestFormat;
+ uint32_t mTestChannels;
+ uint32_t mTestLatencyMs;
+#endif //AUDIO_POLICY_TEST
+
+ uint32_t nextAudioPortGeneration();
+
+ // Audio Policy Engine Interface.
+ AudioPolicyManagerInterface *mEngine;
+private:
+ // updates device caching and output for streams that can influence the
+ // routing of notifications
+ void handleNotificationRoutingForStream(audio_stream_type_t stream);
+ // find the outputs on a given output descriptor that have the given address.
+ // to be called on an AudioOutputDescriptor whose supported devices (as defined
+ // in mProfile->mSupportedDevices) matches the device whose address is to be matched.
+ // see deviceDistinguishesOnAddress(audio_devices_t) for whether the device type is one
+ // where addresses are used to distinguish between one connected device and another.
+ void findIoHandlesByAddress(sp<SwAudioOutputDescriptor> desc /*in*/,
+ const audio_devices_t device /*in*/,
+ const String8 address /*in*/,
+ SortedVector<audio_io_handle_t>& outputs /*out*/);
+ uint32_t curAudioPortGeneration() const { return mAudioPortGeneration; }
+ // internal method to return the output handle for the given device and format
+ audio_io_handle_t getOutputForDevice(
+ audio_devices_t device,
+ audio_session_t session,
+ audio_stream_type_t stream,
+ uint32_t samplingRate,
+ audio_format_t format,
+ audio_channel_mask_t channelMask,
+ audio_output_flags_t flags,
+ const audio_offload_info_t *offloadInfo);
+ // internal function to derive a stream type value from audio attributes
+ audio_stream_type_t streamTypefromAttributesInt(const audio_attributes_t *attr);
+ // event is one of STARTING_OUTPUT, STARTING_BEACON, STOPPING_OUTPUT, STOPPING_BEACON
+ // returns 0 if no mute/unmute event happened, the largest latency of the device where
+ // the mute/unmute happened
+ uint32_t handleEventForBeacon(int event);
+ uint32_t setBeaconMute(bool mute);
+ bool isValidAttributes(const audio_attributes_t *paa);
+
+ // select input device corresponding to requested audio source and return associated policy
+ // mix if any. Calls getDeviceForInputSource().
+ audio_devices_t getDeviceAndMixForInputSource(audio_source_t inputSource,
+ AudioMix **policyMix = NULL);
+
+ // Called by setDeviceConnectionState().
+ status_t setDeviceConnectionStateInt(audio_devices_t device,
+ audio_policy_dev_state_t state,
+ const char *device_address,
+ const char *device_name);
+};
+
+};
diff --git a/services/audiopolicy/AudioPolicyClientImpl.cpp b/services/audiopolicy/service/AudioPolicyClientImpl.cpp
index 3e090e9..489a9be 100644
--- a/services/audiopolicy/AudioPolicyClientImpl.cpp
+++ b/services/audiopolicy/service/AudioPolicyClientImpl.cpp
@@ -213,6 +213,12 @@ void AudioPolicyService::AudioPolicyClient::onAudioPatchListUpdate()
mAudioPolicyService->onAudioPatchListUpdate();
}
+void AudioPolicyService::AudioPolicyClient::onDynamicPolicyMixStateUpdate(
+ String8 regId, int32_t state)
+{
+ mAudioPolicyService->onDynamicPolicyMixStateUpdate(regId, state);
+}
+
audio_unique_id_t AudioPolicyService::AudioPolicyClient::newAudioUniqueId()
{
return AudioSystem::newAudioUniqueId();
diff --git a/services/audiopolicy/AudioPolicyClientImplLegacy.cpp b/services/audiopolicy/service/AudioPolicyClientImplLegacy.cpp
index a79f8ae..a79f8ae 100644
--- a/services/audiopolicy/AudioPolicyClientImplLegacy.cpp
+++ b/services/audiopolicy/service/AudioPolicyClientImplLegacy.cpp
diff --git a/services/audiopolicy/AudioPolicyEffects.cpp b/services/audiopolicy/service/AudioPolicyEffects.cpp
index e6ace20..282ddeb 100644
--- a/services/audiopolicy/AudioPolicyEffects.cpp
+++ b/services/audiopolicy/service/AudioPolicyEffects.cpp
@@ -109,8 +109,8 @@ status_t AudioPolicyEffects::addInputEffects(audio_io_handle_t input,
Vector <EffectDesc *> effects = mInputSources.valueAt(index)->mEffects;
for (size_t i = 0; i < effects.size(); i++) {
EffectDesc *effect = effects[i];
- sp<AudioEffect> fx = new AudioEffect(NULL, &effect->mUuid, -1, 0, 0,
- audioSession, input);
+ sp<AudioEffect> fx = new AudioEffect(NULL, String16("android"), &effect->mUuid, -1, 0,
+ 0, audioSession, input);
status_t status = fx->initCheck();
if (status != NO_ERROR && status != ALREADY_EXISTS) {
ALOGW("addInputEffects(): failed to create Fx %s on source %d",
@@ -254,7 +254,7 @@ status_t AudioPolicyEffects::addOutputSessionEffects(audio_io_handle_t output,
Vector <EffectDesc *> effects = mOutputStreams.valueAt(index)->mEffects;
for (size_t i = 0; i < effects.size(); i++) {
EffectDesc *effect = effects[i];
- sp<AudioEffect> fx = new AudioEffect(NULL, &effect->mUuid, 0, 0, 0,
+ sp<AudioEffect> fx = new AudioEffect(NULL, String16("android"), &effect->mUuid, 0, 0, 0,
audioSession, output);
status_t status = fx->initCheck();
if (status != NO_ERROR && status != ALREADY_EXISTS) {
diff --git a/services/audiopolicy/AudioPolicyEffects.h b/services/audiopolicy/service/AudioPolicyEffects.h
index 3dec437..3dec437 100644
--- a/services/audiopolicy/AudioPolicyEffects.h
+++ b/services/audiopolicy/service/AudioPolicyEffects.h
diff --git a/services/audiopolicy/AudioPolicyInterfaceImpl.cpp b/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
index a45dbb3..65639c3 100644
--- a/services/audiopolicy/AudioPolicyInterfaceImpl.cpp
+++ b/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
@@ -28,7 +28,8 @@ namespace android {
status_t AudioPolicyService::setDeviceConnectionState(audio_devices_t device,
audio_policy_dev_state_t state,
- const char *device_address)
+ const char *device_address,
+ const char *device_name)
{
if (mAudioPolicyManager == NULL) {
return NO_INIT;
@@ -46,8 +47,8 @@ status_t AudioPolicyService::setDeviceConnectionState(audio_devices_t device,
ALOGV("setDeviceConnectionState()");
Mutex::Autolock _l(mLock);
- return mAudioPolicyManager->setDeviceConnectionState(device,
- state, device_address);
+ return mAudioPolicyManager->setDeviceConnectionState(device, state,
+ device_address, device_name);
}
audio_policy_dev_state_t AudioPolicyService::getDeviceConnectionState(
@@ -145,10 +146,12 @@ status_t AudioPolicyService::getOutputForAttr(const audio_attributes_t *attr,
audio_io_handle_t *output,
audio_session_t session,
audio_stream_type_t *stream,
+ uid_t uid,
uint32_t samplingRate,
audio_format_t format,
audio_channel_mask_t channelMask,
audio_output_flags_t flags,
+ audio_port_handle_t selectedDeviceId,
const audio_offload_info_t *offloadInfo)
{
if (mAudioPolicyManager == NULL) {
@@ -156,8 +159,17 @@ status_t AudioPolicyService::getOutputForAttr(const audio_attributes_t *attr,
}
ALOGV("getOutput()");
Mutex::Autolock _l(mLock);
- return mAudioPolicyManager->getOutputForAttr(attr, output, session, stream, samplingRate,
- format, channelMask, flags, offloadInfo);
+
+ // if the caller is us, trust the specified uid
+ if (IPCThreadState::self()->getCallingPid() != getpid_cached || uid == (uid_t)-1) {
+ uid_t newclientUid = IPCThreadState::self()->getCallingUid();
+ if (uid != (uid_t)-1 && uid != newclientUid) {
+ ALOGW("%s uid %d tried to pass itself off as %d", __FUNCTION__, newclientUid, uid);
+ }
+ uid = newclientUid;
+ }
+ return mAudioPolicyManager->getOutputForAttr(attr, output, session, stream, uid, samplingRate,
+ format, channelMask, flags, selectedDeviceId, offloadInfo);
}
status_t AudioPolicyService::startOutput(audio_io_handle_t output,
@@ -246,10 +258,12 @@ void AudioPolicyService::doReleaseOutput(audio_io_handle_t output,
status_t AudioPolicyService::getInputForAttr(const audio_attributes_t *attr,
audio_io_handle_t *input,
audio_session_t session,
+ uid_t uid,
uint32_t samplingRate,
audio_format_t format,
audio_channel_mask_t channelMask,
- audio_input_flags_t flags)
+ audio_input_flags_t flags,
+ audio_port_handle_t selectedDeviceId)
{
if (mAudioPolicyManager == NULL) {
return NO_INIT;
@@ -260,19 +274,28 @@ status_t AudioPolicyService::getInputForAttr(const audio_attributes_t *attr,
return BAD_VALUE;
}
- if (((attr->source == AUDIO_SOURCE_HOTWORD) && !captureHotwordAllowed()) ||
- ((attr->source == AUDIO_SOURCE_FM_TUNER) && !captureFmTunerAllowed())) {
+ if ((attr->source == AUDIO_SOURCE_HOTWORD) && !captureHotwordAllowed()) {
return BAD_VALUE;
}
sp<AudioPolicyEffects>audioPolicyEffects;
status_t status;
AudioPolicyInterface::input_type_t inputType;
+ // if the caller is us, trust the specified uid
+ if (IPCThreadState::self()->getCallingPid() != getpid_cached || uid == (uid_t)-1) {
+ uid_t newclientUid = IPCThreadState::self()->getCallingUid();
+ if (uid != (uid_t)-1 && uid != newclientUid) {
+ ALOGW("%s uid %d tried to pass itself off as %d", __FUNCTION__, newclientUid, uid);
+ }
+ uid = newclientUid;
+ }
+
{
Mutex::Autolock _l(mLock);
// the audio_in_acoustics_t parameter is ignored by get_input()
- status = mAudioPolicyManager->getInputForAttr(attr, input, session,
+ status = mAudioPolicyManager->getInputForAttr(attr, input, session, uid,
samplingRate, format, channelMask,
- flags, &inputType);
+ flags, selectedDeviceId,
+ &inputType);
audioPolicyEffects = mAudioPolicyEffects;
if (status == NO_ERROR) {
@@ -545,9 +568,6 @@ status_t AudioPolicyService::listAudioPorts(audio_port_role_t role,
unsigned int *generation)
{
Mutex::Autolock _l(mLock);
- if(!modifyAudioRoutingAllowed()) {
- return PERMISSION_DENIED;
- }
if (mAudioPolicyManager == NULL) {
return NO_INIT;
}
@@ -558,9 +578,6 @@ status_t AudioPolicyService::listAudioPorts(audio_port_role_t role,
status_t AudioPolicyService::getAudioPort(struct audio_port *port)
{
Mutex::Autolock _l(mLock);
- if(!modifyAudioRoutingAllowed()) {
- return PERMISSION_DENIED;
- }
if (mAudioPolicyManager == NULL) {
return NO_INIT;
}
@@ -601,9 +618,6 @@ status_t AudioPolicyService::listAudioPatches(unsigned int *num_patches,
unsigned int *generation)
{
Mutex::Autolock _l(mLock);
- if(!modifyAudioRoutingAllowed()) {
- return PERMISSION_DENIED;
- }
if (mAudioPolicyManager == NULL) {
return NO_INIT;
}
@@ -660,4 +674,26 @@ status_t AudioPolicyService::registerPolicyMixes(Vector<AudioMix> mixes, bool re
}
}
+status_t AudioPolicyService::startAudioSource(const struct audio_port_config *source,
+ const audio_attributes_t *attributes,
+ audio_io_handle_t *handle)
+{
+ Mutex::Autolock _l(mLock);
+ if (mAudioPolicyManager == NULL) {
+ return NO_INIT;
+ }
+
+ return mAudioPolicyManager->startAudioSource(source, attributes, handle);
+}
+
+status_t AudioPolicyService::stopAudioSource(audio_io_handle_t handle)
+{
+ Mutex::Autolock _l(mLock);
+ if (mAudioPolicyManager == NULL) {
+ return NO_INIT;
+ }
+
+ return mAudioPolicyManager->stopAudioSource(handle);
+}
+
}; // namespace android
diff --git a/services/audiopolicy/AudioPolicyInterfaceImplLegacy.cpp b/services/audiopolicy/service/AudioPolicyInterfaceImplLegacy.cpp
index b8846c6..13af3ef 100644
--- a/services/audiopolicy/AudioPolicyInterfaceImplLegacy.cpp
+++ b/services/audiopolicy/service/AudioPolicyInterfaceImplLegacy.cpp
@@ -33,7 +33,8 @@ namespace android {
status_t AudioPolicyService::setDeviceConnectionState(audio_devices_t device,
audio_policy_dev_state_t state,
- const char *device_address)
+ const char *device_address,
+ const char *device_name __unused)
{
if (mpAudioPolicy == NULL) {
return NO_INIT;
@@ -233,10 +234,12 @@ void AudioPolicyService::doReleaseOutput(audio_io_handle_t output,
status_t AudioPolicyService::getInputForAttr(const audio_attributes_t *attr,
audio_io_handle_t *input,
audio_session_t session,
+ uid_t uid __unused,
uint32_t samplingRate,
audio_format_t format,
audio_channel_mask_t channelMask,
- audio_input_flags_t flags __unused)
+ audio_input_flags_t flags __unused,
+ audio_port_handle_t selectedDeviceId __unused)
{
if (mpAudioPolicy == NULL) {
return NO_INIT;
@@ -254,8 +257,7 @@ status_t AudioPolicyService::getInputForAttr(const audio_attributes_t *attr,
inputSource = AUDIO_SOURCE_MIC;
}
- if (((inputSource == AUDIO_SOURCE_HOTWORD) && !captureHotwordAllowed()) ||
- ((inputSource == AUDIO_SOURCE_FM_TUNER) && !captureFmTunerAllowed())) {
+ if ((inputSource == AUDIO_SOURCE_HOTWORD) && !captureHotwordAllowed()) {
return BAD_VALUE;
}
@@ -564,10 +566,12 @@ status_t AudioPolicyService::getOutputForAttr(const audio_attributes_t *attr,
audio_io_handle_t *output,
audio_session_t session __unused,
audio_stream_type_t *stream,
+ uid_t uid __unused,
uint32_t samplingRate,
audio_format_t format,
audio_channel_mask_t channelMask,
audio_output_flags_t flags,
+ audio_port_handle_t selectedDeviceId __unused,
const audio_offload_info_t *offloadInfo)
{
if (attr != NULL) {
@@ -603,4 +607,16 @@ status_t AudioPolicyService::registerPolicyMixes(Vector<AudioMix> mixes __unused
return INVALID_OPERATION;
}
+status_t AudioPolicyService::startAudioSource(const struct audio_port_config *source,
+ const audio_attributes_t *attributes,
+ audio_io_handle_t *handle)
+{
+ return INVALID_OPERATION;
+}
+
+status_t AudioPolicyService::stopAudioSource(audio_io_handle_t handle)
+{
+ return INVALID_OPERATION;
+}
+
}; // namespace android
diff --git a/services/audiopolicy/AudioPolicyService.cpp b/services/audiopolicy/service/AudioPolicyService.cpp
index eb9116d..eefff3d 100644
--- a/services/audiopolicy/AudioPolicyService.cpp
+++ b/services/audiopolicy/service/AudioPolicyService.cpp
@@ -166,6 +166,17 @@ void AudioPolicyService::registerClient(const sp<IAudioPolicyServiceClient>& cli
}
}
+void AudioPolicyService::setAudioPortCallbacksEnabled(bool enabled)
+{
+ Mutex::Autolock _l(mNotificationClientsLock);
+
+ uid_t uid = IPCThreadState::self()->getCallingUid();
+ if (mNotificationClients.indexOfKey(uid) < 0) {
+ return;
+ }
+ mNotificationClients.valueFor(uid)->setAudioPortCallbacksEnabled(enabled);
+}
+
// removeNotificationClient() is called when the client process dies.
void AudioPolicyService::removeNotificationClient(uid_t uid)
{
@@ -177,7 +188,7 @@ void AudioPolicyService::removeNotificationClient(uid_t uid)
{
Mutex::Autolock _l(mLock);
if (mAudioPolicyManager) {
- mAudioPolicyManager->clearAudioPatches(uid);
+ mAudioPolicyManager->releaseResourcesForUid(uid);
}
}
#endif
@@ -222,6 +233,21 @@ void AudioPolicyService::doOnAudioPatchListUpdate()
}
}
+void AudioPolicyService::onDynamicPolicyMixStateUpdate(String8 regId, int32_t state)
+{
+ ALOGV("AudioPolicyService::onDynamicPolicyMixStateUpdate(%s, %d)",
+ regId.string(), state);
+ mOutputCommandThread->dynamicPolicyMixStateUpdateCommand(regId, state);
+}
+
+void AudioPolicyService::doOnDynamicPolicyMixStateUpdate(String8 regId, int32_t state)
+{
+ Mutex::Autolock _l(mNotificationClientsLock);
+ for (size_t i = 0; i < mNotificationClients.size(); i++) {
+ mNotificationClients.valueAt(i)->onDynamicPolicyMixStateUpdate(regId, state);
+ }
+}
+
status_t AudioPolicyService::clientSetAudioPortConfig(const struct audio_port_config *config,
int delayMs)
{
@@ -231,7 +257,8 @@ status_t AudioPolicyService::clientSetAudioPortConfig(const struct audio_port_co
AudioPolicyService::NotificationClient::NotificationClient(const sp<AudioPolicyService>& service,
const sp<IAudioPolicyServiceClient>& client,
uid_t uid)
- : mService(service), mUid(uid), mAudioPolicyServiceClient(client)
+ : mService(service), mUid(uid), mAudioPolicyServiceClient(client),
+ mAudioPortCallbacksEnabled(false)
{
}
@@ -250,18 +277,32 @@ void AudioPolicyService::NotificationClient::binderDied(const wp<IBinder>& who _
void AudioPolicyService::NotificationClient::onAudioPortListUpdate()
{
- if (mAudioPolicyServiceClient != 0) {
+ if (mAudioPolicyServiceClient != 0 && mAudioPortCallbacksEnabled) {
mAudioPolicyServiceClient->onAudioPortListUpdate();
}
}
void AudioPolicyService::NotificationClient::onAudioPatchListUpdate()
{
- if (mAudioPolicyServiceClient != 0) {
+ if (mAudioPolicyServiceClient != 0 && mAudioPortCallbacksEnabled) {
mAudioPolicyServiceClient->onAudioPatchListUpdate();
}
}
+void AudioPolicyService::NotificationClient::onDynamicPolicyMixStateUpdate(
+ String8 regId, int32_t state)
+{
+ if (mAudioPolicyServiceClient != 0) {
+ mAudioPolicyServiceClient->onDynamicPolicyMixStateUpdate(regId, state);
+ }
+}
+
+void AudioPolicyService::NotificationClient::setAudioPortCallbacksEnabled(bool enabled)
+{
+ mAudioPortCallbacksEnabled = enabled;
+}
+
+
void AudioPolicyService::binderDied(const wp<IBinder>& who) {
ALOGW("binderDied() %p, calling pid %d", who.unsafe_get(),
IPCThreadState::self()->getCallingPid());
@@ -511,6 +552,20 @@ bool AudioPolicyService::AudioCommandThread::threadLoop()
command->mStatus = af->setAudioPortConfig(&data->mConfig);
}
} break;
+ case DYN_POLICY_MIX_STATE_UPDATE: {
+ DynPolicyMixStateUpdateData *data =
+ (DynPolicyMixStateUpdateData *)command->mParam.get();
+ //###ALOGV("AudioCommandThread() processing dyn policy mix state update");
+ ALOGV("AudioCommandThread() processing dyn policy mix state update %s %d",
+ data->mRegId.string(), data->mState);
+ svc = mService.promote();
+ if (svc == 0) {
+ break;
+ }
+ mLock.unlock();
+ svc->doOnDynamicPolicyMixStateUpdate(data->mRegId, data->mState);
+ mLock.lock();
+ } break;
default:
ALOGW("AudioCommandThread() unknown command %d", command->mCommand);
}
@@ -532,7 +587,7 @@ bool AudioPolicyService::AudioCommandThread::threadLoop()
mLock.unlock();
svc.clear();
mLock.lock();
- if (!exitPending() && mAudioCommands.isEmpty()) {
+ if (!exitPending() && (mAudioCommands.isEmpty() || waitTime != INT64_MAX)) {
// release delayed commands wake lock
release_wake_lock(mName.string());
ALOGV("AudioCommandThread() going to sleep");
@@ -747,6 +802,20 @@ status_t AudioPolicyService::AudioCommandThread::setAudioPortConfigCommand(
return sendCommand(command, delayMs);
}
+void AudioPolicyService::AudioCommandThread::dynamicPolicyMixStateUpdateCommand(
+ String8 regId, int32_t state)
+{
+ sp<AudioCommand> command = new AudioCommand();
+ command->mCommand = DYN_POLICY_MIX_STATE_UPDATE;
+ DynPolicyMixStateUpdateData *data = new DynPolicyMixStateUpdateData();
+ data->mRegId = regId;
+ data->mState = state;
+ command->mParam = data;
+ ALOGV("AudioCommandThread() sending dynamic policy mix (id=%s) state update to %d",
+ regId.string(), state);
+ sendCommand(command);
+}
+
status_t AudioPolicyService::AudioCommandThread::sendCommand(sp<AudioCommand>& command, int delayMs)
{
{
@@ -861,6 +930,7 @@ void AudioPolicyService::AudioCommandThread::insertCommand_l(sp<AudioCommand>& c
patch2 = ((CreateAudioPatchData *)command2->mParam.get())->mPatch;
} else {
handle2 = ((ReleaseAudioPatchData *)command2->mParam.get())->mHandle;
+ memset(&patch2, 0, sizeof(patch2));
}
if (handle != handle2) break;
/* Filter CREATE_AUDIO_PATCH commands only when they are issued for
@@ -888,6 +958,10 @@ void AudioPolicyService::AudioCommandThread::insertCommand_l(sp<AudioCommand>& c
delayMs = 1;
} break;
+ case DYN_POLICY_MIX_STATE_UPDATE: {
+
+ } break;
+
case START_TONE:
case STOP_TONE:
default:
diff --git a/services/audiopolicy/AudioPolicyService.h b/services/audiopolicy/service/AudioPolicyService.h
index 80284a4..a0d5aa2 100644
--- a/services/audiopolicy/AudioPolicyService.h
+++ b/services/audiopolicy/service/AudioPolicyService.h
@@ -35,7 +35,7 @@
#include <hardware_legacy/AudioPolicyInterface.h>
#endif
#include "AudioPolicyEffects.h"
-#include "AudioPolicyManager.h"
+#include "managerdefault/AudioPolicyManager.h"
namespace android {
@@ -61,7 +61,8 @@ public:
virtual status_t setDeviceConnectionState(audio_devices_t device,
audio_policy_dev_state_t state,
- const char *device_address);
+ const char *device_address,
+ const char *device_name);
virtual audio_policy_dev_state_t getDeviceConnectionState(
audio_devices_t device,
const char *device_address);
@@ -79,10 +80,12 @@ public:
audio_io_handle_t *output,
audio_session_t session,
audio_stream_type_t *stream,
+ uid_t uid,
uint32_t samplingRate = 0,
audio_format_t format = AUDIO_FORMAT_DEFAULT,
audio_channel_mask_t channelMask = 0,
audio_output_flags_t flags = AUDIO_OUTPUT_FLAG_NONE,
+ audio_port_handle_t selectedDeviceId = AUDIO_PORT_HANDLE_NONE,
const audio_offload_info_t *offloadInfo = NULL);
virtual status_t startOutput(audio_io_handle_t output,
audio_stream_type_t stream,
@@ -96,10 +99,12 @@ public:
virtual status_t getInputForAttr(const audio_attributes_t *attr,
audio_io_handle_t *input,
audio_session_t session,
+ uid_t uid,
uint32_t samplingRate,
audio_format_t format,
audio_channel_mask_t channelMask,
- audio_input_flags_t flags);
+ audio_input_flags_t flags,
+ audio_port_handle_t selectedDeviceId = AUDIO_PORT_HANDLE_NONE);
virtual status_t startInput(audio_io_handle_t input,
audio_session_t session);
virtual status_t stopInput(audio_io_handle_t input,
@@ -180,6 +185,8 @@ public:
virtual void registerClient(const sp<IAudioPolicyServiceClient>& client);
+ virtual void setAudioPortCallbacksEnabled(bool enabled);
+
virtual status_t acquireSoundTriggerSession(audio_session_t *session,
audio_io_handle_t *ioHandle,
audio_devices_t *device);
@@ -190,6 +197,11 @@ public:
virtual status_t registerPolicyMixes(Vector<AudioMix> mixes, bool registration);
+ virtual status_t startAudioSource(const struct audio_port_config *source,
+ const audio_attributes_t *attributes,
+ audio_io_handle_t *handle);
+ virtual status_t stopAudioSource(audio_io_handle_t handle);
+
status_t doStopOutput(audio_io_handle_t output,
audio_stream_type_t stream,
audio_session_t session);
@@ -211,6 +223,9 @@ public:
void onAudioPatchListUpdate();
void doOnAudioPatchListUpdate();
+ void onDynamicPolicyMixStateUpdate(String8 regId, int32_t state);
+ void doOnDynamicPolicyMixStateUpdate(String8 regId, int32_t state);
+
private:
AudioPolicyService() ANDROID_API;
virtual ~AudioPolicyService();
@@ -241,6 +256,7 @@ private:
UPDATE_AUDIOPORT_LIST,
UPDATE_AUDIOPATCH_LIST,
SET_AUDIOPORT_CONFIG,
+ DYN_POLICY_MIX_STATE_UPDATE
};
AudioCommandThread (String8 name, const wp<AudioPolicyService>& service);
@@ -278,6 +294,7 @@ private:
void updateAudioPatchListCommand();
status_t setAudioPortConfigCommand(const struct audio_port_config *config,
int delayMs);
+ void dynamicPolicyMixStateUpdateCommand(String8 regId, int32_t state);
void insertCommand_l(AudioCommand *command, int delayMs = 0);
private:
@@ -362,6 +379,12 @@ private:
struct audio_port_config mConfig;
};
+ class DynPolicyMixStateUpdateData : public AudioCommandData {
+ public:
+ String8 mRegId;
+ int32_t mState;
+ };
+
Mutex mLock;
Condition mWaitWorkCV;
Vector < sp<AudioCommand> > mAudioCommands; // list of pending commands
@@ -467,6 +490,7 @@ private:
virtual void onAudioPortListUpdate();
virtual void onAudioPatchListUpdate();
+ virtual void onDynamicPolicyMixStateUpdate(String8 regId, int32_t state);
virtual audio_unique_id_t newAudioUniqueId();
@@ -482,8 +506,10 @@ private:
uid_t uid);
virtual ~NotificationClient();
- void onAudioPortListUpdate();
- void onAudioPatchListUpdate();
+ void onAudioPortListUpdate();
+ void onAudioPatchListUpdate();
+ void onDynamicPolicyMixStateUpdate(String8 regId, int32_t state);
+ void setAudioPortCallbacksEnabled(bool enabled);
// IBinder::DeathRecipient
virtual void binderDied(const wp<IBinder>& who);
@@ -495,6 +521,7 @@ private:
const wp<AudioPolicyService> mService;
const uid_t mUid;
const sp<IAudioPolicyServiceClient> mAudioPolicyServiceClient;
+ bool mAudioPortCallbacksEnabled;
};
// Internal dump utilities.
diff --git a/services/audiopolicy/utilities/convert/convert.h b/services/audiopolicy/utilities/convert/convert.h
new file mode 100644
index 0000000..980b5d5
--- /dev/null
+++ b/services/audiopolicy/utilities/convert/convert.h
@@ -0,0 +1,383 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <limits>
+#include <sstream>
+#include <string>
+#include <vector>
+#include <stdint.h>
+#include <cmath>
+
+namespace android
+{
+
+namespace utilities
+{
+
+/**
+ * Convert a given source type to a given destination type.
+ *
+ * String conversion to T reads the value of the type T in the given string.
+ * The function does not allow to have white spaces around the value to parse
+ * and tries to parse the whole string, which means that if some bytes were not
+ * read in the string, the function fails.
+ * Hexadecimal representation (ie. numbers starting with 0x) is supported only
+ * for integral types conversions.
+ *
+ * Numeric conversion to string formats the source value to decimal space.
+ *
+ * Vector to vector conversion calls convertTo on each element.
+ *
+ * @tparam srcType source type, default value is string type
+ * @tparam dstType destination type
+ * @param[in] input The source to convert from.
+ * @param[out] result Converted value if success, undefined on failure.
+ *
+ * @return true if conversion was successful, false otherwise.
+ */
+template <typename srcType, typename dstType>
+static inline bool convertTo(const srcType &input, dstType &result);
+
+/* details namespace is here to hide implementation details to header end user. It
+ * is NOT intended to be used outside. */
+namespace details
+{
+
+/** Helper class to limit instantiation of templates */
+template <typename T>
+struct ConversionFromStringAllowed;
+template <typename T>
+struct ConversionToStringAllowed;
+
+/* List of allowed types for conversion */
+template <>
+struct ConversionFromStringAllowed<bool> {};
+template <>
+struct ConversionFromStringAllowed<uint64_t> {};
+template <>
+struct ConversionFromStringAllowed<int64_t> {};
+template <>
+struct ConversionFromStringAllowed<uint32_t> {};
+template <>
+struct ConversionFromStringAllowed<int32_t> {};
+template <>
+struct ConversionFromStringAllowed<uint16_t> {};
+template <>
+struct ConversionFromStringAllowed<int16_t> {};
+template <>
+struct ConversionFromStringAllowed<float> {};
+template <>
+struct ConversionFromStringAllowed<double> {};
+
+template <>
+struct ConversionToStringAllowed<int64_t> {};
+template <>
+struct ConversionToStringAllowed<uint64_t> {};
+template <>
+struct ConversionToStringAllowed<uint32_t> {};
+template <>
+struct ConversionToStringAllowed<int32_t> {};
+template <>
+struct ConversionToStringAllowed<double> {};
+template <>
+struct ConversionToStringAllowed<float> {};
+
+/**
+ * Set the decimal precision to 10 digits.
+ * Note that this setting is aligned with Android Audio Parameter
+ * policy concerning float storage into string.
+ */
+static const uint32_t gFloatPrecision = 10;
+
+template <typename T>
+static inline bool fromString(const std::string &str, T &result)
+{
+ /* Check that conversion to that type is allowed.
+ * If this fails, this means that this template was not intended to be used
+ * with this type, thus that the result is undefined. */
+ ConversionFromStringAllowed<T>();
+
+ if (str.find_first_of(std::string("\r\n\t\v ")) != std::string::npos) {
+ return false;
+ }
+
+ /* Check for a '-' in string. If type is unsigned and a - is found, the
+ * parsing fails. This is made necessary because "-1" is read as 65535 for
+ * uint16_t, for example */
+ if (str.find("-") != std::string::npos
+ && !std::numeric_limits<T>::is_signed) {
+ return false;
+ }
+
+ std::stringstream ss(str);
+
+ /* Sadly, the stream conversion does not handle hexadecimal format, thus
+ * check is done manually */
+ if (str.substr(0, 2) == "0x") {
+ if (std::numeric_limits<T>::is_integer) {
+ ss >> std::hex >> result;
+ } else {
+ /* Conversion undefined for non integers */
+ return false;
+ }
+ } else {
+ ss >> result;
+ }
+
+ return ss.eof() && !ss.fail() && !ss.bad();
+}
+
+template <typename T>
+static inline bool toString(const T &value, std::string &str)
+{
+ /* Check that conversion from that type is allowed.
+ * If this fails, this means that this template was not intended to be used
+ * with this type, thus that the result is undefined. */
+ ConversionToStringAllowed<T>();
+
+ std::stringstream oss;
+ oss.precision(gFloatPrecision);
+ oss << value;
+ str = oss.str();
+ return !oss.fail() && !oss.bad();
+}
+
+template <typename srcType, typename dstType>
+class Converter;
+
+template <typename dstType>
+class Converter<std::string, dstType>
+{
+public:
+ static inline bool run(const std::string &str, dstType &result)
+ {
+ return fromString<dstType>(str, result);
+ }
+};
+
+template <typename srcType>
+class Converter<srcType, std::string>
+{
+public:
+ static inline bool run(const srcType &str, std::string &result)
+ {
+ return toString<srcType>(str, result);
+ }
+};
+
+/** Convert a vector by applying convertTo on each element.
+ *
+ * @tparam SrcElem Type of the src elements.
+ * @tparam DstElem Type of the destination elements.
+ */
+template <typename SrcElem, typename DstElem>
+class Converter<std::vector<SrcElem>, std::vector<DstElem> >
+{
+public:
+ typedef const std::vector<SrcElem> Src;
+ typedef std::vector<DstElem> Dst;
+
+ static inline bool run(Src &src, Dst &dst)
+ {
+ typedef typename Src::const_iterator SrcIt;
+ dst.clear();
+ dst.reserve(src.size());
+ for (SrcIt it = src.begin(); it != src.end(); ++it) {
+ DstElem dstElem;
+ if (not convertTo(*it, dstElem)) {
+ return false;
+ }
+ dst.push_back(dstElem);
+ }
+ return true;
+ }
+};
+
+} // namespace details
+
+template <typename srcType, typename dstType>
+static inline bool convertTo(const srcType &input, dstType &result)
+{
+ return details::Converter<srcType, dstType>::run(input, result);
+}
+
+/**
+ * Specialization for int16_t of convertTo template function.
+ *
+ * This function follows the same paradigm than it's generic version.
+ *
+ * The specific implementation is made necessary because the stlport version of
+ * string streams is bugged and does not fail when giving overflowed values.
+ * This specialisation can be safely removed when stlport behaviour is fixed.
+ *
+ * @param[in] str the string to parse.
+ * @param[out] result reference to object where to store the result.
+ *
+ * @return true if conversion was successful, false otherwise.
+ */
+template <>
+inline bool convertTo<std::string, int16_t>(const std::string &str, int16_t &result)
+{
+ int64_t res;
+
+ if (!convertTo<std::string, int64_t>(str, res)) {
+ return false;
+ }
+
+ if (res > std::numeric_limits<int16_t>::max() || res < std::numeric_limits<int16_t>::min()) {
+ return false;
+ }
+
+ result = static_cast<int16_t>(res);
+ return true;
+}
+
+/**
+ * Specialization for float of convertTo template function.
+ *
+ * This function follows the same paradigm than it's generic version and is
+ * based on it but makes furthers checks on the returned value.
+ *
+ * The specific implementation is made necessary because the stlport conversion
+ * from string to float behaves differently than GNU STL: overflow produce
+ * +/-Infinity rather than an error.
+ *
+ * @param[in] str the string to parse.
+ * @param[out] result reference to object where to store the result.
+ *
+ * @return true if conversion was successful, false otherwise.
+ */
+template <>
+inline bool convertTo<std::string, float>(const std::string &str, float &result)
+{
+ if (!details::Converter<std::string, float>::run(str, result)) {
+ return false;
+ }
+
+ if (std::abs(result) == std::numeric_limits<float>::infinity() ||
+ result == std::numeric_limits<float>::quiet_NaN()) {
+ return false;
+ }
+
+ return true;
+}
+
+/**
+ * Specialization for double of convertTo template function.
+ *
+ * This function follows the same paradigm than it's generic version and is
+ * based on it but makes furthers checks on the returned value.
+ *
+ * The specific implementation is made necessary because the stlport conversion
+ * from string to double behaves differently than GNU STL: overflow produce
+ * +/-Infinity rather than an error.
+ *
+ * @param[in] str the string to parse.
+ * @param[out] result reference to object where to store the result.
+ *
+ * @return true if conversion was successful, false otherwise.
+ */
+template <>
+inline bool convertTo<std::string, double>(const std::string &str, double &result)
+{
+ if (!details::Converter<std::string, double>::run(str, result)) {
+ return false;
+ }
+
+ if (std::abs(result) == std::numeric_limits<double>::infinity() ||
+ result == std::numeric_limits<double>::quiet_NaN()) {
+ return false;
+ }
+
+ return true;
+}
+
+/**
+ * Specialization for boolean of convertTo template function.
+ *
+ * This function follows the same paradigm than it's generic version.
+ * This function accepts to parse boolean as "0/1" or "false/true" or
+ * "FALSE/TRUE".
+ * The specific implementation is made necessary because the behaviour of
+ * string streams when parsing boolean values is not sufficient to fit our
+ * requirements. Indeed, parsing "true" will correctly parse the value, but the
+ * end of stream is not reached which makes the ss.eof() fails in the generic
+ * implementation.
+ *
+ * @param[in] str the string to parse.
+ * @param[out] result reference to object where to store the result.
+ *
+ * @return true if conversion was successful, false otherwise.
+ */
+template <>
+inline bool convertTo<std::string, bool>(const std::string &str, bool &result)
+{
+ if (str == "0" || str == "FALSE" || str == "false") {
+ result = false;
+ return true;
+ }
+
+ if (str == "1" || str == "TRUE" || str == "true") {
+ result = true;
+ return true;
+ }
+
+ return false;
+}
+
+/**
+ * Specialization for boolean to string of convertTo template function.
+ *
+ * This function follows the same paradigm than it's generic version.
+ * This function arbitrarily decides to return "false/true".
+ * It is compatible with the specialization from string to boolean.
+ *
+ * @param[in] isSet boolean to convert to a string.
+ * @param[out] result reference to object where to store the result.
+ *
+ * @return true if conversion was successful, false otherwise.
+ */
+template <>
+inline bool convertTo<bool, std::string>(const bool &isSet, std::string &result)
+{
+ result = isSet ? "true" : "false";
+ return true;
+}
+
+/**
+ * Specialization for string to string of convertTo template function.
+ *
+ * This function is a dummy conversion from string to string.
+ * In case of clients using template as well, this implementation avoids adding extra
+ * specialization to bypass the conversion from string to string.
+ *
+ * @param[in] str the string to parse.
+ * @param[out] result reference to object where to store the result.
+ *
+ * @return true if conversion was successful, false otherwise.
+ */
+template <>
+inline bool convertTo<std::string, std::string>(const std::string &str, std::string &result)
+{
+ result = str;
+ return true;
+}
+
+} // namespace utilities
+
+} // namespace android