diff options
author | Johanna Ye <xincheny@google.com> | 2021-06-29 19:43:02 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2021-06-29 19:43:02 +0000 |
commit | 71fa7426dbf56eea382fd6dfafd88ebb0ff80e9c (patch) | |
tree | 87ab9532faac61ef5e7f79175cc7a587e37e4bb3 /framework/java/android/bluetooth/BluetoothGatt.java | |
parent | 8553bf4231434ce8e6240dff2de2b716b831d960 (diff) | |
parent | bcd43e1c322e4dc492126665d27aa9f8de66542c (diff) |
Merge "Add synchronization to all mDeviceBusy state changes." am: 744e835c40 am: bcd43e1c32
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1751221
Change-Id: I3ecb6ae4c51c4a843be0eb265825966c8afb42ae
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothGatt.java')
-rw-r--r-- | framework/java/android/bluetooth/BluetoothGatt.java | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/framework/java/android/bluetooth/BluetoothGatt.java b/framework/java/android/bluetooth/BluetoothGatt.java index aea82102ca..2f771e9d3b 100644 --- a/framework/java/android/bluetooth/BluetoothGatt.java +++ b/framework/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; } |