package com.google.android.gms.internal.firebase_ml; import com.google.android.gms.common.internal.GmsLogger; import com.google.android.gms.common.internal.Preconditions; import com.google.android.gms.tasks.Task; import com.google.firebase.FirebaseApp; import java.util.concurrent.Callable; /* loaded from: classes2.dex */ public final class zznq { private static final GmsLogger zzape = new GmsLogger("MLTaskManager", ""); private static zznq zzapf; private final zznx zzapg; private zznq(FirebaseApp firebaseApp) { this.zzapg = zznx.zzb(firebaseApp); } public static zznq zza(FirebaseApp firebaseApp) { zznq zznqVar; synchronized (zznq.class) { if (zzapf == null) { zzapf = new zznq(firebaseApp); } zznqVar = zzapf; } return zznqVar; } public final void zza(zznm zznmVar) { zznw zzlm = zznmVar.zzlm(); if (zzlm != null) { this.zzapg.zza(zzlm); } } public final void zzb(zznm zznmVar) { zznw zzlm = zznmVar.zzlm(); if (zzlm != null) { this.zzapg.zzd(zzlm); } } public final Task zza(zznw zznwVar, Callable callable) { Task zza; synchronized (this) { Preconditions.checkNotNull(callable, "Operation can not be null"); Preconditions.checkNotNull(zznwVar, "Model resource can not be null"); zzape.d("MLTaskManager", "Execute task"); zza = zznn.zzln().zza(new zznr(this, zznwVar, callable)); } return zza; } public final Task zza(zznm zznmVar, S s) { Task zza; synchronized (this) { Preconditions.checkNotNull(zznmVar, "Operation can not be null"); Preconditions.checkNotNull(s, "Input can not be null"); zzape.d("MLTaskManager", "Execute task"); zza = zznn.zzln().zza(new zzns(this, zznmVar.zzlm(), zznmVar, s)); } return zza; } }