package l6;

import android.os.Parcel;
import android.os.Parcelable;
import androidx.work.ListenableWorker;

/* loaded from: classes.dex */
public class f implements Parcelable {
    public static final Parcelable.Creator<f> CREATOR = new a();

    /* renamed from: p, reason: collision with root package name */
    private final ListenableWorker.a f27500p;

    /* loaded from: classes.dex */
    class a implements Parcelable.Creator {
        a() {
        }

        @Override // android.os.Parcelable.Creator
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public f createFromParcel(Parcel parcel) {
            return new f(parcel);
        }

        @Override // android.os.Parcelable.Creator
        /* renamed from: b, reason: merged with bridge method [inline-methods] */
        public f[] newArray(int i10) {
            return new f[i10];
        }
    }

    public f(Parcel parcel) {
        this.f27500p = b(parcel.readInt(), new d(parcel).b());
    }

    private static ListenableWorker.a b(int i10, androidx.work.b bVar) {
        if (i10 == 1) {
            return ListenableWorker.a.d();
        }
        if (i10 == 2) {
            return ListenableWorker.a.f(bVar);
        }
        if (i10 == 3) {
            return ListenableWorker.a.b(bVar);
        }
        throw new IllegalStateException(String.format("Unknown result type %s", Integer.valueOf(i10)));
    }

    private static int c(ListenableWorker.a aVar) {
        if (aVar instanceof ListenableWorker.a.b) {
            return 1;
        }
        if (aVar instanceof ListenableWorker.a.c) {
            return 2;
        }
        if (aVar instanceof ListenableWorker.a.C0147a) {
            return 3;
        }
        throw new IllegalStateException(String.format("Unknown Result %s", aVar));
    }

    public ListenableWorker.a a() {
        return this.f27500p;
    }

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

    @Override // android.os.Parcelable
    public void writeToParcel(Parcel parcel, int i10) {
        parcel.writeInt(c(this.f27500p));
        new d(this.f27500p.c()).writeToParcel(parcel, i10);
    }
}
