summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Alice Kuo <aliceypkuo@google.com> 2021-10-04 18:05:57 +0800
committer Alice Kuo <aliceypkuo@google.com> 2021-10-04 10:23:20 +0000
commitcd5a8483be77bd06f3595d9d8aab2070e9f145bc (patch)
treec89e4bd281b618d49aeacfec8061b1348865a358
parent73a065a41f5ab51391f21f149eafa50dde341af1 (diff)
Fix the device summary shown twice issue
As getSubDeviceSummy, we should check the memberDevices's size and decide if the secondarySummary need to be shown. Bug: 201491295 Bug: 150670922 Test: pair with the A2DP/HFP headset, and check the summary Change-Id: I8bb0744067733c6e17292d6c7be1c3f110d731e3
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDeviceManager.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDeviceManager.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDeviceManager.java
index 02566155f1c9..1f75ae329f4a 100644
--- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDeviceManager.java
+++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDeviceManager.java
@@ -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()) {