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

Commit f571b16b authored by Kyeongkab.Nam's avatar Kyeongkab.Nam Committed by android-build-merger
Browse files

Merge "Fix equals API bug on TvTrackInfo" am: 609ac6fe am: c6d3763f am: 01ffb2b2

am: c35ff0f3

Change-Id: Idf26ba1eaaa16e41d36f624f44a832b1e5879b2c
parents 07825ae0 c35ff0f3
Loading
Loading
Loading
Loading
+24 −16
Original line number Diff line number Diff line
@@ -285,20 +285,28 @@ public final class TvTrackInfo implements Parcelable {
        }

        TvTrackInfo obj = (TvTrackInfo) o;
        return 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)
                && (mType == TYPE_AUDIO
                        ? mAudioChannelCount == obj.mAudioChannelCount
                        && mAudioSampleRate == obj.mAudioSampleRate
                        : (mType == TYPE_VIDEO
                                ? mVideoWidth == obj.mVideoWidth

        if (!TextUtils.equals(mId, obj.mId) || mType != obj.mType
                || !TextUtils.equals(mLanguage, obj.mLanguage)
                || !TextUtils.equals(mDescription, obj.mDescription)
                || !Objects.equals(mExtra, obj.mExtra)) {
            return false;
        }

        switch (mType) {
            case TYPE_AUDIO:
                return mAudioChannelCount == obj.mAudioChannelCount
                        && mAudioSampleRate == obj.mAudioSampleRate;

            case TYPE_VIDEO:
                return mVideoWidth == obj.mVideoWidth
                        && mVideoHeight == obj.mVideoHeight
                        && mVideoFrameRate == obj.mVideoFrameRate
                                && mVideoPixelAspectRatio == obj.mVideoPixelAspectRatio : true));
                        && mVideoPixelAspectRatio == obj.mVideoPixelAspectRatio
                        && mVideoActiveFormatDescription == obj.mVideoActiveFormatDescription;
        }

        return true;
    }

    @Override