diff options
| author | Venkat Raghavan <venkatrv@broadcom.com> | 2015-04-06 16:26:11 -0700 |
|---|---|---|
| committer | Andre Eisenbach <eisenbach@google.com> | 2015-04-06 16:27:09 -0700 |
| commit | 05e08c3a2f27d5027b34e81b7c0a67e4da7341f6 (patch) | |
| tree | f3ad792017c830fcc1b0dafdac2e625168049a16 | |
| parent | 6c6d266c401a587f3d6495f7eddd547bdc5759fb (diff) | |
| download | frameworks_base-05e08c3a2f27d5027b34e81b7c0a67e4da7341f6.zip frameworks_base-05e08c3a2f27d5027b34e81b7c0a67e4da7341f6.tar.gz frameworks_base-05e08c3a2f27d5027b34e81b7c0a67e4da7341f6.tar.bz2 | |
Bluetooth: Do not initiate inquiry during pairing/SDP
Retry SDP if it gets cancelled in BONDING state.
If SDP search initiated after the pairing gets cancelled, re-initiate
SDP search from the BTIF layer to ensure completion of the bonding
process.
While pairing/SDP discovery of the bonded device is in progress,
do not initiate inquiry.
Bug: 19417758
Change-Id: I2d80883999771c53b58cc3017a63b17e3564bc57
| -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(); |
