1// Copyright (C) 2020 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_applicable_licenses: ["Android-Apache-2.0"],
17}
18
19cc_defaults {
20    name: "audiocontrol_hal_default_trout",
21    defaults: [
22        "hidl_defaults",
23    ],
24    shared_libs: [
25        "android.hardware.automotive.audiocontrol@2.0",
26        "libbase",
27        "libhidlbase",
28        "liblog",
29        "libutils",
30    ],
31}
32
33genrule {
34    name: "AudioFocusControlProtoStub_h",
35    tools: [
36        "aprotoc",
37        "protoc-gen-grpc-cpp-plugin",
38    ],
39    cmd: "$(location aprotoc) -I$$(dirname $(location proto/AudioFocusControl.proto)) -Iexternal/protobuf/src --plugin=protoc-gen-grpc=$(location protoc-gen-grpc-cpp-plugin) $(location proto/AudioFocusControl.proto) --grpc_out=$(genDir) --cpp_out=$(genDir)",
40    srcs: [
41        "proto/AudioFocusControl.proto",
42        ":libprotobuf-internal-protos",
43    ],
44    out: [
45        "AudioFocusControl.pb.h",
46        "AudioFocusControl.grpc.pb.h",
47    ],
48}
49
50genrule {
51    name: "AudioFocusControlProtoStub_cc",
52    tools: [
53        "aprotoc",
54        "protoc-gen-grpc-cpp-plugin",
55    ],
56    cmd: "$(location aprotoc) -I$$(dirname $(location proto/AudioFocusControl.proto)) -Iexternal/protobuf/src --plugin=protoc-gen-grpc=$(location protoc-gen-grpc-cpp-plugin) $(location proto/AudioFocusControl.proto) --grpc_out=$(genDir) --cpp_out=$(genDir)",
57    srcs: [
58        "proto/AudioFocusControl.proto",
59        ":libprotobuf-internal-protos",
60    ],
61    out: [
62        "AudioFocusControl.pb.cc",
63        "AudioFocusControl.grpc.pb.cc",
64    ],
65}
66
67cc_library {
68    name: "android.hardware.automotive.audiocontrol-server.trout",
69    vendor: true,
70    defaults: ["audiocontrol_hal_default_trout"],
71    srcs: [
72        "AudioControlServer.cpp",
73    ],
74    generated_headers: [
75        "AudioFocusControlProtoStub_h",
76        "audio_policy_configuration_V7_0",
77    ],
78    generated_sources: [
79        "AudioFocusControlProtoStub_cc",
80        "audio_policy_configuration_V7_0",
81    ],
82    header_libs: ["libxsdc-utils"],
83    shared_libs: [
84        "android.hardware.automotive.audiocontrol-V1-ndk",
85        "libgrpc++",
86        "libprotobuf-cpp-full",
87        "libbase",
88        "libbinder_ndk",
89        "libutils",
90        "liblog",
91        "libcutils",
92        "libxml2",
93    ],
94    cflags: [
95        "-Wno-unused-parameter",
96    ],
97}
98
99cc_binary {
100    name: "android.hardware.automotive.audiocontrol-service.trout",
101    relative_install_path: "hw",
102    init_rc: ["audiocontrol-trout.rc"],
103    vintf_fragments: ["audiocontrol-trout.xml"],
104    vendor: true,
105    generated_headers: ["audio_policy_configuration_V7_0"],
106    generated_sources: ["audio_policy_configuration_V7_0"],
107    header_libs: ["libxsdc-utils"],
108    shared_libs: [
109        "android.hardware.automotive.audiocontrol-server.trout",
110        "android.hardware.automotive.audiocontrol-V1-ndk",
111        "android.hardware.automotive.utils.watchdog",
112        "android.automotive.watchdog-V2-ndk",
113        "libbase",
114        "libbinder_ndk",
115        "libutils",
116        "liblog",
117        "libcutils",
118        "libxml2",
119    ],
120    srcs: [
121        "AudioControl.cpp",
122        "main.cpp",
123        "WatchdogClient.cpp"
124    ],
125    static_libs: [
126        "android.hardware.automotive.utils.vsockinfo",
127    ],
128}
129