summaryrefslogtreecommitdiff
path: root/framework/java/android/bluetooth/BluetoothGatt.java
diff options
context:
space:
mode:
authorAjay Panicker <apanicke@google.com>2018-10-18 23:34:44 -0700
committerandroid-build-merger <android-build-merger@google.com>2018-10-18 23:34:44 -0700
commit444e02262d9540e45749a89c723ea2f16b5147e3 (patch)
tree04b39af362163cc69f1a630363b1600afb528c15 /framework/java/android/bluetooth/BluetoothGatt.java
parente0c79a58618fb9f490a4991f9c38bf6f482d69c9 (diff)
parent223493ca1bf0306e0262c3d2c4b56c9fced50f54 (diff)
Merge "Synchronize on a static final object to lock mDeviceBusy" am: 49651ddf88
am: 223493ca1b Change-Id: Ic53518b0e62803bb68b60ed318d6a0825b192164
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothGatt.java')
-rw-r--r--framework/java/android/bluetooth/BluetoothGatt.java25
1 files changed, 13 insertions, 12 deletions
diff --git a/framework/java/android/bluetooth/BluetoothGatt.java b/framework/java/android/bluetooth/BluetoothGatt.java
index 43f68f7e3d..ea238f52b5 100644
--- a/framework/java/android/bluetooth/BluetoothGatt.java
+++ b/framework/java/android/bluetooth/BluetoothGatt.java
@@ -56,6 +56,7 @@ public final class BluetoothGatt implements BluetoothProfile {
private int mAuthRetryState;
private int mConnState;
private final Object mStateLock = new Object();
+ private final Object mDeviceBusyLock = new Object();
@UnsupportedAppUsage
private Boolean mDeviceBusy = false;
@UnsupportedAppUsage
@@ -281,7 +282,7 @@ public final class BluetoothGatt implements BluetoothProfile {
}
}
- synchronized (mDeviceBusy) {
+ synchronized (mDeviceBusyLock) {
mDeviceBusy = false;
}
}
@@ -356,7 +357,7 @@ public final class BluetoothGatt implements BluetoothProfile {
return;
}
- synchronized (mDeviceBusy) {
+ synchronized (mDeviceBusyLock) {
mDeviceBusy = false;
}
@@ -412,7 +413,7 @@ public final class BluetoothGatt implements BluetoothProfile {
return;
}
- synchronized (mDeviceBusy) {
+ synchronized (mDeviceBusyLock) {
mDeviceBusy = false;
}
@@ -495,7 +496,7 @@ public final class BluetoothGatt implements BluetoothProfile {
return;
}
- synchronized (mDeviceBusy) {
+ synchronized (mDeviceBusyLock) {
mDeviceBusy = false;
}
@@ -546,7 +547,7 @@ public final class BluetoothGatt implements BluetoothProfile {
return;
}
- synchronized (mDeviceBusy) {
+ synchronized (mDeviceBusyLock) {
mDeviceBusy = false;
}
@@ -595,7 +596,7 @@ public final class BluetoothGatt implements BluetoothProfile {
return;
}
- synchronized (mDeviceBusy) {
+ synchronized (mDeviceBusyLock) {
mDeviceBusy = false;
}
@@ -1097,7 +1098,7 @@ public final class BluetoothGatt implements BluetoothProfile {
BluetoothDevice device = service.getDevice();
if (device == null) return false;
- synchronized (mDeviceBusy) {
+ synchronized (mDeviceBusyLock) {
if (mDeviceBusy) return false;
mDeviceBusy = true;
}
@@ -1131,7 +1132,7 @@ public final class BluetoothGatt implements BluetoothProfile {
if (VDBG) Log.d(TAG, "readUsingCharacteristicUuid() - uuid: " + uuid);
if (mService == null || mClientIf == 0) return false;
- synchronized (mDeviceBusy) {
+ synchronized (mDeviceBusyLock) {
if (mDeviceBusy) return false;
mDeviceBusy = true;
}
@@ -1177,7 +1178,7 @@ public final class BluetoothGatt implements BluetoothProfile {
BluetoothDevice device = service.getDevice();
if (device == null) return false;
- synchronized (mDeviceBusy) {
+ synchronized (mDeviceBusyLock) {
if (mDeviceBusy) return false;
mDeviceBusy = true;
}
@@ -1220,7 +1221,7 @@ public final class BluetoothGatt implements BluetoothProfile {
BluetoothDevice device = service.getDevice();
if (device == null) return false;
- synchronized (mDeviceBusy) {
+ synchronized (mDeviceBusyLock) {
if (mDeviceBusy) return false;
mDeviceBusy = true;
}
@@ -1261,7 +1262,7 @@ public final class BluetoothGatt implements BluetoothProfile {
BluetoothDevice device = service.getDevice();
if (device == null) return false;
- synchronized (mDeviceBusy) {
+ synchronized (mDeviceBusyLock) {
if (mDeviceBusy) return false;
mDeviceBusy = true;
}
@@ -1329,7 +1330,7 @@ public final class BluetoothGatt implements BluetoothProfile {
if (VDBG) Log.d(TAG, "executeReliableWrite() - device: " + mDevice.getAddress());
if (mService == null || mClientIf == 0) return false;
- synchronized (mDeviceBusy) {
+ synchronized (mDeviceBusyLock) {
if (mDeviceBusy) return false;
mDeviceBusy = true;
}