package com.vungle.ads.internal.downloader; import com.vungle.ads.AnalyticsClient; import com.vungle.ads.TimeIntervalMetric; import com.vungle.ads.internal.Constants; import com.vungle.ads.internal.model.AdAsset; import com.vungle.ads.internal.model.AdPayload; import com.vungle.ads.internal.protos.Sdk; import java.util.concurrent.atomic.AtomicBoolean; import kotlin.jvm.internal.DefaultConstructorMarker; import kotlin.jvm.internal.Intrinsics; /* loaded from: classes4.dex */ public final class DownloadRequest { private final AdAsset asset; private final AtomicBoolean cancelled; private final String creativeId; private TimeIntervalMetric downloadDuration; private final String eventId; private final String placementId; private final Priority priority; public final AdAsset getAsset() { return this.asset; } public final String getCreativeId() { return this.creativeId; } public final String getEventId() { return this.eventId; } public final String getPlacementId() { return this.placementId; } /* renamed from: getPriority, reason: collision with other method in class */ public final Priority m3884getPriority() { return this.priority; } public DownloadRequest(Priority priority, AdAsset asset, String str, String str2, String str3) { Intrinsics.checkNotNullParameter(priority, "priority"); Intrinsics.checkNotNullParameter(asset, "asset"); this.priority = priority; this.asset = asset; this.placementId = str; this.creativeId = str2; this.eventId = str3; this.cancelled = new AtomicBoolean(false); } public /* synthetic */ DownloadRequest(Priority priority, AdAsset adAsset, String str, String str2, String str3, int i, DefaultConstructorMarker defaultConstructorMarker) { this(priority, adAsset, (i & 4) != 0 ? null : str, (i & 8) != 0 ? null : str2, (i & 16) != 0 ? null : str3); } public final boolean isTemplate() { return this.asset.getFileType() == AdAsset.FileType.ZIP || isHtmlTemplate(); } public final boolean isHtmlTemplate() { return Intrinsics.areEqual(this.asset.getAdIdentifier(), AdPayload.KEY_VM); } public final boolean isMainVideo() { return Intrinsics.areEqual(this.asset.getAdIdentifier(), Constants.KEY_MAIN_VIDEO); } public String toString() { return "DownloadRequest{, priority=" + this.priority + ", url='" + this.asset.getServerPath() + "', path='" + this.asset.getLocalPath() + "', cancelled=" + this.cancelled + ", placementId=" + this.placementId + ", creativeId=" + this.creativeId + ", eventId=" + this.eventId + '}'; } public enum Priority { CRITICAL(-2147483647), HIGHEST(0), HIGH(1), LOWEST(Integer.MAX_VALUE); private final int priority; public final int getPriority() { return this.priority; } Priority(int i) { this.priority = i; } } public final void cancel() { this.cancelled.set(true); } public final boolean isCancelled() { return this.cancelled.get(); } public final int getPriority() { return this.priority.getPriority(); } public final void startRecord() { TimeIntervalMetric timeIntervalMetric = new TimeIntervalMetric(Sdk.SDKMetric.SDKMetricType.TEMPLATE_DOWNLOAD_DURATION_MS); this.downloadDuration = timeIntervalMetric; timeIntervalMetric.markStart(); } public final void stopRecord() { TimeIntervalMetric timeIntervalMetric = this.downloadDuration; if (timeIntervalMetric != null) { timeIntervalMetric.markEnd(); AnalyticsClient.INSTANCE.logMetric$vungle_ads_release(timeIntervalMetric, this.placementId, this.creativeId, this.eventId, this.asset.getServerPath()); } } }