2021-06-27 20:44:35 +00:00
|
|
|
package android.support.v4.media.session;
|
|
|
|
|
|
|
|
import android.annotation.SuppressLint;
|
2021-11-08 18:25:28 +00:00
|
|
|
import android.media.session.PlaybackState;
|
2021-06-27 20:44:35 +00:00
|
|
|
import android.os.Bundle;
|
|
|
|
import android.os.Parcel;
|
|
|
|
import android.os.Parcelable;
|
|
|
|
import android.text.TextUtils;
|
2021-11-08 18:25:28 +00:00
|
|
|
import androidx.annotation.DoNotInline;
|
|
|
|
import androidx.annotation.RequiresApi;
|
2021-06-27 20:44:35 +00:00
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.List;
|
|
|
|
@SuppressLint({"BanParcelableUsage"})
|
|
|
|
public final class PlaybackStateCompat implements Parcelable {
|
|
|
|
public static final Parcelable.Creator<PlaybackStateCompat> CREATOR = new a();
|
2021-12-17 22:03:14 +00:00
|
|
|
public final int j;
|
2021-06-27 20:44:35 +00:00
|
|
|
public final long k;
|
2021-12-17 22:03:14 +00:00
|
|
|
public final long l;
|
|
|
|
public final float m;
|
|
|
|
public final long n;
|
|
|
|
public final int o;
|
|
|
|
public final CharSequence p;
|
|
|
|
public final long q;
|
|
|
|
public List<CustomAction> r;
|
2021-06-27 20:44:35 +00:00
|
|
|
|
2021-11-08 18:25:28 +00:00
|
|
|
/* renamed from: s reason: collision with root package name */
|
2021-12-21 23:37:30 +00:00
|
|
|
public final long f21s;
|
2021-12-17 22:03:14 +00:00
|
|
|
public final Bundle t;
|
2021-06-27 20:44:35 +00:00
|
|
|
|
|
|
|
public static final class CustomAction implements Parcelable {
|
|
|
|
public static final Parcelable.Creator<CustomAction> CREATOR = new a();
|
2021-12-17 22:03:14 +00:00
|
|
|
public final String j;
|
|
|
|
public final CharSequence k;
|
|
|
|
public final int l;
|
|
|
|
public final Bundle m;
|
2021-06-27 20:44:35 +00:00
|
|
|
|
|
|
|
public class a implements Parcelable.Creator<CustomAction> {
|
|
|
|
/* Return type fixed from 'java.lang.Object' to match base method */
|
|
|
|
@Override // android.os.Parcelable.Creator
|
|
|
|
public CustomAction createFromParcel(Parcel parcel) {
|
|
|
|
return new CustomAction(parcel);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Return type fixed from 'java.lang.Object[]' to match base method */
|
|
|
|
@Override // android.os.Parcelable.Creator
|
|
|
|
public CustomAction[] newArray(int i) {
|
|
|
|
return new CustomAction[i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public CustomAction(Parcel parcel) {
|
2021-12-17 22:03:14 +00:00
|
|
|
this.j = parcel.readString();
|
|
|
|
this.k = (CharSequence) TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(parcel);
|
|
|
|
this.l = parcel.readInt();
|
|
|
|
this.m = parcel.readBundle(MediaSessionCompat.class.getClassLoader());
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public CustomAction(String str, CharSequence charSequence, int i, Bundle bundle) {
|
2021-12-17 22:03:14 +00:00
|
|
|
this.j = str;
|
|
|
|
this.k = charSequence;
|
|
|
|
this.l = i;
|
|
|
|
this.m = bundle;
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override // android.os.Parcelable
|
|
|
|
public int describeContents() {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // java.lang.Object
|
|
|
|
public String toString() {
|
2021-12-21 23:37:30 +00:00
|
|
|
StringBuilder R = b.d.b.a.a.R("Action:mName='");
|
2021-12-17 22:03:14 +00:00
|
|
|
R.append((Object) this.k);
|
2021-11-08 18:25:28 +00:00
|
|
|
R.append(", mIcon=");
|
|
|
|
R.append(this.l);
|
2021-12-17 22:03:14 +00:00
|
|
|
R.append(", mExtras=");
|
|
|
|
R.append(this.m);
|
2021-11-08 18:25:28 +00:00
|
|
|
return R.toString();
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override // android.os.Parcelable
|
|
|
|
public void writeToParcel(Parcel parcel, int i) {
|
2021-12-17 22:03:14 +00:00
|
|
|
parcel.writeString(this.j);
|
|
|
|
TextUtils.writeToParcel(this.k, parcel, i);
|
|
|
|
parcel.writeInt(this.l);
|
|
|
|
parcel.writeBundle(this.m);
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public class a implements Parcelable.Creator<PlaybackStateCompat> {
|
|
|
|
/* Return type fixed from 'java.lang.Object' to match base method */
|
|
|
|
@Override // android.os.Parcelable.Creator
|
|
|
|
public PlaybackStateCompat createFromParcel(Parcel parcel) {
|
|
|
|
return new PlaybackStateCompat(parcel);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Return type fixed from 'java.lang.Object[]' to match base method */
|
|
|
|
@Override // android.os.Parcelable.Creator
|
|
|
|
public PlaybackStateCompat[] newArray(int i) {
|
|
|
|
return new PlaybackStateCompat[i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-11-08 18:25:28 +00:00
|
|
|
@RequiresApi(21)
|
|
|
|
public static class b {
|
|
|
|
@DoNotInline
|
|
|
|
public static void a(PlaybackState.Builder builder, PlaybackState.CustomAction customAction) {
|
|
|
|
builder.addCustomAction(customAction);
|
|
|
|
}
|
|
|
|
|
|
|
|
@DoNotInline
|
|
|
|
public static PlaybackState.CustomAction b(PlaybackState.CustomAction.Builder builder) {
|
|
|
|
return builder.build();
|
|
|
|
}
|
|
|
|
|
|
|
|
@DoNotInline
|
|
|
|
public static PlaybackState c(PlaybackState.Builder builder) {
|
|
|
|
return builder.build();
|
|
|
|
}
|
|
|
|
|
|
|
|
@DoNotInline
|
|
|
|
public static PlaybackState.Builder d() {
|
|
|
|
return new PlaybackState.Builder();
|
|
|
|
}
|
|
|
|
|
|
|
|
@DoNotInline
|
|
|
|
public static PlaybackState.CustomAction.Builder e(String str, CharSequence charSequence, int i) {
|
|
|
|
return new PlaybackState.CustomAction.Builder(str, charSequence, i);
|
|
|
|
}
|
|
|
|
|
|
|
|
@DoNotInline
|
|
|
|
public static String f(PlaybackState.CustomAction customAction) {
|
|
|
|
return customAction.getAction();
|
|
|
|
}
|
|
|
|
|
|
|
|
@DoNotInline
|
|
|
|
public static long g(PlaybackState playbackState) {
|
|
|
|
return playbackState.getActions();
|
|
|
|
}
|
|
|
|
|
|
|
|
@DoNotInline
|
|
|
|
public static long h(PlaybackState playbackState) {
|
|
|
|
return playbackState.getActiveQueueItemId();
|
|
|
|
}
|
|
|
|
|
|
|
|
@DoNotInline
|
|
|
|
public static long i(PlaybackState playbackState) {
|
|
|
|
return playbackState.getBufferedPosition();
|
|
|
|
}
|
|
|
|
|
|
|
|
@DoNotInline
|
|
|
|
public static List<PlaybackState.CustomAction> j(PlaybackState playbackState) {
|
|
|
|
return playbackState.getCustomActions();
|
|
|
|
}
|
|
|
|
|
|
|
|
@DoNotInline
|
|
|
|
public static CharSequence k(PlaybackState playbackState) {
|
|
|
|
return playbackState.getErrorMessage();
|
|
|
|
}
|
|
|
|
|
|
|
|
@DoNotInline
|
|
|
|
public static Bundle l(PlaybackState.CustomAction customAction) {
|
|
|
|
return customAction.getExtras();
|
|
|
|
}
|
|
|
|
|
|
|
|
@DoNotInline
|
|
|
|
public static int m(PlaybackState.CustomAction customAction) {
|
|
|
|
return customAction.getIcon();
|
|
|
|
}
|
|
|
|
|
|
|
|
@DoNotInline
|
|
|
|
public static long n(PlaybackState playbackState) {
|
|
|
|
return playbackState.getLastPositionUpdateTime();
|
|
|
|
}
|
|
|
|
|
|
|
|
@DoNotInline
|
|
|
|
public static CharSequence o(PlaybackState.CustomAction customAction) {
|
|
|
|
return customAction.getName();
|
|
|
|
}
|
|
|
|
|
|
|
|
@DoNotInline
|
|
|
|
public static float p(PlaybackState playbackState) {
|
|
|
|
return playbackState.getPlaybackSpeed();
|
|
|
|
}
|
|
|
|
|
|
|
|
@DoNotInline
|
|
|
|
public static long q(PlaybackState playbackState) {
|
|
|
|
return playbackState.getPosition();
|
|
|
|
}
|
|
|
|
|
|
|
|
@DoNotInline
|
|
|
|
public static int r(PlaybackState playbackState) {
|
|
|
|
return playbackState.getState();
|
|
|
|
}
|
|
|
|
|
|
|
|
@DoNotInline
|
|
|
|
public static void s(PlaybackState.Builder builder, long j) {
|
|
|
|
builder.setActions(j);
|
|
|
|
}
|
|
|
|
|
|
|
|
@DoNotInline
|
|
|
|
public static void t(PlaybackState.Builder builder, long j) {
|
|
|
|
builder.setActiveQueueItemId(j);
|
|
|
|
}
|
|
|
|
|
|
|
|
@DoNotInline
|
|
|
|
public static void u(PlaybackState.Builder builder, long j) {
|
|
|
|
builder.setBufferedPosition(j);
|
|
|
|
}
|
|
|
|
|
|
|
|
@DoNotInline
|
|
|
|
public static void v(PlaybackState.Builder builder, CharSequence charSequence) {
|
|
|
|
builder.setErrorMessage(charSequence);
|
|
|
|
}
|
|
|
|
|
|
|
|
@DoNotInline
|
|
|
|
public static void w(PlaybackState.CustomAction.Builder builder, Bundle bundle) {
|
|
|
|
builder.setExtras(bundle);
|
|
|
|
}
|
|
|
|
|
|
|
|
@DoNotInline
|
|
|
|
public static void x(PlaybackState.Builder builder, int i, long j, float f, long j2) {
|
|
|
|
builder.setState(i, j, f, j2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@RequiresApi(22)
|
|
|
|
public static class c {
|
|
|
|
@DoNotInline
|
|
|
|
public static Bundle a(PlaybackState playbackState) {
|
|
|
|
return playbackState.getExtras();
|
|
|
|
}
|
|
|
|
|
|
|
|
@DoNotInline
|
|
|
|
public static void b(PlaybackState.Builder builder, Bundle bundle) {
|
|
|
|
builder.setExtras(bundle);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-06-27 20:44:35 +00:00
|
|
|
public PlaybackStateCompat(int i, long j, long j2, float f, long j3, int i2, CharSequence charSequence, long j4, List<CustomAction> list, long j5, Bundle bundle) {
|
2021-12-17 22:03:14 +00:00
|
|
|
this.j = i;
|
|
|
|
this.k = j;
|
|
|
|
this.l = j2;
|
|
|
|
this.m = f;
|
|
|
|
this.n = j3;
|
|
|
|
this.o = i2;
|
|
|
|
this.p = charSequence;
|
|
|
|
this.q = j4;
|
|
|
|
this.r = new ArrayList(list);
|
2021-12-21 23:37:30 +00:00
|
|
|
this.f21s = j5;
|
2021-12-17 22:03:14 +00:00
|
|
|
this.t = bundle;
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public PlaybackStateCompat(Parcel parcel) {
|
2021-12-17 22:03:14 +00:00
|
|
|
this.j = parcel.readInt();
|
2021-06-27 20:44:35 +00:00
|
|
|
this.k = parcel.readLong();
|
2021-12-17 22:03:14 +00:00
|
|
|
this.m = parcel.readFloat();
|
|
|
|
this.q = parcel.readLong();
|
|
|
|
this.l = parcel.readLong();
|
|
|
|
this.n = parcel.readLong();
|
|
|
|
this.p = (CharSequence) TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(parcel);
|
|
|
|
this.r = parcel.createTypedArrayList(CustomAction.CREATOR);
|
2021-12-21 23:37:30 +00:00
|
|
|
this.f21s = parcel.readLong();
|
2021-12-17 22:03:14 +00:00
|
|
|
this.t = parcel.readBundle(MediaSessionCompat.class.getClassLoader());
|
|
|
|
this.o = parcel.readInt();
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override // android.os.Parcelable
|
|
|
|
public int describeContents() {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // java.lang.Object
|
|
|
|
public String toString() {
|
|
|
|
StringBuilder sb = new StringBuilder("PlaybackState {");
|
|
|
|
sb.append("state=");
|
|
|
|
sb.append(this.j);
|
2021-12-17 22:03:14 +00:00
|
|
|
sb.append(", position=");
|
2021-06-27 20:44:35 +00:00
|
|
|
sb.append(this.k);
|
2021-12-17 22:03:14 +00:00
|
|
|
sb.append(", buffered position=");
|
2021-06-27 20:44:35 +00:00
|
|
|
sb.append(this.l);
|
2021-12-17 22:03:14 +00:00
|
|
|
sb.append(", speed=");
|
|
|
|
sb.append(this.m);
|
2021-06-27 20:44:35 +00:00
|
|
|
sb.append(", updated=");
|
2021-12-17 22:03:14 +00:00
|
|
|
sb.append(this.q);
|
2021-06-27 20:44:35 +00:00
|
|
|
sb.append(", actions=");
|
|
|
|
sb.append(this.n);
|
2021-12-17 22:03:14 +00:00
|
|
|
sb.append(", error code=");
|
2021-06-27 20:44:35 +00:00
|
|
|
sb.append(this.o);
|
2021-12-17 22:03:14 +00:00
|
|
|
sb.append(", error message=");
|
|
|
|
sb.append(this.p);
|
2021-06-27 20:44:35 +00:00
|
|
|
sb.append(", custom actions=");
|
2021-12-17 22:03:14 +00:00
|
|
|
sb.append(this.r);
|
2021-06-27 20:44:35 +00:00
|
|
|
sb.append(", active item id=");
|
2021-12-21 23:37:30 +00:00
|
|
|
return b.d.b.a.a.B(sb, this.f21s, "}");
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override // android.os.Parcelable
|
|
|
|
public void writeToParcel(Parcel parcel, int i) {
|
2021-12-17 22:03:14 +00:00
|
|
|
parcel.writeInt(this.j);
|
2021-06-27 20:44:35 +00:00
|
|
|
parcel.writeLong(this.k);
|
2021-12-17 22:03:14 +00:00
|
|
|
parcel.writeFloat(this.m);
|
|
|
|
parcel.writeLong(this.q);
|
|
|
|
parcel.writeLong(this.l);
|
|
|
|
parcel.writeLong(this.n);
|
|
|
|
TextUtils.writeToParcel(this.p, parcel, i);
|
|
|
|
parcel.writeTypedList(this.r);
|
2021-12-21 23:37:30 +00:00
|
|
|
parcel.writeLong(this.f21s);
|
2021-12-17 22:03:14 +00:00
|
|
|
parcel.writeBundle(this.t);
|
|
|
|
parcel.writeInt(this.o);
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
}
|