package androidx.media3.common; import android.os.Bundle; import androidx.media3.common.Bundleable; import androidx.media3.common.util.Assertions; import androidx.media3.common.util.Util; import com.google.common.collect.ImmutableList; import com.google.common.primitives.Ints; import java.util.Collection; import java.util.Collections; import java.util.List; /* loaded from: classes2.dex */ public final class TrackSelectionOverride implements Bundleable { public final TrackGroup mediaTrackGroup; public final ImmutableList trackIndices; private static final String FIELD_TRACK_GROUP = Util.intToStringMaxRadix(0); private static final String FIELD_TRACKS = Util.intToStringMaxRadix(1); public static final Bundleable.Creator CREATOR = new Bundleable.Creator() { // from class: androidx.media3.common.TrackSelectionOverride$$ExternalSyntheticLambda0 @Override // androidx.media3.common.Bundleable.Creator public final Bundleable fromBundle(Bundle bundle) { return TrackSelectionOverride.lambda$static$0(bundle); } }; public TrackSelectionOverride(TrackGroup trackGroup, int i) { this(trackGroup, ImmutableList.of(Integer.valueOf(i))); } public TrackSelectionOverride(TrackGroup trackGroup, List list) { if (!list.isEmpty() && (((Integer) Collections.min(list)).intValue() < 0 || ((Integer) Collections.max(list)).intValue() >= trackGroup.length)) { throw new IndexOutOfBoundsException(); } this.mediaTrackGroup = trackGroup; this.trackIndices = ImmutableList.copyOf((Collection) list); } public int getType() { return this.mediaTrackGroup.type; } public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } TrackSelectionOverride trackSelectionOverride = (TrackSelectionOverride) obj; return this.mediaTrackGroup.equals(trackSelectionOverride.mediaTrackGroup) && this.trackIndices.equals(trackSelectionOverride.trackIndices); } public int hashCode() { return this.mediaTrackGroup.hashCode() + (this.trackIndices.hashCode() * 31); } @Override // androidx.media3.common.Bundleable public Bundle toBundle() { Bundle bundle = new Bundle(); bundle.putBundle(FIELD_TRACK_GROUP, this.mediaTrackGroup.toBundle()); bundle.putIntArray(FIELD_TRACKS, Ints.toArray(this.trackIndices)); return bundle; } /* JADX INFO: Access modifiers changed from: package-private */ public static /* synthetic */ TrackSelectionOverride lambda$static$0(Bundle bundle) { return new TrackSelectionOverride(TrackGroup.CREATOR.fromBundle((Bundle) Assertions.checkNotNull(bundle.getBundle(FIELD_TRACK_GROUP))), Ints.asList((int[]) Assertions.checkNotNull(bundle.getIntArray(FIELD_TRACKS)))); } }