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

Commit e725d6f3 authored by timhypeng's avatar timhypeng Committed by tim peng
Browse files

One of the HA will not be Active after switching sound path to Phone/Speaker during active call

- If first summary is unavailable, not to show second summary.

Bug: 132409181
Test: make -j42 RunSettingsRoboTests
Change-Id: I0d2e426b15dae8ed38e0a1b5a9219209e1a0026c
parent 785c024c
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.bluetooth.BluetoothDevice;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.provider.DeviceConfig;
import android.text.TextUtils;
import android.util.Pair;

import androidx.preference.PreferenceFragmentCompat;
@@ -74,10 +75,13 @@ public class BluetoothDetailsHeaderController extends BluetoothDetailsController
        final Pair<Drawable, String> pair =
                BluetoothUtils.getBtRainbowDrawableWithDescription(mContext, mCachedDevice);
        String summaryText = mCachedDevice.getConnectionSummary();
        if (TextUtils.isEmpty(summaryText)) {
            // If first summary is unavailable, not to show second summary.
            mHeaderController.setSecondSummary((CharSequence)null);
        } else {
            // If both the hearing aids are connected, two device status should be shown.
        // If Second Summary is unavailable, to set it to null.
        mHeaderController.setSecondSummary(
                mDeviceManager.getSubDeviceSummary(mCachedDevice));
            mHeaderController.setSecondSummary(mDeviceManager.getSubDeviceSummary(mCachedDevice));
        }
        mHeaderController.setLabel(mCachedDevice.getName());
        mHeaderController.setIcon(pair.first);
        mHeaderController.setIconContentDescription(pair.second);