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

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

Merge "le_audio: Use broadcast device for broadcasting usecase" into tm-dev am: 61b1cf41

parents 7a75035d 61b1cf41
Loading
Loading
Loading
Loading
+14 −4
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@ import android.media.BluetoothProfileConnectionInfo;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.Looper;
import android.os.Parcel;
import android.os.ParcelUuid;
import android.os.RemoteCallbackList;
import android.os.RemoteException;
@@ -980,6 +981,17 @@ public class LeAudioService extends ProfileService {
        }
    }

    BluetoothProfileConnectionInfo getBroadcastProfile(boolean suppressNoisyIntent) {
        Parcel parcel = Parcel.obtain();
        parcel.writeInt(BluetoothProfile.LE_AUDIO_BROADCAST);
        parcel.writeBoolean(suppressNoisyIntent);
        parcel.writeInt(-1 /* mVolume */);
        parcel.writeBoolean(true /* mIsLeOutput */);
        parcel.setDataPosition(0);

        return BluetoothProfileConnectionInfo.CREATOR.createFromParcel(parcel);
    }

    // Suppressed since this is part of a local process
    @SuppressLint("AndroidFrameworkRequiresPermission")
    void messageFromNative(LeAudioStackEvent stackEvent) {
@@ -1178,8 +1190,7 @@ public class LeAudioService extends ProfileService {
                        mActiveAudioOutDevice = null;
                        mAudioManager.handleBluetoothActiveDeviceChanged(mActiveAudioOutDevice,
                                previousDevice,
                                // TODO: implement createLeAudioBroadcastInfo()
                                BluetoothProfileConnectionInfo.createLeAudioInfo(false, true));
                                getBroadcastProfile(true));
                    }
                }

@@ -1217,8 +1228,7 @@ public class LeAudioService extends ProfileService {
                        mActiveAudioOutDevice = device;
                        mAudioManager.handleBluetoothActiveDeviceChanged(mActiveAudioOutDevice,
                                previousDevice,
                                // TODO: implement createLeAudioBroadcastInfo()
                                BluetoothProfileConnectionInfo.createLeAudioInfo(true, true));
                                getBroadcastProfile(false));
                    }
                }
            }