package l8;

import androidx.lifecycle.f0;
import androidx.lifecycle.g0;
import androidx.lifecycle.u;
import java.util.concurrent.atomic.AtomicBoolean;
import kotlin.jvm.internal.k;
import kotlin.jvm.internal.t;

/* loaded from: classes.dex */
public final class g extends f0 {

    /* renamed from: m, reason: collision with root package name */
    public static final a f27802m = new a(null);

    /* renamed from: n, reason: collision with root package name */
    public static final int f27803n = 8;

    /* renamed from: o, reason: collision with root package name */
    private static final String f27804o = "SingleLiveEvent";

    /* renamed from: l, reason: collision with root package name */
    private final AtomicBoolean f27805l = new AtomicBoolean(false);

    /* loaded from: classes.dex */
    public static final class a {
        private a() {
        }

        public /* synthetic */ a(k kVar) {
            this();
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void t(g this$0, g0 observer, Object obj) {
        t.g(this$0, "this$0");
        t.g(observer, "$observer");
        if (this$0.f27805l.compareAndSet(true, false)) {
            observer.d(obj);
        }
    }

    @Override // androidx.lifecycle.a0
    public void j(u owner, final g0 observer) {
        t.g(owner, "owner");
        t.g(observer, "observer");
        if (h()) {
            tr.a.f36618a.f(f27804o, "Multiple observers registered but only one will be notified of changes.");
        }
        super.j(owner, new g0() { // from class: l8.f
            @Override // androidx.lifecycle.g0
            public final void d(Object obj) {
                g.t(g.this, observer, obj);
            }
        });
    }

    @Override // androidx.lifecycle.f0, androidx.lifecycle.a0
    public void q(Object obj) {
        this.f27805l.set(true);
        super.q(obj);
    }

    public final void s() {
        q(null);
    }
}
