package android.support.v4.media.session;

import Mqv2r_3.KQgRr5e_0.KQgRr5e_0.QxJ9d_1.IFxWkV_5.Mqv2r_3;
import Mqv2r_3.KQgRr5e_0.KQgRr5e_0.QxJ9d_1.IFxWkV_5.QxJ9d_1;
import android.os.Build;
import android.os.Bundle;
import android.os.IBinder;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.ResultReceiver;
import android.support.v4.media.MediaDescriptionCompat;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
/* loaded from: classes.dex */
public class MediaSessionCompat {

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

        /* loaded from: classes.dex */
        public static class KQgRr5e_0 implements Parcelable.Creator<ResultReceiverWrapper> {
            @Override // android.os.Parcelable.Creator
            /* renamed from: KQgRr5e_0 */
            public ResultReceiverWrapper createFromParcel(Parcel parcel) {
                return new ResultReceiverWrapper(parcel);
            }

            @Override // android.os.Parcelable.Creator
            /* renamed from: KQgRr5e_0 */
            public ResultReceiverWrapper[] newArray(int i) {
                return new ResultReceiverWrapper[i];
            }
        }

        public ResultReceiverWrapper(Parcel parcel) {
            this.KQgRr5e_0 = (ResultReceiver) ResultReceiver.CREATOR.createFromParcel(parcel);
        }

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

        @Override // android.os.Parcelable
        public void writeToParcel(Parcel parcel, int i) {
            this.KQgRr5e_0.writeToParcel(parcel, i);
        }
    }

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

        /* renamed from: KQgRr5e_0  reason: collision with other field name */
        public final Object f1813KQgRr5e_0;

        public Token(Object obj) {
            this(obj, null, null);
        }

        public static Token KQgRr5e_0(Object obj) {
            return KQgRr5e_0(obj, null);
        }

        public void KQgRr5e_0(Bundle bundle) {
        }

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

        public boolean equals(Object obj) {
            if (this == obj) {
                return true;
            }
            if (obj instanceof Token) {
                Token token = (Token) obj;
                Object obj2 = this.f1813KQgRr5e_0;
                if (obj2 == null) {
                    return token.f1813KQgRr5e_0 == null;
                }
                Object obj3 = token.f1813KQgRr5e_0;
                if (obj3 == null) {
                    return false;
                }
                return obj2.equals(obj3);
            }
            return false;
        }

        public int hashCode() {
            Object obj = this.f1813KQgRr5e_0;
            if (obj == null) {
                return 0;
            }
            return obj.hashCode();
        }

        @Override // android.os.Parcelable
        public void writeToParcel(Parcel parcel, int i) {
            if (Build.VERSION.SDK_INT >= 21) {
                parcel.writeParcelable((Parcelable) this.f1813KQgRr5e_0, i);
            } else {
                parcel.writeStrongBinder((IBinder) this.f1813KQgRr5e_0);
            }
        }

        public Token(Object obj, QxJ9d_1 qxJ9d_1) {
            this(obj, qxJ9d_1, null);
        }

        public static Token KQgRr5e_0(Object obj, QxJ9d_1 qxJ9d_1) {
            if (obj == null || Build.VERSION.SDK_INT < 21) {
                return null;
            }
            Mqv2r_3.KQgRr5e_0(obj);
            return new Token(obj, qxJ9d_1);
        }

        public Token(Object obj, QxJ9d_1 qxJ9d_1, Bundle bundle) {
            this.f1813KQgRr5e_0 = obj;
            this.KQgRr5e_0 = qxJ9d_1;
        }

        /* loaded from: classes.dex */
        public static class KQgRr5e_0 implements Parcelable.Creator<Token> {
            @Override // android.os.Parcelable.Creator
            /* renamed from: KQgRr5e_0 */
            public Token createFromParcel(Parcel parcel) {
                Object readStrongBinder;
                if (Build.VERSION.SDK_INT >= 21) {
                    readStrongBinder = parcel.readParcelable(null);
                } else {
                    readStrongBinder = parcel.readStrongBinder();
                }
                return new Token(readStrongBinder);
            }

            @Override // android.os.Parcelable.Creator
            /* renamed from: KQgRr5e_0 */
            public Token[] newArray(int i) {
                return new Token[i];
            }
        }

        /* renamed from: KQgRr5e_0  reason: collision with other method in class */
        public Object m819KQgRr5e_0() {
            return this.f1813KQgRr5e_0;
        }

        public QxJ9d_1 KQgRr5e_0() {
            return this.KQgRr5e_0;
        }

        public void KQgRr5e_0(QxJ9d_1 qxJ9d_1) {
            this.KQgRr5e_0 = qxJ9d_1;
        }
    }

    public static void KQgRr5e_0(Bundle bundle) {
        if (bundle != null) {
            bundle.setClassLoader(MediaSessionCompat.class.getClassLoader());
        }
    }

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

        /* renamed from: KQgRr5e_0  reason: collision with other field name */
        public final MediaDescriptionCompat f1812KQgRr5e_0;

        /* loaded from: classes.dex */
        public static class KQgRr5e_0 implements Parcelable.Creator<QueueItem> {
            @Override // android.os.Parcelable.Creator
            /* renamed from: KQgRr5e_0 */
            public QueueItem createFromParcel(Parcel parcel) {
                return new QueueItem(parcel);
            }

            @Override // android.os.Parcelable.Creator
            /* renamed from: KQgRr5e_0 */
            public QueueItem[] newArray(int i) {
                return new QueueItem[i];
            }
        }

        public QueueItem(Object obj, MediaDescriptionCompat mediaDescriptionCompat, long j) {
            if (mediaDescriptionCompat == null) {
                throw new IllegalArgumentException("Description cannot be null.");
            }
            if (j != -1) {
                this.f1812KQgRr5e_0 = mediaDescriptionCompat;
                this.KQgRr5e_0 = j;
                return;
            }
            throw new IllegalArgumentException("Id cannot be QueueItem.UNKNOWN_ID");
        }

        public static QueueItem KQgRr5e_0(Object obj) {
            if (obj == null || Build.VERSION.SDK_INT < 21) {
                return null;
            }
            return new QueueItem(obj, MediaDescriptionCompat.KQgRr5e_0(Mqv2r_3.KQgRr5e_0.m140KQgRr5e_0(obj)), Mqv2r_3.KQgRr5e_0.KQgRr5e_0(obj));
        }

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

        public String toString() {
            return "MediaSession.QueueItem {Description=" + this.f1812KQgRr5e_0 + ", Id=" + this.KQgRr5e_0 + " }";
        }

        @Override // android.os.Parcelable
        public void writeToParcel(Parcel parcel, int i) {
            this.f1812KQgRr5e_0.writeToParcel(parcel, i);
            parcel.writeLong(this.KQgRr5e_0);
        }

        public QueueItem(Parcel parcel) {
            this.f1812KQgRr5e_0 = MediaDescriptionCompat.CREATOR.createFromParcel(parcel);
            this.KQgRr5e_0 = parcel.readLong();
        }

        public static List<QueueItem> KQgRr5e_0(List<?> list) {
            if (list == null || Build.VERSION.SDK_INT < 21) {
                return null;
            }
            ArrayList arrayList = new ArrayList();
            Iterator<?> it = list.iterator();
            while (it.hasNext()) {
                arrayList.add(KQgRr5e_0(it.next()));
            }
            return arrayList;
        }
    }
}
