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

Commit 513ddff8 authored by Alex Dadukin's avatar Alex Dadukin
Browse files

Inlined proxy methods to add different BT Profile devices

Bug: b/255495104
Test: atest SystemMediaRouter2Test
Change-Id: Icb081e6d7b0e31a7622de1a631bf0c3ab9fca253
parent a19d0b80
Loading
Loading
Loading
Loading
+10 −17
Original line number Diff line number Diff line
@@ -414,21 +414,6 @@ class BluetoothRouteProvider {
            }
        }
    }
    private void addActiveHearingAidDevices(BluetoothDevice device) {
        if (DEBUG) {
            Log.d(TAG, "Setting active hearing aid devices. device=" + device);
        }

        addActiveDevices(device);
    }

    private void addActiveLeAudioDevices(BluetoothDevice device) {
        if (DEBUG) {
            Log.d(TAG, "Setting active le audio devices. device=" + device);
        }

        addActiveDevices(device);
    }

    interface BluetoothRoutesUpdatedListener {
        void onBluetoothRoutesUpdated(@NonNull List<MediaRoute2Info> routes);
@@ -542,14 +527,22 @@ class BluetoothRouteProvider {
                case BluetoothHearingAid.ACTION_ACTIVE_DEVICE_CHANGED:
                    clearActiveRoutesWithType(MediaRoute2Info.TYPE_HEARING_AID);
                    if (device != null) {
                        addActiveHearingAidDevices(device);
                        if (DEBUG) {
                            Log.d(TAG, "Setting active hearing aid devices. device=" + device);
                        }

                        addActiveDevices(device);
                    }
                    notifyBluetoothRoutesUpdated();
                    break;
                case BluetoothLeAudio.ACTION_LE_AUDIO_ACTIVE_DEVICE_CHANGED:
                    clearActiveRoutesWithType(MediaRoute2Info.TYPE_BLE_HEADSET);
                    if (device != null) {
                        addActiveLeAudioDevices(device);
                        if (DEBUG) {
                            Log.d(TAG, "Setting active le audio devices. device=" + device);
                        }

                        addActiveDevices(device);
                    }
                    notifyBluetoothRoutesUpdated();
                    break;