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

Commit 00ca2c40 authored by Ravi Shankar Reddy Bommana's avatar Ravi Shankar Reddy Bommana Committed by Android (Google) Code Review
Browse files

Merge "Add getConnectableDevices() to read BLE devices" into main

parents 9f06018b 88d7041c
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
    */