Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 05e08c3a authored by Venkat Raghavan's avatar Venkat Raghavan Committed by Andre Eisenbach
Browse files

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
parent 6c6d266c
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -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();