diff options
Diffstat (limited to 'packages')
| -rw-r--r--[-rwxr-xr-x] | packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java index 64b4452..dd2368f 100755..100644 --- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java +++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java @@ -527,7 +527,11 @@ public final class CachedBluetoothDevice implements Comparable<CachedBluetoothDe void onUuidChanged() { updateProfiles(); ParcelUuid[] uuids = mDevice.getUuids(); + long timeout = MAX_UUID_DELAY_FOR_AUTO_CONNECT; + if (BluetoothUuid.isUuidPresent(uuids, BluetoothUuid.Hogp)) { + timeout = MAX_HOGP_DELAY_FOR_AUTO_CONNECT; + } if (DEBUG) { Log.d(TAG, "onUuidChanged: Time since last connect" @@ -535,14 +539,12 @@ public final class CachedBluetoothDevice implements Comparable<CachedBluetoothDe } /* - * If a connect was attempted earlier without any UUID, we will do the - * connect now. + * If a connect was attempted earlier without any UUID, we will do the connect now. + * Otherwise, allow the connect on UUID change. */ - if (BluetoothUuid.isUuidPresent(uuids, BluetoothUuid.Hogp)) { - timeout = MAX_HOGP_DELAY_FOR_AUTO_CONNECT; - } if (!mProfiles.isEmpty() - && (mConnectAttempted + timeout) > SystemClock.elapsedRealtime()) { + && ((mConnectAttempted + timeout) > SystemClock.elapsedRealtime() + || (mConnectAttempted == 0))) { connectWithoutResettingTimer(false); } dispatchAttributesChanged(); |
