package defpackage;

import android.os.Bundle;
import android.os.SystemClock;
import j$.util.Objects;
import j$.util.concurrent.ConcurrentHashMap;

/* JADX INFO: renamed from: ˋᵫ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C1533 extends AbstractC2191 {

    /* JADX INFO: renamed from: ʿٴˇ, reason: contains not printable characters */
    public boolean f6187;

    /* JADX INFO: renamed from: ˈᵲᵢ, reason: contains not printable characters */
    public C5379 f6188;

    /* JADX INFO: renamed from: ˌᵨʠᵫ, reason: contains not printable characters */
    public volatile boolean f6189;

    /* JADX INFO: renamed from: ˑˊᵲ, reason: contains not printable characters */
    public C3160 f6190;

    /* JADX INFO: renamed from: ᵔᵖᵹᵫ, reason: contains not printable characters */
    public volatile C3160 f6191;

    /* JADX INFO: renamed from: ᵠˏˏ, reason: contains not printable characters */
    public final Object f6192;

    /* JADX INFO: renamed from: ᵨᵼⁱ, reason: contains not printable characters */
    public volatile C3160 f6193;

    /* JADX INFO: renamed from: ᵯᵷʽ, reason: contains not printable characters */
    public C3160 f6194;

    /* JADX INFO: renamed from: ᵶˇᵱ, reason: contains not printable characters */
    public final ConcurrentHashMap f6195;

    /* JADX INFO: renamed from: ᵸˆˁ, reason: contains not printable characters */
    public volatile C3160 f6196;

    public C1533(C1103 c1103) {
        super(c1103);
        this.f6192 = new Object();
        this.f6195 = new ConcurrentHashMap();
    }

    /* JADX INFO: renamed from: ʿٴˇ, reason: contains not printable characters */
    public final C3160 m4340(boolean z) {
        m5699();
        m6166();
        C3160 c3160 = this.f6194;
        return (z && c3160 == null) ? this.f6190 : c3160;
    }

    /* JADX INFO: renamed from: ˀᵭ, reason: contains not printable characters */
    public final void m4341(String str, C3160 c3160, boolean z) {
        C3160 c31602;
        C3160 c31603 = this.f6191 == null ? this.f6193 : this.f6191;
        if (c3160.f12020 == null) {
            c31602 = new C3160(c3160.f12023, str != null ? m4347(str) : null, c3160.f12021, c3160.f12022, c3160.f12026, c3160.f12024);
        } else {
            c31602 = c3160;
        }
        this.f6193 = this.f6191;
        this.f6191 = c31602;
        C1103 c1103 = (C1103) ((ᵜᵪʾ) this).ˌᴵ;
        c1103.f4701.getClass();
        long jElapsedRealtime = SystemClock.elapsedRealtime();
        C1961 c1961 = c1103.f4707;
        C1103.m3564(c1961);
        c1961.m5246(new RunnableC0280(this, c31602, c31603, jElapsedRealtime, z));
    }

    /* JADX INFO: renamed from: ˁˌᵩ, reason: contains not printable characters */
    public final void m4342(C5379 c5379, Bundle bundle) {
        Bundle bundle2;
        if (!((C1103) ((ᵜᵪʾ) this).ˌᴵ).f4726.m8307() || bundle == null || (bundle2 = bundle.getBundle("com.google.app_measurement.screen_service")) == null) {
            return;
        }
        this.f6195.put(Integer.valueOf(c5379.f20382), new C3160(bundle2.getLong("id"), bundle2.getString("name"), bundle2.getString("referrer_name")));
    }

    /* JADX WARN: Removed duplicated region for block: B:10:0x0033  */
    /* JADX WARN: Removed duplicated region for block: B:46:0x00b5  */
    /* JADX INFO: renamed from: ˉᵵᵜ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void m4343(C3160 c3160, C3160 c31602, long j, boolean z, Bundle bundle) {
        boolean z2;
        Bundle bundle2;
        boolean z3 = c3160.f12022;
        C1103 c1103 = (C1103) ((ᵜᵪʾ) this).ˌᴵ;
        m6166();
        boolean z4 = false;
        if (c31602 != null) {
            z2 = (c31602.f12021 == c3160.f12021 && Objects.equals(c31602.f12020, c3160.f12020) && Objects.equals(c31602.f12023, c3160.f12023)) ? false : true;
        }
        if (z && this.f6194 != null) {
            z4 = true;
        }
        if (z2) {
            Bundle bundle3 = bundle != null ? new Bundle(bundle) : new Bundle();
            C3335.m7622(c3160, bundle3, true);
            if (c31602 != null) {
                String str = c31602.f12023;
                if (str != null) {
                    bundle3.putString("_pn", str);
                }
                String str2 = c31602.f12020;
                if (str2 != null) {
                    bundle3.putString("_pc", str2);
                }
                bundle3.putLong("_pi", c31602.f12021);
            }
            if (z4) {
                C1584 c1584 = c1103.f4714;
                C1103.m3565(c1584);
                C1889 c1889 = c1584.f6361;
                long j2 = j - c1889.f7487;
                c1889.f7487 = j;
                if (j2 > 0) {
                    C3335 c3335 = c1103.f4730;
                    C1103.m3567(c3335);
                    c3335.m7660(bundle3, j2);
                }
            }
            C3691 c3691 = c1103.f4726;
            ᵠʽᵲ r5 = c1103.f4701;
            if (!c3691.m8307()) {
                bundle3.putLong("_mst", 1L);
            }
            String str3 = true != z3 ? "auto" : "app";
            r5.getClass();
            long jCurrentTimeMillis = System.currentTimeMillis();
            if (z3) {
                long j3 = c3160.f12026;
                long j4 = j3 != 0 ? j3 : jCurrentTimeMillis;
                long jElapsedRealtime = c1103.f4726.m8314(null, AbstractC3818.f14549) ? SystemClock.elapsedRealtime() : 0L;
                if (z3) {
                    bundle2 = bundle3;
                    long j5 = c3160.f12024;
                    if (j5 != 0) {
                        jElapsedRealtime = j5;
                    }
                } else {
                    bundle2 = bundle3;
                }
                C4799 c4799 = c1103.f4709;
                C1103.m3565(c4799);
                c4799.m10011(j4, jElapsedRealtime, bundle2, str3, "_vs");
            }
        }
        if (z4) {
            m4345(this.f6194, true, j);
        }
        this.f6194 = c3160;
        if (z3) {
            this.f6190 = c3160;
        }
        C1618 c1618M3573 = c1103.m3573();
        c1618M3573.m6166();
        c1618M3573.m5699();
        c1618M3573.m4457(new RunnableC0648(c1618M3573, c3160));
    }

    /* JADX INFO: renamed from: ˊᵡᵗʨ, reason: contains not printable characters */
    public final C3160 m4344(C5379 c5379) {
        ᵘᵞʿⁱ.ᵶᵥᵝ(c5379);
        Integer numValueOf = Integer.valueOf(c5379.f20382);
        ConcurrentHashMap concurrentHashMap = this.f6195;
        C3160 c3160 = (C3160) concurrentHashMap.get(numValueOf);
        if (c3160 == null) {
            String strM4347 = m4347(c5379.f20384);
            C3335 c3335 = ((C1103) ((ᵜᵪʾ) this).ˌᴵ).f4730;
            C1103.m3567(c3335);
            C3160 c31602 = new C3160(c3335.m7650(), null, strM4347);
            concurrentHashMap.put(numValueOf, c31602);
            c3160 = c31602;
        }
        return this.f6196 != null ? this.f6196 : c3160;
    }

    /* JADX INFO: renamed from: ˊᵾʽʼ, reason: contains not printable characters */
    public final void m4345(C3160 c3160, boolean z, long j) {
        C1103 c1103 = (C1103) ((ᵜᵪʾ) this).ˌᴵ;
        C3468 c3468 = c1103.f4706;
        C1103.m3566(c3468);
        c1103.f4701.getClass();
        c3468.m7906(SystemClock.elapsedRealtime());
        boolean z2 = c3160 != null && c3160.f12025;
        C1584 c1584 = c1103.f4714;
        C1103.m3565(c1584);
        if (!c1584.f6361.m5132(j, z2, z) || c3160 == null) {
            return;
        }
        c3160.f12025 = false;
    }

    @Override // defpackage.AbstractC2191
    /* JADX INFO: renamed from: ˑˊᵲ, reason: contains not printable characters */
    public final boolean mo4346() {
        return false;
    }

    /* JADX INFO: renamed from: ᵠˏˏ, reason: contains not printable characters */
    public final String m4347(String str) {
        if (str == null) {
            return "Activity";
        }
        String[] strArrSplit = str.split("\\.");
        int length = strArrSplit.length;
        String str2 = length > 0 ? strArrSplit[length - 1] : "";
        C1103 c1103 = (C1103) ((ᵜᵪʾ) this).ˌᴵ;
        int length2 = str2.length();
        c1103.f4726.getClass();
        if (length2 <= 500) {
            return str2;
        }
        c1103.f4726.getClass();
        return str2.substring(0, 500);
    }
}
