diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-06-17 14:47:03 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-06-17 14:47:03 +0000 |
commit | f312261a248840df35875961e07f145d473b4605 (patch) | |
tree | 85b7d30d06731d116f52695928f72f406b7e5a24 /service/java/com/android/server/bluetooth/BluetoothManagerService.java | |
parent | 5ddceef31bef6f919b82d069e3e536870e789b84 (diff) | |
parent | 82dfb05056735f9c336340723ab2daa6e860910a (diff) |
Merge cherrypicks of [18963721] into tm-release.
Change-Id: If4fd71fa3f8a147763f7b245b84868874725b7ef
Diffstat (limited to 'service/java/com/android/server/bluetooth/BluetoothManagerService.java')
-rw-r--r-- | service/java/com/android/server/bluetooth/BluetoothManagerService.java | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/service/java/com/android/server/bluetooth/BluetoothManagerService.java b/service/java/com/android/server/bluetooth/BluetoothManagerService.java index 303074574e..a7d9831740 100644 --- a/service/java/com/android/server/bluetooth/BluetoothManagerService.java +++ b/service/java/com/android/server/bluetooth/BluetoothManagerService.java @@ -1446,21 +1446,21 @@ public class BluetoothManagerService extends IBluetoothManager.Stub { } synchronized (mProfileServices) { ProfileServiceConnections psc = mProfileServices.get(new Integer(bluetoothProfile)); + Intent intent; + if (bluetoothProfile == BluetoothProfile.HEADSET + && BluetoothProperties.isProfileHfpAgEnabled().orElse(false)) { + intent = new Intent(IBluetoothHeadset.class.getName()); + } else if (bluetoothProfile == BluetoothProfile.LE_CALL_CONTROL + && BluetoothProperties.isProfileCcpServerEnabled().orElse(false)) { + intent = new Intent(IBluetoothLeCallControl.class.getName()); + } else { + return false; + } if (psc == null) { if (DBG) { Log.d(TAG, "Creating new ProfileServiceConnections object for" + " profile: " + bluetoothProfile); } - - Intent intent; - if (bluetoothProfile == BluetoothProfile.HEADSET) { - intent = new Intent(IBluetoothHeadset.class.getName()); - } else if (bluetoothProfile== BluetoothProfile.LE_CALL_CONTROL) { - intent = new Intent(IBluetoothLeCallControl.class.getName()); - } else { - return false; - } - psc = new ProfileServiceConnections(intent); if (!psc.bindService(DEFAULT_REBIND_COUNT)) { return false; |