package com.google.android.gms.common.api.internal;

import com.google.android.gms.common.api.Status;
import com.google.android.gms.common.internal.ApiExceptionUtil;
import com.google.errorprone.annotations.ResultIgnorabilityUnspecified;
import o.Hw0;
import o.Pc0;
import o.Qc0;
import o.Rc0;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public class TaskUtil {
    public static void setResultOrApiException(Status status, Qc0 qc0) {
        setResultOrApiException(status, null, qc0);
    }

    @Deprecated
    public static Pc0 toVoidTaskThatFailsOnFalse(Pc0 pc0) {
        zacx zacxVar = new zacx();
        Hw0 hw0 = (Hw0) pc0;
        hw0.getClass();
        return hw0.k(Rc0.a, zacxVar);
    }

    @ResultIgnorabilityUnspecified
    public static <ResultT> boolean trySetResultOrApiException(Status status, ResultT resultt, Qc0 qc0) {
        return status.isSuccess() ? qc0.a.o(resultt) : qc0.c(ApiExceptionUtil.fromStatus(status));
    }

    public static <ResultT> void setResultOrApiException(Status status, ResultT resultt, Qc0 qc0) {
        if (status.isSuccess()) {
            qc0.b(resultt);
        } else {
            qc0.a(ApiExceptionUtil.fromStatus(status));
        }
    }
}
