From f08b1a5ce6577793eb7ed5236bd691c341dc4cd5 Mon Sep 17 00:00:00 2001 From: Grzegorz Kołodziejczyk Date: Thu, 2 Jul 2020 13:22:11 +0000 Subject: bluetooth: Set special delay for LeAudio auto connect Timer fires when there is more GATT services to discover on a peer devices. In such case, Android don't even start connecting profiles. Increasing timeout solves a problem, but probably some other solution is needed. Bug: 150670922 Tag: #feature Sponsor: jpawlowski@ Test: Manual Change-Id: If28247836690a209b9dc45b297aa889029a14abb --- .../src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java index 7ce9b516990e..243194188727 100644 --- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java +++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java @@ -69,6 +69,7 @@ public class CachedBluetoothDevice implements Comparable // Some Hearing Aids (especially the 2nd device) needs more time to do service discovery private static final long MAX_HEARING_AIDS_DELAY_FOR_AUTO_CONNECT = 15000; private static final long MAX_HOGP_DELAY_FOR_AUTO_CONNECT = 30000; + private static final long MAX_LEAUDIO_DELAY_FOR_AUTO_CONNECT = 30000; private static final long MAX_MEDIA_PROFILE_CONNECT_DELAY = 60000; private final Context mContext; @@ -757,6 +758,8 @@ public class CachedBluetoothDevice implements Comparable timeout = MAX_HOGP_DELAY_FOR_AUTO_CONNECT; } else if (ArrayUtils.contains(uuids, BluetoothUuid.HEARING_AID)) { timeout = MAX_HEARING_AIDS_DELAY_FOR_AUTO_CONNECT; + } else if (ArrayUtils.contains(uuids, BluetoothUuid.LE_AUDIO)) { + timeout = MAX_LEAUDIO_DELAY_FOR_AUTO_CONNECT; } if (BluetoothUtils.D) { -- cgit v1.2.3-59-g8ed1b