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

Commit f63d7368 authored by Yiyi Shen's avatar Yiyi Shen
Browse files

Add util method to check for active lea device.

Test: manual
Bug: 305620450
Change-Id: I2eac44fed0b960a6c141fe52e99caf1ec498cb8e
parent a3ba8f1f
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -594,6 +594,16 @@ public class BluetoothUtils {
                || cachedDevice.isActiveDevice(BluetoothProfile.LE_AUDIO);
    }

    /**
     * Check if the Bluetooth device is an active LE Audio device
     *
     * @param cachedDevice the CachedBluetoothDevice
     * @return if the Bluetooth device is an active LE Audio device
     */
    public static boolean isActiveLeAudioDevice(CachedBluetoothDevice cachedDevice) {
        return cachedDevice.isActiveDevice(BluetoothProfile.LE_AUDIO);
    }

    private static boolean isDeviceConnected(CachedBluetoothDevice cachedDevice) {
        if (cachedDevice == null) {
            return false;