package d3;

import android.os.Bundle;
import android.os.RemoteException;
import android.text.TextUtils;
import java.util.ArrayList;
import java.util.Collections;
import java.util.concurrent.atomic.AtomicReference;

/* JADX INFO: renamed from: d3.s0, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final /* synthetic */ class RunnableC0820s0 implements Runnable {

    /* JADX INFO: renamed from: q, reason: collision with root package name */
    public final /* synthetic */ int f12165q = 2;

    /* JADX INFO: renamed from: r, reason: collision with root package name */
    public final /* synthetic */ String f12166r;

    /* JADX INFO: renamed from: s, reason: collision with root package name */
    public final /* synthetic */ X1 f12167s;

    /* JADX INFO: renamed from: t, reason: collision with root package name */
    public final /* synthetic */ Object f12168t;

    /* JADX INFO: renamed from: u, reason: collision with root package name */
    public final /* synthetic */ Object f12169u;

    /* JADX INFO: renamed from: v, reason: collision with root package name */
    public final /* synthetic */ Object f12170v;

    public /* synthetic */ RunnableC0820s0(BinderC0841z0 binderC0841z0, X1 x12, Bundle bundle, M m8, String str) {
        this.f12168t = binderC0841z0;
        this.f12167s = x12;
        this.f12169u = bundle;
        this.f12170v = m8;
        this.f12166r = str;
    }

    @Override // java.lang.Runnable
    public final void run() {
        AtomicReference atomicReference;
        C0824t1 c0824t1;
        K k8;
        W1 w12;
        K k9;
        switch (this.f12165q) {
            case n4.u0.f15495q /* 0 */:
                M m8 = (M) this.f12170v;
                BinderC0841z0 binderC0841z0 = (BinderC0841z0) this.f12168t;
                Q1 q12 = binderC0841z0.f12234e;
                q12.j();
                try {
                    m8.p(q12.i((Bundle) this.f12169u, this.f12167s));
                    return;
                } catch (RemoteException e8) {
                    binderC0841z0.f12234e.e().f11875v.d("Failed to return trigger URIs for app", this.f12166r, e8);
                    return;
                }
            case 1:
                AtomicReference atomicReference2 = (AtomicReference) this.f12168t;
                synchronized (atomicReference2) {
                    try {
                        try {
                            c0824t1 = (C0824t1) this.f12170v;
                            k8 = c0824t1.f12179t;
                        } catch (RemoteException e9) {
                            Z z8 = ((C0817r0) ((C0824t1) this.f12170v).f5146q).f12150y;
                            C0817r0.k(z8);
                            z8.f11875v.e("(legacy) Failed to get conditional properties; remote exception", null, this.f12166r, e9);
                            ((AtomicReference) this.f12168t).set(Collections.EMPTY_LIST);
                            atomicReference = (AtomicReference) this.f12168t;
                        }
                        if (k8 == null) {
                            Z z9 = ((C0817r0) c0824t1.f5146q).f12150y;
                            C0817r0.k(z9);
                            z9.f11875v.e("(legacy) Failed to get conditional properties; not connected to service", null, this.f12166r, (String) this.f12169u);
                            atomicReference2.set(Collections.EMPTY_LIST);
                            atomicReference2.notify();
                            return;
                        }
                        if (TextUtils.isEmpty(null)) {
                            atomicReference2.set(k8.g(this.f12166r, (String) this.f12169u, this.f12167s));
                        } else {
                            atomicReference2.set(k8.o(null, this.f12166r, (String) this.f12169u));
                        }
                        c0824t1.U();
                        atomicReference = (AtomicReference) this.f12168t;
                        atomicReference.notify();
                        return;
                    } catch (Throwable th) {
                        ((AtomicReference) this.f12168t).notify();
                        throw th;
                    }
                }
            default:
                com.google.android.gms.internal.measurement.L l8 = (com.google.android.gms.internal.measurement.L) this.f12169u;
                String str = (String) this.f12168t;
                String str2 = this.f12166r;
                C0824t1 c0824t12 = (C0824t1) this.f12170v;
                C0817r0 c0817r0 = (C0817r0) c0824t12.f5146q;
                ArrayList arrayList = new ArrayList();
                try {
                    try {
                        k9 = c0824t12.f12179t;
                    } catch (RemoteException e10) {
                        Z z10 = c0817r0.f12150y;
                        C0817r0.k(z10);
                        z10.f11875v.e("Failed to get conditional properties; remote exception", str2, str, e10);
                    }
                    if (k9 != null) {
                        arrayList = W1.R(k9.g(str2, str, this.f12167s));
                        c0824t12.U();
                        w12 = c0817r0.f12122B;
                        C0817r0.i(w12);
                        w12.b0(l8, arrayList);
                        return;
                    }
                    Z z11 = c0817r0.f12150y;
                    C0817r0.k(z11);
                    z11.f11875v.d("Failed to get conditional properties; not connected to service", str2, str);
                    w12 = c0817r0.f12122B;
                    C0817r0.i(w12);
                    w12.b0(l8, arrayList);
                    return;
                } catch (Throwable th2) {
                    W1 w13 = c0817r0.f12122B;
                    C0817r0.i(w13);
                    w13.b0(l8, arrayList);
                    throw th2;
                }
        }
    }

    public RunnableC0820s0(C0824t1 c0824t1, String str, String str2, X1 x12, com.google.android.gms.internal.measurement.L l8) {
        this.f12166r = str;
        this.f12168t = str2;
        this.f12167s = x12;
        this.f12169u = l8;
        this.f12170v = c0824t1;
    }

    public RunnableC0820s0(C0824t1 c0824t1, AtomicReference atomicReference, String str, String str2, X1 x12) {
        this.f12168t = atomicReference;
        this.f12166r = str;
        this.f12169u = str2;
        this.f12167s = x12;
        this.f12170v = c0824t1;
    }
}
