package kotlinx.coroutines.channels;

import java.util.concurrent.CancellationException;
import kotlin.coroutines.Continuation;
import kotlinx.coroutines.JobCancellationException;
import kotlinx.coroutines.e1;
import kotlinx.coroutines.q;

/* JADX INFO: loaded from: classes.dex */
public final class k extends kotlinx.coroutines.a implements l, e {

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final e f29342d;

    public k(kotlin.coroutines.h hVar, b bVar) {
        super(hVar, true);
        this.f29342d = bVar;
    }

    @Override // kotlinx.coroutines.a
    public final void Y(Throwable th, boolean z10) {
        if (this.f29342d.b(th) || z10) {
            return;
        }
        hb.a.g0(this.f29289c, th);
    }

    @Override // kotlinx.coroutines.a
    public final void Z(Object obj) {
        this.f29342d.b(null);
    }

    @Override // kotlinx.coroutines.channels.n
    public final void a(sd.l lVar) {
        this.f29342d.a(lVar);
    }

    @Override // kotlinx.coroutines.channels.n
    public final boolean b(Throwable th) {
        return this.f29342d.b(th);
    }

    @Override // kotlinx.coroutines.channels.n
    public final Object c(Object obj) {
        return this.f29342d.c(obj);
    }

    @Override // kotlinx.coroutines.g1, kotlinx.coroutines.y0, kotlinx.coroutines.channels.m
    public final void e(CancellationException cancellationException) {
        Object objG = G();
        if (objG instanceof q) {
            return;
        }
        if ((objG instanceof e1) && ((e1) objG).c()) {
            return;
        }
        if (cancellationException == null) {
            cancellationException = new JobCancellationException(t(), null, this);
        }
        r(cancellationException);
    }

    @Override // kotlinx.coroutines.channels.n
    public final Object i(Object obj, Continuation continuation) {
        return this.f29342d.i(obj, continuation);
    }

    @Override // kotlinx.coroutines.a, kotlinx.coroutines.g1, kotlinx.coroutines.y0
    public final boolean isActive() {
        return super.isActive();
    }

    @Override // kotlinx.coroutines.channels.m
    public final a iterator() {
        return this.f29342d.iterator();
    }

    @Override // kotlinx.coroutines.channels.n
    public final boolean j() {
        return this.f29342d.j();
    }

    @Override // kotlinx.coroutines.g1
    public final void r(CancellationException cancellationException) {
        this.f29342d.e(cancellationException);
        q(cancellationException);
    }
}
