diff options
author | Wootak Jung <wootak.jung@samsung.com> | 2024-01-16 12:53:35 +0900 |
---|---|---|
committer | Wootak Jung <wootak.jung@samsung.com> | 2024-01-16 12:53:35 +0900 |
commit | 47e37a4f7e932d0fbbb3fe94d2184e87d0c96f44 (patch) | |
tree | ff8b2320eff58e8d5c418cf760f6dcdedff5d563 | |
parent | 4e0dd434b99dc855b0461c8d5ee0e028c60d239f (diff) | |
download | bluez-47e37a4f7e932d0fbbb3fe94d2184e87d0c96f44.tar.gz bluez-47e37a4f7e932d0fbbb3fe94d2184e87d0c96f44.tar.bz2 bluez-47e37a4f7e932d0fbbb3fe94d2184e87d0c96f44.zip |
Fix issue of not reconnecting when disconnected due to timeout
Change-Id: I0f263370df9c22d8fdc98ceb33bc1e364b828ba8
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
-rwxr-xr-x | plugins/policy.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/plugins/policy.c b/plugins/policy.c index 46bbb85f..065ce4f2 100755 --- a/plugins/policy.c +++ b/plugins/policy.c @@ -802,8 +802,15 @@ static void disconnect_cb(struct btd_device *dev, uint8_t reason) DBG("reason %u", reason); /* Only attempt reconnect for the following reasons */ +#ifdef TIZEN_FEATURE_BLUEZ_MODIFY + /* In the timeout case, the error is converted to HCI_ERROR_CONNECTION_TIMEOUT(0x08) + * by mgmt_to_hci_reason(). But, in the suspend case, no conversion is performed */ + if (reason != 0x08 && + reason != MGMT_DEV_DISCONN_LOCAL_HOST_SUSPEND) +#else if (reason != MGMT_DEV_DISCONN_TIMEOUT && reason != MGMT_DEV_DISCONN_LOCAL_HOST_SUSPEND) +#endif return; reconnect = reconnect_find(dev); @@ -830,9 +837,15 @@ static void disconnect_cb(struct btd_device *dev, uint8_t reason) reconnect_set_timer(reconnect, resume_delay); } break; +#ifdef TIZEN_FEATURE_BLUEZ_MODIFY + case 0x08: /* HCI_ERROR_CONNECTION_TIMEOUT */ + reconnect_set_timer(reconnect, -1); + break; +#else case MGMT_DEV_DISCONN_TIMEOUT: reconnect_set_timer(reconnect, -1); break; +#endif default: DBG("Developer error. Reason = %d", reason); break; |