package o;

import android.app.Activity;
import android.content.Context;
import android.content.res.Resources;
import android.os.Bundle;
import android.text.TextUtils;
import com.google.android.gms.common.internal.Preconditions;
import com.google.android.gms.dynamite.descriptors.com.google.android.gms.measurement.dynamite.ModuleDescriptor;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public final class Ip0 extends Rp0 {
    public final /* synthetic */ int p;
    public final /* synthetic */ Object q;
    public final /* synthetic */ Object r;
    public final /* synthetic */ Object s;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public /* synthetic */ Ip0(Wp0 wp0, Object obj, Object obj2, int i) {
        super(wp0, true);
        this.p = i;
        this.r = obj;
        this.s = obj2;
        this.q = wp0;
    }

    @Override // o.Rp0
    public final void a() {
        Boolean boolValueOf;
        Bundle bundle;
        switch (this.p) {
            case 0:
                try {
                    Context context = (Context) this.r;
                    Preconditions.checkNotNull(context);
                    String strA = AbstractC2946xr0.a(context);
                    Preconditions.checkNotNull(context);
                    Resources resources = context.getResources();
                    if (TextUtils.isEmpty(strA)) {
                        strA = AbstractC2946xr0.a(context);
                    }
                    int identifier = resources.getIdentifier("google_analytics_force_disable_updates", "bool", strA);
                    InterfaceC1993np0 interfaceC1993np0AsInterface = null;
                    if (identifier == 0) {
                        boolValueOf = null;
                    } else {
                        try {
                            boolValueOf = Boolean.valueOf(resources.getBoolean(identifier));
                        } catch (Resources.NotFoundException unused) {
                        }
                    }
                    Wp0 wp0 = (Wp0) this.q;
                    boolean z = boolValueOf == null || !boolValueOf.booleanValue();
                    wp0.getClass();
                    try {
                        interfaceC1993np0AsInterface = AbstractBinderC1898mp0.asInterface(C0538Ut.c(context, z ? C0538Ut.c : C0538Ut.b, ModuleDescriptor.MODULE_ID).b("com.google.android.gms.measurement.internal.AppMeasurementDynamiteService"));
                    } catch (C0434Qt e) {
                        wp0.b(e, true, false);
                    }
                    wp0.g = interfaceC1993np0AsInterface;
                    if (wp0.g != null) {
                        int iA = C0538Ut.a(context, ModuleDescriptor.MODULE_ID);
                        ((InterfaceC1993np0) Preconditions.checkNotNull(wp0.g)).initialize(new BinderC1385hT(context), new Dp0(133005L, Math.max(iA, r6), Boolean.TRUE.equals(boolValueOf) || C0538Ut.d(context, ModuleDescriptor.MODULE_ID, false) < iA, (Bundle) this.s, AbstractC2946xr0.a(context)), this.l);
                        break;
                    } else {
                        break;
                    }
                } catch (Exception e2) {
                    ((Wp0) this.q).b(e2, true, false);
                    return;
                }
                break;
            case 1:
                ((InterfaceC1993np0) Preconditions.checkNotNull(((Wp0) this.q).g)).getMaxUserProperties((String) this.r, (BinderC1708kp0) this.s);
                break;
            case 2:
                Bundle bundle2 = (Bundle) this.s;
                if (bundle2 != null) {
                    bundle = new Bundle();
                    if (bundle2.containsKey("com.google.app_measurement.screen_service")) {
                        Object obj = bundle2.get("com.google.app_measurement.screen_service");
                        if (obj instanceof Bundle) {
                            bundle.putBundle("com.google.app_measurement.screen_service", (Bundle) obj);
                        }
                    }
                } else {
                    bundle = null;
                }
                ((InterfaceC1993np0) Preconditions.checkNotNull(((Wp0) ((C0308Lx) this.q).m).g)).onActivityCreatedByScionActivityInfo(Ep0.b((Activity) this.r), bundle, this.m);
                break;
            default:
                ((InterfaceC1993np0) Preconditions.checkNotNull(((Wp0) ((C0308Lx) this.q).m).g)).onActivitySaveInstanceStateByScionActivityInfo(Ep0.b((Activity) this.r), (BinderC1708kp0) this.s, this.m);
                break;
        }
    }

    @Override // o.Rp0
    public void b() {
        switch (this.p) {
            case 1:
                ((BinderC1708kp0) this.s).k(null);
                break;
        }
    }

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public Ip0(C0308Lx c0308Lx, Activity activity, BinderC1708kp0 binderC1708kp0) {
        super((Wp0) c0308Lx.m, true);
        this.p = 3;
        this.r = activity;
        this.s = binderC1708kp0;
        this.q = c0308Lx;
    }

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public Ip0(C0308Lx c0308Lx, Bundle bundle, Activity activity) {
        super((Wp0) c0308Lx.m, true);
        this.p = 2;
        this.s = bundle;
        this.r = activity;
        this.q = c0308Lx;
    }
}
