Merge "Add hearing aid information in CachedBluetoothDevice.toString()" into main
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java
index c2c82b3..b8624fd 100644
--- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java
+++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java
@@ -1029,15 +1029,17 @@
@Override
public String toString() {
- return "CachedBluetoothDevice{"
- + "anonymizedAddress="
- + mDevice.getAnonymizedAddress()
- + ", name="
- + getName()
- + ", groupId="
- + mGroupId
- + ", member=" + mMemberDevices
- + "}";
+ StringBuilder builder = new StringBuilder("CachedBluetoothDevice{");
+ builder.append("anonymizedAddress=").append(mDevice.getAnonymizedAddress());
+ builder.append(", name=").append(getName());
+ builder.append(", groupId=").append(mGroupId);
+ builder.append(", member=").append(mMemberDevices);
+ if (isHearingAidDevice()) {
+ builder.append(", hearingAidInfo=").append(mHearingAidInfo);
+ builder.append(", subDevice=").append(mSubDevice);
+ }
+ builder.append("}");
+ return builder.toString();
}
@Override