if (strcasecmp(name, BT_BLUEZ_NAME) == 0) {
BT_INFO_C("### Bluetoothd is terminated");
- if (_bt_adapter_get_status() == BT_ACTIVATED)
- _bt_disable_cb();
-
+ if (_bt_adapter_get_status() != BT_DEACTIVATING &&
+ _bt_adapter_get_status() != BT_DEACTIVATED) {
+ BT_INFO_C("### Recover it");
+ _bt_recover_adapter();
+ }
_bt_handle_adapter_removed();
__bt_devices_list_free();
}