what-the-bank/sources/com/google/android/gms/common/api/internal/TaskApiCall.java

106 lines
3.2 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.google.android.gms.common.api.internal;
import android.os.RemoteException;
import com.google.android.gms.common.Feature;
import com.google.android.gms.common.api.Api;
import com.google.android.gms.common.api.Api.AnyClient;
import com.google.android.gms.common.internal.Preconditions;
import com.google.android.gms.common.util.BiConsumer;
import com.google.android.gms.tasks.TaskCompletionSource;
/* loaded from: classes.dex */
public abstract class TaskApiCall<A extends Api.AnyClient, ResultT> {
private final Feature[] zaa;
private final boolean zab;
private final int zac;
/* JADX INFO: Access modifiers changed from: protected */
public abstract void doExecute(A a, TaskCompletionSource<ResultT> taskCompletionSource) throws RemoteException;
/* loaded from: classes.dex */
public static class Builder<A extends Api.AnyClient, ResultT> {
private RemoteCall<A, TaskCompletionSource<ResultT>> zaa;
private Feature[] zac;
private boolean zab = true;
private int zad = 0;
public TaskApiCall<A, ResultT> build() {
Preconditions.checkArgument(this.zaa != null, "execute parameter required");
return new zacv(this, this.zac, this.zab, this.zad);
}
public Builder<A, ResultT> setMethodKey(int i) {
this.zad = i;
return this;
}
public Builder<A, ResultT> setFeatures(Feature... featureArr) {
this.zac = featureArr;
return this;
}
public Builder<A, ResultT> setAutoResolveMissingFeatures(boolean z) {
this.zab = z;
return this;
}
public Builder<A, ResultT> run(RemoteCall<A, TaskCompletionSource<ResultT>> remoteCall) {
this.zaa = remoteCall;
return this;
}
@Deprecated
public Builder<A, ResultT> execute(final BiConsumer<A, TaskCompletionSource<ResultT>> biConsumer) {
this.zaa = new RemoteCall(biConsumer) { // from class: com.google.android.gms.common.api.internal.zacu
public final BiConsumer zaa;
@Override // com.google.android.gms.common.api.internal.RemoteCall
public final void accept(Object obj, Object obj2) {
this.zaa.accept((Api.AnyClient) obj, (TaskCompletionSource) obj2);
}
{
this.zaa = biConsumer;
}
};
return this;
}
/* synthetic */ Builder(zacw zacwVar) {
}
private Builder() {
}
}
public final Feature[] zab() {
return this.zaa;
}
public final int zaa() {
return this.zac;
}
public boolean shouldAutoResolveMissingFeatures() {
return this.zab;
}
public static <A extends Api.AnyClient, ResultT> Builder<A, ResultT> builder() {
return new Builder<>(null);
}
/* JADX INFO: Access modifiers changed from: protected */
public TaskApiCall(Feature[] featureArr, boolean z, int i) {
this.zaa = featureArr;
this.zab = featureArr != null && z;
this.zac = i;
}
@Deprecated
public TaskApiCall() {
this.zaa = null;
this.zab = false;
this.zac = 0;
}
}