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

Commit d59a9d3d authored by Eric Laurent's avatar Eric Laurent Committed by Automerger Merge Worker
Browse files

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

parents 141b787e 06e4fec5
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -987,9 +987,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;
                            }
                        }
@@ -1000,8 +1000,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
@@ -1110,6 +1110,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();