Set rfkill power off if turning BT on fails.
Bug:3397042
This was needed anyway for proper cleanup but even more
so as BT and Wifi share the same GPIO line for power to the chipset.
Change-Id: I77dc26fadb72710965af66536c85c5dcb30f2290
diff --git a/bluedroid/bluetooth.c b/bluedroid/bluetooth.c
index ec029ef..e8cf1eb 100644
--- a/bluedroid/bluetooth.c
+++ b/bluedroid/bluetooth.c
@@ -157,6 +157,7 @@
LOGI("Starting hciattach daemon");
if (property_set("ctl.start", "hciattach") < 0) {
LOGE("Failed to start hciattach");
+ set_bluetooth_power(0);
goto out;
}
@@ -174,12 +175,14 @@
}
if (attempt == 0) {
LOGE("%s: Timeout waiting for HCI device to come up", __FUNCTION__);
+ set_bluetooth_power(0);
goto out;
}
LOGI("Starting bluetoothd deamon");
if (property_set("ctl.start", "bluetoothd") < 0) {
LOGE("Failed to start bluetoothd");
+ set_bluetooth_power(0);
goto out;
}