summaryrefslogtreecommitdiff
path: root/framework/java/android/bluetooth/BluetoothLeAudioCodecConfigMetadata.java
diff options
context:
space:
mode:
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothLeAudioCodecConfigMetadata.java')
-rw-r--r--framework/java/android/bluetooth/BluetoothLeAudioCodecConfigMetadata.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/framework/java/android/bluetooth/BluetoothLeAudioCodecConfigMetadata.java b/framework/java/android/bluetooth/BluetoothLeAudioCodecConfigMetadata.java
index 9881ec2067..4e6fd7f350 100644
--- a/framework/java/android/bluetooth/BluetoothLeAudioCodecConfigMetadata.java
+++ b/framework/java/android/bluetooth/BluetoothLeAudioCodecConfigMetadata.java
@@ -17,6 +17,7 @@
package android.bluetooth;
import android.annotation.NonNull;
+import android.annotation.Nullable;
import android.annotation.SystemApi;
import android.bluetooth.BluetoothUtils.TypeValueEntry;
import android.os.Parcel;
@@ -24,7 +25,9 @@ import android.os.Parcelable;
import java.nio.ByteBuffer;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
+import java.util.Objects;
/**
* 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;
}
+ @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
* Assigned numbers.