Merge "[Bluetooth] Add profiles to the bluetooth devices dump." into udc-dev am: d770742187

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23263896

Change-Id: I24faf0f9fc5d93dd72d776973b59f861d427a09f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Treehugger Robot
2023-05-17 16:38:01 +00:00
committed by Automerger Merge Worker

View File

@@ -157,6 +157,7 @@ public class BluetoothControllerImpl implements BluetoothController, BluetoothCa
private String getDeviceString(CachedBluetoothDevice device) {
return device.getName()
+ " profiles=" + getDeviceProfilesString(device)
+ " connected=" + device.isConnected()
+ " active[A2DP]=" + device.isActiveDevice(BluetoothProfile.A2DP)
+ " active[HEADSET]=" + device.isActiveDevice(BluetoothProfile.HEADSET)
@@ -164,6 +165,14 @@ public class BluetoothControllerImpl implements BluetoothController, BluetoothCa
+ " active[LE_AUDIO]=" + device.isActiveDevice(BluetoothProfile.LE_AUDIO);
}
private String getDeviceProfilesString(CachedBluetoothDevice device) {
List<String> profileIds = new ArrayList<>();
for (LocalBluetoothProfile profile : device.getProfiles()) {
profileIds.add(String.valueOf(profile.getProfileId()));
}
return "[" + String.join(",", profileIds) + "]";
}
@Override
public List<CachedBluetoothDevice> getConnectedDevices() {
List<CachedBluetoothDevice> out;