package o;

import android.app.job.JobParameters;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Typeface;
import android.os.Process;
import android.os.StrictMode;
import android.util.LongSparseArray;
import android.view.View;
import android.view.accessibility.AccessibilityEvent;
import android.view.inputmethod.InputMethodManager;
import android.webkit.WebView;
import androidx.activity.ComponentActivity;
import androidx.work.impl.workers.ConstraintTrackingWorker;
import com.google.android.datatransport.runtime.scheduling.jobscheduling.JobInfoSchedulerService;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.api.CommonStatusCodes;
import com.google.firebase.messaging.FirebaseMessaging;
import ir.devixor.app.service.ForegroundService;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.Callable;
import java.util.concurrent.CountDownLatch;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public final /* synthetic */ class O3 implements Runnable {
    public final /* synthetic */ int l;
    public final /* synthetic */ Object m;
    public final /* synthetic */ Object n;

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

    @Override // java.lang.Runnable
    public final void run() throws SecurityException, IllegalArgumentException {
        InterfaceC0250Jq interfaceC0250Jq;
        Object h20;
        InterfaceC0220Im interfaceC0220Im = null;
        int i = 0;
        switch (this.l) {
            case 0:
                AbstractC1904ms0.d((Q3) this.m, (LongSparseArray) this.n);
                return;
            case 1:
                E7 e7 = (E7) this.m;
                Runnable runnable = (Runnable) this.n;
                e7.getClass();
                try {
                    runnable.run();
                    return;
                } finally {
                    e7.a();
                }
            case 2:
                ((InputMethodManager) ((C0599Xc) this.m).k.getValue()).showSoftInput((View) this.n, 1);
                return;
            case 3:
                ComponentActivity componentActivity = (ComponentActivity) this.m;
                ET et = (ET) this.n;
                int i2 = ComponentActivity.l;
                componentActivity.getLifecycle().a(new C2834wj(i, et, componentActivity));
                return;
            case 4:
                LU lu = (LU) this.m;
                DZ dz = (DZ) this.n;
                if (lu.b != LU.d) {
                    throw new IllegalStateException("provide() can be called only once.");
                }
                synchronized (lu) {
                    interfaceC0250Jq = lu.a;
                    lu.a = null;
                    lu.b = dz;
                }
                interfaceC0250Jq.a(dz);
                return;
            case 5:
                BK bk = (BK) this.m;
                DZ dz2 = (DZ) this.n;
                synchronized (bk) {
                    try {
                        if (bk.b == null) {
                            bk.a.add(dz2);
                        } else {
                            bk.b.add(dz2.get());
                        }
                    } finally {
                    }
                }
                return;
            case 6:
                List list = (List) this.m;
                AbstractC0452Rl abstractC0452Rl = (AbstractC0452Rl) this.n;
                Iterator it = list.iterator();
                while (it.hasNext()) {
                    ((C0037Bl) it.next()).a(abstractC0452Rl.e);
                }
                return;
            case 7:
                ConstraintTrackingWorker constraintTrackingWorker = (ConstraintTrackingWorker) this.m;
                YL yl = (YL) this.n;
                synchronized (constraintTrackingWorker.q) {
                    try {
                        if (constraintTrackingWorker.r) {
                            C2595u70 c2595u70 = constraintTrackingWorker.s;
                            int i3 = AbstractC0504Tl.a;
                            c2595u70.i(new C0708aM());
                        } else {
                            constraintTrackingWorker.s.k(yl);
                        }
                    } catch (Throwable th) {
                        throw th;
                    }
                }
                return;
            case 8:
                ((C0324Mn) this.m).c((String) this.n, Boolean.FALSE);
                return;
            case ConnectionResult.SERVICE_INVALID /* 9 */:
                ThreadFactoryC0325Mo threadFactoryC0325Mo = (ThreadFactoryC0325Mo) this.m;
                Runnable runnable2 = (Runnable) this.n;
                Process.setThreadPriority(threadFactoryC0325Mo.c);
                StrictMode.ThreadPolicy threadPolicy = threadFactoryC0325Mo.d;
                if (threadPolicy != null) {
                    StrictMode.setThreadPolicy(threadPolicy);
                }
                runnable2.run();
                return;
            case 10:
                Callable callable = (Callable) this.m;
                ScheduledFutureC1138er scheduledFutureC1138er = (ScheduledFutureC1138er) ((C0247Jn) this.n).m;
                try {
                    scheduledFutureC1138er.j(callable.call());
                    return;
                } catch (Exception e) {
                    scheduledFutureC1138er.k(e);
                    return;
                }
            case ConnectionResult.LICENSE_CHECK_FAILED /* 11 */:
                ((C0308Lx) this.m).a((Intent) this.n);
                return;
            case 12:
                FirebaseMessaging firebaseMessaging = (FirebaseMessaging) this.m;
                Qc0 qc0 = (Qc0) this.n;
                WT wt = FirebaseMessaging.l;
                firebaseMessaging.getClass();
                try {
                    qc0.b(firebaseMessaging.a());
                    return;
                } catch (Exception e2) {
                    qc0.a(e2);
                    return;
                }
            case 13:
                ForegroundService foregroundService = (ForegroundService) this.m;
                WebView webView = (WebView) this.n;
                boolean z = ForegroundService.w;
                try {
                    Bitmap bitmapCreateBitmap = Bitmap.createBitmap(webView.getWidth(), webView.getHeight(), Bitmap.Config.ARGB_8888);
                    webView.draw(new Canvas(bitmapCreateBitmap));
                    if (bitmapCreateBitmap.isRecycled() || bitmapCreateBitmap.getWidth() <= 0 || bitmapCreateBitmap.getHeight() <= 0) {
                        bitmapCreateBitmap.recycle();
                        foregroundService.v0();
                        h20 = Oh0.a;
                    } else {
                        C2468sq c2468sq = AbstractC1903ms.a;
                        h20 = AbstractC1692kh0.C(C80.e(ExecutorC1232fq.m), null, new C2105p(foregroundService, bitmapCreateBitmap, interfaceC0220Im, 23), 3);
                    }
                } catch (Throwable th2) {
                    h20 = new H20(th2);
                }
                if (I20.a(h20) != null) {
                    foregroundService.v0();
                    return;
                }
                return;
            case 14:
                C2511tG c2511tG = (C2511tG) this.m;
                Qc0 qc02 = (Qc0) this.n;
                try {
                    qc02.b(c2511tG.b());
                    return;
                } catch (Exception e3) {
                    qc02.a(e3);
                    return;
                }
            case 15:
                JobInfoSchedulerService jobInfoSchedulerService = (JobInfoSchedulerService) this.m;
                JobParameters jobParameters = (JobParameters) this.n;
                int i4 = JobInfoSchedulerService.l;
                jobInfoSchedulerService.jobFinished(jobParameters, false);
                return;
            case 16:
                ((C0720aY) this.m).b(((AccessibilityEvent) this.n).getSource());
                return;
            case 17:
                XY xy = (XY) this.m;
                C2366rm0 c2366rm0 = (C2366rm0) this.n;
                synchronized (xy.k) {
                    try {
                        ArrayList arrayList = xy.j;
                        int size = arrayList.size();
                        int i5 = 0;
                        while (i5 < size) {
                            Object obj = arrayList.get(i5);
                            i5++;
                            ((InterfaceC0645Yw) obj).b(c2366rm0, false);
                        }
                    } finally {
                    }
                }
                return;
            case ConnectionResult.SERVICE_UPDATING /* 18 */:
                C1541j20 c1541j20 = (C1541j20) this.m;
                CountDownLatch countDownLatch = (CountDownLatch) this.n;
                try {
                    Ug0.a().d.c(((C2156pc) c1541j20.h.f292o).b(HY.n), 1);
                } catch (Exception unused) {
                }
                countDownLatch.countDown();
                return;
            case 19:
                ((AbstractC0249Jp) this.m).V((Typeface) this.n);
                return;
            case 20:
                ((C1390hY) ((C2922xf0) this.m).c).E((C2627ua0) this.n, 3);
                return;
            case CommonStatusCodes.RECONNECTION_TIMED_OUT_DURING_UPDATE /* 21 */:
                RunnableC2082om0 runnableC2082om0 = (RunnableC2082om0) this.m;
                C2595u70 c2595u702 = (C2595u70) this.n;
                if (runnableC2082om0.l.l instanceof E) {
                    c2595u702.cancel(true);
                    return;
                } else {
                    c2595u702.k(runnableC2082om0.f666o.a());
                    return;
                }
            default:
                Lm0 lm0 = (Lm0) this.m;
                YL yl2 = (YL) this.n;
                if (lm0.A.l instanceof E) {
                    yl2.cancel(true);
                    return;
                }
                return;
        }
    }
}
