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

import android.content.Context;
import android.text.TextUtils;

/* JADX INFO: loaded from: classes2.dex */
public final class w10 implements kj {

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

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

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

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public boolean f17844d;

    public w10(Context context, String str) {
        this.f17841a = context.getApplicationContext() != null ? context.getApplicationContext() : context;
        this.f17843c = str;
        this.f17844d = false;
        this.f17842b = new Object();
    }

    public final void a(boolean z10) {
        m7.n nVar = m7.n.C;
        y10 y10Var = nVar.f30486y;
        Context context = this.f17841a;
        if (y10Var.a(context)) {
            synchronized (this.f17842b) {
                try {
                    if (this.f17844d == z10) {
                        return;
                    }
                    this.f17844d = z10;
                    String str = this.f17843c;
                    if (TextUtils.isEmpty(str)) {
                        return;
                    }
                    if (this.f17844d) {
                        y10 y10Var2 = nVar.f30486y;
                        if (y10Var2.a(context)) {
                            y10Var2.g(context, str, "beginAdUnitExposure");
                        }
                    } else {
                        y10 y10Var3 = nVar.f30486y;
                        if (y10Var3.a(context)) {
                            y10Var3.g(context, str, "endAdUnitExposure");
                        }
                    }
                } finally {
                }
            }
        }
    }

    @Override // com.google.android.gms.internal.ads.kj
    public final void p(jj jjVar) {
        a(jjVar.f12901j);
    }
}
