summaryrefslogtreecommitdiff
path: root/framework/java/android/bluetooth/le/PeriodicAdvertisingManager.java
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-06-29 00:04:34 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-06-29 00:04:34 +0000
commitf8b9ffa1b12db219685ae631d91b9020a030c63a (patch)
tree25129cf2994447be05b91ae875abcbbbcadc52fa /framework/java/android/bluetooth/le/PeriodicAdvertisingManager.java
parent5862deea655f581b07e9b7e073f5c459e1191017 (diff)
parent655653f48f95b154bf405d122cc912e476bee0d5 (diff)
Merge cherrypicks of [19039092, 19068701, 19032880] into tm-release.
Change-Id: I1b0f0ec8220609517837acf8a68de53aabcfd226
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 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) {