what-the-bank/sources/com/google/android/gms/internal/firebase_ml/zznq.java

66 lines
2.1 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
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 <T, S extends zznp> void zza(zznm<T, S> zznmVar) {
zznw zzlm = zznmVar.zzlm();
if (zzlm != null) {
this.zzapg.zza(zzlm);
}
}
public final <T, S extends zznp> void zzb(zznm<T, S> zznmVar) {
zznw zzlm = zznmVar.zzlm();
if (zzlm != null) {
this.zzapg.zzd(zzlm);
}
}
public final <TResult> Task<TResult> zza(zznw zznwVar, Callable<TResult> callable) {
Task<TResult> 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 <T, S extends zznp> Task<T> zza(zznm<T, S> zznmVar, S s) {
Task<T> 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;
}
}