• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1subdirs = [
2    "common",
3]
4
5cc_defaults {
6    name: "fluoride_service_defaults",
7    defaults: ["fluoride_defaults"],
8    include_dirs: [
9        "system/bt",
10    ],
11    header_libs: [ "libbluetooth_headers" ],
12}
13
14// Source variables
15// ========================================================
16btserviceDaemonSrc = [
17    "a2dp_sink.cc",
18    "a2dp_source.cc",
19    "adapter.cc",
20    "avrcp_control.cc",
21    "avrcp_target.cc",
22    "daemon.cc",
23    "gatt_client.cc",
24    "gatt_server.cc",
25    "gatt_server_old.cc",
26    "hal/bluetooth_av_interface.cc",
27    "hal/bluetooth_avrcp_interface.cc",
28    "hal/bluetooth_gatt_interface.cc",
29    "hal/bluetooth_interface.cc",
30    "ipc/ipc_handler.cc",
31    "ipc/ipc_manager.cc",
32    "logging_helpers.cc",
33    "low_energy_advertiser.cc",
34    "low_energy_scanner.cc",
35    "low_energy_client.cc",
36    "settings.cc",
37]
38
39btserviceLinuxSrc = [
40    "ipc/ipc_handler_linux.cc",
41    "ipc/linux_ipc_host.cc",
42]
43
44btserviceBinderDaemonSrc = [
45    "ipc/binder/bluetooth_a2dp_sink_binder_server.cc",
46    "ipc/binder/bluetooth_a2dp_source_binder_server.cc",
47    "ipc/binder/bluetooth_avrcp_control_binder_server.cc",
48    "ipc/binder/bluetooth_avrcp_target_binder_server.cc",
49    "ipc/binder/bluetooth_binder_server.cc",
50    "ipc/binder/bluetooth_gatt_client_binder_server.cc",
51    "ipc/binder/bluetooth_gatt_server_binder_server.cc",
52    "ipc/binder/bluetooth_le_advertiser_binder_server.cc",
53    "ipc/binder/bluetooth_le_scanner_binder_server.cc",
54    "ipc/binder/bluetooth_low_energy_binder_server.cc",
55    "ipc/binder/interface_with_instances_base.cc",
56    "ipc/binder/ipc_handler_binder.cc",
57]
58
59// Main unit test sources. These get built for host and target.
60// ========================================================
61btserviceBaseTestSrc = [
62    "hal/fake_bluetooth_av_interface.cc",
63    "hal/fake_bluetooth_gatt_interface.cc",
64    "hal/fake_bluetooth_interface.cc",
65    "test/a2dp_sink_unittest.cc",
66    "test/adapter_unittest.cc",
67    "test/advertise_data_unittest.cc",
68    "test/fake_hal_util.cc",
69    "test/gatt_client_unittest.cc",
70    "test/gatt_server_unittest.cc",
71    "test/low_energy_advertiser_unittest.cc",
72    "test/low_energy_client_unittest.cc",
73    "test/low_energy_scanner_unittest.cc",
74    "test/settings_unittest.cc",
75]
76
77// Native system service for target
78// ========================================================
79cc_binary {
80    name: "bluetoothtbd",
81    defaults: ["fluoride_service_defaults"],
82    srcs: btserviceBinderDaemonSrc +
83    btserviceLinuxSrc +
84    btserviceDaemonSrc +
85    ["main.cc"],
86    static_libs: [
87        "libbluetooth-binder-common",
88        "libbtcore",
89        "libbluetooth-types",
90        "libosi",
91    ],
92
93    shared_libs: [
94        "libchrome",
95        "libbinder",
96        "libcutils",
97        "liblog",
98        "libutils",
99    ],
100    init_rc: ["bluetoothtbd.rc"],
101}
102
103// Native system service unit tests for target and host
104
105// ========================================================
106cc_test {
107    name: "bluetoothtbd_test",
108    test_suites: ["device-tests"],
109    defaults: ["fluoride_service_defaults"],
110    srcs: btserviceBaseTestSrc +
111    btserviceDaemonSrc + [
112        "test/main.cc",
113    ],
114    aidl: {
115        include_dirs: [
116            "system/bt/service/common",
117            "frameworks/native/aidl/binder",
118        ],
119    },
120    static_libs: [
121        "libbluetooth-common",
122        "libgmock",
123        "liblog",
124        "libbluetooth-types",
125        "libutils",
126    ],
127    shared_libs: [
128        "libchrome",
129    ],
130
131    host_supported: true,
132    target: {
133        // This includes Binder related tests that can only be run
134        // on target.
135        android: {
136            srcs: btserviceBinderDaemonSrc + [
137                "test/parcelable_unittest.cc",
138                "test/ParcelableTest.aidl",
139            ],
140            static_libs: [
141                "libbluetooth-binder-common",
142            ],
143            shared_libs: [
144                "libbinder",
145            ],
146        },
147        host: {
148            srcs: [
149                "test/stub_ipc_handler_binder.cc",
150            ],
151        },
152        linux_glibc: {
153            srcs: btserviceLinuxSrc + [
154                // TODO(bcf): Fix this test.
155                //"test/ipc_linux_unittest.cc",
156            ],
157        },
158    },
159    sanitize: {
160        cfi: false,
161    },
162}
163
164// Native system service CLI for target
165// ========================================================
166cc_binary {
167    name: "bluetooth-cli",
168    defaults: ["fluoride_defaults"],
169    srcs: ["client/main.cc"],
170    static_libs: [
171        "libbluetooth-binder-common",
172    ],
173    shared_libs: [
174        "libbinder",
175        "libutils",
176    ],
177}
178
179// Heart Rate GATT service example for target
180// ========================================================
181cc_binary {
182    name: "bt-example-hr-server",
183    defaults: ["fluoride_defaults"],
184    local_include_dirs: ["example/heart_rate"],
185    srcs: [
186        "example/heart_rate/heart_rate_server.cc",
187        "example/heart_rate/server_main.cc",
188    ],
189    static_libs: [
190        "libbluetooth-binder-common",
191    ],
192    shared_libs: [
193        "libbinder",
194        "libutils",
195    ],
196}
197
198cc_library_static {
199    name: "libbluetoothtbd_hal",
200    defaults: ["fluoride_defaults"],
201    include_dirs: ["system/bt"],
202    header_libs: ["libbluetooth_headers"],
203    srcs: [
204        "hal/bluetooth_gatt_interface.cc",
205        "hal/bluetooth_interface.cc",
206        "logging_helpers.cc",
207    ],
208}
209