1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
|
package {
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "system_bt_license"
// to get the below license kinds:
// SPDX-license-identifier-Apache-2.0
// SPDX-license-identifier-MIT
default_applicable_licenses: ["system_bt_license"],
}
cc_defaults {
name: "fluoride_osi_defaults",
defaults: ["fluoride_defaults"],
include_dirs: [
"packages/modules/Bluetooth/system",
"packages/modules/Bluetooth/system/gd",
"packages/modules/Bluetooth/system/internal_include",
"packages/modules/Bluetooth/system/stack/include",
],
}
// Static libraries required by other modules
cc_test_library {
name: "libosi-AllocationTestHarness",
defaults: ["fluoride_osi_defaults"],
srcs: [
"test/AllocationTestHarness.cc",
],
host_supported: true,
shared: {
enabled: false,
},
}
cc_test_library {
name: "libosi-AlarmTestHarness",
defaults: ["fluoride_osi_defaults"],
srcs: [
"test/AlarmTestHarness.cc",
],
host_supported: true,
shared: {
enabled: false,
},
}
filegroup {
name: "OsiCompatSources",
srcs: [
"src/compat.cc",
],
}
// libosi static library for target
cc_library_static {
name: "libosi",
visibility: [
"//packages/apps/Test/connectivity/sl4n",
"//packages/modules/Bluetooth:__subpackages__",
],
export_include_dirs: [
"include",
],
local_include_dirs: [
"include_internal",
],
defaults: [
"fluoride_defaults",
"fluoride_osi_defaults",
],
// TODO(mcchou): Remove socket_utils sources after platform specific
// dependencies are abstracted.
srcs: [
":OsiCompatSources",
"src/alarm.cc",
"src/allocation_tracker.cc",
"src/allocator.cc",
"src/array.cc",
"src/buffer.cc",
"src/config.cc",
"src/fixed_queue.cc",
"src/future.cc",
"src/hash_map_utils.cc",
"src/list.cc",
"src/mutex.cc",
"src/osi.cc",
"src/properties.cc",
"src/reactor.cc",
"src/ringbuffer.cc",
"src/socket.cc",
"src/socket_utils/socket_local_client.cc",
"src/socket_utils/socket_local_server.cc",
"src/thread.cc",
"src/thread_scheduler.cc",
"src/wakelock.cc",
// internal source that should not be used outside of libosi
"src/internal/semaphore.cc",
],
host_supported: true,
// TODO(armansito): Setting _GNU_SOURCE isn't very platform-independent but
// should be compatible for a Linux host OS. We should figure out what to do for
// a non-Linux host OS.
target: {
host_linux: {
cflags: [
"-D_GNU_SOURCE",
],
},
},
cflags: [
"-DLIB_OSI_INTERNAL",
],
min_sdk_version: "Tiramisu",
apex_available: [
"com.android.btservices",
],
}
// libosi unit tests for target and host
cc_test {
name: "net_test_osi",
test_suites: ["device-tests"],
defaults: [
"bluetooth_gtest_x86_asan_workaround",
"fluoride_osi_defaults",
"mts_defaults",
],
host_supported: true,
srcs: [
"test/AlarmTestHarness.cc",
"test/AllocationTestHarness.cc",
"test/alarm_test.cc",
"test/allocation_tracker_test.cc",
"test/allocator_test.cc",
"test/array_test.cc",
"test/config_test.cc",
"test/fixed_queue_test.cc",
"test/future_test.cc",
"test/hash_map_utils_test.cc",
"test/list_test.cc",
"test/properties_test.cc",
"test/rand_test.cc",
"test/reactor_test.cc",
"test/ringbuffer_test.cc",
"test/thread_test.cc",
"test/wakelock_test.cc", // test internal sources only used inside the libosi
"test/internal/semaphore_test.cc",
],
shared_libs: [
"libbase",
"libcrypto",
"libcutils",
"liblog",
],
local_include_dirs: [
"include_internal",
"test",
],
static_libs: [
"libbluetooth_gd",
"libbt-common",
"libc++fs",
"libchrome",
"libevent",
"libgmock",
"libosi",
"libprotobuf-cpp-lite",
],
target: {
android: {
shared_libs: [
"libstatssocket",
],
},
},
cflags: [
"-DLIB_OSI_INTERNAL",
],
sanitize: {
cfi: false,
},
}
|