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

Commit cc715557 authored by Jack He's avatar Jack He Committed by Automerger Merge Worker
Browse files

Merge "[le audio] Broadcast service api enforce callback check" am: 5d2398cb am: 6963c212

parents 4060a6e6 6963c212
Loading
Loading
Loading
Loading
+16 −0
Original line number Original line Diff line number Diff line
@@ -554,6 +554,9 @@ public final class BluetoothLeBroadcast implements AutoCloseable, BluetoothProfi
    public void startBroadcast(@NonNull BluetoothLeAudioContentMetadata contentMetadata,
    public void startBroadcast(@NonNull BluetoothLeAudioContentMetadata contentMetadata,
            @Nullable byte[] broadcastCode) {
            @Nullable byte[] broadcastCode) {
        Objects.requireNonNull(contentMetadata, "contentMetadata cannot be null");
        Objects.requireNonNull(contentMetadata, "contentMetadata cannot be null");
        if (mCallbackExecutorMap.isEmpty()) {
            throw new IllegalStateException("No callback was ever registered");
        }


        if (DBG) log("startBroadcasting");
        if (DBG) log("startBroadcasting");
        final IBluetoothLeAudio service = getService();
        final IBluetoothLeAudio service = getService();
@@ -593,6 +596,9 @@ public final class BluetoothLeBroadcast implements AutoCloseable, BluetoothProfi
            })
            })
    public void startBroadcast(@NonNull BluetoothLeBroadcastSettings broadcastSettings) {
    public void startBroadcast(@NonNull BluetoothLeBroadcastSettings broadcastSettings) {
        Objects.requireNonNull(broadcastSettings, "broadcastSettings cannot be null");
        Objects.requireNonNull(broadcastSettings, "broadcastSettings cannot be null");
        if (mCallbackExecutorMap.isEmpty()) {
            throw new IllegalStateException("No callback was ever registered");
        }


        if (DBG) log("startBroadcasting");
        if (DBG) log("startBroadcasting");
        final IBluetoothLeAudio service = getService();
        final IBluetoothLeAudio service = getService();
@@ -637,6 +643,9 @@ public final class BluetoothLeBroadcast implements AutoCloseable, BluetoothProfi
    public void updateBroadcast(int broadcastId,
    public void updateBroadcast(int broadcastId,
            @NonNull BluetoothLeAudioContentMetadata contentMetadata) {
            @NonNull BluetoothLeAudioContentMetadata contentMetadata) {
        Objects.requireNonNull(contentMetadata, "contentMetadata cannot be null");
        Objects.requireNonNull(contentMetadata, "contentMetadata cannot be null");
        if (mCallbackExecutorMap.isEmpty()) {
            throw new IllegalStateException("No callback was ever registered");
        }


        if (DBG) log("updateBroadcast");
        if (DBG) log("updateBroadcast");
        final IBluetoothLeAudio service = getService();
        final IBluetoothLeAudio service = getService();
@@ -682,6 +691,9 @@ public final class BluetoothLeBroadcast implements AutoCloseable, BluetoothProfi
    public void updateBroadcast(
    public void updateBroadcast(
            int broadcastId, @NonNull BluetoothLeBroadcastSettings broadcastSettings) {
            int broadcastId, @NonNull BluetoothLeBroadcastSettings broadcastSettings) {
        Objects.requireNonNull(broadcastSettings, "broadcastSettings cannot be null");
        Objects.requireNonNull(broadcastSettings, "broadcastSettings cannot be null");
        if (mCallbackExecutorMap.isEmpty()) {
            throw new IllegalStateException("No callback was ever registered");
        }


        if (DBG) log("updateBroadcast");
        if (DBG) log("updateBroadcast");
        final IBluetoothLeAudio service = getService();
        final IBluetoothLeAudio service = getService();
@@ -721,6 +733,10 @@ public final class BluetoothLeBroadcast implements AutoCloseable, BluetoothProfi
            android.Manifest.permission.BLUETOOTH_PRIVILEGED,
            android.Manifest.permission.BLUETOOTH_PRIVILEGED,
    })
    })
    public void stopBroadcast(int broadcastId) {
    public void stopBroadcast(int broadcastId) {
        if (mCallbackExecutorMap.isEmpty()) {
            throw new IllegalStateException("No callback was ever registered");
        }

        if (DBG) log("disableBroadcastMode");
        if (DBG) log("disableBroadcastMode");
        final IBluetoothLeAudio service = getService();
        final IBluetoothLeAudio service = getService();
        if (service == null) {
        if (service == null) {