1/*
2 * Copyright (C) 2019 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17// Import this namespace in order to use AOSP Phone configuration example
18
19soong_namespace {
20    imports: [
21        "frameworks/av/services/audiopolicy/engineconfigurable/config/example/phone",
22        "frameworks/av/services/audiopolicy/config",
23    ],
24}
25
26//
27// Generate Audio Policy Parameter Framework Product Strategies Structure file from template
28//
29prebuilt_etc {
30    name: "ProductStrategies.xml",
31    vendor: true,
32    src: ":buildstrategiesstructure_gen",
33    sub_dir: "parameter-framework/Structure/Policy",
34    required: ["libpolicy-subsystem"],
35}
36genrule {
37    name: "buildstrategiesstructure_gen",
38    defaults: ["buildstrategiesstructurerule"],
39    srcs: [
40        ":audio_policy_engine_configuration_files",
41    ],
42}
43
44//
45// Generate Audio Policy Parameter Framework Configurable Domains
46//
47prebuilt_etc {
48    name: "parameter-framework.policy",
49    filename_from_src: true,
50    vendor: true,
51    src: ":domaingeneratorpolicyrule_gen",
52    sub_dir: "parameter-framework/Settings/Policy",
53    required: [
54        "ProductStrategies.xml",
55        "PolicyClass.xml",
56        "PolicySubsystem.xml",
57        "PolicySubsystem-CommonTypes.xml",
58    ],
59}
60genrule {
61    name: "domaingeneratorpolicyrule_gen",
62    defaults: ["domaingeneratorpolicyrule"],
63    srcs: [
64        ":audio_policy_pfw_toplevel",
65        ":audio_policy_pfw_structure_files",
66        ":audio_policy_engine_criterion_types",
67        ":edd_files",
68    ],
69}
70filegroup {
71    name: "edd_files",
72    srcs: [
73        ":device_for_input_source.pfw",
74        ":volumes.pfw",
75        "Settings/device_for_product_strategy_media.pfw",
76        "Settings/device_for_product_strategy_accessibility.pfw",
77        "Settings/device_for_product_strategy_dtmf.pfw",
78        "Settings/device_for_product_strategy_enforced_audible.pfw",
79        "Settings/device_for_product_strategy_phone.pfw",
80        "Settings/device_for_product_strategy_sonification.pfw",
81        "Settings/device_for_product_strategy_sonification_respectful.pfw",
82        "Settings/device_for_product_strategy_transmitted_through_speaker.pfw",
83        "Settings/device_for_product_strategy_rerouting.pfw",
84        "Settings/device_for_product_strategy_patch.pfw",
85    ],
86}
87// This is for Settings generation, must use socket port, so userdebug version is required
88filegroup {
89    name: "audio_policy_pfw_toplevel",
90    srcs: [":ParameterFrameworkConfigurationPolicy.userdebug.xml"],
91}
92filegroup {
93    name: "audio_policy_pfw_structure_files",
94    srcs: [
95        ":PolicyClass",
96        ":PolicySubsystem",
97        ":buildcommontypesstructure_gen",
98        ":buildstrategiesstructure_gen",
99    ],
100}
101