• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright (C) 2018 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//       http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package {
16    default_team: "trendy_team_android_media_audio_framework",
17    // See: http://go/android-license-faq
18    // A large-scale-change added 'default_applicable_licenses' to import
19    // all of the 'license_kinds' from "frameworks_av_license"
20    // to get the below license kinds:
21    //   SPDX-license-identifier-Apache-2.0
22    default_applicable_licenses: ["frameworks_av_license"],
23}
24
25//##################################################################################################
26// Tools for audio policy engine criterion type configuration file
27//
28python_binary_host {
29    name: "buildPolicyCriterionTypes",
30    main: "buildPolicyCriterionTypes.py",
31    srcs: [
32        "buildPolicyCriterionTypes.py",
33    ],
34}
35
36genrule_defaults {
37    name: "buildpolicycriteriontypesrule",
38    tools: ["buildPolicyCriterionTypes"],
39    cmd: "cp $(locations :audio_policy_configuration_files) $(genDir)/. && " +
40        "cp $(location :audio_policy_configuration_top_file) $(genDir)/audio_policy_configuration.xml && " +
41        "$(location buildPolicyCriterionTypes) " +
42        " --androidaudiobaseheader $(location :libaudio_system_audio_base) " +
43        " --androidaudiocommonbaseheader $(location :libaudio_system_audio_common_base) " +
44        "--audiopolicyconfigurationfile $(genDir)/audio_policy_configuration.xml " +
45        "--criteriontypes $(location :audio_policy_engine_criterion_types_template) " +
46        "--outputfile $(out)",
47    srcs: [
48        // The commented inputs must be provided to use this genrule_defaults
49        // @todo uncomment if 1428659 is merged":android_audio_base_header_file",
50        ":audio_policy_engine_criterion_types_template",
51        ":libaudio_system_audio_base",
52        ":libaudio_system_audio_common_base",
53        // ":audio_policy_configuration_top_file",
54        // ":audio_policy_configuration_files",
55    ],
56    out: ["audio_policy_engine_criterion_types.xml"],
57}
58
59//##################################################################################################
60// Tools for audio policy engine parameter framework configurable domains
61//
62python_binary_host {
63    name: "domainGeneratorPolicy",
64    main: "domainGeneratorPolicy.py",
65    srcs: [
66        "domainGeneratorPolicy.py",
67    ],
68    libs: [
69        "EddParser.py",
70        "PFWScriptGenerator.py",
71        "hostConfig.py",
72    ],
73    required: [
74        "domainGeneratorConnector",
75    ],
76}
77
78genrule_defaults {
79    name: "domaingeneratorpolicyrule",
80    tools: [
81        "domainGeneratorConnector",
82        "domainGeneratorPolicy",
83    ],
84    cmd: "mkdir -p $(genDir)/Structure/Policy && " +
85        "cp $(locations :audio_policy_pfw_structure_files) $(genDir)/Structure/Policy && " +
86        "cp $(location :audio_policy_pfw_toplevel) $(genDir)/top_level && " +
87        "$(location domainGeneratorPolicy) " +
88        "--validate " +
89        "--domain-generator-tool $(location domainGeneratorConnector) " +
90        "--toplevel-config $(genDir)/top_level " +
91        "--criteria $(location :audio_policy_engine_criteria) " +
92        "--criteriontypes $(location :audio_policy_engine_criterion_types) " +
93        "--add-edds $(locations :edd_files) " +
94        "--schemas-dir external/parameter-framework/upstream/schemas " +
95        " > $(out)",
96    srcs: [
97        // The commented inputs must be provided to use this genrule_defaults
98        // ":audio_policy_pfw_toplevel",
99        // ":audio_policy_pfw_structure_files",
100        ":audio_policy_engine_criteria",
101        // ":audio_policy_engine_criterion_types",
102        // ":edd_files",
103        ":parameter_frameworks_configuration_schemas",
104    ],
105    out: ["PolicyConfigurableDomains.xml"],
106}
107
108//##################################################################################################
109// Tools for policy parameter-framework product strategies structure file generation
110//
111python_binary_host {
112    name: "buildStrategiesStructureFile",
113    main: "buildStrategiesStructureFile.py",
114    srcs: [
115        "buildStrategiesStructureFile.py",
116    ],
117}
118
119genrule_defaults {
120    name: "buildstrategiesstructurerule",
121    tools: ["buildStrategiesStructureFile"],
122    cmd: "cp $(locations :audio_policy_engine_configuration_files) $(genDir) && ls -l $(genDir) &&" +
123        "$(location buildStrategiesStructureFile) " +
124        "--audiopolicyengineconfigurationfile $(genDir)/audio_policy_engine_configuration.xml " +
125        "--productstrategiesstructurefile $(location :product_strategies_structure_template) " +
126        "--outputfile $(out)",
127    srcs: [
128        // The commented inputs must be provided to use this genrule_defaults
129        // ":audio_policy_engine_configuration_files",
130        ":product_strategies_structure_template",
131    ],
132    out: ["ProductStrategies.xml"],
133}
134
135//##################################################################################################
136// Tools for policy parameter-framework common type structure file generation
137//
138python_binary_host {
139    name: "buildCommonTypesStructureFile",
140    main: "buildCommonTypesStructureFile.py",
141    srcs: [
142        "buildCommonTypesStructureFile.py",
143    ],
144}
145
146genrule_defaults {
147    name: "buildcommontypesstructurerule",
148    tools: ["buildCommonTypesStructureFile"],
149    cmd: "$(location buildCommonTypesStructureFile) " +
150        "--androidaudiobaseheader $(location :libaudio_system_audio_base) " +
151        "--commontypesstructure $(location :common_types_structure_template) " +
152        "--outputfile $(out)",
153    srcs: [
154        ":common_types_structure_template",
155        ":libaudio_system_audio_base",
156    ],
157    out: ["PolicySubsystem-CommonTypes.xml"],
158}
159