package androidx.media3.exoplayer.offline; import androidx.media3.common.util.Assertions; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /* loaded from: classes2.dex */ public final class Download { public static final int FAILURE_REASON_NONE = 0; public static final int FAILURE_REASON_UNKNOWN = 1; public static final int STATE_COMPLETED = 3; public static final int STATE_DOWNLOADING = 2; public static final int STATE_FAILED = 4; public static final int STATE_QUEUED = 0; public static final int STATE_REMOVING = 5; public static final int STATE_RESTARTING = 7; public static final int STATE_STOPPED = 1; public static final int STOP_REASON_NONE = 0; public final long contentLength; public final int failureReason; final DownloadProgress progress; public final DownloadRequest request; public final long startTimeMs; public final int state; public final int stopReason; public final long updateTimeMs; @Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.LOCAL_VARIABLE, ElementType.TYPE_USE}) @Documented @Retention(RetentionPolicy.SOURCE) /* loaded from: classes2.dex */ public @interface FailureReason { } @Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.LOCAL_VARIABLE, ElementType.TYPE_USE}) @Documented @Retention(RetentionPolicy.SOURCE) /* loaded from: classes2.dex */ public @interface State { } public boolean isTerminalState() { int i = this.state; return i == 3 || i == 4; } public Download(DownloadRequest downloadRequest, int i, long j, long j2, long j3, int i2, int i3) { this(downloadRequest, i, j, j2, j3, i2, i3, new DownloadProgress()); } public Download(DownloadRequest downloadRequest, int i, long j, long j2, long j3, int i2, int i3, DownloadProgress downloadProgress) { Assertions.checkNotNull(downloadProgress); Assertions.checkArgument((i3 == 0) == (i != 4)); if (i2 != 0) { Assertions.checkArgument((i == 2 || i == 0) ? false : true); } this.request = downloadRequest; this.state = i; this.startTimeMs = j; this.updateTimeMs = j2; this.contentLength = j3; this.stopReason = i2; this.failureReason = i3; this.progress = downloadProgress; } public long getBytesDownloaded() { return this.progress.bytesDownloaded; } public float getPercentDownloaded() { return this.progress.percentDownloaded; } }