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

Commit 7be83c57 authored by Andre Eisenbach's avatar Andre Eisenbach
Browse files

Bluetooth: Fix profile auto-connect logic

The fix in commit 05e08c3a caused a
duplicate connect message to be sent to A2DP devices (and others),
causing the A2DP state machine to disconnect a device shortly after
connecting it.

This patch reverts the relevant part of commit 05e06c that causes the
faulty auto-connect behaviour.

Bug: 22128169
Change-Id: Ie0dadd5c9583bf2b64a8434a2a3603cb749b21d0
parent 7d223aee
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -539,10 +539,10 @@ public final class CachedBluetoothDevice implements Comparable<CachedBluetoothDe
         * Otherwise, allow the connect on UUID change.
         * Otherwise, allow the connect on UUID change.
         */
         */
        if (!mProfiles.isEmpty()
        if (!mProfiles.isEmpty()
                && ((mConnectAttempted + timeout) > SystemClock.elapsedRealtime()
                && ((mConnectAttempted + timeout) > SystemClock.elapsedRealtime())) {
                || (mConnectAttempted == 0))) {
            connectWithoutResettingTimer(false);
            connectWithoutResettingTimer(false);
        }
        }

        dispatchAttributesChanged();
        dispatchAttributesChanged();
    }
    }