Loading services/audiopolicy/engineconfigurable/Android.mk +3 −0 Original line number Diff line number Diff line ifeq ($(USE_CONFIGURABLE_AUDIO_POLICY), 1) LOCAL_PATH := $(call my-dir) Loading Loading @@ -57,3 +58,5 @@ include $(BUILD_SHARED_LIBRARY) # Recursive call sub-folder Android.mk # include $(call all-makefiles-under,$(LOCAL_PATH)) endif services/audiopolicy/engineconfigurable/parameter-framework/example/Android.mk +13 −17 Original line number Diff line number Diff line Loading @@ -10,6 +10,11 @@ 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 ################################################################## Loading Loading @@ -65,26 +70,19 @@ include $(BUILD_PREBUILT) ######### Policy PFW Settings ######### ######## Generate routing domains file ######## include $(CLEAR_VARS) LOCAL_MODULE := parameter-framework.policy LOCAL_MODULE_STEM := PolicyConfigurableDomains.xml LOCAL_MODULE_TAGS := optional LOCAL_REQUIRED_MODULES := \ LOCAL_MODULE_CLASS := ETC LOCAL_MODULE_RELATIVE_PATH := parameter-framework/Settings/Policy LOCAL_ADDITIONAL_DEPENDENCIES := \ PolicyClass.xml \ PolicySubsystem.xml \ ParameterFrameworkConfigurationPolicy.xml LOCAL_MODULE_CLASS := ETC LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/parameter-framework/Settings/Policy include $(BUILD_SYSTEM)/base_rules.mk $(LOCAL_BUILT_MODULE): MY_TOOL := $(HOST_OUT_EXECUTABLES)/hostDomainGenerator.sh $(LOCAL_BUILT_MODULE): $(HOST_OUT_EXECUTABLES)/hostDomainGenerator.sh $(LOCAL_BUILT_MODULE): MY_SRC_FILES := \ $(TARGET_OUT_ETC)/parameter-framework/ParameterFrameworkConfigurationPolicy.xml \ $(LOCAL_PATH)/policy_criteria.txt \ /dev/null \ 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 \ Loading @@ -97,8 +95,6 @@ $(LOCAL_BUILT_MODULE): MY_SRC_FILES := \ $(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 \ $(LOCAL_PATH)/Settings/volumes.pfw $(LOCAL_BUILT_MODULE): $(LOCAL_REQUIRED_MODULES) $(hide) mkdir -p $(dir $@) bash --debug $(MY_TOOL) --nonverbose --validate $(MY_SRC_FILES) > $@ include $(BUILD_PFW_SETTINGS) services/audiopolicy/engineconfigurable/parameter-framework/example/policy_criteria.txt +0 −5 Original line number Diff line number Diff line 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 services/audiopolicy/engineconfigurable/src/Engine.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -146,7 +146,7 @@ status_t Engine::add(const std::string &name, const Key &key) template <> routing_strategy Engine::getPropertyForKey<routing_strategy, audio_usage_t>(audio_usage_t usage) const { const AudioOutputCollection &outputs = mApmObserver->getOutputs(); const SwAudioOutputCollection &outputs = mApmObserver->getOutputs(); if (usage == AUDIO_USAGE_ASSISTANCE_ACCESSIBILITY && (outputs.isStreamActive(AUDIO_STREAM_RING) || Loading @@ -170,7 +170,7 @@ Property Engine::getPropertyForKey(Key key) const template <> audio_devices_t Engine::getPropertyForKey<audio_devices_t, routing_strategy>(routing_strategy strategy) const { const AudioOutputCollection &outputs = mApmObserver->getOutputs(); const SwAudioOutputCollection &outputs = mApmObserver->getOutputs(); /** This is the only case handled programmatically because the PFW is unable to know the * activity of streams. Loading Loading @@ -213,7 +213,7 @@ bool Engine::setPropertyForKey(const Property &property, const Key &key) return element->template set<Property>(property) == NO_ERROR; } float Engine::volIndexToAmpl(Volume::device_category category, float Engine::volIndexToDb(Volume::device_category category, audio_stream_type_t streamType, int indexInUi) { Loading @@ -222,7 +222,7 @@ float Engine::volIndexToAmpl(Volume::device_category category, ALOGE("%s: Element indexed by key=%d not found", __FUNCTION__, streamType); return 1.0f; } return stream->volIndexToAmpl(category, indexInUi); return stream->volIndexToDb(category, indexInUi); } status_t Engine::initStreamVolume(audio_stream_type_t streamType, Loading services/audiopolicy/engineconfigurable/src/Engine.h +5 −5 Original line number Diff line number Diff line Loading @@ -97,11 +97,11 @@ private: virtual void initializeVolumeCurves(bool /*isSpeakerDrcEnabled*/) {} virtual float volIndexToAmpl(Volume::device_category deviceCategory, virtual float volIndexToDb(Volume::device_category deviceCategory, audio_stream_type_t stream, int indexInUi) { return mPolicyEngine->volIndexToAmpl(deviceCategory, stream, indexInUi); return mPolicyEngine->volIndexToDb(deviceCategory, stream, indexInUi); } private: Loading Loading @@ -183,7 +183,7 @@ private: status_t setDeviceConnectionState(audio_devices_t devices, audio_policy_dev_state_t state, const char *deviceAddress); float volIndexToAmpl(Volume::device_category category, 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); Loading Loading
services/audiopolicy/engineconfigurable/Android.mk +3 −0 Original line number Diff line number Diff line ifeq ($(USE_CONFIGURABLE_AUDIO_POLICY), 1) LOCAL_PATH := $(call my-dir) Loading Loading @@ -57,3 +58,5 @@ include $(BUILD_SHARED_LIBRARY) # Recursive call sub-folder Android.mk # include $(call all-makefiles-under,$(LOCAL_PATH)) endif
services/audiopolicy/engineconfigurable/parameter-framework/example/Android.mk +13 −17 Original line number Diff line number Diff line Loading @@ -10,6 +10,11 @@ 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 ################################################################## Loading Loading @@ -65,26 +70,19 @@ include $(BUILD_PREBUILT) ######### Policy PFW Settings ######### ######## Generate routing domains file ######## include $(CLEAR_VARS) LOCAL_MODULE := parameter-framework.policy LOCAL_MODULE_STEM := PolicyConfigurableDomains.xml LOCAL_MODULE_TAGS := optional LOCAL_REQUIRED_MODULES := \ LOCAL_MODULE_CLASS := ETC LOCAL_MODULE_RELATIVE_PATH := parameter-framework/Settings/Policy LOCAL_ADDITIONAL_DEPENDENCIES := \ PolicyClass.xml \ PolicySubsystem.xml \ ParameterFrameworkConfigurationPolicy.xml LOCAL_MODULE_CLASS := ETC LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/parameter-framework/Settings/Policy include $(BUILD_SYSTEM)/base_rules.mk $(LOCAL_BUILT_MODULE): MY_TOOL := $(HOST_OUT_EXECUTABLES)/hostDomainGenerator.sh $(LOCAL_BUILT_MODULE): $(HOST_OUT_EXECUTABLES)/hostDomainGenerator.sh $(LOCAL_BUILT_MODULE): MY_SRC_FILES := \ $(TARGET_OUT_ETC)/parameter-framework/ParameterFrameworkConfigurationPolicy.xml \ $(LOCAL_PATH)/policy_criteria.txt \ /dev/null \ 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 \ Loading @@ -97,8 +95,6 @@ $(LOCAL_BUILT_MODULE): MY_SRC_FILES := \ $(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 \ $(LOCAL_PATH)/Settings/volumes.pfw $(LOCAL_BUILT_MODULE): $(LOCAL_REQUIRED_MODULES) $(hide) mkdir -p $(dir $@) bash --debug $(MY_TOOL) --nonverbose --validate $(MY_SRC_FILES) > $@ include $(BUILD_PFW_SETTINGS)
services/audiopolicy/engineconfigurable/parameter-framework/example/policy_criteria.txt +0 −5 Original line number Diff line number Diff line 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
services/audiopolicy/engineconfigurable/src/Engine.cpp +4 −4 Original line number Diff line number Diff line Loading @@ -146,7 +146,7 @@ status_t Engine::add(const std::string &name, const Key &key) template <> routing_strategy Engine::getPropertyForKey<routing_strategy, audio_usage_t>(audio_usage_t usage) const { const AudioOutputCollection &outputs = mApmObserver->getOutputs(); const SwAudioOutputCollection &outputs = mApmObserver->getOutputs(); if (usage == AUDIO_USAGE_ASSISTANCE_ACCESSIBILITY && (outputs.isStreamActive(AUDIO_STREAM_RING) || Loading @@ -170,7 +170,7 @@ Property Engine::getPropertyForKey(Key key) const template <> audio_devices_t Engine::getPropertyForKey<audio_devices_t, routing_strategy>(routing_strategy strategy) const { const AudioOutputCollection &outputs = mApmObserver->getOutputs(); const SwAudioOutputCollection &outputs = mApmObserver->getOutputs(); /** This is the only case handled programmatically because the PFW is unable to know the * activity of streams. Loading Loading @@ -213,7 +213,7 @@ bool Engine::setPropertyForKey(const Property &property, const Key &key) return element->template set<Property>(property) == NO_ERROR; } float Engine::volIndexToAmpl(Volume::device_category category, float Engine::volIndexToDb(Volume::device_category category, audio_stream_type_t streamType, int indexInUi) { Loading @@ -222,7 +222,7 @@ float Engine::volIndexToAmpl(Volume::device_category category, ALOGE("%s: Element indexed by key=%d not found", __FUNCTION__, streamType); return 1.0f; } return stream->volIndexToAmpl(category, indexInUi); return stream->volIndexToDb(category, indexInUi); } status_t Engine::initStreamVolume(audio_stream_type_t streamType, Loading
services/audiopolicy/engineconfigurable/src/Engine.h +5 −5 Original line number Diff line number Diff line Loading @@ -97,11 +97,11 @@ private: virtual void initializeVolumeCurves(bool /*isSpeakerDrcEnabled*/) {} virtual float volIndexToAmpl(Volume::device_category deviceCategory, virtual float volIndexToDb(Volume::device_category deviceCategory, audio_stream_type_t stream, int indexInUi) { return mPolicyEngine->volIndexToAmpl(deviceCategory, stream, indexInUi); return mPolicyEngine->volIndexToDb(deviceCategory, stream, indexInUi); } private: Loading Loading @@ -183,7 +183,7 @@ private: status_t setDeviceConnectionState(audio_devices_t devices, audio_policy_dev_state_t state, const char *deviceAddress); float volIndexToAmpl(Volume::device_category category, 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); Loading