Show the multiple Mac address for the coordinated set

Show the mac address for all the devices if the device detail combine
with the multiple connections based on CSIP.

Screenshot: https://screenshot.googleplex.com/qQjc2pxNTr3tMUV

Bug: 178981521
Test: pair with the coordinated set, and check the UI
Change-Id: I01e0ec91e5c856481318d6435d174b5a2018d820
This commit is contained in:
Alice Kuo
2021-09-14 14:42:48 +08:00
parent 02cadb9b32
commit 133c2cc1cc
2 changed files with 13 additions and 1 deletions

View File

@@ -16,6 +16,7 @@
package com.android.settings.bluetooth;
import android.bluetooth.BluetoothCsipSetCoordinator;
import android.content.Context;
import androidx.preference.PreferenceFragmentCompat;
@@ -50,8 +51,17 @@ public class BluetoothDetailsMacAddressController extends BluetoothDetailsContro
@Override
protected void refresh() {
mFooterPreference.setTitle(mContext.getString(
if (mCachedDevice.getGroupId() != BluetoothCsipSetCoordinator.GROUP_ID_INVALID) {
StringBuilder mTitle = new StringBuilder(mContext.getString(
R.string.bluetooth_multuple_devices_mac_address, mCachedDevice.getAddress()));
for (CachedBluetoothDevice member: mCachedDevice.getMemberDevice()) {
mTitle.append("\n").append(member.getAddress());
}
mFooterPreference.setTitle(mTitle);
} else {
mFooterPreference.setTitle(mContext.getString(
R.string.bluetooth_device_mac_address, mCachedDevice.getAddress()));
}
}
@Override