package o;

import android.os.Parcel;
import android.os.Parcelable;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public final class MV extends Ha0 implements Parcelable, B90 {
    public static final Parcelable.Creator<MV> CREATOR = new LV(0);
    public final D90 m;
    public C90 n;

    public MV(Object obj, D90 d90) {
        this.m = d90;
        AbstractC2220q90 abstractC2220q90K = AbstractC2884x90.k();
        C90 c90 = new C90(abstractC2220q90K.g(), obj);
        if (!(abstractC2220q90K instanceof WD)) {
            c90.b = new C90(1, obj);
        }
        this.n = c90;
    }

    @Override // o.Ga0
    public final Ia0 a() {
        return this.n;
    }

    @Override // o.Ga0
    public final Ia0 b(Ia0 ia0, Ia0 ia02, Ia0 ia03) {
        if (this.m.c(((C90) ia02).c, ((C90) ia03).c)) {
            return ia02;
        }
        return null;
    }

    @Override // o.Ga0
    public final void c(Ia0 ia0) {
        this.n = (C90) ia0;
    }

    @Override // o.B90
    public final D90 d() {
        return this.m;
    }

    @Override // android.os.Parcelable
    public final int describeContents() {
        return 0;
    }

    @Override // o.InterfaceC3007ya0
    public final Object getValue() {
        return ((C90) AbstractC2884x90.t(this.n, this)).c;
    }

    @Override // o.InterfaceC1191fR
    public final void setValue(Object obj) {
        AbstractC2220q90 abstractC2220q90K;
        C90 c90 = (C90) AbstractC2884x90.i(this.n);
        if (this.m.c(c90.c, obj)) {
            return;
        }
        C90 c902 = this.n;
        synchronized (AbstractC2884x90.c) {
            abstractC2220q90K = AbstractC2884x90.k();
            ((C90) AbstractC2884x90.o(c902, this, abstractC2220q90K, c90)).c = obj;
        }
        AbstractC2884x90.n(abstractC2220q90K, this);
    }

    public final String toString() {
        return "MutableState(value=" + ((C90) AbstractC2884x90.i(this.n)).c + ")@" + hashCode();
    }

    @Override // android.os.Parcelable
    public final void writeToParcel(Parcel parcel, int i) {
        int i2;
        parcel.writeValue(getValue());
        C0669Zu c0669Zu = C0669Zu.O;
        D90 d90 = this.m;
        if (F3.c(d90, c0669Zu)) {
            i2 = 0;
        } else if (F3.c(d90, ME.G)) {
            i2 = 1;
        } else {
            if (!F3.c(d90, C0669Zu.S)) {
                throw new IllegalStateException("Only known types of MutableState's SnapshotMutationPolicy are supported");
            }
            i2 = 2;
        }
        parcel.writeInt(i2);
    }
}
