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

am: ddd7d3d766

* commit 'ddd7d3d766744125b1bd3033f12e54b26a1d4068':
  Fix GATT autoConnect race condition

Change-Id: I19dfdf3c52bf90d7e1541716cd63d5aa9d73700d
This commit is contained in:
Sungki Kim
2016-05-19 19:44:44 +00:00
committed by android-build-merger

View File

@@ -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;
}