diff --git a/android/cutils/properties.h b/android/cutils/properties.h
index 7951585..256bf13 100644
--- a/android/cutils/properties.h
+++ b/android/cutils/properties.h
* limitations under the License.
*/
+#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <sys/socket.h>
diff --git a/android/hal-bluetooth.c b/android/hal-bluetooth.c
index 11f2a9f..905b293 100644
--- a/android/hal-bluetooth.c
+++ b/android/hal-bluetooth.c
#include <stdbool.h>
#include <string.h>
+#include <cutils/properties.h>
+
#include "hal-log.h"
#include "hal.h"
#include "hal-msg.h"
#include "hal-ipc.h"
#include "hal-utils.h"
+#define SNOOP_SERVICE_NAME "bluetoothd_snoop"
+
static const bt_callbacks_t *bt_hal_cbacks = NULL;
#define enum_prop_to_hal(prop, hal_prop, type) do { \
}
#endif
+#if PLATFORM_SDK_VERSION > 18
+static int config_hci_snoop_log(uint8_t enable)
+{
+ if (enable && property_set("ctl.start", SNOOP_SERVICE_NAME) < 0) {
+ error("Failed to start service %s", SNOOP_SERVICE_NAME);
+ return BT_STATUS_FAIL;
+ }
+
+ if (!enable && property_set("ctl.stop", SNOOP_SERVICE_NAME) < 0) {
+ error("Failed to stop service %s", SNOOP_SERVICE_NAME);
+ return BT_STATUS_FAIL;
+ }
+
+ return BT_STATUS_SUCCESS;
+}
+#endif
+
static const bt_interface_t bluetooth_if = {
.size = sizeof(bt_interface_t),
.init = init,
#if PLATFORM_SDK_VERSION > 17
.le_test_mode = le_test_mode,
#endif
+#if PLATFORM_SDK_VERSION > 18
+ .config_hci_snoop_log = config_hci_snoop_log,
+#endif
};
static const bt_interface_t *get_bluetooth_interface(void)