Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH] android: Check that service is started
@ 2013-10-23 10:26 Andrei Emeltchenko
  2013-10-23 11:03 ` Johan Hedberg
  0 siblings, 1 reply; 2+ messages in thread
From: Andrei Emeltchenko @ 2013-10-23 10:26 UTC (permalink / raw)
  To: linux-bluetooth

From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-10-23 11:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-23 10:26 [PATCH] android: Check that service is started Andrei Emeltchenko
2013-10-23 11:03 ` Johan Hedberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox