Merge "Fix the device summary shown twice issue" am: 0a80b6a3bc am: 0f423ebc5e am: 1ae038a2c5 am: 71f740a1c1

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

Change-Id: I2086c5d854b326e8bdf21584b69d02321f9406a9
This commit is contained in:
Treehugger Robot
2021-10-05 13:24:37 +00:00
committed by Automerger Merge Worker

View File

@@ -139,14 +139,14 @@ public class CachedBluetoothDeviceManager {
*/
public synchronized String getSubDeviceSummary(CachedBluetoothDevice device) {
final Set<CachedBluetoothDevice> memberDevices = device.getMemberDevice();
if (memberDevices != null) {
// TODO: check the CSIP group size instead of the real member device set size, and adjust
// the size restriction.
if (memberDevices.size() == 1) {
for (CachedBluetoothDevice memberDevice : memberDevices) {
if (!memberDevice.isConnected()) {
return null;
if (memberDevice.isConnected()) {
return memberDevice.getConnectionSummary();
}
}
return device.getConnectionSummary();
}
CachedBluetoothDevice subDevice = device.getSubDevice();
if (subDevice != null && subDevice.isConnected()) {