diff options
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; |