1// Copyright (C) 2018 Knowles Electronics 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: [ 17 "Android-Apache-2.0", 18 ], 19} 20 21soong_config_string_variable { 22 name: "use_sound_trigger_hal", 23 values: [ 24 "iaxxx", 25 ], 26} 27 28soong_config_bool_variable { 29 name: "sound_trigger_hal_is_android_p", 30} 31 32soong_config_module_type { 33 name: "use_sound_trigger_hal_cc_defaults", 34 module_type: "cc_defaults", 35 config_namespace: "knowles", 36 variables: [ 37 "use_sound_trigger_hal", 38 "sound_trigger_hal_is_android_p", 39 ], 40 properties: [ 41 "enabled", 42 "proprietary", 43 "cflags", 44 ], 45} 46 47use_sound_trigger_hal_cc_defaults { 48 name: "use_sound_trigger_hal_defaults", 49 header_libs: ["device_kernel_headers"], 50 soong_config_variables: { 51 use_sound_trigger_hal: { 52 iaxxx: { 53 enabled: true, 54 }, 55 conditions_default: { 56 enabled: false, 57 } 58 }, 59 sound_trigger_hal_is_android_p: { 60 proprietary: true, 61 cflags: ["-DANDROID_P"], 62 } 63 }, 64} 65 66cc_library_shared { 67 name: "sound_trigger.primary.msmnile", 68 defaults: [ 69 "use_sound_trigger_hal_defaults", 70 ], 71 relative_install_path: "hw", 72 srcs: [ 73 "sound_trigger_hw_iaxxx.c", 74 "cvq_util.c", 75 ], 76 vendor: true, 77 include_dirs: [ 78 "external/tinyalsa/include", 79 "system/media/audio_route/include", 80 ], 81 header_libs: ["libhardware_headers"], 82 shared_libs: [ 83 "liblog", 84 "libcutils", 85 "libtinyalsa", 86 "libaudioroute", 87 "libodsp", 88 "libhardware_legacy", 89 ], 90} 91 92cc_library_shared { 93 name: "adnc_strm.primary.default", 94 defaults: [ 95 "use_sound_trigger_hal_defaults", 96 ], 97 relative_install_path: "hw", 98 vendor: true, 99 srcs: ["adnc_strm.c"], 100 shared_libs: [ 101 "liblog", 102 "libcutils", 103 "libtinyalsa", 104 "libtunnel", 105 ], 106} 107 108cc_library_shared { 109 name: "libtunnel", 110 defaults: [ 111 "use_sound_trigger_hal_defaults", 112 ], 113 vendor: true, 114 srcs: ["tunnel.c"], 115 shared_libs: [ 116 "liblog", 117 "libcutils", 118 ], 119} 120 121cc_library_shared { 122 name: "libodsp", 123 defaults: [ 124 "use_sound_trigger_hal_defaults", 125 ], 126 vendor: true, 127 srcs: ["iaxxx_odsp_hw.c"], 128 shared_libs: [ 129 "liblog", 130 "libcutils", 131 ], 132} 133 134cc_binary { 135 name: "tunneling_hal_test", 136 defaults: [ 137 "use_sound_trigger_hal_defaults", 138 ], 139 vendor: true, 140 srcs: [ 141 "tests/tunnel_test.c", 142 "tests/conversion_routines.c", 143 ], 144 compile_multilib: "32", 145 shared_libs: [ 146 "liblog", 147 "libcutils", 148 "libtunnel", 149 ], 150 cflags: ["-DFILENAME_ASSIGN"], 151} 152 153cc_binary { 154 name: "sensor_param_test", 155 defaults: [ 156 "use_sound_trigger_hal_defaults", 157 ], 158 vendor: true, 159 srcs: ["tests/sensor_param_test.c"], 160 compile_multilib: "32", 161 shared_libs: [ 162 "liblog", 163 "libutils", 164 "libcutils", 165 "libtinyalsa", 166 ], 167 include_dirs: ["external/tinyalsa/include"], 168} 169 170cc_library_shared { 171 name: "libosloutils", 172 defaults: [ 173 "use_sound_trigger_hal_defaults", 174 ], 175 srcs: [ 176 "tests/oslo_sound_model_control.cpp", 177 "tests/oslo_iaxxx_sensor_control.c", 178 ], 179 include_dirs: [ 180 "external/tinyalsa/include", 181 "system/media/audio_route/include", 182 ], 183 header_libs: ["libhardware_headers"], 184 shared_libs: [ 185 "liblog", 186 "libutils", 187 "libcutils", 188 "libtinyalsa", 189 "libhidlbase", 190 "libodsp", 191 "android.hardware.soundtrigger@2.0", 192 ], 193 proprietary: true, 194} 195 196cc_binary { 197 name: "oslo_data_injection_test", 198 defaults: [ 199 "use_sound_trigger_hal_defaults", 200 ], 201 srcs: ["tests/oslo_data_injection_test.c"], 202 compile_multilib: "32", 203 header_libs: ["libhardware_headers"], 204 shared_libs: [ 205 "liblog", 206 "libutils", 207 "libcutils", 208 "libosloutils", 209 ], 210 proprietary: true, 211} 212 213cc_binary { 214 name: "oslo_config_test", 215 defaults: [ 216 "use_sound_trigger_hal_defaults", 217 ], 218 srcs: ["tests/oslo_config_test.c"], 219 compile_multilib: "32", 220 header_libs: ["libhardware_headers"], 221 shared_libs: [ 222 "liblog", 223 "libutils", 224 "libcutils", 225 "libosloutils", 226 ], 227 proprietary: true, 228} 229 230cc_binary { 231 name: "oslo_get_stats", 232 defaults: [ 233 "use_sound_trigger_hal_defaults", 234 ], 235 srcs: ["tests/oslo_get_stats.c"], 236 header_libs: ["libhardware_headers"], 237 shared_libs: [ 238 "liblog", 239 "libutils", 240 "libcutils", 241 "libosloutils", 242 ], 243 proprietary: true, 244} 245 246cc_binary { 247 name: "spi_reliability_test", 248 defaults: [ 249 "use_sound_trigger_hal_defaults", 250 ], 251 srcs: ["tests/spi_reliability_test.c"], 252 compile_multilib: "32", 253 shared_libs: [ 254 "liblog", 255 "libcutils", 256 ], 257 vendor: true, 258} 259 260cc_binary { 261 name: "oslo_package_test", 262 defaults: [ 263 "use_sound_trigger_hal_defaults", 264 ], 265 srcs: ["./tests/oslo_package_test.c"], 266 compile_multilib: "32", 267 shared_libs: [ 268 "liblog", 269 "libcutils", 270 "libtinyalsa", 271 ], 272 vendor: true, 273} 274 275cc_binary { 276 name: "tunneling_hal_test_sensor", 277 defaults: [ 278 "use_sound_trigger_hal_defaults", 279 ], 280 srcs: ["tests/tunnel_test_sensor.c"], 281 compile_multilib: "32", 282 shared_libs: ["liblog"], 283 vendor: true, 284} 285 286cc_binary { 287 name: "odsp_api_test", 288 defaults: [ 289 "use_sound_trigger_hal_defaults", 290 ], 291 vendor: true, 292 srcs: ["tests/odsp_api_test.c"], 293 include_dirs: ["hardware/knowles/athletico/sound_trigger_hal/tests"], 294 compile_multilib: "32", 295 shared_libs: [ 296 "liblog", 297 "libcutils", 298 "libodsp", 299 ], 300} 301 302cc_binary { 303 name: "dump_debug_info", 304 vendor: true, 305 defaults: [ 306 "use_sound_trigger_hal_defaults", 307 ], 308 srcs: ["tests/dump_debug_info.c"], 309 compile_multilib: "32", 310 shared_libs: ["liblog"], 311} 312 313cc_binary { 314 name: "crash_event_logger", 315 vendor: true, 316 defaults: [ 317 "use_sound_trigger_hal_defaults", 318 ], 319 srcs: [ 320 "tests/crash_event_logger.c", 321 "tests/crash_analyzer.c", 322 ], 323 compile_multilib: "32", 324 shared_libs: [ 325 "liblog", 326 "libcutils", 327 ], 328} 329 330cc_binary { 331 vendor: true, 332 name: "setparamblk_test", 333 defaults: [ 334 "use_sound_trigger_hal_defaults", 335 ], 336 srcs: ["tests/setparamblk_test.c"], 337 compile_multilib: "32", 338 shared_libs: [ 339 "libcutils", 340 "libodsp", 341 ], 342} 343 344cc_binary { 345 name: "crash_trigger_test", 346 defaults: [ 347 "use_sound_trigger_hal_defaults", 348 ], 349 srcs: ["tests/crash_trigger_test.c"], 350 vendor: true, 351 compile_multilib: "32", 352 shared_libs: [ 353 "liblog", 354 "libodsp", 355 ], 356} 357 358cc_binary { 359 name: "plugin_status_test", 360 defaults: [ 361 "use_sound_trigger_hal_defaults", 362 ], 363 srcs: ["tests/plugin_status_test.c"], 364 vendor: true, 365 local_include_dirs: [""], 366 compile_multilib: "32", 367 shared_libs: [ 368 "libcutils", 369 "libodsp", 370 ], 371} 372 373cc_binary { 374 name: "get_pwr_stats", 375 defaults: [ 376 "use_sound_trigger_hal_defaults", 377 ], 378 vendor: true, 379 srcs: ["tests/get_pwr_stats.c"], 380 local_include_dirs: [""], 381 compile_multilib: "32", 382 shared_libs: [ 383 "libcutils", 384 "liblog", 385 ], 386} 387