Merge "Bluetooth: Export AsyncFdWatcher for reuse"

This commit is contained in:
Treehugger Robot
2017-02-22 04:06:51 +00:00
committed by Gerrit Code Review
5 changed files with 27 additions and 11 deletions

View File

@@ -17,7 +17,6 @@ cc_library_shared {
name: "android.hardware.bluetooth@1.0-impl",
relative_install_path: "hw",
srcs: [
"async_fd_watcher.cc",
"bluetooth_hci.cc",
"bluetooth_address.cc",
"vendor_interface.cc",
@@ -33,12 +32,28 @@ cc_library_shared {
"liblog",
"libutils",
],
static_libs: [
"android.hardware.bluetooth-async",
],
}
cc_library_static {
name: "android.hardware.bluetooth-async",
srcs: [
"async_fd_watcher.cc",
],
export_include_dirs: ["."],
shared_libs: [
"libbase",
"libcutils",
"liblog",
"libutils",
],
}
cc_test {
name: "bluetooth-vendor-interface-unit-tests",
srcs: [
"async_fd_watcher.cc",
"test/async_fd_watcher_unittest.cc",
],
local_include_dirs: [
@@ -48,6 +63,9 @@ cc_test {
"libbase",
"liblog",
],
static_libs: [
"android.hardware.bluetooth-async",
],
}
cc_test_host {

View File

@@ -29,8 +29,7 @@
namespace android {
namespace hardware {
namespace bluetooth {
namespace V1_0 {
namespace implementation {
namespace async {
int AsyncFdWatcher::WatchFdForNonBlockingReads(
int file_descriptor, const ReadCallback& on_read_fd_ready_callback) {
@@ -167,8 +166,7 @@ void AsyncFdWatcher::ThreadRoutine() {
}
}
} // namespace implementation
} // namespace V1_0
} // namespace async
} // namespace bluetooth
} // namespace hardware
} // namespace android

View File

@@ -22,8 +22,7 @@
namespace android {
namespace hardware {
namespace bluetooth {
namespace V1_0 {
namespace implementation {
namespace async {
using ReadCallback = std::function<void(int)>;
using TimeoutCallback = std::function<void(void)>;
@@ -62,8 +61,7 @@ class AsyncFdWatcher {
};
} // namespace implementation
} // namespace V1_0
} // namespace async
} // namespace bluetooth
} // namespace hardware
} // namespace android

View File

@@ -33,6 +33,8 @@ namespace bluetooth {
namespace V1_0 {
namespace implementation {
using android::hardware::bluetooth::async::AsyncFdWatcher;
class AsyncFdWatcherSocketTest : public ::testing::Test {
public:
static const uint16_t kPort = 6111;

View File

@@ -59,7 +59,7 @@ class VendorInterface {
void *lib_handle_;
bt_vendor_interface_t *lib_interface_;
AsyncFdWatcher fd_watcher_;
async::AsyncFdWatcher fd_watcher_;
int uart_fd_;
PacketReadCallback packet_read_cb_;
InitializeCompleteCallback initialize_complete_cb_;