package defpackage;

import android.content.Context;
import android.content.pm.PackageManager;
import android.os.Handler;
import j$.util.DesugarCollections;
import j$.util.Objects;
import java.util.ArrayList;
import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/* JADX INFO: renamed from: ᵮˎˏᵛ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C4217 implements InterfaceC3885 {

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public final C3421 f16060;

    /* JADX INFO: renamed from: ˊᵫᵗ, reason: contains not printable characters */
    public ˋˀᵧ f16061;

    /* JADX INFO: renamed from: ːˏᵟᵯ, reason: contains not printable characters */
    public final C3814 f16062;

    /* JADX INFO: renamed from: ᵨᵣ, reason: contains not printable characters */
    public Handler f16063;

    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public final Context f16064;

    /* JADX INFO: renamed from: ᵵᵽ, reason: contains not printable characters */
    public ThreadPoolExecutor f16065;

    /* JADX INFO: renamed from: ᵷᵺʾᵖ, reason: contains not printable characters */
    public final Object f16066 = new Object();

    /* JADX INFO: renamed from: ᵻˈᵦʼ, reason: contains not printable characters */
    public ThreadPoolExecutor f16067;

    public C4217(Context context, C3421 c3421) {
        ᵫﾞˌ.ᵷᵺʾᵖ(context, "Context cannot be null");
        this.f16064 = context.getApplicationContext();
        this.f16060 = c3421;
        this.f16062 = C2764.f10624;
    }

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public final void m9160() {
        synchronized (this.f16066) {
            try {
                this.f16061 = null;
                Handler handler = this.f16063;
                if (handler != null) {
                    handler.removeCallbacks(null);
                }
                this.f16063 = null;
                ThreadPoolExecutor threadPoolExecutor = this.f16065;
                if (threadPoolExecutor != null) {
                    threadPoolExecutor.shutdown();
                }
                this.f16067 = null;
                this.f16065 = null;
            } catch (Throwable th) {
                throw th;
            }
        }
    }

    /* JADX INFO: renamed from: ːˏᵟᵯ, reason: contains not printable characters */
    public final void m9161() {
        synchronized (this.f16066) {
            try {
                if (this.f16061 == null) {
                    return;
                }
                if (this.f16067 == null) {
                    ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(0, 1, 15L, TimeUnit.SECONDS, new LinkedBlockingDeque(), new ThreadFactoryC3236(0, "emojiCompat"));
                    threadPoolExecutor.allowCoreThreadTimeOut(true);
                    this.f16065 = threadPoolExecutor;
                    this.f16067 = threadPoolExecutor;
                }
                this.f16067.execute(new RunnableC2846(25, this));
            } catch (Throwable th) {
                throw th;
            }
        }
    }

    @Override // defpackage.InterfaceC3885
    /* JADX INFO: renamed from: ᵲᵶᵳˈ */
    public final void mo4754(ˋˀᵧ r2) {
        synchronized (this.f16066) {
            this.f16061 = r2;
        }
        m9161();
    }

    /* JADX INFO: renamed from: ᵷᵺʾᵖ, reason: contains not printable characters */
    public final C4821 m9162() {
        try {
            C3814 c3814 = this.f16062;
            Context context = this.f16064;
            C3421 c3421 = this.f16060;
            c3814.getClass();
            Object[] objArr = {c3421};
            ArrayList arrayList = new ArrayList(1);
            Object obj = objArr[0];
            Objects.requireNonNull(obj);
            arrayList.add(obj);
            C1542 c1542M3444 = AbstractC1042.m3444(context, DesugarCollections.unmodifiableList(arrayList));
            int i = c1542M3444.f6206;
            if (i != 0) {
                C4935.m10237(AbstractC0793.m2876(i, "fetchFonts failed (", ")"));
                return null;
            }
            C4821[] c4821Arr = (C4821[]) c1542M3444.f6205.get(0);
            if (c4821Arr != null && c4821Arr.length != 0) {
                return c4821Arr[0];
            }
            C4935.m10237("fetchFonts failed (empty result)");
            return null;
        } catch (PackageManager.NameNotFoundException e) {
            ᵷᵝˎ.ᵪᵹᵥᵻ("provider not found", e);
            return null;
        }
    }
}
