summaryrefslogtreecommitdiff
path: root/framework/java/android/bluetooth/le/PeriodicAdvertisingManager.java
diff options
context:
space:
mode:
authorNeha Jain <jainne@google.com>2022-06-29 04:04:16 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-06-29 04:13:00 +0000
commitdd85e91cea26c7f706af36c852e79d5b4ca1f173 (patch)
tree3cc753e6115fae83b16d4c9468d5119aed64d696 /framework/java/android/bluetooth/le/PeriodicAdvertisingManager.java
parentf8b9ffa1b12db219685ae631d91b9020a030c63a (diff)
Revert "Reuse SynchronousResultReceivers instead of creating new."
This reverts commit 02dcbe72b3564559eaa9c2e2714824e4aac6f18c. Reason for revert: Causing builds to fail b/237471430 Change-Id: I6165d838abf312085050359377f67a68a5f8b51a (cherry picked from commit f5dd42bbd05e68f7763ccaa9fae5642acc4ceba1) Merged-In: I6165d838abf312085050359377f67a68a5f8b51a
Diffstat (limited to 'framework/java/android/bluetooth/le/PeriodicAdvertisingManager.java')
-rw-r--r--framework/java/android/bluetooth/le/PeriodicAdvertisingManager.java8
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 7711a00740..13b7163f30 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 = SynchronousResultReceiver.get();
+ final SynchronousResultReceiver recv = new SynchronousResultReceiver();
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 = SynchronousResultReceiver.get();
+ final SynchronousResultReceiver recv = new SynchronousResultReceiver();
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 = SynchronousResultReceiver.get();
+ final SynchronousResultReceiver recv = new SynchronousResultReceiver();
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 = SynchronousResultReceiver.get();
+ final SynchronousResultReceiver recv = new SynchronousResultReceiver();
gatt.transferSetInfo(bda, serviceData , advHandle, wrapper, mAttributionSource, recv);
recv.awaitResultNoInterrupt(getSyncTimeout()).getValue(null);
} catch (RemoteException | TimeoutException e) {