package android.support.v4.media.session;

import android.annotation.SuppressLint;
import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
import android.text.TextUtils;
import java.util.List;

/* JADX INFO: loaded from: classes.dex */
@SuppressLint({"BanParcelableUsage"})
public final class PlaybackStateCompat implements Parcelable {
    public static final Parcelable.Creator<PlaybackStateCompat> CREATOR = new a();

    /* JADX INFO: renamed from: H, reason: collision with root package name */
    final int f2116H;

    /* JADX INFO: renamed from: I, reason: collision with root package name */
    final CharSequence f2117I;

    /* JADX INFO: renamed from: L, reason: collision with root package name */
    final long f2118L;

    /* JADX INFO: renamed from: M, reason: collision with root package name */
    List f2119M;

    /* JADX INFO: renamed from: Q, reason: collision with root package name */
    final long f2120Q;

    /* JADX INFO: renamed from: Z, reason: collision with root package name */
    final Bundle f2121Z;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    final int f2122b;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    final long f2123g;

    /* JADX INFO: renamed from: r, reason: collision with root package name */
    final long f2124r;

    /* JADX INFO: renamed from: x, reason: collision with root package name */
    final float f2125x;

    /* JADX INFO: renamed from: y, reason: collision with root package name */
    final long f2126y;

    public static final class CustomAction implements Parcelable {
        public static final Parcelable.Creator<CustomAction> CREATOR = new a();

        /* JADX INFO: renamed from: b, reason: collision with root package name */
        private final String f2127b;

        /* JADX INFO: renamed from: g, reason: collision with root package name */
        private final CharSequence f2128g;

        /* JADX INFO: renamed from: r, reason: collision with root package name */
        private final int f2129r;

        /* JADX INFO: renamed from: x, reason: collision with root package name */
        private final Bundle f2130x;

        class a implements Parcelable.Creator {
            a() {
            }

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

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

        CustomAction(Parcel parcel) {
            this.f2127b = parcel.readString();
            this.f2128g = (CharSequence) TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(parcel);
            this.f2129r = parcel.readInt();
            this.f2130x = parcel.readBundle(MediaSessionCompat.class.getClassLoader());
        }

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

        public String toString() {
            return "Action:mName='" + ((Object) this.f2128g) + ", mIcon=" + this.f2129r + ", mExtras=" + this.f2130x;
        }

        @Override // android.os.Parcelable
        public void writeToParcel(Parcel parcel, int i2) {
            parcel.writeString(this.f2127b);
            TextUtils.writeToParcel(this.f2128g, parcel, i2);
            parcel.writeInt(this.f2129r);
            parcel.writeBundle(this.f2130x);
        }
    }

    class a implements Parcelable.Creator {
        a() {
        }

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

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

    PlaybackStateCompat(Parcel parcel) {
        this.f2122b = parcel.readInt();
        this.f2123g = parcel.readLong();
        this.f2125x = parcel.readFloat();
        this.f2118L = parcel.readLong();
        this.f2124r = parcel.readLong();
        this.f2126y = parcel.readLong();
        this.f2117I = (CharSequence) TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(parcel);
        this.f2119M = parcel.createTypedArrayList(CustomAction.CREATOR);
        this.f2120Q = parcel.readLong();
        this.f2121Z = parcel.readBundle(MediaSessionCompat.class.getClassLoader());
        this.f2116H = parcel.readInt();
    }

    public static int a(long j2) {
        if (j2 == 4) {
            return 126;
        }
        if (j2 == 2) {
            return 127;
        }
        if (j2 == 32) {
            return 87;
        }
        if (j2 == 16) {
            return 88;
        }
        if (j2 == 1) {
            return 86;
        }
        if (j2 == 64) {
            return 90;
        }
        if (j2 == 8) {
            return 89;
        }
        return j2 == 512 ? 85 : 0;
    }

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

    public String toString() {
        return "PlaybackState {state=" + this.f2122b + ", position=" + this.f2123g + ", buffered position=" + this.f2124r + ", speed=" + this.f2125x + ", updated=" + this.f2118L + ", actions=" + this.f2126y + ", error code=" + this.f2116H + ", error message=" + this.f2117I + ", custom actions=" + this.f2119M + ", active item id=" + this.f2120Q + "}";
    }

    @Override // android.os.Parcelable
    public void writeToParcel(Parcel parcel, int i2) {
        parcel.writeInt(this.f2122b);
        parcel.writeLong(this.f2123g);
        parcel.writeFloat(this.f2125x);
        parcel.writeLong(this.f2118L);
        parcel.writeLong(this.f2124r);
        parcel.writeLong(this.f2126y);
        TextUtils.writeToParcel(this.f2117I, parcel, i2);
        parcel.writeTypedList(this.f2119M);
        parcel.writeLong(this.f2120Q);
        parcel.writeBundle(this.f2121Z);
        parcel.writeInt(this.f2116H);
    }
}
