Initial commit
This commit is contained in:
81
sources/android/support/customtabs/ICustomTabsCallback.java
Normal file
81
sources/android/support/customtabs/ICustomTabsCallback.java
Normal file
@@ -0,0 +1,81 @@
|
||||
package android.support.customtabs;
|
||||
|
||||
import android.os.Binder;
|
||||
import android.os.Bundle;
|
||||
import android.os.IBinder;
|
||||
import android.os.IInterface;
|
||||
import android.os.Parcel;
|
||||
import android.os.RemoteException;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface ICustomTabsCallback extends IInterface {
|
||||
|
||||
public static abstract class Stub extends Binder implements ICustomTabsCallback {
|
||||
|
||||
private static class Proxy implements ICustomTabsCallback {
|
||||
private IBinder a;
|
||||
|
||||
Proxy(IBinder iBinder) {
|
||||
this.a = iBinder;
|
||||
}
|
||||
|
||||
@Override // android.support.customtabs.ICustomTabsCallback
|
||||
public void a(String str, Bundle bundle) throws RemoteException {
|
||||
Parcel obtain = Parcel.obtain();
|
||||
Parcel obtain2 = Parcel.obtain();
|
||||
try {
|
||||
obtain.writeInterfaceToken("android.support.customtabs.ICustomTabsCallback");
|
||||
obtain.writeString(str);
|
||||
if (bundle != null) {
|
||||
obtain.writeInt(1);
|
||||
bundle.writeToParcel(obtain, 0);
|
||||
} else {
|
||||
obtain.writeInt(0);
|
||||
}
|
||||
this.a.transact(5, obtain, obtain2, 0);
|
||||
obtain2.readException();
|
||||
} finally {
|
||||
obtain2.recycle();
|
||||
obtain.recycle();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.os.IInterface
|
||||
public IBinder asBinder() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
@Override // android.support.customtabs.ICustomTabsCallback
|
||||
public void b(Bundle bundle) throws RemoteException {
|
||||
Parcel obtain = Parcel.obtain();
|
||||
Parcel obtain2 = Parcel.obtain();
|
||||
try {
|
||||
obtain.writeInterfaceToken("android.support.customtabs.ICustomTabsCallback");
|
||||
if (bundle != null) {
|
||||
obtain.writeInt(1);
|
||||
bundle.writeToParcel(obtain, 0);
|
||||
} else {
|
||||
obtain.writeInt(0);
|
||||
}
|
||||
this.a.transact(4, obtain, obtain2, 0);
|
||||
obtain2.readException();
|
||||
} finally {
|
||||
obtain2.recycle();
|
||||
obtain.recycle();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static ICustomTabsCallback a(IBinder iBinder) {
|
||||
if (iBinder == null) {
|
||||
return null;
|
||||
}
|
||||
IInterface queryLocalInterface = iBinder.queryLocalInterface("android.support.customtabs.ICustomTabsCallback");
|
||||
return (queryLocalInterface == null || !(queryLocalInterface instanceof ICustomTabsCallback)) ? new Proxy(iBinder) : (ICustomTabsCallback) queryLocalInterface;
|
||||
}
|
||||
}
|
||||
|
||||
void a(String str, Bundle bundle) throws RemoteException;
|
||||
|
||||
void b(Bundle bundle) throws RemoteException;
|
||||
}
|
107
sources/android/support/customtabs/ICustomTabsService.java
Normal file
107
sources/android/support/customtabs/ICustomTabsService.java
Normal file
@@ -0,0 +1,107 @@
|
||||
package android.support.customtabs;
|
||||
|
||||
import android.net.Uri;
|
||||
import android.os.Binder;
|
||||
import android.os.Bundle;
|
||||
import android.os.IBinder;
|
||||
import android.os.IInterface;
|
||||
import android.os.Parcel;
|
||||
import android.os.RemoteException;
|
||||
import android.support.customtabs.ICustomTabsCallback;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface ICustomTabsService extends IInterface {
|
||||
|
||||
public static abstract class Stub extends Binder implements ICustomTabsService {
|
||||
public Stub() {
|
||||
attachInterface(this, "android.support.customtabs.ICustomTabsService");
|
||||
}
|
||||
|
||||
@Override // android.os.IInterface
|
||||
public IBinder asBinder() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.os.Binder
|
||||
public boolean onTransact(int i, Parcel parcel, Parcel parcel2, int i2) throws RemoteException {
|
||||
if (i == 1598968902) {
|
||||
parcel2.writeString("android.support.customtabs.ICustomTabsService");
|
||||
return true;
|
||||
}
|
||||
switch (i) {
|
||||
case 2:
|
||||
parcel.enforceInterface("android.support.customtabs.ICustomTabsService");
|
||||
boolean a = a(parcel.readLong());
|
||||
parcel2.writeNoException();
|
||||
parcel2.writeInt(a ? 1 : 0);
|
||||
return true;
|
||||
case 3:
|
||||
parcel.enforceInterface("android.support.customtabs.ICustomTabsService");
|
||||
boolean a2 = a(ICustomTabsCallback.Stub.a(parcel.readStrongBinder()));
|
||||
parcel2.writeNoException();
|
||||
parcel2.writeInt(a2 ? 1 : 0);
|
||||
return true;
|
||||
case 4:
|
||||
parcel.enforceInterface("android.support.customtabs.ICustomTabsService");
|
||||
boolean a3 = a(ICustomTabsCallback.Stub.a(parcel.readStrongBinder()), parcel.readInt() != 0 ? (Uri) Uri.CREATOR.createFromParcel(parcel) : null, parcel.readInt() != 0 ? (Bundle) Bundle.CREATOR.createFromParcel(parcel) : null, parcel.createTypedArrayList(Bundle.CREATOR));
|
||||
parcel2.writeNoException();
|
||||
parcel2.writeInt(a3 ? 1 : 0);
|
||||
return true;
|
||||
case 5:
|
||||
parcel.enforceInterface("android.support.customtabs.ICustomTabsService");
|
||||
Bundle b = b(parcel.readString(), parcel.readInt() != 0 ? (Bundle) Bundle.CREATOR.createFromParcel(parcel) : null);
|
||||
parcel2.writeNoException();
|
||||
if (b != null) {
|
||||
parcel2.writeInt(1);
|
||||
b.writeToParcel(parcel2, 1);
|
||||
} else {
|
||||
parcel2.writeInt(0);
|
||||
}
|
||||
return true;
|
||||
case 6:
|
||||
parcel.enforceInterface("android.support.customtabs.ICustomTabsService");
|
||||
boolean b2 = b(ICustomTabsCallback.Stub.a(parcel.readStrongBinder()), parcel.readInt() != 0 ? (Bundle) Bundle.CREATOR.createFromParcel(parcel) : null);
|
||||
parcel2.writeNoException();
|
||||
parcel2.writeInt(b2 ? 1 : 0);
|
||||
return true;
|
||||
case 7:
|
||||
parcel.enforceInterface("android.support.customtabs.ICustomTabsService");
|
||||
boolean a4 = a(ICustomTabsCallback.Stub.a(parcel.readStrongBinder()), parcel.readInt() != 0 ? (Uri) Uri.CREATOR.createFromParcel(parcel) : null);
|
||||
parcel2.writeNoException();
|
||||
parcel2.writeInt(a4 ? 1 : 0);
|
||||
return true;
|
||||
case 8:
|
||||
parcel.enforceInterface("android.support.customtabs.ICustomTabsService");
|
||||
int b3 = b(ICustomTabsCallback.Stub.a(parcel.readStrongBinder()), parcel.readString(), parcel.readInt() != 0 ? (Bundle) Bundle.CREATOR.createFromParcel(parcel) : null);
|
||||
parcel2.writeNoException();
|
||||
parcel2.writeInt(b3);
|
||||
return true;
|
||||
case 9:
|
||||
parcel.enforceInterface("android.support.customtabs.ICustomTabsService");
|
||||
boolean a5 = a(ICustomTabsCallback.Stub.a(parcel.readStrongBinder()), parcel.readInt(), parcel.readInt() != 0 ? (Uri) Uri.CREATOR.createFromParcel(parcel) : null, parcel.readInt() != 0 ? (Bundle) Bundle.CREATOR.createFromParcel(parcel) : null);
|
||||
parcel2.writeNoException();
|
||||
parcel2.writeInt(a5 ? 1 : 0);
|
||||
return true;
|
||||
default:
|
||||
return super.onTransact(i, parcel, parcel2, i2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
boolean a(long j) throws RemoteException;
|
||||
|
||||
boolean a(ICustomTabsCallback iCustomTabsCallback) throws RemoteException;
|
||||
|
||||
boolean a(ICustomTabsCallback iCustomTabsCallback, int i, Uri uri, Bundle bundle) throws RemoteException;
|
||||
|
||||
boolean a(ICustomTabsCallback iCustomTabsCallback, Uri uri) throws RemoteException;
|
||||
|
||||
boolean a(ICustomTabsCallback iCustomTabsCallback, Uri uri, Bundle bundle, List<Bundle> list) throws RemoteException;
|
||||
|
||||
int b(ICustomTabsCallback iCustomTabsCallback, String str, Bundle bundle) throws RemoteException;
|
||||
|
||||
Bundle b(String str, Bundle bundle) throws RemoteException;
|
||||
|
||||
boolean b(ICustomTabsCallback iCustomTabsCallback, Bundle bundle) throws RemoteException;
|
||||
}
|
49
sources/android/support/customtabs/IPostMessageService.java
Normal file
49
sources/android/support/customtabs/IPostMessageService.java
Normal file
@@ -0,0 +1,49 @@
|
||||
package android.support.customtabs;
|
||||
|
||||
import android.os.Binder;
|
||||
import android.os.Bundle;
|
||||
import android.os.IBinder;
|
||||
import android.os.IInterface;
|
||||
import android.os.Parcel;
|
||||
import android.os.RemoteException;
|
||||
import android.support.customtabs.ICustomTabsCallback;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface IPostMessageService extends IInterface {
|
||||
|
||||
public static abstract class Stub extends Binder implements IPostMessageService {
|
||||
public Stub() {
|
||||
attachInterface(this, "android.support.customtabs.IPostMessageService");
|
||||
}
|
||||
|
||||
@Override // android.os.IInterface
|
||||
public IBinder asBinder() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.os.Binder
|
||||
public boolean onTransact(int i, Parcel parcel, Parcel parcel2, int i2) throws RemoteException {
|
||||
if (i == 2) {
|
||||
parcel.enforceInterface("android.support.customtabs.IPostMessageService");
|
||||
a(ICustomTabsCallback.Stub.a(parcel.readStrongBinder()), parcel.readInt() != 0 ? (Bundle) Bundle.CREATOR.createFromParcel(parcel) : null);
|
||||
parcel2.writeNoException();
|
||||
return true;
|
||||
}
|
||||
if (i != 3) {
|
||||
if (i != 1598968902) {
|
||||
return super.onTransact(i, parcel, parcel2, i2);
|
||||
}
|
||||
parcel2.writeString("android.support.customtabs.IPostMessageService");
|
||||
return true;
|
||||
}
|
||||
parcel.enforceInterface("android.support.customtabs.IPostMessageService");
|
||||
a(ICustomTabsCallback.Stub.a(parcel.readStrongBinder()), parcel.readString(), parcel.readInt() != 0 ? (Bundle) Bundle.CREATOR.createFromParcel(parcel) : null);
|
||||
parcel2.writeNoException();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
void a(ICustomTabsCallback iCustomTabsCallback, Bundle bundle) throws RemoteException;
|
||||
|
||||
void a(ICustomTabsCallback iCustomTabsCallback, String str, Bundle bundle) throws RemoteException;
|
||||
}
|
53
sources/android/support/v4/app/INotificationSideChannel.java
Normal file
53
sources/android/support/v4/app/INotificationSideChannel.java
Normal file
@@ -0,0 +1,53 @@
|
||||
package android.support.v4.app;
|
||||
|
||||
import android.app.Notification;
|
||||
import android.os.Binder;
|
||||
import android.os.IBinder;
|
||||
import android.os.IInterface;
|
||||
import android.os.Parcel;
|
||||
import android.os.RemoteException;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface INotificationSideChannel extends IInterface {
|
||||
|
||||
public static abstract class Stub extends Binder implements INotificationSideChannel {
|
||||
public Stub() {
|
||||
attachInterface(this, "android.support.v4.app.INotificationSideChannel");
|
||||
}
|
||||
|
||||
@Override // android.os.IInterface
|
||||
public IBinder asBinder() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.os.Binder
|
||||
public boolean onTransact(int i, Parcel parcel, Parcel parcel2, int i2) throws RemoteException {
|
||||
if (i == 1) {
|
||||
parcel.enforceInterface("android.support.v4.app.INotificationSideChannel");
|
||||
a(parcel.readString(), parcel.readInt(), parcel.readString(), parcel.readInt() != 0 ? (Notification) Notification.CREATOR.createFromParcel(parcel) : null);
|
||||
return true;
|
||||
}
|
||||
if (i == 2) {
|
||||
parcel.enforceInterface("android.support.v4.app.INotificationSideChannel");
|
||||
a(parcel.readString(), parcel.readInt(), parcel.readString());
|
||||
return true;
|
||||
}
|
||||
if (i == 3) {
|
||||
parcel.enforceInterface("android.support.v4.app.INotificationSideChannel");
|
||||
a(parcel.readString());
|
||||
return true;
|
||||
}
|
||||
if (i != 1598968902) {
|
||||
return super.onTransact(i, parcel, parcel2, i2);
|
||||
}
|
||||
parcel2.writeString("android.support.v4.app.INotificationSideChannel");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
void a(String str) throws RemoteException;
|
||||
|
||||
void a(String str, int i, String str2) throws RemoteException;
|
||||
|
||||
void a(String str, int i, String str2, Notification notification) throws RemoteException;
|
||||
}
|
@@ -0,0 +1,15 @@
|
||||
package android.support.v4.graphics.drawable;
|
||||
|
||||
import androidx.core.graphics.drawable.IconCompat;
|
||||
import androidx.versionedparcelable.VersionedParcel;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class IconCompatParcelizer extends androidx.core.graphics.drawable.IconCompatParcelizer {
|
||||
public static IconCompat read(VersionedParcel versionedParcel) {
|
||||
return androidx.core.graphics.drawable.IconCompatParcelizer.read(versionedParcel);
|
||||
}
|
||||
|
||||
public static void write(IconCompat iconCompat, VersionedParcel versionedParcel) {
|
||||
androidx.core.graphics.drawable.IconCompatParcelizer.write(iconCompat, versionedParcel);
|
||||
}
|
||||
}
|
1039
sources/android/support/v4/media/MediaBrowserCompat.java
Normal file
1039
sources/android/support/v4/media/MediaBrowserCompat.java
Normal file
File diff suppressed because it is too large
Load Diff
104
sources/android/support/v4/media/MediaBrowserCompatApi21.java
Normal file
104
sources/android/support/v4/media/MediaBrowserCompatApi21.java
Normal file
@@ -0,0 +1,104 @@
|
||||
package android.support.v4.media;
|
||||
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.media.browse.MediaBrowser;
|
||||
import android.os.Bundle;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class MediaBrowserCompatApi21 {
|
||||
|
||||
interface ConnectionCallback {
|
||||
void b();
|
||||
|
||||
void d();
|
||||
|
||||
void onConnected();
|
||||
}
|
||||
|
||||
static class ConnectionCallbackProxy<T extends ConnectionCallback> extends MediaBrowser.ConnectionCallback {
|
||||
protected final T a;
|
||||
|
||||
public ConnectionCallbackProxy(T t) {
|
||||
this.a = t;
|
||||
}
|
||||
|
||||
@Override // android.media.browse.MediaBrowser.ConnectionCallback
|
||||
public void onConnected() {
|
||||
this.a.onConnected();
|
||||
}
|
||||
|
||||
@Override // android.media.browse.MediaBrowser.ConnectionCallback
|
||||
public void onConnectionFailed() {
|
||||
this.a.d();
|
||||
}
|
||||
|
||||
@Override // android.media.browse.MediaBrowser.ConnectionCallback
|
||||
public void onConnectionSuspended() {
|
||||
this.a.b();
|
||||
}
|
||||
}
|
||||
|
||||
static class MediaItem {
|
||||
public static Object a(Object obj) {
|
||||
return ((MediaBrowser.MediaItem) obj).getDescription();
|
||||
}
|
||||
|
||||
public static int b(Object obj) {
|
||||
return ((MediaBrowser.MediaItem) obj).getFlags();
|
||||
}
|
||||
}
|
||||
|
||||
interface SubscriptionCallback {
|
||||
void a(String str, List<?> list);
|
||||
|
||||
void b(String str);
|
||||
}
|
||||
|
||||
static class SubscriptionCallbackProxy<T extends SubscriptionCallback> extends MediaBrowser.SubscriptionCallback {
|
||||
protected final T a;
|
||||
|
||||
public SubscriptionCallbackProxy(T t) {
|
||||
this.a = t;
|
||||
}
|
||||
|
||||
@Override // android.media.browse.MediaBrowser.SubscriptionCallback
|
||||
public void onChildrenLoaded(String str, List<MediaBrowser.MediaItem> list) {
|
||||
this.a.a(str, list);
|
||||
}
|
||||
|
||||
@Override // android.media.browse.MediaBrowser.SubscriptionCallback
|
||||
public void onError(String str) {
|
||||
this.a.b(str);
|
||||
}
|
||||
}
|
||||
|
||||
public static Object a(ConnectionCallback connectionCallback) {
|
||||
return new ConnectionCallbackProxy(connectionCallback);
|
||||
}
|
||||
|
||||
public static void b(Object obj) {
|
||||
((MediaBrowser) obj).disconnect();
|
||||
}
|
||||
|
||||
public static Bundle c(Object obj) {
|
||||
return ((MediaBrowser) obj).getExtras();
|
||||
}
|
||||
|
||||
public static Object d(Object obj) {
|
||||
return ((MediaBrowser) obj).getSessionToken();
|
||||
}
|
||||
|
||||
public static Object a(Context context, ComponentName componentName, Object obj, Bundle bundle) {
|
||||
return new MediaBrowser(context, componentName, (MediaBrowser.ConnectionCallback) obj, bundle);
|
||||
}
|
||||
|
||||
public static void a(Object obj) {
|
||||
((MediaBrowser) obj).connect();
|
||||
}
|
||||
|
||||
public static Object a(SubscriptionCallback subscriptionCallback) {
|
||||
return new SubscriptionCallbackProxy(subscriptionCallback);
|
||||
}
|
||||
}
|
@@ -0,0 +1,39 @@
|
||||
package android.support.v4.media;
|
||||
|
||||
import android.media.browse.MediaBrowser;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.media.MediaBrowserCompatApi21;
|
||||
import android.support.v4.media.session.MediaSessionCompat;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class MediaBrowserCompatApi26 {
|
||||
|
||||
interface SubscriptionCallback extends MediaBrowserCompatApi21.SubscriptionCallback {
|
||||
void a(String str, Bundle bundle);
|
||||
|
||||
void a(String str, List<?> list, Bundle bundle);
|
||||
}
|
||||
|
||||
static class SubscriptionCallbackProxy<T extends SubscriptionCallback> extends MediaBrowserCompatApi21.SubscriptionCallbackProxy<T> {
|
||||
SubscriptionCallbackProxy(T t) {
|
||||
super(t);
|
||||
}
|
||||
|
||||
@Override // android.media.browse.MediaBrowser.SubscriptionCallback
|
||||
public void onChildrenLoaded(String str, List<MediaBrowser.MediaItem> list, Bundle bundle) {
|
||||
MediaSessionCompat.a(bundle);
|
||||
((SubscriptionCallback) this.a).a(str, list, bundle);
|
||||
}
|
||||
|
||||
@Override // android.media.browse.MediaBrowser.SubscriptionCallback
|
||||
public void onError(String str, Bundle bundle) {
|
||||
MediaSessionCompat.a(bundle);
|
||||
((SubscriptionCallback) this.a).a(str, bundle);
|
||||
}
|
||||
}
|
||||
|
||||
static Object a(SubscriptionCallback subscriptionCallback) {
|
||||
return new SubscriptionCallbackProxy(subscriptionCallback);
|
||||
}
|
||||
}
|
283
sources/android/support/v4/media/MediaDescriptionCompat.java
Normal file
283
sources/android/support/v4/media/MediaDescriptionCompat.java
Normal file
@@ -0,0 +1,283 @@
|
||||
package android.support.v4.media;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.support.v4.media.MediaDescriptionCompatApi21;
|
||||
import android.support.v4.media.MediaDescriptionCompatApi23;
|
||||
import android.text.TextUtils;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class MediaDescriptionCompat implements Parcelable {
|
||||
public static final long BT_FOLDER_TYPE_ALBUMS = 2;
|
||||
public static final long BT_FOLDER_TYPE_ARTISTS = 3;
|
||||
public static final long BT_FOLDER_TYPE_GENRES = 4;
|
||||
public static final long BT_FOLDER_TYPE_MIXED = 0;
|
||||
public static final long BT_FOLDER_TYPE_PLAYLISTS = 5;
|
||||
public static final long BT_FOLDER_TYPE_TITLES = 1;
|
||||
public static final long BT_FOLDER_TYPE_YEARS = 6;
|
||||
public static final Parcelable.Creator<MediaDescriptionCompat> CREATOR = new Parcelable.Creator<MediaDescriptionCompat>() { // from class: android.support.v4.media.MediaDescriptionCompat.1
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public MediaDescriptionCompat createFromParcel(Parcel parcel) {
|
||||
return Build.VERSION.SDK_INT < 21 ? new MediaDescriptionCompat(parcel) : MediaDescriptionCompat.fromMediaDescription(MediaDescriptionCompatApi21.a(parcel));
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public MediaDescriptionCompat[] newArray(int i) {
|
||||
return new MediaDescriptionCompat[i];
|
||||
}
|
||||
};
|
||||
public static final String DESCRIPTION_KEY_MEDIA_URI = "android.support.v4.media.description.MEDIA_URI";
|
||||
public static final String DESCRIPTION_KEY_NULL_BUNDLE_FLAG = "android.support.v4.media.description.NULL_BUNDLE_FLAG";
|
||||
public static final String EXTRA_BT_FOLDER_TYPE = "android.media.extra.BT_FOLDER_TYPE";
|
||||
public static final String EXTRA_DOWNLOAD_STATUS = "android.media.extra.DOWNLOAD_STATUS";
|
||||
public static final long STATUS_DOWNLOADED = 2;
|
||||
public static final long STATUS_DOWNLOADING = 1;
|
||||
public static final long STATUS_NOT_DOWNLOADED = 0;
|
||||
private final CharSequence mDescription;
|
||||
private Object mDescriptionObj;
|
||||
private final Bundle mExtras;
|
||||
private final Bitmap mIcon;
|
||||
private final Uri mIconUri;
|
||||
private final String mMediaId;
|
||||
private final Uri mMediaUri;
|
||||
private final CharSequence mSubtitle;
|
||||
private final CharSequence mTitle;
|
||||
|
||||
public static final class Builder {
|
||||
private String a;
|
||||
private CharSequence b;
|
||||
private CharSequence c;
|
||||
private CharSequence d;
|
||||
private Bitmap e;
|
||||
private Uri f;
|
||||
private Bundle g;
|
||||
private Uri h;
|
||||
|
||||
public Builder a(String str) {
|
||||
this.a = str;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder b(CharSequence charSequence) {
|
||||
this.c = charSequence;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder c(CharSequence charSequence) {
|
||||
this.b = charSequence;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder a(CharSequence charSequence) {
|
||||
this.d = charSequence;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder b(Uri uri) {
|
||||
this.h = uri;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder a(Bitmap bitmap) {
|
||||
this.e = bitmap;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder a(Uri uri) {
|
||||
this.f = uri;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder a(Bundle bundle) {
|
||||
this.g = bundle;
|
||||
return this;
|
||||
}
|
||||
|
||||
public MediaDescriptionCompat a() {
|
||||
return new MediaDescriptionCompat(this.a, this.b, this.c, this.d, this.e, this.f, this.g, this.h);
|
||||
}
|
||||
}
|
||||
|
||||
MediaDescriptionCompat(String str, CharSequence charSequence, CharSequence charSequence2, CharSequence charSequence3, Bitmap bitmap, Uri uri, Bundle bundle, Uri uri2) {
|
||||
this.mMediaId = str;
|
||||
this.mTitle = charSequence;
|
||||
this.mSubtitle = charSequence2;
|
||||
this.mDescription = charSequence3;
|
||||
this.mIcon = bitmap;
|
||||
this.mIconUri = uri;
|
||||
this.mExtras = bundle;
|
||||
this.mMediaUri = uri2;
|
||||
}
|
||||
|
||||
/* JADX WARN: Removed duplicated region for block: B:15:0x0069 */
|
||||
/* JADX WARN: Removed duplicated region for block: B:19:0x006d */
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
||||
*/
|
||||
public static android.support.v4.media.MediaDescriptionCompat fromMediaDescription(java.lang.Object r8) {
|
||||
/*
|
||||
r0 = 0
|
||||
if (r8 == 0) goto L80
|
||||
int r1 = android.os.Build.VERSION.SDK_INT
|
||||
r2 = 21
|
||||
if (r1 < r2) goto L80
|
||||
android.support.v4.media.MediaDescriptionCompat$Builder r1 = new android.support.v4.media.MediaDescriptionCompat$Builder
|
||||
r1.<init>()
|
||||
java.lang.String r2 = android.support.v4.media.MediaDescriptionCompatApi21.e(r8)
|
||||
r1.a(r2)
|
||||
java.lang.CharSequence r2 = android.support.v4.media.MediaDescriptionCompatApi21.g(r8)
|
||||
r1.c(r2)
|
||||
java.lang.CharSequence r2 = android.support.v4.media.MediaDescriptionCompatApi21.f(r8)
|
||||
r1.b(r2)
|
||||
java.lang.CharSequence r2 = android.support.v4.media.MediaDescriptionCompatApi21.a(r8)
|
||||
r1.a(r2)
|
||||
android.graphics.Bitmap r2 = android.support.v4.media.MediaDescriptionCompatApi21.c(r8)
|
||||
r1.a(r2)
|
||||
android.net.Uri r2 = android.support.v4.media.MediaDescriptionCompatApi21.d(r8)
|
||||
r1.a(r2)
|
||||
android.os.Bundle r2 = android.support.v4.media.MediaDescriptionCompatApi21.b(r8)
|
||||
java.lang.String r3 = "android.support.v4.media.description.MEDIA_URI"
|
||||
if (r2 == 0) goto L4a
|
||||
android.support.v4.media.session.MediaSessionCompat.a(r2)
|
||||
android.os.Parcelable r4 = r2.getParcelable(r3)
|
||||
android.net.Uri r4 = (android.net.Uri) r4
|
||||
goto L4b
|
||||
L4a:
|
||||
r4 = r0
|
||||
L4b:
|
||||
if (r4 == 0) goto L63
|
||||
java.lang.String r5 = "android.support.v4.media.description.NULL_BUNDLE_FLAG"
|
||||
boolean r6 = r2.containsKey(r5)
|
||||
if (r6 == 0) goto L5d
|
||||
int r6 = r2.size()
|
||||
r7 = 2
|
||||
if (r6 != r7) goto L5d
|
||||
goto L64
|
||||
L5d:
|
||||
r2.remove(r3)
|
||||
r2.remove(r5)
|
||||
L63:
|
||||
r0 = r2
|
||||
L64:
|
||||
r1.a(r0)
|
||||
if (r4 == 0) goto L6d
|
||||
r1.b(r4)
|
||||
goto L7a
|
||||
L6d:
|
||||
int r0 = android.os.Build.VERSION.SDK_INT
|
||||
r2 = 23
|
||||
if (r0 < r2) goto L7a
|
||||
android.net.Uri r0 = android.support.v4.media.MediaDescriptionCompatApi23.a(r8)
|
||||
r1.b(r0)
|
||||
L7a:
|
||||
android.support.v4.media.MediaDescriptionCompat r0 = r1.a()
|
||||
r0.mDescriptionObj = r8
|
||||
L80:
|
||||
return r0
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: android.support.v4.media.MediaDescriptionCompat.fromMediaDescription(java.lang.Object):android.support.v4.media.MediaDescriptionCompat");
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public CharSequence getDescription() {
|
||||
return this.mDescription;
|
||||
}
|
||||
|
||||
public Bundle getExtras() {
|
||||
return this.mExtras;
|
||||
}
|
||||
|
||||
public Bitmap getIconBitmap() {
|
||||
return this.mIcon;
|
||||
}
|
||||
|
||||
public Uri getIconUri() {
|
||||
return this.mIconUri;
|
||||
}
|
||||
|
||||
public Object getMediaDescription() {
|
||||
if (this.mDescriptionObj != null || Build.VERSION.SDK_INT < 21) {
|
||||
return this.mDescriptionObj;
|
||||
}
|
||||
Object a = MediaDescriptionCompatApi21.Builder.a();
|
||||
MediaDescriptionCompatApi21.Builder.a(a, this.mMediaId);
|
||||
MediaDescriptionCompatApi21.Builder.c(a, this.mTitle);
|
||||
MediaDescriptionCompatApi21.Builder.b(a, this.mSubtitle);
|
||||
MediaDescriptionCompatApi21.Builder.a(a, this.mDescription);
|
||||
MediaDescriptionCompatApi21.Builder.a(a, this.mIcon);
|
||||
MediaDescriptionCompatApi21.Builder.a(a, this.mIconUri);
|
||||
Bundle bundle = this.mExtras;
|
||||
if (Build.VERSION.SDK_INT < 23 && this.mMediaUri != null) {
|
||||
if (bundle == null) {
|
||||
bundle = new Bundle();
|
||||
bundle.putBoolean(DESCRIPTION_KEY_NULL_BUNDLE_FLAG, true);
|
||||
}
|
||||
bundle.putParcelable(DESCRIPTION_KEY_MEDIA_URI, this.mMediaUri);
|
||||
}
|
||||
MediaDescriptionCompatApi21.Builder.a(a, bundle);
|
||||
if (Build.VERSION.SDK_INT >= 23) {
|
||||
MediaDescriptionCompatApi23.Builder.a(a, this.mMediaUri);
|
||||
}
|
||||
this.mDescriptionObj = MediaDescriptionCompatApi21.Builder.a(a);
|
||||
return this.mDescriptionObj;
|
||||
}
|
||||
|
||||
public String getMediaId() {
|
||||
return this.mMediaId;
|
||||
}
|
||||
|
||||
public Uri getMediaUri() {
|
||||
return this.mMediaUri;
|
||||
}
|
||||
|
||||
public CharSequence getSubtitle() {
|
||||
return this.mSubtitle;
|
||||
}
|
||||
|
||||
public CharSequence getTitle() {
|
||||
return this.mTitle;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return ((Object) this.mTitle) + ", " + ((Object) this.mSubtitle) + ", " + ((Object) this.mDescription);
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public void writeToParcel(Parcel parcel, int i) {
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
MediaDescriptionCompatApi21.a(getMediaDescription(), parcel, i);
|
||||
return;
|
||||
}
|
||||
parcel.writeString(this.mMediaId);
|
||||
TextUtils.writeToParcel(this.mTitle, parcel, i);
|
||||
TextUtils.writeToParcel(this.mSubtitle, parcel, i);
|
||||
TextUtils.writeToParcel(this.mDescription, parcel, i);
|
||||
parcel.writeParcelable(this.mIcon, i);
|
||||
parcel.writeParcelable(this.mIconUri, i);
|
||||
parcel.writeBundle(this.mExtras);
|
||||
parcel.writeParcelable(this.mMediaUri, i);
|
||||
}
|
||||
|
||||
MediaDescriptionCompat(Parcel parcel) {
|
||||
this.mMediaId = parcel.readString();
|
||||
this.mTitle = (CharSequence) TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(parcel);
|
||||
this.mSubtitle = (CharSequence) TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(parcel);
|
||||
this.mDescription = (CharSequence) TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(parcel);
|
||||
ClassLoader classLoader = MediaDescriptionCompat.class.getClassLoader();
|
||||
this.mIcon = (Bitmap) parcel.readParcelable(classLoader);
|
||||
this.mIconUri = (Uri) parcel.readParcelable(classLoader);
|
||||
this.mExtras = parcel.readBundle(classLoader);
|
||||
this.mMediaUri = (Uri) parcel.readParcelable(classLoader);
|
||||
}
|
||||
}
|
@@ -0,0 +1,85 @@
|
||||
package android.support.v4.media;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.media.MediaDescription;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.Parcel;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class MediaDescriptionCompatApi21 {
|
||||
|
||||
static class Builder {
|
||||
public static Object a() {
|
||||
return new MediaDescription.Builder();
|
||||
}
|
||||
|
||||
public static void b(Object obj, CharSequence charSequence) {
|
||||
((MediaDescription.Builder) obj).setSubtitle(charSequence);
|
||||
}
|
||||
|
||||
public static void c(Object obj, CharSequence charSequence) {
|
||||
((MediaDescription.Builder) obj).setTitle(charSequence);
|
||||
}
|
||||
|
||||
public static void a(Object obj, String str) {
|
||||
((MediaDescription.Builder) obj).setMediaId(str);
|
||||
}
|
||||
|
||||
public static void a(Object obj, CharSequence charSequence) {
|
||||
((MediaDescription.Builder) obj).setDescription(charSequence);
|
||||
}
|
||||
|
||||
public static void a(Object obj, Bitmap bitmap) {
|
||||
((MediaDescription.Builder) obj).setIconBitmap(bitmap);
|
||||
}
|
||||
|
||||
public static void a(Object obj, Uri uri) {
|
||||
((MediaDescription.Builder) obj).setIconUri(uri);
|
||||
}
|
||||
|
||||
public static void a(Object obj, Bundle bundle) {
|
||||
((MediaDescription.Builder) obj).setExtras(bundle);
|
||||
}
|
||||
|
||||
public static Object a(Object obj) {
|
||||
return ((MediaDescription.Builder) obj).build();
|
||||
}
|
||||
}
|
||||
|
||||
public static CharSequence a(Object obj) {
|
||||
return ((MediaDescription) obj).getDescription();
|
||||
}
|
||||
|
||||
public static Bundle b(Object obj) {
|
||||
return ((MediaDescription) obj).getExtras();
|
||||
}
|
||||
|
||||
public static Bitmap c(Object obj) {
|
||||
return ((MediaDescription) obj).getIconBitmap();
|
||||
}
|
||||
|
||||
public static Uri d(Object obj) {
|
||||
return ((MediaDescription) obj).getIconUri();
|
||||
}
|
||||
|
||||
public static String e(Object obj) {
|
||||
return ((MediaDescription) obj).getMediaId();
|
||||
}
|
||||
|
||||
public static CharSequence f(Object obj) {
|
||||
return ((MediaDescription) obj).getSubtitle();
|
||||
}
|
||||
|
||||
public static CharSequence g(Object obj) {
|
||||
return ((MediaDescription) obj).getTitle();
|
||||
}
|
||||
|
||||
public static void a(Object obj, Parcel parcel, int i) {
|
||||
((MediaDescription) obj).writeToParcel(parcel, i);
|
||||
}
|
||||
|
||||
public static Object a(Parcel parcel) {
|
||||
return MediaDescription.CREATOR.createFromParcel(parcel);
|
||||
}
|
||||
}
|
@@ -0,0 +1,18 @@
|
||||
package android.support.v4.media;
|
||||
|
||||
import android.media.MediaDescription;
|
||||
import android.net.Uri;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class MediaDescriptionCompatApi23 {
|
||||
|
||||
static class Builder {
|
||||
public static void a(Object obj, Uri uri) {
|
||||
((MediaDescription.Builder) obj).setMediaUri(uri);
|
||||
}
|
||||
}
|
||||
|
||||
public static Uri a(Object obj) {
|
||||
return ((MediaDescription) obj).getMediaUri();
|
||||
}
|
||||
}
|
287
sources/android/support/v4/media/MediaMetadataCompat.java
Normal file
287
sources/android/support/v4/media/MediaMetadataCompat.java
Normal file
@@ -0,0 +1,287 @@
|
||||
package android.support.v4.media;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.support.v4.media.MediaDescriptionCompat;
|
||||
import android.support.v4.media.session.MediaSessionCompat;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import androidx.collection.ArrayMap;
|
||||
import java.util.Set;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class MediaMetadataCompat implements Parcelable {
|
||||
public static final Parcelable.Creator<MediaMetadataCompat> CREATOR;
|
||||
static final ArrayMap<String, Integer> METADATA_KEYS_TYPE = new ArrayMap<>();
|
||||
public static final String METADATA_KEY_ADVERTISEMENT = "android.media.metadata.ADVERTISEMENT";
|
||||
public static final String METADATA_KEY_ALBUM = "android.media.metadata.ALBUM";
|
||||
public static final String METADATA_KEY_ALBUM_ART = "android.media.metadata.ALBUM_ART";
|
||||
public static final String METADATA_KEY_ALBUM_ARTIST = "android.media.metadata.ALBUM_ARTIST";
|
||||
public static final String METADATA_KEY_ALBUM_ART_URI = "android.media.metadata.ALBUM_ART_URI";
|
||||
public static final String METADATA_KEY_ART = "android.media.metadata.ART";
|
||||
public static final String METADATA_KEY_ARTIST = "android.media.metadata.ARTIST";
|
||||
public static final String METADATA_KEY_ART_URI = "android.media.metadata.ART_URI";
|
||||
public static final String METADATA_KEY_AUTHOR = "android.media.metadata.AUTHOR";
|
||||
public static final String METADATA_KEY_BT_FOLDER_TYPE = "android.media.metadata.BT_FOLDER_TYPE";
|
||||
public static final String METADATA_KEY_COMPILATION = "android.media.metadata.COMPILATION";
|
||||
public static final String METADATA_KEY_COMPOSER = "android.media.metadata.COMPOSER";
|
||||
public static final String METADATA_KEY_DATE = "android.media.metadata.DATE";
|
||||
public static final String METADATA_KEY_DISC_NUMBER = "android.media.metadata.DISC_NUMBER";
|
||||
public static final String METADATA_KEY_DISPLAY_DESCRIPTION = "android.media.metadata.DISPLAY_DESCRIPTION";
|
||||
public static final String METADATA_KEY_DISPLAY_ICON = "android.media.metadata.DISPLAY_ICON";
|
||||
public static final String METADATA_KEY_DISPLAY_ICON_URI = "android.media.metadata.DISPLAY_ICON_URI";
|
||||
public static final String METADATA_KEY_DISPLAY_SUBTITLE = "android.media.metadata.DISPLAY_SUBTITLE";
|
||||
public static final String METADATA_KEY_DISPLAY_TITLE = "android.media.metadata.DISPLAY_TITLE";
|
||||
public static final String METADATA_KEY_DOWNLOAD_STATUS = "android.media.metadata.DOWNLOAD_STATUS";
|
||||
public static final String METADATA_KEY_DURATION = "android.media.metadata.DURATION";
|
||||
public static final String METADATA_KEY_GENRE = "android.media.metadata.GENRE";
|
||||
public static final String METADATA_KEY_MEDIA_ID = "android.media.metadata.MEDIA_ID";
|
||||
public static final String METADATA_KEY_MEDIA_URI = "android.media.metadata.MEDIA_URI";
|
||||
public static final String METADATA_KEY_NUM_TRACKS = "android.media.metadata.NUM_TRACKS";
|
||||
public static final String METADATA_KEY_RATING = "android.media.metadata.RATING";
|
||||
public static final String METADATA_KEY_TITLE = "android.media.metadata.TITLE";
|
||||
public static final String METADATA_KEY_TRACK_NUMBER = "android.media.metadata.TRACK_NUMBER";
|
||||
public static final String METADATA_KEY_USER_RATING = "android.media.metadata.USER_RATING";
|
||||
public static final String METADATA_KEY_WRITER = "android.media.metadata.WRITER";
|
||||
public static final String METADATA_KEY_YEAR = "android.media.metadata.YEAR";
|
||||
static final int METADATA_TYPE_BITMAP = 2;
|
||||
static final int METADATA_TYPE_LONG = 0;
|
||||
static final int METADATA_TYPE_RATING = 3;
|
||||
static final int METADATA_TYPE_TEXT = 1;
|
||||
private static final String[] PREFERRED_BITMAP_ORDER;
|
||||
private static final String[] PREFERRED_DESCRIPTION_ORDER;
|
||||
private static final String[] PREFERRED_URI_ORDER;
|
||||
private static final String TAG = "MediaMetadata";
|
||||
final Bundle mBundle;
|
||||
private MediaDescriptionCompat mDescription;
|
||||
private Object mMetadataObj;
|
||||
|
||||
static {
|
||||
METADATA_KEYS_TYPE.put(METADATA_KEY_TITLE, 1);
|
||||
METADATA_KEYS_TYPE.put(METADATA_KEY_ARTIST, 1);
|
||||
METADATA_KEYS_TYPE.put(METADATA_KEY_DURATION, 0);
|
||||
METADATA_KEYS_TYPE.put(METADATA_KEY_ALBUM, 1);
|
||||
METADATA_KEYS_TYPE.put(METADATA_KEY_AUTHOR, 1);
|
||||
METADATA_KEYS_TYPE.put(METADATA_KEY_WRITER, 1);
|
||||
METADATA_KEYS_TYPE.put(METADATA_KEY_COMPOSER, 1);
|
||||
METADATA_KEYS_TYPE.put(METADATA_KEY_COMPILATION, 1);
|
||||
METADATA_KEYS_TYPE.put(METADATA_KEY_DATE, 1);
|
||||
METADATA_KEYS_TYPE.put(METADATA_KEY_YEAR, 0);
|
||||
METADATA_KEYS_TYPE.put(METADATA_KEY_GENRE, 1);
|
||||
METADATA_KEYS_TYPE.put(METADATA_KEY_TRACK_NUMBER, 0);
|
||||
METADATA_KEYS_TYPE.put(METADATA_KEY_NUM_TRACKS, 0);
|
||||
METADATA_KEYS_TYPE.put(METADATA_KEY_DISC_NUMBER, 0);
|
||||
METADATA_KEYS_TYPE.put(METADATA_KEY_ALBUM_ARTIST, 1);
|
||||
METADATA_KEYS_TYPE.put(METADATA_KEY_ART, 2);
|
||||
METADATA_KEYS_TYPE.put(METADATA_KEY_ART_URI, 1);
|
||||
METADATA_KEYS_TYPE.put(METADATA_KEY_ALBUM_ART, 2);
|
||||
METADATA_KEYS_TYPE.put(METADATA_KEY_ALBUM_ART_URI, 1);
|
||||
METADATA_KEYS_TYPE.put(METADATA_KEY_USER_RATING, 3);
|
||||
METADATA_KEYS_TYPE.put(METADATA_KEY_RATING, 3);
|
||||
METADATA_KEYS_TYPE.put(METADATA_KEY_DISPLAY_TITLE, 1);
|
||||
METADATA_KEYS_TYPE.put(METADATA_KEY_DISPLAY_SUBTITLE, 1);
|
||||
METADATA_KEYS_TYPE.put(METADATA_KEY_DISPLAY_DESCRIPTION, 1);
|
||||
METADATA_KEYS_TYPE.put(METADATA_KEY_DISPLAY_ICON, 2);
|
||||
METADATA_KEYS_TYPE.put(METADATA_KEY_DISPLAY_ICON_URI, 1);
|
||||
METADATA_KEYS_TYPE.put(METADATA_KEY_MEDIA_ID, 1);
|
||||
METADATA_KEYS_TYPE.put(METADATA_KEY_BT_FOLDER_TYPE, 0);
|
||||
METADATA_KEYS_TYPE.put(METADATA_KEY_MEDIA_URI, 1);
|
||||
METADATA_KEYS_TYPE.put(METADATA_KEY_ADVERTISEMENT, 0);
|
||||
METADATA_KEYS_TYPE.put(METADATA_KEY_DOWNLOAD_STATUS, 0);
|
||||
PREFERRED_DESCRIPTION_ORDER = new String[]{METADATA_KEY_TITLE, METADATA_KEY_ARTIST, METADATA_KEY_ALBUM, METADATA_KEY_ALBUM_ARTIST, METADATA_KEY_WRITER, METADATA_KEY_AUTHOR, METADATA_KEY_COMPOSER};
|
||||
PREFERRED_BITMAP_ORDER = new String[]{METADATA_KEY_DISPLAY_ICON, METADATA_KEY_ART, METADATA_KEY_ALBUM_ART};
|
||||
PREFERRED_URI_ORDER = new String[]{METADATA_KEY_DISPLAY_ICON_URI, METADATA_KEY_ART_URI, METADATA_KEY_ALBUM_ART_URI};
|
||||
CREATOR = new Parcelable.Creator<MediaMetadataCompat>() { // from class: android.support.v4.media.MediaMetadataCompat.1
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public MediaMetadataCompat createFromParcel(Parcel parcel) {
|
||||
return new MediaMetadataCompat(parcel);
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public MediaMetadataCompat[] newArray(int i) {
|
||||
return new MediaMetadataCompat[i];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
MediaMetadataCompat(Bundle bundle) {
|
||||
this.mBundle = new Bundle(bundle);
|
||||
MediaSessionCompat.a(this.mBundle);
|
||||
}
|
||||
|
||||
public static MediaMetadataCompat fromMediaMetadata(Object obj) {
|
||||
if (obj == null || Build.VERSION.SDK_INT < 21) {
|
||||
return null;
|
||||
}
|
||||
Parcel obtain = Parcel.obtain();
|
||||
MediaMetadataCompatApi21.a(obj, obtain, 0);
|
||||
obtain.setDataPosition(0);
|
||||
MediaMetadataCompat createFromParcel = CREATOR.createFromParcel(obtain);
|
||||
obtain.recycle();
|
||||
createFromParcel.mMetadataObj = obj;
|
||||
return createFromParcel;
|
||||
}
|
||||
|
||||
public boolean containsKey(String str) {
|
||||
return this.mBundle.containsKey(str);
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public Bitmap getBitmap(String str) {
|
||||
try {
|
||||
return (Bitmap) this.mBundle.getParcelable(str);
|
||||
} catch (Exception e) {
|
||||
Log.w(TAG, "Failed to retrieve a key as Bitmap.", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public Bundle getBundle() {
|
||||
return new Bundle(this.mBundle);
|
||||
}
|
||||
|
||||
public MediaDescriptionCompat getDescription() {
|
||||
Bitmap bitmap;
|
||||
Uri uri;
|
||||
MediaDescriptionCompat mediaDescriptionCompat = this.mDescription;
|
||||
if (mediaDescriptionCompat != null) {
|
||||
return mediaDescriptionCompat;
|
||||
}
|
||||
String string = getString(METADATA_KEY_MEDIA_ID);
|
||||
CharSequence[] charSequenceArr = new CharSequence[3];
|
||||
CharSequence text = getText(METADATA_KEY_DISPLAY_TITLE);
|
||||
if (TextUtils.isEmpty(text)) {
|
||||
int i = 0;
|
||||
int i2 = 0;
|
||||
while (i < charSequenceArr.length) {
|
||||
String[] strArr = PREFERRED_DESCRIPTION_ORDER;
|
||||
if (i2 >= strArr.length) {
|
||||
break;
|
||||
}
|
||||
int i3 = i2 + 1;
|
||||
CharSequence text2 = getText(strArr[i2]);
|
||||
if (!TextUtils.isEmpty(text2)) {
|
||||
charSequenceArr[i] = text2;
|
||||
i++;
|
||||
}
|
||||
i2 = i3;
|
||||
}
|
||||
} else {
|
||||
charSequenceArr[0] = text;
|
||||
charSequenceArr[1] = getText(METADATA_KEY_DISPLAY_SUBTITLE);
|
||||
charSequenceArr[2] = getText(METADATA_KEY_DISPLAY_DESCRIPTION);
|
||||
}
|
||||
int i4 = 0;
|
||||
while (true) {
|
||||
String[] strArr2 = PREFERRED_BITMAP_ORDER;
|
||||
if (i4 >= strArr2.length) {
|
||||
bitmap = null;
|
||||
break;
|
||||
}
|
||||
bitmap = getBitmap(strArr2[i4]);
|
||||
if (bitmap != null) {
|
||||
break;
|
||||
}
|
||||
i4++;
|
||||
}
|
||||
int i5 = 0;
|
||||
while (true) {
|
||||
String[] strArr3 = PREFERRED_URI_ORDER;
|
||||
if (i5 >= strArr3.length) {
|
||||
uri = null;
|
||||
break;
|
||||
}
|
||||
String string2 = getString(strArr3[i5]);
|
||||
if (!TextUtils.isEmpty(string2)) {
|
||||
uri = Uri.parse(string2);
|
||||
break;
|
||||
}
|
||||
i5++;
|
||||
}
|
||||
String string3 = getString(METADATA_KEY_MEDIA_URI);
|
||||
Uri parse = TextUtils.isEmpty(string3) ? null : Uri.parse(string3);
|
||||
MediaDescriptionCompat.Builder builder = new MediaDescriptionCompat.Builder();
|
||||
builder.a(string);
|
||||
builder.c(charSequenceArr[0]);
|
||||
builder.b(charSequenceArr[1]);
|
||||
builder.a(charSequenceArr[2]);
|
||||
builder.a(bitmap);
|
||||
builder.a(uri);
|
||||
builder.b(parse);
|
||||
Bundle bundle = new Bundle();
|
||||
if (this.mBundle.containsKey(METADATA_KEY_BT_FOLDER_TYPE)) {
|
||||
bundle.putLong(MediaDescriptionCompat.EXTRA_BT_FOLDER_TYPE, getLong(METADATA_KEY_BT_FOLDER_TYPE));
|
||||
}
|
||||
if (this.mBundle.containsKey(METADATA_KEY_DOWNLOAD_STATUS)) {
|
||||
bundle.putLong(MediaDescriptionCompat.EXTRA_DOWNLOAD_STATUS, getLong(METADATA_KEY_DOWNLOAD_STATUS));
|
||||
}
|
||||
if (!bundle.isEmpty()) {
|
||||
builder.a(bundle);
|
||||
}
|
||||
this.mDescription = builder.a();
|
||||
return this.mDescription;
|
||||
}
|
||||
|
||||
public long getLong(String str) {
|
||||
return this.mBundle.getLong(str, 0L);
|
||||
}
|
||||
|
||||
public Object getMediaMetadata() {
|
||||
if (this.mMetadataObj == null && Build.VERSION.SDK_INT >= 21) {
|
||||
Parcel obtain = Parcel.obtain();
|
||||
writeToParcel(obtain, 0);
|
||||
obtain.setDataPosition(0);
|
||||
this.mMetadataObj = MediaMetadataCompatApi21.a(obtain);
|
||||
obtain.recycle();
|
||||
}
|
||||
return this.mMetadataObj;
|
||||
}
|
||||
|
||||
public RatingCompat getRating(String str) {
|
||||
try {
|
||||
return Build.VERSION.SDK_INT >= 19 ? RatingCompat.fromRating(this.mBundle.getParcelable(str)) : (RatingCompat) this.mBundle.getParcelable(str);
|
||||
} catch (Exception e) {
|
||||
Log.w(TAG, "Failed to retrieve a key as Rating.", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public String getString(String str) {
|
||||
CharSequence charSequence = this.mBundle.getCharSequence(str);
|
||||
if (charSequence != null) {
|
||||
return charSequence.toString();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public CharSequence getText(String str) {
|
||||
return this.mBundle.getCharSequence(str);
|
||||
}
|
||||
|
||||
public Set<String> keySet() {
|
||||
return this.mBundle.keySet();
|
||||
}
|
||||
|
||||
public int size() {
|
||||
return this.mBundle.size();
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public void writeToParcel(Parcel parcel, int i) {
|
||||
parcel.writeBundle(this.mBundle);
|
||||
}
|
||||
|
||||
MediaMetadataCompat(Parcel parcel) {
|
||||
this.mBundle = parcel.readBundle(MediaSessionCompat.class.getClassLoader());
|
||||
}
|
||||
}
|
@@ -0,0 +1,15 @@
|
||||
package android.support.v4.media;
|
||||
|
||||
import android.media.MediaMetadata;
|
||||
import android.os.Parcel;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class MediaMetadataCompatApi21 {
|
||||
public static void a(Object obj, Parcel parcel, int i) {
|
||||
((MediaMetadata) obj).writeToParcel(parcel, i);
|
||||
}
|
||||
|
||||
public static Object a(Parcel parcel) {
|
||||
return MediaMetadata.CREATOR.createFromParcel(parcel);
|
||||
}
|
||||
}
|
198
sources/android/support/v4/media/RatingCompat.java
Normal file
198
sources/android/support/v4/media/RatingCompat.java
Normal file
@@ -0,0 +1,198 @@
|
||||
package android.support.v4.media;
|
||||
|
||||
import android.media.Rating;
|
||||
import android.os.Build;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.util.Log;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class RatingCompat implements Parcelable {
|
||||
public static final Parcelable.Creator<RatingCompat> CREATOR = new Parcelable.Creator<RatingCompat>() { // from class: android.support.v4.media.RatingCompat.1
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public RatingCompat createFromParcel(Parcel parcel) {
|
||||
return new RatingCompat(parcel.readInt(), parcel.readFloat());
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public RatingCompat[] newArray(int i) {
|
||||
return new RatingCompat[i];
|
||||
}
|
||||
};
|
||||
public static final int RATING_3_STARS = 3;
|
||||
public static final int RATING_4_STARS = 4;
|
||||
public static final int RATING_5_STARS = 5;
|
||||
public static final int RATING_HEART = 1;
|
||||
public static final int RATING_NONE = 0;
|
||||
private static final float RATING_NOT_RATED = -1.0f;
|
||||
public static final int RATING_PERCENTAGE = 6;
|
||||
public static final int RATING_THUMB_UP_DOWN = 2;
|
||||
private static final String TAG = "Rating";
|
||||
private Object mRatingObj;
|
||||
private final int mRatingStyle;
|
||||
private final float mRatingValue;
|
||||
|
||||
RatingCompat(int i, float f) {
|
||||
this.mRatingStyle = i;
|
||||
this.mRatingValue = f;
|
||||
}
|
||||
|
||||
public static RatingCompat fromRating(Object obj) {
|
||||
RatingCompat ratingCompat = null;
|
||||
if (obj != null && Build.VERSION.SDK_INT >= 19) {
|
||||
Rating rating = (Rating) obj;
|
||||
int ratingStyle = rating.getRatingStyle();
|
||||
if (rating.isRated()) {
|
||||
switch (ratingStyle) {
|
||||
case 1:
|
||||
ratingCompat = newHeartRating(rating.hasHeart());
|
||||
break;
|
||||
case 2:
|
||||
ratingCompat = newThumbRating(rating.isThumbUp());
|
||||
break;
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
ratingCompat = newStarRating(ratingStyle, rating.getStarRating());
|
||||
break;
|
||||
case 6:
|
||||
ratingCompat = newPercentageRating(rating.getPercentRating());
|
||||
break;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
ratingCompat = newUnratedRating(ratingStyle);
|
||||
}
|
||||
ratingCompat.mRatingObj = obj;
|
||||
}
|
||||
return ratingCompat;
|
||||
}
|
||||
|
||||
public static RatingCompat newHeartRating(boolean z) {
|
||||
return new RatingCompat(1, z ? 1.0f : 0.0f);
|
||||
}
|
||||
|
||||
public static RatingCompat newPercentageRating(float f) {
|
||||
if (f >= 0.0f && f <= 100.0f) {
|
||||
return new RatingCompat(6, f);
|
||||
}
|
||||
Log.e(TAG, "Invalid percentage-based rating value");
|
||||
return null;
|
||||
}
|
||||
|
||||
public static RatingCompat newStarRating(int i, float f) {
|
||||
float f2;
|
||||
if (i == 3) {
|
||||
f2 = 3.0f;
|
||||
} else if (i == 4) {
|
||||
f2 = 4.0f;
|
||||
} else {
|
||||
if (i != 5) {
|
||||
Log.e(TAG, "Invalid rating style (" + i + ") for a star rating");
|
||||
return null;
|
||||
}
|
||||
f2 = 5.0f;
|
||||
}
|
||||
if (f >= 0.0f && f <= f2) {
|
||||
return new RatingCompat(i, f);
|
||||
}
|
||||
Log.e(TAG, "Trying to set out of range star-based rating");
|
||||
return null;
|
||||
}
|
||||
|
||||
public static RatingCompat newThumbRating(boolean z) {
|
||||
return new RatingCompat(2, z ? 1.0f : 0.0f);
|
||||
}
|
||||
|
||||
public static RatingCompat newUnratedRating(int i) {
|
||||
switch (i) {
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
return new RatingCompat(i, RATING_NOT_RATED);
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public int describeContents() {
|
||||
return this.mRatingStyle;
|
||||
}
|
||||
|
||||
public float getPercentRating() {
|
||||
return (this.mRatingStyle == 6 && isRated()) ? this.mRatingValue : RATING_NOT_RATED;
|
||||
}
|
||||
|
||||
public Object getRating() {
|
||||
if (this.mRatingObj == null && Build.VERSION.SDK_INT >= 19) {
|
||||
if (isRated()) {
|
||||
int i = this.mRatingStyle;
|
||||
switch (i) {
|
||||
case 1:
|
||||
this.mRatingObj = Rating.newHeartRating(hasHeart());
|
||||
break;
|
||||
case 2:
|
||||
this.mRatingObj = Rating.newThumbRating(isThumbUp());
|
||||
break;
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
this.mRatingObj = Rating.newStarRating(i, getStarRating());
|
||||
break;
|
||||
case 6:
|
||||
this.mRatingObj = Rating.newPercentageRating(getPercentRating());
|
||||
break;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
this.mRatingObj = Rating.newUnratedRating(this.mRatingStyle);
|
||||
}
|
||||
}
|
||||
return this.mRatingObj;
|
||||
}
|
||||
|
||||
public int getRatingStyle() {
|
||||
return this.mRatingStyle;
|
||||
}
|
||||
|
||||
public float getStarRating() {
|
||||
int i = this.mRatingStyle;
|
||||
return ((i == 3 || i == 4 || i == 5) && isRated()) ? this.mRatingValue : RATING_NOT_RATED;
|
||||
}
|
||||
|
||||
public boolean hasHeart() {
|
||||
return this.mRatingStyle == 1 && this.mRatingValue == 1.0f;
|
||||
}
|
||||
|
||||
public boolean isRated() {
|
||||
return this.mRatingValue >= 0.0f;
|
||||
}
|
||||
|
||||
public boolean isThumbUp() {
|
||||
return this.mRatingStyle == 2 && this.mRatingValue == 1.0f;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("Rating:style=");
|
||||
sb.append(this.mRatingStyle);
|
||||
sb.append(" rating=");
|
||||
float f = this.mRatingValue;
|
||||
sb.append(f < 0.0f ? "unrated" : String.valueOf(f));
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public void writeToParcel(Parcel parcel, int i) {
|
||||
parcel.writeInt(this.mRatingStyle);
|
||||
parcel.writeFloat(this.mRatingValue);
|
||||
}
|
||||
}
|
@@ -0,0 +1,117 @@
|
||||
package android.support.v4.media.session;
|
||||
|
||||
import android.os.Binder;
|
||||
import android.os.Bundle;
|
||||
import android.os.IBinder;
|
||||
import android.os.IInterface;
|
||||
import android.os.Parcel;
|
||||
import android.os.RemoteException;
|
||||
import android.support.v4.media.MediaMetadataCompat;
|
||||
import android.support.v4.media.session.MediaSessionCompat;
|
||||
import android.text.TextUtils;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface IMediaControllerCallback extends IInterface {
|
||||
|
||||
public static abstract class Stub extends Binder implements IMediaControllerCallback {
|
||||
public Stub() {
|
||||
attachInterface(this, "android.support.v4.media.session.IMediaControllerCallback");
|
||||
}
|
||||
|
||||
@Override // android.os.IInterface
|
||||
public IBinder asBinder() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.os.Binder
|
||||
public boolean onTransact(int i, Parcel parcel, Parcel parcel2, int i2) throws RemoteException {
|
||||
if (i == 1598968902) {
|
||||
parcel2.writeString("android.support.v4.media.session.IMediaControllerCallback");
|
||||
return true;
|
||||
}
|
||||
switch (i) {
|
||||
case 1:
|
||||
parcel.enforceInterface("android.support.v4.media.session.IMediaControllerCallback");
|
||||
c(parcel.readString(), parcel.readInt() != 0 ? (Bundle) Bundle.CREATOR.createFromParcel(parcel) : null);
|
||||
return true;
|
||||
case 2:
|
||||
parcel.enforceInterface("android.support.v4.media.session.IMediaControllerCallback");
|
||||
b();
|
||||
return true;
|
||||
case 3:
|
||||
parcel.enforceInterface("android.support.v4.media.session.IMediaControllerCallback");
|
||||
a(parcel.readInt() != 0 ? PlaybackStateCompat.CREATOR.createFromParcel(parcel) : null);
|
||||
return true;
|
||||
case 4:
|
||||
parcel.enforceInterface("android.support.v4.media.session.IMediaControllerCallback");
|
||||
a(parcel.readInt() != 0 ? MediaMetadataCompat.CREATOR.createFromParcel(parcel) : null);
|
||||
return true;
|
||||
case 5:
|
||||
parcel.enforceInterface("android.support.v4.media.session.IMediaControllerCallback");
|
||||
a(parcel.createTypedArrayList(MediaSessionCompat.QueueItem.CREATOR));
|
||||
return true;
|
||||
case 6:
|
||||
parcel.enforceInterface("android.support.v4.media.session.IMediaControllerCallback");
|
||||
a(parcel.readInt() != 0 ? (CharSequence) TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(parcel) : null);
|
||||
return true;
|
||||
case 7:
|
||||
parcel.enforceInterface("android.support.v4.media.session.IMediaControllerCallback");
|
||||
a(parcel.readInt() != 0 ? (Bundle) Bundle.CREATOR.createFromParcel(parcel) : null);
|
||||
return true;
|
||||
case 8:
|
||||
parcel.enforceInterface("android.support.v4.media.session.IMediaControllerCallback");
|
||||
a(parcel.readInt() != 0 ? ParcelableVolumeInfo.CREATOR.createFromParcel(parcel) : null);
|
||||
return true;
|
||||
case 9:
|
||||
parcel.enforceInterface("android.support.v4.media.session.IMediaControllerCallback");
|
||||
g(parcel.readInt());
|
||||
return true;
|
||||
case 10:
|
||||
parcel.enforceInterface("android.support.v4.media.session.IMediaControllerCallback");
|
||||
c(parcel.readInt() != 0);
|
||||
return true;
|
||||
case 11:
|
||||
parcel.enforceInterface("android.support.v4.media.session.IMediaControllerCallback");
|
||||
b(parcel.readInt() != 0);
|
||||
return true;
|
||||
case 12:
|
||||
parcel.enforceInterface("android.support.v4.media.session.IMediaControllerCallback");
|
||||
h(parcel.readInt());
|
||||
return true;
|
||||
case 13:
|
||||
parcel.enforceInterface("android.support.v4.media.session.IMediaControllerCallback");
|
||||
f();
|
||||
return true;
|
||||
default:
|
||||
return super.onTransact(i, parcel, parcel2, i2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void a(Bundle bundle) throws RemoteException;
|
||||
|
||||
void a(MediaMetadataCompat mediaMetadataCompat) throws RemoteException;
|
||||
|
||||
void a(ParcelableVolumeInfo parcelableVolumeInfo) throws RemoteException;
|
||||
|
||||
void a(PlaybackStateCompat playbackStateCompat) throws RemoteException;
|
||||
|
||||
void a(CharSequence charSequence) throws RemoteException;
|
||||
|
||||
void a(List<MediaSessionCompat.QueueItem> list) throws RemoteException;
|
||||
|
||||
void b() throws RemoteException;
|
||||
|
||||
void b(boolean z) throws RemoteException;
|
||||
|
||||
void c(String str, Bundle bundle) throws RemoteException;
|
||||
|
||||
void c(boolean z) throws RemoteException;
|
||||
|
||||
void f() throws RemoteException;
|
||||
|
||||
void g(int i) throws RemoteException;
|
||||
|
||||
void h(int i) throws RemoteException;
|
||||
}
|
74
sources/android/support/v4/media/session/IMediaSession.java
Normal file
74
sources/android/support/v4/media/session/IMediaSession.java
Normal file
@@ -0,0 +1,74 @@
|
||||
package android.support.v4.media.session;
|
||||
|
||||
import android.os.Binder;
|
||||
import android.os.IBinder;
|
||||
import android.os.IInterface;
|
||||
import android.os.Parcel;
|
||||
import android.os.RemoteException;
|
||||
import android.view.KeyEvent;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface IMediaSession extends IInterface {
|
||||
void a(IMediaControllerCallback iMediaControllerCallback) throws RemoteException;
|
||||
|
||||
boolean a(KeyEvent keyEvent) throws RemoteException;
|
||||
|
||||
public static abstract class Stub extends Binder implements IMediaSession {
|
||||
public static IMediaSession a(IBinder iBinder) {
|
||||
if (iBinder == null) {
|
||||
return null;
|
||||
}
|
||||
IInterface queryLocalInterface = iBinder.queryLocalInterface("android.support.v4.media.session.IMediaSession");
|
||||
return (queryLocalInterface == null || !(queryLocalInterface instanceof IMediaSession)) ? new Proxy(iBinder) : (IMediaSession) queryLocalInterface;
|
||||
}
|
||||
|
||||
private static class Proxy implements IMediaSession {
|
||||
private IBinder a;
|
||||
|
||||
Proxy(IBinder iBinder) {
|
||||
this.a = iBinder;
|
||||
}
|
||||
|
||||
@Override // android.support.v4.media.session.IMediaSession
|
||||
public boolean a(KeyEvent keyEvent) throws RemoteException {
|
||||
Parcel obtain = Parcel.obtain();
|
||||
Parcel obtain2 = Parcel.obtain();
|
||||
try {
|
||||
obtain.writeInterfaceToken("android.support.v4.media.session.IMediaSession");
|
||||
if (keyEvent != null) {
|
||||
obtain.writeInt(1);
|
||||
keyEvent.writeToParcel(obtain, 0);
|
||||
} else {
|
||||
obtain.writeInt(0);
|
||||
}
|
||||
this.a.transact(2, obtain, obtain2, 0);
|
||||
obtain2.readException();
|
||||
return obtain2.readInt() != 0;
|
||||
} finally {
|
||||
obtain2.recycle();
|
||||
obtain.recycle();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.os.IInterface
|
||||
public IBinder asBinder() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
@Override // android.support.v4.media.session.IMediaSession
|
||||
public void a(IMediaControllerCallback iMediaControllerCallback) throws RemoteException {
|
||||
Parcel obtain = Parcel.obtain();
|
||||
Parcel obtain2 = Parcel.obtain();
|
||||
try {
|
||||
obtain.writeInterfaceToken("android.support.v4.media.session.IMediaSession");
|
||||
obtain.writeStrongBinder(iMediaControllerCallback != null ? iMediaControllerCallback.asBinder() : null);
|
||||
this.a.transact(3, obtain, obtain2, 0);
|
||||
obtain2.readException();
|
||||
} finally {
|
||||
obtain2.recycle();
|
||||
obtain.recycle();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,442 @@
|
||||
package android.support.v4.media.session;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.IBinder;
|
||||
import android.os.Message;
|
||||
import android.os.RemoteException;
|
||||
import android.os.ResultReceiver;
|
||||
import android.support.v4.media.MediaMetadataCompat;
|
||||
import android.support.v4.media.session.IMediaControllerCallback;
|
||||
import android.support.v4.media.session.IMediaSession;
|
||||
import android.support.v4.media.session.MediaControllerCompatApi21;
|
||||
import android.support.v4.media.session.MediaSessionCompat;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
import androidx.core.app.BundleCompat;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class MediaControllerCompat {
|
||||
private final MediaControllerImpl a;
|
||||
|
||||
public static abstract class Callback implements IBinder.DeathRecipient {
|
||||
MessageHandler a;
|
||||
IMediaControllerCallback b;
|
||||
|
||||
private class MessageHandler extends Handler {
|
||||
}
|
||||
|
||||
public Callback() {
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
MediaControllerCompatApi21.a(new StubApi21(this));
|
||||
} else {
|
||||
this.b = new StubCompat(this);
|
||||
}
|
||||
}
|
||||
|
||||
public void a() {
|
||||
}
|
||||
|
||||
void a(int i, Object obj, Bundle bundle) {
|
||||
MessageHandler messageHandler = this.a;
|
||||
if (messageHandler != null) {
|
||||
Message obtainMessage = messageHandler.obtainMessage(i, obj);
|
||||
obtainMessage.setData(bundle);
|
||||
obtainMessage.sendToTarget();
|
||||
}
|
||||
}
|
||||
|
||||
public void a(Bundle bundle) {
|
||||
}
|
||||
|
||||
public void a(MediaMetadataCompat mediaMetadataCompat) {
|
||||
}
|
||||
|
||||
public void a(PlaybackInfo playbackInfo) {
|
||||
}
|
||||
|
||||
public void a(PlaybackStateCompat playbackStateCompat) {
|
||||
}
|
||||
|
||||
public void a(CharSequence charSequence) {
|
||||
}
|
||||
|
||||
public void a(String str, Bundle bundle) {
|
||||
}
|
||||
|
||||
public void a(List<MediaSessionCompat.QueueItem> list) {
|
||||
}
|
||||
|
||||
@Override // android.os.IBinder.DeathRecipient
|
||||
public void binderDied() {
|
||||
a(8, null, null);
|
||||
}
|
||||
|
||||
private static class StubApi21 implements MediaControllerCompatApi21.Callback {
|
||||
private final WeakReference<Callback> a;
|
||||
|
||||
StubApi21(Callback callback) {
|
||||
this.a = new WeakReference<>(callback);
|
||||
}
|
||||
|
||||
@Override // android.support.v4.media.session.MediaControllerCompatApi21.Callback
|
||||
public void a(String str, Bundle bundle) {
|
||||
Callback callback = this.a.get();
|
||||
if (callback != null) {
|
||||
if (callback.b == null || Build.VERSION.SDK_INT >= 23) {
|
||||
callback.a(str, bundle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.support.v4.media.session.MediaControllerCompatApi21.Callback
|
||||
public void b() {
|
||||
Callback callback = this.a.get();
|
||||
if (callback != null) {
|
||||
callback.a();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.support.v4.media.session.MediaControllerCompatApi21.Callback
|
||||
public void b(Object obj) {
|
||||
Callback callback = this.a.get();
|
||||
if (callback == null || callback.b != null) {
|
||||
return;
|
||||
}
|
||||
callback.a(PlaybackStateCompat.fromPlaybackState(obj));
|
||||
}
|
||||
|
||||
@Override // android.support.v4.media.session.MediaControllerCompatApi21.Callback
|
||||
public void a(Object obj) {
|
||||
Callback callback = this.a.get();
|
||||
if (callback != null) {
|
||||
callback.a(MediaMetadataCompat.fromMediaMetadata(obj));
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.support.v4.media.session.MediaControllerCompatApi21.Callback
|
||||
public void a(List<?> list) {
|
||||
Callback callback = this.a.get();
|
||||
if (callback != null) {
|
||||
callback.a(MediaSessionCompat.QueueItem.fromQueueItemList(list));
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.support.v4.media.session.MediaControllerCompatApi21.Callback
|
||||
public void a(CharSequence charSequence) {
|
||||
Callback callback = this.a.get();
|
||||
if (callback != null) {
|
||||
callback.a(charSequence);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.support.v4.media.session.MediaControllerCompatApi21.Callback
|
||||
public void a(Bundle bundle) {
|
||||
Callback callback = this.a.get();
|
||||
if (callback != null) {
|
||||
callback.a(bundle);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.support.v4.media.session.MediaControllerCompatApi21.Callback
|
||||
public void a(int i, int i2, int i3, int i4, int i5) {
|
||||
Callback callback = this.a.get();
|
||||
if (callback != null) {
|
||||
callback.a(new PlaybackInfo(i, i2, i3, i4, i5));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static class StubCompat extends IMediaControllerCallback.Stub {
|
||||
private final WeakReference<Callback> a;
|
||||
|
||||
StubCompat(Callback callback) {
|
||||
this.a = new WeakReference<>(callback);
|
||||
}
|
||||
|
||||
@Override // android.support.v4.media.session.IMediaControllerCallback
|
||||
public void a(PlaybackStateCompat playbackStateCompat) throws RemoteException {
|
||||
Callback callback = this.a.get();
|
||||
if (callback != null) {
|
||||
callback.a(2, playbackStateCompat, null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.support.v4.media.session.IMediaControllerCallback
|
||||
public void b() throws RemoteException {
|
||||
Callback callback = this.a.get();
|
||||
if (callback != null) {
|
||||
callback.a(8, null, null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.support.v4.media.session.IMediaControllerCallback
|
||||
public void c(String str, Bundle bundle) throws RemoteException {
|
||||
Callback callback = this.a.get();
|
||||
if (callback != null) {
|
||||
callback.a(1, str, bundle);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.support.v4.media.session.IMediaControllerCallback
|
||||
public void c(boolean z) throws RemoteException {
|
||||
}
|
||||
|
||||
@Override // android.support.v4.media.session.IMediaControllerCallback
|
||||
public void f() throws RemoteException {
|
||||
Callback callback = this.a.get();
|
||||
if (callback != null) {
|
||||
callback.a(13, null, null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.support.v4.media.session.IMediaControllerCallback
|
||||
public void g(int i) throws RemoteException {
|
||||
Callback callback = this.a.get();
|
||||
if (callback != null) {
|
||||
callback.a(9, Integer.valueOf(i), null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.support.v4.media.session.IMediaControllerCallback
|
||||
public void h(int i) throws RemoteException {
|
||||
Callback callback = this.a.get();
|
||||
if (callback != null) {
|
||||
callback.a(12, Integer.valueOf(i), null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.support.v4.media.session.IMediaControllerCallback
|
||||
public void a(MediaMetadataCompat mediaMetadataCompat) throws RemoteException {
|
||||
Callback callback = this.a.get();
|
||||
if (callback != null) {
|
||||
callback.a(3, mediaMetadataCompat, null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.support.v4.media.session.IMediaControllerCallback
|
||||
public void b(boolean z) throws RemoteException {
|
||||
Callback callback = this.a.get();
|
||||
if (callback != null) {
|
||||
callback.a(11, Boolean.valueOf(z), null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.support.v4.media.session.IMediaControllerCallback
|
||||
public void a(List<MediaSessionCompat.QueueItem> list) throws RemoteException {
|
||||
Callback callback = this.a.get();
|
||||
if (callback != null) {
|
||||
callback.a(5, list, null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.support.v4.media.session.IMediaControllerCallback
|
||||
public void a(CharSequence charSequence) throws RemoteException {
|
||||
Callback callback = this.a.get();
|
||||
if (callback != null) {
|
||||
callback.a(6, charSequence, null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.support.v4.media.session.IMediaControllerCallback
|
||||
public void a(Bundle bundle) throws RemoteException {
|
||||
Callback callback = this.a.get();
|
||||
if (callback != null) {
|
||||
callback.a(7, bundle, null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.support.v4.media.session.IMediaControllerCallback
|
||||
public void a(ParcelableVolumeInfo parcelableVolumeInfo) throws RemoteException {
|
||||
Callback callback = this.a.get();
|
||||
if (callback != null) {
|
||||
callback.a(4, parcelableVolumeInfo != null ? new PlaybackInfo(parcelableVolumeInfo.volumeType, parcelableVolumeInfo.audioStream, parcelableVolumeInfo.controlType, parcelableVolumeInfo.maxVolume, parcelableVolumeInfo.currentVolume) : null, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
interface MediaControllerImpl {
|
||||
boolean a(KeyEvent keyEvent);
|
||||
}
|
||||
|
||||
static class MediaControllerImplApi21 implements MediaControllerImpl {
|
||||
protected final Object a;
|
||||
final Object b = new Object();
|
||||
private final List<Callback> c = new ArrayList();
|
||||
private HashMap<Callback, ExtraCallback> d = new HashMap<>();
|
||||
final MediaSessionCompat.Token e;
|
||||
|
||||
private static class ExtraBinderRequestResultReceiver extends ResultReceiver {
|
||||
private WeakReference<MediaControllerImplApi21> mMediaControllerImpl;
|
||||
|
||||
ExtraBinderRequestResultReceiver(MediaControllerImplApi21 mediaControllerImplApi21) {
|
||||
super(null);
|
||||
this.mMediaControllerImpl = new WeakReference<>(mediaControllerImplApi21);
|
||||
}
|
||||
|
||||
@Override // android.os.ResultReceiver
|
||||
protected void onReceiveResult(int i, Bundle bundle) {
|
||||
MediaControllerImplApi21 mediaControllerImplApi21 = this.mMediaControllerImpl.get();
|
||||
if (mediaControllerImplApi21 == null || bundle == null) {
|
||||
return;
|
||||
}
|
||||
synchronized (mediaControllerImplApi21.b) {
|
||||
mediaControllerImplApi21.e.setExtraBinder(IMediaSession.Stub.a(BundleCompat.a(bundle, "android.support.v4.media.session.EXTRA_BINDER")));
|
||||
mediaControllerImplApi21.e.setSessionToken2Bundle(bundle.getBundle("android.support.v4.media.session.SESSION_TOKEN2_BUNDLE"));
|
||||
mediaControllerImplApi21.a();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static class ExtraCallback extends Callback.StubCompat {
|
||||
ExtraCallback(Callback callback) {
|
||||
super(callback);
|
||||
}
|
||||
|
||||
@Override // android.support.v4.media.session.MediaControllerCompat.Callback.StubCompat, android.support.v4.media.session.IMediaControllerCallback
|
||||
public void a(MediaMetadataCompat mediaMetadataCompat) throws RemoteException {
|
||||
throw new AssertionError();
|
||||
}
|
||||
|
||||
@Override // android.support.v4.media.session.MediaControllerCompat.Callback.StubCompat, android.support.v4.media.session.IMediaControllerCallback
|
||||
public void b() throws RemoteException {
|
||||
throw new AssertionError();
|
||||
}
|
||||
|
||||
@Override // android.support.v4.media.session.MediaControllerCompat.Callback.StubCompat, android.support.v4.media.session.IMediaControllerCallback
|
||||
public void a(List<MediaSessionCompat.QueueItem> list) throws RemoteException {
|
||||
throw new AssertionError();
|
||||
}
|
||||
|
||||
@Override // android.support.v4.media.session.MediaControllerCompat.Callback.StubCompat, android.support.v4.media.session.IMediaControllerCallback
|
||||
public void a(CharSequence charSequence) throws RemoteException {
|
||||
throw new AssertionError();
|
||||
}
|
||||
|
||||
@Override // android.support.v4.media.session.MediaControllerCompat.Callback.StubCompat, android.support.v4.media.session.IMediaControllerCallback
|
||||
public void a(Bundle bundle) throws RemoteException {
|
||||
throw new AssertionError();
|
||||
}
|
||||
|
||||
@Override // android.support.v4.media.session.MediaControllerCompat.Callback.StubCompat, android.support.v4.media.session.IMediaControllerCallback
|
||||
public void a(ParcelableVolumeInfo parcelableVolumeInfo) throws RemoteException {
|
||||
throw new AssertionError();
|
||||
}
|
||||
}
|
||||
|
||||
public MediaControllerImplApi21(Context context, MediaSessionCompat.Token token) throws RemoteException {
|
||||
this.e = token;
|
||||
this.a = MediaControllerCompatApi21.a(context, this.e.getToken());
|
||||
if (this.a == null) {
|
||||
throw new RemoteException();
|
||||
}
|
||||
if (this.e.getExtraBinder() == null) {
|
||||
b();
|
||||
}
|
||||
}
|
||||
|
||||
private void b() {
|
||||
a("android.support.v4.media.session.command.GET_EXTRA_BINDER", null, new ExtraBinderRequestResultReceiver(this));
|
||||
}
|
||||
|
||||
@Override // android.support.v4.media.session.MediaControllerCompat.MediaControllerImpl
|
||||
public boolean a(KeyEvent keyEvent) {
|
||||
return MediaControllerCompatApi21.a(this.a, keyEvent);
|
||||
}
|
||||
|
||||
public void a(String str, Bundle bundle, ResultReceiver resultReceiver) {
|
||||
MediaControllerCompatApi21.a(this.a, str, bundle, resultReceiver);
|
||||
}
|
||||
|
||||
void a() {
|
||||
if (this.e.getExtraBinder() == null) {
|
||||
return;
|
||||
}
|
||||
for (Callback callback : this.c) {
|
||||
ExtraCallback extraCallback = new ExtraCallback(callback);
|
||||
this.d.put(callback, extraCallback);
|
||||
callback.b = extraCallback;
|
||||
try {
|
||||
this.e.getExtraBinder().a(extraCallback);
|
||||
callback.a(13, null, null);
|
||||
} catch (RemoteException e) {
|
||||
Log.e("MediaControllerCompat", "Dead object in registerCallback.", e);
|
||||
}
|
||||
}
|
||||
this.c.clear();
|
||||
}
|
||||
}
|
||||
|
||||
static class MediaControllerImplApi23 extends MediaControllerImplApi21 {
|
||||
public MediaControllerImplApi23(Context context, MediaSessionCompat.Token token) throws RemoteException {
|
||||
super(context, token);
|
||||
}
|
||||
}
|
||||
|
||||
static class MediaControllerImplApi24 extends MediaControllerImplApi23 {
|
||||
public MediaControllerImplApi24(Context context, MediaSessionCompat.Token token) throws RemoteException {
|
||||
super(context, token);
|
||||
}
|
||||
}
|
||||
|
||||
static class MediaControllerImplBase implements MediaControllerImpl {
|
||||
private IMediaSession a;
|
||||
|
||||
public MediaControllerImplBase(MediaSessionCompat.Token token) {
|
||||
this.a = IMediaSession.Stub.a((IBinder) token.getToken());
|
||||
}
|
||||
|
||||
@Override // android.support.v4.media.session.MediaControllerCompat.MediaControllerImpl
|
||||
public boolean a(KeyEvent keyEvent) {
|
||||
if (keyEvent == null) {
|
||||
throw new IllegalArgumentException("event may not be null.");
|
||||
}
|
||||
try {
|
||||
this.a.a(keyEvent);
|
||||
return false;
|
||||
} catch (RemoteException e) {
|
||||
Log.e("MediaControllerCompat", "Dead object in dispatchMediaButtonEvent.", e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static final class PlaybackInfo {
|
||||
PlaybackInfo(int i, int i2, int i3, int i4, int i5) {
|
||||
}
|
||||
}
|
||||
|
||||
public MediaControllerCompat(Context context, MediaSessionCompat.Token token) throws RemoteException {
|
||||
new HashSet();
|
||||
if (token == null) {
|
||||
throw new IllegalArgumentException("sessionToken must not be null");
|
||||
}
|
||||
int i = Build.VERSION.SDK_INT;
|
||||
if (i >= 24) {
|
||||
this.a = new MediaControllerImplApi24(context, token);
|
||||
return;
|
||||
}
|
||||
if (i >= 23) {
|
||||
this.a = new MediaControllerImplApi23(context, token);
|
||||
} else if (i >= 21) {
|
||||
this.a = new MediaControllerImplApi21(context, token);
|
||||
} else {
|
||||
this.a = new MediaControllerImplBase(token);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean a(KeyEvent keyEvent) {
|
||||
if (keyEvent != null) {
|
||||
return this.a.a(keyEvent);
|
||||
}
|
||||
throw new IllegalArgumentException("KeyEvent may not be null");
|
||||
}
|
||||
}
|
@@ -0,0 +1,144 @@
|
||||
package android.support.v4.media.session;
|
||||
|
||||
import android.content.Context;
|
||||
import android.media.AudioAttributes;
|
||||
import android.media.MediaMetadata;
|
||||
import android.media.session.MediaController;
|
||||
import android.media.session.MediaSession;
|
||||
import android.media.session.PlaybackState;
|
||||
import android.os.Bundle;
|
||||
import android.os.ResultReceiver;
|
||||
import android.view.KeyEvent;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class MediaControllerCompatApi21 {
|
||||
|
||||
public interface Callback {
|
||||
void a(int i, int i2, int i3, int i4, int i5);
|
||||
|
||||
void a(Bundle bundle);
|
||||
|
||||
void a(CharSequence charSequence);
|
||||
|
||||
void a(Object obj);
|
||||
|
||||
void a(String str, Bundle bundle);
|
||||
|
||||
void a(List<?> list);
|
||||
|
||||
void b();
|
||||
|
||||
void b(Object obj);
|
||||
}
|
||||
|
||||
static class CallbackProxy<T extends Callback> extends MediaController.Callback {
|
||||
protected final T a;
|
||||
|
||||
public CallbackProxy(T t) {
|
||||
this.a = t;
|
||||
}
|
||||
|
||||
@Override // android.media.session.MediaController.Callback
|
||||
public void onAudioInfoChanged(MediaController.PlaybackInfo playbackInfo) {
|
||||
this.a.a(playbackInfo.getPlaybackType(), PlaybackInfo.b(playbackInfo), playbackInfo.getVolumeControl(), playbackInfo.getMaxVolume(), playbackInfo.getCurrentVolume());
|
||||
}
|
||||
|
||||
@Override // android.media.session.MediaController.Callback
|
||||
public void onExtrasChanged(Bundle bundle) {
|
||||
MediaSessionCompat.a(bundle);
|
||||
this.a.a(bundle);
|
||||
}
|
||||
|
||||
@Override // android.media.session.MediaController.Callback
|
||||
public void onMetadataChanged(MediaMetadata mediaMetadata) {
|
||||
this.a.a(mediaMetadata);
|
||||
}
|
||||
|
||||
@Override // android.media.session.MediaController.Callback
|
||||
public void onPlaybackStateChanged(PlaybackState playbackState) {
|
||||
this.a.b(playbackState);
|
||||
}
|
||||
|
||||
@Override // android.media.session.MediaController.Callback
|
||||
public void onQueueChanged(List<MediaSession.QueueItem> list) {
|
||||
this.a.a(list);
|
||||
}
|
||||
|
||||
@Override // android.media.session.MediaController.Callback
|
||||
public void onQueueTitleChanged(CharSequence charSequence) {
|
||||
this.a.a(charSequence);
|
||||
}
|
||||
|
||||
@Override // android.media.session.MediaController.Callback
|
||||
public void onSessionDestroyed() {
|
||||
this.a.b();
|
||||
}
|
||||
|
||||
@Override // android.media.session.MediaController.Callback
|
||||
public void onSessionEvent(String str, Bundle bundle) {
|
||||
MediaSessionCompat.a(bundle);
|
||||
this.a.a(str, bundle);
|
||||
}
|
||||
}
|
||||
|
||||
public static class PlaybackInfo {
|
||||
public static AudioAttributes a(Object obj) {
|
||||
return ((MediaController.PlaybackInfo) obj).getAudioAttributes();
|
||||
}
|
||||
|
||||
public static int b(Object obj) {
|
||||
return a(a(obj));
|
||||
}
|
||||
|
||||
private static int a(AudioAttributes audioAttributes) {
|
||||
if ((audioAttributes.getFlags() & 1) == 1) {
|
||||
return 7;
|
||||
}
|
||||
if ((audioAttributes.getFlags() & 4) == 4) {
|
||||
return 6;
|
||||
}
|
||||
switch (audioAttributes.getUsage()) {
|
||||
case 1:
|
||||
case 11:
|
||||
case 12:
|
||||
case 14:
|
||||
return 3;
|
||||
case 2:
|
||||
return 0;
|
||||
case 3:
|
||||
return 8;
|
||||
case 4:
|
||||
return 4;
|
||||
case 5:
|
||||
case 7:
|
||||
case 8:
|
||||
case 9:
|
||||
case 10:
|
||||
return 5;
|
||||
case 6:
|
||||
return 2;
|
||||
case 13:
|
||||
return 1;
|
||||
default:
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static Object a(Context context, Object obj) {
|
||||
return new MediaController(context, (MediaSession.Token) obj);
|
||||
}
|
||||
|
||||
public static Object a(Callback callback) {
|
||||
return new CallbackProxy(callback);
|
||||
}
|
||||
|
||||
public static boolean a(Object obj, KeyEvent keyEvent) {
|
||||
return ((MediaController) obj).dispatchMediaButtonEvent(keyEvent);
|
||||
}
|
||||
|
||||
public static void a(Object obj, String str, Bundle bundle, ResultReceiver resultReceiver) {
|
||||
((MediaController) obj).sendCommand(str, bundle, resultReceiver);
|
||||
}
|
||||
}
|
284
sources/android/support/v4/media/session/MediaSessionCompat.java
Normal file
284
sources/android/support/v4/media/session/MediaSessionCompat.java
Normal file
@@ -0,0 +1,284 @@
|
||||
package android.support.v4.media.session;
|
||||
|
||||
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 android.support.v4.media.session.IMediaSession;
|
||||
import android.support.v4.media.session.MediaSessionCompatApi21;
|
||||
import androidx.core.app.BundleCompat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class MediaSessionCompat {
|
||||
|
||||
public static final class QueueItem implements Parcelable {
|
||||
public static final Parcelable.Creator<QueueItem> CREATOR = new Parcelable.Creator<QueueItem>() { // from class: android.support.v4.media.session.MediaSessionCompat.QueueItem.1
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public QueueItem createFromParcel(Parcel parcel) {
|
||||
return new QueueItem(parcel);
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public QueueItem[] newArray(int i) {
|
||||
return new QueueItem[i];
|
||||
}
|
||||
};
|
||||
public static final int UNKNOWN_ID = -1;
|
||||
private final MediaDescriptionCompat mDescription;
|
||||
private final long mId;
|
||||
private Object mItem;
|
||||
|
||||
public QueueItem(MediaDescriptionCompat mediaDescriptionCompat, long j) {
|
||||
this(null, mediaDescriptionCompat, j);
|
||||
}
|
||||
|
||||
public static QueueItem fromQueueItem(Object obj) {
|
||||
if (obj == null || Build.VERSION.SDK_INT < 21) {
|
||||
return null;
|
||||
}
|
||||
return new QueueItem(obj, MediaDescriptionCompat.fromMediaDescription(MediaSessionCompatApi21.QueueItem.a(obj)), MediaSessionCompatApi21.QueueItem.b(obj));
|
||||
}
|
||||
|
||||
public static List<QueueItem> fromQueueItemList(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(fromQueueItem(it.next()));
|
||||
}
|
||||
return arrayList;
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public MediaDescriptionCompat getDescription() {
|
||||
return this.mDescription;
|
||||
}
|
||||
|
||||
public long getQueueId() {
|
||||
return this.mId;
|
||||
}
|
||||
|
||||
public Object getQueueItem() {
|
||||
if (this.mItem != null || Build.VERSION.SDK_INT < 21) {
|
||||
return this.mItem;
|
||||
}
|
||||
this.mItem = MediaSessionCompatApi21.QueueItem.a(this.mDescription.getMediaDescription(), this.mId);
|
||||
return this.mItem;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "MediaSession.QueueItem {Description=" + this.mDescription + ", Id=" + this.mId + " }";
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public void writeToParcel(Parcel parcel, int i) {
|
||||
this.mDescription.writeToParcel(parcel, i);
|
||||
parcel.writeLong(this.mId);
|
||||
}
|
||||
|
||||
private QueueItem(Object obj, MediaDescriptionCompat mediaDescriptionCompat, long j) {
|
||||
if (mediaDescriptionCompat == null) {
|
||||
throw new IllegalArgumentException("Description cannot be null.");
|
||||
}
|
||||
if (j == -1) {
|
||||
throw new IllegalArgumentException("Id cannot be QueueItem.UNKNOWN_ID");
|
||||
}
|
||||
this.mDescription = mediaDescriptionCompat;
|
||||
this.mId = j;
|
||||
this.mItem = obj;
|
||||
}
|
||||
|
||||
QueueItem(Parcel parcel) {
|
||||
this.mDescription = MediaDescriptionCompat.CREATOR.createFromParcel(parcel);
|
||||
this.mId = parcel.readLong();
|
||||
}
|
||||
}
|
||||
|
||||
public static final class Token implements Parcelable {
|
||||
public static final Parcelable.Creator<Token> CREATOR = new Parcelable.Creator<Token>() { // from class: android.support.v4.media.session.MediaSessionCompat.Token.1
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public Token createFromParcel(Parcel parcel) {
|
||||
return new Token(Build.VERSION.SDK_INT >= 21 ? parcel.readParcelable(null) : parcel.readStrongBinder());
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public Token[] newArray(int i) {
|
||||
return new Token[i];
|
||||
}
|
||||
};
|
||||
private IMediaSession mExtraBinder;
|
||||
private final Object mInner;
|
||||
private Bundle mSessionToken2Bundle;
|
||||
|
||||
Token(Object obj) {
|
||||
this(obj, null, null);
|
||||
}
|
||||
|
||||
public static Token fromBundle(Bundle bundle) {
|
||||
if (bundle == null) {
|
||||
return null;
|
||||
}
|
||||
IMediaSession a = IMediaSession.Stub.a(BundleCompat.a(bundle, "android.support.v4.media.session.EXTRA_BINDER"));
|
||||
Bundle bundle2 = bundle.getBundle("android.support.v4.media.session.SESSION_TOKEN2_BUNDLE");
|
||||
Token token = (Token) bundle.getParcelable("android.support.v4.media.session.TOKEN");
|
||||
if (token == null) {
|
||||
return null;
|
||||
}
|
||||
return new Token(token.mInner, a, bundle2);
|
||||
}
|
||||
|
||||
public static Token fromToken(Object obj) {
|
||||
return fromToken(obj, null);
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (!(obj instanceof Token)) {
|
||||
return false;
|
||||
}
|
||||
Token token = (Token) obj;
|
||||
Object obj2 = this.mInner;
|
||||
if (obj2 == null) {
|
||||
return token.mInner == null;
|
||||
}
|
||||
Object obj3 = token.mInner;
|
||||
if (obj3 == null) {
|
||||
return false;
|
||||
}
|
||||
return obj2.equals(obj3);
|
||||
}
|
||||
|
||||
public IMediaSession getExtraBinder() {
|
||||
return this.mExtraBinder;
|
||||
}
|
||||
|
||||
public Bundle getSessionToken2Bundle() {
|
||||
return this.mSessionToken2Bundle;
|
||||
}
|
||||
|
||||
public Object getToken() {
|
||||
return this.mInner;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
Object obj = this.mInner;
|
||||
if (obj == null) {
|
||||
return 0;
|
||||
}
|
||||
return obj.hashCode();
|
||||
}
|
||||
|
||||
public void setExtraBinder(IMediaSession iMediaSession) {
|
||||
this.mExtraBinder = iMediaSession;
|
||||
}
|
||||
|
||||
public void setSessionToken2Bundle(Bundle bundle) {
|
||||
this.mSessionToken2Bundle = bundle;
|
||||
}
|
||||
|
||||
public Bundle toBundle() {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putParcelable("android.support.v4.media.session.TOKEN", this);
|
||||
IMediaSession iMediaSession = this.mExtraBinder;
|
||||
if (iMediaSession != null) {
|
||||
BundleCompat.a(bundle, "android.support.v4.media.session.EXTRA_BINDER", iMediaSession.asBinder());
|
||||
}
|
||||
Bundle bundle2 = this.mSessionToken2Bundle;
|
||||
if (bundle2 != null) {
|
||||
bundle.putBundle("android.support.v4.media.session.SESSION_TOKEN2_BUNDLE", bundle2);
|
||||
}
|
||||
return bundle;
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public void writeToParcel(Parcel parcel, int i) {
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
parcel.writeParcelable((Parcelable) this.mInner, i);
|
||||
} else {
|
||||
parcel.writeStrongBinder((IBinder) this.mInner);
|
||||
}
|
||||
}
|
||||
|
||||
Token(Object obj, IMediaSession iMediaSession) {
|
||||
this(obj, iMediaSession, null);
|
||||
}
|
||||
|
||||
public static Token fromToken(Object obj, IMediaSession iMediaSession) {
|
||||
if (obj == null || Build.VERSION.SDK_INT < 21) {
|
||||
return null;
|
||||
}
|
||||
MediaSessionCompatApi21.a(obj);
|
||||
return new Token(obj, iMediaSession);
|
||||
}
|
||||
|
||||
Token(Object obj, IMediaSession iMediaSession, Bundle bundle) {
|
||||
this.mInner = obj;
|
||||
this.mExtraBinder = iMediaSession;
|
||||
this.mSessionToken2Bundle = bundle;
|
||||
}
|
||||
}
|
||||
|
||||
public static void a(Bundle bundle) {
|
||||
if (bundle != null) {
|
||||
bundle.setClassLoader(MediaSessionCompat.class.getClassLoader());
|
||||
}
|
||||
}
|
||||
|
||||
public static final class ResultReceiverWrapper implements Parcelable {
|
||||
public static final Parcelable.Creator<ResultReceiverWrapper> CREATOR = new Parcelable.Creator<ResultReceiverWrapper>() { // from class: android.support.v4.media.session.MediaSessionCompat.ResultReceiverWrapper.1
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public ResultReceiverWrapper createFromParcel(Parcel parcel) {
|
||||
return new ResultReceiverWrapper(parcel);
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public ResultReceiverWrapper[] newArray(int i) {
|
||||
return new ResultReceiverWrapper[i];
|
||||
}
|
||||
};
|
||||
ResultReceiver mResultReceiver;
|
||||
|
||||
public ResultReceiverWrapper(ResultReceiver resultReceiver) {
|
||||
this.mResultReceiver = resultReceiver;
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public void writeToParcel(Parcel parcel, int i) {
|
||||
this.mResultReceiver.writeToParcel(parcel, i);
|
||||
}
|
||||
|
||||
ResultReceiverWrapper(Parcel parcel) {
|
||||
this.mResultReceiver = (ResultReceiver) ResultReceiver.CREATOR.createFromParcel(parcel);
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,29 @@
|
||||
package android.support.v4.media.session;
|
||||
|
||||
import android.media.MediaDescription;
|
||||
import android.media.session.MediaSession;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class MediaSessionCompatApi21 {
|
||||
|
||||
static class QueueItem {
|
||||
public static Object a(Object obj, long j) {
|
||||
return new MediaSession.QueueItem((MediaDescription) obj, j);
|
||||
}
|
||||
|
||||
public static long b(Object obj) {
|
||||
return ((MediaSession.QueueItem) obj).getQueueId();
|
||||
}
|
||||
|
||||
public static Object a(Object obj) {
|
||||
return ((MediaSession.QueueItem) obj).getDescription();
|
||||
}
|
||||
}
|
||||
|
||||
public static Object a(Object obj) {
|
||||
if (obj instanceof MediaSession.Token) {
|
||||
return obj;
|
||||
}
|
||||
throw new IllegalArgumentException("token is not a valid MediaSession.Token object");
|
||||
}
|
||||
}
|
@@ -0,0 +1,56 @@
|
||||
package android.support.v4.media.session;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ParcelableVolumeInfo implements Parcelable {
|
||||
public static final Parcelable.Creator<ParcelableVolumeInfo> CREATOR = new Parcelable.Creator<ParcelableVolumeInfo>() { // from class: android.support.v4.media.session.ParcelableVolumeInfo.1
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public ParcelableVolumeInfo createFromParcel(Parcel parcel) {
|
||||
return new ParcelableVolumeInfo(parcel);
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public ParcelableVolumeInfo[] newArray(int i) {
|
||||
return new ParcelableVolumeInfo[i];
|
||||
}
|
||||
};
|
||||
public int audioStream;
|
||||
public int controlType;
|
||||
public int currentVolume;
|
||||
public int maxVolume;
|
||||
public int volumeType;
|
||||
|
||||
public ParcelableVolumeInfo(int i, int i2, int i3, int i4, int i5) {
|
||||
this.volumeType = i;
|
||||
this.audioStream = i2;
|
||||
this.controlType = i3;
|
||||
this.maxVolume = i4;
|
||||
this.currentVolume = i5;
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public void writeToParcel(Parcel parcel, int i) {
|
||||
parcel.writeInt(this.volumeType);
|
||||
parcel.writeInt(this.controlType);
|
||||
parcel.writeInt(this.maxVolume);
|
||||
parcel.writeInt(this.currentVolume);
|
||||
parcel.writeInt(this.audioStream);
|
||||
}
|
||||
|
||||
public ParcelableVolumeInfo(Parcel parcel) {
|
||||
this.volumeType = parcel.readInt();
|
||||
this.controlType = parcel.readInt();
|
||||
this.maxVolume = parcel.readInt();
|
||||
this.currentVolume = parcel.readInt();
|
||||
this.audioStream = parcel.readInt();
|
||||
}
|
||||
}
|
@@ -0,0 +1,353 @@
|
||||
package android.support.v4.media.session;
|
||||
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.os.SystemClock;
|
||||
import android.support.v4.media.session.PlaybackStateCompatApi21;
|
||||
import android.text.TextUtils;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class PlaybackStateCompat implements Parcelable {
|
||||
public static final long ACTION_FAST_FORWARD = 64;
|
||||
public static final long ACTION_PAUSE = 2;
|
||||
public static final long ACTION_PLAY = 4;
|
||||
public static final long ACTION_PLAY_FROM_MEDIA_ID = 1024;
|
||||
public static final long ACTION_PLAY_FROM_SEARCH = 2048;
|
||||
public static final long ACTION_PLAY_FROM_URI = 8192;
|
||||
public static final long ACTION_PLAY_PAUSE = 512;
|
||||
public static final long ACTION_PREPARE = 16384;
|
||||
public static final long ACTION_PREPARE_FROM_MEDIA_ID = 32768;
|
||||
public static final long ACTION_PREPARE_FROM_SEARCH = 65536;
|
||||
public static final long ACTION_PREPARE_FROM_URI = 131072;
|
||||
public static final long ACTION_REWIND = 8;
|
||||
public static final long ACTION_SEEK_TO = 256;
|
||||
public static final long ACTION_SET_CAPTIONING_ENABLED = 1048576;
|
||||
public static final long ACTION_SET_RATING = 128;
|
||||
public static final long ACTION_SET_REPEAT_MODE = 262144;
|
||||
public static final long ACTION_SET_SHUFFLE_MODE = 2097152;
|
||||
|
||||
@Deprecated
|
||||
public static final long ACTION_SET_SHUFFLE_MODE_ENABLED = 524288;
|
||||
public static final long ACTION_SKIP_TO_NEXT = 32;
|
||||
public static final long ACTION_SKIP_TO_PREVIOUS = 16;
|
||||
public static final long ACTION_SKIP_TO_QUEUE_ITEM = 4096;
|
||||
public static final long ACTION_STOP = 1;
|
||||
public static final Parcelable.Creator<PlaybackStateCompat> CREATOR = new Parcelable.Creator<PlaybackStateCompat>() { // from class: android.support.v4.media.session.PlaybackStateCompat.1
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public PlaybackStateCompat createFromParcel(Parcel parcel) {
|
||||
return new PlaybackStateCompat(parcel);
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public PlaybackStateCompat[] newArray(int i) {
|
||||
return new PlaybackStateCompat[i];
|
||||
}
|
||||
};
|
||||
public static final int ERROR_CODE_ACTION_ABORTED = 10;
|
||||
public static final int ERROR_CODE_APP_ERROR = 1;
|
||||
public static final int ERROR_CODE_AUTHENTICATION_EXPIRED = 3;
|
||||
public static final int ERROR_CODE_CONCURRENT_STREAM_LIMIT = 5;
|
||||
public static final int ERROR_CODE_CONTENT_ALREADY_PLAYING = 8;
|
||||
public static final int ERROR_CODE_END_OF_QUEUE = 11;
|
||||
public static final int ERROR_CODE_NOT_AVAILABLE_IN_REGION = 7;
|
||||
public static final int ERROR_CODE_NOT_SUPPORTED = 2;
|
||||
public static final int ERROR_CODE_PARENTAL_CONTROL_RESTRICTED = 6;
|
||||
public static final int ERROR_CODE_PREMIUM_ACCOUNT_REQUIRED = 4;
|
||||
public static final int ERROR_CODE_SKIP_LIMIT_REACHED = 9;
|
||||
public static final int ERROR_CODE_UNKNOWN_ERROR = 0;
|
||||
private static final int KEYCODE_MEDIA_PAUSE = 127;
|
||||
private static final int KEYCODE_MEDIA_PLAY = 126;
|
||||
public static final long PLAYBACK_POSITION_UNKNOWN = -1;
|
||||
public static final int REPEAT_MODE_ALL = 2;
|
||||
public static final int REPEAT_MODE_GROUP = 3;
|
||||
public static final int REPEAT_MODE_INVALID = -1;
|
||||
public static final int REPEAT_MODE_NONE = 0;
|
||||
public static final int REPEAT_MODE_ONE = 1;
|
||||
public static final int SHUFFLE_MODE_ALL = 1;
|
||||
public static final int SHUFFLE_MODE_GROUP = 2;
|
||||
public static final int SHUFFLE_MODE_INVALID = -1;
|
||||
public static final int SHUFFLE_MODE_NONE = 0;
|
||||
public static final int STATE_BUFFERING = 6;
|
||||
public static final int STATE_CONNECTING = 8;
|
||||
public static final int STATE_ERROR = 7;
|
||||
public static final int STATE_FAST_FORWARDING = 4;
|
||||
public static final int STATE_NONE = 0;
|
||||
public static final int STATE_PAUSED = 2;
|
||||
public static final int STATE_PLAYING = 3;
|
||||
public static final int STATE_REWINDING = 5;
|
||||
public static final int STATE_SKIPPING_TO_NEXT = 10;
|
||||
public static final int STATE_SKIPPING_TO_PREVIOUS = 9;
|
||||
public static final int STATE_SKIPPING_TO_QUEUE_ITEM = 11;
|
||||
public static final int STATE_STOPPED = 1;
|
||||
final long mActions;
|
||||
final long mActiveItemId;
|
||||
final long mBufferedPosition;
|
||||
List<CustomAction> mCustomActions;
|
||||
final int mErrorCode;
|
||||
final CharSequence mErrorMessage;
|
||||
final Bundle mExtras;
|
||||
final long mPosition;
|
||||
final float mSpeed;
|
||||
final int mState;
|
||||
private Object mStateObj;
|
||||
final long mUpdateTime;
|
||||
|
||||
PlaybackStateCompat(int i, long j, long j2, float f, long j3, int i2, CharSequence charSequence, long j4, List<CustomAction> list, long j5, Bundle bundle) {
|
||||
this.mState = i;
|
||||
this.mPosition = j;
|
||||
this.mBufferedPosition = j2;
|
||||
this.mSpeed = f;
|
||||
this.mActions = j3;
|
||||
this.mErrorCode = i2;
|
||||
this.mErrorMessage = charSequence;
|
||||
this.mUpdateTime = j4;
|
||||
this.mCustomActions = new ArrayList(list);
|
||||
this.mActiveItemId = j5;
|
||||
this.mExtras = bundle;
|
||||
}
|
||||
|
||||
public static PlaybackStateCompat fromPlaybackState(Object obj) {
|
||||
ArrayList arrayList;
|
||||
if (obj == null || Build.VERSION.SDK_INT < 21) {
|
||||
return null;
|
||||
}
|
||||
List<Object> d = PlaybackStateCompatApi21.d(obj);
|
||||
if (d != null) {
|
||||
ArrayList arrayList2 = new ArrayList(d.size());
|
||||
Iterator<Object> it = d.iterator();
|
||||
while (it.hasNext()) {
|
||||
arrayList2.add(CustomAction.fromCustomAction(it.next()));
|
||||
}
|
||||
arrayList = arrayList2;
|
||||
} else {
|
||||
arrayList = null;
|
||||
}
|
||||
PlaybackStateCompat playbackStateCompat = new PlaybackStateCompat(PlaybackStateCompatApi21.i(obj), PlaybackStateCompatApi21.h(obj), PlaybackStateCompatApi21.c(obj), PlaybackStateCompatApi21.g(obj), PlaybackStateCompatApi21.a(obj), 0, PlaybackStateCompatApi21.e(obj), PlaybackStateCompatApi21.f(obj), arrayList, PlaybackStateCompatApi21.b(obj), Build.VERSION.SDK_INT >= 22 ? PlaybackStateCompatApi22.a(obj) : null);
|
||||
playbackStateCompat.mStateObj = obj;
|
||||
return playbackStateCompat;
|
||||
}
|
||||
|
||||
public static int toKeyCode(long j) {
|
||||
if (j == 4) {
|
||||
return KEYCODE_MEDIA_PLAY;
|
||||
}
|
||||
if (j == 2) {
|
||||
return KEYCODE_MEDIA_PAUSE;
|
||||
}
|
||||
if (j == 32) {
|
||||
return 87;
|
||||
}
|
||||
if (j == 16) {
|
||||
return 88;
|
||||
}
|
||||
if (j == 1) {
|
||||
return 86;
|
||||
}
|
||||
if (j == 64) {
|
||||
return 90;
|
||||
}
|
||||
if (j == 8) {
|
||||
return 89;
|
||||
}
|
||||
return j == 512 ? 85 : 0;
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public long getActions() {
|
||||
return this.mActions;
|
||||
}
|
||||
|
||||
public long getActiveQueueItemId() {
|
||||
return this.mActiveItemId;
|
||||
}
|
||||
|
||||
public long getBufferedPosition() {
|
||||
return this.mBufferedPosition;
|
||||
}
|
||||
|
||||
public long getCurrentPosition(Long l) {
|
||||
return Math.max(0L, this.mPosition + ((long) (this.mSpeed * (l != null ? l.longValue() : SystemClock.elapsedRealtime() - this.mUpdateTime))));
|
||||
}
|
||||
|
||||
public List<CustomAction> getCustomActions() {
|
||||
return this.mCustomActions;
|
||||
}
|
||||
|
||||
public int getErrorCode() {
|
||||
return this.mErrorCode;
|
||||
}
|
||||
|
||||
public CharSequence getErrorMessage() {
|
||||
return this.mErrorMessage;
|
||||
}
|
||||
|
||||
public Bundle getExtras() {
|
||||
return this.mExtras;
|
||||
}
|
||||
|
||||
public long getLastPositionUpdateTime() {
|
||||
return this.mUpdateTime;
|
||||
}
|
||||
|
||||
public float getPlaybackSpeed() {
|
||||
return this.mSpeed;
|
||||
}
|
||||
|
||||
public Object getPlaybackState() {
|
||||
if (this.mStateObj == null && Build.VERSION.SDK_INT >= 21) {
|
||||
ArrayList arrayList = null;
|
||||
List<CustomAction> list = this.mCustomActions;
|
||||
if (list != null) {
|
||||
arrayList = new ArrayList(list.size());
|
||||
Iterator<CustomAction> it = this.mCustomActions.iterator();
|
||||
while (it.hasNext()) {
|
||||
arrayList.add(it.next().getCustomAction());
|
||||
}
|
||||
}
|
||||
ArrayList arrayList2 = arrayList;
|
||||
if (Build.VERSION.SDK_INT >= 22) {
|
||||
this.mStateObj = PlaybackStateCompatApi22.a(this.mState, this.mPosition, this.mBufferedPosition, this.mSpeed, this.mActions, this.mErrorMessage, this.mUpdateTime, arrayList2, this.mActiveItemId, this.mExtras);
|
||||
} else {
|
||||
this.mStateObj = PlaybackStateCompatApi21.a(this.mState, this.mPosition, this.mBufferedPosition, this.mSpeed, this.mActions, this.mErrorMessage, this.mUpdateTime, arrayList2, this.mActiveItemId);
|
||||
}
|
||||
}
|
||||
return this.mStateObj;
|
||||
}
|
||||
|
||||
public long getPosition() {
|
||||
return this.mPosition;
|
||||
}
|
||||
|
||||
public int getState() {
|
||||
return this.mState;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "PlaybackState {state=" + this.mState + ", position=" + this.mPosition + ", buffered position=" + this.mBufferedPosition + ", speed=" + this.mSpeed + ", updated=" + this.mUpdateTime + ", actions=" + this.mActions + ", error code=" + this.mErrorCode + ", error message=" + this.mErrorMessage + ", custom actions=" + this.mCustomActions + ", active item id=" + this.mActiveItemId + "}";
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public void writeToParcel(Parcel parcel, int i) {
|
||||
parcel.writeInt(this.mState);
|
||||
parcel.writeLong(this.mPosition);
|
||||
parcel.writeFloat(this.mSpeed);
|
||||
parcel.writeLong(this.mUpdateTime);
|
||||
parcel.writeLong(this.mBufferedPosition);
|
||||
parcel.writeLong(this.mActions);
|
||||
TextUtils.writeToParcel(this.mErrorMessage, parcel, i);
|
||||
parcel.writeTypedList(this.mCustomActions);
|
||||
parcel.writeLong(this.mActiveItemId);
|
||||
parcel.writeBundle(this.mExtras);
|
||||
parcel.writeInt(this.mErrorCode);
|
||||
}
|
||||
|
||||
public static final class CustomAction implements Parcelable {
|
||||
public static final Parcelable.Creator<CustomAction> CREATOR = new Parcelable.Creator<CustomAction>() { // from class: android.support.v4.media.session.PlaybackStateCompat.CustomAction.1
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public CustomAction createFromParcel(Parcel parcel) {
|
||||
return new CustomAction(parcel);
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public CustomAction[] newArray(int i) {
|
||||
return new CustomAction[i];
|
||||
}
|
||||
};
|
||||
private final String mAction;
|
||||
private Object mCustomActionObj;
|
||||
private final Bundle mExtras;
|
||||
private final int mIcon;
|
||||
private final CharSequence mName;
|
||||
|
||||
CustomAction(String str, CharSequence charSequence, int i, Bundle bundle) {
|
||||
this.mAction = str;
|
||||
this.mName = charSequence;
|
||||
this.mIcon = i;
|
||||
this.mExtras = bundle;
|
||||
}
|
||||
|
||||
public static CustomAction fromCustomAction(Object obj) {
|
||||
if (obj == null || Build.VERSION.SDK_INT < 21) {
|
||||
return null;
|
||||
}
|
||||
CustomAction customAction = new CustomAction(PlaybackStateCompatApi21.CustomAction.a(obj), PlaybackStateCompatApi21.CustomAction.d(obj), PlaybackStateCompatApi21.CustomAction.c(obj), PlaybackStateCompatApi21.CustomAction.b(obj));
|
||||
customAction.mCustomActionObj = obj;
|
||||
return customAction;
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public String getAction() {
|
||||
return this.mAction;
|
||||
}
|
||||
|
||||
public Object getCustomAction() {
|
||||
if (this.mCustomActionObj != null || Build.VERSION.SDK_INT < 21) {
|
||||
return this.mCustomActionObj;
|
||||
}
|
||||
this.mCustomActionObj = PlaybackStateCompatApi21.CustomAction.a(this.mAction, this.mName, this.mIcon, this.mExtras);
|
||||
return this.mCustomActionObj;
|
||||
}
|
||||
|
||||
public Bundle getExtras() {
|
||||
return this.mExtras;
|
||||
}
|
||||
|
||||
public int getIcon() {
|
||||
return this.mIcon;
|
||||
}
|
||||
|
||||
public CharSequence getName() {
|
||||
return this.mName;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "Action:mName='" + ((Object) this.mName) + ", mIcon=" + this.mIcon + ", mExtras=" + this.mExtras;
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public void writeToParcel(Parcel parcel, int i) {
|
||||
parcel.writeString(this.mAction);
|
||||
TextUtils.writeToParcel(this.mName, parcel, i);
|
||||
parcel.writeInt(this.mIcon);
|
||||
parcel.writeBundle(this.mExtras);
|
||||
}
|
||||
|
||||
CustomAction(Parcel parcel) {
|
||||
this.mAction = parcel.readString();
|
||||
this.mName = (CharSequence) TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(parcel);
|
||||
this.mIcon = parcel.readInt();
|
||||
this.mExtras = parcel.readBundle(MediaSessionCompat.class.getClassLoader());
|
||||
}
|
||||
}
|
||||
|
||||
PlaybackStateCompat(Parcel parcel) {
|
||||
this.mState = parcel.readInt();
|
||||
this.mPosition = parcel.readLong();
|
||||
this.mSpeed = parcel.readFloat();
|
||||
this.mUpdateTime = parcel.readLong();
|
||||
this.mBufferedPosition = parcel.readLong();
|
||||
this.mActions = parcel.readLong();
|
||||
this.mErrorMessage = (CharSequence) TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(parcel);
|
||||
this.mCustomActions = parcel.createTypedArrayList(CustomAction.CREATOR);
|
||||
this.mActiveItemId = parcel.readLong();
|
||||
this.mExtras = parcel.readBundle(MediaSessionCompat.class.getClassLoader());
|
||||
this.mErrorCode = parcel.readInt();
|
||||
}
|
||||
}
|
@@ -0,0 +1,84 @@
|
||||
package android.support.v4.media.session;
|
||||
|
||||
import android.media.session.PlaybackState;
|
||||
import android.os.Bundle;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class PlaybackStateCompatApi21 {
|
||||
|
||||
static final class CustomAction {
|
||||
public static String a(Object obj) {
|
||||
return ((PlaybackState.CustomAction) obj).getAction();
|
||||
}
|
||||
|
||||
public static Bundle b(Object obj) {
|
||||
return ((PlaybackState.CustomAction) obj).getExtras();
|
||||
}
|
||||
|
||||
public static int c(Object obj) {
|
||||
return ((PlaybackState.CustomAction) obj).getIcon();
|
||||
}
|
||||
|
||||
public static CharSequence d(Object obj) {
|
||||
return ((PlaybackState.CustomAction) obj).getName();
|
||||
}
|
||||
|
||||
public static Object a(String str, CharSequence charSequence, int i, Bundle bundle) {
|
||||
PlaybackState.CustomAction.Builder builder = new PlaybackState.CustomAction.Builder(str, charSequence, i);
|
||||
builder.setExtras(bundle);
|
||||
return builder.build();
|
||||
}
|
||||
}
|
||||
|
||||
public static long a(Object obj) {
|
||||
return ((PlaybackState) obj).getActions();
|
||||
}
|
||||
|
||||
public static long b(Object obj) {
|
||||
return ((PlaybackState) obj).getActiveQueueItemId();
|
||||
}
|
||||
|
||||
public static long c(Object obj) {
|
||||
return ((PlaybackState) obj).getBufferedPosition();
|
||||
}
|
||||
|
||||
public static List<Object> d(Object obj) {
|
||||
return ((PlaybackState) obj).getCustomActions();
|
||||
}
|
||||
|
||||
public static CharSequence e(Object obj) {
|
||||
return ((PlaybackState) obj).getErrorMessage();
|
||||
}
|
||||
|
||||
public static long f(Object obj) {
|
||||
return ((PlaybackState) obj).getLastPositionUpdateTime();
|
||||
}
|
||||
|
||||
public static float g(Object obj) {
|
||||
return ((PlaybackState) obj).getPlaybackSpeed();
|
||||
}
|
||||
|
||||
public static long h(Object obj) {
|
||||
return ((PlaybackState) obj).getPosition();
|
||||
}
|
||||
|
||||
public static int i(Object obj) {
|
||||
return ((PlaybackState) obj).getState();
|
||||
}
|
||||
|
||||
public static Object a(int i, long j, long j2, float f, long j3, CharSequence charSequence, long j4, List<Object> list, long j5) {
|
||||
PlaybackState.Builder builder = new PlaybackState.Builder();
|
||||
builder.setState(i, j, f, j4);
|
||||
builder.setBufferedPosition(j2);
|
||||
builder.setActions(j3);
|
||||
builder.setErrorMessage(charSequence);
|
||||
Iterator<Object> it = list.iterator();
|
||||
while (it.hasNext()) {
|
||||
builder.addCustomAction((PlaybackState.CustomAction) it.next());
|
||||
}
|
||||
builder.setActiveQueueItemId(j5);
|
||||
return builder.build();
|
||||
}
|
||||
}
|
@@ -0,0 +1,28 @@
|
||||
package android.support.v4.media.session;
|
||||
|
||||
import android.media.session.PlaybackState;
|
||||
import android.os.Bundle;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class PlaybackStateCompatApi22 {
|
||||
public static Bundle a(Object obj) {
|
||||
return ((PlaybackState) obj).getExtras();
|
||||
}
|
||||
|
||||
public static Object a(int i, long j, long j2, float f, long j3, CharSequence charSequence, long j4, List<Object> list, long j5, Bundle bundle) {
|
||||
PlaybackState.Builder builder = new PlaybackState.Builder();
|
||||
builder.setState(i, j, f, j4);
|
||||
builder.setBufferedPosition(j2);
|
||||
builder.setActions(j3);
|
||||
builder.setErrorMessage(charSequence);
|
||||
Iterator<Object> it = list.iterator();
|
||||
while (it.hasNext()) {
|
||||
builder.addCustomAction((PlaybackState.CustomAction) it.next());
|
||||
}
|
||||
builder.setActiveQueueItemId(j5);
|
||||
builder.setExtras(bundle);
|
||||
return builder.build();
|
||||
}
|
||||
}
|
79
sources/android/support/v4/os/IResultReceiver.java
Normal file
79
sources/android/support/v4/os/IResultReceiver.java
Normal file
@@ -0,0 +1,79 @@
|
||||
package android.support.v4.os;
|
||||
|
||||
import android.os.Binder;
|
||||
import android.os.Bundle;
|
||||
import android.os.IBinder;
|
||||
import android.os.IInterface;
|
||||
import android.os.Parcel;
|
||||
import android.os.RemoteException;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface IResultReceiver extends IInterface {
|
||||
|
||||
public static abstract class Stub extends Binder implements IResultReceiver {
|
||||
|
||||
private static class Proxy implements IResultReceiver {
|
||||
private IBinder a;
|
||||
|
||||
Proxy(IBinder iBinder) {
|
||||
this.a = iBinder;
|
||||
}
|
||||
|
||||
@Override // android.support.v4.os.IResultReceiver
|
||||
public void a(int i, Bundle bundle) throws RemoteException {
|
||||
Parcel obtain = Parcel.obtain();
|
||||
try {
|
||||
obtain.writeInterfaceToken("android.support.v4.os.IResultReceiver");
|
||||
obtain.writeInt(i);
|
||||
if (bundle != null) {
|
||||
obtain.writeInt(1);
|
||||
bundle.writeToParcel(obtain, 0);
|
||||
} else {
|
||||
obtain.writeInt(0);
|
||||
}
|
||||
this.a.transact(1, obtain, null, 1);
|
||||
} finally {
|
||||
obtain.recycle();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.os.IInterface
|
||||
public IBinder asBinder() {
|
||||
return this.a;
|
||||
}
|
||||
}
|
||||
|
||||
public Stub() {
|
||||
attachInterface(this, "android.support.v4.os.IResultReceiver");
|
||||
}
|
||||
|
||||
public static IResultReceiver a(IBinder iBinder) {
|
||||
if (iBinder == null) {
|
||||
return null;
|
||||
}
|
||||
IInterface queryLocalInterface = iBinder.queryLocalInterface("android.support.v4.os.IResultReceiver");
|
||||
return (queryLocalInterface == null || !(queryLocalInterface instanceof IResultReceiver)) ? new Proxy(iBinder) : (IResultReceiver) queryLocalInterface;
|
||||
}
|
||||
|
||||
@Override // android.os.IInterface
|
||||
public IBinder asBinder() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.os.Binder
|
||||
public boolean onTransact(int i, Parcel parcel, Parcel parcel2, int i2) throws RemoteException {
|
||||
if (i == 1) {
|
||||
parcel.enforceInterface("android.support.v4.os.IResultReceiver");
|
||||
a(parcel.readInt(), parcel.readInt() != 0 ? (Bundle) Bundle.CREATOR.createFromParcel(parcel) : null);
|
||||
return true;
|
||||
}
|
||||
if (i != 1598968902) {
|
||||
return super.onTransact(i, parcel, parcel2, i2);
|
||||
}
|
||||
parcel2.writeString("android.support.v4.os.IResultReceiver");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
void a(int i, Bundle bundle) throws RemoteException;
|
||||
}
|
108
sources/android/support/v4/os/ResultReceiver.java
Normal file
108
sources/android/support/v4/os/ResultReceiver.java
Normal file
@@ -0,0 +1,108 @@
|
||||
package android.support.v4.os;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.os.RemoteException;
|
||||
import android.support.v4.os.IResultReceiver;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ResultReceiver implements Parcelable {
|
||||
public static final Parcelable.Creator<ResultReceiver> CREATOR = new Parcelable.Creator<ResultReceiver>() { // from class: android.support.v4.os.ResultReceiver.1
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public ResultReceiver createFromParcel(Parcel parcel) {
|
||||
return new ResultReceiver(parcel);
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public ResultReceiver[] newArray(int i) {
|
||||
return new ResultReceiver[i];
|
||||
}
|
||||
};
|
||||
final Handler mHandler;
|
||||
final boolean mLocal;
|
||||
IResultReceiver mReceiver;
|
||||
|
||||
class MyResultReceiver extends IResultReceiver.Stub {
|
||||
MyResultReceiver() {
|
||||
}
|
||||
|
||||
@Override // android.support.v4.os.IResultReceiver
|
||||
public void a(int i, Bundle bundle) {
|
||||
ResultReceiver resultReceiver = ResultReceiver.this;
|
||||
Handler handler = resultReceiver.mHandler;
|
||||
if (handler != null) {
|
||||
handler.post(resultReceiver.new MyRunnable(i, bundle));
|
||||
} else {
|
||||
resultReceiver.onReceiveResult(i, bundle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class MyRunnable implements Runnable {
|
||||
final int a;
|
||||
final Bundle b;
|
||||
|
||||
MyRunnable(int i, Bundle bundle) {
|
||||
this.a = i;
|
||||
this.b = bundle;
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
ResultReceiver.this.onReceiveResult(this.a, this.b);
|
||||
}
|
||||
}
|
||||
|
||||
public ResultReceiver(Handler handler) {
|
||||
this.mLocal = true;
|
||||
this.mHandler = handler;
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
protected void onReceiveResult(int i, Bundle bundle) {
|
||||
}
|
||||
|
||||
public void send(int i, Bundle bundle) {
|
||||
if (this.mLocal) {
|
||||
Handler handler = this.mHandler;
|
||||
if (handler != null) {
|
||||
handler.post(new MyRunnable(i, bundle));
|
||||
return;
|
||||
} else {
|
||||
onReceiveResult(i, bundle);
|
||||
return;
|
||||
}
|
||||
}
|
||||
IResultReceiver iResultReceiver = this.mReceiver;
|
||||
if (iResultReceiver != null) {
|
||||
try {
|
||||
iResultReceiver.a(i, bundle);
|
||||
} catch (RemoteException unused) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public void writeToParcel(Parcel parcel, int i) {
|
||||
synchronized (this) {
|
||||
if (this.mReceiver == null) {
|
||||
this.mReceiver = new MyResultReceiver();
|
||||
}
|
||||
parcel.writeStrongBinder(this.mReceiver.asBinder());
|
||||
}
|
||||
}
|
||||
|
||||
ResultReceiver(Parcel parcel) {
|
||||
this.mLocal = false;
|
||||
this.mHandler = null;
|
||||
this.mReceiver = IResultReceiver.Stub.a(parcel.readStrongBinder());
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user