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

Commit e56dbe62 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...

Merge "[le audio] Broadcast service api enforce callback check" am: 5d2398cb am: 6963c212 am: cc715557 am: 0fdfd3e3 am: 88f4e700 am: cce65284

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/2579277



Change-Id: If4e6f9c44ee6848586900625912ede337b2caebc
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 0f7111a7 cce65284
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -554,6 +554,9 @@ public final class BluetoothLeBroadcast implements AutoCloseable, BluetoothProfi
    public void startBroadcast(@NonNull BluetoothLeAudioContentMetadata contentMetadata,
            @Nullable byte[] broadcastCode) {
        Objects.requireNonNull(contentMetadata, "contentMetadata cannot be null");
        if (mCallbackExecutorMap.isEmpty()) {
            throw new IllegalStateException("No callback was ever registered");
        }

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

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

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

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

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