100 lines
3.1 KiB
Java
100 lines
3.1 KiB
Java
|
package com.google.android.gms.common.api.internal;
|
||
|
|
||
|
import android.os.Bundle;
|
||
|
import android.os.DeadObjectException;
|
||
|
import com.google.android.gms.common.ConnectionResult;
|
||
|
import com.google.android.gms.common.api.Api;
|
||
|
import com.google.android.gms.common.api.Result;
|
||
|
import com.google.android.gms.common.api.Status;
|
||
|
import com.google.android.gms.common.api.internal.BaseImplementation;
|
||
|
import com.google.android.gms.common.internal.Preconditions;
|
||
|
import java.util.Iterator;
|
||
|
import java.util.Set;
|
||
|
|
||
|
/* loaded from: classes.dex */
|
||
|
public final class zaaj implements zabf {
|
||
|
private final zabi zaa;
|
||
|
private boolean zab = false;
|
||
|
|
||
|
@Override // com.google.android.gms.common.api.internal.zabf
|
||
|
public final <A extends Api.AnyClient, R extends Result, T extends BaseImplementation.ApiMethodImpl<R, A>> T zaa(T t) {
|
||
|
zab(t);
|
||
|
return t;
|
||
|
}
|
||
|
|
||
|
@Override // com.google.android.gms.common.api.internal.zabf
|
||
|
public final <A extends Api.AnyClient, T extends BaseImplementation.ApiMethodImpl<? extends Result, A>> T zab(T t) {
|
||
|
try {
|
||
|
this.zaa.zag.zai.zaa(t);
|
||
|
zabe zabeVar = this.zaa.zag;
|
||
|
Api.Client client = zabeVar.zac.get(t.getClientKey());
|
||
|
Preconditions.checkNotNull(client, "Appropriate Api was not requested.");
|
||
|
if (client.isConnected() || !this.zaa.zab.containsKey(t.getClientKey())) {
|
||
|
t.run(client);
|
||
|
} else {
|
||
|
t.setFailedResult(new Status(17));
|
||
|
}
|
||
|
} catch (DeadObjectException unused) {
|
||
|
this.zaa.zal(new zaah(this, this));
|
||
|
}
|
||
|
return t;
|
||
|
}
|
||
|
|
||
|
@Override // com.google.android.gms.common.api.internal.zabf
|
||
|
public final void zad() {
|
||
|
}
|
||
|
|
||
|
@Override // com.google.android.gms.common.api.internal.zabf
|
||
|
public final void zae() {
|
||
|
if (this.zab) {
|
||
|
this.zab = false;
|
||
|
this.zaa.zal(new zaai(this, this));
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: package-private */
|
||
|
public final void zaf() {
|
||
|
if (this.zab) {
|
||
|
this.zab = false;
|
||
|
this.zaa.zag.zai.zab();
|
||
|
zaj();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@Override // com.google.android.gms.common.api.internal.zabf
|
||
|
public final void zag(Bundle bundle) {
|
||
|
}
|
||
|
|
||
|
@Override // com.google.android.gms.common.api.internal.zabf
|
||
|
public final void zah(ConnectionResult connectionResult, Api<?> api, boolean z) {
|
||
|
}
|
||
|
|
||
|
@Override // com.google.android.gms.common.api.internal.zabf
|
||
|
public final void zai(int i) {
|
||
|
this.zaa.zak(null);
|
||
|
this.zaa.zah.zac(i, this.zab);
|
||
|
}
|
||
|
|
||
|
@Override // com.google.android.gms.common.api.internal.zabf
|
||
|
public final boolean zaj() {
|
||
|
if (this.zab) {
|
||
|
return false;
|
||
|
}
|
||
|
Set<zada> set = this.zaa.zag.zah;
|
||
|
if (set == null || set.isEmpty()) {
|
||
|
this.zaa.zak(null);
|
||
|
return true;
|
||
|
}
|
||
|
this.zab = true;
|
||
|
Iterator<zada> it = set.iterator();
|
||
|
while (it.hasNext()) {
|
||
|
it.next().zah();
|
||
|
}
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
public zaaj(zabi zabiVar) {
|
||
|
this.zaa = zabiVar;
|
||
|
}
|
||
|
}
|