Skip to content

Commit

Permalink
Get rid of libhardware dependency in native daemon
Browse files Browse the repository at this point in the history
Test: compilation test
Bug: 66187274
Change-Id: I97ee33a55315f44dc03083d1a8da9a38d5619725

Fix net_test_bluetooth

Test: net_test_bluetooth
Change-Id: I8c84f0db3ce0e4f6efbd6d7d3cdc794be8fb7faa

Fix net_test_bluetooth

* net_test_bluetooth should try to load Bluetooth library from
  system/lib/hw or system/lib64/hw if it cannot find it from default
  path
* Also replaced legacy logging macro with libbase logging statements

Bug: 67059247
Test: net_test_bluetooth
Change-Id: I6c45f66aedf675397f377ca56203bec9708324e1

Remove hw_module_t dependency in Bluetooth (1/3)

Bug: 67853426
Test: run Bluetooth
Merged-In: Ia3808552137d1f770f2c0305aaa01181f383d064
Change-Id: Ia3808552137d1f770f2c0305aaa01181f383d064

test_vendor: Add base implementation

test_vendor: Add Device and Beacon classes
Device contains properties to be modeled.  Beacon
is a simple class that inherits from Device.

test_vendor: Add a Device factory
The device factory calls the constructors and initializes
the devices.  The controller uses the factory to instantiate
devices.

test_vendor: Add a Keyboard class
Add a connectable LE device.

test_vendor: Add BrokenAdv device
Generate random broken advertisements.

test_vendor: Add scanning and connections
Add a connection class to handle data transfer.
Add scanning and connections in the controller.

Test: Compiles
Change-Id: Id9f64308447c9de4e83a2a4fa9f59c30bede75ab

Loosen libhardware dependency

In most places we don't really need the libhardware library, just the
headers.

Bug: 66187274
Test: compilation test
Change-Id: Ifa2f547165fcf8b34bc29ab80d2bd12ce02f4ae1

Move include->internal_include (1/2)

Change-Id: If351c7d51a380c33ec9bae3b3f240ed53639f3c9

Remove hw_module_t dependency in Bluetooth - cleanup

Bug: 67853426
Test: run Bluetooth

Move Bluetooth headers to system/bt (1/3)

Bug: 67853426
Test: run Bluetooth
Change-Id: I75748d29a35d10d377d39e0441116dbfd04c82e9

hw/bluetooth.default.so -> libbluetooth.so (1/2)

Also rename the build goal for both the library and headers.

Bug: 67853426
Test: run Bluetooth
Merged-In: Iaffeebc1d3f2761e13f6d66d4e855dc342603054
Change-Id: Iaffeebc1d3f2761e13f6d66d4e855dc342603054
(cherry picked from commit 842ff8ed7f5b00d5f6da9d975f37e65c41bb8ebc)

Linux: bluetooth.default.so -> libbluetooth.so

Also rename the build goal for both the library.

Bug: 67853426
Test: run Bluetooth
Change-Id: Ic5bd27f10ade0b068057049dd98c09e082cafee1

Conflicts:
	main/BUILD.gn

Use one type for UUID (1/5)

Currently, we have few different representations for UUID in stack:
tBT_UUID, tSDP_UUID, bt_uuid_t, bluetooth:UUID, or uint8_t*.

Additionally, tBT_UUID and bt_uuid_t are used to hold UUID as 128bit
as Little Endian or Big Endian, depending on which part of stack (GATT
or SDP) is using it.

This patch is creating one type, bluetooth::Uuid, that will replace all
other types.

Bug: 66912853
Test: all sl4a tests for GATT and RFCOMM
Merged-In: Ia42d3233146db0488728ed6f878f99b368fe8838
Change-Id: Ia42d3233146db0488728ed6f878f99b368fe8838

CRs-Fixed: 2191285
  • Loading branch information
