Loading android/app/src/com/android/bluetooth/btservice/AdapterService.java +14 −9 Original line number Diff line number Diff line Loading @@ -5288,7 +5288,7 @@ public class AdapterService extends Service { } /** * Sets device as the active devices for the profiles passed into the function * Sets device as the active devices for the profiles passed into the function. * * @param device is the remote bluetooth device * @param profiles is a constant that references for which profiles we'll be setting the remote Loading Loading @@ -5322,9 +5322,18 @@ public class AdapterService extends Service { return false; } if (mLeAudioService != null && (device == null boolean a2dpSupported = mA2dpService != null && (device == null || mA2dpService.getConnectionPolicy(device) == BluetoothProfile.CONNECTION_POLICY_ALLOWED); boolean hfpSupported = mHeadsetService != null && (device == null || mHeadsetService.getConnectionPolicy(device) == BluetoothProfile.CONNECTION_POLICY_ALLOWED); boolean leAudioSupported = mLeAudioService != null && (device == null || mLeAudioService.getConnectionPolicy(device) == BluetoothProfile.CONNECTION_POLICY_ALLOWED)) { == BluetoothProfile.CONNECTION_POLICY_ALLOWED); if (leAudioSupported) { Log.i(TAG, "setActiveDevice: Setting active Le Audio device " + device); if (device == null) { mLeAudioService.removeActiveDevice(false); Loading @@ -5333,9 +5342,7 @@ public class AdapterService extends Service { } } if (setA2dp && mA2dpService != null && (device == null || mA2dpService.getConnectionPolicy(device) == BluetoothProfile.CONNECTION_POLICY_ALLOWED)) { if (setA2dp && a2dpSupported) { Log.i(TAG, "setActiveDevice: Setting active A2dp device " + device); if (device == null) { mA2dpService.removeActiveDevice(false); Loading @@ -5351,9 +5358,7 @@ public class AdapterService extends Service { mHearingAidService.setActiveDevice(device); } if (setHeadset && mHeadsetService != null && (device == null || mHeadsetService.getConnectionPolicy(device) == BluetoothProfile.CONNECTION_POLICY_ALLOWED)) { if (setHeadset && hfpSupported) { Log.i(TAG, "setActiveDevice: Setting active Headset " + device); mHeadsetService.setActiveDevice(device); } Loading framework/java/android/bluetooth/BluetoothAdapter.java +3 −1 Original line number Diff line number Diff line Loading @@ -2375,7 +2375,9 @@ public final class BluetoothAdapter { } /** * Sets device as the active devices for the profiles passed into the function * Sets device as the active devices for the use cases passed into the function. Note that in * order to make a device active for LE Audio, it must be the active device for audio and * phone calls. * * @param device is the remote bluetooth device * @param profiles represents the purpose for which we are setting this as the active device. Loading Loading
android/app/src/com/android/bluetooth/btservice/AdapterService.java +14 −9 Original line number Diff line number Diff line Loading @@ -5288,7 +5288,7 @@ public class AdapterService extends Service { } /** * Sets device as the active devices for the profiles passed into the function * Sets device as the active devices for the profiles passed into the function. * * @param device is the remote bluetooth device * @param profiles is a constant that references for which profiles we'll be setting the remote Loading Loading @@ -5322,9 +5322,18 @@ public class AdapterService extends Service { return false; } if (mLeAudioService != null && (device == null boolean a2dpSupported = mA2dpService != null && (device == null || mA2dpService.getConnectionPolicy(device) == BluetoothProfile.CONNECTION_POLICY_ALLOWED); boolean hfpSupported = mHeadsetService != null && (device == null || mHeadsetService.getConnectionPolicy(device) == BluetoothProfile.CONNECTION_POLICY_ALLOWED); boolean leAudioSupported = mLeAudioService != null && (device == null || mLeAudioService.getConnectionPolicy(device) == BluetoothProfile.CONNECTION_POLICY_ALLOWED)) { == BluetoothProfile.CONNECTION_POLICY_ALLOWED); if (leAudioSupported) { Log.i(TAG, "setActiveDevice: Setting active Le Audio device " + device); if (device == null) { mLeAudioService.removeActiveDevice(false); Loading @@ -5333,9 +5342,7 @@ public class AdapterService extends Service { } } if (setA2dp && mA2dpService != null && (device == null || mA2dpService.getConnectionPolicy(device) == BluetoothProfile.CONNECTION_POLICY_ALLOWED)) { if (setA2dp && a2dpSupported) { Log.i(TAG, "setActiveDevice: Setting active A2dp device " + device); if (device == null) { mA2dpService.removeActiveDevice(false); Loading @@ -5351,9 +5358,7 @@ public class AdapterService extends Service { mHearingAidService.setActiveDevice(device); } if (setHeadset && mHeadsetService != null && (device == null || mHeadsetService.getConnectionPolicy(device) == BluetoothProfile.CONNECTION_POLICY_ALLOWED)) { if (setHeadset && hfpSupported) { Log.i(TAG, "setActiveDevice: Setting active Headset " + device); mHeadsetService.setActiveDevice(device); } Loading
framework/java/android/bluetooth/BluetoothAdapter.java +3 −1 Original line number Diff line number Diff line Loading @@ -2375,7 +2375,9 @@ public final class BluetoothAdapter { } /** * Sets device as the active devices for the profiles passed into the function * Sets device as the active devices for the use cases passed into the function. Note that in * order to make a device active for LE Audio, it must be the active device for audio and * phone calls. * * @param device is the remote bluetooth device * @param profiles represents the purpose for which we are setting this as the active device. Loading