Diff between 1c393c18d0bf29f2f216096d33fd14a733baf055 and 02dc1cdd6041c34899f4fd047997ba0f54e036aa

Changed Files

File Additions Deletions Status
android/hal-bluetooth.c +8 -0 modified
android/hal-ipc.c +0 -6 modified

Full Patch

diff --git a/android/hal-bluetooth.c b/android/hal-bluetooth.c
index a220328..b8eae69 100644
--- a/android/hal-bluetooth.c
+++ b/android/hal-bluetooth.c
@@ -423,6 +423,14 @@ static int init(bt_callbacks_t *callbacks)
 
 	bt_hal_cbacks = callbacks;
 
+	/* Start Android Bluetooth daemon service */
+	if (property_set("bluetooth.start", "daemon") < 0) {
+		error("Failed to set bluetooth.start=daemon");
+		hal_ipc_cleanup();
+		bt_hal_cbacks = NULL;
+		return BT_STATUS_FAIL;
+	}
+
 	if (!hal_ipc_accept()) {
 		hal_ipc_cleanup();
 		bt_hal_cbacks = NULL;
diff --git a/android/hal-ipc.c b/android/hal-ipc.c
index b1b85b0..7dd6870 100644
--- a/android/hal-ipc.c
+++ b/android/hal-ipc.c
@@ -238,12 +238,6 @@ bool hal_ipc_accept(void)
 {
 	int err;
 
-	/* Start Android Bluetooth daemon service */
-	if (property_set("bluetooth.start", "daemon") < 0) {
-		error("Failed to set bluetooth.start=daemon");
-		return false;
-	}
-
 	cmd_sk = accept_connection(listen_sk);
 	if (cmd_sk < 0)
 		return false;