summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--framework/java/android/bluetooth/BluetoothUtils.java15
1 files changed, 6 insertions, 9 deletions
diff --git a/framework/java/android/bluetooth/BluetoothUtils.java b/framework/java/android/bluetooth/BluetoothUtils.java
index d7a09929f0..b734ff2fef 100644
--- a/framework/java/android/bluetooth/BluetoothUtils.java
+++ b/framework/java/android/bluetooth/BluetoothUtils.java
@@ -338,15 +338,12 @@ public final class BluetoothUtils {
* @hide
*/
public static void executeFromBinder(@NonNull Executor executor, @NonNull Runnable callback) {
- executor.execute(
- () -> {
- final long identity = Binder.clearCallingIdentity();
- try {
- callback.run();
- } finally {
- Binder.restoreCallingIdentity(identity);
- }
- });
+ final long identity = Binder.clearCallingIdentity();
+ try {
+ executor.execute(() -> callback.run());
+ } finally {
+ Binder.restoreCallingIdentity(identity);
+ }
}
/** A {@link Consumer} that automatically logs {@link RemoteException} @hide */