Merge "Fix GATT autoConnect race condition" into nyc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
ddd7d3d766
@@ -645,6 +645,9 @@ public final class BluetoothGatt implements BluetoothProfile {
|
|||||||
}
|
}
|
||||||
mConnState = CONN_STATE_CONNECTING;
|
mConnState = CONN_STATE_CONNECTING;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mAutoConnect = autoConnect;
|
||||||
|
|
||||||
if (!registerApp(callback)) {
|
if (!registerApp(callback)) {
|
||||||
synchronized(mStateLock) {
|
synchronized(mStateLock) {
|
||||||
mConnState = CONN_STATE_IDLE;
|
mConnState = CONN_STATE_IDLE;
|
||||||
@@ -653,8 +656,7 @@ public final class BluetoothGatt implements BluetoothProfile {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// the connection will continue after successful callback registration
|
// The connection will continue in the onClientRegistered callback
|
||||||
mAutoConnect = autoConnect;
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user