Fix AudioVolumeGroup equality check

Strings should be compared with String.equals, not with ==

Bug: 255429175
Test: atest android.media.audio.cts.VolumeInfoTest
Change-Id: I5d1d487a721f4de177dc9b50f37daf1c8861666b
This commit is contained in:
Jean-Michel Trivi
2022-12-08 23:29:04 +00:00
parent e66e4c201c
commit d2eaa1eb6d

View File

@@ -51,7 +51,7 @@ public final class AudioVolumeGroup implements Parcelable {
/**
* human-readable name of this volume group.
*/
private final String mName;
private final @NonNull String mName;
private final AudioAttributes[] mAudioAttributes;
private int[] mLegacyStreamTypes;
@@ -113,7 +113,7 @@ public final class AudioVolumeGroup implements Parcelable {
AudioVolumeGroup thatAvg = (AudioVolumeGroup) o;
return mName == thatAvg.mName && mId == thatAvg.mId
return mName.equals(thatAvg.mName) && mId == thatAvg.mId
&& Arrays.equals(mAudioAttributes, thatAvg.mAudioAttributes);
}