package ඓ.ῲ.K;

import android.content.ComponentCallbacks2;
import android.content.Context;
import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
import com.bumptech.glide.Priority;
import java.io.File;
import java.util.concurrent.CopyOnWriteArrayList;
import ඓ.ῲ.K.ᓣ.C0845;
import ඓ.ῲ.K.ᕣ.ᕣ.ⁱ.C0901;
import ඓ.ῲ.K.ᕣ.ᨨ.AbstractC0951;
import ඓ.ῲ.K.㑃.AbstractC1167;
import ඓ.ῲ.K.㑃.AbstractC1175;
import ඓ.ῲ.K.㑃.AbstractC1186;
import ඓ.ῲ.K.㑃.AbstractC1187;
import ඓ.ῲ.K.㑃.AbstractC1188;
import ඓ.ῲ.K.㑃.C1169;
import ඓ.ῲ.K.㑃.C1170;
import ඓ.ῲ.K.㑃.C1185;
import ඓ.ῲ.K.㗗.AbstractC1189;
import ඓ.ῲ.K.㗗.AbstractC1198;
import ඓ.ῲ.K.㗗.AbstractC1200;
import ඓ.ῲ.K.㗗.C1190;
import ඓ.ῲ.K.㗗.㿎.AbstractC1211;

/* renamed from: ඓ.ῲ.K.ⁱ  reason: contains not printable characters */
/* compiled from: RequestManager */
public class ComponentCallbacks2C1163 implements ComponentCallbacks2, AbstractC1175, AbstractC0823<C1218<Drawable>> {

    /* renamed from: Ԕ  reason: contains not printable characters */
    public static final C1190 f4675;

    /* renamed from: 㗗  reason: contains not printable characters */
    public static final C1190 f4676;

    /* renamed from: ʬ  reason: contains not printable characters */
    public final Context f4677;

    /* renamed from: ඓ  reason: contains not printable characters */
    public final C1169 f4678;

    /* renamed from: ᕣ  reason: contains not printable characters */
    public final CopyOnWriteArrayList<AbstractC1200<Object>> f4679;

    /* renamed from: ᨨ  reason: contains not printable characters */
    public final Handler f4680 = new Handler(Looper.getMainLooper());

    /* renamed from: ῲ  reason: contains not printable characters */
    public final ComponentCallbacks2C1161 f4681;

    /* renamed from: ⁱ  reason: contains not printable characters */
    public final C1170 f4682 = new C1170();

    /* renamed from: 㑃  reason: contains not printable characters */
    public C1190 f4683;

    /* renamed from: 㳳  reason: contains not printable characters */
    public final AbstractC1167 f4684;

    /* renamed from: 㴹  reason: contains not printable characters */
    public final AbstractC1188 f4685;

    /* renamed from: 㸾  reason: contains not printable characters */
    public final AbstractC1187 f4686;

    /* renamed from: 㿎  reason: contains not printable characters */
    public final Runnable f4687 = new RunnableC1165();

    /* renamed from: 䁗  reason: contains not printable characters */
    public boolean f4688;

    /* renamed from: ඓ.ῲ.K.ⁱ$ῲ  reason: contains not printable characters */
    /* compiled from: RequestManager */
    public class C1164 implements AbstractC1167.AbstractC1168 {

        /* renamed from: K  reason: contains not printable characters */
        public final C1169 f4690;

        public C1164(C1169 r2) {
            this.f4690 = r2;
        }

        /* renamed from: K  reason: contains not printable characters */
        public void m3129(boolean z) {
            if (z) {
                synchronized (ComponentCallbacks2C1163.this) {
                    C1169 r0 = this.f4690;
                    for (AbstractC1189 r2 : C0845.m2457(r0.f4694)) {
                        if (!r2.m3178() && !r2.m3182()) {
                            r2.clear();
                            if (!r0.f4692) {
                                r2.m3179();
                            } else {
                                r0.f4693.add(r2);
                            }
                        }
                    }
                }
            }
        }
    }

    /* renamed from: ඓ.ῲ.K.ⁱ$K  reason: contains not printable characters */
    /* compiled from: RequestManager */
    public class RunnableC1165 implements Runnable {
        public RunnableC1165() {
        }

        public void run() {
            ComponentCallbacks2C1163 r0 = ComponentCallbacks2C1163.this;
            r0.f4686.m3176(r0);
        }
    }

    static {
        C1190 r0 = (C1190) new C1190().m3221(Bitmap.class);
        r0.f4742 = true;
        f4675 = r0;
        C1190 r02 = (C1190) new C1190().m3221(C0901.class);
        r02.f4742 = true;
        f4676 = r02;
        C1190 r03 = (C1190) ((C1190) C1190.m3183(AbstractC0951.f4299).m3219(Priority.LOW)).m3228(true);
    }

    public ComponentCallbacks2C1163(ComponentCallbacks2C1161 r5, AbstractC1187 r6, AbstractC1188 r7, Context context) {
        C1169 r0 = new C1169();
        AbstractC1186 r1 = r5.f4674;
        this.f4681 = r5;
        this.f4686 = r6;
        this.f4685 = r7;
        this.f4678 = r0;
        this.f4677 = context;
        this.f4684 = ((C1185) r1).m3174(context.getApplicationContext(), new C1164(r0));
        if (C0845.m2450()) {
            this.f4680.post(this.f4687);
        } else {
            r6.m3176(this);
        }
        r6.m3176(this.f4684);
        this.f4679 = new CopyOnWriteArrayList<>(r5.f4673.f4847);
        m3122(r5.f4673.m3294());
        r5.m3110(this);
    }

    public void onConfigurationChanged(Configuration configuration) {
    }

    public void onLowMemory() {
    }

