package com.google.android.gms.internal.ads;

import android.content.Context;
import android.view.View;
import java.util.HashMap;
import java.util.concurrent.atomic.AtomicBoolean;

/* JADX INFO: loaded from: classes2.dex */
public final class cp1 implements bp1, cl1 {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final /* synthetic */ int f10018a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final Context f10019b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final jp1 f10020c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final dv1 f10021d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final bk1 f10022e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final AtomicBoolean f10023f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public com.google.common.util.concurrent.w f10024g;

    public cp1(Context context, jp1 jp1Var, bk1 bk1Var, dv1 dv1Var) {
        this.f10018a = 0;
        this.f10023f = new AtomicBoolean(false);
        this.f10024g = ih1.k("E");
        this.f10019b = context;
        this.f10020c = jp1Var;
        this.f10022e = bk1Var;
        this.f10021d = dv1Var;
    }

    @Override // com.google.android.gms.internal.ads.bp1
    public final void a(HashMap map) {
        switch (this.f10018a) {
            case 0:
                d(map);
                break;
            default:
                map.put("gs", this.f10024g);
                break;
        }
    }

    @Override // com.google.android.gms.internal.ads.bp1
    public final void b(HashMap map) {
        switch (this.f10018a) {
            case 0:
                d(map);
                break;
            default:
                map.put("gs", this.f10024g);
                break;
        }
    }

    @Override // com.google.android.gms.internal.ads.bp1
    public final void c(HashMap map, Context context, View view) {
        switch (this.f10018a) {
            case 0:
                d(map);
                break;
            default:
                map.put("gs", this.f10024g);
                break;
        }
    }

    public final void d(HashMap map) {
        synchronized (this) {
            map.put("ai", this.f10024g);
        }
    }

    @Override // com.google.android.gms.internal.ads.cl1
    public final com.google.common.util.concurrent.w zza() {
        AtomicBoolean atomicBoolean = this.f10023f;
        int i10 = this.f10018a;
        dv1 dv1Var = this.f10021d;
        switch (i10) {
            case 0:
                if (atomicBoolean.getAndSet(true)) {
                    return bv1.f9665b;
                }
                return ((iu1) dv1Var).g(new y61(this, 8));
            default:
                if (atomicBoolean.getAndSet(true) || !this.f10022e.I()) {
                    return bv1.f9665b;
                }
                return ((iu1) dv1Var).e(new na1(this, 11));
        }
    }

    public cp1(Context context, jp1 jp1Var, dv1 dv1Var, bk1 bk1Var) {
        this.f10018a = 1;
        this.f10023f = new AtomicBoolean(false);
        this.f10024g = ih1.k(null);
        this.f10019b = context;
        this.f10020c = jp1Var;
        this.f10021d = dv1Var;
        this.f10022e = bk1Var;
    }
}
