diff options
| author | TreeHugger Robot <treehugger-gerrit@google.com> | 2016-05-19 19:38:55 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2016-05-19 19:38:56 +0000 |
| commit | ddd7d3d766744125b1bd3033f12e54b26a1d4068 (patch) | |
| tree | 8405f593411c3f0f0ff9b423a8b9d04c36d6b2be /core/java/android | |
| parent | 9d37bdcb91dffbfeebc45ef5ae7724c556cb6864 (diff) | |
| parent | d35167adcaa40cb54df8e392379dfdfe98bcdba2 (diff) | |
Merge "Fix GATT autoConnect race condition" into nyc-dev
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/bluetooth/BluetoothGatt.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/core/java/android/bluetooth/BluetoothGatt.java b/core/java/android/bluetooth/BluetoothGatt.java index b8a40dc6895a..800dd434a969 100644 --- a/core/java/android/bluetooth/BluetoothGatt.java +++ b/core/java/android/bluetooth/BluetoothGatt.java @@ -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; } |
