- /* Enable the BT LE */
- _bt_enable_adapter_le();
- } else {
- status = _bt_adapter_get_status();
- le_status = _bt_adapter_get_le_status();
- BT_DBG("State: %d, LE State: %d", status, le_status);
+ if ((bt_status != VCONFKEY_BT_STATUS_OFF || bt_off_due_to_timeout) &&
+ (status == BT_DEACTIVATED)) {
+ BT_DBG("Previous session was enabled.");
+
+ /* Enable the BT */
+ _bt_enable_adapter();
+ } else if (bt_status == VCONFKEY_BT_STATUS_OFF && flight_mode_deactivation == 1) {
+ _bt_enable_core();
+ }
+
+ if ((bt_le_status == VCONFKEY_BT_LE_STATUS_ON) && (le_status == BT_LE_DEACTIVATED)) {
+ BT_DBG("Previous session was le enabled. Turn BT LE on automatically.");
+
+ /* Enable the BT LE */
+ _bt_enable_adapter_le();
+ } else {
+ status = _bt_adapter_get_status();
+ le_status = _bt_adapter_get_le_status();
+ BT_DBG("State: %d, LE State: %d", status, le_status);