diff options
author | Jack He <siyuanh@google.com> | 2022-04-24 19:02:37 -0700 |
---|---|---|
committer | Jack He <siyuanh@google.com> | 2022-04-28 01:28:14 +0000 |
commit | 771724d4575abe529b6bd1a071e3289f14d3d77a (patch) | |
tree | 4f3fd5cb599be1eb0984988d399f949596e9b299 /framework/java/android/bluetooth/BluetoothLeBroadcastMetadata.java | |
parent | 376819760a772a3fdf299811aad92988db6c1f8a (diff) |
BASS: Fix BASS client service to pass CTS tests
* Through NullPointerException when asserting on non-null arguments
* Invoke error callback when sink device is not connected
* Assert on parameter value at binder client side
* Clear binder identity when checking DeviceConfig values
Test: atest CtsBluetoothTestCases
Bug: 229790402
Fixes: 229790402
Ignore-AOSP-First: Fixing CTS tests on T
Change-Id: Ie19cf24d2fe20948494643f3ce179d1a2c3a290f
Merged-In: Ie19cf24d2fe20948494643f3ce179d1a2c3a290f
(cherry picked from commit 9d0518ee6515bf0aeccdbd428485e7bd38f68f0b)
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. * |