diff options
author | Myles Watson <mylesgw@google.com> | 2017-03-29 06:09:54 -0700 |
---|---|---|
committer | Myles Watson <mylesgw@google.com> | 2017-03-29 11:26:41 -0700 |
commit | 04475567c2c72c52dfb53bf33bb37b4b40bbefb9 (patch) | |
tree | ca942923491ead3b290992274cde6e2c5b6ccc11 | |
parent | 781bd6409dafab4b4daa4b749af3806dae554015 (diff) | |
download | hikey-04475567c2c72c52dfb53bf33bb37b4b40bbefb9.tar.gz |
bluetooth: Check the result of registerAsService
Test: VTS tests pass, Bluetooth starts/stops
Change-Id: Idc541ac9eee32edbdd64e054f6c42a5cb930493c
(cherry picked from commit f63b741b6a1f034fd2768060b272392c4214197b)
-rw-r--r-- | bluetooth/service.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/bluetooth/service.cc b/bluetooth/service.cc index 5c591543..05920edf 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 @@ using ::android::sp; 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!"); } |