package R2;

import C4.f;
import O2.r;
import P.g;
import P2.C0253j;
import P2.m;
import P2.n;
import P2.w;
import Y2.e;
import android.content.Context;
import android.os.Build;
import com.google.android.gms.internal.measurement.B1;
import d3.R0;
import g3.h;
import g3.o;

/* JADX INFO: loaded from: classes.dex */
public final class c {
    public static final R0 i = new R0(new b(), new f(10));

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

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

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

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

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final O2.a f6051e;

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

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public final C0253j f6053g;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public final O2.d f6054h;

    public c(Context context, R0 r02, n nVar, N2.b bVar) {
        w.g(context, "Null context is not permitted.");
        w.g(r02, "Api must not be null.");
        w.g(bVar, "Settings must not be null; use Settings.DEFAULT_SETTINGS instead.");
        Context applicationContext = context.getApplicationContext();
        w.g(applicationContext, "The provided context did not have an application context.");
        this.f6047a = applicationContext;
        String attributionTag = Build.VERSION.SDK_INT >= 30 ? context.getAttributionTag() : null;
        this.f6048b = attributionTag;
        this.f6049c = r02;
        this.f6050d = nVar;
        this.f6051e = new O2.a(r02, nVar, attributionTag);
        O2.d dVarE = O2.d.e(applicationContext);
        this.f6054h = dVarE;
        this.f6052f = dVarE.f5113x.getAndIncrement();
        this.f6053g = bVar.f4734a;
        e eVar = dVarE.f5105C;
        eVar.sendMessage(eVar.obtainMessage(7, this));
    }

    public final o a(m mVar) {
        K4.c cVar = new K4.c(28, false);
        M2.d[] dVarArr = {Y2.c.f7311a};
        cVar.f3604r = new g(7, mVar);
        B1 b12 = new B1();
        b12.f9560c = cVar;
        b12.f9559b = dVarArr;
        b12.f9558a = false;
        h hVar = new h();
        O2.d dVar = this.f6054h;
        dVar.getClass();
        O2.o oVar = new O2.o(new r(b12, hVar, this.f6053g), dVar.f5114y.get(), this);
        e eVar = dVar.f5105C;
        eVar.sendMessage(eVar.obtainMessage(4, oVar));
        return hVar.f12923a;
    }
}
