diff options
| author | Johanna Ye <xincheny@google.com> | 2021-06-29 20:16:03 +0000 |
|---|---|---|
| committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2021-06-29 20:16:03 +0000 |
| commit | 4e2056b367de2b7ed8c5be494d3fd95a0cd4cc90 (patch) | |
| tree | ef7ce7e63e5a45d5bfe6c48a5727530e8844328b /core/java/android/bluetooth | |
| parent | 25e5ced0f9dbc6db8ca3c88292d7fdfbd8863977 (diff) | |
| parent | 2ca11a0ebecfdaab24361b32c60ef4b70ef6e87c (diff) | |
Merge "Add synchronization to all mDeviceBusy state changes." am: 744e835c40 am: 8e9787fdb1 am: 7bd3fa33dc am: 2ca11a0ebe
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1751221
Change-Id: I2aa83d3dc16e4d60efc22a62eb7421da6318f68b
Diffstat (limited to 'core/java/android/bluetooth')
| -rw-r--r-- | core/java/android/bluetooth/BluetoothGatt.java | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/core/java/android/bluetooth/BluetoothGatt.java b/core/java/android/bluetooth/BluetoothGatt.java index aea82102ca36..2f771e9d3ba6 100644 --- a/core/java/android/bluetooth/BluetoothGatt.java +++ b/core/java/android/bluetooth/BluetoothGatt.java @@ -1190,7 +1190,9 @@ public final class BluetoothGatt implements BluetoothProfile { characteristic.getInstanceId(), AUTHENTICATION_NONE, mAttributionSource); } catch (RemoteException e) { Log.e(TAG, "", e); - mDeviceBusy = false; + synchronized (mDeviceBusyLock) { + mDeviceBusy = false; + } return false; } @@ -1226,7 +1228,9 @@ public final class BluetoothGatt implements BluetoothProfile { mAttributionSource); } catch (RemoteException e) { Log.e(TAG, "", e); - mDeviceBusy = false; + synchronized (mDeviceBusyLock) { + mDeviceBusy = false; + } return false; } @@ -1274,7 +1278,9 @@ public final class BluetoothGatt implements BluetoothProfile { AUTHENTICATION_NONE, characteristic.getValue(), mAttributionSource); } catch (RemoteException e) { Log.e(TAG, "", e); - mDeviceBusy = false; + synchronized (mDeviceBusyLock) { + mDeviceBusy = false; + } return false; } @@ -1317,7 +1323,9 @@ public final class BluetoothGatt implements BluetoothProfile { descriptor.getInstanceId(), AUTHENTICATION_NONE, mAttributionSource); } catch (RemoteException e) { Log.e(TAG, "", e); - mDeviceBusy = false; + synchronized (mDeviceBusyLock) { + mDeviceBusy = false; + } return false; } @@ -1359,7 +1367,9 @@ public final class BluetoothGatt implements BluetoothProfile { AUTHENTICATION_NONE, descriptor.getValue(), mAttributionSource); } catch (RemoteException e) { Log.e(TAG, "", e); - mDeviceBusy = false; + synchronized (mDeviceBusyLock) { + mDeviceBusy = false; + } return false; } @@ -1428,7 +1438,9 @@ public final class BluetoothGatt implements BluetoothProfile { mService.endReliableWrite(mClientIf, mDevice.getAddress(), true, mAttributionSource); } catch (RemoteException e) { Log.e(TAG, "", e); - mDeviceBusy = false; + synchronized (mDeviceBusyLock) { + mDeviceBusy = false; + } return false; } |
