Merge "Fix equals and hashCode APIs on TvTrackInfo"
This commit is contained in:
@@ -352,8 +352,7 @@ public final class TvTrackInfo implements Parcelable {
|
|||||||
if (!TextUtils.equals(mId, obj.mId) || mType != obj.mType
|
if (!TextUtils.equals(mId, obj.mId) || mType != obj.mType
|
||||||
|| !TextUtils.equals(mLanguage, obj.mLanguage)
|
|| !TextUtils.equals(mLanguage, obj.mLanguage)
|
||||||
|| !TextUtils.equals(mDescription, obj.mDescription)
|
|| !TextUtils.equals(mDescription, obj.mDescription)
|
||||||
|| mEncrypted != obj.mEncrypted
|
|| mEncrypted != obj.mEncrypted) {
|
||||||
|| !Objects.equals(mExtra, obj.mExtra)) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -381,7 +380,16 @@ public final class TvTrackInfo implements Parcelable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
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 =
|
public static final @android.annotation.NonNull Parcelable.Creator<TvTrackInfo> CREATOR =
|
||||||
|
|||||||
Reference in New Issue
Block a user