package fi;

import android.util.Log;
import java.util.ArrayList;
import java.util.List;
import s3.h;

/* loaded from: classes4.dex */
public abstract class a {

    /* renamed from: a, reason: collision with root package name */
    private static final g f18506a = new C0402a();

    /* renamed from: fi.a$a, reason: collision with other inner class name */
    /* loaded from: classes4.dex */
    class C0402a implements g {
        C0402a() {
        }

        @Override // fi.a.g
        public void a(Object obj) {
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes4.dex */
    public class b implements d {
        b() {
        }

        @Override // fi.a.d
        /* renamed from: b, reason: merged with bridge method [inline-methods] */
        public List a() {
            return new ArrayList();
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes4.dex */
    public class c implements g {
        c() {
        }

        @Override // fi.a.g
        /* renamed from: b, reason: merged with bridge method [inline-methods] */
        public void a(List list) {
            list.clear();
        }
    }

    /* loaded from: classes4.dex */
    public interface d {
        Object a();
    }

    /* JADX INFO: Access modifiers changed from: private */
    /* loaded from: classes4.dex */
    public static final class e implements s3.f {

        /* renamed from: a, reason: collision with root package name */
        private final d f18507a;

        /* renamed from: b, reason: collision with root package name */
        private final g f18508b;

        /* renamed from: c, reason: collision with root package name */
        private final s3.f f18509c;

        e(s3.f fVar, d dVar, g gVar) {
            this.f18509c = fVar;
            this.f18507a = dVar;
            this.f18508b = gVar;
        }

        @Override // s3.f
        public boolean a(Object obj) {
            if (obj instanceof f) {
                ((f) obj).m().b(true);
            }
            this.f18508b.a(obj);
            return this.f18509c.a(obj);
        }

        @Override // s3.f
        public Object b() {
            Object b10 = this.f18509c.b();
            if (b10 == null) {
                b10 = this.f18507a.a();
                if (Log.isLoggable("FactoryPools", 2)) {
                    Log.v("FactoryPools", "Created new " + b10.getClass());
                }
            }
            if (b10 instanceof f) {
                ((f) b10).m().b(false);
            }
            return b10;
        }
    }

    /* loaded from: classes4.dex */
    public interface f {
        fi.c m();
    }

    /* loaded from: classes4.dex */
    public interface g {
        void a(Object obj);
    }

    private static s3.f a(s3.f fVar, d dVar) {
        return b(fVar, dVar, c());
    }

    private static s3.f b(s3.f fVar, d dVar, g gVar) {
        return new e(fVar, dVar, gVar);
    }

    private static g c() {
        return f18506a;
    }

    public static s3.f d(int i10, d dVar) {
        return a(new h(i10), dVar);
    }

    public static s3.f e() {
        return f(20);
    }

    public static s3.f f(int i10) {
        return b(new h(i10), new b(), new c());
    }
}
