diff options
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothLeBroadcastMetadata.java')
-rw-r--r-- | framework/java/android/bluetooth/BluetoothLeBroadcastMetadata.java | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/framework/java/android/bluetooth/BluetoothLeBroadcastMetadata.java b/framework/java/android/bluetooth/BluetoothLeBroadcastMetadata.java index c63061a893..b79f31e0bc 100644 --- a/framework/java/android/bluetooth/BluetoothLeBroadcastMetadata.java +++ b/framework/java/android/bluetooth/BluetoothLeBroadcastMetadata.java @@ -24,6 +24,7 @@ import android.os.Parcel; import android.os.Parcelable; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import java.util.Objects; @@ -76,6 +77,30 @@ public final class BluetoothLeBroadcastMetadata implements Parcelable { mSubgroups = subgroups; } + @Override + public boolean equals(@Nullable Object o) { + if (!(o instanceof BluetoothLeBroadcastMetadata)) { + return false; + } + final BluetoothLeBroadcastMetadata other = (BluetoothLeBroadcastMetadata) o; + return mSourceAddressType == other.getSourceAddressType() + && mSourceDevice.equals(other.getSourceDevice()) + && mSourceAdvertisingSid == other.getSourceAdvertisingSid() + && mBroadcastId == other.getBroadcastId() + && mPaSyncInterval == other.getPaSyncInterval() + && mIsEncrypted == other.isEncrypted() + && Arrays.equals(mBroadcastCode, other.getBroadcastCode()) + && mPresentationDelayMicros == other.getPresentationDelayMicros() + && mSubgroups.equals(other.getSubgroups()); + } + + @Override + public int hashCode() { + return Objects.hash(mSourceAddressType, mSourceDevice, mSourceAdvertisingSid, + mBroadcastId, mPaSyncInterval, mIsEncrypted, Arrays.hashCode(mBroadcastCode), + mPresentationDelayMicros, mSubgroups); + } + /** * Get the address type of the Broadcast Source. * |