• 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/a2dp_source_unittest.cc",
67    "test/adapter_unittest.cc",
68    "test/advertise_data_unittest.cc",
69    "test/fake_hal_util.cc",
70    "test/gatt_client_unittest.cc",
71    "test/gatt_server_unittest.cc",
72    "test/low_energy_advertiser_unittest.cc",
73    "test/low_energy_client_unittest.cc",
74    "test/low_energy_scanner_unittest.cc",
75    "test/settings_unittest.cc",
76]
77
78// Native system service for target
79// ========================================================
80cc_binary {
81    name: "bluetoothtbd",
82    defaults: ["fluoride_service_defaults"],
83    srcs: btserviceBinderDaemonSrc +
84        btserviceLinuxSrc +
85        btserviceDaemonSrc +
86        ["main.cc"],
87    static_libs: [
88        "libbluetooth-binder-common",
89        "libbtcore",
90        "libbluetooth-types",
91        "libosi",
92    ],
93
94    shared_libs: [
95        "libchrome",
96        "libbinder",
97        "libcutils",
98        "liblog",
99        "libutils",
100    ],
101    init_rc: ["bluetoothtbd.rc"],
102}
103
104// Native system service unit tests for target and host
105
106// ========================================================
107cc_test {
108    name: "bluetoothtbd_test",
109    test_suites: ["device-tests"],
110    defaults: ["fluoride_service_defaults"],
111    srcs: btserviceBaseTestSrc +
112        btserviceDaemonSrc + [
113            "test/main.cc",
114        ],
115    aidl: {
116        include_dirs: [
117            "system/bt/service/common",
118            "frameworks/native/aidl/binder",
119        ],
120    },
121    static_libs: [
122        "libbluetooth-common",
123        "libgmock",
124        "liblog",
125        "libbluetooth-types",
126        "libutils",
127    ],
128    shared_libs: [
129        "libchrome",
130    ],
131
132    host_supported: true,
133    target: {
134        // This includes Binder related tests that can only be run
135        // on target.
136        android: {
137            srcs: btserviceBinderDaemonSrc + [
138                "test/parcelable_unittest.cc",
139                "test/ParcelableTest.aidl",
140            ],
141            static_libs: [
142                "libbluetooth-binder-common",
143            ],
144            shared_libs: [
145                "libbinder",
146            ],
147        },
148        host: {
149            srcs: [
150                "test/stub_ipc_handler_binder.cc",
151            ],
152        },
153        linux_glibc: {
154            srcs: btserviceLinuxSrc + [
155                // TODO(bcf): Fix this test.
156                //"test/ipc_linux_unittest.cc",
157            ],
158        },
159    },
160    sanitize: {
161        cfi: false,
162    },
163}
164
165// Native system service CLI for target
166// ========================================================
167cc_binary {
168    name: "bluetooth-cli",
169    defaults: ["fluoride_defaults"],
170    srcs: ["client/main.cc"],
171    static_libs: [
172        "libbluetooth-binder-common",
173    ],
174    shared_libs: [
175        "libbinder",
176        "libutils",
177    ],
178}
179
180// Heart Rate GATT service example for target
181// ========================================================
182cc_binary {
183    name: "bt-example-hr-server",
184    defaults: ["fluoride_defaults"],
185    local_include_dirs: ["example/heart_rate"],
186    srcs: [
187        "example/heart_rate/heart_rate_server.cc",
188        "example/heart_rate/server_main.cc",
189    ],
190    static_libs: [
191        "libbluetooth-binder-common",
192    ],
193    shared_libs: [
194        "libbinder",
195        "libutils",
196    ],
197}
198
199cc_library_static {
200    name: "libbluetoothtbd_hal",
201    defaults: ["fluoride_defaults"],
202    include_dirs: ["system/bt"],
203    header_libs: ["libbluetooth_headers"],
204    srcs: [
205        "hal/bluetooth_gatt_interface.cc",
206        "hal/bluetooth_interface.cc",
207        "logging_helpers.cc",
208    ],
209}
210