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

Commit 33a40b47 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "BluetoothLeBroadcastMetadata: log updates" into main

parents de95de35 e28c6ad4
Loading
Loading
Loading
Loading
+46 −45
Original line number Diff line number Diff line
@@ -1505,12 +1505,10 @@ public class BassClientService extends ProfileService {
            BluetoothLeBroadcastMetadata sourceMetadata,
            boolean isGroupOp) {
        log(
                "addSource: device: "
                        + sink
                        + " sourceMetadata"
                        + sourceMetadata
                        + " isGroupOp: "
                        + isGroupOp);
                "addSource: "
                        + ("device: " + sink)
                        + (", sourceMetadata: " + sourceMetadata)
                        + (", isGroupOp: " + isGroupOp));

        List<BluetoothDevice> devices = getTargetDeviceList(sink, isGroupOp);
        // Don't coordinate it as a group if there's no group or there is one device only
@@ -1570,12 +1568,12 @@ public class BassClientService extends ProfileService {
                if (sourceId != BassConstants.INVALID_SOURCE_ID) {
                    sEventLogger.logd(
                            TAG,
                            "Switch Broadcast Source: device: "
                                    + device
                                    + ", old SourceId: "
                                    + sourceId
                                    + ", new SourceMetadata: "
                                    + sourceMetadata);
                            "Switch Broadcast Source: "
                                    + ("device: " + device)
                                    + (", old SourceId: " + sourceId)
                                    + (", new broadcastId: " + sourceMetadata.getBroadcastId())
                                    + (", new broadcastName: "
                                            + sourceMetadata.getBroadcastName()));

                    // new source will be added once the existing source got removed
                    if (isGroupOp) {
@@ -1629,12 +1627,11 @@ public class BassClientService extends ProfileService {

            sEventLogger.logd(
                    TAG,
                    "Add Broadcast Source: device: "
                            + device
                            + ", sourceMetadata: "
                            + sourceMetadata
                            + ", isGroupOp: "
                            + isGroupOp);
                    "Add Broadcast Source: "
                            + ("device: " + device)
                            + (", broadcastId: " + sourceMetadata.getBroadcastId())
                            + (", broadcastName: " + sourceMetadata.getBroadcastName())
                            + (", isGroupOp: " + isGroupOp));

            Message message = stateMachine.obtainMessage(BassClientStateMachine.ADD_BCAST_SOURCE);
            message.obj = sourceMetadata;
@@ -1642,10 +1639,10 @@ public class BassClientService extends ProfileService {
            if (code != null && code.length != 0) {
                sEventLogger.logd(
                        TAG,
                        "Set Broadcast Code (Add Source context): device: "
                                + device
                                + ", broadcastId: "
                                + sourceMetadata.getBroadcastId());
                        "Set Broadcast Code (Add Source context): "
                                + ("device: " + device)
                                + (", broadcastId: " + sourceMetadata.getBroadcastId())
                                + (", broadcastName: " + sourceMetadata.getBroadcastName()));

                message = stateMachine.obtainMessage(BassClientStateMachine.SET_BCAST_CODE);
                message.obj = sourceMetadata;
@@ -1664,7 +1661,11 @@ public class BassClientService extends ProfileService {
     */
    public void modifySource(
            BluetoothDevice sink, int sourceId, BluetoothLeBroadcastMetadata updatedMetadata) {
        log("modifySource: device: " + sink + " sourceId " + sourceId);
        log(
                "modifySource: "
                        + ("device: " + sink)
                        + ("sourceId: " + sourceId)
                        + (", updatedMetadata: " + updatedMetadata));

        Map<BluetoothDevice, Integer> devices = getGroupManagedDeviceSources(sink, sourceId).second;
        if (updatedMetadata == null) {
@@ -1695,12 +1696,11 @@ public class BassClientService extends ProfileService {

            sEventLogger.logd(
                    TAG,
                    "Modify Broadcast Source: device: "
                            + device
                            + ", sourceId: "
                            + sourceId
                            + ", updatedMetadata: "
                            + updatedMetadata);
                    "Modify Broadcast Source: "
                            + ("device: " + device)
                            + ("sourceId: " + sourceId)
                            + (", updatedBroadcastId: " + updatedMetadata.getBroadcastId())
                            + (", updatedBroadcastName: " + updatedMetadata.getBroadcastName()));

            Message message =
                    stateMachine.obtainMessage(BassClientStateMachine.UPDATE_BCAST_SOURCE);
@@ -1711,10 +1711,12 @@ public class BassClientService extends ProfileService {
            if (code != null && code.length != 0) {
                sEventLogger.logd(
                        TAG,
                        "Set Broadcast Code (Modify Source context), device: "
                                + device
                                + ", sourceId: "
                                + sourceId);
                        "Set Broadcast Code (Modify Source context): "
                                + ("device: " + device)
                                + ("sourceId: " + sourceId)
                                + (", updatedBroadcastId: " + updatedMetadata.getBroadcastId())
                                + (", updatedBroadcastName: "
                                        + updatedMetadata.getBroadcastName()));
                message = stateMachine.obtainMessage(BassClientStateMachine.SET_BCAST_CODE);
                message.obj = updatedMetadata;
                message.arg1 = BassClientStateMachine.ARGTYPE_METADATA;
@@ -1731,7 +1733,7 @@ public class BassClientService extends ProfileService {
     * @param sourceId source ID as delivered in onSourceAdded
     */
    public void removeSource(BluetoothDevice sink, int sourceId) {
        log("removeSource: device = " + sink + ", sourceId " + sourceId);
        log("removeSource: device: " + sink + ", sourceId: " + sourceId);

        Map<BluetoothDevice, Integer> devices = getGroupManagedDeviceSources(sink, sourceId).second;
        for (Map.Entry<BluetoothDevice, Integer> deviceSourceIdPair : devices.entrySet()) {
@@ -1768,10 +1770,11 @@ public class BassClientService extends ProfileService {
            if (metaData != null && stateMachine.isSyncedToTheSource(sourceId)) {
                sEventLogger.logd(
                        TAG,
                        "Remove Broadcast Source(Force lost PA sync): device: "
                                + device
                                + ", sourceId: "
                                + sourceId);
                        "Remove Broadcast Source(Force lost PA sync): "
                                + ("device: " + device)
                                + (", sourceId: " + sourceId)
                                + (", broadcastId: " + metaData.getBroadcastId())
                                + (", broadcastName: " + metaData.getBroadcastName()));

                log("Force source to lost PA sync");
                Message message = stateMachine.obtainMessage(
@@ -2159,13 +2162,11 @@ public class BassClientService extends ProfileService {

                    sEventLogger.logd(
                            TAG,
                            "Modify Broadcast Source (resume): device: "
                                    + sink
                                    + ", sourceId: "
                                    + sourceId
                                    + ", updatedMetadata: "
                                    + metadata);

                            "Modify Broadcast Source (resume): "
                                    + ("device: " + sink)
                                    + ("sourceId: " + sourceId)
                                    + (", updatedBroadcastId: " + metadata.getBroadcastId())
                                    + (", updatedBroadcastName: " + metadata.getBroadcastName()));
                    Message message =
                            stateMachine.obtainMessage(BassClientStateMachine.UPDATE_BCAST_SOURCE);
                    message.arg1 = sourceId;
+11 −1
Original line number Diff line number Diff line
@@ -29,7 +29,6 @@ import static android.bluetooth.BluetoothLeAudioCodecConfig.SAMPLE_RATE_8000;
import static android.bluetooth.BluetoothLeAudioCodecConfig.SAMPLE_RATE_NONE;
import static android.bluetooth.BluetoothLeAudioCodecConfig.SampleRate;

import android.annotation.FlaggedApi;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SystemApi;
@@ -125,6 +124,17 @@ public final class BluetoothLeAudioCodecConfigMetadata implements Parcelable {
                Arrays.hashCode(mRawMetadata));
    }

    @Override
    public String toString() {
        return "BluetoothLeAudioCodecConfigMetadata{"
                + ("audioLocation=" + mAudioLocation)
                + (", sampleRate=" + mSampleRate)
                + (", frameDuration=" + mFrameDuration)
                + (", octetsPerFrame=" + mOctetsPerFrame)
                + (", rawMetadata=" + Arrays.toString(mRawMetadata))
                + '}';
    }

    /**
     * Get the audio location information as defined in the Generic Audio section of Bluetooth
     * Assigned numbers.
+9 −0
Original line number Diff line number Diff line
@@ -69,6 +69,15 @@ public final class BluetoothLeAudioContentMetadata implements Parcelable {
        return Objects.hash(mProgramInfo, mLanguage, Arrays.hashCode(mRawMetadata));
    }

    @Override
    public String toString() {
        return "BluetoothLeAudioContentMetadata{"
                + ("programInfo=" + mProgramInfo)
                + (", language=" + mLanguage)
                + (", rawMetadata=" + Arrays.toString(mRawMetadata))
                + '}';
    }

    /**
     * Get the title and/or summary of Audio Stream content in UTF-8 format.
     *
+9 −0
Original line number Diff line number Diff line
@@ -63,6 +63,15 @@ public final class BluetoothLeBroadcastChannel implements Parcelable {
        return Objects.hash(mIsSelected, mChannelIndex, mCodecMetadata);
    }

    @Override
    public String toString() {
        return "BluetoothLeBroadcastChannel{"
                + ("isSelected=" + mIsSelected)
                + (", channelIndex=" + mChannelIndex)
                + (", codecMetadata=" + mCodecMetadata)
                + '}';
    }

    /**
     * Return true if the channel is selected by Broadcast Assistant for the Broadcast Sink.
     *
+20 −0
Original line number Diff line number Diff line
@@ -189,6 +189,26 @@ public final class BluetoothLeBroadcastMetadata implements Parcelable {
                mSubgroups);
    }

    @Override
    public String toString() {
        return "BluetoothLeBroadcastMetadata{"
                + ("sourceAddressType=" + mSourceAddressType)
                + (", sourceDevice=" + mSourceDevice)
                + (", sourceAdvertisingSid=" + mSourceAdvertisingSid)
                + (", broadcastId=" + mBroadcastId)
                + (", paSyncInterval=" + mPaSyncInterval)
                + (", isEncrypted=" + mIsEncrypted)
                + (", isPublicBroadcast=" + mIsPublicBroadcast)
                + (", broadcastName=" + mBroadcastName)
                + (", broadcastCode=" + Arrays.toString(mBroadcastCode))
                + (", presentationDelayMicros=" + mPresentationDelayMicros)
                + (", audioConfigQuality=" + mAudioConfigQuality)
                + (", rssi=" + mRssi)
                + (", publicBroadcastMetadata=" + mPublicBroadcastMetadata)
                + (", subgroups=" + mSubgroups)
                + '}';
    }

    /**
     * Get the address type of the Broadcast Source.
     *
Loading