Gurpreet Ghai committed Feb 16, 2018
1 parent e2cabd5 commit c4a6c8d
Show file tree
Hide file tree
Showing 248 changed files with 8,463 additions and 4,046 deletions.
1 change: 1 addition & 0 deletions Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ subdirs = [
"osi",
"embdrv",
"service",
"include",
"main",
"bta",
"vendor_libs",
Expand Down
2 changes: 1 addition & 1 deletion BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# This pulls in main/BUILD.gn and all of its dependencies.
group("bluetooth") {
deps = [
"//main:bluetooth.default",
"//main:bluetooth",
"//service:bluetoothtbd",
]
}
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ git clone https://android.googlesource.com/platform/external/libchrome
git clone https://android.googlesource.com/platform/external/libldac
git clone https://android.googlesource.com/platform/external/modp_b64
git clone https://android.googlesource.com/platform/external/tinyxml2
git clone https://android.googlesource.com/platform/hardware/libhardware
```

And third party dependencies of third party dependencies:
Expand All @@ -60,7 +59,6 @@ ln -s ../../../external/libchrome libchrome
ln -s ../../../external/libldac libldac
ln -s ../../../external/modp_b64 modp_b64
ln -s ../../../external/tinyxml2 tinyxml2
ln -s ../../../hardware/libhardware libhardware
ln -s ../../../external/googletest googletest
```

Expand Down
1 change: 1 addition & 0 deletions audio_a2dp_hw/Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ cc_defaults {
defaults: ["fluoride_defaults"],
include_dirs: [
"system/bt",
"system/bt/include",
"system/bt/audio_a2dp_hw/include",
]
}
Expand Down
4 changes: 2 additions & 2 deletions bta/Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ cc_defaults {
"system/bt/bta/include",
"system/bt/btcore/include",
"system/bt/hci/include",
"system/bt/include",
"system/bt/internal_include",
"system/bt/stack/include",
"system/bt/stack/btm",
"system/bt/udrv/include",
Expand All @@ -25,6 +25,7 @@ cc_defaults {
shared_libs: [
"libcutils",
],
header_libs: ["libbluetooth_headers"],
cflags: ["-DBUILDCFG"],
}

Expand Down Expand Up @@ -121,7 +122,6 @@ cc_test {
"test/bta_hf_client_test.cc",
],
shared_libs: [
"libhardware",
"liblog",
"libprotobuf-cpp-lite",
],
Expand Down
12 changes: 6 additions & 6 deletions bta/ag/bta_ag_sdp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
#include "device/include/interop_config.h"
#include "bt_utils.h"

using bluetooth::Uuid;

/* Number of protocol elements in protocol element list. */
#define BTA_AG_NUM_PROTO_ELEMS 2

Expand Down Expand Up @@ -381,7 +383,7 @@ bool bta_ag_sdp_find_attr(tBTA_AG_SCB* p_scb, tBTA_SERVICE_MASK service) {
*
******************************************************************************/
void bta_ag_do_disc(tBTA_AG_SCB* p_scb, tBTA_SERVICE_MASK service) {
tSDP_UUID uuid_list[2];
Uuid uuid_list[2];
uint16_t num_uuid = 1;
uint16_t attr_list[4];
uint8_t num_attr;
Expand All @@ -394,15 +396,15 @@ void bta_ag_do_disc(tBTA_AG_SCB* p_scb, tBTA_SERVICE_MASK service) {
attr_list[2] = ATTR_ID_BT_PROFILE_DESC_LIST;
attr_list[3] = ATTR_ID_SUPPORTED_FEATURES;
num_attr = 4;
uuid_list[0].uu.uuid16 = UUID_SERVCLASS_HF_HANDSFREE;
uuid_list[0] = Uuid::From16Bit(UUID_SERVCLASS_HF_HANDSFREE);
}
/* HFP acceptor; get features */
else if (service & BTA_HFP_SERVICE_MASK && p_scb->role == BTA_AG_ACP) {
attr_list[0] = ATTR_ID_SERVICE_CLASS_ID_LIST;
attr_list[1] = ATTR_ID_BT_PROFILE_DESC_LIST;
attr_list[2] = ATTR_ID_SUPPORTED_FEATURES;
num_attr = 3;
uuid_list[0].uu.uuid16 = UUID_SERVCLASS_HF_HANDSFREE;
uuid_list[0] = Uuid::From16Bit(UUID_SERVCLASS_HF_HANDSFREE);
}
/* HSP initiator; get proto list */
else if (service & BTA_HSP_SERVICE_MASK && p_scb->role == BTA_AG_INT) {
Expand All @@ -414,7 +416,7 @@ void bta_ag_do_disc(tBTA_AG_SCB* p_scb, tBTA_SERVICE_MASK service) {

uuid_list[0].uu.uuid16 = UUID_SERVCLASS_HEADSET; /* Legacy from HSP v1.0 */
if (p_scb->hsp_version >= HSP_VERSION_1_2) {
uuid_list[1].uu.uuid16 = UUID_SERVCLASS_HEADSET_HS;
uuid_list[1].uu.uuid16 = Uuid::From16Bit(UUID_SERVCLASS_HEADSET_HS);
num_uuid = 2;
}
}
Expand All @@ -437,8 +439,6 @@ void bta_ag_do_disc(tBTA_AG_SCB* p_scb, tBTA_SERVICE_MASK service) {
/* allocate buffer for sdp database */
p_scb->p_disc_db = (tSDP_DISCOVERY_DB*)osi_malloc(BTA_AG_DISC_BUF_SIZE);
/* set up service discovery database; attr happens to be attr_list len */
uuid_list[0].len = LEN_UUID_16;
uuid_list[1].len = LEN_UUID_16;
db_inited = SDP_InitDiscoveryDb(p_scb->p_disc_db, BTA_AG_DISC_BUF_SIZE,
num_uuid, uuid_list, num_attr, attr_list);

Expand Down
Loading

0 comments on commit c4a6c8d

Please sign in to comment.