57 lines
2.1 KiB
Java
57 lines
2.1 KiB
Java
|
package com.google.android.gms.internal.firebase_ml;
|
||
|
|
||
|
import com.google.android.gms.auth.api.AuthProxy;
|
||
|
import com.google.android.gms.common.ConnectionResult;
|
||
|
import com.google.android.gms.common.api.GoogleApiClient;
|
||
|
import com.google.firebase.FirebaseApp;
|
||
|
import com.google.firebase.ml.common.FirebaseMLException;
|
||
|
import java.util.concurrent.TimeUnit;
|
||
|
|
||
|
/* JADX INFO: Add missing generic type declarations: [ResultType] */
|
||
|
/* loaded from: classes2.dex */
|
||
|
public final class zzpp<ResultType> implements zznm<ResultType, zzpn>, zznw {
|
||
|
private final zzpq zzawo;
|
||
|
private final GoogleApiClient zzawp;
|
||
|
private final zzpo zzawq;
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: package-private */
|
||
|
public zzpp(zzpo zzpoVar, FirebaseApp firebaseApp, boolean z) {
|
||
|
this.zzawq = zzpoVar;
|
||
|
if (z) {
|
||
|
GoogleApiClient build = new GoogleApiClient.Builder(firebaseApp.getApplicationContext()).addApi(AuthProxy.API).build();
|
||
|
this.zzawp = build;
|
||
|
build.connect();
|
||
|
} else {
|
||
|
this.zzawp = null;
|
||
|
}
|
||
|
this.zzawo = zzpq.zza(firebaseApp, z, this.zzawp);
|
||
|
}
|
||
|
|
||
|
@Override // com.google.android.gms.internal.firebase_ml.zznm
|
||
|
public final zznw zzlm() {
|
||
|
return this;
|
||
|
}
|
||
|
|
||
|
@Override // com.google.android.gms.internal.firebase_ml.zznw
|
||
|
public final void zzlp() throws FirebaseMLException {
|
||
|
GoogleApiClient googleApiClient = this.zzawp;
|
||
|
if (googleApiClient != null && googleApiClient.blockingConnect(3L, TimeUnit.SECONDS) != ConnectionResult.RESULT_SUCCESS) {
|
||
|
throw new FirebaseMLException("Failed to contact Google Play services", 14);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@Override // com.google.android.gms.internal.firebase_ml.zznw
|
||
|
public final void release() {
|
||
|
GoogleApiClient googleApiClient = this.zzawp;
|
||
|
if (googleApiClient != null) {
|
||
|
googleApiClient.disconnect();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@Override // com.google.android.gms.internal.firebase_ml.zznm
|
||
|
public final /* synthetic */ Object zza(zzpn zzpnVar) throws FirebaseMLException {
|
||
|
zzpn zzpnVar2 = zzpnVar;
|
||
|
return this.zzawq.zza(this.zzawo.zza(zzpnVar2), zzpnVar2.zzawl);
|
||
|
}
|
||
|
}
|