Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cd5a8483 authored by Alice Kuo's avatar Alice Kuo
Browse files

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
parent 73a065a4
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -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()) {