bluetooth: Check the result of registerAsService am: f63b741b6a am: 31570b1187
am: 1b03ef42c1
Change-Id: I265c66dde42d7bd74aa23fa9e7eb52e74150b712
diff --git a/bluetooth/service.cc b/bluetooth/service.cc
index 5c59154..05920ed 100644
--- a/bluetooth/service.cc
+++ b/bluetooth/service.cc
@@ -19,6 +19,7 @@
#include <android/hardware/bluetooth/1.0/IBluetoothHci.h>
#include <hidl/HidlSupport.h>
#include <hidl/HidlTransportSupport.h>
+#include <utils/Log.h>
#include "bluetooth_hci.h"
@@ -31,6 +32,9 @@
int main(int /* argc */, char** /* argv */) {
sp<IBluetoothHci> bluetooth = new BluetoothHci;
configureRpcThreadpool(1, true);
- bluetooth->registerAsService();
- joinRpcThreadpool();
+ android::status_t status = bluetooth->registerAsService();
+ if (status == android::OK)
+ joinRpcThreadpool();
+ else
+ ALOGE("Could not register as a service!");
}