46 lines
1.9 KiB
Java
46 lines
1.9 KiB
Java
|
package com.google.android.gms.internal.firebase_ml;
|
||
|
|
||
|
import android.os.SystemClock;
|
||
|
import com.google.android.gms.common.internal.GmsLogger;
|
||
|
import com.google.android.gms.internal.firebase_ml.zzmd;
|
||
|
import com.google.firebase.FirebaseApp;
|
||
|
import com.google.firebase.ml.common.modeldownload.FirebaseRemoteModel;
|
||
|
|
||
|
/* loaded from: classes2.dex */
|
||
|
public final class zzon {
|
||
|
private static final GmsLogger zzaoz = new GmsLogger("ModelDownloadLogger", "");
|
||
|
private final FirebaseApp zzapo;
|
||
|
private final zznu zzaqs;
|
||
|
private final FirebaseRemoteModel zzaqt;
|
||
|
|
||
|
public zzon(FirebaseApp firebaseApp, FirebaseRemoteModel firebaseRemoteModel) {
|
||
|
this.zzapo = firebaseApp;
|
||
|
this.zzaqs = zznu.zza(firebaseApp, 4);
|
||
|
this.zzaqt = firebaseRemoteModel;
|
||
|
}
|
||
|
|
||
|
public final void zza(zzmk zzmkVar, String str, boolean z) {
|
||
|
zzmd.zzo zzmh = this.zzaqt.zzmh();
|
||
|
if (!z) {
|
||
|
this.zzaqs.zza(zzmd.zzq.zzjx().zzb(zzmd.zzac.zzli().zzbu(str)).zzb(zzmd.zzl.zzji().zzb(zzmkVar).zzb(zzmh)), zzmn.CUSTOM_MODEL_DOWNLOAD);
|
||
|
return;
|
||
|
}
|
||
|
long zzf = zzoa.zzf(this.zzapo, this.zzaqt.zzmj());
|
||
|
if (zzf == 0) {
|
||
|
zzaoz.w("ModelDownloadLogger", "Model downloaded without its beginning time recorded.");
|
||
|
this.zzaqs.zza(zzmd.zzq.zzjx().zzb(zzmd.zzac.zzli().zzbu(str)).zzb(zzmd.zzl.zzji().zzb(zzmk.UNKNOWN_ERROR).zzb(zzmh)), zzmn.CUSTOM_MODEL_DOWNLOAD);
|
||
|
return;
|
||
|
}
|
||
|
long zzg = zzoa.zzg(this.zzapo, this.zzaqt.zzmj());
|
||
|
if (zzg == 0) {
|
||
|
zzg = SystemClock.elapsedRealtime();
|
||
|
zzoa.zza(this.zzapo, this.zzaqt.zzmj(), zzg);
|
||
|
}
|
||
|
this.zzaqs.zza(zzmd.zzq.zzjx().zzb(zzmd.zzac.zzli().zzbu(str)).zzb(zzmd.zzl.zzji().zzi(zzg - zzf).zzb(zzmkVar).zzb(zzmh)), zzmn.CUSTOM_MODEL_DOWNLOAD);
|
||
|
}
|
||
|
|
||
|
public final void zza(zzmk zzmkVar, boolean z) {
|
||
|
zza(zzmkVar, "NA", z);
|
||
|
}
|
||
|
}
|