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

Commit 11a60a9a authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Fix equals and hashCode APIs on TvTrackInfo" am: 2e8d16f7 am: 7e6df336 am: 08c064c6

Change-Id: Id27dbd4cca87a6f96fed5dfe078419d4f720bd20
parents d2be79c1 08c064c6
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -353,8 +353,7 @@ public final class TvTrackInfo implements Parcelable {
        if (!TextUtils.equals(mId, obj.mId) || mType != obj.mType
                || !TextUtils.equals(mLanguage, obj.mLanguage)
                || !TextUtils.equals(mDescription, obj.mDescription)
                || mEncrypted != obj.mEncrypted
                || !Objects.equals(mExtra, obj.mExtra)) {
                || mEncrypted != obj.mEncrypted) {
            return false;
        }

@@ -382,7 +381,16 @@ public final class TvTrackInfo implements Parcelable {

    @Override
    public int hashCode() {
        return Objects.hashCode(mId);
        int result = Objects.hash(mId, mType, mLanguage, mDescription);

        if (mType == TYPE_AUDIO) {
            result = Objects.hash(result, mAudioChannelCount, mAudioSampleRate);
        } else if (mType == TYPE_VIDEO) {
            result = Objects.hash(result, mVideoWidth, mVideoHeight, mVideoFrameRate,
                    mVideoPixelAspectRatio);
        }

        return result;
    }

    public static final @android.annotation.NonNull Parcelable.Creator<TvTrackInfo> CREATOR =