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

72 lines
2.7 KiB
Java

package com.google.android.gms.common.api.internal;
import com.google.android.gms.common.api.OptionalPendingResult;
import com.google.android.gms.common.api.PendingResult;
import com.google.android.gms.common.api.Result;
import com.google.android.gms.common.api.ResultCallback;
import com.google.android.gms.common.api.ResultTransform;
import com.google.android.gms.common.api.TransformedResult;
import java.util.concurrent.TimeUnit;
/* loaded from: classes.dex */
public final class OptionalPendingResultImpl<R extends Result> extends OptionalPendingResult<R> {
private final BasePendingResult<R> zaa;
@Override // com.google.android.gms.common.api.PendingResult
public final void addStatusListener(PendingResult.StatusListener statusListener) {
this.zaa.addStatusListener(statusListener);
}
@Override // com.google.android.gms.common.api.PendingResult
public final R await() {
return this.zaa.await();
}
@Override // com.google.android.gms.common.api.PendingResult
public final void cancel() {
this.zaa.cancel();
}
@Override // com.google.android.gms.common.api.OptionalPendingResult
public final R get() {
if (this.zaa.isReady()) {
return this.zaa.await(0L, TimeUnit.MILLISECONDS);
}
throw new IllegalStateException("Result is not available. Check that isDone() returns true before calling get().");
}
@Override // com.google.android.gms.common.api.PendingResult
public final boolean isCanceled() {
return this.zaa.isCanceled();
}
@Override // com.google.android.gms.common.api.OptionalPendingResult
public final boolean isDone() {
return this.zaa.isReady();
}
@Override // com.google.android.gms.common.api.PendingResult
public final void setResultCallback(ResultCallback<? super R> resultCallback) {
this.zaa.setResultCallback(resultCallback);
}
@Override // com.google.android.gms.common.api.PendingResult
public final <S extends Result> TransformedResult<S> then(ResultTransform<? super R, ? extends S> resultTransform) {
return this.zaa.then(resultTransform);
}
@Override // com.google.android.gms.common.api.PendingResult
public final R await(long j, TimeUnit timeUnit) {
return this.zaa.await(j, timeUnit);
}
@Override // com.google.android.gms.common.api.PendingResult
public final void setResultCallback(ResultCallback<? super R> resultCallback, long j, TimeUnit timeUnit) {
this.zaa.setResultCallback(resultCallback, j, timeUnit);
}
public OptionalPendingResultImpl(PendingResult<R> pendingResult) {
this.zaa = (BasePendingResult) pendingResult;
}
}