package com.google.android.gms.measurement;

import android.content.Context;
import android.os.Bundle;
import com.google.firebase.analytics.FirebaseAnalytics;
import defpackage.AbstractC1814;
import defpackage.C1103;
import defpackage.C1216;
import defpackage.C3643;
import defpackage.C4758;
import defpackage.InterfaceC0050;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/* JADX INFO: loaded from: classes3.dex */
@Deprecated
public class AppMeasurement {

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public static volatile AppMeasurement f1027;

    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public final AbstractC1814 f1028;

    public static class ConditionalUserProperty {
        public boolean mActive;
        public String mAppId;
        public long mCreationTimestamp;
        public String mExpiredEventName;
        public Bundle mExpiredEventParams;
        public String mName;
        public String mOrigin;
        public long mTimeToLive;
        public String mTimedOutEventName;
        public Bundle mTimedOutEventParams;
        public String mTriggerEventName;
        public long mTriggerTimeout;
        public String mTriggeredEventName;
        public Bundle mTriggeredEventParams;
        public long mTriggeredTimestamp;
        public Object mValue;
    }

    public AppMeasurement(InterfaceC0050 interfaceC0050) {
        this.f1028 = new C3643(interfaceC0050);
    }

    public AppMeasurement(C1103 c1103) {
        this.f1028 = new C4758(c1103);
    }

    /* JADX WARN: Unreachable blocks removed: 1, instructions: 1 */
    @Deprecated
    public static AppMeasurement getInstance(Context context) {
        if (f1027 == null) {
            synchronized (AppMeasurement.class) {
                if (f1027 == null) {
                    InterfaceC0050 interfaceC0050 = (InterfaceC0050) FirebaseAnalytics.class.getDeclaredMethod("getScionFrontendApiImplementation", Context.class, Bundle.class).invoke(null, context, null);
                    if (interfaceC0050 != null) {
                        f1027 = new AppMeasurement(interfaceC0050);
                    } else {
                        f1027 = new AppMeasurement(C1103.m3563(context, new C1216(0L, 0L, true, null, null), null, null));
                    }
                }
            }
        }
        return f1027;
    }

    public void beginAdUnitExposure(String str) {
        this.f1028.mo1050(str);
    }

    public void clearConditionalUserProperty(String str, String str2, Bundle bundle) {
        this.f1028.mo1048(str, str2, bundle);
    }

    public void endAdUnitExposure(String str) {
        this.f1028.mo1045(str);
    }

    public long generateEventId() {
        return this.f1028.mo1053();
    }

    public String getAppInstanceId() {
        return this.f1028.mo1042();
    }

    public List<ConditionalUserProperty> getConditionalUserProperties(String str, String str2) {
        List<Bundle> listMo1052 = this.f1028.mo1052(str, str2);
        ArrayList arrayList = new ArrayList(listMo1052 == null ? 0 : listMo1052.size());
        for (Bundle bundle : listMo1052) {
            ConditionalUserProperty conditionalUserProperty = new ConditionalUserProperty();
            ᵘᵞʿⁱ.ᵶᵥᵝ(bundle);
            conditionalUserProperty.mAppId = (String) ᵷˆᵣ.ᵜᵪʾ(bundle, "app_id", String.class, (Object) null);
            conditionalUserProperty.mOrigin = (String) ᵷˆᵣ.ᵜᵪʾ(bundle, "origin", String.class, (Object) null);
            conditionalUserProperty.mName = (String) ᵷˆᵣ.ᵜᵪʾ(bundle, "name", String.class, (Object) null);
            conditionalUserProperty.mValue = ᵷˆᵣ.ᵜᵪʾ(bundle, "value", Object.class, (Object) null);
            conditionalUserProperty.mTriggerEventName = (String) ᵷˆᵣ.ᵜᵪʾ(bundle, "trigger_event_name", String.class, (Object) null);
            conditionalUserProperty.mTriggerTimeout = ((Long) ᵷˆᵣ.ᵜᵪʾ(bundle, "trigger_timeout", Long.class, 0L)).longValue();
            conditionalUserProperty.mTimedOutEventName = (String) ᵷˆᵣ.ᵜᵪʾ(bundle, "timed_out_event_name", String.class, (Object) null);
            conditionalUserProperty.mTimedOutEventParams = (Bundle) ᵷˆᵣ.ᵜᵪʾ(bundle, "timed_out_event_params", Bundle.class, (Object) null);
            conditionalUserProperty.mTriggeredEventName = (String) ᵷˆᵣ.ᵜᵪʾ(bundle, "triggered_event_name", String.class, (Object) null);
            conditionalUserProperty.mTriggeredEventParams = (Bundle) ᵷˆᵣ.ᵜᵪʾ(bundle, "triggered_event_params", Bundle.class, (Object) null);
            conditionalUserProperty.mTimeToLive = ((Long) ᵷˆᵣ.ᵜᵪʾ(bundle, "time_to_live", Long.class, 0L)).longValue();
            conditionalUserProperty.mExpiredEventName = (String) ᵷˆᵣ.ᵜᵪʾ(bundle, "expired_event_name", String.class, (Object) null);
            conditionalUserProperty.mExpiredEventParams = (Bundle) ᵷˆᵣ.ᵜᵪʾ(bundle, "expired_event_params", Bundle.class, (Object) null);
            conditionalUserProperty.mActive = ((Boolean) ᵷˆᵣ.ᵜᵪʾ(bundle, "active", Boolean.class, Boolean.FALSE)).booleanValue();
            conditionalUserProperty.mCreationTimestamp = ((Long) ᵷˆᵣ.ᵜᵪʾ(bundle, "creation_timestamp", Long.class, 0L)).longValue();
            conditionalUserProperty.mTriggeredTimestamp = ((Long) ᵷˆᵣ.ᵜᵪʾ(bundle, "triggered_timestamp", Long.class, 0L)).longValue();
            arrayList.add(conditionalUserProperty);
        }
        return arrayList;
    }

