[Bluetooth] Add profiles to the bluetooth devices dump.

BluetoothController's calculation of mAudioProfileOnly relies on what
profiles each device has, but those profiles currently aren't logged.
Logging the profiles could help us debug other bluetooth icon issues.

Bug: 278982782
Test: `adb shell dumpsys activity service
com.android.systemui/.SystemUIService BluetoothController` -> profiles
included in dump

Change-Id: I86398069662f07d94c95efc2a2244606f14a56f9
This commit is contained in:
Caitlin Shkuratov
2023-05-16 14:55:14 +00:00
parent 65f5d0b889
commit 366613fe9a

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;