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

Commit 588bd34f authored by Ze Li's avatar Ze Li Committed by Android (Google) Code Review
Browse files

Merge "[Audiosharing] Update BluetoothUtils#isAudioSharingEnabled to handle...

Merge "[Audiosharing] Update BluetoothUtils#isAudioSharingEnabled to handle the case where LE is on but no bluetooth service" into main
parents 7d0f3c90 705aeb2d
Loading
Loading
Loading
Loading
+10 −5
Original line number Diff line number Diff line
@@ -534,11 +534,16 @@ public class BluetoothUtils {
    /** Returns if the le audio sharing is enabled. */
    public static boolean isAudioSharingEnabled() {
        BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
        try {
            return Flags.enableLeAudioSharing()
                    && adapter.isLeAudioBroadcastSourceSupported()
                            == BluetoothStatusCodes.FEATURE_SUPPORTED
                    && adapter.isLeAudioBroadcastAssistantSupported()
                            == BluetoothStatusCodes.FEATURE_SUPPORTED;
        } catch (IllegalStateException e) {
            Log.d(TAG, "LE state is on, but there is no bluetooth service.", e);
            return false;
        }
    }

    /** Returns if the broadcast is on-going. */