1################################################################################################ 2# 3# @NOTE: 4# Audio Policy Engine configurable example for generic device build 5# 6# Any vendor shall have its own configuration within the corresponding device folder 7# 8################################################################################################ 9 10LOCAL_PATH := $(call my-dir) 11 12ifdef BUILD_AUDIO_POLICY_EXAMPLE_CONFIGURATION 13 14ifeq ($(BUILD_AUDIO_POLICY_EXAMPLE_CONFIGURATION),$(filter $(BUILD_AUDIO_POLICY_EXAMPLE_CONFIGURATION),phone_configurable automotive_configurable caremu_configurable no-output_configurable no-input_configurable)) 15 16PFW_CORE := external/parameter-framework 17#@TODO: upstream new domain generator 18#BUILD_PFW_SETTINGS := $(PFW_CORE)/support/android/build_pfw_settings.mk 19PFW_DEFAULT_SCHEMAS_DIR := $(PFW_CORE)/upstream/schemas 20PFW_SCHEMAS_DIR := $(PFW_DEFAULT_SCHEMAS_DIR) 21 22TOOLS := frameworks/av/services/audiopolicy/engineconfigurable/tools 23BUILD_PFW_SETTINGS := $(TOOLS)/build_audio_pfw_settings.mk 24 25PROVISION_STRATEGIES_STRUCTURE := $(TOOLS)/provision_strategies_structure.mk 26 27endif 28 29################################################################## 30# CONFIGURATION FILES 31################################################################## 32######### Policy PFW top level file ######### 33 34ifeq ($(BUILD_AUDIO_POLICY_EXAMPLE_CONFIGURATION),$(filter $(BUILD_AUDIO_POLICY_EXAMPLE_CONFIGURATION),phone_configurable automotive_configurable caremu_configurable)) 35 36include $(CLEAR_VARS) 37LOCAL_MODULE := ParameterFrameworkConfigurationPolicy.xml 38LOCAL_MODULE_TAGS := optional 39LOCAL_MODULE_CLASS := ETC 40LOCAL_VENDOR_MODULE := true 41LOCAL_MODULE_RELATIVE_PATH := parameter-framework 42LOCAL_SRC_FILES := $(LOCAL_MODULE).in 43LOCAL_REQUIRED_MODULES := \ 44 PolicySubsystem.xml \ 45 PolicyClass.xml 46 47# external/parameter-framework prevents from using debug interface 48AUDIO_PATTERN = @TUNING_ALLOWED@ 49ifeq ($(TARGET_BUILD_VARIANT),user) 50AUDIO_VALUE = false 51else 52AUDIO_VALUE = true 53endif 54 55LOCAL_POST_INSTALL_CMD := $(hide) sed -i -e 's|$(AUDIO_PATTERN)|$(AUDIO_VALUE)|g' $(TARGET_OUT_VENDOR_ETC)/$(LOCAL_MODULE_RELATIVE_PATH)/$(LOCAL_MODULE) 56 57include $(BUILD_PREBUILT) 58 59########## Policy PFW Common Structures ######### 60 61include $(CLEAR_VARS) 62LOCAL_MODULE := PolicySubsystem.xml 63LOCAL_MODULE_TAGS := optional 64LOCAL_MODULE_CLASS := ETC 65LOCAL_VENDOR_MODULE := true 66LOCAL_REQUIRED_MODULES := \ 67 PolicySubsystem-CommonTypes.xml \ 68 ProductStrategies.xml 69 70LOCAL_MODULE_RELATIVE_PATH := parameter-framework/Structure/Policy 71LOCAL_SRC_FILES := common/Structure/$(LOCAL_MODULE) 72include $(BUILD_PREBUILT) 73 74include $(CLEAR_VARS) 75LOCAL_MODULE := PolicySubsystem-CommonTypes.xml 76LOCAL_MODULE_TAGS := optional 77LOCAL_MODULE_CLASS := ETC 78LOCAL_VENDOR_MODULE := true 79LOCAL_MODULE_RELATIVE_PATH := parameter-framework/Structure/Policy 80LOCAL_SRC_FILES := common/Structure/$(LOCAL_MODULE) 81include $(BUILD_PREBUILT) 82 83include $(CLEAR_VARS) 84LOCAL_MODULE := PolicyClass.xml 85LOCAL_MODULE_TAGS := optional 86LOCAL_MODULE_CLASS := ETC 87LOCAL_VENDOR_MODULE := true 88LOCAL_MODULE_RELATIVE_PATH := parameter-framework/Structure/Policy 89LOCAL_SRC_FILES := common/Structure/$(LOCAL_MODULE) 90include $(BUILD_PREBUILT) 91 92 93include $(CLEAR_VARS) 94LOCAL_MODULE := ProductStrategies.xml 95LOCAL_MODULE_CLASS := ETC 96LOCAL_VENDOR_MODULE := true 97LOCAL_MODULE_RELATIVE_PATH := parameter-framework/Structure/Policy 98 99AUDIO_POLICY_ENGINE_CONFIGURATION_FILE := \ 100 $(TARGET_OUT_VENDOR_ETC)/audio_policy_engine_configuration.xml 101STRATEGIES_STRUCTURE_FILE := $(LOCAL_PATH)/common/Structure/$(LOCAL_MODULE).in 102 103include $(PROVISION_STRATEGIES_STRUCTURE) 104 105endif #ifeq ($(BUILD_AUDIO_POLICY_EXAMPLE_CONFIGURATION),$(filter $(BUILD_AUDIO_POLICY_EXAMPLE_CONFIGURATION),phone_configurable automotive_configurable caremu_configurable)) 106 107########## Policy PFW Example Structures ######### 108ifeq ($(BUILD_AUDIO_POLICY_EXAMPLE_CONFIGURATION),$(filter $(BUILD_AUDIO_POLICY_EXAMPLE_CONFIGURATION),no-output_configurable no-input_configurable)) 109 110include $(CLEAR_VARS) 111LOCAL_MODULE := PolicySubsystem.xml 112LOCAL_MODULE_TAGS := optional 113LOCAL_MODULE_CLASS := ETC 114LOCAL_VENDOR_MODULE := true 115LOCAL_REQUIRED_MODULES := PolicySubsystem-CommonTypes.xml 116 117LOCAL_MODULE_RELATIVE_PATH := parameter-framework/Structure/Policy 118LOCAL_SRC_FILES := common/Structure/$(LOCAL_MODULE) 119include $(BUILD_PREBUILT) 120 121include $(CLEAR_VARS) 122LOCAL_MODULE := ParameterFrameworkConfigurationPolicy-no-strategy.xml 123LOCAL_MODULE_STEM := ParameterFrameworkConfigurationPolicy.xml 124LOCAL_MODULE_TAGS := optional 125LOCAL_MODULE_CLASS := ETC 126LOCAL_VENDOR_MODULE := true 127LOCAL_MODULE_RELATIVE_PATH := parameter-framework 128LOCAL_SRC_FILES := $(LOCAL_MODULE).in 129LOCAL_REQUIRED_MODULES := \ 130 PolicySubsystem.xml \ 131 PolicyClass.xml 132AUDIO_VALUE = false 133LOCAL_POST_INSTALL_CMD := $(hide) sed -i -e 's|$(AUDIO_PATTERN)|$(AUDIO_VALUE)|g' $(TARGET_OUT_VENDOR_ETC)/$(LOCAL_MODULE_RELATIVE_PATH)/$(LOCAL_MODULE) 134 135include $(BUILD_PREBUILT) 136 137endif # ifeq ($(BUILD_AUDIO_POLICY_EXAMPLE_CONFIGURATION),$(filter $(BUILD_AUDIO_POLICY_EXAMPLE_CONFIGURATION),no-output_configurable no-input_configurable)) 138 139######### Policy PFW Settings - No Output ######### 140ifeq ($(BUILD_AUDIO_POLICY_EXAMPLE_CONFIGURATION),no-output_configurable) 141 142include $(CLEAR_VARS) 143LOCAL_MODULE := parameter-framework.policy 144LOCAL_MODULE_STEM := PolicyConfigurableDomains-NoOutputDevice.xml 145LOCAL_MODULE_CLASS := ETC 146LOCAL_VENDOR_MODULE := true 147LOCAL_MODULE_RELATIVE_PATH := parameter-framework/Settings/Policy 148 149PFW_TOPLEVEL_FILE := $(TARGET_OUT_VENDOR_ETC)/parameter-framework/ParameterFrameworkConfigurationPolicy.xml 150PFW_CRITERION_TYPES_FILE := $(TARGET_OUT_VENDOR_ETC)/audio_policy_engine_criterion_types.xml 151PFW_CRITERIA_FILE := $(TARGET_OUT_VENDOR_ETC)/audio_policy_engine_criteria.xml 152PFW_EDD_FILES := \ 153 $(LOCAL_PATH)/SettingsNoOutput/device_for_strategies.pfw \ 154 $(LOCAL_PATH)/Settings/device_for_input_source.pfw \ 155 $(LOCAL_PATH)/Settings/volumes.pfw 156LOCAL_REQUIRED_MODULES := libpolicy-subsystem 157include $(BUILD_PFW_SETTINGS) 158 159endif # ifeq ($(BUILD_AUDIO_POLICY_EXAMPLE_CONFIGURATION),no-output_configurable) 160######### Policy PFW Settings - No Input ######### 161ifeq ($(BUILD_AUDIO_POLICY_EXAMPLE_CONFIGURATION),no-input_configurable) 162 163include $(CLEAR_VARS) 164LOCAL_MODULE := parameter-framework.policy 165LOCAL_MODULE_STEM := PolicyConfigurableDomains-NoInputDevice.xml 166LOCAL_MODULE_CLASS := ETC 167LOCAL_VENDOR_MODULE := true 168LOCAL_MODULE_RELATIVE_PATH := parameter-framework/Settings/Policy 169 170PFW_TOPLEVEL_FILE := $(TARGET_OUT_VENDOR_ETC)/parameter-framework/ParameterFrameworkConfigurationPolicy.xml 171PFW_CRITERION_TYPES_FILE := $(TARGET_OUT_VENDOR_ETC)/audio_policy_engine_criterion_types.xml 172PFW_CRITERIA_FILE := $(TARGET_OUT_VENDOR_ETC)/audio_policy_engine_criteria.xml 173PFW_EDD_FILES := \ 174 $(LOCAL_PATH)/SettingsNoInput/device_for_input_source.pfw \ 175 $(LOCAL_PATH)/Settings/volumes.pfw 176LOCAL_REQUIRED_MODULES := libpolicy-subsystem 177include $(BUILD_PFW_SETTINGS) 178 179endif #ifeq ($(BUILD_AUDIO_POLICY_EXAMPLE_CONFIGURATION),no-input_configurable) 180####################################################################### 181# Recursive call sub-folder Android.mk 182####################################################################### 183 184include $(call all-makefiles-under,$(LOCAL_PATH)) 185 186endif #ifdef BUILD_AUDIO_POLICY_EXAMPLE_CONFIGURATION 187 188