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

Commit b0eab235 authored by Sungki Kim's avatar Sungki Kim Committed by android-build-merger
Browse files

Merge "Fix GATT autoConnect race condition" into nyc-dev

am: ddd7d3d7

* commit 'ddd7d3d7':
  Fix GATT autoConnect race condition

Change-Id: Ibd668dcd22c1c1f17835ee05bcd175024a6487e5
parents 2b2ad77f ddd7d3d7
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -645,6 +645,9 @@ public final class BluetoothGatt implements BluetoothProfile {
            }
            mConnState = CONN_STATE_CONNECTING;
        }

        mAutoConnect = autoConnect;

        if (!registerApp(callback)) {
            synchronized(mStateLock) {
                mConnState = CONN_STATE_IDLE;
@@ -653,8 +656,7 @@ public final class BluetoothGatt implements BluetoothProfile {
            return false;
        }

        // the connection will continue after successful callback registration
        mAutoConnect = autoConnect;
        // The connection will continue in the onClientRegistered callback
        return true;
    }