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
Merged-In: I01e0ec91e5c856481318d6435d174b5a2018d820
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 0dd2054..86c80c3 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -1912,6 +1912,8 @@
     <string name="device_details_title">Device details</string>
     <!-- Title of the item to show device MAC address -->
     <string name="bluetooth_device_mac_address">Device\'s Bluetooth address: <xliff:g id="address">%1$s</xliff:g></string>
+    <!-- Title of the items to show multuple devices MAC address [CHAR LIMIT=NONE]-->
+    <string name="bluetooth_multuple_devices_mac_address">Device\'s Bluetooth address:\n<xliff:g id="address">%1$s</xliff:g></string>
     <!-- Bluetooth device details. The title of a confirmation dialog for unpairing a paired device. [CHAR LIMIT=60] -->
     <string name="bluetooth_unpair_dialog_title">Forget device?</string>
     <!-- Content Description for companion device app associations removal button [CHAR LIMIT=28]-->
diff --git a/src/com/android/settings/bluetooth/BluetoothDetailsMacAddressController.java b/src/com/android/settings/bluetooth/BluetoothDetailsMacAddressController.java
index dda247e..c5f8453 100644
--- a/src/com/android/settings/bluetooth/BluetoothDetailsMacAddressController.java
+++ b/src/com/android/settings/bluetooth/BluetoothDetailsMacAddressController.java
@@ -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 @@
 
     @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