package z;

import h2.n0;
import j2.e1;
import j2.f1;
import l1.i;

/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes.dex */
public final class v extends i.c implements j2.h, e1 {
    private n0.a C;
    private boolean D;
    private final boolean E;

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes.dex */
    public static final class a extends kotlin.jvm.internal.v implements dn.a {

        /* renamed from: p, reason: collision with root package name */
        final /* synthetic */ kotlin.jvm.internal.o0 f53069p;

        /* renamed from: q, reason: collision with root package name */
        final /* synthetic */ v f53070q;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        a(kotlin.jvm.internal.o0 o0Var, v vVar) {
            super(0);
            this.f53069p = o0Var;
            this.f53070q = vVar;
        }

        @Override // dn.a
        public /* bridge */ /* synthetic */ Object invoke() {
            m490invoke();
            return rm.n0.f34904a;
        }

        /* renamed from: invoke, reason: collision with other method in class */
        public final void m490invoke() {
            this.f53069p.f26199p = j2.i.a(this.f53070q, h2.o0.a());
        }
    }

    private final h2.n0 h2() {
        kotlin.jvm.internal.o0 o0Var = new kotlin.jvm.internal.o0();
        f1.a(this, new a(o0Var, this));
        return (h2.n0) o0Var.f26199p;
    }

    @Override // l1.i.c
    public boolean M1() {
        return this.E;
    }

    @Override // l1.i.c
    public void T1() {
        n0.a aVar = this.C;
        if (aVar != null) {
            aVar.release();
        }
        this.C = null;
    }

    @Override // j2.e1
    public void V0() {
        h2.n0 h22 = h2();
        if (this.D) {
            n0.a aVar = this.C;
            if (aVar != null) {
                aVar.release();
            }
            this.C = h22 != null ? h22.a() : null;
        }
    }

    public final void i2(boolean z10) {
        if (z10) {
            h2.n0 h22 = h2();
            this.C = h22 != null ? h22.a() : null;
        } else {
            n0.a aVar = this.C;
            if (aVar != null) {
                aVar.release();
            }
            this.C = null;
        }
        this.D = z10;
    }
}
