package com.bumptech.glide.h.a;

import android.support.v4.f.k$a;
import android.util.Log;
import com.bumptech.glide.h.a.a.a;
import com.bumptech.glide.h.a.a.c;
import com.bumptech.glide.h.a.a.d;
import com.tencent.matrix.trace.core.AppMethodBeat;

final class a$b<T> implements k$a<T> {
    private final k$a<T> aAr;
    private final a<T> aIj;
    private final d<T> aIk;

    a$b(k$a<T> k_a, a<T> aVar, d<T> dVar) {
        this.aAr = k_a;
        this.aIj = aVar;
        this.aIk = dVar;
    }

    public final T aA() {
        AppMethodBeat.i(92618);
        T aA = this.aAr.aA();
        if (aA == null) {
            aA = this.aIj.mG();
            if (Log.isLoggable("FactoryPools", 2)) {
                new StringBuilder("Created new ").append(aA.getClass());
            }
        }
        if (aA instanceof c) {
            ((c) aA).my().ay(false);
        }
        AppMethodBeat.o(92618);
        return aA;
    }

    public final boolean release(T t) {
        AppMethodBeat.i(92619);
        if (t instanceof c) {
            ((c) t).my().ay(true);
        }
        this.aIk.reset(t);
        boolean release = this.aAr.release(t);
        AppMethodBeat.o(92619);
        return release;
    }
}
