package defpackage;

/* renamed from: ᵘᵱˈᵠ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class RunnableC2538 implements Runnable {

    /* renamed from: ᵢˇᵭ, reason: contains not printable characters */
    public final /* synthetic */ String f9891;

    /* renamed from: ᵧᵾˀˈ, reason: contains not printable characters */
    public final /* synthetic */ int f9892;

    /* renamed from: ᵾᵬ, reason: contains not printable characters */
    public final /* synthetic */ C4198 f9893;

    /* renamed from: ᵿʗᵝʽ, reason: contains not printable characters */
    public final /* synthetic */ long f9894;

    public /* synthetic */ RunnableC2538(C4198 c4198, String str, long j, int i) {
        this.f9892 = i;
        this.f9891 = str;
        this.f9894 = j;
        this.f9893 = c4198;
    }

    @Override // java.lang.Runnable
    public final void run() {
        int i = this.f9892;
        long j = this.f9894;
        String str = this.f9891;
        C4198 c4198 = this.f9893;
        switch (i) {
            case 0:
                c4198.m6590();
                ᵩʛʽ.ˏˋٴ(str);
                C1200 c1200 = c4198.f15686;
                if (c1200.isEmpty()) {
                    c4198.f15685 = j;
                }
                Integer num = (Integer) c1200.get(str);
                if (num == null) {
                    if (c1200.f10698 < 100) {
                        c1200.put(str, 1);
                        c4198.f15684.put(str, Long.valueOf(j));
                        break;
                    } else {
                        C1736 c1736 = ((C4205) ((ᵢˇᵭ) c4198).ᵧᵾˀˈ).f15715;
                        C4205.m9132(c1736);
                        c1736.f6934.m6038("Too many ads visible");
                        break;
                    }
                } else {
                    c1200.put(str, Integer.valueOf(num.intValue() + 1));
                    break;
                }
            default:
                c4198.m6590();
                ᵩʛʽ.ˏˋٴ(str);
                C1200 c12002 = c4198.f15686;
                Integer num2 = (Integer) c12002.get(str);
                C4205 c4205 = (C4205) ((ᵢˇᵭ) c4198).ᵧᵾˀˈ;
                if (num2 == null) {
                    C1736 c17362 = c4205.f15715;
                    C4205.m9132(c17362);
                    c17362.f6937.m6039(str, "Call to endAdUnitExposure for unknown ad unit id");
                    break;
                } else {
                    C3476 c3476 = c4205.f15718;
                    C1736 c17363 = c4205.f15715;
                    C4205.m9130(c3476);
                    C5465 c5465M7909 = c3476.m7909(false);
                    int iIntValue = num2.intValue() - 1;
                    if (iIntValue != 0) {
                        c12002.put(str, Integer.valueOf(iIntValue));
                        break;
                    } else {
                        c12002.remove(str);
                        C1200 c12003 = c4198.f15684;
                        Long l = (Long) c12003.get(str);
                        if (l == null) {
                            C4205.m9132(c17363);
                            c17363.f6937.m6038("First ad unit exposure time was never set");
                        } else {
                            long jLongValue = j - l.longValue();
                            c12003.remove(str);
                            c4198.m9120(str, jLongValue, c5465M7909);
                        }
                        if (c12002.isEmpty()) {
                            long j2 = c4198.f15685;
                            if (j2 != 0) {
                                c4198.m9121(j - j2, c5465M7909);
                                c4198.f15685 = 0L;
                                break;
                            } else {
                                C4205.m9132(c17363);
                                c17363.f6937.m6038("First ad exposure time was never set");
                                break;
                            }
                        }
                    }
                }
                break;
        }
    }
}
