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

Commit dd4535d8 authored by Marvin Ramin's avatar Marvin Ramin
Browse files

Flag equals/hashCode changes in AudioMix

Bug: 328173922
Test: atest AudioMixTest
Change-Id: Ifba8672a61e7ee456365bfce66379e2de5031f43
(cherry picked from commit a96eaff7)
parent 72e3fbec
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -275,18 +275,24 @@ public class AudioMix implements Parcelable {
        if (o == null || getClass() != o.getClass()) return false;

        final AudioMix that = (AudioMix) o;
        boolean tokenMatch = android.media.audiopolicy.Flags.audioMixOwnership()
                ? Objects.equals(this.mToken, that.mToken)
                : true;
        return Objects.equals(this.mRouteFlags, that.mRouteFlags)
            && Objects.equals(this.mRule, that.mRule)
            && Objects.equals(this.mMixType, that.mMixType)
            && Objects.equals(this.mFormat, that.mFormat)
            && Objects.equals(this.mToken, that.mToken);
            && tokenMatch;
    }

    /** @hide */
    @Override
    public int hashCode() {
        if (android.media.audiopolicy.Flags.audioMixOwnership()) {
            return Objects.hash(mRouteFlags, mRule, mMixType, mFormat, mToken);
        }
        return Objects.hash(mRouteFlags, mRule, mMixType, mFormat);
    }

    @Override
    public int describeContents() {