[PATCH] android: Check that service is started

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Andrei Emeltchenko <andrei.emeltchenko@xxxxxxxxx>

Add check that we are able to start Bluetooth service in
Android. If service is not started we should not try to connect to it.
---
 android/hal-ipc.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/android/hal-ipc.c b/android/hal-ipc.c
index 2d58038..a7948a6 100644
--- a/android/hal-ipc.c
+++ b/android/hal-ipc.c
@@ -204,7 +204,11 @@ bool hal_ipc_init(void)
 	}
 
 	/* Start Android Bluetooth daemon service */
-	property_set("ctl.start", SERVICE_NAME);
+	if (property_set("ctl.start", SERVICE_NAME) < 0) {
+		error("Failed to start service %s", SERVICE_NAME);
+		close(sk);
+		return false;
+	}
 
 	cmd_sk = accept_connection(sk);
 	if (cmd_sk < 0) {
-- 
1.8.1.2

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux