diff --git a/Android.bp b/Android.bp new file mode 100644 index 0000000000000000000000000000000000000000..69ed54b9163178c5d701adaf8bd7fd21d44e288d --- /dev/null +++ b/Android.bp @@ -0,0 +1,18 @@ +subdirs = [ + "build", + "btif", + "btcore", + "audio_a2dp_hw", + "hci", + "utils", + "device", + "stack", + "osi", + "embdrv", + "service", + "main", + "bta", + "vendor_libs", + "test", + "udrv", +] diff --git a/Android.mk b/Android.mk index dbbd32b63db20b7a1ee1869b4395da6b19c709a6..5053e7d64389d3eaa35c6e807277fff9f83898f6 100644 --- a/Android.mk +++ b/Android.mk @@ -1,52 +1 @@ -LOCAL_PATH := $(call my-dir) - -# Setup Bluetooth local make variables for handling configuration -ifneq ($(BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR),) - bluetooth_C_INCLUDES := $(BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR) - bluetooth_CFLAGS += -DHAS_BDROID_BUILDCFG -else - bluetooth_C_INCLUDES := - bluetooth_CFLAGS += -DHAS_NO_BDROID_BUILDCFG -endif - -ifneq ($(BOARD_BLUETOOTH_BDROID_HCILP_INCLUDED),) - bluetooth_CFLAGS += -DHCILP_INCLUDED=$(BOARD_BLUETOOTH_BDROID_HCILP_INCLUDED) -endif - -ifneq ($(TARGET_BUILD_VARIANT),user) -bluetooth_CFLAGS += -DBLUEDROID_DEBUG -endif - -bluetooth_CFLAGS += -DEXPORT_SYMBOL="__attribute__((visibility(\"default\")))" - -# -# Common C/C++ compiler flags. -# -# -Wno-gnu-variable-sized-type-not-at-end is needed, because struct BT_HDR -# is defined as a variable-size header in a struct. -# -Wno-typedef-redefinition is needed because of the way the struct typedef -# is done in osi/include header files. This issue can be obsoleted by -# switching to C11 or C++. -# -Wno-unused-parameter is needed, because there are too many unused -# parameters in all the code. -# -bluetooth_CFLAGS += \ - -fvisibility=hidden \ - -Wall \ - -Wextra \ - -Werror \ - -Wno-gnu-variable-sized-type-not-at-end \ - -Wno-typedef-redefinition \ - -Wno-unused-parameter \ - -DLOG_NDEBUG=1 - -bluetooth_CONLYFLAGS += -std=c99 -bluetooth_CPPFLAGS := - include $(call all-subdir-makefiles) - -# Cleanup our locals -bluetooth_C_INCLUDES := -bluetooth_CFLAGS := -bluetooth_CONLYFLAGS := -bluetooth_CPPFLAGS := diff --git a/system/audio_a2dp_hw/Android.bp b/system/audio_a2dp_hw/Android.bp new file mode 100644 index 0000000000000000000000000000000000000000..63eb0e5dcd0ac7e105d7faf2c5120c54c874ec05 --- /dev/null +++ b/system/audio_a2dp_hw/Android.bp @@ -0,0 +1,26 @@ +// Audio A2DP shared library for target +// ======================================================== +cc_library_shared { + name: "audio.a2dp.default", + defaults: ["fluoride_defaults"], + relative_install_path: "hw", + srcs: [ + "audio_a2dp_hw.cc", + "audio_a2dp_hw_utils.cc", + ], + include_dirs: [ + "packages/modules/Bluetooth/system", + ], + shared_libs: [ + "liblog", + ], + static_libs: ["libosi"], +} + +cc_library_static { + name: "libaudio-a2dp-hw-utils", + defaults: ["fluoride_defaults"], + srcs: [ + "audio_a2dp_hw_utils.cc", + ], +} diff --git a/system/audio_a2dp_hw/Android.mk b/system/audio_a2dp_hw/Android.mk deleted file mode 100644 index 8b4273f4287ee814e0ea0b9ab8232579aaeaff0d..0000000000000000000000000000000000000000 --- a/system/audio_a2dp_hw/Android.mk +++ /dev/null @@ -1,29 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -# Audio A2DP shared library for target -# ======================================================== -include $(CLEAR_VARS) -LOCAL_CPP_EXTENSION := .cc - -LOCAL_SRC_FILES := \ - audio_a2dp_hw.cc \ - audio_a2dp_hw_utils.cc - -LOCAL_C_INCLUDES := \ - . \ - $(LOCAL_PATH)/../ \ - $(LOCAL_PATH)/../utils/include - -LOCAL_MODULE := audio.a2dp.default -LOCAL_MODULE_RELATIVE_PATH := hw - -LOCAL_SHARED_LIBRARIES := liblog libchrome -LOCAL_STATIC_LIBRARIES := libosi - -LOCAL_MODULE_TAGS := optional - -LOCAL_CFLAGS += $(bluetooth_CFLAGS) -LOCAL_CONLYFLAGS += $(bluetooth_CONLYFLAGS) -LOCAL_CPPFLAGS += $(bluetooth_CPPFLAGS) - -include $(BUILD_SHARED_LIBRARY) diff --git a/system/audio_a2dp_hw/audio_a2dp_hw.cc b/system/audio_a2dp_hw/audio_a2dp_hw.cc index ecc27a6ecbfc88b4e7c0a04713fb591d496791d4..24a5014aa51e8f0cb978271c999ca2f0eb652e6e 100644 --- a/system/audio_a2dp_hw/audio_a2dp_hw.cc +++ b/system/audio_a2dp_hw/audio_a2dp_hw.cc @@ -44,13 +44,13 @@ #include <hardware/hardware.h> #include <system/audio.h> -#include "audio_a2dp_hw.h" -#include "bt_utils.h" #include "osi/include/hash_map_utils.h" #include "osi/include/log.h" #include "osi/include/osi.h" #include "osi/include/socket_utils/sockets.h" +#include "audio_a2dp_hw.h" + /***************************************************************************** * Constants & Macros *****************************************************************************/ diff --git a/system/bta/Android.bp b/system/bta/Android.bp new file mode 100644 index 0000000000000000000000000000000000000000..a4df7957950d7a5d1fe9e29a6a8e019174fbefea --- /dev/null +++ b/system/bta/Android.bp @@ -0,0 +1,135 @@ +cc_defaults { + name: "fluoride_bta_defaults", + defaults: ["fluoride_defaults"], + local_include_dirs: [ + "include", + "sys", + "dm", + "hd", + "hh", + "closure", + ], + include_dirs: [ + "packages/modules/Bluetooth/system", + "packages/modules/Bluetooth/system/bta/include", + "packages/modules/Bluetooth/system/btcore/include", + "packages/modules/Bluetooth/system/hci/include", + "packages/modules/Bluetooth/system/include", + "packages/modules/Bluetooth/system/stack/include", + "packages/modules/Bluetooth/system/stack/btm", + "packages/modules/Bluetooth/system/udrv/include", + "packages/modules/Bluetooth/system/vnd/include", + "packages/modules/Bluetooth/system/utils/include", + ], + shared_libs: [ + "libcutils", + ], + cflags: ["-DBUILDCFG"], +} + +// BTA static library for target +// ======================================================== +cc_library_static { + name: "libbt-bta", + defaults: ["fluoride_bta_defaults"], + srcs: [ + "ag/bta_ag_act.cc", + "ag/bta_ag_api.cc", + "ag/bta_ag_at.cc", + "ag/bta_ag_cfg.cc", + "ag/bta_ag_ci.cc", + "ag/bta_ag_cmd.cc", + "ag/bta_ag_main.cc", + "ag/bta_ag_rfc.cc", + "ag/bta_ag_sco.cc", + "ag/bta_ag_sdp.cc", + "ar/bta_ar.cc", + "av/bta_av_aact.cc", + "av/bta_av_act.cc", + "av/bta_av_api.cc", + "av/bta_av_cfg.cc", + "av/bta_av_ci.cc", + "av/bta_av_main.cc", + "av/bta_av_ssm.cc", + "closure/bta_closure.cc", + "dm/bta_dm_act.cc", + "dm/bta_dm_api.cc", + "dm/bta_dm_cfg.cc", + "dm/bta_dm_ci.cc", + "dm/bta_dm_main.cc", + "dm/bta_dm_pm.cc", + "dm/bta_dm_sco.cc", + "gatt/bta_gattc_act.cc", + "gatt/bta_gattc_api.cc", + "gatt/bta_gattc_cache.cc", + "gatt/bta_gattc_main.cc", + "gatt/bta_gattc_utils.cc", + "gatt/bta_gatts_act.cc", + "gatt/bta_gatts_api.cc", + "gatt/bta_gatts_main.cc", + "gatt/bta_gatts_utils.cc", + "hf_client/bta_hf_client_act.cc", + "hf_client/bta_hf_client_api.cc", + "hf_client/bta_hf_client_at.cc", + "hf_client/bta_hf_client_main.cc", + "hf_client/bta_hf_client_rfc.cc", + "hf_client/bta_hf_client_sco.cc", + "hf_client/bta_hf_client_sdp.cc", + "hh/bta_hh_act.cc", + "hh/bta_hh_api.cc", + "hh/bta_hh_cfg.cc", + "hh/bta_hh_le.cc", + "hh/bta_hh_main.cc", + "hh/bta_hh_utils.cc", + "hl/bta_hl_act.cc", + "hl/bta_hl_api.cc", + "hl/bta_hl_ci.cc", + "hl/bta_hl_main.cc", + "hl/bta_hl_sdp.cc", + "hl/bta_hl_utils.cc", + "hd/bta_hd_act.cc", + "hd/bta_hd_api.cc", + "hd/bta_hd_main.cc", + "jv/bta_jv_act.cc", + "jv/bta_jv_api.cc", + "jv/bta_jv_cfg.cc", + "jv/bta_jv_main.cc", + "mce/bta_mce_act.cc", + "mce/bta_mce_api.cc", + "mce/bta_mce_cfg.cc", + "mce/bta_mce_main.cc", + "pan/bta_pan_act.cc", + "pan/bta_pan_api.cc", + "pan/bta_pan_ci.cc", + "pan/bta_pan_main.cc", + "sdp/bta_sdp.cc", + "sdp/bta_sdp_act.cc", + "sdp/bta_sdp_api.cc", + "sdp/bta_sdp_cfg.cc", + "sys/bta_sys_conn.cc", + "sys/bta_sys_main.cc", + "sys/utl.cc", + ], +} + +// bta unit tests for target +// ======================================================== +cc_test { + name: "net_test_bta", + defaults: ["fluoride_bta_defaults"], + srcs: [ + "test/bta_closure_test.cc", + "test/bta_hf_client_test.cc", + ], + shared_libs: [ + "libhardware", + "liblog", + "libprotobuf-cpp-lite", + ], + static_libs: [ + "libbtcore", + "libbt-bta", + "libosi", + "libbt-protos", + ], +} diff --git a/system/bta/Android.mk b/system/bta/Android.mk deleted file mode 100644 index 429e319ce34380475e8655a2acd0b8525221f214..0000000000000000000000000000000000000000 --- a/system/bta/Android.mk +++ /dev/null @@ -1,139 +0,0 @@ -LOCAL_PATH:= $(call my-dir) - -# Tests -btaTestSrc := \ - test/bta_closure_test.cc \ - test/bta_hf_client_test.cc - -btaCommonIncludes := \ - $(LOCAL_PATH)/../ \ - $(LOCAL_PATH)/include \ - $(LOCAL_PATH)/sys \ - $(LOCAL_PATH)/dm \ - $(LOCAL_PATH)/hh \ - $(LOCAL_PATH)/hd \ - $(LOCAL_PATH)/closure \ - $(LOCAL_PATH)/../btcore/include \ - $(LOCAL_PATH)/../hci/include \ - $(LOCAL_PATH)/../include \ - $(LOCAL_PATH)/../stack/include \ - $(LOCAL_PATH)/../stack/btm \ - $(LOCAL_PATH)/../udrv/include \ - $(LOCAL_PATH)/../vnd/include \ - $(LOCAL_PATH)/../utils/include \ - $(bluetooth_C_INCLUDES) - -# BTA static library for target -# ======================================================== -include $(CLEAR_VARS) -LOCAL_CPP_EXTENSION := .cc - -LOCAL_SRC_FILES:= \ - ./ag/bta_ag_act.cc \ - ./ag/bta_ag_api.cc \ - ./ag/bta_ag_at.cc \ - ./ag/bta_ag_cfg.cc \ - ./ag/bta_ag_ci.cc \ - ./ag/bta_ag_cmd.cc \ - ./ag/bta_ag_main.cc \ - ./ag/bta_ag_rfc.cc \ - ./ag/bta_ag_sco.cc \ - ./ag/bta_ag_sdp.cc \ - ./ar/bta_ar.cc \ - ./av/bta_av_aact.cc \ - ./av/bta_av_act.cc \ - ./av/bta_av_api.cc \ - ./av/bta_av_cfg.cc \ - ./av/bta_av_ci.cc \ - ./av/bta_av_main.cc \ - ./av/bta_av_ssm.cc \ - ./closure/bta_closure.cc \ - ./dm/bta_dm_act.cc \ - ./dm/bta_dm_api.cc \ - ./dm/bta_dm_cfg.cc \ - ./dm/bta_dm_ci.cc \ - ./dm/bta_dm_main.cc \ - ./dm/bta_dm_pm.cc \ - ./dm/bta_dm_sco.cc \ - ./gatt/bta_gattc_act.cc \ - ./gatt/bta_gattc_api.cc \ - ./gatt/bta_gattc_cache.cc \ - ./gatt/bta_gattc_main.cc \ - ./gatt/bta_gattc_utils.cc \ - ./gatt/bta_gatts_act.cc \ - ./gatt/bta_gatts_api.cc \ - ./gatt/bta_gatts_main.cc \ - ./gatt/bta_gatts_utils.cc \ - ./hf_client/bta_hf_client_act.cc \ - ./hf_client/bta_hf_client_api.cc \ - ./hf_client/bta_hf_client_at.cc \ - ./hf_client/bta_hf_client_main.cc \ - ./hf_client/bta_hf_client_rfc.cc \ - ./hf_client/bta_hf_client_sco.cc \ - ./hf_client/bta_hf_client_sdp.cc \ - ./hh/bta_hh_act.cc \ - ./hh/bta_hh_api.cc \ - ./hh/bta_hh_cfg.cc \ - ./hh/bta_hh_le.cc \ - ./hh/bta_hh_main.cc \ - ./hh/bta_hh_utils.cc \ - ./hd/bta_hd_act.cc \ - ./hd/bta_hd_api.cc \ - ./hd/bta_hd_main.cc \ - ./hl/bta_hl_act.cc \ - ./hl/bta_hl_api.cc \ - ./hl/bta_hl_ci.cc \ - ./hl/bta_hl_main.cc \ - ./hl/bta_hl_sdp.cc \ - ./hl/bta_hl_utils.cc \ - ./jv/bta_jv_act.cc \ - ./jv/bta_jv_api.cc \ - ./jv/bta_jv_cfg.cc \ - ./jv/bta_jv_main.cc \ - ./mce/bta_mce_act.cc \ - ./mce/bta_mce_api.cc \ - ./mce/bta_mce_cfg.cc \ - ./mce/bta_mce_main.cc \ - ./pan/bta_pan_act.cc \ - ./pan/bta_pan_api.cc \ - ./pan/bta_pan_ci.cc \ - ./pan/bta_pan_main.cc \ - ./sdp/bta_sdp.cc \ - ./sdp/bta_sdp_act.cc \ - ./sdp/bta_sdp_api.cc \ - ./sdp/bta_sdp_cfg.cc \ - ./sys/bta_sys_conn.cc \ - ./sys/bta_sys_main.cc \ - ./sys/utl.cc - -LOCAL_MODULE := libbt-bta -LOCAL_MODULE_CLASS := STATIC_LIBRARIES -LOCAL_MODULE_TAGS := optional -LOCAL_SHARED_LIBRARIES := libcutils libc libchrome - -LOCAL_C_INCLUDES := $(btaCommonIncludes) - -LOCAL_CFLAGS += $(bluetooth_CFLAGS) -DBUILDCFG -LOCAL_CONLYFLAGS += $(bluetooth_CONLYFLAGS) -LOCAL_CPPFLAGS += $(bluetooth_CPPFLAGS) - -include $(BUILD_STATIC_LIBRARY) - -# bta unit tests for target -# ======================================================== -include $(CLEAR_VARS) - -LOCAL_CPP_EXTENSION := .cc - -LOCAL_C_INCLUDES := $(btaCommonIncludes) -LOCAL_SRC_FILES := $(btaTestSrc) -LOCAL_SHARED_LIBRARIES := libcutils libc libchrome libhardware liblog libprotobuf-cpp-lite -LOCAL_STATIC_LIBRARIES := libbtcore libbt-bta libosi libbt-protos -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE := net_test_bta - -LOCAL_CFLAGS += $(bluetooth_CFLAGS) -DBUILDCFG -LOCAL_CONLYFLAGS += $(bluetooth_CONLYFLAGS) -LOCAL_CPPFLAGS += $(bluetooth_CPPFLAGS) - -include $(BUILD_NATIVE_TEST) diff --git a/system/btcore/Android.bp b/system/btcore/Android.bp new file mode 100644 index 0000000000000000000000000000000000000000..7b72da398dfd015861dc8113b8244cbfe74cc478 --- /dev/null +++ b/system/btcore/Android.bp @@ -0,0 +1,60 @@ +// libbtcore static library for target and host +// ======================================================== +cc_library_static { + name: "libbtcore", + defaults: ["fluoride_defaults"], + local_include_dirs: ["include"], + include_dirs: ["packages/modules/Bluetooth/system"], + srcs: [ + "src/bdaddr.cc", + "src/device_class.cc", + "src/hal_util.cc", + "src/module.cc", + "src/osi_module.cc", + "src/property.cc", + "src/uuid.cc", + ], + shared_libs: [ + "liblog", + ], + host_supported: true, + target: { + darwin: { + enabled: false, + }, + linux: { + cflags: ["-D_GNU_SOURCE"], + }, + }, +} + +// Note: It's good to get the tests compiled both for the host and the target so +// we get to test with both Bionic libc and glibc +// libbtcore unit tests for target and host +// ======================================================== +cc_test { + name: "net_test_btcore", + defaults: ["fluoride_defaults"], + local_include_dirs: ["include"], + include_dirs: ["packages/modules/Bluetooth/system"], + srcs: [ + "test/bdaddr_test.cc", + "test/device_class_test.cc", + "test/property_test.cc", + "test/uuid_test.cc", + ], + shared_libs: [ + "liblog", + ], + static_libs: [ + "libbtcore", + "libosi-AllocationTestHarness", + "libosi", + ], + host_supported: true, + target: { + darwin: { + enabled: false, + } + } +} diff --git a/system/btcore/Android.mk b/system/btcore/Android.mk deleted file mode 100644 index a18f04a7157fa0b7c5e3d24c776e110b8b15cb3f..0000000000000000000000000000000000000000 --- a/system/btcore/Android.mk +++ /dev/null @@ -1,119 +0,0 @@ - ############################################################################## - # - # Copyright (C) 2014 Google, Inc. - # - # Licensed under the Apache License, Version 2.0 (the "License"); - # you may not use this file except in compliance with the License. - # You may obtain a copy of the License at: - # - # http://www.apache.org/licenses/LICENSE-2.0 - # - # Unless required by applicable law or agreed to in writing, software - # distributed under the License is distributed on an "AS IS" BASIS, - # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - # See the License for the specific language governing permissions and - # limitations under the License. - # - ############################################################################## - -LOCAL_PATH := $(call my-dir) - -# Common variables -# ======================================================== -btcoreCommonSrc := \ - src/bdaddr.cc \ - src/device_class.cc \ - src/hal_util.cc \ - src/module.cc \ - src/osi_module.cc \ - src/property.cc \ - src/uuid.cc - -btcoreCommonTestSrc := \ - ./test/bdaddr_test.cc \ - ./test/device_class_test.cc \ - ./test/property_test.cc \ - ./test/uuid_test.cc \ - ../osi/test/AllocationTestHarness.cc - -btcoreCommonIncludes := \ - $(LOCAL_PATH)/include \ - $(LOCAL_PATH)/.. - -# libbtcore static library for target -# ======================================================== -include $(CLEAR_VARS) -LOCAL_CPP_EXTENSION := .cc -LOCAL_C_INCLUDES := $(btcoreCommonIncludes) -LOCAL_SRC_FILES := $(btcoreCommonSrc) -LOCAL_MODULE := libbtcore -LOCAL_MODULE_TAGS := optional -LOCAL_SHARED_LIBRARIES := libc liblog libchrome -LOCAL_MODULE_CLASS := STATIC_LIBRARIES - -LOCAL_CFLAGS += $(bluetooth_CFLAGS) -LOCAL_CONLYFLAGS += $(bluetooth_CONLYFLAGS) -LOCAL_CPPFLAGS += $(bluetooth_CPPFLAGS) - -include $(BUILD_STATIC_LIBRARY) - -# libbtcore static library for host -# ======================================================== -ifeq ($(HOST_OS),linux) -include $(CLEAR_VARS) -LOCAL_CPP_EXTENSION := .cc -LOCAL_C_INCLUDES := $(btcoreCommonIncludes) -LOCAL_SRC_FILES := $(btcoreCommonSrc) -LOCAL_MODULE := libbtcore-host -LOCAL_MODULE_TAGS := optional -LOCAL_SHARED_LIBRARIES := liblog libchrome -LOCAL_MODULE_CLASS := STATIC_LIBRARIES - -# 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. -LOCAL_CFLAGS += $(bluetooth_CFLAGS) -D_GNU_SOURCE -LOCAL_CONLYFLAGS += $(bluetooth_CONLYFLAGS) -LOCAL_CPPFLAGS += $(bluetooth_CPPFLAGS) - -include $(BUILD_HOST_STATIC_LIBRARY) -endif - -# Note: It's good to get the tests compiled both for the host and the target so -# we get to test with both Bionic libc and glibc - -# libbtcore unit tests for target -# ======================================================== -include $(CLEAR_VARS) -LOCAL_CPP_EXTENSION := .cc -LOCAL_C_INCLUDES := $(btcoreCommonIncludes) -LOCAL_SRC_FILES := $(btcoreCommonTestSrc) -LOCAL_MODULE := net_test_btcore -LOCAL_MODULE_TAGS := tests -LOCAL_SHARED_LIBRARIES := liblog libchrome -LOCAL_STATIC_LIBRARIES := libbtcore libosi - -LOCAL_CFLAGS += $(bluetooth_CFLAGS) -LOCAL_CONLYFLAGS += $(bluetooth_CONLYFLAGS) -LOCAL_CPPFLAGS += $(bluetooth_CPPFLAGS) - -include $(BUILD_NATIVE_TEST) - -# libbtcore unit tests for host -# ======================================================== -ifeq ($(HOST_OS),linux) -include $(CLEAR_VARS) -LOCAL_CPP_EXTENSION := .cc -LOCAL_C_INCLUDES := $(btcoreCommonIncludes) -LOCAL_SRC_FILES := $(btcoreCommonTestSrc) -LOCAL_MODULE := net_test_btcore -LOCAL_MODULE_TAGS := tests -LOCAL_SHARED_LIBRARIES := liblog libchrome -LOCAL_STATIC_LIBRARIES := libbtcore-host libosi-host - -LOCAL_CFLAGS += $(bluetooth_CFLAGS) -LOCAL_CONLYFLAGS += $(bluetooth_CONLYFLAGS) -LOCAL_CPPFLAGS += $(bluetooth_CPPFLAGS) - -include $(BUILD_HOST_NATIVE_TEST) -endif diff --git a/system/btif/Android.bp b/system/btif/Android.bp new file mode 100644 index 0000000000000000000000000000000000000000..25e207755c2261983a76411391839d390ac22373 --- /dev/null +++ b/system/btif/Android.bp @@ -0,0 +1,121 @@ +// Common variables +// ======================================================== +btifCommonIncludes = [ + "packages/modules/Bluetooth/system", + "packages/modules/Bluetooth/system/bta/include", + "packages/modules/Bluetooth/system/bta/sys", + "packages/modules/Bluetooth/system/bta/dm", + "packages/modules/Bluetooth/system/btcore/include", + "packages/modules/Bluetooth/system/include", + "packages/modules/Bluetooth/system/stack/include", + "packages/modules/Bluetooth/system/stack/l2cap", + "packages/modules/Bluetooth/system/stack/a2dp", + "packages/modules/Bluetooth/system/stack/btm", + "packages/modules/Bluetooth/system/stack/avdt", + "packages/modules/Bluetooth/system/udrv/include", + "packages/modules/Bluetooth/system/btif/include", + "packages/modules/Bluetooth/system/btif/co", + "packages/modules/Bluetooth/system/hci/include", + "packages/modules/Bluetooth/system/vnd/include", + "packages/modules/Bluetooth/system/embdrv/sbc/encoder/include", + "packages/modules/Bluetooth/system/embdrv/sbc/decoder/include", + "packages/modules/Bluetooth/system/audio_a2dp_hw", + "packages/modules/Bluetooth/system/utils/include", +] + +// libbtif static library for target +// ======================================================== +cc_library_static { + name: "libbtif", + defaults: ["fluoride_defaults"], + include_dirs: btifCommonIncludes, + srcs: [ + // HAL layer + "src/bluetooth.cc", + // BTIF implementation + "src/btif_a2dp.cc", + "src/btif_a2dp_control.cc", + "src/btif_a2dp_sink.cc", + "src/btif_a2dp_source.cc", + "src/btif_av.cc", + "src/btif_avrcp_audio_track.cc", + "src/btif_ble_advertiser.cc", + "src/btif_ble_scanner.cc", + "src/btif_config.cc", + "src/btif_config_transcode.cc", + "src/btif_core.cc", + "src/btif_debug.cc", + "src/btif_debug_btsnoop.cc", + "src/btif_debug_conn.cc", + "src/btif_dm.cc", + "src/btif_gatt.cc", + "src/btif_gatt_client.cc", + "src/btif_gatt_server.cc", + "src/btif_gatt_test.cc", + "src/btif_gatt_util.cc", + "src/btif_hf.cc", + "src/btif_hf_client.cc", + "src/btif_hh.cc", + "src/btif_hd.cc", + "src/btif_hl.cc", + "src/btif_mce.cc", + "src/btif_pan.cc", + "src/btif_profile_queue.cc", + "src/btif_rc.cc", + "src/btif_sdp.cc", + "src/btif_sdp_server.cc", + "src/btif_sm.cc", + "src/btif_sock.cc", + "src/btif_sock_rfc.cc", + "src/btif_sock_l2cap.cc", + "src/btif_sock_sco.cc", + "src/btif_sock_sdp.cc", + "src/btif_sock_thread.cc", + "src/btif_sock_util.cc", + "src/btif_storage.cc", + "src/btif_uid.cc", + "src/btif_util.cc", + "src/stack_manager.cc", + // Callouts + "co/bta_ag_co.cc", + "co/bta_dm_co.cc", + "co/bta_av_co.cc", + "co/bta_hh_co.cc", + "co/bta_hl_co.cc", + "co/bta_pan_co.cc", + "co/bta_gatts_co.cc", + ], + shared_libs: [ + "libaudioclient", + "libcutils", + "liblog", + "libz", + "libtinyxml2", + ], + whole_static_libs: [ + "libaudio-a2dp-hw-utils", + ], + cflags: ["-DBUILDCFG"], + +} + +// btif unit tests for target +// ======================================================== +cc_test { + name: "net_test_btif", + defaults: ["fluoride_defaults"], + include_dirs: btifCommonIncludes, + srcs: ["test/btif_storage_test.cc"], + shared_libs: [ + "liblog", + "libhardware", + "libcutils", + ], + static_libs: [ + "libbtcore", + "libbtif", + "libbt-stack", + "libosi", + ], + cflags: ["-DBUILDCFG"], +} diff --git a/system/btif/Android.mk b/system/btif/Android.mk deleted file mode 100644 index 4509919200f5fa74180d4d53b9f64ebe0c49d65d..0000000000000000000000000000000000000000 --- a/system/btif/Android.mk +++ /dev/null @@ -1,154 +0,0 @@ - ############################################################################## - # - # Copyright (C) 2014 Google, Inc. - # - # Licensed under the Apache License, Version 2.0 (the "License"); - # you may not use this file except in compliance with the License. - # You may obtain a copy of the License at: - # - # http://www.apache.org/licenses/LICENSE-2.0 - # - # Unless required by applicable law or agreed to in writing, software - # distributed under the License is distributed on an "AS IS" BASIS, - # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - # See the License for the specific language governing permissions and - # limitations under the License. - # - ############################################################################## - -LOCAL_PATH := $(call my-dir) - -# Common variables -# ======================================================== - -# HAL layer -btifCommonSrc += \ - src/bluetooth.cc \ - ../../EventLogTags.logtags - -# BTIF implementation -btifCommonSrc += \ - ../audio_a2dp_hw/audio_a2dp_hw_utils.cc \ - src/btif_a2dp.cc \ - src/btif_a2dp_control.cc \ - src/btif_a2dp_sink.cc \ - src/btif_a2dp_source.cc \ - src/btif_av.cc \ - src/btif_avrcp_audio_track.cc \ - src/btif_ble_advertiser.cc \ - src/btif_ble_scanner.cc \ - src/btif_config.cc \ - src/btif_config_transcode.cc \ - src/btif_core.cc \ - src/btif_debug.cc \ - src/btif_debug_btsnoop.cc \ - src/btif_debug_conn.cc \ - src/btif_dm.cc \ - src/btif_gatt.cc \ - src/btif_gatt_client.cc \ - src/btif_gatt_server.cc \ - src/btif_gatt_test.cc \ - src/btif_gatt_util.cc \ - src/btif_hf.cc \ - src/btif_hf_client.cc \ - src/btif_hh.cc \ - src/btif_hd.cc \ - src/btif_hl.cc \ - src/btif_mce.cc \ - src/btif_pan.cc \ - src/btif_profile_queue.cc \ - src/btif_rc.cc \ - src/btif_sdp.cc \ - src/btif_sdp_server.cc \ - src/btif_sm.cc \ - src/btif_sock.cc \ - src/btif_sock_rfc.cc \ - src/btif_sock_l2cap.cc \ - src/btif_sock_sco.cc \ - src/btif_sock_sdp.cc \ - src/btif_sock_thread.cc \ - src/btif_sock_util.cc \ - src/btif_storage.cc \ - src/btif_uid.cc \ - src/btif_util.cc \ - src/stack_manager.cc - -# Callouts -btifCommonSrc += \ - co/bta_ag_co.cc \ - co/bta_dm_co.cc \ - co/bta_av_co.cc \ - co/bta_hh_co.cc \ - co/bta_hl_co.cc \ - co/bta_pan_co.cc \ - co/bta_gatts_co.cc - -# Tests -btifTestSrc := \ - test/btif_storage_test.cc - -# Includes -btifCommonIncludes := \ - $(LOCAL_PATH)/../ \ - $(LOCAL_PATH)/../bta/include \ - $(LOCAL_PATH)/../bta/sys \ - $(LOCAL_PATH)/../bta/dm \ - $(LOCAL_PATH)/../btcore/include \ - $(LOCAL_PATH)/../include \ - $(LOCAL_PATH)/../stack/include \ - $(LOCAL_PATH)/../stack/l2cap \ - $(LOCAL_PATH)/../stack/a2dp \ - $(LOCAL_PATH)/../stack/btm \ - $(LOCAL_PATH)/../stack/avdt \ - $(LOCAL_PATH)/../udrv/include \ - $(LOCAL_PATH)/../btif/include \ - $(LOCAL_PATH)/../btif/co \ - $(LOCAL_PATH)/../hci/include\ - $(LOCAL_PATH)/../vnd/include \ - $(LOCAL_PATH)/../embdrv/sbc/encoder/include \ - $(LOCAL_PATH)/../embdrv/sbc/decoder/include \ - $(LOCAL_PATH)/../audio_a2dp_hw \ - $(LOCAL_PATH)/../utils/include \ - $(bluetooth_C_INCLUDES) \ - external/tinyxml2 \ - external/zlib - -# libbtif static library for target -# ======================================================== -include $(CLEAR_VARS) - -LOCAL_CPP_EXTENSION := .cc - -LOCAL_C_INCLUDES := $(btifCommonIncludes) -LOCAL_SRC_FILES := $(btifCommonSrc) -# Many .h files have redefined typedefs -LOCAL_SHARED_LIBRARIES := libaudioclient libcutils liblog libchrome -LOCAL_MODULE_CLASS := STATIC_LIBRARIES -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE := libbtif - -LOCAL_CFLAGS += $(bluetooth_CFLAGS) -DBUILDCFG -LOCAL_CONLYFLAGS += $(bluetooth_CONLYFLAGS) -LOCAL_CPPFLAGS += $(bluetooth_CPPFLAGS) - -include $(BUILD_STATIC_LIBRARY) - -# btif unit tests for target -# ======================================================== -include $(CLEAR_VARS) - -LOCAL_CPP_EXTENSION := .cc - -LOCAL_C_INCLUDES := $(btifCommonIncludes) -LOCAL_SRC_FILES := $(btifTestSrc) -LOCAL_SHARED_LIBRARIES := liblog libhardware libhardware_legacy libcutils \ - libchrome -LOCAL_STATIC_LIBRARIES := libbtcore libbtif libbt-stack libosi -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE := net_test_btif - -LOCAL_CFLAGS += $(bluetooth_CFLAGS) -DBUILDCFG -LOCAL_CONLYFLAGS += $(bluetooth_CONLYFLAGS) -LOCAL_CPPFLAGS += $(bluetooth_CPPFLAGS) - -include $(BUILD_NATIVE_TEST) diff --git a/system/build/Android.bp b/system/build/Android.bp new file mode 100644 index 0000000000000000000000000000000000000000..2c47df7f1f89f903e42abdc550c42eb54d0ae32e --- /dev/null +++ b/system/build/Android.bp @@ -0,0 +1,44 @@ +bootstrap_go_package { + name: "soong-fluoride", + pkgPath: "android/soong/fluoride", + deps: [ + "blueprint", + "blueprint-pathtools", + "soong", + "soong-android", + "soong-cc", + ], + srcs: [ + "fluoride.go", + ], + pluginFor: ["soong_build"], +} + +fluoride_defaults { + name: "fluoride_defaults", + cflags: [ + "-DEXPORT_SYMBOL=__attribute__((visibility(\"default\")))", + "-fvisibility=hidden", + "-Wall", + "-Wextra", + "-Werror", + // struct BT_HDR is defined as a variable-size header in a struct. + "-Wno-gnu-variable-sized-type-not-at-end", + // needed because of the way the struct typedef is done in osi/include + // header files. This issue can be obsoleted by switching to C11 or C++. + "-Wno-typedef-redefinition", + // there are too many unused parameters in all the code. + "-Wno-unused-parameter", + "-DLOG_NDEBUG=1", + ], + conlyflags: [ + "-std=c99", + ], + product_variables: { + debuggable: { + cflags: ["-DBLUEDROID_DEBUG"], + }, + }, + shared_libs: [ "libchrome" ] + // Setup Bluetooth local make variables for handling configuration +} diff --git a/system/build/fluoride.go b/system/build/fluoride.go new file mode 100644 index 0000000000000000000000000000000000000000..b269170c6e3e5daadcb56fea63b2adf1fb925963 --- /dev/null +++ b/system/build/fluoride.go @@ -0,0 +1,69 @@ +// Copyright (C) 2016 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package fluoride + +import ( + "android/soong/android" + "android/soong/cc" + + "github.com/google/blueprint" +) + +func init() { + android.RegisterModuleType("fluoride_defaults", fluorideDefaultsFactory) +} + +func fluorideDefaultsFactory() (blueprint.Module, []interface{}) { + module, props := cc.DefaultsFactory() + android.AddLoadHook(module, fluorideDefaults) + + return module, props +} + +func fluorideDefaults(ctx android.LoadHookContext) { + type props struct { + Include_dirs []string + Cflags []string + } + + p := &props{} + p.Cflags, p.Include_dirs = globalDefaults(ctx) + + ctx.AppendProperties(p) +} + +func globalDefaults(ctx android.BaseContext) ([]string, []string) { + var cflags []string + var includeDirs []string + + board_bt_buildcfg_include_dir := ctx.DeviceConfig().BtConfigIncludeDir() + if (len(board_bt_buildcfg_include_dir) > 0) { + cflags = append(cflags, "-DHAS_BDROID_BUILDCFG") + includeDirs = append(includeDirs, board_bt_buildcfg_include_dir) + } else { + cflags = append(cflags, "-DHAS_NO_BDROID_BUILDCFG") + } + + board_bt_hcilp_included := ctx.DeviceConfig().BtHcilpIncluded() + if (len(board_bt_hcilp_included) > 0) { + cflags = append(cflags, "-DHCILP_INCLUDED=" + board_bt_hcilp_included) + } + + board_bt_hci_use_mct := ctx.DeviceConfig().BtHciUseMct() + if (board_bt_hci_use_mct) { + cflags = append(cflags, "-DHCI_USE_MCT") + } + + return cflags, includeDirs +} diff --git a/system/conf/Android.mk b/system/conf/Android.mk index 5bc5a636f17bddddef239b3431bff071e11d567c..6f5037c4f7c02b0f22a642ddc660fcaed4fad232 100644 --- a/system/conf/Android.mk +++ b/system/conf/Android.mk @@ -1,3 +1,5 @@ +# Cannot convert to Android.bp as resource copying has not +# yet implemented for soong as of 12/16/2016 LOCAL_PATH := $(call my-dir) # Bluetooth bt_stack.conf config file diff --git a/system/device/Android.bp b/system/device/Android.bp new file mode 100644 index 0000000000000000000000000000000000000000..bb864afa91565bd09aaddb9c9ff9a5aeccfc9d6a --- /dev/null +++ b/system/device/Android.bp @@ -0,0 +1,45 @@ +// Bluetooth device static library for target +// ======================================================== +cc_library_static { + name: "libbtdevice", + defaults: ["fluoride_defaults"], + local_include_dirs: [ + "include", + ], + include_dirs: [ + "packages/modules/Bluetooth/system", + "packages/modules/Bluetooth/system/btcore/include", + "packages/modules/Bluetooth/system/hci/include", + "packages/modules/Bluetooth/system/include", + "packages/modules/Bluetooth/system/stack/include", + ], + srcs: [ + "src/controller.cc", + "src/interop.cc", + ], + shared_libs: [ + "liblog", + ], +} + +// Bluetooth device unit tests for target +// ======================================================== +cc_test { + name: "net_test_device", + defaults: ["fluoride_defaults"], + include_dirs: ["packages/modules/Bluetooth/system"], + srcs: [ + "test/interop_test.cc", + ], + shared_libs: [ + "liblog", + "libdl", + ], + static_libs: [ + "libbtdevice", + "libbtcore", + "libosi", + "libosi-AllocationTestHarness", + "libcutils", + ], +} diff --git a/system/device/Android.mk b/system/device/Android.mk deleted file mode 100644 index f191aa12048fc235c04f531d8e819ed96cd516ed..0000000000000000000000000000000000000000 --- a/system/device/Android.mk +++ /dev/null @@ -1,71 +0,0 @@ - ############################################################################## - # - # Copyright (C) 2014 Google, Inc. - # - # Licensed under the Apache License, Version 2.0 (the "License"); - # you may not use this file except in compliance with the License. - # You may obtain a copy of the License at: - # - # http://www.apache.org/licenses/LICENSE-2.0 - # - # Unless required by applicable law or agreed to in writing, software - # distributed under the License is distributed on an "AS IS" BASIS, - # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - # See the License for the specific language governing permissions and - # limitations under the License. - # - ############################################################################## - -LOCAL_PATH := $(call my-dir) - -# Bluetooth device static library for target -# ======================================================== -include $(CLEAR_VARS) -LOCAL_CPP_EXTENSION := .cc - -LOCAL_C_INCLUDES := \ - $(LOCAL_PATH)/.. \ - $(LOCAL_PATH)/include \ - $(LOCAL_PATH)/../btcore/include \ - $(LOCAL_PATH)/../hci/include \ - $(LOCAL_PATH)/../include \ - $(LOCAL_PATH)/../stack/include \ - $(bluetooth_C_INCLUDES) - -LOCAL_SRC_FILES := \ - src/controller.cc \ - src/interop.cc - -LOCAL_MODULE := libbtdevice -LOCAL_MODULE_TAGS := optional -LOCAL_SHARED_LIBRARIES := libc liblog libchrome -LOCAL_MODULE_CLASS := STATIC_LIBRARIES - -LOCAL_CFLAGS += $(bluetooth_CFLAGS) -LOCAL_CONLYFLAGS += $(bluetooth_CONLYFLAGS) -LOCAL_CPPFLAGS += $(bluetooth_CPPFLAGS) - -include $(BUILD_STATIC_LIBRARY) - -# Bluetooth device unit tests for target -# ======================================================== -include $(CLEAR_VARS) -LOCAL_CPP_EXTENSION := .cc -LOCAL_C_INCLUDES := \ - $(LOCAL_PATH)/.. \ - $(bluetooth_C_INCLUDES) - -LOCAL_SRC_FILES := \ - ../osi/test/AllocationTestHarness.cc \ - ./test/interop_test.cc - -LOCAL_MODULE := net_test_device -LOCAL_MODULE_TAGS := tests -LOCAL_SHARED_LIBRARIES := liblog libdl libchrome -LOCAL_STATIC_LIBRARIES := libbtdevice libbtcore libosi libcutils - -LOCAL_CFLAGS += $(bluetooth_CFLAGS) -LOCAL_CONLYFLAGS += $(bluetooth_CONLYFLAGS) -LOCAL_CPPFLAGS += $(bluetooth_CPPFLAGS) - -include $(BUILD_NATIVE_TEST) diff --git a/system/embdrv/Android.bp b/system/embdrv/Android.bp new file mode 100644 index 0000000000000000000000000000000000000000..7c6328e69dae1d9f7f85b7399c6940b409a17f87 --- /dev/null +++ b/system/embdrv/Android.bp @@ -0,0 +1,3 @@ +subdirs = [ + "sbc", +] diff --git a/system/embdrv/Android.mk b/system/embdrv/Android.mk deleted file mode 100644 index c455f97f184b7c1fb3a9c3e922f5e5d250de267a..0000000000000000000000000000000000000000 --- a/system/embdrv/Android.mk +++ /dev/null @@ -1,3 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -include $(call all-subdir-makefiles) diff --git a/system/embdrv/sbc/Android.bp b/system/embdrv/sbc/Android.bp new file mode 100644 index 0000000000000000000000000000000000000000..5696377f6f9ce8497d02d087dc80f092a00a39db --- /dev/null +++ b/system/embdrv/sbc/Android.bp @@ -0,0 +1,4 @@ +subdirs = [ + "decoder", + "encoder", +] diff --git a/system/embdrv/sbc/Android.mk b/system/embdrv/sbc/Android.mk deleted file mode 100644 index c455f97f184b7c1fb3a9c3e922f5e5d250de267a..0000000000000000000000000000000000000000 --- a/system/embdrv/sbc/Android.mk +++ /dev/null @@ -1,3 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -include $(call all-subdir-makefiles) diff --git a/system/embdrv/sbc/decoder/Android.bp b/system/embdrv/sbc/decoder/Android.bp new file mode 100644 index 0000000000000000000000000000000000000000..274f2bf45959c75f69edb8966642fa079efca12f --- /dev/null +++ b/system/embdrv/sbc/decoder/Android.bp @@ -0,0 +1,26 @@ +// Bluetooth SBC decoder static library for target +// ======================================================== +cc_library_static { + name: "libbt-sbc-decoder", + defaults: ["fluoride_defaults"], + srcs: [ + "srce/alloc.c", + "srce/bitalloc.c", + "srce/bitalloc-sbc.c", + "srce/bitstream-decode.c", + "srce/decoder-oina.c", + "srce/decoder-private.c", + "srce/decoder-sbc.c", + "srce/dequant.c", + "srce/framing.c", + "srce/framing-sbc.c", + "srce/oi_codec_version.c", + "srce/synthesis-sbc.c", + "srce/synthesis-dct8.c", + "srce/synthesis-8-generated.c", + ], + local_include_dirs: [ + "include", + "srce", + ], +} diff --git a/system/embdrv/sbc/decoder/Android.mk b/system/embdrv/sbc/decoder/Android.mk deleted file mode 100644 index 267de8215354916e3f1f778580b782549028fd2b..0000000000000000000000000000000000000000 --- a/system/embdrv/sbc/decoder/Android.mk +++ /dev/null @@ -1,37 +0,0 @@ -LOCAL_PATH:= $(call my-dir) - -# Bluetooth SBC decoder static library for target -# ======================================================== -include $(CLEAR_VARS) - -LOCAL_CPP_EXTENSION := .cc - -# SBC decoder -LOCAL_SRC_FILES := \ - ./srce/alloc.c \ - ./srce/bitalloc.c \ - ./srce/bitalloc-sbc.c \ - ./srce/bitstream-decode.c \ - ./srce/decoder-oina.c \ - ./srce/decoder-private.c \ - ./srce/decoder-sbc.c \ - ./srce/dequant.c \ - ./srce/framing.c \ - ./srce/framing-sbc.c \ - ./srce/oi_codec_version.c \ - ./srce/synthesis-sbc.c \ - ./srce/synthesis-dct8.c \ - ./srce/synthesis-8-generated.c - -LOCAL_C_INCLUDES := $(LOCAL_PATH)/include \ - $(LOCAL_PATH)/srce - -LOCAL_MODULE := libbt-sbc-decoder -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_CLASS := STATIC_LIBRARIES - -LOCAL_CFLAGS += $(bluetooth_CFLAGS) -LOCAL_CONLYFLAGS += $(bluetooth_CONLYFLAGS) -LOCAL_CPPFLAGS += $(bluetooth_CPPFLAGS) - -include $(BUILD_STATIC_LIBRARY) diff --git a/system/embdrv/sbc/encoder/Android.bp b/system/embdrv/sbc/encoder/Android.bp new file mode 100644 index 0000000000000000000000000000000000000000..edbebe98eb761e236ea30899d5da3d0a934e3655 --- /dev/null +++ b/system/embdrv/sbc/encoder/Android.bp @@ -0,0 +1,23 @@ +cc_library_static { + name: "libbt-sbc-encoder", + defaults: ["fluoride_defaults"], + srcs: [ + "srce/sbc_analysis.c", + "srce/sbc_dct.c", + "srce/sbc_dct_coeffs.c", + "srce/sbc_enc_bit_alloc_mono.c", + "srce/sbc_enc_bit_alloc_ste.c", + "srce/sbc_enc_coeffs.c", + "srce/sbc_encoder.c", + "srce/sbc_packing.c", + ], + local_include_dirs: [ + "include", + "srce", + ], + include_dirs: [ + "packages/modules/Bluetooth/system", + "packages/modules/Bluetooth/system/include", + "packages/modules/Bluetooth/system/stack/include", + ], +} diff --git a/system/embdrv/sbc/encoder/Android.mk b/system/embdrv/sbc/encoder/Android.mk deleted file mode 100644 index e5eb406ad3100b56800b73be082166263bd1fe68..0000000000000000000000000000000000000000 --- a/system/embdrv/sbc/encoder/Android.mk +++ /dev/null @@ -1,34 +0,0 @@ -LOCAL_PATH:= $(call my-dir) - -# Bluetooth SBC encoder static library for target -# ======================================================== -include $(CLEAR_VARS) - -LOCAL_CPP_EXTENSION := .cc - -# SBC encoder -LOCAL_SRC_FILES := \ - ./srce/sbc_analysis.c \ - ./srce/sbc_dct.c \ - ./srce/sbc_dct_coeffs.c \ - ./srce/sbc_enc_bit_alloc_mono.c \ - ./srce/sbc_enc_bit_alloc_ste.c \ - ./srce/sbc_enc_coeffs.c \ - ./srce/sbc_encoder.c \ - ./srce/sbc_packing.c - -LOCAL_C_INCLUDES := $(LOCAL_PATH)/include \ - $(LOCAL_PATH)/../../../include \ - $(LOCAL_PATH)/../../../stack/include \ - $(LOCAL_PATH)/srce \ - $(bluetooth_C_INCLUDES) - -LOCAL_MODULE := libbt-sbc-encoder -# LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_CLASS := STATIC_LIBRARIES - -LOCAL_CFLAGS += $(bluetooth_CFLAGS) -LOCAL_CONLYFLAGS += $(bluetooth_CONLYFLAGS) -LOCAL_CPPFLAGS += $(bluetooth_CPPFLAGS) - -include $(BUILD_STATIC_LIBRARY) diff --git a/system/hci/Android.bp b/system/hci/Android.bp new file mode 100644 index 0000000000000000000000000000000000000000..c08bdc9a9aee48a9bfcc6351385455b9097f4274 --- /dev/null +++ b/system/hci/Android.bp @@ -0,0 +1,73 @@ +// HCI static library for target +// ======================================================== +cc_library_static { + name: "libbt-hci", + defaults: ["fluoride_defaults"], + srcs: [ + "src/btsnoop.cc", + "src/btsnoop_mem.cc", + "src/btsnoop_net.cc", + "src/buffer_allocator.cc", + "src/hci_audio.cc", + "src/hci_hal.cc", + "src/hci_hal_h4.cc", + "src/hci_hal_mct.cc", + "src/hci_inject.cc", + "src/hci_layer.cc", + "src/hci_packet_factory.cc", + "src/hci_packet_parser.cc", + "src/low_power_manager.cc", + "src/packet_fragmenter.cc", + "src/vendor.cc", + ], + local_include_dirs: [ + "include", + ], + include_dirs: [ + "packages/modules/Bluetooth/system", + "packages/modules/Bluetooth/system/include", + "packages/modules/Bluetooth/system/btcore/include", + "packages/modules/Bluetooth/system/stack/include", + "packages/modules/Bluetooth/system/utils/include", + "packages/modules/Bluetooth/system/bta/include", + ], +} + +// HCI unit tests for target +// ======================================================== +cc_test { + name: "net_test_hci", + defaults: ["fluoride_defaults"], + local_include_dirs: [ + "include", + ], + include_dirs: [ + "packages/modules/Bluetooth/system", + "packages/modules/Bluetooth/system/include", + "packages/modules/Bluetooth/system/btcore/include", + "packages/modules/Bluetooth/system/osi/test", + "packages/modules/Bluetooth/system/stack/include", + "packages/modules/Bluetooth/system/utils/include", + ], + srcs: [ + "test/hci_hal_h4_test.cc", + "test/hci_hal_mct_test.cc", + "test/hci_layer_test.cc", + "test/low_power_manager_test.cc", + "test/packet_fragmenter_test.cc", + ], + shared_libs: [ + "liblog", + "libdl", + "libprotobuf-cpp-lite", + ], + static_libs: [ + "libbt-hci", + "libosi", + "libosi-AlarmTestHarness", + "libosi-AllocationTestHarness", + "libcutils", + "libbtcore", + "libbt-protos", + ], +} diff --git a/system/hci/Android.mk b/system/hci/Android.mk deleted file mode 100644 index e392c0c0a8efeec3e746764192eee3b33cf8dd26..0000000000000000000000000000000000000000 --- a/system/hci/Android.mk +++ /dev/null @@ -1,83 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -# HCI static library for target -# ======================================================== -include $(CLEAR_VARS) -LOCAL_CPP_EXTENSION := .cc - -LOCAL_SRC_FILES := \ - src/btsnoop.cc \ - src/btsnoop_mem.cc \ - src/btsnoop_net.cc \ - src/buffer_allocator.cc \ - src/hci_audio.cc \ - src/hci_hal.cc \ - src/hci_hal_h4.cc \ - src/hci_hal_mct.cc \ - src/hci_inject.cc \ - src/hci_layer.cc \ - src/hci_packet_factory.cc \ - src/hci_packet_parser.cc \ - src/low_power_manager.cc \ - src/packet_fragmenter.cc \ - src/vendor.cc \ - ../../EventLogTags.logtags - -LOCAL_C_INCLUDES := \ - $(LOCAL_PATH)/include \ - $(LOCAL_PATH)/.. \ - $(LOCAL_PATH)/../include \ - $(LOCAL_PATH)/../btcore/include \ - $(LOCAL_PATH)/../stack/include \ - $(LOCAL_PATH)/../utils/include \ - $(LOCAL_PATH)/../bta/include \ - $(bluetooth_C_INCLUDES) - -LOCAL_MODULE := libbt-hci -LOCAL_SHARED_LIBRARIES := libchrome - -ifeq ($(BLUETOOTH_HCI_USE_MCT),true) - LOCAL_CFLAGS += -DHCI_USE_MCT -endif -LOCAL_CFLAGS += $(bluetooth_CFLAGS) -LOCAL_CONLYFLAGS += $(bluetooth_CONLYFLAGS) -LOCAL_CPPFLAGS += $(bluetooth_CPPFLAGS) - -include $(BUILD_STATIC_LIBRARY) - -# HCI unit tests for target -# ======================================================== -ifeq (,$(strip $(SANITIZE_TARGET))) -include $(CLEAR_VARS) -LOCAL_CPP_EXTENSION := .cc - -LOCAL_C_INCLUDES := \ - $(LOCAL_PATH)/include \ - $(LOCAL_PATH)/.. \ - $(LOCAL_PATH)/../include \ - $(LOCAL_PATH)/../btcore/include \ - $(LOCAL_PATH)/../osi/test \ - $(LOCAL_PATH)/../stack/include \ - $(LOCAL_PATH)/../utils/include \ - $(bluetooth_C_INCLUDES) - -LOCAL_SRC_FILES := \ - ../osi/test/AllocationTestHarness.cc \ - ../osi/test/AlarmTestHarness.cc \ - ./test/hci_hal_h4_test.cc \ - ./test/hci_hal_mct_test.cc \ - ./test/hci_layer_test.cc \ - ./test/low_power_manager_test.cc \ - ./test/packet_fragmenter_test.cc - -LOCAL_MODULE := net_test_hci -LOCAL_MODULE_TAGS := tests -LOCAL_SHARED_LIBRARIES := liblog libdl libprotobuf-cpp-lite libchrome -LOCAL_STATIC_LIBRARIES := libbt-hci libosi libcutils libbtcore libbt-protos - -LOCAL_CFLAGS += $(bluetooth_CFLAGS) -LOCAL_CONLYFLAGS += $(bluetooth_CONLYFLAGS) -LOCAL_CPPFLAGS += $(bluetooth_CPPFLAGS) - -include $(BUILD_NATIVE_TEST) -endif # SANITIZE_TARGET diff --git a/system/main/Android.bp b/system/main/Android.bp new file mode 100644 index 0000000000000000000000000000000000000000..bae1a97a2070683d42bae64f88d2490fb0afc9b1 --- /dev/null +++ b/system/main/Android.bp @@ -0,0 +1,81 @@ +// Bluetooth main HW module / shared library for target +// ======================================================== +cc_library_shared { + name: "bluetooth.default", + defaults: ["fluoride_defaults"], + relative_install_path: "hw", + srcs: [ + // platform specific + "bte_conf.cc", + "bte_init.cc", + "bte_init_cpp_logging.cc", + "bte_logmsg.cc", + "bte_main.cc", + "stack_config.cc", + ], + include_dirs: [ + "packages/modules/Bluetooth/system", + "packages/modules/Bluetooth/system/bta/include", + "packages/modules/Bluetooth/system/bta/sys", + "packages/modules/Bluetooth/system/bta/dm", + "packages/modules/Bluetooth/system/btcore/include", + "packages/modules/Bluetooth/system/include", + "packages/modules/Bluetooth/system/stack/include", + "packages/modules/Bluetooth/system/stack/l2cap", + "packages/modules/Bluetooth/system/stack/a2dp", + "packages/modules/Bluetooth/system/stack/btm", + "packages/modules/Bluetooth/system/stack/avdt", + "packages/modules/Bluetooth/system/udrv/include", + "packages/modules/Bluetooth/system/btif/include", + "packages/modules/Bluetooth/system/btif/co", + "packages/modules/Bluetooth/system/hci/include", + "packages/modules/Bluetooth/system/vnd/include", + "packages/modules/Bluetooth/system/embdrv/sbc/encoder/include", + "packages/modules/Bluetooth/system/embdrv/sbc/decoder/include", + "packages/modules/Bluetooth/system/audio_a2dp_hw", + "packages/modules/Bluetooth/system/utils/include", + ], + logtags: ["../../EventLogTags.logtags"], + shared_libs: [ + "libcutils", + "libdl", + "liblog", + "libz", + "libprotobuf-cpp-lite", + "libaudioclient", + "libutils", + "libtinyxml2", + ], + static_libs: [ + "libbt-sbc-decoder", + "libbt-sbc-encoder", + "libudrv-uipc", + ], + whole_static_libs: [ + "libbt-bta", + "libbtdevice", + "libbtif", + "libbt-hci", + "libbt-protos", + "libbt-stack", + "libbt-utils", + "libbtcore", + "libosi", + ], + // Shared library link options. + // References to global symbols and functions should bind to the library + // itself. This is to avoid issues with some of the unit/system tests + // that might link statically with some of the code in the library, and + // also dlopen(3) the shared library. + ldflags: ["-Wl,-Bsymbolic,-Bsymbolic-functions"], + required: [ + "bt_did.conf", + "bt_stack.conf", + "libbt-hci", + "libbt-vendor", + "libldacBT_enc", + ], + cflags: [ + "-DBUILDCFG", + ], +} diff --git a/system/main/Android.mk b/system/main/Android.mk deleted file mode 100644 index 10bf746c6ccee14a963c27f46e3c9f3bfff6a3b2..0000000000000000000000000000000000000000 --- a/system/main/Android.mk +++ /dev/null @@ -1,97 +0,0 @@ -LOCAL_PATH:= $(call my-dir) - -# Bluetooth main HW module / shared library for target -# ======================================================== -include $(CLEAR_VARS) - -LOCAL_CPP_EXTENSION := .cc - -# platform specific -LOCAL_SRC_FILES := \ - bte_conf.cc \ - bte_init.cc \ - bte_init_cpp_logging.cc \ - bte_logmsg.cc \ - bte_main.cc \ - stack_config.cc - -LOCAL_SRC_FILES += \ - ../udrv/ulinux/uipc.cc - -LOCAL_C_INCLUDES := . \ - $(LOCAL_PATH)/../ \ - $(LOCAL_PATH)/../bta/include \ - $(LOCAL_PATH)/../bta/sys \ - $(LOCAL_PATH)/../bta/dm \ - $(LOCAL_PATH)/../btcore/include \ - $(LOCAL_PATH)/../include \ - $(LOCAL_PATH)/../stack/include \ - $(LOCAL_PATH)/../stack/l2cap \ - $(LOCAL_PATH)/../stack/a2dp \ - $(LOCAL_PATH)/../stack/btm \ - $(LOCAL_PATH)/../stack/avdt \ - $(LOCAL_PATH)/../udrv/include \ - $(LOCAL_PATH)/../btif/include \ - $(LOCAL_PATH)/../btif/co \ - $(LOCAL_PATH)/../hci/include\ - $(LOCAL_PATH)/../vnd/include \ - $(LOCAL_PATH)/../embdrv/sbc/encoder/include \ - $(LOCAL_PATH)/../embdrv/sbc/decoder/include \ - $(LOCAL_PATH)/../audio_a2dp_hw \ - $(LOCAL_PATH)/../utils/include \ - $(bluetooth_C_INCLUDES) \ - external/tinyxml2 \ - external/zlib - -LOCAL_SHARED_LIBRARIES := \ - libcutils \ - libdl \ - liblog \ - libz \ - libprotobuf-cpp-lite \ - libaudioclient \ - libutils \ - libchrome \ - libtinyxml2 - -LOCAL_STATIC_LIBRARIES := \ - libbt-sbc-decoder \ - libbt-sbc-encoder - -LOCAL_WHOLE_STATIC_LIBRARIES := \ - libbt-bta \ - libbtdevice \ - libbtif \ - libbt-hci \ - libbt-protos \ - libbt-stack \ - libbt-utils \ - libbtcore \ - libosi - -LOCAL_MODULE := bluetooth.default -LOCAL_MODULE_RELATIVE_PATH := hw -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_CLASS := SHARED_LIBRARIES - -# -# Shared library link options. -# References to global symbols and functions should bind to the library -# itself. This is to avoid issues with some of the unit/system tests -# that might link statically with some of the code in the library, and -# also dlopen(3) the shared library. -# -LOCAL_LDLIBS := -Wl,-Bsymbolic,-Bsymbolic-functions - -LOCAL_REQUIRED_MODULES := \ - bt_did.conf \ - bt_stack.conf \ - libbt-hci \ - libbt-vendor \ - libldacBT_enc - -LOCAL_CFLAGS += $(bluetooth_CFLAGS) -DBUILDCFG -LOCAL_CONLYFLAGS += $(bluetooth_CONLYFLAGS) -LOCAL_CPPFLAGS += $(bluetooth_CPPFLAGS) - -include $(BUILD_SHARED_LIBRARY) diff --git a/system/osi/Android.bp b/system/osi/Android.bp new file mode 100644 index 0000000000000000000000000000000000000000..e8385e7d7d25392bf931da998e66187c6b9aa053 --- /dev/null +++ b/system/osi/Android.bp @@ -0,0 +1,161 @@ +cc_defaults { + name: "fluoride_osi_defaults", + defaults: ["fluoride_defaults"], + include_dirs: [ + "packages/modules/Bluetooth/system", + "packages/modules/Bluetooth/system/include", + "packages/modules/Bluetooth/system/osi/src/protos", + "packages/modules/Bluetooth/system/utils/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 + } +} + +// Bluetooth Protobuf static library for target and host +// ======================================================== +cc_library_static { + name: "libbt-protos", + defaults: ["fluoride_defaults"], + srcs: ["src/protos/bluetooth.proto"], + proto: { + export_proto_headers: true, + }, + host_supported: true +} + + +// libosi static library for target +// ======================================================== +cc_library_static { + name: "libosi", + defaults: ["fluoride_osi_defaults"], + // TODO(mcchou): Remove socket_utils sources after platform specific + // dependencies are abstracted. + srcs: [ + "src/alarm.cc", + "src/allocation_tracker.cc", + "src/allocator.cc", + "src/array.cc", + "src/buffer.cc", + "src/compat.cc", + "src/config.cc", + "src/data_dispatcher.cc", + "src/eager_reader.cc", + "src/fixed_queue.cc", + "src/future.cc", + "src/hash_map_utils.cc", + "src/list.cc", + "src/metrics.cc", + "src/mutex.cc", + "src/osi.cc", + "src/properties.cc", + "src/reactor.cc", + "src/ringbuffer.cc", + "src/semaphore.cc", + "src/socket.cc", + "src/socket_utils/socket_local_client.cc", + "src/socket_utils/socket_local_server.cc", + "src/thread.cc", + "src/time.cc", + "src/wakelock.cc", + ], + shared_libs: [ + "liblog", + ], + static_libs: ["libbt-protos"], + 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: { + darwin: { + enabled: false, + }, + linux: { + cflags: [ + "-D_GNU_SOURCE", + "-DOS_GENERIC", + ], + }, + }, +} + +// libosi unit tests for target and host +// ======================================================== +cc_test { + name: "net_test_osi", + defaults: ["fluoride_osi_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/data_dispatcher_test.cc", + "test/eager_reader_test.cc", + "test/fixed_queue_test.cc", + "test/future_test.cc", + "test/hash_map_utils_test.cc", + "test/leaky_bonded_queue_test.cc", + "test/list_test.cc", + "test/metrics_test.cc", + "test/properties_test.cc", + "test/rand_test.cc", + "test/reactor_test.cc", + "test/ringbuffer_test.cc", + "test/semaphore_test.cc", + "test/thread_test.cc", + "test/time_test.cc", + "test/wakelock_test.cc", + ], + shared_libs: [ + "liblog", + "libprotobuf-cpp-lite", + "libcutils", + ], + static_libs: [ + "libbt-protos", + "libgmock", + "libosi", + ], + target: { + linux: { + cflags: ["-DOS_GENERIC"], + host_ldlibs: [ + "-lrt", + "-lpthread", + ], + }, + darwin: { + enabled: false, + } + }, +} diff --git a/system/osi/Android.mk b/system/osi/Android.mk deleted file mode 100644 index 27dd82d34a31e38286712b7472df10f968f98eaf..0000000000000000000000000000000000000000 --- a/system/osi/Android.mk +++ /dev/null @@ -1,201 +0,0 @@ - ############################################################################## - # - # Copyright (C) 2014 Google, Inc. - # - # Licensed under the Apache License, Version 2.0 (the "License"); - # you may not use this file except in compliance with the License. - # You may obtain a copy of the License at: - # - # http://www.apache.org/licenses/LICENSE-2.0 - # - # Unless required by applicable law or agreed to in writing, software - # distributed under the License is distributed on an "AS IS" BASIS, - # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - # See the License for the specific language governing permissions and - # limitations under the License. - # - ############################################################################## - -LOCAL_PATH := $(call my-dir) - -# Common variables -# ======================================================== - -# TODO(mcchou): Remove socket_utils sources after platform specific -# dependencies are abstracted. -btosiCommonSrc := \ - ./src/alarm.cc \ - ./src/allocation_tracker.cc \ - ./src/allocator.cc \ - ./src/array.cc \ - ./src/buffer.cc \ - ./src/compat.cc \ - ./src/config.cc \ - ./src/data_dispatcher.cc \ - ./src/eager_reader.cc \ - ./src/fixed_queue.cc \ - ./src/future.cc \ - ./src/hash_map_utils.cc \ - ./src/list.cc \ - ./src/metrics.cc \ - ./src/mutex.cc \ - ./src/osi.cc \ - ./src/properties.cc \ - ./src/reactor.cc \ - ./src/ringbuffer.cc \ - ./src/semaphore.cc \ - ./src/socket.cc \ - ./src/socket_utils/socket_local_client.cc \ - ./src/socket_utils/socket_local_server.cc \ - ./src/thread.cc \ - ./src/time.cc \ - ./src/wakelock.cc - -btosiCommonTestSrc := \ - ./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/data_dispatcher_test.cc \ - ./test/eager_reader_test.cc \ - ./test/fixed_queue_test.cc \ - ./test/future_test.cc \ - ./test/hash_map_utils_test.cc \ - ./test/leaky_bonded_queue_test.cc \ - ./test/list_test.cc \ - ./test/metrics_test.cc \ - ./test/properties_test.cc \ - ./test/rand_test.cc \ - ./test/reactor_test.cc \ - ./test/ringbuffer_test.cc \ - ./test/semaphore_test.cc \ - ./test/thread_test.cc \ - ./test/time_test.cc \ - ./test/wakelock_test.cc - -btosiCommonIncludes := \ - $(LOCAL_PATH)/.. \ - $(LOCAL_PATH)/../include \ - $(LOCAL_PATH)/../utils/include \ - $(LOCAL_PATH)/../stack/include \ - $(bluetooth_C_INCLUDES) - -# Bluetooth Protobuf static library for target -# ======================================================== -include $(CLEAR_VARS) -LOCAL_CPP_EXTENSION := .cc -LOCAL_MODULE := libbt-protos -LOCAL_MODULE_CLASS := STATIC_LIBRARIES -generated_sources_dir := $(call local-generated-sources-dir) -LOCAL_EXPORT_C_INCLUDE_DIRS := \ - $(generated_sources_dir)/proto/packages/modules/Bluetooth/system -LOCAL_SRC_FILES := $(call all-proto-files-under,src/protos/) - -LOCAL_CFLAGS += $(bluetooth_CFLAGS) -LOCAL_CONLYFLAGS += $(bluetooth_CONLYFLAGS) -LOCAL_CPPFLAGS += $(bluetooth_CPPFLAGS) - -include $(BUILD_STATIC_LIBRARY) - -# Bluetooth Protobuf static library for host -# ======================================================== -include $(CLEAR_VARS) -LOCAL_CPP_EXTENSION := .cc -LOCAL_MODULE := libbt-protos -LOCAL_MODULE_CLASS := STATIC_LIBRARIES -LOCAL_IS_HOST_MODULE := true -generated_sources_dir := $(call local-generated-sources-dir) -LOCAL_EXPORT_C_INCLUDE_DIRS := \ - $(generated_sources_dir)/proto/packages/modules/Bluetooth/system -LOCAL_SRC_FILES := $(call all-proto-files-under,src/protos/) - -LOCAL_CFLAGS += $(bluetooth_CFLAGS) -LOCAL_CONLYFLAGS += $(bluetooth_CONLYFLAGS) -LOCAL_CPPFLAGS += $(bluetooth_CPPFLAGS) - -include $(BUILD_HOST_STATIC_LIBRARY) - -# libosi static library for target -# ======================================================== -include $(CLEAR_VARS) -LOCAL_CPP_EXTENSION := .cc -LOCAL_C_INCLUDES := $(btosiCommonIncludes) -LOCAL_SRC_FILES := $(btosiCommonSrc) -LOCAL_MODULE := libosi -LOCAL_MODULE_TAGS := optional -LOCAL_SHARED_LIBRARIES := libc liblog libchrome -LOCAL_STATIC_LIBRARIES := libbt-protos -LOCAL_MODULE_CLASS := STATIC_LIBRARIES - -LOCAL_CFLAGS += $(bluetooth_CFLAGS) -LOCAL_CONLYFLAGS += $(bluetooth_CONLYFLAGS) -LOCAL_CPPFLAGS += $(bluetooth_CPPFLAGS) - -include $(BUILD_STATIC_LIBRARY) - -# libosi static library for host -# ======================================================== -ifeq ($(HOST_OS),linux) -include $(CLEAR_VARS) -LOCAL_CPP_EXTENSION := .cc -LOCAL_C_INCLUDES := $(btosiCommonIncludes) -LOCAL_SRC_FILES := $(btosiCommonSrc) -LOCAL_MODULE := libosi-host -LOCAL_MODULE_TAGS := optional -LOCAL_SHARED_LIBRARIES := liblog libchrome -LOCAL_STATIC_LIBRARIES := libbt-protos -LOCAL_MODULE_CLASS := STATIC_LIBRARIES - -# 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. -LOCAL_CFLAGS += $(bluetooth_CFLAGS) -D_GNU_SOURCE -DOS_GENERIC -LOCAL_CONLYFLAGS += $(bluetooth_CONLYFLAGS) -LOCAL_CPPFLAGS += $(bluetooth_CPPFLAGS) - -include $(BUILD_HOST_STATIC_LIBRARY) -endif - -# -# Note: It's good to get the tests compiled both for the host and the target so -# we get to test with both Bionic libc and glibc -# -# libosi unit tests for target -# ======================================================== -include $(CLEAR_VARS) -LOCAL_CPP_EXTENSION := .cc -LOCAL_C_INCLUDES := $(btosiCommonIncludes) -LOCAL_SRC_FILES := $(btosiCommonTestSrc) -LOCAL_MODULE := net_test_osi -LOCAL_MODULE_TAGS := tests -LOCAL_SHARED_LIBRARIES := libc liblog libprotobuf-cpp-lite libchrome libcutils -LOCAL_STATIC_LIBRARIES := libosi libbt-protos libgmock - -LOCAL_CFLAGS += $(bluetooth_CFLAGS) -LOCAL_CONLYFLAGS += $(bluetooth_CONLYFLAGS) -LOCAL_CPPFLAGS += $(bluetooth_CPPFLAGS) - -include $(BUILD_NATIVE_TEST) - -# libosi unit tests for host -# ======================================================== -ifeq ($(HOST_OS),linux) -include $(CLEAR_VARS) -LOCAL_CPP_EXTENSION := .cc -LOCAL_C_INCLUDES := $(btosiCommonIncludes) -LOCAL_SRC_FILES := $(btosiCommonTestSrc) -LOCAL_LDLIBS := -lrt -lpthread -LOCAL_MODULE := net_test_osi -LOCAL_MODULE_TAGS := tests -LOCAL_SHARED_LIBRARIES := liblog libprotobuf-cpp-lite libchrome -LOCAL_STATIC_LIBRARIES := libosi-host libbt-protos libgmock - -LOCAL_CFLAGS += $(bluetooth_CFLAGS) -DOS_GENERIC -LOCAL_CONLYFLAGS += $(bluetooth_CONLYFLAGS) -LOCAL_CPPFLAGS += $(bluetooth_CPPFLAGS) - -include $(BUILD_HOST_NATIVE_TEST) -endif diff --git a/system/osi/src/metrics.cc b/system/osi/src/metrics.cc index e5f9b55b6936154768c14b3f7bd2704c624bef12..2cce3d39afe8febf98cfc01ddf5fddfe5861af72 100644 --- a/system/osi/src/metrics.cc +++ b/system/osi/src/metrics.cc @@ -35,7 +35,7 @@ #include "osi/include/time.h" #include "stack/include/btm_api_types.h" -#include "osi/src/protos/bluetooth.pb.h" +#include "src/protos/bluetooth.pb.h" #include "osi/include/metrics.h" diff --git a/system/osi/test/metrics_test.cc b/system/osi/test/metrics_test.cc index ce4057e42e7e3c70472aa1056f8c58bcccd6e875..8bcf6732e8f5aac8a05ac756be982584f2b1e754 100644 --- a/system/osi/test/metrics_test.cc +++ b/system/osi/test/metrics_test.cc @@ -28,7 +28,7 @@ #include "osi/include/metrics.h" #include "osi/include/time.h" -#include "osi/src/protos/bluetooth.pb.h" +#include "src/protos/bluetooth.pb.h" #define BTM_COD_MAJOR_AUDIO_TEST 0x04 diff --git a/system/service/Android.bp b/system/service/Android.bp new file mode 100644 index 0000000000000000000000000000000000000000..ff0b9b7df7635924dedecec8a1f279e2e7edf060 --- /dev/null +++ b/system/service/Android.bp @@ -0,0 +1,242 @@ +cc_defaults { + name: "fluoride_service_defaults", + defaults: ["fluoride_defaults"], + local_include_dirs: [ + "common" + ], + include_dirs: [ + "packages/modules/Bluetooth/system" + ], + srcs: [ + "common/bluetooth/adapter_state.cc", + "common/bluetooth/advertise_data.cc", + "common/bluetooth/advertise_settings.cc", + "common/bluetooth/descriptor.cc", + "common/bluetooth/characteristic.cc", + "common/bluetooth/scan_filter.cc", + "common/bluetooth/scan_result.cc", + "common/bluetooth/scan_settings.cc", + "common/bluetooth/service.cc", + "common/bluetooth/util/address_helper.cc", + "common/bluetooth/util/atomic_string.cc", + "common/bluetooth/uuid.cc", + ] +} + +// Source variables +// ======================================================== +btserviceCommonBinderSrc = [ + "common/android/bluetooth/IBluetooth.aidl", + "common/android/bluetooth/IBluetoothCallback.aidl", + "common/android/bluetooth/IBluetoothGattClient.aidl", + "common/android/bluetooth/IBluetoothGattClientCallback.aidl", + "common/android/bluetooth/IBluetoothGattServer.aidl", + "common/android/bluetooth/IBluetoothGattServerCallback.aidl", + "common/android/bluetooth/IBluetoothLeAdvertiser.aidl", + "common/android/bluetooth/IBluetoothLeAdvertiserCallback.aidl", + "common/android/bluetooth/IBluetoothLeScanner.aidl", + "common/android/bluetooth/IBluetoothLeScannerCallback.aidl", + "common/android/bluetooth/IBluetoothLowEnergy.aidl", + "common/android/bluetooth/IBluetoothLowEnergyCallback.aidl", + "common/android/bluetooth/advertise_data.cc", + "common/android/bluetooth/advertise_settings.cc", + "common/android/bluetooth/bluetooth_gatt_characteristic.cc", + "common/android/bluetooth/bluetooth_gatt_descriptor.cc", + "common/android/bluetooth/bluetooth_gatt_included_service.cc", + "common/android/bluetooth/bluetooth_gatt_service.cc", + "common/android/bluetooth/scan_filter.cc", + "common/android/bluetooth/scan_result.cc", + "common/android/bluetooth/scan_settings.cc", + "common/android/bluetooth/uuid.cc", +] + +btserviceCommonAidlInclude = [ + "packages/modules/Bluetooth/system/service/common", + "frameworks/native/aidl/binder", +] + +btserviceDaemonSrc = [ + "adapter.cc", + "daemon.cc", + "gatt_client.cc", + "gatt_server.cc", + "gatt_server_old.cc", + "hal/bluetooth_gatt_interface.cc", + "hal/bluetooth_interface.cc", + "ipc/ipc_handler.cc", + "ipc/ipc_manager.cc", + "logging_helpers.cc", + "low_energy_advertiser.cc", + "low_energy_scanner.cc", + "low_energy_client.cc", + "settings.cc", +] + +btserviceLinuxSrc = [ + "ipc/ipc_handler_linux.cc", + "ipc/linux_ipc_host.cc", +] + +btserviceBinderDaemonImplSrc = [ + "ipc/binder/bluetooth_binder_server.cc", + "ipc/binder/bluetooth_gatt_client_binder_server.cc", + "ipc/binder/bluetooth_gatt_server_binder_server.cc", + "ipc/binder/bluetooth_le_advertiser_binder_server.cc", + "ipc/binder/bluetooth_le_scanner_binder_server.cc", + "ipc/binder/bluetooth_low_energy_binder_server.cc", + "ipc/binder/interface_with_instances_base.cc", + "ipc/binder/ipc_handler_binder.cc", +] + +btserviceBinderDaemonSrc = btserviceCommonBinderSrc + btserviceBinderDaemonImplSrc + +// Main unit test sources. These get built for host and target. +// ======================================================== +btserviceBaseTestSrc = [ + "hal/fake_bluetooth_gatt_interface.cc", + "hal/fake_bluetooth_interface.cc", + "test/adapter_unittest.cc", + "test/advertise_data_unittest.cc", + "test/fake_hal_util.cc", + "test/gatt_client_unittest.cc", + "test/gatt_server_unittest.cc", + "test/low_energy_advertiser_unittest.cc", + "test/low_energy_client_unittest.cc", + "test/low_energy_scanner_unittest.cc", + "test/settings_unittest.cc", + "test/util_unittest.cc", + "test/uuid_unittest.cc", +] + +// Native system service for target +// ======================================================== +cc_binary { + name: "bluetoothtbd", + defaults: ["fluoride_service_defaults"], + srcs: btserviceBinderDaemonSrc + + btserviceLinuxSrc + + btserviceDaemonSrc + + ["main.cc"], + aidl: { + include_dirs: btserviceCommonAidlInclude + }, + required: ["bluetooth.default"], + static_libs: ["libbtcore"], + shared_libs: [ + "libbinder", + "libcutils", + "libhardware", + "liblog", + "libutils", + ], + init_rc: ["bluetoothtbd.rc"], +} + +// Native system service unit tests for target and host + +// ======================================================== +cc_test { + name: "bluetoothtbd_test", + defaults: ["fluoride_service_defaults"], + srcs: btserviceBaseTestSrc + + btserviceDaemonSrc + [ + "test/main.cc" + ], + aidl: { + include_dirs: btserviceCommonAidlInclude, + }, + static_libs: [ + "libgmock", + "liblog", + ], + host_supported: true, + target: { + // This includes Binder related tests that can only be run + // on target. + android: { + srcs: btserviceBinderDaemonSrc + [ + "test/parcelable_unittest.cc", + "test/ParcelableTest.aidl", + ], + shared_libs: [ + "libbinder", + "libutils", + ], + }, + host: { + srcs: [ + "test/stub_ipc_handler_binder.cc", + ], + }, + darwin: { + srcs: [ + "test/stub_ipc_handler_linux.cc", + ], + }, + linux: { + srcs: btserviceLinuxSrc + [ + "test/ipc_linux_unittest.cc", + ], + host_ldlibs: ["-lrt"], + }, + }, +} + +// Client library for interacting with Bluetooth daemon +// This is a static library for target. +// ======================================================== +cc_library_static { + name: "libbluetooth-client", + defaults: ["fluoride_service_defaults"], + srcs: btserviceCommonBinderSrc, + aidl: { + export_aidl_headers: true, + include_dirs: btserviceCommonAidlInclude + }, + export_include_dirs: ["common"], + shared_libs: [ + "libbinder", + "libutils", + ], +} + +// Native system service CLI for target +// ======================================================== +cc_binary { + name: "bluetooth-cli", + defaults: ["fluoride_defaults"], + srcs: ["client/main.cc"], + static_libs: ["libbluetooth-client"], + shared_libs: [ + "libbinder", + "libutils", + ], +} + +// Heart Rate GATT service example for target +// ======================================================== +cc_binary { + name: "bt-example-hr-server", + defaults: ["fluoride_defaults"], + local_include_dirs: ["example/heart_rate"], + srcs: [ + "example/heart_rate/heart_rate_server.cc", + "example/heart_rate/server_main.cc", + ], + static_libs: ["libbluetooth-client"], + shared_libs: [ + "libbinder", + "libutils", + ], +} + +cc_library_static { + name: "libbluetoothtbd_hal", + defaults: ["fluoride_defaults"], + include_dirs: ["packages/modules/Bluetooth/system"], + srcs = [ + "hal/bluetooth_gatt_interface.cc", + "hal/bluetooth_interface.cc", + "logging_helpers.cc", + ] +} diff --git a/system/service/Android.mk b/system/service/Android.mk deleted file mode 100644 index 4100b69d6f937b266207f491f30cbc20b01f56f2..0000000000000000000000000000000000000000 --- a/system/service/Android.mk +++ /dev/null @@ -1,272 +0,0 @@ -# -# Copyright (C) 2015 Google -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -LOCAL_PATH:= $(call my-dir) - -# Source variables -# ======================================================== -btserviceCommonSrc := \ - common/bluetooth/adapter_state.cc \ - common/bluetooth/advertise_data.cc \ - common/bluetooth/advertise_settings.cc \ - common/bluetooth/descriptor.cc \ - common/bluetooth/characteristic.cc \ - common/bluetooth/scan_filter.cc \ - common/bluetooth/scan_result.cc \ - common/bluetooth/scan_settings.cc \ - common/bluetooth/service.cc \ - common/bluetooth/util/address_helper.cc \ - common/bluetooth/util/atomic_string.cc \ - common/bluetooth/uuid.cc - -btserviceCommonBinderSrc := \ - common/android/bluetooth/IBluetooth.aidl \ - common/android/bluetooth/IBluetoothCallback.aidl \ - common/android/bluetooth/IBluetoothGattClient.aidl \ - common/android/bluetooth/IBluetoothGattClientCallback.aidl \ - common/android/bluetooth/IBluetoothGattServer.aidl \ - common/android/bluetooth/IBluetoothGattServerCallback.aidl \ - common/android/bluetooth/IBluetoothLeAdvertiser.aidl \ - common/android/bluetooth/IBluetoothLeAdvertiserCallback.aidl \ - common/android/bluetooth/IBluetoothLeScanner.aidl \ - common/android/bluetooth/IBluetoothLeScannerCallback.aidl \ - common/android/bluetooth/IBluetoothLowEnergy.aidl \ - common/android/bluetooth/IBluetoothLowEnergyCallback.aidl \ - common/android/bluetooth/advertise_data.cc \ - common/android/bluetooth/advertise_settings.cc \ - common/android/bluetooth/bluetooth_gatt_characteristic.cc \ - common/android/bluetooth/bluetooth_gatt_descriptor.cc \ - common/android/bluetooth/bluetooth_gatt_included_service.cc \ - common/android/bluetooth/bluetooth_gatt_service.cc \ - common/android/bluetooth/scan_filter.cc \ - common/android/bluetooth/scan_result.cc \ - common/android/bluetooth/scan_settings.cc \ - common/android/bluetooth/uuid.cc \ - -btserviceCommonAidlInclude := \ - packages/modules/Bluetooth/system/service/common \ - frameworks/native/aidl/binder - -btserviceDaemonSrc := \ - adapter.cc \ - daemon.cc \ - gatt_client.cc \ - gatt_server.cc \ - gatt_server_old.cc \ - hal/bluetooth_gatt_interface.cc \ - hal/bluetooth_interface.cc \ - ipc/ipc_handler.cc \ - ipc/ipc_manager.cc \ - logging_helpers.cc \ - low_energy_advertiser.cc \ - low_energy_scanner.cc \ - low_energy_client.cc \ - settings.cc - -btserviceLinuxSrc := \ - ipc/ipc_handler_linux.cc \ - ipc/linux_ipc_host.cc - -btserviceBinderDaemonImplSrc := \ - ipc/binder/bluetooth_binder_server.cc \ - ipc/binder/bluetooth_gatt_client_binder_server.cc \ - ipc/binder/bluetooth_gatt_server_binder_server.cc \ - ipc/binder/bluetooth_le_advertiser_binder_server.cc \ - ipc/binder/bluetooth_le_scanner_binder_server.cc \ - ipc/binder/bluetooth_low_energy_binder_server.cc \ - ipc/binder/interface_with_instances_base.cc \ - ipc/binder/ipc_handler_binder.cc \ - -btserviceBinderDaemonSrc := \ - $(btserviceCommonBinderSrc) \ - $(btserviceBinderDaemonImplSrc) - -btserviceCommonIncludes := \ - $(LOCAL_PATH)/../ \ - $(LOCAL_PATH)/common - -# Main unit test sources. These get built for host and target. -# ======================================================== -btserviceBaseTestSrc := \ - hal/fake_bluetooth_gatt_interface.cc \ - hal/fake_bluetooth_interface.cc \ - test/adapter_unittest.cc \ - test/advertise_data_unittest.cc \ - test/fake_hal_util.cc \ - test/gatt_client_unittest.cc \ - test/gatt_server_unittest.cc \ - test/low_energy_advertiser_unittest.cc \ - test/low_energy_client_unittest.cc \ - test/low_energy_scanner_unittest.cc \ - test/settings_unittest.cc \ - test/util_unittest.cc \ - test/uuid_unittest.cc - -# Native system service for target -# ======================================================== -include $(CLEAR_VARS) -LOCAL_CPP_EXTENSION := .cc -LOCAL_SRC_FILES := \ - $(btserviceCommonSrc) \ - $(btserviceBinderDaemonSrc) \ - $(btserviceLinuxSrc) \ - $(btserviceDaemonSrc) \ - main.cc -LOCAL_AIDL_INCLUDES = $(btserviceCommonAidlInclude) -LOCAL_C_INCLUDES := $(btserviceCommonIncludes) -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE := bluetoothtbd -LOCAL_REQUIRED_MODULES := bluetooth.default -LOCAL_STATIC_LIBRARIES := libbtcore -LOCAL_SHARED_LIBRARIES := \ - libbinder \ - libchrome \ - libcutils \ - libhardware \ - liblog \ - libutils -LOCAL_INIT_RC := bluetoothtbd.rc - -LOCAL_CFLAGS += $(bluetooth_CFLAGS) -LOCAL_CONLYFLAGS += $(bluetooth_CONLYFLAGS) -LOCAL_CPPFLAGS += $(bluetooth_CPPFLAGS) - -include $(BUILD_EXECUTABLE) - -# Native system service unit tests for host -# ======================================================== -include $(CLEAR_VARS) -LOCAL_CPP_EXTENSION := .cc -LOCAL_SRC_FILES := \ - $(btserviceBaseTestSrc) \ - $(btserviceCommonSrc) \ - $(btserviceDaemonSrc) \ - test/main.cc \ - test/stub_ipc_handler_binder.cc -ifeq ($(HOST_OS),linux) -LOCAL_SRC_FILES += \ - $(btserviceLinuxSrc) \ - test/ipc_linux_unittest.cc -LOCAL_LDLIBS += -lrt -else -LOCAL_SRC_FILES += \ - test/stub_ipc_handler_linux.cc -endif -LOCAL_C_INCLUDES := $(btserviceCommonIncludes) -LOCAL_MODULE_TAGS := debug tests -LOCAL_MODULE := bluetoothtbd-host_test -LOCAL_SHARED_LIBRARIES := libchrome -LOCAL_STATIC_LIBRARIES := libgmock_host libgtest_host liblog - -LOCAL_CFLAGS += $(bluetooth_CFLAGS) -LOCAL_CONLYFLAGS += $(bluetooth_CONLYFLAGS) -LOCAL_CPPFLAGS += $(bluetooth_CPPFLAGS) - -include $(BUILD_HOST_NATIVE_TEST) - -# Native system service unit tests for target. -# This includes Binder related tests that can only be run -# on target. -# ======================================================== -include $(CLEAR_VARS) -LOCAL_CPP_EXTENSION := .cc -LOCAL_SRC_FILES := \ - $(btserviceBaseTestSrc) \ - $(btserviceCommonSrc) \ - $(btserviceBinderDaemonSrc) \ - $(btserviceDaemonSrc) \ - test/main.cc \ - test/parcelable_unittest.cc \ - test/ParcelableTest.aidl -LOCAL_AIDL_INCLUDES := $(btserviceCommonAidlInclude) -LOCAL_AIDL_INCLUDES += ./ -LOCAL_C_INCLUDES := $(btserviceCommonIncludes) -LOCAL_MODULE_TAGS := debug tests -LOCAL_MODULE := bluetoothtbd_test -LOCAL_SHARED_LIBRARIES := \ - libbinder \ - libchrome \ - libutils -LOCAL_STATIC_LIBRARIES := libgmock libgtest liblog - -LOCAL_CFLAGS += $(bluetooth_CFLAGS) -LOCAL_CONLYFLAGS += $(bluetooth_CONLYFLAGS) -LOCAL_CPPFLAGS += $(bluetooth_CPPFLAGS) - -include $(BUILD_NATIVE_TEST) - -# Client library for interacting with Bluetooth daemon -# This is a static library for target. -# ======================================================== -include $(CLEAR_VARS) -LOCAL_CPP_EXTENSION := .cc -LOCAL_SRC_FILES := \ - $(btserviceCommonSrc) \ - $(btserviceCommonBinderSrc) -LOCAL_AIDL_INCLUDES := $(btserviceCommonAidlInclude) -LOCAL_C_INCLUDES := $(btserviceCommonIncludes) -LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/common -LOCAL_MODULE := libbluetooth-client -LOCAL_SHARED_LIBRARIES := libbinder libchrome libutils - -LOCAL_CFLAGS += $(bluetooth_CFLAGS) -LOCAL_CONLYFLAGS += $(bluetooth_CONLYFLAGS) -LOCAL_CPPFLAGS += $(bluetooth_CPPFLAGS) - -include $(BUILD_STATIC_LIBRARY) - -# Native system service CLI for target -# ======================================================== -include $(CLEAR_VARS) -LOCAL_CPP_EXTENSION := .cc -LOCAL_SRC_FILES := client/main.cc -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE := bluetooth-cli -LOCAL_STATIC_LIBRARIES := libbluetooth-client -LOCAL_SHARED_LIBRARIES := \ - libbinder \ - libchrome \ - libutils - -LOCAL_CFLAGS += $(bluetooth_CFLAGS) -LOCAL_CONLYFLAGS += $(bluetooth_CONLYFLAGS) -LOCAL_CPPFLAGS += $(bluetooth_CPPFLAGS) - -include $(BUILD_EXECUTABLE) - -# Heart Rate GATT service example for target -# ======================================================== -# TODO(armansito): Move this into a new makefile under examples/ once we build -# a client static library that the examples can depend on. -include $(CLEAR_VARS) -LOCAL_CPP_EXTENSION := .cc -LOCAL_SRC_FILES := \ - example/heart_rate/heart_rate_server.cc \ - example/heart_rate/server_main.cc -LOCAL_C_INCLUDES := $(LOCAL_PATH)/../ -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE := bt-example-hr-server -LOCAL_STATIC_LIBRARIES := libbluetooth-client -LOCAL_SHARED_LIBRARIES := \ - libbinder \ - libchrome \ - libutils - -LOCAL_CFLAGS += $(bluetooth_CFLAGS) -LOCAL_CONLYFLAGS += $(bluetooth_CONLYFLAGS) -LOCAL_CPPFLAGS += $(bluetooth_CPPFLAGS) - -include $(BUILD_EXECUTABLE) diff --git a/system/service/example/heart_rate/heart_rate_server.cc b/system/service/example/heart_rate/heart_rate_server.cc index 63b68beefb3dfc57e0a43e5c19ed748df4fc99fc..a7bfe520ccf60ed00cc4a873f79ac0541b073081 100644 --- a/system/service/example/heart_rate/heart_rate_server.cc +++ b/system/service/example/heart_rate/heart_rate_server.cc @@ -13,9 +13,6 @@ // See the License for the specific language governing permissions and // limitations under the License. // - -#include "service/example/heart_rate/heart_rate_server.h" - #include <base/bind.h> #include <base/location.h> #include <base/logging.h> @@ -25,7 +22,8 @@ #include <android/bluetooth/IBluetoothLeAdvertiser.h> #include <bluetooth/low_energy_constants.h> -#include "service/example/heart_rate/constants.h" +#include "constants.h" +#include "heart_rate_server.h" using android::binder::Status; using android::String8; diff --git a/system/service/example/heart_rate/server_main.cc b/system/service/example/heart_rate/server_main.cc index 27fac53d13043b087cbd367b82926d98e70380c8..76e7741df0f950773112be01a4cea2c498ee5de0 100644 --- a/system/service/example/heart_rate/server_main.cc +++ b/system/service/example/heart_rate/server_main.cc @@ -28,7 +28,7 @@ #include <android/bluetooth/IBluetooth.h> -#include "service/example/heart_rate/heart_rate_server.h" +#include "heart_rate_server.h" using android::sp; using android::OK; diff --git a/system/stack/Android.bp b/system/stack/Android.bp new file mode 100644 index 0000000000000000000000000000000000000000..f0b5e46001a9be5f6880d3f01db6484a3367fa6c --- /dev/null +++ b/system/stack/Android.bp @@ -0,0 +1,263 @@ +// Bluetooth stack static library for target +// ======================================================== +cc_library_static { + name: "libbt-stack", + defaults: ["fluoride_defaults"], + local_include_dirs: [ + "include", + "avct", + "btm", + "avrc", + "l2cap", + "avdt", + "gatt", + "gap", + "pan", + "bnep", + "hid", + "sdp", + "smp", + "srvc", + ], + include_dirs: [ + "external/libldac/inc", + "packages/modules/Bluetooth/system", + "packages/modules/Bluetooth/system/btcore/include", + "packages/modules/Bluetooth/system/vnd/include", + "packages/modules/Bluetooth/system/vnd/ble", + "packages/modules/Bluetooth/system/btif/include", + "packages/modules/Bluetooth/system/hci/include", + "packages/modules/Bluetooth/system/include", + "packages/modules/Bluetooth/system/udrv/include", + "packages/modules/Bluetooth/system/bta/include", + "packages/modules/Bluetooth/system/bta/sys", + "packages/modules/Bluetooth/system/utils/include", + ], + srcs: [ + "a2dp/a2dp_api.cc", + "a2dp/a2dp_codec_config.cc", + "a2dp/a2dp_sbc.cc", + "a2dp/a2dp_sbc_encoder.cc", + "a2dp/a2dp_sbc_up_sample.cc", + "a2dp/a2dp_vendor.cc", + "a2dp/a2dp_vendor_aptx.cc", + "a2dp/a2dp_vendor_aptx_hd.cc", + "a2dp/a2dp_vendor_aptx_encoder.cc", + "a2dp/a2dp_vendor_aptx_hd_encoder.cc", + "a2dp/a2dp_vendor_ldac.cc", + "a2dp/a2dp_vendor_ldac_encoder.cc", + "avct/avct_api.cc", + "avct/avct_bcb_act.cc", + "avct/avct_ccb.cc", + "avct/avct_l2c.cc", + "avct/avct_l2c_br.cc", + "avct/avct_lcb.cc", + "avct/avct_lcb_act.cc", + "avdt/avdt_ad.cc", + "avdt/avdt_api.cc", + "avdt/avdt_ccb.cc", + "avdt/avdt_ccb_act.cc", + "avdt/avdt_l2c.cc", + "avdt/avdt_msg.cc", + "avdt/avdt_scb.cc", + "avdt/avdt_scb_act.cc", + "avrc/avrc_api.cc", + "avrc/avrc_bld_ct.cc", + "avrc/avrc_bld_tg.cc", + "avrc/avrc_opt.cc", + "avrc/avrc_pars_ct.cc", + "avrc/avrc_pars_tg.cc", + "avrc/avrc_sdp.cc", + "avrc/avrc_utils.cc", + "bnep/bnep_api.cc", + "bnep/bnep_main.cc", + "bnep/bnep_utils.cc", + "btm/ble_advertiser_hci_interface.cc", + "btm/btm_acl.cc", + "btm/btm_ble.cc", + "btm/btm_ble_addr.cc", + "btm/btm_ble_adv_filter.cc", + "btm/btm_ble_batchscan.cc", + "btm/btm_ble_bgconn.cc", + "btm/btm_ble_cont_energy.cc", + "btm/btm_ble_gap.cc", + "btm/btm_ble_multi_adv.cc", + "btm/btm_ble_privacy.cc", + "btm/btm_dev.cc", + "btm/btm_devctl.cc", + "btm/btm_inq.cc", + "btm/btm_main.cc", + "btm/btm_pm.cc", + "btm/btm_sco.cc", + "btm/btm_sec.cc", + "btu/btu_hcif.cc", + "btu/btu_init.cc", + "btu/btu_task.cc", + "gap/gap_api.cc", + "gap/gap_ble.cc", + "gap/gap_conn.cc", + "gap/gap_utils.cc", + "gatt/att_protocol.cc", + "gatt/gatt_api.cc", + "gatt/gatt_attr.cc", + "gatt/gatt_auth.cc", + "gatt/gatt_cl.cc", + "gatt/gatt_db.cc", + "gatt/gatt_main.cc", + "gatt/gatt_sr.cc", + "gatt/gatt_utils.cc", + "hcic/hciblecmds.cc", + "hcic/hcicmds.cc", + "hid/hidh_api.cc", + "hid/hidh_conn.cc", + "hid/hidd_api.cc", + "hid/hidd_conn.cc", + "l2cap/l2c_api.cc", + "l2cap/l2c_ble.cc", + "l2cap/l2c_csm.cc", + "l2cap/l2c_fcr.cc", + "l2cap/l2c_link.cc", + "l2cap/l2c_main.cc", + "l2cap/l2c_ucd.cc", + "l2cap/l2c_utils.cc", + "l2cap/l2cap_client.cc", + "mcap/mca_api.cc", + "mcap/mca_cact.cc", + "mcap/mca_csm.cc", + "mcap/mca_dact.cc", + "mcap/mca_dsm.cc", + "mcap/mca_l2c.cc", + "mcap/mca_main.cc", + "pan/pan_api.cc", + "pan/pan_main.cc", + "pan/pan_utils.cc", + "rfcomm/port_api.cc", + "rfcomm/port_rfc.cc", + "rfcomm/port_utils.cc", + "rfcomm/rfc_l2cap_if.cc", + "rfcomm/rfc_mx_fsm.cc", + "rfcomm/rfc_port_fsm.cc", + "rfcomm/rfc_port_if.cc", + "rfcomm/rfc_ts_frames.cc", + "rfcomm/rfc_utils.cc", + "sdp/sdp_api.cc", + "sdp/sdp_db.cc", + "sdp/sdp_discovery.cc", + "sdp/sdp_main.cc", + "sdp/sdp_server.cc", + "sdp/sdp_utils.cc", + "smp/aes.cc", + "smp/p_256_curvepara.cc", + "smp/p_256_ecc_pp.cc", + "smp/p_256_multprecision.cc", + "smp/smp_act.cc", + "smp/smp_api.cc", + "smp/smp_br_main.cc", + "smp/smp_cmac.cc", + "smp/smp_keys.cc", + "smp/smp_l2c.cc", + "smp/smp_main.cc", + "smp/smp_utils.cc", + "srvc/srvc_battery.cc", + "srvc/srvc_dis.cc", + "srvc/srvc_eng.cc", + ], + static_libs: ["libbt-hci"], + shared_libs: [ + "libcutils", + "liblog", + ], + required: [ + "libldacBT_enc", + ] +} + +// Bluetooth stack unit tests for target +// ======================================================== +cc_test { + name: "net_test_stack", + defaults: ["fluoride_defaults"], + local_include_dirs: [ + "include", + ], + include_dirs: [ + "packages/modules/Bluetooth/system", + "packages/modules/Bluetooth/system/include", + ], + srcs: ["test/stack_a2dp_test.cc"], + shared_libs: [ + "liblog", + ], + static_libs: [ + "libbt-stack", + "libbt-sbc-encoder", + "libosi", + ], +} + +// Bluetooth stack smp unit tests for target +// ======================================================== +cc_test { + name: "net_test_stack_smp", + defaults: ["fluoride_defaults"], + local_include_dirs: [ + "include", + "btm", + "l2cap", + "smp", + ], + include_dirs: [ + "packages/modules/Bluetooth/system", + "packages/modules/Bluetooth/system/include", + "packages/modules/Bluetooth/system/btcore/include", + "packages/modules/Bluetooth/system/hci/include", + "packages/modules/Bluetooth/system/utils/include", + ], + srcs: [ + "smp/smp_keys.cc", + "smp/aes.cc", + "smp/smp_api.cc", + "smp/smp_main.cc", + "smp/smp_utils.cc", + "test/stack_smp_test.cc", + ], + shared_libs: [ + "libcutils", + ], + static_libs: [ + "liblog", + "libgmock", + "libosi", + ], +} + + +// Bluetooth stack multi-advertising unit tests for target +// ======================================================== +cc_test { + name: "net_test_stack_multi_adv", + defaults: ["fluoride_defaults"], + local_include_dirs: [ + "include", + "btm", + ], + include_dirs: [ + "packages/modules/Bluetooth/system", + "packages/modules/Bluetooth/system/include", + "packages/modules/Bluetooth/system/btcore/include", + "packages/modules/Bluetooth/system/hci/include", + "packages/modules/Bluetooth/system/include", + "packages/modules/Bluetooth/system/utils/include", + ], + srcs: [ + "btm/btm_ble_multi_adv.cc", + "test/ble_advertiser_test.cc", + ], + shared_libs: [ + "libcutils", + ], + static_libs: [ + "liblog", + "libgmock", + ], +} diff --git a/system/stack/Android.mk b/system/stack/Android.mk deleted file mode 100644 index 71bd5af02eeb4d8bd593a45248fe153c9e0001e4..0000000000000000000000000000000000000000 --- a/system/stack/Android.mk +++ /dev/null @@ -1,264 +0,0 @@ -LOCAL_PATH:= $(call my-dir) - -# Bluetooth stack static library for target -# ======================================================== -include $(CLEAR_VARS) -LOCAL_CPP_EXTENSION := .cc -LOCAL_C_INCLUDES := \ - external/libldac/inc \ - $(LOCAL_PATH)/include \ - $(LOCAL_PATH)/avct \ - $(LOCAL_PATH)/btm \ - $(LOCAL_PATH)/avrc \ - $(LOCAL_PATH)/l2cap \ - $(LOCAL_PATH)/avdt \ - $(LOCAL_PATH)/gatt \ - $(LOCAL_PATH)/gap \ - $(LOCAL_PATH)/pan \ - $(LOCAL_PATH)/bnep \ - $(LOCAL_PATH)/hid \ - $(LOCAL_PATH)/sdp \ - $(LOCAL_PATH)/smp \ - $(LOCAL_PATH)/srvc \ - $(LOCAL_PATH)/../btcore/include \ - $(LOCAL_PATH)/../vnd/include \ - $(LOCAL_PATH)/../vnd/ble \ - $(LOCAL_PATH)/../btif/include \ - $(LOCAL_PATH)/../hci/include \ - $(LOCAL_PATH)/../include \ - $(LOCAL_PATH)/../udrv/include \ - $(LOCAL_PATH)/../bta/include \ - $(LOCAL_PATH)/../bta/sys \ - $(LOCAL_PATH)/../utils/include \ - $(LOCAL_PATH)/../ \ - $(bluetooth_C_INCLUDES) - -LOCAL_SRC_FILES := \ - ./a2dp/a2dp_api.cc \ - ./a2dp/a2dp_codec_config.cc \ - ./a2dp/a2dp_sbc.cc \ - ./a2dp/a2dp_sbc_encoder.cc \ - ./a2dp/a2dp_sbc_up_sample.cc \ - ./a2dp/a2dp_vendor.cc \ - ./a2dp/a2dp_vendor_aptx.cc \ - ./a2dp/a2dp_vendor_aptx_hd.cc \ - ./a2dp/a2dp_vendor_aptx_encoder.cc \ - ./a2dp/a2dp_vendor_aptx_hd_encoder.cc \ - ./a2dp/a2dp_vendor_ldac.cc \ - ./a2dp/a2dp_vendor_ldac_encoder.cc \ - ./avct/avct_api.cc \ - ./avct/avct_bcb_act.cc \ - ./avct/avct_ccb.cc \ - ./avct/avct_l2c.cc \ - ./avct/avct_l2c_br.cc \ - ./avct/avct_lcb.cc \ - ./avct/avct_lcb_act.cc \ - ./avdt/avdt_ad.cc \ - ./avdt/avdt_api.cc \ - ./avdt/avdt_ccb.cc \ - ./avdt/avdt_ccb_act.cc \ - ./avdt/avdt_l2c.cc \ - ./avdt/avdt_msg.cc \ - ./avdt/avdt_scb.cc \ - ./avdt/avdt_scb_act.cc \ - ./avrc/avrc_api.cc \ - ./avrc/avrc_bld_ct.cc \ - ./avrc/avrc_bld_tg.cc \ - ./avrc/avrc_opt.cc \ - ./avrc/avrc_pars_ct.cc \ - ./avrc/avrc_pars_tg.cc \ - ./avrc/avrc_sdp.cc \ - ./avrc/avrc_utils.cc \ - ./bnep/bnep_api.cc \ - ./bnep/bnep_main.cc \ - ./bnep/bnep_utils.cc \ - ./btm/ble_advertiser_hci_interface.cc \ - ./btm/btm_acl.cc \ - ./btm/btm_ble.cc \ - ./btm/btm_ble_addr.cc \ - ./btm/btm_ble_adv_filter.cc \ - ./btm/btm_ble_batchscan.cc \ - ./btm/btm_ble_bgconn.cc \ - ./btm/btm_ble_cont_energy.cc \ - ./btm/btm_ble_gap.cc \ - ./btm/btm_ble_multi_adv.cc \ - ./btm/btm_ble_privacy.cc \ - ./btm/btm_dev.cc \ - ./btm/btm_devctl.cc \ - ./btm/btm_inq.cc \ - ./btm/btm_main.cc \ - ./btm/btm_pm.cc \ - ./btm/btm_sco.cc \ - ./btm/btm_sec.cc \ - ./btu/btu_hcif.cc \ - ./btu/btu_init.cc \ - ./btu/btu_task.cc \ - ./gap/gap_api.cc \ - ./gap/gap_ble.cc \ - ./gap/gap_conn.cc \ - ./gap/gap_utils.cc \ - ./gatt/att_protocol.cc \ - ./gatt/gatt_api.cc \ - ./gatt/gatt_attr.cc \ - ./gatt/gatt_auth.cc \ - ./gatt/gatt_cl.cc \ - ./gatt/gatt_db.cc \ - ./gatt/gatt_main.cc \ - ./gatt/gatt_sr.cc \ - ./gatt/gatt_utils.cc \ - ./hcic/hciblecmds.cc \ - ./hcic/hcicmds.cc \ - ./hid/hidh_api.cc \ - ./hid/hidh_conn.cc \ - ./hid/hidd_api.cc \ - ./hid/hidd_conn.cc \ - ./l2cap/l2c_api.cc \ - ./l2cap/l2c_ble.cc \ - ./l2cap/l2c_csm.cc \ - ./l2cap/l2c_fcr.cc \ - ./l2cap/l2c_link.cc \ - ./l2cap/l2c_main.cc \ - ./l2cap/l2c_ucd.cc \ - ./l2cap/l2c_utils.cc \ - ./l2cap/l2cap_client.cc \ - ./mcap/mca_api.cc \ - ./mcap/mca_cact.cc \ - ./mcap/mca_csm.cc \ - ./mcap/mca_dact.cc \ - ./mcap/mca_dsm.cc \ - ./mcap/mca_l2c.cc \ - ./mcap/mca_main.cc \ - ./pan/pan_api.cc \ - ./pan/pan_main.cc \ - ./pan/pan_utils.cc \ - ./rfcomm/port_api.cc \ - ./rfcomm/port_rfc.cc \ - ./rfcomm/port_utils.cc \ - ./rfcomm/rfc_l2cap_if.cc \ - ./rfcomm/rfc_mx_fsm.cc \ - ./rfcomm/rfc_port_fsm.cc \ - ./rfcomm/rfc_port_if.cc \ - ./rfcomm/rfc_ts_frames.cc \ - ./rfcomm/rfc_utils.cc \ - ./sdp/sdp_api.cc \ - ./sdp/sdp_db.cc \ - ./sdp/sdp_discovery.cc \ - ./sdp/sdp_main.cc \ - ./sdp/sdp_server.cc \ - ./sdp/sdp_utils.cc \ - ./smp/aes.cc \ - ./smp/p_256_curvepara.cc \ - ./smp/p_256_ecc_pp.cc \ - ./smp/p_256_multprecision.cc \ - ./smp/smp_act.cc \ - ./smp/smp_api.cc \ - ./smp/smp_br_main.cc \ - ./smp/smp_cmac.cc \ - ./smp/smp_keys.cc \ - ./smp/smp_l2c.cc \ - ./smp/smp_main.cc \ - ./smp/smp_utils.cc \ - ./srvc/srvc_battery.cc \ - ./srvc/srvc_dis.cc \ - ./srvc/srvc_eng.cc - -LOCAL_MODULE := libbt-stack -LOCAL_STATIC_LIBRARIES := libbt-hci -LOCAL_SHARED_LIBRARIES := libcutils liblog libchrome -LOCAL_REQUIRED_MODULES := libldacBT_enc - -LOCAL_CFLAGS += $(bluetooth_CFLAGS) -LOCAL_CONLYFLAGS += $(bluetooth_CONLYFLAGS) -LOCAL_CPPFLAGS += $(bluetooth_CPPFLAGS) - -include $(BUILD_STATIC_LIBRARY) - -# Bluetooth stack unit tests for target -# ======================================================== -include $(CLEAR_VARS) - -LOCAL_CPP_EXTENSION := .cc - -LOCAL_C_INCLUDES := \ - $(LOCAL_PATH)/include \ - $(LOCAL_PATH)/../include \ - $(LOCAL_PATH)/../ \ - $(bluetooth_C_INCLUDES) - -LOCAL_SRC_FILES := test/stack_a2dp_test.cc -LOCAL_SHARED_LIBRARIES := libc liblog libchrome -LOCAL_STATIC_LIBRARIES := libbt-stack libbt-sbc-encoder libosi -LOCAL_MODULE_TAGS := tests -LOCAL_MODULE := net_test_stack - -LOCAL_CFLAGS += $(bluetooth_CFLAGS) -LOCAL_CONLYFLAGS += $(bluetooth_CONLYFLAGS) -LOCAL_CPPFLAGS += $(bluetooth_CPPFLAGS) - -include $(BUILD_NATIVE_TEST) - -# Bluetooth smp unit tests for target -# ======================================================== -include $(CLEAR_VARS) - -LOCAL_CPP_EXTENSION := .cc - -LOCAL_C_INCLUDES := \ - $(LOCAL_PATH)/include \ - $(LOCAL_PATH)/btm \ - $(LOCAL_PATH)/l2cap \ - $(LOCAL_PATH)/smp \ - $(LOCAL_PATH)/../btcore/include \ - $(LOCAL_PATH)/../hci/include \ - $(LOCAL_PATH)/../include \ - $(LOCAL_PATH)/../utils/include \ - $(LOCAL_PATH)/../ \ - $(bluetooth_C_INCLUDES) - -LOCAL_SRC_FILES := smp/smp_keys.cc \ - smp/aes.cc \ - smp/smp_api.cc \ - smp/smp_main.cc \ - smp/smp_utils.cc \ - test/stack_smp_test.cc -LOCAL_SHARED_LIBRARIES := libcutils libchrome -LOCAL_STATIC_LIBRARIES := liblog libgtest libgmock libosi -LOCAL_MODULE_TAGS := tests -LOCAL_MODULE := net_test_stack_smp - -LOCAL_CFLAGS += $(bluetooth_CFLAGS) -LOCAL_CONLYFLAGS += $(bluetooth_CONLYFLAGS) -LOCAL_CPPFLAGS += $(bluetooth_CPPFLAGS) - -include $(BUILD_NATIVE_TEST) - -# Bluetooth stack multi-advertising unit tests for target -# ======================================================== -include $(CLEAR_VARS) - -LOCAL_CPP_EXTENSION := .cc - -LOCAL_C_INCLUDES := \ - $(LOCAL_PATH)/include \ - $(LOCAL_PATH)/../include \ - $(LOCAL_PATH)/../ \ - $(LOCAL_PATH)/btm \ - $(LOCAL_PATH)/../btcore/include \ - $(LOCAL_PATH)/../hci/include \ - $(LOCAL_PATH)/../include \ - $(LOCAL_PATH)/../utils/include \ - $(LOCAL_PATH)/../ \ - $(bluetooth_C_INCLUDES) - -LOCAL_SRC_FILES := btm/btm_ble_multi_adv.cc \ - test/ble_advertiser_test.cc -LOCAL_SHARED_LIBRARIES := libcutils libchrome -LOCAL_STATIC_LIBRARIES := liblog libgmock libgtest -LOCAL_MODULE_TAGS := tests -LOCAL_MODULE := net_test_stack_multi_adv - -LOCAL_CFLAGS += $(bluetooth_CFLAGS) -LOCAL_CONLYFLAGS += $(bluetooth_CONLYFLAGS) -LOCAL_CPPFLAGS += $(bluetooth_CPPFLAGS) - -include $(BUILD_NATIVE_TEST) diff --git a/system/test/Android.bp b/system/test/Android.bp new file mode 100644 index 0000000000000000000000000000000000000000..c873d78e57760799fb4b5d016ccc6ae20112d8e4 --- /dev/null +++ b/system/test/Android.bp @@ -0,0 +1,3 @@ +subdirs = [ + "suite", +] diff --git a/system/test/Android.mk b/system/test/Android.mk deleted file mode 100644 index 5053e7d64389d3eaa35c6e807277fff9f83898f6..0000000000000000000000000000000000000000 --- a/system/test/Android.mk +++ /dev/null @@ -1 +0,0 @@ -include $(call all-subdir-makefiles) diff --git a/system/test/suite/Android.bp b/system/test/suite/Android.bp new file mode 100644 index 0000000000000000000000000000000000000000..12cbdede767a7e8cb5339ef7f86209616a80b7b5 --- /dev/null +++ b/system/test/suite/Android.bp @@ -0,0 +1,50 @@ +// Bluetooth test suite for target +// ======================================================== +cc_test { + name: "net_test_bluetooth", + defaults: ["fluoride_defaults"], + include_dirs: ["packages/modules/Bluetooth/system"], + srcs: [ + "adapter/adapter_unittest.cc", + "adapter/bluetooth_test.cc", + "gatt/gatt_test.cc", + "gatt/gatt_unittest.cc", + ], + shared_libs: [ + "liblog", + "libhardware", + "libcutils", + ], + static_libs: [ + "libbtcore", + "libosi", + ], + whole_static_libs: [ + "libbluetoothtbd_hal", + ], +} + +// Bluetooth test suite for target +// ======================================================== +cc_test { + name: "net_test_rfcomm", + defaults: ["fluoride_defaults"], + include_dirs: ["packages/modules/Bluetooth/system"], + srcs: [ + "adapter/bluetooth_test.cc", + "rfcomm/rfcomm_test.cc", + "rfcomm/rfcomm_unittest.cc", + ], + shared_libs: [ + "liblog", + "libhardware", + "libcutils", + ], + static_libs: [ + "libbtcore", + "libosi", + ], + whole_static_libs: [ + "libbluetoothtbd_hal", + ], +} diff --git a/system/test/suite/Android.mk b/system/test/suite/Android.mk deleted file mode 100644 index bfd30c6f1e7261bf3b8a5381bda04d22754960d3..0000000000000000000000000000000000000000 --- a/system/test/suite/Android.mk +++ /dev/null @@ -1,93 +0,0 @@ -# -# Copyright (C) 2015 Google, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at: -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -LOCAL_PATH := $(call my-dir) - -# These tests use the bluetoothtbd HAL wrappers in order to easily interact -# with the interface using C++ -# TODO: Make the bluetoothtbd HAL a static library -bluetoothHalSrc := \ - ../../service/hal/bluetooth_gatt_interface.cc \ - ../../service/hal/bluetooth_interface.cc \ - ../../service/logging_helpers.cc - -# Bluetooth test suite for target -# ======================================================== -include $(CLEAR_VARS) -LOCAL_CPP_EXTENSION := .cc -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE := net_test_bluetooth - -LOCAL_C_INCLUDES := \ - $(LOCAL_PATH)/../../ - -LOCAL_SRC_FILES := \ - adapter/adapter_unittest.cc \ - adapter/bluetooth_test.cc \ - gatt/gatt_test.cc \ - gatt/gatt_unittest.cc \ - $(bluetoothHalSrc) - -LOCAL_SHARED_LIBRARIES := \ - liblog \ - libhardware \ - libhardware_legacy \ - libcutils \ - libchrome - -LOCAL_STATIC_LIBRARIES := \ - libbtcore \ - libosi - -LOCAL_CFLAGS += $(bluetooth_CFLAGS) -LOCAL_CONLYFLAGS += $(bluetooth_CONLYFLAGS) -LOCAL_CPPFLAGS += $(bluetooth_CPPFLAGS) - -include $(BUILD_NATIVE_TEST) - -# Bluetooth test suite for target -# ======================================================== -include $(CLEAR_VARS) -LOCAL_CPP_EXTENSION := .cc -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE := net_test_rfcomm - -LOCAL_C_INCLUDES := \ - $(LOCAL_PATH)/../../ \ - $(bluetooth_C_INCLUDES) \ - -LOCAL_SRC_FILES := \ - adapter/bluetooth_test.cc \ - rfcomm/rfcomm_test.cc \ - rfcomm/rfcomm_unittest.cc \ - $(bluetoothHalSrc) - -LOCAL_SHARED_LIBRARIES := \ - liblog \ - libhardware \ - libhardware_legacy \ - libcutils \ - libchrome \ - -LOCAL_STATIC_LIBRARIES := \ - libbtcore \ - libosi \ - -LOCAL_CFLAGS += $(bluetooth_CFLAGS) -LOCAL_CONLYFLAGS += $(bluetooth_CONLYFLAGS) -LOCAL_CPPFLAGS += $(bluetooth_CPPFLAGS) - -include $(BUILD_NATIVE_TEST) diff --git a/system/udrv/Android.bp b/system/udrv/Android.bp new file mode 100644 index 0000000000000000000000000000000000000000..a3647b1e527edd277fc51d1640e8831aba11b0f6 --- /dev/null +++ b/system/udrv/Android.bp @@ -0,0 +1,20 @@ +cc_library_static { + name: "libudrv-uipc", + defaults: ["fluoride_defaults"], + srcs: [ + "ulinux/uipc.cc", + ], + include_dirs: [ + "packages/modules/Bluetooth/system", + "packages/modules/Bluetooth/system/include", + "packages/modules/Bluetooth/system/audio_a2dp_hw", + "packages/modules/Bluetooth/system/utils/include", + "packages/modules/Bluetooth/system/stack/include", + ], + local_include_dirs: [ + "include", + ], + shared_libs: [ + "liblog", + ], +} diff --git a/system/utils/Android.bp b/system/utils/Android.bp new file mode 100644 index 0000000000000000000000000000000000000000..bb7761338c867a4022045d6c98abd3e7e576b0df --- /dev/null +++ b/system/utils/Android.bp @@ -0,0 +1,15 @@ +// Utils static library for target +// ======================================================== +cc_library_static { + name: "libbt-utils", + defaults: ["fluoride_defaults"], + local_include_dirs: [ + "include", + ], + include_dirs: [ + "packages/modules/Bluetooth/system", + "packages/modules/Bluetooth/system/btcore/include", + "packages/modules/Bluetooth/system/stack/include", + ], + srcs: ["src/bt_utils.cc"], +} diff --git a/system/utils/Android.mk b/system/utils/Android.mk deleted file mode 100644 index 5ba3e884fcb07a90d6b4b7a78c13a9df241264c1..0000000000000000000000000000000000000000 --- a/system/utils/Android.mk +++ /dev/null @@ -1,27 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -# Utils static library for target -# ======================================================== -include $(CLEAR_VARS) - -LOCAL_CPP_EXTENSION := .cc - -LOCAL_C_INCLUDES := \ - $(LOCAL_PATH)/include \ - $(LOCAL_PATH)/../btcore/include \ - $(LOCAL_PATH)/../stack/include \ - $(LOCAL_PATH)/../ \ - $(bluetooth_C_INCLUDES) - -LOCAL_SRC_FILES := \ - ./src/bt_utils.cc - -LOCAL_MODULE := libbt-utils -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_CLASS := STATIC_LIBRARIES - -LOCAL_CFLAGS += $(bluetooth_CFLAGS) -LOCAL_CONLYFLAGS += $(bluetooth_CONLYFLAGS) -LOCAL_CPPFLAGS += $(bluetooth_CPPFLAGS) - -include $(BUILD_STATIC_LIBRARY) diff --git a/system/vendor_libs/Android.bp b/system/vendor_libs/Android.bp new file mode 100644 index 0000000000000000000000000000000000000000..07dde0f1ec5abe85c89ee754c00c211564ebdcfd --- /dev/null +++ b/system/vendor_libs/Android.bp @@ -0,0 +1,3 @@ +subdirs = [ + "test_vendor_lib", +] diff --git a/system/vendor_libs/Android.mk b/system/vendor_libs/Android.mk index 5053e7d64389d3eaa35c6e807277fff9f83898f6..31d6e6bb4105c278a1664c0c74ec9cd587ffd7b8 100644 --- a/system/vendor_libs/Android.mk +++ b/system/vendor_libs/Android.mk @@ -1 +1,28 @@ +# Common C/C++ compiler flags for test-vendor lib +# +# -Wno-gnu-variable-sized-type-not-at-end is needed, because struct BT_HDR +# is defined as a variable-size header in a struct. +# -Wno-typedef-redefinition is needed because of the way the struct typedef +# is done in osi/include header files. This issue can be obsoleted by +# switching to C11 or C++. +# -Wno-unused-parameter is needed, because there are too many unused +# parameters in all the code. +# +test-vendor_CFLAGS += \ + -fvisibility=hidden \ + -Wall \ + -Wextra \ + -Werror \ + -Wno-gnu-variable-sized-type-not-at-end \ + -Wno-typedef-redefinition \ + -Wno-unused-parameter \ + -DLOG_NDEBUG=1 \ + -DEXPORT_SYMBOL="__attribute__((visibility(\"default\")))" + +test-vendor_CONLYFLAGS += -std=c99 + include $(call all-subdir-makefiles) + +# Cleanup our locals +test-vendor_CFLAGS := +test-vendor_CONLYFLAGS := diff --git a/system/vendor_libs/linux/Android.mk b/system/vendor_libs/linux/Android.mk index 3cdaabc7cefa4f8450f63e029bb7902ef58cc8b6..818060f1a55bac767b32384823ad2d857157a015 100644 --- a/system/vendor_libs/linux/Android.mk +++ b/system/vendor_libs/linux/Android.mk @@ -38,9 +38,8 @@ LOCAL_STATIC_LIBRARIES := libosi LOCAL_MODULE := libbt-vendor LOCAL_MODULE_TAGS := optional -LOCAL_CFLAGS += $(bluetooth_CFLAGS) -LOCAL_CONLYFLAGS += $(bluetooth_CONLYFLAGS) -LOCAL_CPPFLAGS += $(bluetooth_CPPFLAGS) +LOCAL_CFLAGS += $(test-vendor_CFLAGS) +LOCAL_CONLYFLAGS += $(test-vendor_CONLYFLAGS) include $(BUILD_SHARED_LIBRARY) diff --git a/system/vendor_libs/test_vendor_lib/Android.bp b/system/vendor_libs/test_vendor_lib/Android.bp new file mode 100644 index 0000000000000000000000000000000000000000..cb11f53ef91052baa6213eef874ce022a6d9c3e4 --- /dev/null +++ b/system/vendor_libs/test_vendor_lib/Android.bp @@ -0,0 +1,43 @@ +// test-vendor unit tests for host +// ======================================================== +cc_test_host { + name: "test-vendor_test_host", + srcs: [ + "src/async_manager.cc", + "src/bt_address.cc", + "src/command_packet.cc", + "src/event_packet.cc", + "src/hci_transport.cc", + "src/packet.cc", + "src/packet_stream.cc", + "test/async_manager_unittest.cc", + "test/bt_address_unittest.cc", + "test/hci_transport_unittest.cc", + "test/packet_stream_unittest.cc", + ], + local_include_dirs: [ + "include", + ], + include_dirs: [ + "packages/modules/Bluetooth/system", + "packages/modules/Bluetooth/system/utils/include", + "packages/modules/Bluetooth/system/hci/include", + "packages/modules/Bluetooth/system/stack/include", + ], + shared_libs: [ + "liblog", + "libchrome", + ], + cflags: [ + "-fvisibility=hidden", + "-Wall", + "-Wextra", + "-Werror", + "-DLOG_NDEBUG=1", + ], + target: { + darwin: { + enabled: false, + } + }, +} diff --git a/system/vendor_libs/test_vendor_lib/Android.mk b/system/vendor_libs/test_vendor_lib/Android.mk index e6efcdfc6ef2a0eff1d9631c18182953d570495c..7e2f9711610fd37825cbe737b8f0ef858b315ba0 100644 --- a/system/vendor_libs/test_vendor_lib/Android.mk +++ b/system/vendor_libs/test_vendor_lib/Android.mk @@ -55,58 +55,6 @@ endif LOCAL_MODULE_TAGS := optional LOCAL_MODULE_CLASS := SHARED_LIBRARIES -LOCAL_CFLAGS += \ - -fvisibility=hidden \ - -Wall \ - -Wextra \ - -Werror \ - -UNDEBUG \ - -DLOG_NDEBUG=1 - -LOCAL_CFLAGS += -DEXPORT_SYMBOL="__attribute__((visibility(\"default\")))" +LOCAL_CFLAGS += $(test-vendor_CFLAGS) include $(BUILD_SHARED_LIBRARY) - -# test-vendor unit tests for host -# ======================================================== -ifeq ($(HOST_OS), linux) -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := \ - src/async_manager.cc \ - src/bt_address.cc \ - src/command_packet.cc \ - src/event_packet.cc \ - src/hci_transport.cc \ - src/packet.cc \ - src/packet_stream.cc \ - test/async_manager_unittest.cc \ - test/bt_address_unittest.cc \ - test/hci_transport_unittest.cc \ - test/packet_stream_unittest.cc - -LOCAL_C_INCLUDES := \ - $(LOCAL_PATH)/include \ - $(BT_DIR) \ - $(BT_DIR)/utils/include \ - $(BT_DIR)/hci/include \ - $(BT_DIR)/stack/include - -LOCAL_SHARED_LIBRARIES := \ - liblog \ - libchrome - -LOCAL_CPP_EXTENSION := .cc -LOCAL_MODULE := test-vendor_test_host -LOCAL_MODULE_TAGS := tests - -LOCAL_CFLAGS += \ - -fvisibility=hidden \ - -Wall \ - -Wextra \ - -Werror \ - -UNDEBUG \ - -DLOG_NDEBUG=1 - -include $(BUILD_HOST_NATIVE_TEST) -endif