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

Commit 88d7041c authored by Ravi Shankar Reddy's avatar Ravi Shankar Reddy
Browse files

Add getConnectableDevices() to read BLE devices

BUG: 308887992
Test: make -j50 RunSettingsLibRoboTests
Change-Id: I816a70d956851217e7914f2d10422a4ef2c8d3bf
parent 7c10e57c
Loading
Loading
Loading
Loading
+17 −5
Original line number Diff line number Diff line
@@ -126,15 +126,27 @@ public class LeAudioProfile implements LocalBluetoothProfile {
    }

    public List<BluetoothDevice> getConnectedDevices() {
        if (mService == null) {
            return new ArrayList<BluetoothDevice>(0);
        return getDevicesByStates(new int[] {
                BluetoothProfile.STATE_CONNECTED,
                BluetoothProfile.STATE_CONNECTING,
                BluetoothProfile.STATE_DISCONNECTING});
    }
        return mService.getDevicesMatchingConnectionStates(
              new int[] {BluetoothProfile.STATE_CONNECTED,

    public List<BluetoothDevice> getConnectableDevices() {
        return getDevicesByStates(new int[] {
                BluetoothProfile.STATE_DISCONNECTED,
                BluetoothProfile.STATE_CONNECTED,
                BluetoothProfile.STATE_CONNECTING,
                BluetoothProfile.STATE_DISCONNECTING});
    }

    private List<BluetoothDevice> getDevicesByStates(int[] states) {
        if (mService == null) {
            return new ArrayList<>(0);
        }
        return mService.getDevicesMatchingConnectionStates(states);
    }

    /*
    * @hide
    */