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 Automotive configuration example
18
19soong_namespace {
20    imports: [
21        "frameworks/av/services/audiopolicy/config",
22        "frameworks/av/services/audiopolicy/engineconfigurable/config/example/automotive",
23    ],
24}
25
26//
27// Generate Audio Policy Parameter Framework Product Strategies Structure file from template
28//
29package {
30    default_team: "trendy_team_android_media_audio_framework",
31    // See: http://go/android-license-faq
32    // A large-scale-change added 'default_applicable_licenses' to import
33    // all of the 'license_kinds' from "frameworks_av_license"
34    // to get the below license kinds:
35    //   SPDX-license-identifier-Apache-2.0
36    default_applicable_licenses: ["frameworks_av_license"],
37}
38
39prebuilt_etc {
40    name: "ProductStrategies.xml",
41    vendor: true,
42    src: ":buildstrategiesstructure_gen",
43    sub_dir: "parameter-framework/Structure/Policy",
44    required: ["libpolicy-subsystem"],
45}
46
47genrule {
48    name: "buildstrategiesstructure_gen",
49    defaults: ["buildstrategiesstructurerule"],
50    srcs: [
51        ":audio_policy_engine_configuration_files",
52    ],
53}
54
55//
56// Generate Audio Policy Parameter Framework Configurable Domains
57//
58prebuilt_etc {
59    name: "parameter-framework.policy",
60    enabled: false, // TODO: This module depends on domaingeneratorpolicyrule_gen, which fails to build
61    filename_from_src: true,
62    vendor: true,
63    src: ":domaingeneratorpolicyrule_gen",
64    sub_dir: "parameter-framework/Settings/Policy",
65    required: [
66        "PolicyClass.xml",
67        "PolicySubsystem-CommonTypes.xml",
68        "PolicySubsystem.xml",
69        "ProductStrategies.xml",
70    ],
71}
72
73genrule {
74    name: "domaingeneratorpolicyrule_gen",
75    enabled: false, // TODO: This module fails to build
76    defaults: ["domaingeneratorpolicyrule"],
77    srcs: [
78        ":audio_policy_engine_criterion_types",
79        ":audio_policy_pfw_structure_files",
80        ":audio_policy_pfw_toplevel",
81        ":edd_files",
82    ],
83}
84
85filegroup {
86    name: "edd_files",
87    srcs: [
88        ":device_for_input_source.pfw",
89        ":volumes.pfw",
90        "Settings/device_for_product_strategies.pfw",
91    ],
92}
93
94// This is for Settings generation, must use socket port, so userdebug version is required
95filegroup {
96    name: "audio_policy_pfw_toplevel",
97    srcs: [":ParameterFrameworkConfigurationPolicy.userdebug.xml"],
98}
99
100filegroup {
101    name: "audio_policy_pfw_structure_files",
102    srcs: [
103        ":PolicyClass",
104        ":PolicySubsystem",
105        ":buildcommontypesstructure_gen",
106        ":buildstrategiesstructure_gen",
107    ],
108}
109