    public String getCurrentScreenClass() {
        return this.f1028.mo1051();
    }

    public String getCurrentScreenName() {
        return this.f1028.mo1054();
    }

    public String getGmpAppId() {
        return this.f1028.mo1046();
    }

    public int getMaxUserProperties(String str) {
        return this.f1028.mo1043(str);
    }

    public Map<String, Object> getUserProperties(String str, String str2, boolean z) {
        return this.f1028.mo1044(str, str2, z);
    }

    public void logEventInternal(String str, String str2, Bundle bundle) {
        this.f1028.mo1049(str, str2, bundle);
    }

    public void setConditionalUserProperty(ConditionalUserProperty conditionalUserProperty) {
        ᵘᵞʿⁱ.ᵶᵥᵝ(conditionalUserProperty);
        Bundle bundle = new Bundle();
        String str = conditionalUserProperty.mAppId;
        if (str != null) {
            bundle.putString("app_id", str);
        }
        String str2 = conditionalUserProperty.mOrigin;
        if (str2 != null) {
            bundle.putString("origin", str2);
        }
        String str3 = conditionalUserProperty.mName;
        if (str3 != null) {
            bundle.putString("name", str3);
        }
        Object obj = conditionalUserProperty.mValue;
        if (obj != null) {
            ᵷˆᵣ.ˊᵨᵧ(bundle, obj);
        }
        String str4 = conditionalUserProperty.mTriggerEventName;
        if (str4 != null) {
            bundle.putString("trigger_event_name", str4);
        }
        bundle.putLong("trigger_timeout", conditionalUserProperty.mTriggerTimeout);
        String str5 = conditionalUserProperty.mTimedOutEventName;
        if (str5 != null) {
            bundle.putString("timed_out_event_name", str5);
        }
        Bundle bundle2 = conditionalUserProperty.mTimedOutEventParams;
        if (bundle2 != null) {
            bundle.putBundle("timed_out_event_params", bundle2);
        }
        String str6 = conditionalUserProperty.mTriggeredEventName;
        if (str6 != null) {
            bundle.putString("triggered_event_name", str6);
        }
        Bundle bundle3 = conditionalUserProperty.mTriggeredEventParams;
        if (bundle3 != null) {
            bundle.putBundle("triggered_event_params", bundle3);
        }
        bundle.putLong("time_to_live", conditionalUserProperty.mTimeToLive);
        String str7 = conditionalUserProperty.mExpiredEventName;
        if (str7 != null) {
            bundle.putString("expired_event_name", str7);
        }
        Bundle bundle4 = conditionalUserProperty.mExpiredEventParams;
        if (bundle4 != null) {
            bundle.putBundle("expired_event_params", bundle4);
        }
        bundle.putLong("creation_timestamp", conditionalUserProperty.mCreationTimestamp);
        bundle.putBoolean("active", conditionalUserProperty.mActive);
        bundle.putLong("triggered_timestamp", conditionalUserProperty.mTriggeredTimestamp);
        this.f1028.mo1047(bundle);
    }
}
