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

Commit 06e4fec5 authored by Eric Laurent's avatar Eric Laurent Committed by Android (Google) Code Review
Browse files

Merge "AudioDeviceInventory: protect from null BT identity address" into 24D1-dev

parents 931000e0 bbab0b18
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -983,9 +983,9 @@ public class AudioDeviceInventory {
                    }
                    if (di.mPeerDeviceAddress.equals("")) {
                        for (Pair<String, String> addr : addresses) {
                            if (!addr.first.equals(di.mDeviceAddress)) {
                                di.mPeerDeviceAddress = addr.first;
                                di.mPeerIdentityDeviceAddress = addr.second;
                            if (!di.mDeviceAddress.equals(addr.first)) {
                                di.mPeerDeviceAddress = TextUtils.emptyIfNull(addr.first);
                                di.mPeerIdentityDeviceAddress = TextUtils.emptyIfNull(addr.second);
                                break;
                            }
                        }
@@ -996,8 +996,8 @@ public class AudioDeviceInventory {
                    }
                    if (di.mDeviceIdentityAddress.equals("")) {
                        for (Pair<String, String> addr : addresses) {
                            if (addr.first.equals(di.mDeviceAddress)) {
                                di.mDeviceIdentityAddress = addr.second;
                            if (di.mDeviceAddress.equals(addr.first)) {
                                di.mDeviceIdentityAddress = TextUtils.emptyIfNull(addr.second);
                                break;
                            }
                        }
+6 −0
Original line number Diff line number Diff line
@@ -1116,6 +1116,12 @@ public class BtHelper {
        return mLeAudio.getGroupId(device);
    }

    /**
     * Returns all addresses and identity addresses for LE Audio devices a group.
     * @param groupId The ID of the group from which to get addresses.
     * @return A List of Pair(String main_address, String identity_address). Note that the
     * addresses returned by BluetoothDevice can be null.
     */
    /*package*/ List<Pair<String, String>> getLeAudioGroupAddresses(int groupId) {
        List<Pair<String, String>> addresses = new ArrayList<>();
        BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();