diff options
author | Neha Jain <jainne@google.com> | 2022-06-29 23:53:57 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-06-30 02:24:28 +0000 |
commit | 856f6acf59076eb3b200b1581d178745c9f0e681 (patch) | |
tree | 015aab1ce91e4148f0c851baa4681b01d9aea25c /framework/java/android/bluetooth/le/PeriodicAdvertisingManager.java | |
parent | 4c024a2dee95a9c9f94e8c4616e6aa9cdb5aa2a5 (diff) |
Revert "Revert "Reuse SynchronousResultReceivers instead of creating new.""
This reverts commit dd85e91cea26c7f706af36c852e79d5b4ca1f173.
Bug: 217366135
Reason for revert: Need this to fix a crash bug in tm-dev
Change-Id: I2a94c278edc0681c5b8af6ea0a0171b71d72c650
(cherry picked from commit dbaf406ccb0ed887d4e93057c9ec0d3457f14457)
Merged-In: I2a94c278edc0681c5b8af6ea0a0171b71d72c650
Diffstat (limited to 'framework/java/android/bluetooth/le/PeriodicAdvertisingManager.java')
-rw-r--r-- | framework/java/android/bluetooth/le/PeriodicAdvertisingManager.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/framework/java/android/bluetooth/le/PeriodicAdvertisingManager.java b/framework/java/android/bluetooth/le/PeriodicAdvertisingManager.java index 13b7163f30..7711a00740 100644 --- a/framework/java/android/bluetooth/le/PeriodicAdvertisingManager.java +++ b/framework/java/android/bluetooth/le/PeriodicAdvertisingManager.java @@ -177,7 +177,7 @@ public final class PeriodicAdvertisingManager { mCallbackWrappers.put(callback, wrapped); try { - final SynchronousResultReceiver recv = new SynchronousResultReceiver(); + final SynchronousResultReceiver recv = SynchronousResultReceiver.get(); gatt.registerSync(scanResult, skip, timeout, wrapped, mAttributionSource, recv); recv.awaitResultNoInterrupt(getSyncTimeout()).getValue(null); } catch (TimeoutException | RemoteException e) { @@ -215,7 +215,7 @@ public final class PeriodicAdvertisingManager { } try { - final SynchronousResultReceiver recv = new SynchronousResultReceiver(); + final SynchronousResultReceiver recv = SynchronousResultReceiver.get(); gatt.unregisterSync(wrapper, mAttributionSource, recv); recv.awaitResultNoInterrupt(getSyncTimeout()).getValue(null); } catch (TimeoutException | RemoteException e) { @@ -246,7 +246,7 @@ public final class PeriodicAdvertisingManager { return; } try { - final SynchronousResultReceiver recv = new SynchronousResultReceiver(); + final SynchronousResultReceiver recv = SynchronousResultReceiver.get(); gatt.transferSync(bda, serviceData , syncHandle, mAttributionSource, recv); recv.awaitResultNoInterrupt(getSyncTimeout()).getValue(null); } catch (TimeoutException | RemoteException e) { @@ -291,7 +291,7 @@ public final class PeriodicAdvertisingManager { throw new IllegalArgumentException("callback was not properly registered"); } try { - final SynchronousResultReceiver recv = new SynchronousResultReceiver(); + final SynchronousResultReceiver recv = SynchronousResultReceiver.get(); gatt.transferSetInfo(bda, serviceData , advHandle, wrapper, mAttributionSource, recv); recv.awaitResultNoInterrupt(getSyncTimeout()).getValue(null); } catch (RemoteException | TimeoutException e) { |