package android.support.v4.media.session; import android.annotation.SuppressLint; import android.media.session.MediaSession; import android.os.BadParcelableException; import android.os.Bundle; import android.os.Parcel; import android.os.Parcelable; import android.os.ResultReceiver; import android.support.v4.media.MediaDescriptionCompat; import android.util.Log; import androidx.annotation.GuardedBy; import androidx.annotation.Nullable; import androidx.annotation.RestrictTo; import androidx.versionedparcelable.VersionedParcelable; import x.a.b.b.a.b; public class MediaSessionCompat { @SuppressLint({"BanParcelableUsage"}) public static final class QueueItem implements Parcelable { public static final Parcelable.Creator CREATOR = new a(); public final MediaDescriptionCompat i; public final long j; public class a implements Parcelable.Creator { /* Return type fixed from 'java.lang.Object' to match base method */ @Override // android.os.Parcelable.Creator public QueueItem createFromParcel(Parcel parcel) { return new QueueItem(parcel); } /* Return type fixed from 'java.lang.Object[]' to match base method */ @Override // android.os.Parcelable.Creator public QueueItem[] newArray(int i) { return new QueueItem[i]; } } public QueueItem(MediaSession.QueueItem queueItem, MediaDescriptionCompat mediaDescriptionCompat, long j) { if (mediaDescriptionCompat == null) { throw new IllegalArgumentException("Description cannot be null"); } else if (j != -1) { this.i = mediaDescriptionCompat; this.j = j; } else { throw new IllegalArgumentException("Id cannot be QueueItem.UNKNOWN_ID"); } } public QueueItem(Parcel parcel) { this.i = MediaDescriptionCompat.CREATOR.createFromParcel(parcel); this.j = parcel.readLong(); } @Override // android.os.Parcelable public int describeContents() { return 0; } @Override // java.lang.Object public String toString() { StringBuilder L = c.d.b.a.a.L("MediaSession.QueueItem {Description="); L.append(this.i); L.append(", Id="); return c.d.b.a.a.z(L, this.j, " }"); } @Override // android.os.Parcelable public void writeToParcel(Parcel parcel, int i) { this.i.writeToParcel(parcel, i); parcel.writeLong(this.j); } } @SuppressLint({"BanParcelableUsage"}) public static final class ResultReceiverWrapper implements Parcelable { public static final Parcelable.Creator CREATOR = new a(); public ResultReceiver i; public class a implements Parcelable.Creator { /* Return type fixed from 'java.lang.Object' to match base method */ @Override // android.os.Parcelable.Creator public ResultReceiverWrapper createFromParcel(Parcel parcel) { return new ResultReceiverWrapper(parcel); } /* Return type fixed from 'java.lang.Object[]' to match base method */ @Override // android.os.Parcelable.Creator public ResultReceiverWrapper[] newArray(int i) { return new ResultReceiverWrapper[i]; } } public ResultReceiverWrapper(Parcel parcel) { this.i = (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.i.writeToParcel(parcel, i); } } @SuppressLint({"BanParcelableUsage"}) public static final class Token implements Parcelable { public static final Parcelable.Creator CREATOR = new a(); public final Object i = new Object(); public final Object j; @GuardedBy("mLock") public b k; @GuardedBy("mLock") public VersionedParcelable l; public class a implements Parcelable.Creator { /* Return type fixed from 'java.lang.Object' to match base method */ @Override // android.os.Parcelable.Creator public Token createFromParcel(Parcel parcel) { return new Token(parcel.readParcelable(null)); } /* Return type fixed from 'java.lang.Object[]' to match base method */ @Override // android.os.Parcelable.Creator public Token[] newArray(int i) { return new Token[i]; } } public Token(Object obj) { this.j = obj; this.k = null; } public Token(Object obj, b bVar) { this.j = obj; this.k = bVar; } @RestrictTo({RestrictTo.Scope.LIBRARY}) public static Token a(Object obj, b bVar) { if (obj == null) { return null; } if (obj instanceof MediaSession.Token) { return new Token(obj, bVar); } throw new IllegalArgumentException("token is not a valid MediaSession.Token object"); } @RestrictTo({RestrictTo.Scope.LIBRARY}) public b b() { b bVar; synchronized (this.i) { bVar = this.k; } return bVar; } @Override // android.os.Parcelable public int describeContents() { return 0; } @Override // java.lang.Object public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof Token)) { return false; } Token token = (Token) obj; Object obj2 = this.j; if (obj2 == null) { return token.j == null; } Object obj3 = token.j; if (obj3 == null) { return false; } return obj2.equals(obj3); } @Override // java.lang.Object public int hashCode() { Object obj = this.j; if (obj == null) { return 0; } return obj.hashCode(); } @Override // android.os.Parcelable public void writeToParcel(Parcel parcel, int i) { parcel.writeParcelable((Parcelable) this.j, i); } } @RestrictTo({RestrictTo.Scope.LIBRARY}) public static void a(@Nullable Bundle bundle) { if (bundle != null) { bundle.setClassLoader(MediaSessionCompat.class.getClassLoader()); } } @Nullable @RestrictTo({RestrictTo.Scope.LIBRARY}) public static Bundle b(@Nullable Bundle bundle) { a(bundle); try { bundle.isEmpty(); return bundle; } catch (BadParcelableException unused) { Log.e("MediaSessionCompat", "Could not unparcel the data."); return null; } } }