summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author William Escande <wescande@google.com> 2025-03-20 13:49:55 -0700
committer William Escande <wescande@google.com> 2025-03-20 14:02:10 -0700
commit103b98c64230e494cadd063493ad2b8dae89384b (patch)
treeb7f7fbe49b2dc9d75ddd444e5ecb965404db16f1
parent084f6ced41f860f06e50e316f9e8d2bce1df5388 (diff)
getAdapterProxy: null-check re-order
Bug: 404290817 Fix: 404290817 Bug: 404058947 Flag: EXEMPT bugfix obvious and without risk Test: atest CtsBluetoothTestCases Change-Id: I18e528e7324c81d710952425b7dfacf4a504bf40
-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