    @Override // ඓ.ῲ.K.㑃.AbstractC1175
    public synchronized void onStop() {
        m3125();
        this.f4682.onStop();
    }

    public void onTrimMemory(int i) {
        if (i == 60 && this.f4688) {
            m3114();
        }
    }

    public synchronized String toString() {
        return super.toString() + "{tracker=" + this.f4678 + ", treeNode=" + this.f4685 + "}";
    }

    /* renamed from: ඓ  reason: contains not printable characters */
    public C1218<Drawable> m3112() {
        return m3120(Drawable.class);
    }

    /* renamed from: ᕣ  reason: contains not printable characters */
    public synchronized void m3113() {
        C1169 r0 = this.f4678;
        r0.f4692 = false;
        for (AbstractC1189 r2 : C0845.m2457(r0.f4694)) {
            if (!r2.m3178() && !r2.isRunning()) {
                r2.m3179();
            }
        }
        r0.f4693.clear();
    }

    /* renamed from: ᨨ  reason: contains not printable characters */
    public synchronized void m3114() {
        m3128();
        for (ComponentCallbacks2C1163 r1 : this.f4685.m3177()) {
            r1.m3128();
        }
    }

    @Override // ඓ.ῲ.K.㑃.AbstractC1175
    /* renamed from: ῲ  reason: contains not printable characters */
    public synchronized void m3115() {
        this.f4682.m3131();
        for (AbstractC1211<?> r1 : C0845.m2457(this.f4682.f4695)) {
            m3123(r1);
        }
        this.f4682.f4695.clear();
        C1169 r0 = this.f4678;
        for (AbstractC1189 r2 : C0845.m2457(r0.f4694)) {
            r0.m3130(r2);
        }
        r0.f4693.clear();
        this.f4686.m3175(this);
        this.f4686.m3175(this.f4684);
        this.f4680.removeCallbacks(this.f4687);
        this.f4681.m3109(this);
    }

    /* renamed from: ⁱ  reason: contains not printable characters */
    public synchronized C1190 m3117() {
        return this.f4683;
    }

    /* renamed from: K  reason: contains not printable characters */
    public synchronized void m3122(C1190 r2) {
        C1190 r22 = (C1190) r2.clone();
        if (r22.f4742) {
            if (!r22.f4747) {
                throw new IllegalStateException("You cannot auto lock an already locked options object, try clone() first");
            }
        }
        r22.f4747 = true;
        r22.f4742 = true;
        this.f4683 = r22;
    }

    /* renamed from: 㳳  reason: contains not printable characters */
    public synchronized void m3125() {
        C1169 r0 = this.f4678;
        r0.f4692 = true;
        for (AbstractC1189 r2 : C0845.m2457(r0.f4694)) {
            if (r2.isRunning()) {
                r2.pause();
                r0.f4693.add(r2);
            }
        }
    }

    /* renamed from: 㴹  reason: contains not printable characters */
    public C1218<C0901> m3126() {
        return m3120(C0901.class).m3292((AbstractC1198<?>) f4676);
    }

    /* renamed from: 㸾  reason: contains not printable characters */
    public C1218<Bitmap> m3127() {
        return m3120(Bitmap.class).m3292((AbstractC1198<?>) f4675);
    }

    /* renamed from: 㿎  reason: contains not printable characters */
    public synchronized void m3128() {
        C1169 r0 = this.f4678;
        r0.f4692 = true;
        for (AbstractC1189 r2 : C0845.m2457(r0.f4694)) {
            if (r2.isRunning() || r2.m3178()) {
                r2.clear();
                r0.f4693.add(r2);
            }
        }
    }

    @Override // ඓ.ῲ.K.㑃.AbstractC1175
    /* renamed from: K  reason: contains not printable characters */
    public synchronized void m3121() {
        m3113();
        this.f4682.m3132();
    }

    /* renamed from: K  reason: contains not printable characters */
    public C1218<Drawable> m3118(Bitmap bitmap) {
        C1218<Drawable> r0 = m3112();
        r0.f4833 = bitmap;
        r0.f4841 = true;
        return r0.m3292((AbstractC1198<?>) C1190.m3183(AbstractC0951.f4300));
    }

    /* renamed from: K  reason: contains not printable characters */
    public C1218<Drawable> m3119(File file) {
        C1218<Drawable> r0 = m3112();
        r0.f4833 = file;
        r0.f4841 = true;
        return r0;
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public synchronized boolean m3116(AbstractC1211<?> r4) {
        AbstractC1189 r0 = r4.m3266();
        if (r0 == null) {
            return true;
        }
        if (!this.f4678.m3130(r0)) {
            return false;
        }
        this.f4682.f4695.remove(r4);
        r4.m3272((AbstractC1189) null);
        return true;
    }

    /* renamed from: K  reason: contains not printable characters */
    public <ResourceType> C1218<ResourceType> m3120(Class<ResourceType> cls) {
        return new C1218<>(this.f4681, this, cls, this.f4677);
    }

    /* renamed from: K  reason: contains not printable characters */
    public void m3123(AbstractC1211<?> r3) {
        if (r3 != null) {
            boolean r0 = m3116(r3);
            AbstractC1189 r1 = r3.m3266();
            if (!r0 && !this.f4681.m3111(r3) && r1 != null) {
                r3.m3272((AbstractC1189) null);
                r1.clear();
            }
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public synchronized void m3124(AbstractC1211<?> r3, AbstractC1189 r4) {
        this.f4682.f4695.add(r3);
        C1169 r32 = this.f4678;
        r32.f4694.add(r4);
        if (!r32.f4692) {
            r4.m3179();
        } else {
            r4.clear();
            if (Log.isLoggable("RequestTracker", 2)) {
                Log.v("RequestTracker", "Paused, delaying request");
            }
            r32.f4693.add(r4);
        }
    }
}
