package com.google.android.gms.internal.gtm; import com.google.android.gms.common.api.Status; import com.google.android.gms.common.internal.Preconditions; import com.google.android.gms.common.util.Clock; import com.google.android.gms.common.util.DefaultClock; /* loaded from: classes.dex */ public abstract class zzmn { private int zzasj; protected final zzmw zzask; private final zzms zzasl; private final Clock zzasm; protected final zzdz zzasn; public zzmn(int i, zzmw zzmwVar, zzms zzmsVar, zzdz zzdzVar) { this(i, zzmwVar, zzmsVar, zzdzVar, DefaultClock.getInstance()); } protected abstract void zza(zzmx zzmxVar); private zzmn(int i, zzmw zzmwVar, zzms zzmsVar, zzdz zzdzVar, Clock clock) { this.zzask = (zzmw) Preconditions.checkNotNull(zzmwVar); Preconditions.checkNotNull(zzmwVar.zzlk()); this.zzasj = i; this.zzasl = (zzms) Preconditions.checkNotNull(zzmsVar); this.zzasm = (Clock) Preconditions.checkNotNull(clock); this.zzasn = zzdzVar; } public final void zzc(byte[] bArr) { zzmx zzmxVar; zzmx zzd = zzd(bArr); zzdz zzdzVar = this.zzasn; if (zzdzVar != null && this.zzasj == 0) { zzdzVar.zzho(); } if (zzd != null && zzd.getStatus() == Status.RESULT_SUCCESS) { zzmxVar = new zzmx(Status.RESULT_SUCCESS, this.zzasj, new zzmy(this.zzask.zzlk(), bArr, zzd.zzll().zzlq(), this.zzasm.currentTimeMillis()), zzd.zzlm()); } else { zzmxVar = new zzmx(Status.RESULT_INTERNAL_ERROR, this.zzasj); } zza(zzmxVar); } public final void zzb(int i, int i2) { zzdz zzdzVar = this.zzasn; if (zzdzVar != null && i2 == 0 && i == 3) { zzdzVar.zzhn(); } String containerId = this.zzask.zzlk().getContainerId(); String str = i != 0 ? i != 1 ? i != 2 ? "Unknown reason" : "Server error" : "IOError" : "Resource not available"; StringBuilder sb = new StringBuilder(String.valueOf(containerId).length() + 61 + str.length()); sb.append("Failed to fetch the container resource for the container \""); sb.append(containerId); sb.append("\": "); sb.append(str); zzev.zzab(sb.toString()); zza(new zzmx(Status.RESULT_INTERNAL_ERROR, i2)); } private final zzmx zzd(byte[] bArr) { zzmx zzmxVar; try { zzmxVar = this.zzasl.zze(bArr); if (zzmxVar == null) { try { zzev.zzaw("Parsed resource from is null"); } catch (zzml unused) { zzev.zzaw("Resource data is corrupted"); return zzmxVar; } } } catch (zzml unused2) { zzmxVar = null; } return zzmxVar; } }