summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author William Escande <wescande@google.com> 2025-03-20 18:23:46 -0700
committer Android (Google) Code Review <android-gerrit@google.com> 2025-03-20 18:23:46 -0700
commit2fb4d9b77fa2b72d1b6012b602fd106349fad790 (patch)
treece82f8f0c39293aafb5f118e0e074e749be2ae46
parent0d8713dff209c7f9ba76b160c928569b0c4fcb6f (diff)
parent103b98c64230e494cadd063493ad2b8dae89384b (diff)
Merge "getAdapterProxy: null-check re-order" into main
-rw-r--r--framework/java/android/bluetooth/BluetoothAdapter.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/framework/java/android/bluetooth/BluetoothAdapter.java b/framework/java/android/bluetooth/BluetoothAdapter.java
index 1b37497323..b7feb11e19 100644
--- a/framework/java/android/bluetooth/BluetoothAdapter.java
+++ b/framework/java/android/bluetooth/BluetoothAdapter.java
@@ -3460,14 +3460,14 @@ public final class BluetoothAdapter {
BiFunction<Context, BluetoothAdapter, BluetoothProfile> constructor =
PROFILE_CONSTRUCTORS.get(profile);
- BluetoothProfile profileProxy = constructor.apply(context, this);
- ProfileConnection connection = new ProfileConnection(profile, listener, executor);
-
if (constructor == null) {
Log.e(TAG, "getProfileProxy(): Unknown profile " + profile);
return false;
}
+ BluetoothProfile profileProxy = constructor.apply(context, this);
+ ProfileConnection connection = new ProfileConnection(profile, listener, executor);
+
synchronized (sProfileLock) {
// Synchronize with the binder callback to prevent performing the
// ProfileConnection.connect concurrently