summaryrefslogtreecommitdiff
path: root/framework/java/android/bluetooth/BluetoothGatt.java
diff options
context:
space:
mode:
authorJohanna Ye <xincheny@google.com>2021-06-29 19:23:29 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2021-06-29 19:23:29 +0000
commitbcd43e1c322e4dc492126665d27aa9f8de66542c (patch)
tree5586e2c072937e68e80819791b69db43d28b4b7b /framework/java/android/bluetooth/BluetoothGatt.java
parentf7b74742320f808da5de78f975c168a2052fac13 (diff)
parent842f394c3d34f5e5779f027bdcde8fcaccd195bd (diff)
Merge "Add synchronization to all mDeviceBusy state changes." am: 744e835c40
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1751221 Change-Id: I652d7bef485bca276c3315efec8f5ed647883b28
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothGatt.java')
-rw-r--r--framework/java/android/bluetooth/BluetoothGatt.java24
1 files changed, 18 insertions, 6 deletions
diff --git a/framework/java/android/bluetooth/BluetoothGatt.java b/framework/java/android/bluetooth/BluetoothGatt.java
index 381318b26d..1d08ddb65c 100644
--- a/framework/java/android/bluetooth/BluetoothGatt.java
+++ b/framework/java/android/bluetooth/BluetoothGatt.java
@@ -1153,7 +1153,9 @@ public final class BluetoothGatt implements BluetoothProfile {
characteristic.getInstanceId(), AUTHENTICATION_NONE);
} catch (RemoteException e) {
Log.e(TAG, "", e);
- mDeviceBusy = false;
+ synchronized (mDeviceBusyLock) {
+ mDeviceBusy = false;
+ }
return false;
}
@@ -1187,7 +1189,9 @@ public final class BluetoothGatt implements BluetoothProfile {
new ParcelUuid(uuid), startHandle, endHandle, AUTHENTICATION_NONE);
} catch (RemoteException e) {
Log.e(TAG, "", e);
- mDeviceBusy = false;
+ synchronized (mDeviceBusyLock) {
+ mDeviceBusy = false;
+ }
return false;
}
@@ -1234,7 +1238,9 @@ public final class BluetoothGatt implements BluetoothProfile {
AUTHENTICATION_NONE, characteristic.getValue());
} catch (RemoteException e) {
Log.e(TAG, "", e);
- mDeviceBusy = false;
+ synchronized (mDeviceBusyLock) {
+ mDeviceBusy = false;
+ }
return false;
}
@@ -1276,7 +1282,9 @@ public final class BluetoothGatt implements BluetoothProfile {
descriptor.getInstanceId(), AUTHENTICATION_NONE);
} catch (RemoteException e) {
Log.e(TAG, "", e);
- mDeviceBusy = false;
+ synchronized (mDeviceBusyLock) {
+ mDeviceBusy = false;
+ }
return false;
}
@@ -1317,7 +1325,9 @@ public final class BluetoothGatt implements BluetoothProfile {
AUTHENTICATION_NONE, descriptor.getValue());
} catch (RemoteException e) {
Log.e(TAG, "", e);
- mDeviceBusy = false;
+ synchronized (mDeviceBusyLock) {
+ mDeviceBusy = false;
+ }
return false;
}
@@ -1384,7 +1394,9 @@ public final class BluetoothGatt implements BluetoothProfile {
mService.endReliableWrite(mClientIf, mDevice.getAddress(), true);
} catch (RemoteException e) {
Log.e(TAG, "", e);
- mDeviceBusy = false;
+ synchronized (mDeviceBusyLock) {
+ mDeviceBusy = false;
+ }
return false;
}