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

Commit 95f5c17c authored by William Escande's avatar William Escande Committed by Automerger Merge Worker
Browse files

Merge "Implement Equals and Hash for BluetoothLeAudioCodecConfigMetadata" into...

Merge "Implement Equals and Hash for BluetoothLeAudioCodecConfigMetadata" into tm-dev am: a0e68f6f

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



Change-Id: I591d8f168f892261520169abeb39b0d2cff2c37c
Ignore-AOSP-First: this is an automerge
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents bc7731ce a0e68f6f
Loading
Loading
Loading
Loading
+18 −0
Original line number Original line Diff line number Diff line
@@ -17,6 +17,7 @@
package android.bluetooth;
package android.bluetooth;


import android.annotation.NonNull;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SystemApi;
import android.annotation.SystemApi;
import android.bluetooth.BluetoothUtils.TypeValueEntry;
import android.bluetooth.BluetoothUtils.TypeValueEntry;
import android.os.Parcel;
import android.os.Parcel;
@@ -24,7 +25,9 @@ import android.os.Parcelable;


import java.nio.ByteBuffer;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.List;
import java.util.Objects;


/**
/**
 * A class representing the codec specific config metadata information defined in the Basic Audio
 * A class representing the codec specific config metadata information defined in the Basic Audio
@@ -44,6 +47,21 @@ public final class BluetoothLeAudioCodecConfigMetadata implements Parcelable {
        mRawMetadata = rawMetadata;
        mRawMetadata = rawMetadata;
    }
    }


    @Override
    public boolean equals(@Nullable Object o) {
        if (o != null && o instanceof BluetoothLeAudioCodecConfigMetadata) {
            final BluetoothLeAudioCodecConfigMetadata oth = (BluetoothLeAudioCodecConfigMetadata) o;
            return mAudioLocation == oth.getAudioLocation()
                && Arrays.equals(mRawMetadata, oth.getRawMetadata());
        }
        return false;
    }

    @Override
    public int hashCode() {
        return Objects.hash(mAudioLocation, mRawMetadata);
    }

    /**
    /**
     * Get the audio location information as defined in the Generic Audio section of Bluetooth
     * Get the audio location information as defined in the Generic Audio section of Bluetooth
     * Assigned numbers.
     * Assigned numbers.