package o;

import android.content.Intent;
import android.view.ActionMode;
import com.google.firebase.messaging.EnhancedIntentService;
import java.util.ArrayList;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ThreadPoolExecutor;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.y5, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final /* synthetic */ class RunnableC2970y5 implements Runnable {
    public final /* synthetic */ int l;
    public final /* synthetic */ Object m;
    public final /* synthetic */ Object n;

    /* renamed from: o, reason: collision with root package name */
    public final /* synthetic */ Object f799o;

    public /* synthetic */ RunnableC2970y5(Object obj, Object obj2, Object obj3, int i) {
        this.l = i;
        this.m = obj;
        this.n = obj2;
        this.f799o = obj3;
    }

    @Override // java.lang.Runnable
    public final void run() {
        boolean zBooleanValue = true;
        switch (this.l) {
            case 0:
                A5 a5 = (A5) this.m;
                C2780w5 c2780w5 = (C2780w5) this.n;
                C2875x5 c2875x5 = (C2875x5) this.f799o;
                ActionMode actionModeStartActionMode = a5.a.startActionMode(new ActionModeCallbackC1914mz(c2780w5), 1);
                F3.c(a5.h, actionModeStartActionMode);
                if (actionModeStartActionMode == null) {
                    c2875x5.close();
                    return;
                }
                return;
            case 1:
                C0507To c0507To = (C0507To) this.m;
                AbstractC0249Jp abstractC0249Jp = (AbstractC0249Jp) this.n;
                ThreadPoolExecutor threadPoolExecutor = (ThreadPoolExecutor) this.f799o;
                try {
                    AA aaT = C1884mi0.t(c0507To.l);
                    if (aaT == null) {
                        throw new RuntimeException("EmojiCompat font provider not available on this device.");
                    }
                    C3075zA c3075zA = (C3075zA) ((InterfaceC1909mv) aaT.b);
                    synchronized (c3075zA.f821o) {
                        c3075zA.q = threadPoolExecutor;
                    }
                    ((InterfaceC1909mv) aaT.b).a(new C2194pv(abstractC0249Jp, threadPoolExecutor));
                    return;
                } catch (Throwable th) {
                    abstractC0249Jp.T(th);
                    threadPoolExecutor.shutdown();
                    return;
                }
            case 2:
                EnhancedIntentService enhancedIntentService = (EnhancedIntentService) this.m;
                Intent intent = (Intent) this.n;
                Qc0 qc0 = (Qc0) this.f799o;
                int i = EnhancedIntentService.l;
                enhancedIntentService.getClass();
                try {
                    enhancedIntentService.handleIntent(intent);
                    return;
                } finally {
                    qc0.b(null);
                }
            default:
                XY xy = (XY) this.m;
                YL yl = (YL) this.n;
                Lm0 lm0 = (Lm0) this.f799o;
                try {
                    zBooleanValue = ((Boolean) yl.get()).booleanValue();
                } catch (InterruptedException | ExecutionException unused) {
                }
                synchronized (xy.k) {
                    try {
                        C2366rm0 c2366rm0O = C2887xC.o(lm0.n);
                        String str = c2366rm0O.a;
                        if (xy.c(str) == lm0) {
                            xy.b(str);
                        }
                        C0669Zu.e().getClass();
                        ArrayList arrayList = xy.j;
                        int size = arrayList.size();
                        int i2 = 0;
                        while (i2 < size) {
                            Object obj = arrayList.get(i2);
                            i2++;
                            ((InterfaceC0645Yw) obj).b(c2366rm0O, zBooleanValue);
                        }
                    } catch (Throwable th2) {
                        throw th2;
                    }
                }
                return;
        }
    }
}
