mirror of
https://github.com/FuzzingLabs/fuzzforge_ai.git
synced 2026-06-13 12:17:46 +02:00
first commit
This commit is contained in:
+187
@@ -0,0 +1,187 @@
|
||||
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 {
|
||||
void cancel(String str, int i, String str2) throws RemoteException;
|
||||
|
||||
void cancelAll(String str) throws RemoteException;
|
||||
|
||||
void notify(String str, int i, String str2, Notification notification) throws RemoteException;
|
||||
|
||||
public static class Default implements INotificationSideChannel {
|
||||
@Override // android.support.v4.app.INotificationSideChannel
|
||||
public void notify(String packageName, int id, String tag, Notification notification) throws RemoteException {
|
||||
}
|
||||
|
||||
@Override // android.support.v4.app.INotificationSideChannel
|
||||
public void cancel(String packageName, int id, String tag) throws RemoteException {
|
||||
}
|
||||
|
||||
@Override // android.support.v4.app.INotificationSideChannel
|
||||
public void cancelAll(String packageName) throws RemoteException {
|
||||
}
|
||||
|
||||
@Override // android.os.IInterface
|
||||
public IBinder asBinder() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static abstract class Stub extends Binder implements INotificationSideChannel {
|
||||
private static final String DESCRIPTOR = "android.support.v4.app.INotificationSideChannel";
|
||||
static final int TRANSACTION_cancel = 2;
|
||||
static final int TRANSACTION_cancelAll = 3;
|
||||
static final int TRANSACTION_notify = 1;
|
||||
|
||||
public Stub() {
|
||||
attachInterface(this, DESCRIPTOR);
|
||||
}
|
||||
|
||||
public static INotificationSideChannel asInterface(IBinder obj) {
|
||||
if (obj == null) {
|
||||
return null;
|
||||
}
|
||||
IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
|
||||
if (iin != null && (iin instanceof INotificationSideChannel)) {
|
||||
return (INotificationSideChannel) iin;
|
||||
}
|
||||
return new Proxy(obj);
|
||||
}
|
||||
|
||||
@Override // android.os.IInterface
|
||||
public IBinder asBinder() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.os.Binder
|
||||
public boolean onTransact(int code, Parcel data, Parcel reply, int flags) throws RemoteException {
|
||||
Notification _arg3;
|
||||
switch (code) {
|
||||
case 1:
|
||||
data.enforceInterface(DESCRIPTOR);
|
||||
String _arg0 = data.readString();
|
||||
int _arg1 = data.readInt();
|
||||
String _arg2 = data.readString();
|
||||
if (data.readInt() != 0) {
|
||||
_arg3 = (Notification) Notification.CREATOR.createFromParcel(data);
|
||||
} else {
|
||||
_arg3 = null;
|
||||
}
|
||||
notify(_arg0, _arg1, _arg2, _arg3);
|
||||
return true;
|
||||
case 2:
|
||||
data.enforceInterface(DESCRIPTOR);
|
||||
String _arg02 = data.readString();
|
||||
int _arg12 = data.readInt();
|
||||
String _arg22 = data.readString();
|
||||
cancel(_arg02, _arg12, _arg22);
|
||||
return true;
|
||||
case 3:
|
||||
data.enforceInterface(DESCRIPTOR);
|
||||
String _arg03 = data.readString();
|
||||
cancelAll(_arg03);
|
||||
return true;
|
||||
case 1598968902:
|
||||
reply.writeString(DESCRIPTOR);
|
||||
return true;
|
||||
default:
|
||||
return super.onTransact(code, data, reply, flags);
|
||||
}
|
||||
}
|
||||
|
||||
private static class Proxy implements INotificationSideChannel {
|
||||
public static INotificationSideChannel sDefaultImpl;
|
||||
private IBinder mRemote;
|
||||
|
||||
Proxy(IBinder remote) {
|
||||
this.mRemote = remote;
|
||||
}
|
||||
|
||||
@Override // android.os.IInterface
|
||||
public IBinder asBinder() {
|
||||
return this.mRemote;
|
||||
}
|
||||
|
||||
public String getInterfaceDescriptor() {
|
||||
return Stub.DESCRIPTOR;
|
||||
}
|
||||
|
||||
@Override // android.support.v4.app.INotificationSideChannel
|
||||
public void notify(String packageName, int id, String tag, Notification notification) throws RemoteException {
|
||||
Parcel _data = Parcel.obtain();
|
||||
try {
|
||||
_data.writeInterfaceToken(Stub.DESCRIPTOR);
|
||||
_data.writeString(packageName);
|
||||
_data.writeInt(id);
|
||||
_data.writeString(tag);
|
||||
if (notification != null) {
|
||||
_data.writeInt(1);
|
||||
notification.writeToParcel(_data, 0);
|
||||
} else {
|
||||
_data.writeInt(0);
|
||||
}
|
||||
boolean _status = this.mRemote.transact(1, _data, null, 1);
|
||||
if (!_status && Stub.getDefaultImpl() != null) {
|
||||
Stub.getDefaultImpl().notify(packageName, id, tag, notification);
|
||||
}
|
||||
} finally {
|
||||
_data.recycle();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.support.v4.app.INotificationSideChannel
|
||||
public void cancel(String packageName, int id, String tag) throws RemoteException {
|
||||
Parcel _data = Parcel.obtain();
|
||||
try {
|
||||
_data.writeInterfaceToken(Stub.DESCRIPTOR);
|
||||
_data.writeString(packageName);
|
||||
_data.writeInt(id);
|
||||
_data.writeString(tag);
|
||||
boolean _status = this.mRemote.transact(2, _data, null, 1);
|
||||
if (!_status && Stub.getDefaultImpl() != null) {
|
||||
Stub.getDefaultImpl().cancel(packageName, id, tag);
|
||||
}
|
||||
} finally {
|
||||
_data.recycle();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.support.v4.app.INotificationSideChannel
|
||||
public void cancelAll(String packageName) throws RemoteException {
|
||||
Parcel _data = Parcel.obtain();
|
||||
try {
|
||||
_data.writeInterfaceToken(Stub.DESCRIPTOR);
|
||||
_data.writeString(packageName);
|
||||
boolean _status = this.mRemote.transact(3, _data, null, 1);
|
||||
if (!_status && Stub.getDefaultImpl() != null) {
|
||||
Stub.getDefaultImpl().cancelAll(packageName);
|
||||
}
|
||||
} finally {
|
||||
_data.recycle();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean setDefaultImpl(INotificationSideChannel impl) {
|
||||
if (Proxy.sDefaultImpl != null) {
|
||||
throw new IllegalStateException("setDefaultImpl() called twice");
|
||||
}
|
||||
if (impl != null) {
|
||||
Proxy.sDefaultImpl = impl;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static INotificationSideChannel getDefaultImpl() {
|
||||
return Proxy.sDefaultImpl;
|
||||
}
|
||||
}
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package android.support.v4.app;
|
||||
|
||||
import androidx.core.app.RemoteActionCompat;
|
||||
import androidx.versionedparcelable.VersionedParcel;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class RemoteActionCompatParcelizer extends androidx.core.app.RemoteActionCompatParcelizer {
|
||||
public static RemoteActionCompat read(VersionedParcel parcel) {
|
||||
return androidx.core.app.RemoteActionCompatParcelizer.read(parcel);
|
||||
}
|
||||
|
||||
public static void write(RemoteActionCompat obj, VersionedParcel parcel) {
|
||||
androidx.core.app.RemoteActionCompatParcelizer.write(obj, parcel);
|
||||
}
|
||||
}
|
||||
+15
@@ -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 parcel) {
|
||||
return androidx.core.graphics.drawable.IconCompatParcelizer.read(parcel);
|
||||
}
|
||||
|
||||
public static void write(IconCompat obj, VersionedParcel parcel) {
|
||||
androidx.core.graphics.drawable.IconCompatParcelizer.write(obj, parcel);
|
||||
}
|
||||
}
|
||||
+1643
File diff suppressed because it is too large
Load Diff
+131
@@ -0,0 +1,131 @@
|
||||
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 {
|
||||
static final String NULL_MEDIA_ITEM_ID = "android.support.v4.media.MediaBrowserCompat.NULL_MEDIA_ITEM";
|
||||
|
||||
interface ConnectionCallback {
|
||||
void onConnected();
|
||||
|
||||
void onConnectionFailed();
|
||||
|
||||
void onConnectionSuspended();
|
||||
}
|
||||
|
||||
interface SubscriptionCallback {
|
||||
void onChildrenLoaded(String str, List<?> list);
|
||||
|
||||
void onError(String str);
|
||||
}
|
||||
|
||||
public static Object createConnectionCallback(ConnectionCallback callback) {
|
||||
return new ConnectionCallbackProxy(callback);
|
||||
}
|
||||
|
||||
public static Object createBrowser(Context context, ComponentName serviceComponent, Object callback, Bundle rootHints) {
|
||||
return new MediaBrowser(context, serviceComponent, (MediaBrowser.ConnectionCallback) callback, rootHints);
|
||||
}
|
||||
|
||||
public static void connect(Object browserObj) {
|
||||
((MediaBrowser) browserObj).connect();
|
||||
}
|
||||
|
||||
public static void disconnect(Object browserObj) {
|
||||
((MediaBrowser) browserObj).disconnect();
|
||||
}
|
||||
|
||||
public static boolean isConnected(Object browserObj) {
|
||||
return ((MediaBrowser) browserObj).isConnected();
|
||||
}
|
||||
|
||||
public static ComponentName getServiceComponent(Object browserObj) {
|
||||
return ((MediaBrowser) browserObj).getServiceComponent();
|
||||
}
|
||||
|
||||
public static String getRoot(Object browserObj) {
|
||||
return ((MediaBrowser) browserObj).getRoot();
|
||||
}
|
||||
|
||||
public static Bundle getExtras(Object browserObj) {
|
||||
return ((MediaBrowser) browserObj).getExtras();
|
||||
}
|
||||
|
||||
public static Object getSessionToken(Object browserObj) {
|
||||
return ((MediaBrowser) browserObj).getSessionToken();
|
||||
}
|
||||
|
||||
public static Object createSubscriptionCallback(SubscriptionCallback callback) {
|
||||
return new SubscriptionCallbackProxy(callback);
|
||||
}
|
||||
|
||||
public static void subscribe(Object browserObj, String parentId, Object subscriptionCallbackObj) {
|
||||
((MediaBrowser) browserObj).subscribe(parentId, (MediaBrowser.SubscriptionCallback) subscriptionCallbackObj);
|
||||
}
|
||||
|
||||
public static void unsubscribe(Object browserObj, String parentId) {
|
||||
((MediaBrowser) browserObj).unsubscribe(parentId);
|
||||
}
|
||||
|
||||
static class ConnectionCallbackProxy<T extends ConnectionCallback> extends MediaBrowser.ConnectionCallback {
|
||||
protected final T mConnectionCallback;
|
||||
|
||||
public ConnectionCallbackProxy(T connectionCallback) {
|
||||
this.mConnectionCallback = connectionCallback;
|
||||
}
|
||||
|
||||
@Override // android.media.browse.MediaBrowser.ConnectionCallback
|
||||
public void onConnected() {
|
||||
this.mConnectionCallback.onConnected();
|
||||
}
|
||||
|
||||
@Override // android.media.browse.MediaBrowser.ConnectionCallback
|
||||
public void onConnectionSuspended() {
|
||||
this.mConnectionCallback.onConnectionSuspended();
|
||||
}
|
||||
|
||||
@Override // android.media.browse.MediaBrowser.ConnectionCallback
|
||||
public void onConnectionFailed() {
|
||||
this.mConnectionCallback.onConnectionFailed();
|
||||
}
|
||||
}
|
||||
|
||||
static class SubscriptionCallbackProxy<T extends SubscriptionCallback> extends MediaBrowser.SubscriptionCallback {
|
||||
protected final T mSubscriptionCallback;
|
||||
|
||||
public SubscriptionCallbackProxy(T callback) {
|
||||
this.mSubscriptionCallback = callback;
|
||||
}
|
||||
|
||||
@Override // android.media.browse.MediaBrowser.SubscriptionCallback
|
||||
public void onChildrenLoaded(String parentId, List<MediaBrowser.MediaItem> children) {
|
||||
this.mSubscriptionCallback.onChildrenLoaded(parentId, children);
|
||||
}
|
||||
|
||||
@Override // android.media.browse.MediaBrowser.SubscriptionCallback
|
||||
public void onError(String parentId) {
|
||||
this.mSubscriptionCallback.onError(parentId);
|
||||
}
|
||||
}
|
||||
|
||||
static class MediaItem {
|
||||
public static int getFlags(Object itemObj) {
|
||||
return ((MediaBrowser.MediaItem) itemObj).getFlags();
|
||||
}
|
||||
|
||||
public static Object getDescription(Object itemObj) {
|
||||
return ((MediaBrowser.MediaItem) itemObj).getDescription();
|
||||
}
|
||||
|
||||
private MediaItem() {
|
||||
}
|
||||
}
|
||||
|
||||
private MediaBrowserCompatApi21() {
|
||||
}
|
||||
}
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
package android.support.v4.media;
|
||||
|
||||
import android.media.browse.MediaBrowser;
|
||||
import android.os.Parcel;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class MediaBrowserCompatApi23 {
|
||||
|
||||
interface ItemCallback {
|
||||
void onError(String str);
|
||||
|
||||
void onItemLoaded(Parcel parcel);
|
||||
}
|
||||
|
||||
public static Object createItemCallback(ItemCallback callback) {
|
||||
return new ItemCallbackProxy(callback);
|
||||
}
|
||||
|
||||
public static void getItem(Object browserObj, String mediaId, Object itemCallbackObj) {
|
||||
((MediaBrowser) browserObj).getItem(mediaId, (MediaBrowser.ItemCallback) itemCallbackObj);
|
||||
}
|
||||
|
||||
static class ItemCallbackProxy<T extends ItemCallback> extends MediaBrowser.ItemCallback {
|
||||
protected final T mItemCallback;
|
||||
|
||||
public ItemCallbackProxy(T callback) {
|
||||
this.mItemCallback = callback;
|
||||
}
|
||||
|
||||
@Override // android.media.browse.MediaBrowser.ItemCallback
|
||||
public void onItemLoaded(MediaBrowser.MediaItem item) {
|
||||
if (item == null) {
|
||||
this.mItemCallback.onItemLoaded(null);
|
||||
return;
|
||||
}
|
||||
Parcel parcel = Parcel.obtain();
|
||||
item.writeToParcel(parcel, 0);
|
||||
this.mItemCallback.onItemLoaded(parcel);
|
||||
}
|
||||
|
||||
@Override // android.media.browse.MediaBrowser.ItemCallback
|
||||
public void onError(String itemId) {
|
||||
this.mItemCallback.onError(itemId);
|
||||
}
|
||||
}
|
||||
|
||||
private MediaBrowserCompatApi23() {
|
||||
}
|
||||
}
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
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 onChildrenLoaded(String str, List<?> list, Bundle bundle);
|
||||
|
||||
void onError(String str, Bundle bundle);
|
||||
}
|
||||
|
||||
static Object createSubscriptionCallback(SubscriptionCallback callback) {
|
||||
return new SubscriptionCallbackProxy(callback);
|
||||
}
|
||||
|
||||
public static void subscribe(Object browserObj, String parentId, Bundle options, Object subscriptionCallbackObj) {
|
||||
((MediaBrowser) browserObj).subscribe(parentId, options, (MediaBrowser.SubscriptionCallback) subscriptionCallbackObj);
|
||||
}
|
||||
|
||||
public static void unsubscribe(Object browserObj, String parentId, Object subscriptionCallbackObj) {
|
||||
((MediaBrowser) browserObj).unsubscribe(parentId, (MediaBrowser.SubscriptionCallback) subscriptionCallbackObj);
|
||||
}
|
||||
|
||||
static class SubscriptionCallbackProxy<T extends SubscriptionCallback> extends MediaBrowserCompatApi21.SubscriptionCallbackProxy<T> {
|
||||
SubscriptionCallbackProxy(T callback) {
|
||||
super(callback);
|
||||
}
|
||||
|
||||
@Override // android.media.browse.MediaBrowser.SubscriptionCallback
|
||||
public void onChildrenLoaded(String parentId, List<MediaBrowser.MediaItem> children, Bundle options) {
|
||||
MediaSessionCompat.ensureClassLoader(options);
|
||||
((SubscriptionCallback) this.mSubscriptionCallback).onChildrenLoaded(parentId, children, options);
|
||||
}
|
||||
|
||||
@Override // android.media.browse.MediaBrowser.SubscriptionCallback
|
||||
public void onError(String parentId, Bundle options) {
|
||||
MediaSessionCompat.ensureClassLoader(options);
|
||||
((SubscriptionCallback) this.mSubscriptionCallback).onError(parentId, options);
|
||||
}
|
||||
}
|
||||
|
||||
private MediaBrowserCompatApi26() {
|
||||
}
|
||||
}
|
||||
+254
@@ -0,0 +1,254 @@
|
||||
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.support.v4.media.session.MediaSessionCompat;
|
||||
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 in) {
|
||||
if (Build.VERSION.SDK_INT < 21) {
|
||||
return new MediaDescriptionCompat(in);
|
||||
}
|
||||
return MediaDescriptionCompat.fromMediaDescription(MediaDescriptionCompatApi21.fromParcel(in));
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public MediaDescriptionCompat[] newArray(int size) {
|
||||
return new MediaDescriptionCompat[size];
|
||||
}
|
||||
};
|
||||
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;
|
||||
|
||||
MediaDescriptionCompat(String mediaId, CharSequence title, CharSequence subtitle, CharSequence description, Bitmap icon, Uri iconUri, Bundle extras, Uri mediaUri) {
|
||||
this.mMediaId = mediaId;
|
||||
this.mTitle = title;
|
||||
this.mSubtitle = subtitle;
|
||||
this.mDescription = description;
|
||||
this.mIcon = icon;
|
||||
this.mIconUri = iconUri;
|
||||
this.mExtras = extras;
|
||||
this.mMediaUri = mediaUri;
|
||||
}
|
||||
|
||||
MediaDescriptionCompat(Parcel in) {
|
||||
this.mMediaId = in.readString();
|
||||
this.mTitle = (CharSequence) TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in);
|
||||
this.mSubtitle = (CharSequence) TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in);
|
||||
this.mDescription = (CharSequence) TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in);
|
||||
ClassLoader loader = getClass().getClassLoader();
|
||||
this.mIcon = (Bitmap) in.readParcelable(loader);
|
||||
this.mIconUri = (Uri) in.readParcelable(loader);
|
||||
this.mExtras = in.readBundle(loader);
|
||||
this.mMediaUri = (Uri) in.readParcelable(loader);
|
||||
}
|
||||
|
||||
public String getMediaId() {
|
||||
return this.mMediaId;
|
||||
}
|
||||
|
||||
public CharSequence getTitle() {
|
||||
return this.mTitle;
|
||||
}
|
||||
|
||||
public CharSequence getSubtitle() {
|
||||
return this.mSubtitle;
|
||||
}
|
||||
|
||||
public CharSequence getDescription() {
|
||||
return this.mDescription;
|
||||
}
|
||||
|
||||
public Bitmap getIconBitmap() {
|
||||
return this.mIcon;
|
||||
}
|
||||
|
||||
public Uri getIconUri() {
|
||||
return this.mIconUri;
|
||||
}
|
||||
|
||||
public Bundle getExtras() {
|
||||
return this.mExtras;
|
||||
}
|
||||
|
||||
public Uri getMediaUri() {
|
||||
return this.mMediaUri;
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
if (Build.VERSION.SDK_INT < 21) {
|
||||
dest.writeString(this.mMediaId);
|
||||
TextUtils.writeToParcel(this.mTitle, dest, flags);
|
||||
TextUtils.writeToParcel(this.mSubtitle, dest, flags);
|
||||
TextUtils.writeToParcel(this.mDescription, dest, flags);
|
||||
dest.writeParcelable(this.mIcon, flags);
|
||||
dest.writeParcelable(this.mIconUri, flags);
|
||||
dest.writeBundle(this.mExtras);
|
||||
dest.writeParcelable(this.mMediaUri, flags);
|
||||
return;
|
||||
}
|
||||
MediaDescriptionCompatApi21.writeToParcel(getMediaDescription(), dest, flags);
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return ((Object) this.mTitle) + ", " + ((Object) this.mSubtitle) + ", " + ((Object) this.mDescription);
|
||||
}
|
||||
|
||||
public Object getMediaDescription() {
|
||||
if (this.mDescriptionObj != null || Build.VERSION.SDK_INT < 21) {
|
||||
return this.mDescriptionObj;
|
||||
}
|
||||
Object bob = MediaDescriptionCompatApi21.Builder.newInstance();
|
||||
MediaDescriptionCompatApi21.Builder.setMediaId(bob, this.mMediaId);
|
||||
MediaDescriptionCompatApi21.Builder.setTitle(bob, this.mTitle);
|
||||
MediaDescriptionCompatApi21.Builder.setSubtitle(bob, this.mSubtitle);
|
||||
MediaDescriptionCompatApi21.Builder.setDescription(bob, this.mDescription);
|
||||
MediaDescriptionCompatApi21.Builder.setIconBitmap(bob, this.mIcon);
|
||||
MediaDescriptionCompatApi21.Builder.setIconUri(bob, this.mIconUri);
|
||||
Bundle extras = this.mExtras;
|
||||
if (Build.VERSION.SDK_INT < 23 && this.mMediaUri != null) {
|
||||
if (extras == null) {
|
||||
extras = new Bundle();
|
||||
extras.putBoolean(DESCRIPTION_KEY_NULL_BUNDLE_FLAG, true);
|
||||
}
|
||||
extras.putParcelable(DESCRIPTION_KEY_MEDIA_URI, this.mMediaUri);
|
||||
}
|
||||
MediaDescriptionCompatApi21.Builder.setExtras(bob, extras);
|
||||
if (Build.VERSION.SDK_INT >= 23) {
|
||||
MediaDescriptionCompatApi23.Builder.setMediaUri(bob, this.mMediaUri);
|
||||
}
|
||||
Object build = MediaDescriptionCompatApi21.Builder.build(bob);
|
||||
this.mDescriptionObj = build;
|
||||
return build;
|
||||
}
|
||||
|
||||
public static MediaDescriptionCompat fromMediaDescription(Object descriptionObj) {
|
||||
if (descriptionObj != null && Build.VERSION.SDK_INT >= 21) {
|
||||
Builder bob = new Builder();
|
||||
bob.setMediaId(MediaDescriptionCompatApi21.getMediaId(descriptionObj));
|
||||
bob.setTitle(MediaDescriptionCompatApi21.getTitle(descriptionObj));
|
||||
bob.setSubtitle(MediaDescriptionCompatApi21.getSubtitle(descriptionObj));
|
||||
bob.setDescription(MediaDescriptionCompatApi21.getDescription(descriptionObj));
|
||||
bob.setIconBitmap(MediaDescriptionCompatApi21.getIconBitmap(descriptionObj));
|
||||
bob.setIconUri(MediaDescriptionCompatApi21.getIconUri(descriptionObj));
|
||||
Bundle extras = MediaDescriptionCompatApi21.getExtras(descriptionObj);
|
||||
Uri mediaUri = null;
|
||||
if (extras != null) {
|
||||
MediaSessionCompat.ensureClassLoader(extras);
|
||||
mediaUri = (Uri) extras.getParcelable(DESCRIPTION_KEY_MEDIA_URI);
|
||||
}
|
||||
if (mediaUri != null) {
|
||||
if (extras.containsKey(DESCRIPTION_KEY_NULL_BUNDLE_FLAG) && extras.size() == 2) {
|
||||
extras = null;
|
||||
} else {
|
||||
extras.remove(DESCRIPTION_KEY_MEDIA_URI);
|
||||
extras.remove(DESCRIPTION_KEY_NULL_BUNDLE_FLAG);
|
||||
}
|
||||
}
|
||||
bob.setExtras(extras);
|
||||
if (mediaUri != null) {
|
||||
bob.setMediaUri(mediaUri);
|
||||
} else if (Build.VERSION.SDK_INT >= 23) {
|
||||
bob.setMediaUri(MediaDescriptionCompatApi23.getMediaUri(descriptionObj));
|
||||
}
|
||||
MediaDescriptionCompat descriptionCompat = bob.build();
|
||||
descriptionCompat.mDescriptionObj = descriptionObj;
|
||||
return descriptionCompat;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static final class Builder {
|
||||
private CharSequence mDescription;
|
||||
private Bundle mExtras;
|
||||
private Bitmap mIcon;
|
||||
private Uri mIconUri;
|
||||
private String mMediaId;
|
||||
private Uri mMediaUri;
|
||||
private CharSequence mSubtitle;
|
||||
private CharSequence mTitle;
|
||||
|
||||
public Builder setMediaId(String mediaId) {
|
||||
this.mMediaId = mediaId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setTitle(CharSequence title) {
|
||||
this.mTitle = title;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setSubtitle(CharSequence subtitle) {
|
||||
this.mSubtitle = subtitle;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setDescription(CharSequence description) {
|
||||
this.mDescription = description;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setIconBitmap(Bitmap icon) {
|
||||
this.mIcon = icon;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setIconUri(Uri iconUri) {
|
||||
this.mIconUri = iconUri;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setExtras(Bundle extras) {
|
||||
this.mExtras = extras;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setMediaUri(Uri mediaUri) {
|
||||
this.mMediaUri = mediaUri;
|
||||
return this;
|
||||
}
|
||||
|
||||
public MediaDescriptionCompat build() {
|
||||
return new MediaDescriptionCompat(this.mMediaId, this.mTitle, this.mSubtitle, this.mDescription, this.mIcon, this.mIconUri, this.mExtras, this.mMediaUri);
|
||||
}
|
||||
}
|
||||
}
|
||||
+90
@@ -0,0 +1,90 @@
|
||||
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 {
|
||||
public static String getMediaId(Object descriptionObj) {
|
||||
return ((MediaDescription) descriptionObj).getMediaId();
|
||||
}
|
||||
|
||||
public static CharSequence getTitle(Object descriptionObj) {
|
||||
return ((MediaDescription) descriptionObj).getTitle();
|
||||
}
|
||||
|
||||
public static CharSequence getSubtitle(Object descriptionObj) {
|
||||
return ((MediaDescription) descriptionObj).getSubtitle();
|
||||
}
|
||||
|
||||
public static CharSequence getDescription(Object descriptionObj) {
|
||||
return ((MediaDescription) descriptionObj).getDescription();
|
||||
}
|
||||
|
||||
public static Bitmap getIconBitmap(Object descriptionObj) {
|
||||
return ((MediaDescription) descriptionObj).getIconBitmap();
|
||||
}
|
||||
|
||||
public static Uri getIconUri(Object descriptionObj) {
|
||||
return ((MediaDescription) descriptionObj).getIconUri();
|
||||
}
|
||||
|
||||
public static Bundle getExtras(Object descriptionObj) {
|
||||
return ((MediaDescription) descriptionObj).getExtras();
|
||||
}
|
||||
|
||||
public static void writeToParcel(Object descriptionObj, Parcel dest, int flags) {
|
||||
((MediaDescription) descriptionObj).writeToParcel(dest, flags);
|
||||
}
|
||||
|
||||
public static Object fromParcel(Parcel in) {
|
||||
return MediaDescription.CREATOR.createFromParcel(in);
|
||||
}
|
||||
|
||||
static class Builder {
|
||||
public static Object newInstance() {
|
||||
return new MediaDescription.Builder();
|
||||
}
|
||||
|
||||
public static void setMediaId(Object builderObj, String mediaId) {
|
||||
((MediaDescription.Builder) builderObj).setMediaId(mediaId);
|
||||
}
|
||||
|
||||
public static void setTitle(Object builderObj, CharSequence title) {
|
||||
((MediaDescription.Builder) builderObj).setTitle(title);
|
||||
}
|
||||
|
||||
public static void setSubtitle(Object builderObj, CharSequence subtitle) {
|
||||
((MediaDescription.Builder) builderObj).setSubtitle(subtitle);
|
||||
}
|
||||
|
||||
public static void setDescription(Object builderObj, CharSequence description) {
|
||||
((MediaDescription.Builder) builderObj).setDescription(description);
|
||||
}
|
||||
|
||||
public static void setIconBitmap(Object builderObj, Bitmap iconBitmap) {
|
||||
((MediaDescription.Builder) builderObj).setIconBitmap(iconBitmap);
|
||||
}
|
||||
|
||||
public static void setIconUri(Object builderObj, Uri iconUri) {
|
||||
((MediaDescription.Builder) builderObj).setIconUri(iconUri);
|
||||
}
|
||||
|
||||
public static void setExtras(Object builderObj, Bundle extras) {
|
||||
((MediaDescription.Builder) builderObj).setExtras(extras);
|
||||
}
|
||||
|
||||
public static Object build(Object builderObj) {
|
||||
return ((MediaDescription.Builder) builderObj).build();
|
||||
}
|
||||
|
||||
private Builder() {
|
||||
}
|
||||
}
|
||||
|
||||
private MediaDescriptionCompatApi21() {
|
||||
}
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package android.support.v4.media;
|
||||
|
||||
import android.media.MediaDescription;
|
||||
import android.net.Uri;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class MediaDescriptionCompatApi23 {
|
||||
public static Uri getMediaUri(Object descriptionObj) {
|
||||
return ((MediaDescription) descriptionObj).getMediaUri();
|
||||
}
|
||||
|
||||
static class Builder {
|
||||
public static void setMediaUri(Object builderObj, Uri mediaUri) {
|
||||
((MediaDescription.Builder) builderObj).setMediaUri(mediaUri);
|
||||
}
|
||||
|
||||
private Builder() {
|
||||
}
|
||||
}
|
||||
|
||||
private MediaDescriptionCompatApi23() {
|
||||
}
|
||||
}
|
||||
+404
@@ -0,0 +1,404 @@
|
||||
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.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
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;
|
||||
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;
|
||||
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface BitmapKey {
|
||||
}
|
||||
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface LongKey {
|
||||
}
|
||||
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface RatingKey {
|
||||
}
|
||||
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface TextKey {
|
||||
}
|
||||
|
||||
static {
|
||||
ArrayMap<String, Integer> arrayMap = new ArrayMap<>();
|
||||
METADATA_KEYS_TYPE = arrayMap;
|
||||
arrayMap.put(METADATA_KEY_TITLE, 1);
|
||||
arrayMap.put(METADATA_KEY_ARTIST, 1);
|
||||
arrayMap.put(METADATA_KEY_DURATION, 0);
|
||||
arrayMap.put(METADATA_KEY_ALBUM, 1);
|
||||
arrayMap.put(METADATA_KEY_AUTHOR, 1);
|
||||
arrayMap.put(METADATA_KEY_WRITER, 1);
|
||||
arrayMap.put(METADATA_KEY_COMPOSER, 1);
|
||||
arrayMap.put(METADATA_KEY_COMPILATION, 1);
|
||||
arrayMap.put(METADATA_KEY_DATE, 1);
|
||||
arrayMap.put(METADATA_KEY_YEAR, 0);
|
||||
arrayMap.put(METADATA_KEY_GENRE, 1);
|
||||
arrayMap.put(METADATA_KEY_TRACK_NUMBER, 0);
|
||||
arrayMap.put(METADATA_KEY_NUM_TRACKS, 0);
|
||||
arrayMap.put(METADATA_KEY_DISC_NUMBER, 0);
|
||||
arrayMap.put(METADATA_KEY_ALBUM_ARTIST, 1);
|
||||
arrayMap.put(METADATA_KEY_ART, 2);
|
||||
arrayMap.put(METADATA_KEY_ART_URI, 1);
|
||||
arrayMap.put(METADATA_KEY_ALBUM_ART, 2);
|
||||
arrayMap.put(METADATA_KEY_ALBUM_ART_URI, 1);
|
||||
arrayMap.put(METADATA_KEY_USER_RATING, 3);
|
||||
arrayMap.put(METADATA_KEY_RATING, 3);
|
||||
arrayMap.put(METADATA_KEY_DISPLAY_TITLE, 1);
|
||||
arrayMap.put(METADATA_KEY_DISPLAY_SUBTITLE, 1);
|
||||
arrayMap.put(METADATA_KEY_DISPLAY_DESCRIPTION, 1);
|
||||
arrayMap.put(METADATA_KEY_DISPLAY_ICON, 2);
|
||||
arrayMap.put(METADATA_KEY_DISPLAY_ICON_URI, 1);
|
||||
arrayMap.put(METADATA_KEY_MEDIA_ID, 1);
|
||||
arrayMap.put(METADATA_KEY_BT_FOLDER_TYPE, 0);
|
||||
arrayMap.put(METADATA_KEY_MEDIA_URI, 1);
|
||||
arrayMap.put(METADATA_KEY_ADVERTISEMENT, 0);
|
||||
arrayMap.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 in) {
|
||||
return new MediaMetadataCompat(in);
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public MediaMetadataCompat[] newArray(int size) {
|
||||
return new MediaMetadataCompat[size];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
MediaMetadataCompat(Bundle bundle) {
|
||||
Bundle bundle2 = new Bundle(bundle);
|
||||
this.mBundle = bundle2;
|
||||
MediaSessionCompat.ensureClassLoader(bundle2);
|
||||
}
|
||||
|
||||
MediaMetadataCompat(Parcel in) {
|
||||
this.mBundle = in.readBundle(MediaSessionCompat.class.getClassLoader());
|
||||
}
|
||||
|
||||
public boolean containsKey(String key) {
|
||||
return this.mBundle.containsKey(key);
|
||||
}
|
||||
|
||||
public CharSequence getText(String key) {
|
||||
return this.mBundle.getCharSequence(key);
|
||||
}
|
||||
|
||||
public String getString(String key) {
|
||||
CharSequence text = this.mBundle.getCharSequence(key);
|
||||
if (text != null) {
|
||||
return text.toString();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public long getLong(String key) {
|
||||
return this.mBundle.getLong(key, 0L);
|
||||
}
|
||||
|
||||
public RatingCompat getRating(String key) {
|
||||
RatingCompat rating = null;
|
||||
try {
|
||||
if (Build.VERSION.SDK_INT >= 19) {
|
||||
rating = RatingCompat.fromRating(this.mBundle.getParcelable(key));
|
||||
} else {
|
||||
rating = (RatingCompat) this.mBundle.getParcelable(key);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.w(TAG, "Failed to retrieve a key as Rating.", e);
|
||||
}
|
||||
return rating;
|
||||
}
|
||||
|
||||
public Bitmap getBitmap(String key) {
|
||||
try {
|
||||
Bitmap bmp = (Bitmap) this.mBundle.getParcelable(key);
|
||||
return bmp;
|
||||
} catch (Exception e) {
|
||||
Log.w(TAG, "Failed to retrieve a key as Bitmap.", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public MediaDescriptionCompat getDescription() {
|
||||
MediaDescriptionCompat mediaDescriptionCompat = this.mDescription;
|
||||
if (mediaDescriptionCompat != null) {
|
||||
return mediaDescriptionCompat;
|
||||
}
|
||||
String mediaId = getString(METADATA_KEY_MEDIA_ID);
|
||||
CharSequence[] text = new CharSequence[3];
|
||||
Bitmap icon = null;
|
||||
Uri iconUri = null;
|
||||
CharSequence displayText = getText(METADATA_KEY_DISPLAY_TITLE);
|
||||
if (!TextUtils.isEmpty(displayText)) {
|
||||
text[0] = displayText;
|
||||
text[1] = getText(METADATA_KEY_DISPLAY_SUBTITLE);
|
||||
text[2] = getText(METADATA_KEY_DISPLAY_DESCRIPTION);
|
||||
} else {
|
||||
int textIndex = 0;
|
||||
int keyIndex = 0;
|
||||
while (textIndex < text.length) {
|
||||
String[] strArr = PREFERRED_DESCRIPTION_ORDER;
|
||||
if (keyIndex >= strArr.length) {
|
||||
break;
|
||||
}
|
||||
int keyIndex2 = keyIndex + 1;
|
||||
CharSequence next = getText(strArr[keyIndex]);
|
||||
if (!TextUtils.isEmpty(next)) {
|
||||
text[textIndex] = next;
|
||||
textIndex++;
|
||||
}
|
||||
keyIndex = keyIndex2;
|
||||
}
|
||||
}
|
||||
int i = 0;
|
||||
while (true) {
|
||||
String[] strArr2 = PREFERRED_BITMAP_ORDER;
|
||||
if (i >= strArr2.length) {
|
||||
break;
|
||||
}
|
||||
Bitmap next2 = getBitmap(strArr2[i]);
|
||||
if (next2 == null) {
|
||||
i++;
|
||||
} else {
|
||||
icon = next2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
int i2 = 0;
|
||||
while (true) {
|
||||
String[] strArr3 = PREFERRED_URI_ORDER;
|
||||
if (i2 >= strArr3.length) {
|
||||
break;
|
||||
}
|
||||
String next3 = getString(strArr3[i2]);
|
||||
if (TextUtils.isEmpty(next3)) {
|
||||
i2++;
|
||||
} else {
|
||||
iconUri = Uri.parse(next3);
|
||||
break;
|
||||
}
|
||||
}
|
||||
Uri mediaUri = null;
|
||||
String mediaUriStr = getString(METADATA_KEY_MEDIA_URI);
|
||||
if (!TextUtils.isEmpty(mediaUriStr)) {
|
||||
mediaUri = Uri.parse(mediaUriStr);
|
||||
}
|
||||
MediaDescriptionCompat.Builder bob = new MediaDescriptionCompat.Builder();
|
||||
bob.setMediaId(mediaId);
|
||||
bob.setTitle(text[0]);
|
||||
bob.setSubtitle(text[1]);
|
||||
bob.setDescription(text[2]);
|
||||
bob.setIconBitmap(icon);
|
||||
bob.setIconUri(iconUri);
|
||||
bob.setMediaUri(mediaUri);
|
||||
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()) {
|
||||
bob.setExtras(bundle);
|
||||
}
|
||||
MediaDescriptionCompat build = bob.build();
|
||||
this.mDescription = build;
|
||||
return build;
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeBundle(this.mBundle);
|
||||
}
|
||||
|
||||
public int size() {
|
||||
return this.mBundle.size();
|
||||
}
|
||||
|
||||
public Set<String> keySet() {
|
||||
return this.mBundle.keySet();
|
||||
}
|
||||
|
||||
public Bundle getBundle() {
|
||||
return new Bundle(this.mBundle);
|
||||
}
|
||||
|
||||
public static MediaMetadataCompat fromMediaMetadata(Object metadataObj) {
|
||||
if (metadataObj != null && Build.VERSION.SDK_INT >= 21) {
|
||||
Parcel p = Parcel.obtain();
|
||||
MediaMetadataCompatApi21.writeToParcel(metadataObj, p, 0);
|
||||
p.setDataPosition(0);
|
||||
MediaMetadataCompat metadata = CREATOR.createFromParcel(p);
|
||||
p.recycle();
|
||||
metadata.mMetadataObj = metadataObj;
|
||||
return metadata;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public Object getMediaMetadata() {
|
||||
if (this.mMetadataObj == null && Build.VERSION.SDK_INT >= 21) {
|
||||
Parcel p = Parcel.obtain();
|
||||
writeToParcel(p, 0);
|
||||
p.setDataPosition(0);
|
||||
this.mMetadataObj = MediaMetadataCompatApi21.createFromParcel(p);
|
||||
p.recycle();
|
||||
}
|
||||
return this.mMetadataObj;
|
||||
}
|
||||
|
||||
public static final class Builder {
|
||||
private final Bundle mBundle;
|
||||
|
||||
public Builder() {
|
||||
this.mBundle = new Bundle();
|
||||
}
|
||||
|
||||
public Builder(MediaMetadataCompat source) {
|
||||
Bundle bundle = new Bundle(source.mBundle);
|
||||
this.mBundle = bundle;
|
||||
MediaSessionCompat.ensureClassLoader(bundle);
|
||||
}
|
||||
|
||||
public Builder(MediaMetadataCompat source, int maxBitmapSize) {
|
||||
this(source);
|
||||
for (String key : this.mBundle.keySet()) {
|
||||
Object value = this.mBundle.get(key);
|
||||
if (value instanceof Bitmap) {
|
||||
Bitmap bmp = (Bitmap) value;
|
||||
if (bmp.getHeight() > maxBitmapSize || bmp.getWidth() > maxBitmapSize) {
|
||||
putBitmap(key, scaleBitmap(bmp, maxBitmapSize));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Builder putText(String key, CharSequence value) {
|
||||
if (MediaMetadataCompat.METADATA_KEYS_TYPE.containsKey(key) && MediaMetadataCompat.METADATA_KEYS_TYPE.get(key).intValue() != 1) {
|
||||
throw new IllegalArgumentException("The " + key + " key cannot be used to put a CharSequence");
|
||||
}
|
||||
this.mBundle.putCharSequence(key, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder putString(String key, String value) {
|
||||
if (MediaMetadataCompat.METADATA_KEYS_TYPE.containsKey(key) && MediaMetadataCompat.METADATA_KEYS_TYPE.get(key).intValue() != 1) {
|
||||
throw new IllegalArgumentException("The " + key + " key cannot be used to put a String");
|
||||
}
|
||||
this.mBundle.putCharSequence(key, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder putLong(String key, long value) {
|
||||
if (MediaMetadataCompat.METADATA_KEYS_TYPE.containsKey(key) && MediaMetadataCompat.METADATA_KEYS_TYPE.get(key).intValue() != 0) {
|
||||
throw new IllegalArgumentException("The " + key + " key cannot be used to put a long");
|
||||
}
|
||||
this.mBundle.putLong(key, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder putRating(String key, RatingCompat value) {
|
||||
if (MediaMetadataCompat.METADATA_KEYS_TYPE.containsKey(key) && MediaMetadataCompat.METADATA_KEYS_TYPE.get(key).intValue() != 3) {
|
||||
throw new IllegalArgumentException("The " + key + " key cannot be used to put a Rating");
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 19) {
|
||||
this.mBundle.putParcelable(key, (Parcelable) value.getRating());
|
||||
} else {
|
||||
this.mBundle.putParcelable(key, value);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder putBitmap(String key, Bitmap value) {
|
||||
if (MediaMetadataCompat.METADATA_KEYS_TYPE.containsKey(key) && MediaMetadataCompat.METADATA_KEYS_TYPE.get(key).intValue() != 2) {
|
||||
throw new IllegalArgumentException("The " + key + " key cannot be used to put a Bitmap");
|
||||
}
|
||||
this.mBundle.putParcelable(key, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public MediaMetadataCompat build() {
|
||||
return new MediaMetadataCompat(this.mBundle);
|
||||
}
|
||||
|
||||
private Bitmap scaleBitmap(Bitmap bmp, int maxSize) {
|
||||
float maxSizeF = maxSize;
|
||||
float widthScale = maxSizeF / bmp.getWidth();
|
||||
float heightScale = maxSizeF / bmp.getHeight();
|
||||
float scale = Math.min(widthScale, heightScale);
|
||||
int height = (int) (bmp.getHeight() * scale);
|
||||
int width = (int) (bmp.getWidth() * scale);
|
||||
return Bitmap.createScaledBitmap(bmp, width, height, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
package android.support.v4.media;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.media.MediaMetadata;
|
||||
import android.media.Rating;
|
||||
import android.os.Parcel;
|
||||
import java.util.Set;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class MediaMetadataCompatApi21 {
|
||||
public static Set<String> keySet(Object metadataObj) {
|
||||
return ((MediaMetadata) metadataObj).keySet();
|
||||
}
|
||||
|
||||
public static Bitmap getBitmap(Object metadataObj, String key) {
|
||||
return ((MediaMetadata) metadataObj).getBitmap(key);
|
||||
}
|
||||
|
||||
public static long getLong(Object metadataObj, String key) {
|
||||
return ((MediaMetadata) metadataObj).getLong(key);
|
||||
}
|
||||
|
||||
public static Object getRating(Object metadataObj, String key) {
|
||||
return ((MediaMetadata) metadataObj).getRating(key);
|
||||
}
|
||||
|
||||
public static CharSequence getText(Object metadataObj, String key) {
|
||||
return ((MediaMetadata) metadataObj).getText(key);
|
||||
}
|
||||
|
||||
public static void writeToParcel(Object metadataObj, Parcel dest, int flags) {
|
||||
((MediaMetadata) metadataObj).writeToParcel(dest, flags);
|
||||
}
|
||||
|
||||
public static Object createFromParcel(Parcel in) {
|
||||
return MediaMetadata.CREATOR.createFromParcel(in);
|
||||
}
|
||||
|
||||
public static class Builder {
|
||||
public static Object newInstance() {
|
||||
return new MediaMetadata.Builder();
|
||||
}
|
||||
|
||||
public static void putBitmap(Object builderObj, String key, Bitmap value) {
|
||||
((MediaMetadata.Builder) builderObj).putBitmap(key, value);
|
||||
}
|
||||
|
||||
public static void putLong(Object builderObj, String key, long value) {
|
||||
((MediaMetadata.Builder) builderObj).putLong(key, value);
|
||||
}
|
||||
|
||||
public static void putRating(Object builderObj, String key, Object ratingObj) {
|
||||
((MediaMetadata.Builder) builderObj).putRating(key, (Rating) ratingObj);
|
||||
}
|
||||
|
||||
public static void putText(Object builderObj, String key, CharSequence value) {
|
||||
((MediaMetadata.Builder) builderObj).putText(key, value);
|
||||
}
|
||||
|
||||
public static void putString(Object builderObj, String key, String value) {
|
||||
((MediaMetadata.Builder) builderObj).putString(key, value);
|
||||
}
|
||||
|
||||
public static Object build(Object builderObj) {
|
||||
return ((MediaMetadata.Builder) builderObj).build();
|
||||
}
|
||||
|
||||
private Builder() {
|
||||
}
|
||||
}
|
||||
|
||||
private MediaMetadataCompatApi21() {
|
||||
}
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
package android.support.v4.media;
|
||||
|
||||
import android.media.browse.MediaBrowser;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class ParceledListSliceAdapterApi21 {
|
||||
private static Constructor sConstructor;
|
||||
|
||||
static {
|
||||
try {
|
||||
Class theClass = Class.forName("android.content.pm.ParceledListSlice");
|
||||
sConstructor = theClass.getConstructor(List.class);
|
||||
} catch (ClassNotFoundException | NoSuchMethodException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
static Object newInstance(List<MediaBrowser.MediaItem> itemList) {
|
||||
try {
|
||||
Object result = sConstructor.newInstance(itemList);
|
||||
return result;
|
||||
} catch (IllegalAccessException | InstantiationException | InvocationTargetException e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private ParceledListSliceAdapterApi21() {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,223 @@
|
||||
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;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
/* 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 p) {
|
||||
return new RatingCompat(p.readInt(), p.readFloat());
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public RatingCompat[] newArray(int size) {
|
||||
return new RatingCompat[size];
|
||||
}
|
||||
};
|
||||
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;
|
||||
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface StarStyle {
|
||||
}
|
||||
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface Style {
|
||||
}
|
||||
|
||||
RatingCompat(int ratingStyle, float rating) {
|
||||
this.mRatingStyle = ratingStyle;
|
||||
this.mRatingValue = rating;
|
||||
}
|
||||
|
||||
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 int describeContents() {
|
||||
return this.mRatingStyle;
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeInt(this.mRatingStyle);
|
||||
dest.writeFloat(this.mRatingValue);
|
||||
}
|
||||
|
||||
public static RatingCompat newUnratedRating(int ratingStyle) {
|
||||
switch (ratingStyle) {
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
return new RatingCompat(ratingStyle, RATING_NOT_RATED);
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static RatingCompat newHeartRating(boolean hasHeart) {
|
||||
return new RatingCompat(1, hasHeart ? 1.0f : 0.0f);
|
||||
}
|
||||
|
||||
public static RatingCompat newThumbRating(boolean thumbIsUp) {
|
||||
return new RatingCompat(2, thumbIsUp ? 1.0f : 0.0f);
|
||||
}
|
||||
|
||||
public static RatingCompat newStarRating(int starRatingStyle, float starRating) {
|
||||
float maxRating;
|
||||
switch (starRatingStyle) {
|
||||
case 3:
|
||||
maxRating = 3.0f;
|
||||
break;
|
||||
case 4:
|
||||
maxRating = 4.0f;
|
||||
break;
|
||||
case 5:
|
||||
maxRating = 5.0f;
|
||||
break;
|
||||
default:
|
||||
Log.e(TAG, "Invalid rating style (" + starRatingStyle + ") for a star rating");
|
||||
return null;
|
||||
}
|
||||
if (starRating < 0.0f || starRating > maxRating) {
|
||||
Log.e(TAG, "Trying to set out of range star-based rating");
|
||||
return null;
|
||||
}
|
||||
return new RatingCompat(starRatingStyle, starRating);
|
||||
}
|
||||
|
||||
public static RatingCompat newPercentageRating(float percent) {
|
||||
if (percent < 0.0f || percent > 100.0f) {
|
||||
Log.e(TAG, "Invalid percentage-based rating value");
|
||||
return null;
|
||||
}
|
||||
return new RatingCompat(6, percent);
|
||||
}
|
||||
|
||||
public boolean isRated() {
|
||||
return this.mRatingValue >= 0.0f;
|
||||
}
|
||||
|
||||
public int getRatingStyle() {
|
||||
return this.mRatingStyle;
|
||||
}
|
||||
|
||||
public boolean hasHeart() {
|
||||
return this.mRatingStyle == 1 && this.mRatingValue == 1.0f;
|
||||
}
|
||||
|
||||
public boolean isThumbUp() {
|
||||
return this.mRatingStyle == 2 && this.mRatingValue == 1.0f;
|
||||
}
|
||||
|
||||
public float getStarRating() {
|
||||
switch (this.mRatingStyle) {
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
if (isRated()) {
|
||||
return this.mRatingValue;
|
||||
}
|
||||
return RATING_NOT_RATED;
|
||||
default:
|
||||
return RATING_NOT_RATED;
|
||||
}
|
||||
}
|
||||
|
||||
public float getPercentRating() {
|
||||
if (this.mRatingStyle != 6 || !isRated()) {
|
||||
return RATING_NOT_RATED;
|
||||
}
|
||||
return this.mRatingValue;
|
||||
}
|
||||
|
||||
public static RatingCompat fromRating(Object ratingObj) {
|
||||
RatingCompat rating;
|
||||
if (ratingObj == null || Build.VERSION.SDK_INT < 19) {
|
||||
return null;
|
||||
}
|
||||
int ratingStyle = ((Rating) ratingObj).getRatingStyle();
|
||||
if (((Rating) ratingObj).isRated()) {
|
||||
switch (ratingStyle) {
|
||||
case 1:
|
||||
rating = newHeartRating(((Rating) ratingObj).hasHeart());
|
||||
break;
|
||||
case 2:
|
||||
rating = newThumbRating(((Rating) ratingObj).isThumbUp());
|
||||
break;
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
rating = newStarRating(ratingStyle, ((Rating) ratingObj).getStarRating());
|
||||
break;
|
||||
case 6:
|
||||
rating = newPercentageRating(((Rating) ratingObj).getPercentRating());
|
||||
break;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
rating = newUnratedRating(ratingStyle);
|
||||
}
|
||||
rating.mRatingObj = ratingObj;
|
||||
return rating;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
+383
@@ -0,0 +1,383 @@
|
||||
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 {
|
||||
void onCaptioningEnabledChanged(boolean z) throws RemoteException;
|
||||
|
||||
void onEvent(String str, Bundle bundle) throws RemoteException;
|
||||
|
||||
void onExtrasChanged(Bundle bundle) throws RemoteException;
|
||||
|
||||
void onMetadataChanged(MediaMetadataCompat mediaMetadataCompat) throws RemoteException;
|
||||
|
||||
void onPlaybackStateChanged(PlaybackStateCompat playbackStateCompat) throws RemoteException;
|
||||
|
||||
void onQueueChanged(List<MediaSessionCompat.QueueItem> list) throws RemoteException;
|
||||
|
||||
void onQueueTitleChanged(CharSequence charSequence) throws RemoteException;
|
||||
|
||||
void onRepeatModeChanged(int i) throws RemoteException;
|
||||
|
||||
void onSessionDestroyed() throws RemoteException;
|
||||
|
||||
void onSessionReady() throws RemoteException;
|
||||
|
||||
void onShuffleModeChanged(int i) throws RemoteException;
|
||||
|
||||
void onShuffleModeChangedRemoved(boolean z) throws RemoteException;
|
||||
|
||||
void onVolumeInfoChanged(ParcelableVolumeInfo parcelableVolumeInfo) throws RemoteException;
|
||||
|
||||
public static abstract class Stub extends Binder implements IMediaControllerCallback {
|
||||
private static final String DESCRIPTOR = "android.support.v4.media.session.IMediaControllerCallback";
|
||||
static final int TRANSACTION_onCaptioningEnabledChanged = 11;
|
||||
static final int TRANSACTION_onEvent = 1;
|
||||
static final int TRANSACTION_onExtrasChanged = 7;
|
||||
static final int TRANSACTION_onMetadataChanged = 4;
|
||||
static final int TRANSACTION_onPlaybackStateChanged = 3;
|
||||
static final int TRANSACTION_onQueueChanged = 5;
|
||||
static final int TRANSACTION_onQueueTitleChanged = 6;
|
||||
static final int TRANSACTION_onRepeatModeChanged = 9;
|
||||
static final int TRANSACTION_onSessionDestroyed = 2;
|
||||
static final int TRANSACTION_onSessionReady = 13;
|
||||
static final int TRANSACTION_onShuffleModeChanged = 12;
|
||||
static final int TRANSACTION_onShuffleModeChangedRemoved = 10;
|
||||
static final int TRANSACTION_onVolumeInfoChanged = 8;
|
||||
|
||||
public Stub() {
|
||||
attachInterface(this, DESCRIPTOR);
|
||||
}
|
||||
|
||||
public static IMediaControllerCallback asInterface(IBinder obj) {
|
||||
if (obj == null) {
|
||||
return null;
|
||||
}
|
||||
IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
|
||||
if (iin != null && (iin instanceof IMediaControllerCallback)) {
|
||||
return (IMediaControllerCallback) iin;
|
||||
}
|
||||
return new Proxy(obj);
|
||||
}
|
||||
|
||||
@Override // android.os.IInterface
|
||||
public IBinder asBinder() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.os.Binder
|
||||
public boolean onTransact(int code, Parcel data, Parcel reply, int flags) throws RemoteException {
|
||||
Bundle _arg1;
|
||||
PlaybackStateCompat _arg0;
|
||||
MediaMetadataCompat _arg02;
|
||||
CharSequence _arg03;
|
||||
Bundle _arg04;
|
||||
ParcelableVolumeInfo _arg05;
|
||||
boolean _arg06;
|
||||
switch (code) {
|
||||
case 1:
|
||||
data.enforceInterface(DESCRIPTOR);
|
||||
String _arg07 = data.readString();
|
||||
if (data.readInt() != 0) {
|
||||
_arg1 = (Bundle) Bundle.CREATOR.createFromParcel(data);
|
||||
} else {
|
||||
_arg1 = null;
|
||||
}
|
||||
onEvent(_arg07, _arg1);
|
||||
return true;
|
||||
case 2:
|
||||
data.enforceInterface(DESCRIPTOR);
|
||||
onSessionDestroyed();
|
||||
return true;
|
||||
case 3:
|
||||
data.enforceInterface(DESCRIPTOR);
|
||||
if (data.readInt() != 0) {
|
||||
_arg0 = PlaybackStateCompat.CREATOR.createFromParcel(data);
|
||||
} else {
|
||||
_arg0 = null;
|
||||
}
|
||||
onPlaybackStateChanged(_arg0);
|
||||
return true;
|
||||
case 4:
|
||||
data.enforceInterface(DESCRIPTOR);
|
||||
if (data.readInt() != 0) {
|
||||
_arg02 = MediaMetadataCompat.CREATOR.createFromParcel(data);
|
||||
} else {
|
||||
_arg02 = null;
|
||||
}
|
||||
onMetadataChanged(_arg02);
|
||||
return true;
|
||||
case 5:
|
||||
data.enforceInterface(DESCRIPTOR);
|
||||
onQueueChanged(data.createTypedArrayList(MediaSessionCompat.QueueItem.CREATOR));
|
||||
return true;
|
||||
case 6:
|
||||
data.enforceInterface(DESCRIPTOR);
|
||||
if (data.readInt() != 0) {
|
||||
_arg03 = (CharSequence) TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data);
|
||||
} else {
|
||||
_arg03 = null;
|
||||
}
|
||||
onQueueTitleChanged(_arg03);
|
||||
return true;
|
||||
case 7:
|
||||
data.enforceInterface(DESCRIPTOR);
|
||||
if (data.readInt() != 0) {
|
||||
_arg04 = (Bundle) Bundle.CREATOR.createFromParcel(data);
|
||||
} else {
|
||||
_arg04 = null;
|
||||
}
|
||||
onExtrasChanged(_arg04);
|
||||
return true;
|
||||
case 8:
|
||||
data.enforceInterface(DESCRIPTOR);
|
||||
if (data.readInt() != 0) {
|
||||
_arg05 = ParcelableVolumeInfo.CREATOR.createFromParcel(data);
|
||||
} else {
|
||||
_arg05 = null;
|
||||
}
|
||||
onVolumeInfoChanged(_arg05);
|
||||
return true;
|
||||
case 9:
|
||||
data.enforceInterface(DESCRIPTOR);
|
||||
onRepeatModeChanged(data.readInt());
|
||||
return true;
|
||||
case 10:
|
||||
data.enforceInterface(DESCRIPTOR);
|
||||
_arg06 = data.readInt() != 0;
|
||||
onShuffleModeChangedRemoved(_arg06);
|
||||
return true;
|
||||
case 11:
|
||||
data.enforceInterface(DESCRIPTOR);
|
||||
_arg06 = data.readInt() != 0;
|
||||
onCaptioningEnabledChanged(_arg06);
|
||||
return true;
|
||||
case 12:
|
||||
data.enforceInterface(DESCRIPTOR);
|
||||
onShuffleModeChanged(data.readInt());
|
||||
return true;
|
||||
case 13:
|
||||
data.enforceInterface(DESCRIPTOR);
|
||||
onSessionReady();
|
||||
return true;
|
||||
case 1598968902:
|
||||
reply.writeString(DESCRIPTOR);
|
||||
return true;
|
||||
default:
|
||||
return super.onTransact(code, data, reply, flags);
|
||||
}
|
||||
}
|
||||
|
||||
private static class Proxy implements IMediaControllerCallback {
|
||||
private IBinder mRemote;
|
||||
|
||||
Proxy(IBinder remote) {
|
||||
this.mRemote = remote;
|
||||
}
|
||||
|
||||
@Override // android.os.IInterface
|
||||
public IBinder asBinder() {
|
||||
return this.mRemote;
|
||||
}
|
||||
|
||||
public String getInterfaceDescriptor() {
|
||||
return Stub.DESCRIPTOR;
|
||||
}
|
||||
|
||||
@Override // android.support.v4.media.session.IMediaControllerCallback
|
||||
public void onEvent(String event, Bundle extras) throws RemoteException {
|
||||
Parcel _data = Parcel.obtain();
|
||||
try {
|
||||
_data.writeInterfaceToken(Stub.DESCRIPTOR);
|
||||
_data.writeString(event);
|
||||
if (extras != null) {
|
||||
_data.writeInt(1);
|
||||
extras.writeToParcel(_data, 0);
|
||||
} else {
|
||||
_data.writeInt(0);
|
||||
}
|
||||
this.mRemote.transact(1, _data, null, 1);
|
||||
} finally {
|
||||
_data.recycle();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.support.v4.media.session.IMediaControllerCallback
|
||||
public void onSessionDestroyed() throws RemoteException {
|
||||
Parcel _data = Parcel.obtain();
|
||||
try {
|
||||
_data.writeInterfaceToken(Stub.DESCRIPTOR);
|
||||
this.mRemote.transact(2, _data, null, 1);
|
||||
} finally {
|
||||
_data.recycle();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.support.v4.media.session.IMediaControllerCallback
|
||||
public void onPlaybackStateChanged(PlaybackStateCompat state) throws RemoteException {
|
||||
Parcel _data = Parcel.obtain();
|
||||
try {
|
||||
_data.writeInterfaceToken(Stub.DESCRIPTOR);
|
||||
if (state != null) {
|
||||
_data.writeInt(1);
|
||||
state.writeToParcel(_data, 0);
|
||||
} else {
|
||||
_data.writeInt(0);
|
||||
}
|
||||
this.mRemote.transact(3, _data, null, 1);
|
||||
} finally {
|
||||
_data.recycle();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.support.v4.media.session.IMediaControllerCallback
|
||||
public void onMetadataChanged(MediaMetadataCompat metadata) throws RemoteException {
|
||||
Parcel _data = Parcel.obtain();
|
||||
try {
|
||||
_data.writeInterfaceToken(Stub.DESCRIPTOR);
|
||||
if (metadata != null) {
|
||||
_data.writeInt(1);
|
||||
metadata.writeToParcel(_data, 0);
|
||||
} else {
|
||||
_data.writeInt(0);
|
||||
}
|
||||
this.mRemote.transact(4, _data, null, 1);
|
||||
} finally {
|
||||
_data.recycle();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.support.v4.media.session.IMediaControllerCallback
|
||||
public void onQueueChanged(List<MediaSessionCompat.QueueItem> queue) throws RemoteException {
|
||||
Parcel _data = Parcel.obtain();
|
||||
try {
|
||||
_data.writeInterfaceToken(Stub.DESCRIPTOR);
|
||||
_data.writeTypedList(queue);
|
||||
this.mRemote.transact(5, _data, null, 1);
|
||||
} finally {
|
||||
_data.recycle();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.support.v4.media.session.IMediaControllerCallback
|
||||
public void onQueueTitleChanged(CharSequence title) throws RemoteException {
|
||||
Parcel _data = Parcel.obtain();
|
||||
try {
|
||||
_data.writeInterfaceToken(Stub.DESCRIPTOR);
|
||||
if (title != null) {
|
||||
_data.writeInt(1);
|
||||
TextUtils.writeToParcel(title, _data, 0);
|
||||
} else {
|
||||
_data.writeInt(0);
|
||||
}
|
||||
this.mRemote.transact(6, _data, null, 1);
|
||||
} finally {
|
||||
_data.recycle();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.support.v4.media.session.IMediaControllerCallback
|
||||
public void onExtrasChanged(Bundle extras) throws RemoteException {
|
||||
Parcel _data = Parcel.obtain();
|
||||
try {
|
||||
_data.writeInterfaceToken(Stub.DESCRIPTOR);
|
||||
if (extras != null) {
|
||||
_data.writeInt(1);
|
||||
extras.writeToParcel(_data, 0);
|
||||
} else {
|
||||
_data.writeInt(0);
|
||||
}
|
||||
this.mRemote.transact(7, _data, null, 1);
|
||||
} finally {
|
||||
_data.recycle();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.support.v4.media.session.IMediaControllerCallback
|
||||
public void onVolumeInfoChanged(ParcelableVolumeInfo info) throws RemoteException {
|
||||
Parcel _data = Parcel.obtain();
|
||||
try {
|
||||
_data.writeInterfaceToken(Stub.DESCRIPTOR);
|
||||
if (info != null) {
|
||||
_data.writeInt(1);
|
||||
info.writeToParcel(_data, 0);
|
||||
} else {
|
||||
_data.writeInt(0);
|
||||
}
|
||||
this.mRemote.transact(8, _data, null, 1);
|
||||
} finally {
|
||||
_data.recycle();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.support.v4.media.session.IMediaControllerCallback
|
||||
public void onRepeatModeChanged(int repeatMode) throws RemoteException {
|
||||
Parcel _data = Parcel.obtain();
|
||||
try {
|
||||
_data.writeInterfaceToken(Stub.DESCRIPTOR);
|
||||
_data.writeInt(repeatMode);
|
||||
this.mRemote.transact(9, _data, null, 1);
|
||||
} finally {
|
||||
_data.recycle();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.support.v4.media.session.IMediaControllerCallback
|
||||
public void onShuffleModeChangedRemoved(boolean enabled) throws RemoteException {
|
||||
Parcel _data = Parcel.obtain();
|
||||
try {
|
||||
_data.writeInterfaceToken(Stub.DESCRIPTOR);
|
||||
_data.writeInt(enabled ? 1 : 0);
|
||||
this.mRemote.transact(10, _data, null, 1);
|
||||
} finally {
|
||||
_data.recycle();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.support.v4.media.session.IMediaControllerCallback
|
||||
public void onCaptioningEnabledChanged(boolean enabled) throws RemoteException {
|
||||
Parcel _data = Parcel.obtain();
|
||||
try {
|
||||
_data.writeInterfaceToken(Stub.DESCRIPTOR);
|
||||
_data.writeInt(enabled ? 1 : 0);
|
||||
this.mRemote.transact(11, _data, null, 1);
|
||||
} finally {
|
||||
_data.recycle();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.support.v4.media.session.IMediaControllerCallback
|
||||
public void onShuffleModeChanged(int shuffleMode) throws RemoteException {
|
||||
Parcel _data = Parcel.obtain();
|
||||
try {
|
||||
_data.writeInterfaceToken(Stub.DESCRIPTOR);
|
||||
_data.writeInt(shuffleMode);
|
||||
this.mRemote.transact(12, _data, null, 1);
|
||||
} finally {
|
||||
_data.recycle();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.support.v4.media.session.IMediaControllerCallback
|
||||
public void onSessionReady() throws RemoteException {
|
||||
Parcel _data = Parcel.obtain();
|
||||
try {
|
||||
_data.writeInterfaceToken(Stub.DESCRIPTOR);
|
||||
this.mRemote.transact(13, _data, null, 1);
|
||||
} finally {
|
||||
_data.recycle();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+1509
File diff suppressed because it is too large
Load Diff
+1808
File diff suppressed because it is too large
Load Diff
+310
@@ -0,0 +1,310 @@
|
||||
package android.support.v4.media.session;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
import android.media.AudioAttributes;
|
||||
import android.media.MediaMetadata;
|
||||
import android.media.Rating;
|
||||
import android.media.session.MediaController;
|
||||
import android.media.session.MediaSession;
|
||||
import android.media.session.PlaybackState;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.ResultReceiver;
|
||||
import android.view.KeyEvent;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class MediaControllerCompatApi21 {
|
||||
|
||||
public interface Callback {
|
||||
void onAudioInfoChanged(int i, int i2, int i3, int i4, int i5);
|
||||
|
||||
void onExtrasChanged(Bundle bundle);
|
||||
|
||||
void onMetadataChanged(Object obj);
|
||||
|
||||
void onPlaybackStateChanged(Object obj);
|
||||
|
||||
void onQueueChanged(List<?> list);
|
||||
|
||||
void onQueueTitleChanged(CharSequence charSequence);
|
||||
|
||||
void onSessionDestroyed();
|
||||
|
||||
void onSessionEvent(String str, Bundle bundle);
|
||||
}
|
||||
|
||||
public static Object fromToken(Context context, Object sessionToken) {
|
||||
return new MediaController(context, (MediaSession.Token) sessionToken);
|
||||
}
|
||||
|
||||
public static Object createCallback(Callback callback) {
|
||||
return new CallbackProxy(callback);
|
||||
}
|
||||
|
||||
public static void registerCallback(Object controllerObj, Object callbackObj, Handler handler) {
|
||||
((MediaController) controllerObj).registerCallback((MediaController.Callback) callbackObj, handler);
|
||||
}
|
||||
|
||||
public static void unregisterCallback(Object controllerObj, Object callbackObj) {
|
||||
((MediaController) controllerObj).unregisterCallback((MediaController.Callback) callbackObj);
|
||||
}
|
||||
|
||||
public static void setMediaController(Activity activity, Object controllerObj) {
|
||||
activity.setMediaController((MediaController) controllerObj);
|
||||
}
|
||||
|
||||
public static Object getMediaController(Activity activity) {
|
||||
return activity.getMediaController();
|
||||
}
|
||||
|
||||
public static Object getSessionToken(Object controllerObj) {
|
||||
return ((MediaController) controllerObj).getSessionToken();
|
||||
}
|
||||
|
||||
public static Object getTransportControls(Object controllerObj) {
|
||||
return ((MediaController) controllerObj).getTransportControls();
|
||||
}
|
||||
|
||||
public static Object getPlaybackState(Object controllerObj) {
|
||||
return ((MediaController) controllerObj).getPlaybackState();
|
||||
}
|
||||
|
||||
public static Object getMetadata(Object controllerObj) {
|
||||
return ((MediaController) controllerObj).getMetadata();
|
||||
}
|
||||
|
||||
public static List<Object> getQueue(Object controllerObj) {
|
||||
List<MediaSession.QueueItem> queue = ((MediaController) controllerObj).getQueue();
|
||||
if (queue == null) {
|
||||
return null;
|
||||
}
|
||||
List<Object> queueObjs = new ArrayList<>(queue);
|
||||
return queueObjs;
|
||||
}
|
||||
|
||||
public static CharSequence getQueueTitle(Object controllerObj) {
|
||||
return ((MediaController) controllerObj).getQueueTitle();
|
||||
}
|
||||
|
||||
public static Bundle getExtras(Object controllerObj) {
|
||||
return ((MediaController) controllerObj).getExtras();
|
||||
}
|
||||
|
||||
public static int getRatingType(Object controllerObj) {
|
||||
return ((MediaController) controllerObj).getRatingType();
|
||||
}
|
||||
|
||||
public static long getFlags(Object controllerObj) {
|
||||
return ((MediaController) controllerObj).getFlags();
|
||||
}
|
||||
|
||||
public static Object getPlaybackInfo(Object controllerObj) {
|
||||
return ((MediaController) controllerObj).getPlaybackInfo();
|
||||
}
|
||||
|
||||
public static PendingIntent getSessionActivity(Object controllerObj) {
|
||||
return ((MediaController) controllerObj).getSessionActivity();
|
||||
}
|
||||
|
||||
public static boolean dispatchMediaButtonEvent(Object controllerObj, KeyEvent event) {
|
||||
return ((MediaController) controllerObj).dispatchMediaButtonEvent(event);
|
||||
}
|
||||
|
||||
public static void setVolumeTo(Object controllerObj, int value, int flags) {
|
||||
((MediaController) controllerObj).setVolumeTo(value, flags);
|
||||
}
|
||||
|
||||
public static void adjustVolume(Object controllerObj, int direction, int flags) {
|
||||
((MediaController) controllerObj).adjustVolume(direction, flags);
|
||||
}
|
||||
|
||||
public static void sendCommand(Object controllerObj, String command, Bundle params, ResultReceiver cb) {
|
||||
((MediaController) controllerObj).sendCommand(command, params, cb);
|
||||
}
|
||||
|
||||
public static String getPackageName(Object controllerObj) {
|
||||
return ((MediaController) controllerObj).getPackageName();
|
||||
}
|
||||
|
||||
public static class TransportControls {
|
||||
public static void play(Object controlsObj) {
|
||||
((MediaController.TransportControls) controlsObj).play();
|
||||
}
|
||||
|
||||
public static void pause(Object controlsObj) {
|
||||
((MediaController.TransportControls) controlsObj).pause();
|
||||
}
|
||||
|
||||
public static void stop(Object controlsObj) {
|
||||
((MediaController.TransportControls) controlsObj).stop();
|
||||
}
|
||||
|
||||
public static void seekTo(Object controlsObj, long pos) {
|
||||
((MediaController.TransportControls) controlsObj).seekTo(pos);
|
||||
}
|
||||
|
||||
public static void fastForward(Object controlsObj) {
|
||||
((MediaController.TransportControls) controlsObj).fastForward();
|
||||
}
|
||||
|
||||
public static void rewind(Object controlsObj) {
|
||||
((MediaController.TransportControls) controlsObj).rewind();
|
||||
}
|
||||
|
||||
public static void skipToNext(Object controlsObj) {
|
||||
((MediaController.TransportControls) controlsObj).skipToNext();
|
||||
}
|
||||
|
||||
public static void skipToPrevious(Object controlsObj) {
|
||||
((MediaController.TransportControls) controlsObj).skipToPrevious();
|
||||
}
|
||||
|
||||
public static void setRating(Object controlsObj, Object ratingObj) {
|
||||
((MediaController.TransportControls) controlsObj).setRating((Rating) ratingObj);
|
||||
}
|
||||
|
||||
public static void playFromMediaId(Object controlsObj, String mediaId, Bundle extras) {
|
||||
((MediaController.TransportControls) controlsObj).playFromMediaId(mediaId, extras);
|
||||
}
|
||||
|
||||
public static void playFromSearch(Object controlsObj, String query, Bundle extras) {
|
||||
((MediaController.TransportControls) controlsObj).playFromSearch(query, extras);
|
||||
}
|
||||
|
||||
public static void skipToQueueItem(Object controlsObj, long id) {
|
||||
((MediaController.TransportControls) controlsObj).skipToQueueItem(id);
|
||||
}
|
||||
|
||||
public static void sendCustomAction(Object controlsObj, String action, Bundle args) {
|
||||
((MediaController.TransportControls) controlsObj).sendCustomAction(action, args);
|
||||
}
|
||||
|
||||
private TransportControls() {
|
||||
}
|
||||
}
|
||||
|
||||
public static class PlaybackInfo {
|
||||
private static final int FLAG_SCO = 4;
|
||||
private static final int STREAM_BLUETOOTH_SCO = 6;
|
||||
private static final int STREAM_SYSTEM_ENFORCED = 7;
|
||||
|
||||
public static int getPlaybackType(Object volumeInfoObj) {
|
||||
return ((MediaController.PlaybackInfo) volumeInfoObj).getPlaybackType();
|
||||
}
|
||||
|
||||
public static AudioAttributes getAudioAttributes(Object volumeInfoObj) {
|
||||
return ((MediaController.PlaybackInfo) volumeInfoObj).getAudioAttributes();
|
||||
}
|
||||
|
||||
public static int getLegacyAudioStream(Object volumeInfoObj) {
|
||||
AudioAttributes attrs = getAudioAttributes(volumeInfoObj);
|
||||
return toLegacyStreamType(attrs);
|
||||
}
|
||||
|
||||
public static int getVolumeControl(Object volumeInfoObj) {
|
||||
return ((MediaController.PlaybackInfo) volumeInfoObj).getVolumeControl();
|
||||
}
|
||||
|
||||
public static int getMaxVolume(Object volumeInfoObj) {
|
||||
return ((MediaController.PlaybackInfo) volumeInfoObj).getMaxVolume();
|
||||
}
|
||||
|
||||
public static int getCurrentVolume(Object volumeInfoObj) {
|
||||
return ((MediaController.PlaybackInfo) volumeInfoObj).getCurrentVolume();
|
||||
}
|
||||
|
||||
private static int toLegacyStreamType(AudioAttributes aa) {
|
||||
if ((aa.getFlags() & 1) == 1) {
|
||||
return 7;
|
||||
}
|
||||
if ((aa.getFlags() & 4) == 4) {
|
||||
return 6;
|
||||
}
|
||||
switch (aa.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;
|
||||
}
|
||||
}
|
||||
|
||||
private PlaybackInfo() {
|
||||
}
|
||||
}
|
||||
|
||||
static class CallbackProxy<T extends Callback> extends MediaController.Callback {
|
||||
protected final T mCallback;
|
||||
|
||||
public CallbackProxy(T callback) {
|
||||
this.mCallback = callback;
|
||||
}
|
||||
|
||||
@Override // android.media.session.MediaController.Callback
|
||||
public void onSessionDestroyed() {
|
||||
this.mCallback.onSessionDestroyed();
|
||||
}
|
||||
|
||||
@Override // android.media.session.MediaController.Callback
|
||||
public void onSessionEvent(String event, Bundle extras) {
|
||||
MediaSessionCompat.ensureClassLoader(extras);
|
||||
this.mCallback.onSessionEvent(event, extras);
|
||||
}
|
||||
|
||||
@Override // android.media.session.MediaController.Callback
|
||||
public void onPlaybackStateChanged(PlaybackState state) {
|
||||
this.mCallback.onPlaybackStateChanged(state);
|
||||
}
|
||||
|
||||
@Override // android.media.session.MediaController.Callback
|
||||
public void onMetadataChanged(MediaMetadata metadata) {
|
||||
this.mCallback.onMetadataChanged(metadata);
|
||||
}
|
||||
|
||||
@Override // android.media.session.MediaController.Callback
|
||||
public void onQueueChanged(List<MediaSession.QueueItem> queue) {
|
||||
this.mCallback.onQueueChanged(queue);
|
||||
}
|
||||
|
||||
@Override // android.media.session.MediaController.Callback
|
||||
public void onQueueTitleChanged(CharSequence title) {
|
||||
this.mCallback.onQueueTitleChanged(title);
|
||||
}
|
||||
|
||||
@Override // android.media.session.MediaController.Callback
|
||||
public void onExtrasChanged(Bundle extras) {
|
||||
MediaSessionCompat.ensureClassLoader(extras);
|
||||
this.mCallback.onExtrasChanged(extras);
|
||||
}
|
||||
|
||||
@Override // android.media.session.MediaController.Callback
|
||||
public void onAudioInfoChanged(MediaController.PlaybackInfo info) {
|
||||
this.mCallback.onAudioInfoChanged(info.getPlaybackType(), PlaybackInfo.getLegacyAudioStream(info), info.getVolumeControl(), info.getMaxVolume(), info.getCurrentVolume());
|
||||
}
|
||||
}
|
||||
|
||||
private MediaControllerCompatApi21() {
|
||||
}
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package android.support.v4.media.session;
|
||||
|
||||
import android.media.session.MediaController;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class MediaControllerCompatApi23 {
|
||||
|
||||
public static class TransportControls {
|
||||
public static void playFromUri(Object controlsObj, Uri uri, Bundle extras) {
|
||||
((MediaController.TransportControls) controlsObj).playFromUri(uri, extras);
|
||||
}
|
||||
|
||||
private TransportControls() {
|
||||
}
|
||||
}
|
||||
|
||||
private MediaControllerCompatApi23() {
|
||||
}
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
package android.support.v4.media.session;
|
||||
|
||||
import android.media.session.MediaController;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class MediaControllerCompatApi24 {
|
||||
|
||||
public static class TransportControls {
|
||||
public static void prepare(Object controlsObj) {
|
||||
((MediaController.TransportControls) controlsObj).prepare();
|
||||
}
|
||||
|
||||
public static void prepareFromMediaId(Object controlsObj, String mediaId, Bundle extras) {
|
||||
((MediaController.TransportControls) controlsObj).prepareFromMediaId(mediaId, extras);
|
||||
}
|
||||
|
||||
public static void prepareFromSearch(Object controlsObj, String query, Bundle extras) {
|
||||
((MediaController.TransportControls) controlsObj).prepareFromSearch(query, extras);
|
||||
}
|
||||
|
||||
public static void prepareFromUri(Object controlsObj, Uri uri, Bundle extras) {
|
||||
((MediaController.TransportControls) controlsObj).prepareFromUri(uri, extras);
|
||||
}
|
||||
|
||||
private TransportControls() {
|
||||
}
|
||||
}
|
||||
|
||||
private MediaControllerCompatApi24() {
|
||||
}
|
||||
}
|
||||
+2934
File diff suppressed because it is too large
Load Diff
+278
@@ -0,0 +1,278 @@
|
||||
package android.support.v4.media.session;
|
||||
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.media.AudioAttributes;
|
||||
import android.media.MediaDescription;
|
||||
import android.media.MediaMetadata;
|
||||
import android.media.Rating;
|
||||
import android.media.VolumeProvider;
|
||||
import android.media.session.MediaSession;
|
||||
import android.media.session.PlaybackState;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Parcelable;
|
||||
import android.os.ResultReceiver;
|
||||
import android.util.Log;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class MediaSessionCompatApi21 {
|
||||
static final String TAG = "MediaSessionCompatApi21";
|
||||
|
||||
interface Callback {
|
||||
void onCommand(String str, Bundle bundle, ResultReceiver resultReceiver);
|
||||
|
||||
void onCustomAction(String str, Bundle bundle);
|
||||
|
||||
void onFastForward();
|
||||
|
||||
boolean onMediaButtonEvent(Intent intent);
|
||||
|
||||
void onPause();
|
||||
|
||||
void onPlay();
|
||||
|
||||
void onPlayFromMediaId(String str, Bundle bundle);
|
||||
|
||||
void onPlayFromSearch(String str, Bundle bundle);
|
||||
|
||||
void onRewind();
|
||||
|
||||
void onSeekTo(long j);
|
||||
|
||||
void onSetRating(Object obj);
|
||||
|
||||
void onSetRating(Object obj, Bundle bundle);
|
||||
|
||||
void onSkipToNext();
|
||||
|
||||
void onSkipToPrevious();
|
||||
|
||||
void onSkipToQueueItem(long j);
|
||||
|
||||
void onStop();
|
||||
}
|
||||
|
||||
public static Object createSession(Context context, String tag) {
|
||||
return new MediaSession(context, tag);
|
||||
}
|
||||
|
||||
public static Object verifySession(Object mediaSession) {
|
||||
if (mediaSession instanceof MediaSession) {
|
||||
return mediaSession;
|
||||
}
|
||||
throw new IllegalArgumentException("mediaSession is not a valid MediaSession object");
|
||||
}
|
||||
|
||||
public static Object verifyToken(Object token) {
|
||||
if (token instanceof MediaSession.Token) {
|
||||
return token;
|
||||
}
|
||||
throw new IllegalArgumentException("token is not a valid MediaSession.Token object");
|
||||
}
|
||||
|
||||
public static Object createCallback(Callback callback) {
|
||||
return new CallbackProxy(callback);
|
||||
}
|
||||
|
||||
public static void setCallback(Object sessionObj, Object callbackObj, Handler handler) {
|
||||
((MediaSession) sessionObj).setCallback((MediaSession.Callback) callbackObj, handler);
|
||||
}
|
||||
|
||||
public static void setFlags(Object sessionObj, int flags) {
|
||||
((MediaSession) sessionObj).setFlags(flags);
|
||||
}
|
||||
|
||||
public static void setPlaybackToLocal(Object sessionObj, int stream) {
|
||||
AudioAttributes.Builder bob = new AudioAttributes.Builder();
|
||||
bob.setLegacyStreamType(stream);
|
||||
((MediaSession) sessionObj).setPlaybackToLocal(bob.build());
|
||||
}
|
||||
|
||||
public static void setPlaybackToRemote(Object sessionObj, Object volumeProviderObj) {
|
||||
((MediaSession) sessionObj).setPlaybackToRemote((VolumeProvider) volumeProviderObj);
|
||||
}
|
||||
|
||||
public static void setActive(Object sessionObj, boolean active) {
|
||||
((MediaSession) sessionObj).setActive(active);
|
||||
}
|
||||
|
||||
public static boolean isActive(Object sessionObj) {
|
||||
return ((MediaSession) sessionObj).isActive();
|
||||
}
|
||||
|
||||
public static void sendSessionEvent(Object sessionObj, String event, Bundle extras) {
|
||||
((MediaSession) sessionObj).sendSessionEvent(event, extras);
|
||||
}
|
||||
|
||||
public static void release(Object sessionObj) {
|
||||
((MediaSession) sessionObj).release();
|
||||
}
|
||||
|
||||
public static Parcelable getSessionToken(Object sessionObj) {
|
||||
return ((MediaSession) sessionObj).getSessionToken();
|
||||
}
|
||||
|
||||
public static void setPlaybackState(Object sessionObj, Object stateObj) {
|
||||
((MediaSession) sessionObj).setPlaybackState((PlaybackState) stateObj);
|
||||
}
|
||||
|
||||
public static void setMetadata(Object sessionObj, Object metadataObj) {
|
||||
((MediaSession) sessionObj).setMetadata((MediaMetadata) metadataObj);
|
||||
}
|
||||
|
||||
public static void setSessionActivity(Object sessionObj, PendingIntent pi) {
|
||||
((MediaSession) sessionObj).setSessionActivity(pi);
|
||||
}
|
||||
|
||||
public static void setMediaButtonReceiver(Object sessionObj, PendingIntent pi) {
|
||||
((MediaSession) sessionObj).setMediaButtonReceiver(pi);
|
||||
}
|
||||
|
||||
public static void setQueue(Object sessionObj, List<Object> queueObjs) {
|
||||
if (queueObjs == null) {
|
||||
((MediaSession) sessionObj).setQueue(null);
|
||||
return;
|
||||
}
|
||||
ArrayList<MediaSession.QueueItem> queue = new ArrayList<>();
|
||||
for (Object itemObj : queueObjs) {
|
||||
queue.add((MediaSession.QueueItem) itemObj);
|
||||
}
|
||||
((MediaSession) sessionObj).setQueue(queue);
|
||||
}
|
||||
|
||||
public static void setQueueTitle(Object sessionObj, CharSequence title) {
|
||||
((MediaSession) sessionObj).setQueueTitle(title);
|
||||
}
|
||||
|
||||
public static void setExtras(Object sessionObj, Bundle extras) {
|
||||
((MediaSession) sessionObj).setExtras(extras);
|
||||
}
|
||||
|
||||
public static boolean hasCallback(Object sessionObj) {
|
||||
try {
|
||||
Field callbackField = sessionObj.getClass().getDeclaredField("mCallback");
|
||||
if (callbackField != null) {
|
||||
callbackField.setAccessible(true);
|
||||
if (callbackField.get(sessionObj) == null) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
} catch (IllegalAccessException | NoSuchFieldException e) {
|
||||
Log.w(TAG, "Failed to get mCallback object.");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static class CallbackProxy<T extends Callback> extends MediaSession.Callback {
|
||||
protected final T mCallback;
|
||||
|
||||
public CallbackProxy(T callback) {
|
||||
this.mCallback = callback;
|
||||
}
|
||||
|
||||
@Override // android.media.session.MediaSession.Callback
|
||||
public void onCommand(String command, Bundle args, ResultReceiver cb) {
|
||||
MediaSessionCompat.ensureClassLoader(args);
|
||||
this.mCallback.onCommand(command, args, cb);
|
||||
}
|
||||
|
||||
@Override // android.media.session.MediaSession.Callback
|
||||
public boolean onMediaButtonEvent(Intent mediaButtonIntent) {
|
||||
return this.mCallback.onMediaButtonEvent(mediaButtonIntent) || super.onMediaButtonEvent(mediaButtonIntent);
|
||||
}
|
||||
|
||||
@Override // android.media.session.MediaSession.Callback
|
||||
public void onPlay() {
|
||||
this.mCallback.onPlay();
|
||||
}
|
||||
|
||||
@Override // android.media.session.MediaSession.Callback
|
||||
public void onPlayFromMediaId(String mediaId, Bundle extras) {
|
||||
MediaSessionCompat.ensureClassLoader(extras);
|
||||
this.mCallback.onPlayFromMediaId(mediaId, extras);
|
||||
}
|
||||
|
||||
@Override // android.media.session.MediaSession.Callback
|
||||
public void onPlayFromSearch(String search, Bundle extras) {
|
||||
MediaSessionCompat.ensureClassLoader(extras);
|
||||
this.mCallback.onPlayFromSearch(search, extras);
|
||||
}
|
||||
|
||||
@Override // android.media.session.MediaSession.Callback
|
||||
public void onSkipToQueueItem(long id) {
|
||||
this.mCallback.onSkipToQueueItem(id);
|
||||
}
|
||||
|
||||
@Override // android.media.session.MediaSession.Callback
|
||||
public void onPause() {
|
||||
this.mCallback.onPause();
|
||||
}
|
||||
|
||||
@Override // android.media.session.MediaSession.Callback
|
||||
public void onSkipToNext() {
|
||||
this.mCallback.onSkipToNext();
|
||||
}
|
||||
|
||||
@Override // android.media.session.MediaSession.Callback
|
||||
public void onSkipToPrevious() {
|
||||
this.mCallback.onSkipToPrevious();
|
||||
}
|
||||
|
||||
@Override // android.media.session.MediaSession.Callback
|
||||
public void onFastForward() {
|
||||
this.mCallback.onFastForward();
|
||||
}
|
||||
|
||||
@Override // android.media.session.MediaSession.Callback
|
||||
public void onRewind() {
|
||||
this.mCallback.onRewind();
|
||||
}
|
||||
|
||||
@Override // android.media.session.MediaSession.Callback
|
||||
public void onStop() {
|
||||
this.mCallback.onStop();
|
||||
}
|
||||
|
||||
@Override // android.media.session.MediaSession.Callback
|
||||
public void onSeekTo(long pos) {
|
||||
this.mCallback.onSeekTo(pos);
|
||||
}
|
||||
|
||||
@Override // android.media.session.MediaSession.Callback
|
||||
public void onSetRating(Rating rating) {
|
||||
this.mCallback.onSetRating(rating);
|
||||
}
|
||||
|
||||
@Override // android.media.session.MediaSession.Callback
|
||||
public void onCustomAction(String action, Bundle extras) {
|
||||
MediaSessionCompat.ensureClassLoader(extras);
|
||||
this.mCallback.onCustomAction(action, extras);
|
||||
}
|
||||
}
|
||||
|
||||
static class QueueItem {
|
||||
public static Object createItem(Object mediaDescription, long id) {
|
||||
return new MediaSession.QueueItem((MediaDescription) mediaDescription, id);
|
||||
}
|
||||
|
||||
public static Object getDescription(Object queueItem) {
|
||||
return ((MediaSession.QueueItem) queueItem).getDescription();
|
||||
}
|
||||
|
||||
public static long getQueueId(Object queueItem) {
|
||||
return ((MediaSession.QueueItem) queueItem).getQueueId();
|
||||
}
|
||||
|
||||
private QueueItem() {
|
||||
}
|
||||
}
|
||||
|
||||
private MediaSessionCompatApi21() {
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package android.support.v4.media.session;
|
||||
|
||||
import android.media.session.MediaSession;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class MediaSessionCompatApi22 {
|
||||
public static void setRatingType(Object sessionObj, int type) {
|
||||
((MediaSession) sessionObj).setRatingType(type);
|
||||
}
|
||||
|
||||
private MediaSessionCompatApi22() {
|
||||
}
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
package android.support.v4.media.session;
|
||||
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.media.session.MediaSessionCompatApi21;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class MediaSessionCompatApi23 {
|
||||
|
||||
public interface Callback extends MediaSessionCompatApi21.Callback {
|
||||
void onPlayFromUri(Uri uri, Bundle bundle);
|
||||
}
|
||||
|
||||
public static Object createCallback(Callback callback) {
|
||||
return new CallbackProxy(callback);
|
||||
}
|
||||
|
||||
static class CallbackProxy<T extends Callback> extends MediaSessionCompatApi21.CallbackProxy<T> {
|
||||
public CallbackProxy(T callback) {
|
||||
super(callback);
|
||||
}
|
||||
|
||||
@Override // android.media.session.MediaSession.Callback
|
||||
public void onPlayFromUri(Uri uri, Bundle extras) {
|
||||
MediaSessionCompat.ensureClassLoader(extras);
|
||||
((Callback) this.mCallback).onPlayFromUri(uri, extras);
|
||||
}
|
||||
}
|
||||
|
||||
private MediaSessionCompatApi23() {
|
||||
}
|
||||
}
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
package android.support.v4.media.session;
|
||||
|
||||
import android.media.session.MediaSession;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.media.session.MediaSessionCompatApi23;
|
||||
import android.util.Log;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class MediaSessionCompatApi24 {
|
||||
private static final String TAG = "MediaSessionCompatApi24";
|
||||
|
||||
public interface Callback extends MediaSessionCompatApi23.Callback {
|
||||
void onPrepare();
|
||||
|
||||
void onPrepareFromMediaId(String str, Bundle bundle);
|
||||
|
||||
void onPrepareFromSearch(String str, Bundle bundle);
|
||||
|
||||
void onPrepareFromUri(Uri uri, Bundle bundle);
|
||||
}
|
||||
|
||||
public static Object createCallback(Callback callback) {
|
||||
return new CallbackProxy(callback);
|
||||
}
|
||||
|
||||
public static String getCallingPackage(Object sessionObj) {
|
||||
MediaSession session = (MediaSession) sessionObj;
|
||||
try {
|
||||
Method getCallingPackageMethod = session.getClass().getMethod("getCallingPackage", new Class[0]);
|
||||
return (String) getCallingPackageMethod.invoke(session, new Object[0]);
|
||||
} catch (IllegalAccessException | NoSuchMethodException | InvocationTargetException e) {
|
||||
Log.e(TAG, "Cannot execute MediaSession.getCallingPackage()", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
static class CallbackProxy<T extends Callback> extends MediaSessionCompatApi23.CallbackProxy<T> {
|
||||
public CallbackProxy(T callback) {
|
||||
super(callback);
|
||||
}
|
||||
|
||||
@Override // android.media.session.MediaSession.Callback
|
||||
public void onPrepare() {
|
||||
((Callback) this.mCallback).onPrepare();
|
||||
}
|
||||
|
||||
@Override // android.media.session.MediaSession.Callback
|
||||
public void onPrepareFromMediaId(String mediaId, Bundle extras) {
|
||||
MediaSessionCompat.ensureClassLoader(extras);
|
||||
((Callback) this.mCallback).onPrepareFromMediaId(mediaId, extras);
|
||||
}
|
||||
|
||||
@Override // android.media.session.MediaSession.Callback
|
||||
public void onPrepareFromSearch(String query, Bundle extras) {
|
||||
MediaSessionCompat.ensureClassLoader(extras);
|
||||
((Callback) this.mCallback).onPrepareFromSearch(query, extras);
|
||||
}
|
||||
|
||||
@Override // android.media.session.MediaSession.Callback
|
||||
public void onPrepareFromUri(Uri uri, Bundle extras) {
|
||||
MediaSessionCompat.ensureClassLoader(extras);
|
||||
((Callback) this.mCallback).onPrepareFromUri(uri, extras);
|
||||
}
|
||||
}
|
||||
|
||||
private MediaSessionCompatApi24() {
|
||||
}
|
||||
}
|
||||
+56
@@ -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 in) {
|
||||
return new ParcelableVolumeInfo(in);
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public ParcelableVolumeInfo[] newArray(int size) {
|
||||
return new ParcelableVolumeInfo[size];
|
||||
}
|
||||
};
|
||||
public int audioStream;
|
||||
public int controlType;
|
||||
public int currentVolume;
|
||||
public int maxVolume;
|
||||
public int volumeType;
|
||||
|
||||
public ParcelableVolumeInfo(int volumeType, int audioStream, int controlType, int maxVolume, int currentVolume) {
|
||||
this.volumeType = volumeType;
|
||||
this.audioStream = audioStream;
|
||||
this.controlType = controlType;
|
||||
this.maxVolume = maxVolume;
|
||||
this.currentVolume = currentVolume;
|
||||
}
|
||||
|
||||
public ParcelableVolumeInfo(Parcel from) {
|
||||
this.volumeType = from.readInt();
|
||||
this.controlType = from.readInt();
|
||||
this.maxVolume = from.readInt();
|
||||
this.currentVolume = from.readInt();
|
||||
this.audioStream = from.readInt();
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeInt(this.volumeType);
|
||||
dest.writeInt(this.controlType);
|
||||
dest.writeInt(this.maxVolume);
|
||||
dest.writeInt(this.currentVolume);
|
||||
dest.writeInt(this.audioStream);
|
||||
}
|
||||
}
|
||||
+510
@@ -0,0 +1,510 @@
|
||||
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.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.util.ArrayList;
|
||||
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 in) {
|
||||
return new PlaybackStateCompat(in);
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public PlaybackStateCompat[] newArray(int size) {
|
||||
return new PlaybackStateCompat[size];
|
||||
}
|
||||
};
|
||||
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;
|
||||
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface Actions {
|
||||
}
|
||||
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface ErrorCode {
|
||||
}
|
||||
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface MediaKeyAction {
|
||||
}
|
||||
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface RepeatMode {
|
||||
}
|
||||
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface ShuffleMode {
|
||||
}
|
||||
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface State {
|
||||
}
|
||||
|
||||
public static int toKeyCode(long action) {
|
||||
if (action == 4) {
|
||||
return 126;
|
||||
}
|
||||
if (action == 2) {
|
||||
return 127;
|
||||
}
|
||||
if (action == 32) {
|
||||
return 87;
|
||||
}
|
||||
if (action == 16) {
|
||||
return 88;
|
||||
}
|
||||
if (action == 1) {
|
||||
return 86;
|
||||
}
|
||||
if (action == 64) {
|
||||
return 90;
|
||||
}
|
||||
if (action == 8) {
|
||||
return 89;
|
||||
}
|
||||
if (action == 512) {
|
||||
return 85;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
PlaybackStateCompat(int state, long position, long bufferedPosition, float rate, long actions, int errorCode, CharSequence errorMessage, long updateTime, List<CustomAction> customActions, long activeItemId, Bundle extras) {
|
||||
this.mState = state;
|
||||
this.mPosition = position;
|
||||
this.mBufferedPosition = bufferedPosition;
|
||||
this.mSpeed = rate;
|
||||
this.mActions = actions;
|
||||
this.mErrorCode = errorCode;
|
||||
this.mErrorMessage = errorMessage;
|
||||
this.mUpdateTime = updateTime;
|
||||
this.mCustomActions = new ArrayList(customActions);
|
||||
this.mActiveItemId = activeItemId;
|
||||
this.mExtras = extras;
|
||||
}
|
||||
|
||||
PlaybackStateCompat(Parcel in) {
|
||||
this.mState = in.readInt();
|
||||
this.mPosition = in.readLong();
|
||||
this.mSpeed = in.readFloat();
|
||||
this.mUpdateTime = in.readLong();
|
||||
this.mBufferedPosition = in.readLong();
|
||||
this.mActions = in.readLong();
|
||||
this.mErrorMessage = (CharSequence) TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in);
|
||||
this.mCustomActions = in.createTypedArrayList(CustomAction.CREATOR);
|
||||
this.mActiveItemId = in.readLong();
|
||||
this.mExtras = in.readBundle(MediaSessionCompat.class.getClassLoader());
|
||||
this.mErrorCode = in.readInt();
|
||||
}
|
||||
|
||||
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 int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeInt(this.mState);
|
||||
dest.writeLong(this.mPosition);
|
||||
dest.writeFloat(this.mSpeed);
|
||||
dest.writeLong(this.mUpdateTime);
|
||||
dest.writeLong(this.mBufferedPosition);
|
||||
dest.writeLong(this.mActions);
|
||||
TextUtils.writeToParcel(this.mErrorMessage, dest, flags);
|
||||
dest.writeTypedList(this.mCustomActions);
|
||||
dest.writeLong(this.mActiveItemId);
|
||||
dest.writeBundle(this.mExtras);
|
||||
dest.writeInt(this.mErrorCode);
|
||||
}
|
||||
|
||||
public int getState() {
|
||||
return this.mState;
|
||||
}
|
||||
|
||||
public long getPosition() {
|
||||
return this.mPosition;
|
||||
}
|
||||
|
||||
public long getLastPositionUpdateTime() {
|
||||
return this.mUpdateTime;
|
||||
}
|
||||
|
||||
public long getCurrentPosition(Long timeDiff) {
|
||||
long expectedPosition = this.mPosition + (this.mSpeed * ((float) (timeDiff != null ? timeDiff.longValue() : SystemClock.elapsedRealtime() - this.mUpdateTime)));
|
||||
return Math.max(0L, expectedPosition);
|
||||
}
|
||||
|
||||
public long getBufferedPosition() {
|
||||
return this.mBufferedPosition;
|
||||
}
|
||||
|
||||
public float getPlaybackSpeed() {
|
||||
return this.mSpeed;
|
||||
}
|
||||
|
||||
public long getActions() {
|
||||
return this.mActions;
|
||||
}
|
||||
|
||||
public List<CustomAction> getCustomActions() {
|
||||
return this.mCustomActions;
|
||||
}
|
||||
|
||||
public int getErrorCode() {
|
||||
return this.mErrorCode;
|
||||
}
|
||||
|
||||
public CharSequence getErrorMessage() {
|
||||
return this.mErrorMessage;
|
||||
}
|
||||
|
||||
public long getActiveQueueItemId() {
|
||||
return this.mActiveItemId;
|
||||
}
|
||||
|
||||
public Bundle getExtras() {
|
||||
return this.mExtras;
|
||||
}
|
||||
|
||||
public static PlaybackStateCompat fromPlaybackState(Object stateObj) {
|
||||
Bundle extras;
|
||||
if (stateObj != null && Build.VERSION.SDK_INT >= 21) {
|
||||
List<Object> customActionObjs = PlaybackStateCompatApi21.getCustomActions(stateObj);
|
||||
List<CustomAction> customActions = null;
|
||||
if (customActionObjs != null) {
|
||||
customActions = new ArrayList<>(customActionObjs.size());
|
||||
for (Object customActionObj : customActionObjs) {
|
||||
customActions.add(CustomAction.fromCustomAction(customActionObj));
|
||||
}
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 22) {
|
||||
extras = PlaybackStateCompatApi22.getExtras(stateObj);
|
||||
} else {
|
||||
extras = null;
|
||||
}
|
||||
PlaybackStateCompat state = new PlaybackStateCompat(PlaybackStateCompatApi21.getState(stateObj), PlaybackStateCompatApi21.getPosition(stateObj), PlaybackStateCompatApi21.getBufferedPosition(stateObj), PlaybackStateCompatApi21.getPlaybackSpeed(stateObj), PlaybackStateCompatApi21.getActions(stateObj), 0, PlaybackStateCompatApi21.getErrorMessage(stateObj), PlaybackStateCompatApi21.getLastPositionUpdateTime(stateObj), customActions, PlaybackStateCompatApi21.getActiveQueueItemId(stateObj), extras);
|
||||
state.mStateObj = stateObj;
|
||||
return state;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public Object getPlaybackState() {
|
||||
if (this.mStateObj == null && Build.VERSION.SDK_INT >= 21) {
|
||||
List<Object> customActions = null;
|
||||
if (this.mCustomActions != null) {
|
||||
customActions = new ArrayList<>(this.mCustomActions.size());
|
||||
for (CustomAction customAction : this.mCustomActions) {
|
||||
customActions.add(customAction.getCustomAction());
|
||||
}
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 22) {
|
||||
this.mStateObj = PlaybackStateCompatApi22.newInstance(this.mState, this.mPosition, this.mBufferedPosition, this.mSpeed, this.mActions, this.mErrorMessage, this.mUpdateTime, customActions, this.mActiveItemId, this.mExtras);
|
||||
} else {
|
||||
this.mStateObj = PlaybackStateCompatApi21.newInstance(this.mState, this.mPosition, this.mBufferedPosition, this.mSpeed, this.mActions, this.mErrorMessage, this.mUpdateTime, customActions, this.mActiveItemId);
|
||||
}
|
||||
}
|
||||
return this.mStateObj;
|
||||
}
|
||||
|
||||
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 p) {
|
||||
return new CustomAction(p);
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public CustomAction[] newArray(int size) {
|
||||
return new CustomAction[size];
|
||||
}
|
||||
};
|
||||
private final String mAction;
|
||||
private Object mCustomActionObj;
|
||||
private final Bundle mExtras;
|
||||
private final int mIcon;
|
||||
private final CharSequence mName;
|
||||
|
||||
CustomAction(String action, CharSequence name, int icon, Bundle extras) {
|
||||
this.mAction = action;
|
||||
this.mName = name;
|
||||
this.mIcon = icon;
|
||||
this.mExtras = extras;
|
||||
}
|
||||
|
||||
CustomAction(Parcel in) {
|
||||
this.mAction = in.readString();
|
||||
this.mName = (CharSequence) TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in);
|
||||
this.mIcon = in.readInt();
|
||||
this.mExtras = in.readBundle(MediaSessionCompat.class.getClassLoader());
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeString(this.mAction);
|
||||
TextUtils.writeToParcel(this.mName, dest, flags);
|
||||
dest.writeInt(this.mIcon);
|
||||
dest.writeBundle(this.mExtras);
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static CustomAction fromCustomAction(Object customActionObj) {
|
||||
if (customActionObj == null || Build.VERSION.SDK_INT < 21) {
|
||||
return null;
|
||||
}
|
||||
CustomAction customAction = new CustomAction(PlaybackStateCompatApi21.CustomAction.getAction(customActionObj), PlaybackStateCompatApi21.CustomAction.getName(customActionObj), PlaybackStateCompatApi21.CustomAction.getIcon(customActionObj), PlaybackStateCompatApi21.CustomAction.getExtras(customActionObj));
|
||||
customAction.mCustomActionObj = customActionObj;
|
||||
return customAction;
|
||||
}
|
||||
|
||||
public Object getCustomAction() {
|
||||
if (this.mCustomActionObj != null || Build.VERSION.SDK_INT < 21) {
|
||||
return this.mCustomActionObj;
|
||||
}
|
||||
Object newInstance = PlaybackStateCompatApi21.CustomAction.newInstance(this.mAction, this.mName, this.mIcon, this.mExtras);
|
||||
this.mCustomActionObj = newInstance;
|
||||
return newInstance;
|
||||
}
|
||||
|
||||
public String getAction() {
|
||||
return this.mAction;
|
||||
}
|
||||
|
||||
public CharSequence getName() {
|
||||
return this.mName;
|
||||
}
|
||||
|
||||
public int getIcon() {
|
||||
return this.mIcon;
|
||||
}
|
||||
|
||||
public Bundle getExtras() {
|
||||
return this.mExtras;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "Action:mName='" + ((Object) this.mName) + ", mIcon=" + this.mIcon + ", mExtras=" + this.mExtras;
|
||||
}
|
||||
|
||||
public static final class Builder {
|
||||
private final String mAction;
|
||||
private Bundle mExtras;
|
||||
private final int mIcon;
|
||||
private final CharSequence mName;
|
||||
|
||||
public Builder(String action, CharSequence name, int icon) {
|
||||
if (TextUtils.isEmpty(action)) {
|
||||
throw new IllegalArgumentException("You must specify an action to build a CustomAction.");
|
||||
}
|
||||
if (TextUtils.isEmpty(name)) {
|
||||
throw new IllegalArgumentException("You must specify a name to build a CustomAction.");
|
||||
}
|
||||
if (icon == 0) {
|
||||
throw new IllegalArgumentException("You must specify an icon resource id to build a CustomAction.");
|
||||
}
|
||||
this.mAction = action;
|
||||
this.mName = name;
|
||||
this.mIcon = icon;
|
||||
}
|
||||
|
||||
public Builder setExtras(Bundle extras) {
|
||||
this.mExtras = extras;
|
||||
return this;
|
||||
}
|
||||
|
||||
public CustomAction build() {
|
||||
return new CustomAction(this.mAction, this.mName, this.mIcon, this.mExtras);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static final class Builder {
|
||||
private long mActions;
|
||||
private long mActiveItemId;
|
||||
private long mBufferedPosition;
|
||||
private final List<CustomAction> mCustomActions;
|
||||
private int mErrorCode;
|
||||
private CharSequence mErrorMessage;
|
||||
private Bundle mExtras;
|
||||
private long mPosition;
|
||||
private float mRate;
|
||||
private int mState;
|
||||
private long mUpdateTime;
|
||||
|
||||
public Builder() {
|
||||
this.mCustomActions = new ArrayList();
|
||||
this.mActiveItemId = -1L;
|
||||
}
|
||||
|
||||
public Builder(PlaybackStateCompat source) {
|
||||
ArrayList arrayList = new ArrayList();
|
||||
this.mCustomActions = arrayList;
|
||||
this.mActiveItemId = -1L;
|
||||
this.mState = source.mState;
|
||||
this.mPosition = source.mPosition;
|
||||
this.mRate = source.mSpeed;
|
||||
this.mUpdateTime = source.mUpdateTime;
|
||||
this.mBufferedPosition = source.mBufferedPosition;
|
||||
this.mActions = source.mActions;
|
||||
this.mErrorCode = source.mErrorCode;
|
||||
this.mErrorMessage = source.mErrorMessage;
|
||||
if (source.mCustomActions != null) {
|
||||
arrayList.addAll(source.mCustomActions);
|
||||
}
|
||||
this.mActiveItemId = source.mActiveItemId;
|
||||
this.mExtras = source.mExtras;
|
||||
}
|
||||
|
||||
public Builder setState(int state, long position, float playbackSpeed) {
|
||||
return setState(state, position, playbackSpeed, SystemClock.elapsedRealtime());
|
||||
}
|
||||
|
||||
public Builder setState(int state, long position, float playbackSpeed, long updateTime) {
|
||||
this.mState = state;
|
||||
this.mPosition = position;
|
||||
this.mUpdateTime = updateTime;
|
||||
this.mRate = playbackSpeed;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setBufferedPosition(long bufferPosition) {
|
||||
this.mBufferedPosition = bufferPosition;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setActions(long capabilities) {
|
||||
this.mActions = capabilities;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder addCustomAction(String action, String name, int icon) {
|
||||
return addCustomAction(new CustomAction(action, name, icon, null));
|
||||
}
|
||||
|
||||
public Builder addCustomAction(CustomAction customAction) {
|
||||
if (customAction == null) {
|
||||
throw new IllegalArgumentException("You may not add a null CustomAction to PlaybackStateCompat.");
|
||||
}
|
||||
this.mCustomActions.add(customAction);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setActiveQueueItemId(long id) {
|
||||
this.mActiveItemId = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setErrorMessage(CharSequence errorMessage) {
|
||||
this.mErrorMessage = errorMessage;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setErrorMessage(int errorCode, CharSequence errorMessage) {
|
||||
this.mErrorCode = errorCode;
|
||||
this.mErrorMessage = errorMessage;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setExtras(Bundle extras) {
|
||||
this.mExtras = extras;
|
||||
return this;
|
||||
}
|
||||
|
||||
public PlaybackStateCompat build() {
|
||||
return new PlaybackStateCompat(this.mState, this.mPosition, this.mBufferedPosition, this.mRate, this.mActions, this.mErrorCode, this.mErrorMessage, this.mUpdateTime, this.mCustomActions, this.mActiveItemId, this.mExtras);
|
||||
}
|
||||
}
|
||||
}
|
||||
+87
@@ -0,0 +1,87 @@
|
||||
package android.support.v4.media.session;
|
||||
|
||||
import android.media.session.PlaybackState;
|
||||
import android.os.Bundle;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class PlaybackStateCompatApi21 {
|
||||
public static int getState(Object stateObj) {
|
||||
return ((PlaybackState) stateObj).getState();
|
||||
}
|
||||
|
||||
public static long getPosition(Object stateObj) {
|
||||
return ((PlaybackState) stateObj).getPosition();
|
||||
}
|
||||
|
||||
public static long getBufferedPosition(Object stateObj) {
|
||||
return ((PlaybackState) stateObj).getBufferedPosition();
|
||||
}
|
||||
|
||||
public static float getPlaybackSpeed(Object stateObj) {
|
||||
return ((PlaybackState) stateObj).getPlaybackSpeed();
|
||||
}
|
||||
|
||||
public static long getActions(Object stateObj) {
|
||||
return ((PlaybackState) stateObj).getActions();
|
||||
}
|
||||
|
||||
public static CharSequence getErrorMessage(Object stateObj) {
|
||||
return ((PlaybackState) stateObj).getErrorMessage();
|
||||
}
|
||||
|
||||
public static long getLastPositionUpdateTime(Object stateObj) {
|
||||
return ((PlaybackState) stateObj).getLastPositionUpdateTime();
|
||||
}
|
||||
|
||||
public static List<Object> getCustomActions(Object stateObj) {
|
||||
return ((PlaybackState) stateObj).getCustomActions();
|
||||
}
|
||||
|
||||
public static long getActiveQueueItemId(Object stateObj) {
|
||||
return ((PlaybackState) stateObj).getActiveQueueItemId();
|
||||
}
|
||||
|
||||
public static Object newInstance(int state, long position, long bufferedPosition, float speed, long actions, CharSequence errorMessage, long updateTime, List<Object> customActions, long activeItemId) {
|
||||
PlaybackState.Builder stateObj = new PlaybackState.Builder();
|
||||
stateObj.setState(state, position, speed, updateTime);
|
||||
stateObj.setBufferedPosition(bufferedPosition);
|
||||
stateObj.setActions(actions);
|
||||
stateObj.setErrorMessage(errorMessage);
|
||||
for (Object customAction : customActions) {
|
||||
stateObj.addCustomAction((PlaybackState.CustomAction) customAction);
|
||||
}
|
||||
stateObj.setActiveQueueItemId(activeItemId);
|
||||
return stateObj.build();
|
||||
}
|
||||
|
||||
static final class CustomAction {
|
||||
public static String getAction(Object customActionObj) {
|
||||
return ((PlaybackState.CustomAction) customActionObj).getAction();
|
||||
}
|
||||
|
||||
public static CharSequence getName(Object customActionObj) {
|
||||
return ((PlaybackState.CustomAction) customActionObj).getName();
|
||||
}
|
||||
|
||||
public static int getIcon(Object customActionObj) {
|
||||
return ((PlaybackState.CustomAction) customActionObj).getIcon();
|
||||
}
|
||||
|
||||
public static Bundle getExtras(Object customActionObj) {
|
||||
return ((PlaybackState.CustomAction) customActionObj).getExtras();
|
||||
}
|
||||
|
||||
public static Object newInstance(String action, CharSequence name, int icon, Bundle extras) {
|
||||
PlaybackState.CustomAction.Builder customActionObj = new PlaybackState.CustomAction.Builder(action, name, icon);
|
||||
customActionObj.setExtras(extras);
|
||||
return customActionObj.build();
|
||||
}
|
||||
|
||||
private CustomAction() {
|
||||
}
|
||||
}
|
||||
|
||||
private PlaybackStateCompatApi21() {
|
||||
}
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
package android.support.v4.media.session;
|
||||
|
||||
import android.media.session.PlaybackState;
|
||||
import android.os.Bundle;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class PlaybackStateCompatApi22 {
|
||||
public static Bundle getExtras(Object stateObj) {
|
||||
return ((PlaybackState) stateObj).getExtras();
|
||||
}
|
||||
|
||||
public static Object newInstance(int state, long position, long bufferedPosition, float speed, long actions, CharSequence errorMessage, long updateTime, List<Object> customActions, long activeItemId, Bundle extras) {
|
||||
PlaybackState.Builder stateObj = new PlaybackState.Builder();
|
||||
stateObj.setState(state, position, speed, updateTime);
|
||||
stateObj.setBufferedPosition(bufferedPosition);
|
||||
stateObj.setActions(actions);
|
||||
stateObj.setErrorMessage(errorMessage);
|
||||
for (Object customAction : customActions) {
|
||||
stateObj.addCustomAction((PlaybackState.CustomAction) customAction);
|
||||
}
|
||||
stateObj.setActiveQueueItemId(activeItemId);
|
||||
stateObj.setExtras(extras);
|
||||
return stateObj.build();
|
||||
}
|
||||
|
||||
private PlaybackStateCompatApi22() {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
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 {
|
||||
void send(int i, Bundle bundle) throws RemoteException;
|
||||
|
||||
public static class Default implements IResultReceiver {
|
||||
@Override // android.support.v4.os.IResultReceiver
|
||||
public void send(int resultCode, Bundle resultData) throws RemoteException {
|
||||
}
|
||||
|
||||
@Override // android.os.IInterface
|
||||
public IBinder asBinder() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static abstract class Stub extends Binder implements IResultReceiver {
|
||||
private static final String DESCRIPTOR = "android.support.v4.os.IResultReceiver";
|
||||
static final int TRANSACTION_send = 1;
|
||||
|
||||
public Stub() {
|
||||
attachInterface(this, DESCRIPTOR);
|
||||
}
|
||||
|
||||
public static IResultReceiver asInterface(IBinder obj) {
|
||||
if (obj == null) {
|
||||
return null;
|
||||
}
|
||||
IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
|
||||
if (iin != null && (iin instanceof IResultReceiver)) {
|
||||
return (IResultReceiver) iin;
|
||||
}
|
||||
return new Proxy(obj);
|
||||
}
|
||||
|
||||
@Override // android.os.IInterface
|
||||
public IBinder asBinder() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // android.os.Binder
|
||||
public boolean onTransact(int code, Parcel data, Parcel reply, int flags) throws RemoteException {
|
||||
Bundle _arg1;
|
||||
switch (code) {
|
||||
case 1:
|
||||
data.enforceInterface(DESCRIPTOR);
|
||||
int _arg0 = data.readInt();
|
||||
if (data.readInt() != 0) {
|
||||
_arg1 = (Bundle) Bundle.CREATOR.createFromParcel(data);
|
||||
} else {
|
||||
_arg1 = null;
|
||||
}
|
||||
send(_arg0, _arg1);
|
||||
return true;
|
||||
case 1598968902:
|
||||
reply.writeString(DESCRIPTOR);
|
||||
return true;
|
||||
default:
|
||||
return super.onTransact(code, data, reply, flags);
|
||||
}
|
||||
}
|
||||
|
||||
private static class Proxy implements IResultReceiver {
|
||||
public static IResultReceiver sDefaultImpl;
|
||||
private IBinder mRemote;
|
||||
|
||||
Proxy(IBinder remote) {
|
||||
this.mRemote = remote;
|
||||
}
|
||||
|
||||
@Override // android.os.IInterface
|
||||
public IBinder asBinder() {
|
||||
return this.mRemote;
|
||||
}
|
||||
|
||||
public String getInterfaceDescriptor() {
|
||||
return Stub.DESCRIPTOR;
|
||||
}
|
||||
|
||||
@Override // android.support.v4.os.IResultReceiver
|
||||
public void send(int resultCode, Bundle resultData) throws RemoteException {
|
||||
Parcel _data = Parcel.obtain();
|
||||
try {
|
||||
_data.writeInterfaceToken(Stub.DESCRIPTOR);
|
||||
_data.writeInt(resultCode);
|
||||
if (resultData != null) {
|
||||
_data.writeInt(1);
|
||||
resultData.writeToParcel(_data, 0);
|
||||
} else {
|
||||
_data.writeInt(0);
|
||||
}
|
||||
boolean _status = this.mRemote.transact(1, _data, null, 1);
|
||||
if (!_status && Stub.getDefaultImpl() != null) {
|
||||
Stub.getDefaultImpl().send(resultCode, resultData);
|
||||
}
|
||||
} finally {
|
||||
_data.recycle();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean setDefaultImpl(IResultReceiver impl) {
|
||||
if (Proxy.sDefaultImpl != null) {
|
||||
throw new IllegalStateException("setDefaultImpl() called twice");
|
||||
}
|
||||
if (impl != null) {
|
||||
Proxy.sDefaultImpl = impl;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static IResultReceiver getDefaultImpl() {
|
||||
return Proxy.sDefaultImpl;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
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 in) {
|
||||
return new ResultReceiver(in);
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public ResultReceiver[] newArray(int size) {
|
||||
return new ResultReceiver[size];
|
||||
}
|
||||
};
|
||||
final Handler mHandler;
|
||||
final boolean mLocal;
|
||||
IResultReceiver mReceiver;
|
||||
|
||||
class MyRunnable implements Runnable {
|
||||
final int mResultCode;
|
||||
final Bundle mResultData;
|
||||
|
||||
MyRunnable(int resultCode, Bundle resultData) {
|
||||
this.mResultCode = resultCode;
|
||||
this.mResultData = resultData;
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
ResultReceiver.this.onReceiveResult(this.mResultCode, this.mResultData);
|
||||
}
|
||||
}
|
||||
|
||||
class MyResultReceiver extends IResultReceiver.Stub {
|
||||
MyResultReceiver() {
|
||||
}
|
||||
|
||||
@Override // android.support.v4.os.IResultReceiver
|
||||
public void send(int resultCode, Bundle resultData) {
|
||||
if (ResultReceiver.this.mHandler != null) {
|
||||
ResultReceiver.this.mHandler.post(ResultReceiver.this.new MyRunnable(resultCode, resultData));
|
||||
} else {
|
||||
ResultReceiver.this.onReceiveResult(resultCode, resultData);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public ResultReceiver(Handler handler) {
|
||||
this.mLocal = true;
|
||||
this.mHandler = handler;
|
||||
}
|
||||
|
||||
public void send(int resultCode, Bundle resultData) {
|
||||
if (this.mLocal) {
|
||||
Handler handler = this.mHandler;
|
||||
if (handler != null) {
|
||||
handler.post(new MyRunnable(resultCode, resultData));
|
||||
return;
|
||||
} else {
|
||||
onReceiveResult(resultCode, resultData);
|
||||
return;
|
||||
}
|
||||
}
|
||||
IResultReceiver iResultReceiver = this.mReceiver;
|
||||
if (iResultReceiver != null) {
|
||||
try {
|
||||
iResultReceiver.send(resultCode, resultData);
|
||||
} catch (RemoteException e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void onReceiveResult(int resultCode, Bundle resultData) {
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public void writeToParcel(Parcel out, int flags) {
|
||||
synchronized (this) {
|
||||
if (this.mReceiver == null) {
|
||||
this.mReceiver = new MyResultReceiver();
|
||||
}
|
||||
out.writeStrongBinder(this.mReceiver.asBinder());
|
||||
}
|
||||
}
|
||||
|
||||
ResultReceiver(Parcel in) {
|
||||
this.mLocal = false;
|
||||
this.mHandler = null;
|
||||
this.mReceiver = IResultReceiver.Stub.asInterface(in.readStrongBinder());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,256 @@
|
||||
package androidx.activity;
|
||||
|
||||
import app.beetlebug.C0572R;
|
||||
|
||||
/* renamed from: androidx.activity.R */
|
||||
/* loaded from: classes2.dex */
|
||||
public final class C0039R {
|
||||
|
||||
/* renamed from: androidx.activity.R$attr */
|
||||
public static final class attr {
|
||||
public static final int alpha = 2130968620;
|
||||
public static final int font = 2130968967;
|
||||
public static final int fontProviderAuthority = 2130968969;
|
||||
public static final int fontProviderCerts = 2130968970;
|
||||
public static final int fontProviderFetchStrategy = 2130968971;
|
||||
public static final int fontProviderFetchTimeout = 2130968972;
|
||||
public static final int fontProviderPackage = 2130968973;
|
||||
public static final int fontProviderQuery = 2130968974;
|
||||
public static final int fontStyle = 2130968976;
|
||||
public static final int fontVariationSettings = 2130968977;
|
||||
public static final int fontWeight = 2130968978;
|
||||
public static final int ttcIndex = 2130969565;
|
||||
|
||||
private attr() {
|
||||
}
|
||||
}
|
||||
|
||||
/* renamed from: androidx.activity.R$color */
|
||||
public static final class color {
|
||||
public static final int notification_action_color_filter = 2131099844;
|
||||
public static final int notification_icon_bg_color = 2131099845;
|
||||
public static final int ripple_material_light = 2131099863;
|
||||
public static final int secondary_text_default_material_light = 2131099865;
|
||||
|
||||
private color() {
|
||||
}
|
||||
}
|
||||
|
||||
/* renamed from: androidx.activity.R$dimen */
|
||||
public static final class dimen {
|
||||
public static final int compat_button_inset_horizontal_material = 2131165273;
|
||||
public static final int compat_button_inset_vertical_material = 2131165274;
|
||||
public static final int compat_button_padding_horizontal_material = 2131165275;
|
||||
public static final int compat_button_padding_vertical_material = 2131165276;
|
||||
public static final int compat_control_corner_material = 2131165277;
|
||||
public static final int compat_notification_large_icon_max_height = 2131165278;
|
||||
public static final int compat_notification_large_icon_max_width = 2131165279;
|
||||
public static final int notification_action_icon_size = 2131165574;
|
||||
public static final int notification_action_text_size = 2131165575;
|
||||
public static final int notification_big_circle_margin = 2131165576;
|
||||
public static final int notification_content_margin_start = 2131165577;
|
||||
public static final int notification_large_icon_height = 2131165578;
|
||||
public static final int notification_large_icon_width = 2131165579;
|
||||
public static final int notification_main_column_padding_top = 2131165580;
|
||||
public static final int notification_media_narrow_margin = 2131165581;
|
||||
public static final int notification_right_icon_size = 2131165582;
|
||||
public static final int notification_right_side_padding_top = 2131165583;
|
||||
public static final int notification_small_icon_background_padding = 2131165584;
|
||||
public static final int notification_small_icon_size_as_large = 2131165585;
|
||||
public static final int notification_subtext_size = 2131165586;
|
||||
public static final int notification_top_pad = 2131165587;
|
||||
public static final int notification_top_pad_large_text = 2131165588;
|
||||
|
||||
private dimen() {
|
||||
}
|
||||
}
|
||||
|
||||
/* renamed from: androidx.activity.R$drawable */
|
||||
public static final class drawable {
|
||||
public static final int notification_action_background = 2131230925;
|
||||
public static final int notification_bg = 2131230926;
|
||||
public static final int notification_bg_low = 2131230927;
|
||||
public static final int notification_bg_low_normal = 2131230928;
|
||||
public static final int notification_bg_low_pressed = 2131230929;
|
||||
public static final int notification_bg_normal = 2131230930;
|
||||
public static final int notification_bg_normal_pressed = 2131230931;
|
||||
public static final int notification_icon_background = 2131230932;
|
||||
public static final int notification_template_icon_bg = 2131230933;
|
||||
public static final int notification_template_icon_low_bg = 2131230934;
|
||||
public static final int notification_tile_bg = 2131230935;
|
||||
public static final int notify_panel_notification_icon_bg = 2131230936;
|
||||
|
||||
private drawable() {
|
||||
}
|
||||
}
|
||||
|
||||
/* renamed from: androidx.activity.R$id */
|
||||
public static final class id {
|
||||
public static final int accessibility_action_clickable_span = 2131361808;
|
||||
public static final int accessibility_custom_action_0 = 2131361809;
|
||||
public static final int accessibility_custom_action_1 = 2131361810;
|
||||
public static final int accessibility_custom_action_10 = 2131361811;
|
||||
public static final int accessibility_custom_action_11 = 2131361812;
|
||||
public static final int accessibility_custom_action_12 = 2131361813;
|
||||
public static final int accessibility_custom_action_13 = 2131361814;
|
||||
public static final int accessibility_custom_action_14 = 2131361815;
|
||||
public static final int accessibility_custom_action_15 = 2131361816;
|
||||
public static final int accessibility_custom_action_16 = 2131361817;
|
||||
public static final int accessibility_custom_action_17 = 2131361818;
|
||||
public static final int accessibility_custom_action_18 = 2131361819;
|
||||
public static final int accessibility_custom_action_19 = 2131361820;
|
||||
public static final int accessibility_custom_action_2 = 2131361821;
|
||||
public static final int accessibility_custom_action_20 = 2131361822;
|
||||
public static final int accessibility_custom_action_21 = 2131361823;
|
||||
public static final int accessibility_custom_action_22 = 2131361824;
|
||||
public static final int accessibility_custom_action_23 = 2131361825;
|
||||
public static final int accessibility_custom_action_24 = 2131361826;
|
||||
public static final int accessibility_custom_action_25 = 2131361827;
|
||||
public static final int accessibility_custom_action_26 = 2131361828;
|
||||
public static final int accessibility_custom_action_27 = 2131361829;
|
||||
public static final int accessibility_custom_action_28 = 2131361830;
|
||||
public static final int accessibility_custom_action_29 = 2131361831;
|
||||
public static final int accessibility_custom_action_3 = 2131361832;
|
||||
public static final int accessibility_custom_action_30 = 2131361833;
|
||||
public static final int accessibility_custom_action_31 = 2131361834;
|
||||
public static final int accessibility_custom_action_4 = 2131361835;
|
||||
public static final int accessibility_custom_action_5 = 2131361836;
|
||||
public static final int accessibility_custom_action_6 = 2131361837;
|
||||
public static final int accessibility_custom_action_7 = 2131361838;
|
||||
public static final int accessibility_custom_action_8 = 2131361839;
|
||||
public static final int accessibility_custom_action_9 = 2131361840;
|
||||
public static final int action_container = 2131361852;
|
||||
public static final int action_divider = 2131361854;
|
||||
public static final int action_image = 2131361855;
|
||||
public static final int action_text = 2131361861;
|
||||
public static final int actions = 2131361862;
|
||||
public static final int async = 2131361882;
|
||||
public static final int blocking = 2131361896;
|
||||
public static final int chronometer = 2131361941;
|
||||
public static final int dialog_button = 2131361984;
|
||||
public static final int forever = 2131362054;
|
||||
public static final int icon = 2131362076;
|
||||
public static final int icon_group = 2131362077;
|
||||
public static final int info = 2131362109;
|
||||
public static final int italic = 2131362113;
|
||||
public static final int line1 = 2131362124;
|
||||
public static final int line3 = 2131362125;
|
||||
public static final int normal = 2131362212;
|
||||
public static final int notification_background = 2131362214;
|
||||
public static final int notification_main_column = 2131362215;
|
||||
public static final int notification_main_column_container = 2131362216;
|
||||
public static final int right_icon = 2131362261;
|
||||
public static final int right_side = 2131362262;
|
||||
public static final int tag_accessibility_actions = 2131362335;
|
||||
public static final int tag_accessibility_clickable_spans = 2131362336;
|
||||
public static final int tag_accessibility_heading = 2131362337;
|
||||
public static final int tag_accessibility_pane_title = 2131362338;
|
||||
public static final int tag_screen_reader_focusable = 2131362342;
|
||||
public static final int tag_transition_group = 2131362344;
|
||||
public static final int tag_unhandled_key_event_manager = 2131362345;
|
||||
public static final int tag_unhandled_key_listeners = 2131362346;
|
||||
public static final int text = 2131362352;
|
||||
public static final int text2 = 2131362353;
|
||||
public static final int time = 2131362403;
|
||||
public static final int title = 2131362404;
|
||||
public static final int view_tree_lifecycle_owner = 2131362432;
|
||||
public static final int view_tree_saved_state_registry_owner = 2131362433;
|
||||
public static final int view_tree_view_model_store_owner = 2131362434;
|
||||
|
||||
private id() {
|
||||
}
|
||||
}
|
||||
|
||||
/* renamed from: androidx.activity.R$integer */
|
||||
public static final class integer {
|
||||
public static final int status_bar_notification_info_maxnum = 2131427356;
|
||||
|
||||
private integer() {
|
||||
}
|
||||
}
|
||||
|
||||
/* renamed from: androidx.activity.R$layout */
|
||||
public static final class layout {
|
||||
public static final int custom_dialog = 2131558464;
|
||||
public static final int notification_action = 2131558541;
|
||||
public static final int notification_action_tombstone = 2131558542;
|
||||
public static final int notification_template_custom_big = 2131558549;
|
||||
public static final int notification_template_icon_group = 2131558550;
|
||||
public static final int notification_template_part_chronometer = 2131558554;
|
||||
public static final int notification_template_part_time = 2131558555;
|
||||
|
||||
private layout() {
|
||||
}
|
||||
}
|
||||
|
||||
/* renamed from: androidx.activity.R$string */
|
||||
public static final class string {
|
||||
public static final int status_bar_notification_info_overflow = 2131886227;
|
||||
|
||||
private string() {
|
||||
}
|
||||
}
|
||||
|
||||
/* renamed from: androidx.activity.R$style */
|
||||
public static final class style {
|
||||
public static final int TextAppearance_Compat_Notification = 2131951969;
|
||||
public static final int TextAppearance_Compat_Notification_Info = 2131951970;
|
||||
public static final int TextAppearance_Compat_Notification_Line2 = 2131951972;
|
||||
public static final int TextAppearance_Compat_Notification_Time = 2131951975;
|
||||
public static final int TextAppearance_Compat_Notification_Title = 2131951977;
|
||||
public static final int Widget_Compat_NotificationActionContainer = 2131952210;
|
||||
public static final int Widget_Compat_NotificationActionText = 2131952211;
|
||||
|
||||
private style() {
|
||||
}
|
||||
}
|
||||
|
||||
/* renamed from: androidx.activity.R$styleable */
|
||||
public static final class styleable {
|
||||
public static final int ColorStateListItem_alpha = 2;
|
||||
public static final int ColorStateListItem_android_alpha = 1;
|
||||
public static final int ColorStateListItem_android_color = 0;
|
||||
public static final int FontFamilyFont_android_font = 0;
|
||||
public static final int FontFamilyFont_android_fontStyle = 2;
|
||||
public static final int FontFamilyFont_android_fontVariationSettings = 4;
|
||||
public static final int FontFamilyFont_android_fontWeight = 1;
|
||||
public static final int FontFamilyFont_android_ttcIndex = 3;
|
||||
public static final int FontFamilyFont_font = 5;
|
||||
public static final int FontFamilyFont_fontStyle = 6;
|
||||
public static final int FontFamilyFont_fontVariationSettings = 7;
|
||||
public static final int FontFamilyFont_fontWeight = 8;
|
||||
public static final int FontFamilyFont_ttcIndex = 9;
|
||||
public static final int FontFamily_fontProviderAuthority = 0;
|
||||
public static final int FontFamily_fontProviderCerts = 1;
|
||||
public static final int FontFamily_fontProviderFetchStrategy = 2;
|
||||
public static final int FontFamily_fontProviderFetchTimeout = 3;
|
||||
public static final int FontFamily_fontProviderPackage = 4;
|
||||
public static final int FontFamily_fontProviderQuery = 5;
|
||||
public static final int FontFamily_fontProviderSystemFontFamily = 6;
|
||||
public static final int GradientColorItem_android_color = 0;
|
||||
public static final int GradientColorItem_android_offset = 1;
|
||||
public static final int GradientColor_android_centerColor = 7;
|
||||
public static final int GradientColor_android_centerX = 3;
|
||||
public static final int GradientColor_android_centerY = 4;
|
||||
public static final int GradientColor_android_endColor = 1;
|
||||
public static final int GradientColor_android_endX = 10;
|
||||
public static final int GradientColor_android_endY = 11;
|
||||
public static final int GradientColor_android_gradientRadius = 5;
|
||||
public static final int GradientColor_android_startColor = 0;
|
||||
public static final int GradientColor_android_startX = 8;
|
||||
public static final int GradientColor_android_startY = 9;
|
||||
public static final int GradientColor_android_tileMode = 6;
|
||||
public static final int GradientColor_android_type = 2;
|
||||
public static final int[] ColorStateListItem = {android.R.attr.color, android.R.attr.alpha, C0572R.attr.alpha};
|
||||
public static final int[] FontFamily = {C0572R.attr.fontProviderAuthority, C0572R.attr.fontProviderCerts, C0572R.attr.fontProviderFetchStrategy, C0572R.attr.fontProviderFetchTimeout, C0572R.attr.fontProviderPackage, C0572R.attr.fontProviderQuery, C0572R.attr.fontProviderSystemFontFamily};
|
||||
public static final int[] FontFamilyFont = {android.R.attr.font, android.R.attr.fontWeight, android.R.attr.fontStyle, android.R.attr.ttcIndex, android.R.attr.fontVariationSettings, C0572R.attr.font, C0572R.attr.fontStyle, C0572R.attr.fontVariationSettings, C0572R.attr.fontWeight, C0572R.attr.ttcIndex};
|
||||
public static final int[] GradientColor = {android.R.attr.startColor, android.R.attr.endColor, android.R.attr.type, android.R.attr.centerX, android.R.attr.centerY, android.R.attr.gradientRadius, android.R.attr.tileMode, android.R.attr.centerColor, android.R.attr.startX, android.R.attr.startY, android.R.attr.endX, android.R.attr.endY};
|
||||
public static final int[] GradientColorItem = {android.R.attr.color, android.R.attr.offset};
|
||||
|
||||
private styleable() {
|
||||
}
|
||||
}
|
||||
|
||||
private C0039R() {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package androidx.activity;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
interface Cancellable {
|
||||
void cancel();
|
||||
}
|
||||
@@ -0,0 +1,431 @@
|
||||
package androidx.activity;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentSender;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.Window;
|
||||
import androidx.activity.contextaware.ContextAware;
|
||||
import androidx.activity.contextaware.ContextAwareHelper;
|
||||
import androidx.activity.contextaware.OnContextAvailableListener;
|
||||
import androidx.activity.result.ActivityResultCallback;
|
||||
import androidx.activity.result.ActivityResultCaller;
|
||||
import androidx.activity.result.ActivityResultLauncher;
|
||||
import androidx.activity.result.ActivityResultRegistry;
|
||||
import androidx.activity.result.ActivityResultRegistryOwner;
|
||||
import androidx.activity.result.IntentSenderRequest;
|
||||
import androidx.activity.result.contract.ActivityResultContract;
|
||||
import androidx.activity.result.contract.ActivityResultContracts;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.app.ActivityOptionsCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.lifecycle.HasDefaultViewModelProviderFactory;
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
import androidx.lifecycle.LifecycleEventObserver;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
import androidx.lifecycle.LifecycleRegistry;
|
||||
import androidx.lifecycle.ReportFragment;
|
||||
import androidx.lifecycle.SavedStateViewModelFactory;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.lifecycle.ViewModelStore;
|
||||
import androidx.lifecycle.ViewModelStoreOwner;
|
||||
import androidx.lifecycle.ViewTreeLifecycleOwner;
|
||||
import androidx.lifecycle.ViewTreeViewModelStoreOwner;
|
||||
import androidx.savedstate.SavedStateRegistry;
|
||||
import androidx.savedstate.SavedStateRegistryController;
|
||||
import androidx.savedstate.SavedStateRegistryOwner;
|
||||
import androidx.savedstate.ViewTreeSavedStateRegistryOwner;
|
||||
import androidx.tracing.Trace;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class ComponentActivity extends androidx.core.app.ComponentActivity implements ContextAware, LifecycleOwner, ViewModelStoreOwner, HasDefaultViewModelProviderFactory, SavedStateRegistryOwner, OnBackPressedDispatcherOwner, ActivityResultRegistryOwner, ActivityResultCaller {
|
||||
private static final String ACTIVITY_RESULT_TAG = "android:support:activity-result";
|
||||
private final ActivityResultRegistry mActivityResultRegistry;
|
||||
private int mContentLayoutId;
|
||||
final ContextAwareHelper mContextAwareHelper;
|
||||
private ViewModelProvider.Factory mDefaultFactory;
|
||||
private final LifecycleRegistry mLifecycleRegistry;
|
||||
private final AtomicInteger mNextLocalRequestCode;
|
||||
private final OnBackPressedDispatcher mOnBackPressedDispatcher;
|
||||
final SavedStateRegistryController mSavedStateRegistryController;
|
||||
private ViewModelStore mViewModelStore;
|
||||
|
||||
static final class NonConfigurationInstances {
|
||||
Object custom;
|
||||
ViewModelStore viewModelStore;
|
||||
|
||||
NonConfigurationInstances() {
|
||||
}
|
||||
}
|
||||
|
||||
public ComponentActivity() {
|
||||
this.mContextAwareHelper = new ContextAwareHelper();
|
||||
this.mLifecycleRegistry = new LifecycleRegistry(this);
|
||||
this.mSavedStateRegistryController = SavedStateRegistryController.create(this);
|
||||
this.mOnBackPressedDispatcher = new OnBackPressedDispatcher(new Runnable() { // from class: androidx.activity.ComponentActivity.1
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
try {
|
||||
ComponentActivity.super.onBackPressed();
|
||||
} catch (IllegalStateException e) {
|
||||
if (!TextUtils.equals(e.getMessage(), "Can not perform this action after onSaveInstanceState")) {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
this.mNextLocalRequestCode = new AtomicInteger();
|
||||
this.mActivityResultRegistry = new ActivityResultRegistry() { // from class: androidx.activity.ComponentActivity.2
|
||||
@Override // androidx.activity.result.ActivityResultRegistry
|
||||
public <I, O> void onLaunch(final int requestCode, ActivityResultContract<I, O> contract, I input, ActivityOptionsCompat options) {
|
||||
Bundle optionsBundle;
|
||||
Bundle optionsBundle2;
|
||||
ComponentActivity activity = ComponentActivity.this;
|
||||
final ActivityResultContract.SynchronousResult<O> synchronousResult = contract.getSynchronousResult(activity, input);
|
||||
if (synchronousResult != null) {
|
||||
new Handler(Looper.getMainLooper()).post(new Runnable() { // from class: androidx.activity.ComponentActivity.2.1
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
dispatchResult(requestCode, synchronousResult.getValue());
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
Intent intent = contract.createIntent(activity, input);
|
||||
if (intent.getExtras() != null && intent.getExtras().getClassLoader() == null) {
|
||||
intent.setExtrasClassLoader(activity.getClassLoader());
|
||||
}
|
||||
if (intent.hasExtra(ActivityResultContracts.StartActivityForResult.EXTRA_ACTIVITY_OPTIONS_BUNDLE)) {
|
||||
Bundle optionsBundle3 = intent.getBundleExtra(ActivityResultContracts.StartActivityForResult.EXTRA_ACTIVITY_OPTIONS_BUNDLE);
|
||||
intent.removeExtra(ActivityResultContracts.StartActivityForResult.EXTRA_ACTIVITY_OPTIONS_BUNDLE);
|
||||
optionsBundle = optionsBundle3;
|
||||
} else if (options == null) {
|
||||
optionsBundle = null;
|
||||
} else {
|
||||
Bundle optionsBundle4 = options.toBundle();
|
||||
optionsBundle = optionsBundle4;
|
||||
}
|
||||
if (ActivityResultContracts.RequestMultiplePermissions.ACTION_REQUEST_PERMISSIONS.equals(intent.getAction())) {
|
||||
String[] permissions = intent.getStringArrayExtra(ActivityResultContracts.RequestMultiplePermissions.EXTRA_PERMISSIONS);
|
||||
if (permissions == null) {
|
||||
permissions = new String[0];
|
||||
}
|
||||
ActivityCompat.requestPermissions(activity, permissions, requestCode);
|
||||
return;
|
||||
}
|
||||
if (ActivityResultContracts.StartIntentSenderForResult.ACTION_INTENT_SENDER_REQUEST.equals(intent.getAction())) {
|
||||
IntentSenderRequest request = (IntentSenderRequest) intent.getParcelableExtra(ActivityResultContracts.StartIntentSenderForResult.EXTRA_INTENT_SENDER_REQUEST);
|
||||
try {
|
||||
optionsBundle2 = optionsBundle;
|
||||
try {
|
||||
ActivityCompat.startIntentSenderForResult(activity, request.getIntentSender(), requestCode, request.getFillInIntent(), request.getFlagsMask(), request.getFlagsValues(), 0, optionsBundle);
|
||||
} catch (IntentSender.SendIntentException e) {
|
||||
e = e;
|
||||
new Handler(Looper.getMainLooper()).post(new Runnable() { // from class: androidx.activity.ComponentActivity.2.2
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
dispatchResult(requestCode, 0, new Intent().setAction(ActivityResultContracts.StartIntentSenderForResult.ACTION_INTENT_SENDER_REQUEST).putExtra(ActivityResultContracts.StartIntentSenderForResult.EXTRA_SEND_INTENT_EXCEPTION, e));
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
} catch (IntentSender.SendIntentException e2) {
|
||||
e = e2;
|
||||
optionsBundle2 = optionsBundle;
|
||||
}
|
||||
return;
|
||||
}
|
||||
ActivityCompat.startActivityForResult(activity, intent, requestCode, optionsBundle);
|
||||
}
|
||||
};
|
||||
Lifecycle lifecycle = getLifecycle();
|
||||
if (lifecycle == null) {
|
||||
throw new IllegalStateException("getLifecycle() returned null in ComponentActivity's constructor. Please make sure you are lazily constructing your Lifecycle in the first call to getLifecycle() rather than relying on field initialization.");
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 19) {
|
||||
getLifecycle().addObserver(new LifecycleEventObserver() { // from class: androidx.activity.ComponentActivity.3
|
||||
@Override // androidx.lifecycle.LifecycleEventObserver
|
||||
public void onStateChanged(LifecycleOwner source, Lifecycle.Event event) {
|
||||
if (event == Lifecycle.Event.ON_STOP) {
|
||||
Window window = ComponentActivity.this.getWindow();
|
||||
View decor = window != null ? window.peekDecorView() : null;
|
||||
if (decor != null) {
|
||||
decor.cancelPendingInputEvents();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
getLifecycle().addObserver(new LifecycleEventObserver() { // from class: androidx.activity.ComponentActivity.4
|
||||
@Override // androidx.lifecycle.LifecycleEventObserver
|
||||
public void onStateChanged(LifecycleOwner source, Lifecycle.Event event) {
|
||||
if (event == Lifecycle.Event.ON_DESTROY) {
|
||||
ComponentActivity.this.mContextAwareHelper.clearAvailableContext();
|
||||
if (!ComponentActivity.this.isChangingConfigurations()) {
|
||||
ComponentActivity.this.getViewModelStore().clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
getLifecycle().addObserver(new LifecycleEventObserver() { // from class: androidx.activity.ComponentActivity.5
|
||||
@Override // androidx.lifecycle.LifecycleEventObserver
|
||||
public void onStateChanged(LifecycleOwner source, Lifecycle.Event event) {
|
||||
ComponentActivity.this.ensureViewModelStore();
|
||||
ComponentActivity.this.getLifecycle().removeObserver(this);
|
||||
}
|
||||
});
|
||||
if (19 <= Build.VERSION.SDK_INT && Build.VERSION.SDK_INT <= 23) {
|
||||
getLifecycle().addObserver(new ImmLeaksCleaner(this));
|
||||
}
|
||||
getSavedStateRegistry().registerSavedStateProvider(ACTIVITY_RESULT_TAG, new SavedStateRegistry.SavedStateProvider() { // from class: androidx.activity.ComponentActivity.6
|
||||
@Override // androidx.savedstate.SavedStateRegistry.SavedStateProvider
|
||||
public Bundle saveState() {
|
||||
Bundle outState = new Bundle();
|
||||
ComponentActivity.this.mActivityResultRegistry.onSaveInstanceState(outState);
|
||||
return outState;
|
||||
}
|
||||
});
|
||||
addOnContextAvailableListener(new OnContextAvailableListener() { // from class: androidx.activity.ComponentActivity.7
|
||||
@Override // androidx.activity.contextaware.OnContextAvailableListener
|
||||
public void onContextAvailable(Context context) {
|
||||
Bundle savedInstanceState = ComponentActivity.this.getSavedStateRegistry().consumeRestoredStateForKey(ComponentActivity.ACTIVITY_RESULT_TAG);
|
||||
if (savedInstanceState != null) {
|
||||
ComponentActivity.this.mActivityResultRegistry.onRestoreInstanceState(savedInstanceState);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public ComponentActivity(int contentLayoutId) {
|
||||
this();
|
||||
this.mContentLayoutId = contentLayoutId;
|
||||
}
|
||||
|
||||
@Override // androidx.core.app.ComponentActivity, android.app.Activity
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
this.mSavedStateRegistryController.performRestore(savedInstanceState);
|
||||
this.mContextAwareHelper.dispatchOnContextAvailable(this);
|
||||
super.onCreate(savedInstanceState);
|
||||
ReportFragment.injectIfNeededIn(this);
|
||||
int i = this.mContentLayoutId;
|
||||
if (i != 0) {
|
||||
setContentView(i);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.core.app.ComponentActivity, android.app.Activity
|
||||
protected void onSaveInstanceState(Bundle outState) {
|
||||
Lifecycle lifecycle = getLifecycle();
|
||||
if (lifecycle instanceof LifecycleRegistry) {
|
||||
((LifecycleRegistry) lifecycle).setCurrentState(Lifecycle.State.CREATED);
|
||||
}
|
||||
super.onSaveInstanceState(outState);
|
||||
this.mSavedStateRegistryController.performSave(outState);
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
public final Object onRetainNonConfigurationInstance() {
|
||||
NonConfigurationInstances nc;
|
||||
Object custom = onRetainCustomNonConfigurationInstance();
|
||||
ViewModelStore viewModelStore = this.mViewModelStore;
|
||||
if (viewModelStore == null && (nc = (NonConfigurationInstances) getLastNonConfigurationInstance()) != null) {
|
||||
viewModelStore = nc.viewModelStore;
|
||||
}
|
||||
if (viewModelStore == null && custom == null) {
|
||||
return null;
|
||||
}
|
||||
NonConfigurationInstances nci = new NonConfigurationInstances();
|
||||
nci.custom = custom;
|
||||
nci.viewModelStore = viewModelStore;
|
||||
return nci;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public Object onRetainCustomNonConfigurationInstance() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public Object getLastCustomNonConfigurationInstance() {
|
||||
NonConfigurationInstances nc = (NonConfigurationInstances) getLastNonConfigurationInstance();
|
||||
if (nc != null) {
|
||||
return nc.custom;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
public void setContentView(int layoutResID) {
|
||||
initViewTreeOwners();
|
||||
super.setContentView(layoutResID);
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
public void setContentView(View view) {
|
||||
initViewTreeOwners();
|
||||
super.setContentView(view);
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
public void setContentView(View view, ViewGroup.LayoutParams params) {
|
||||
initViewTreeOwners();
|
||||
super.setContentView(view, params);
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
public void addContentView(View view, ViewGroup.LayoutParams params) {
|
||||
initViewTreeOwners();
|
||||
super.addContentView(view, params);
|
||||
}
|
||||
|
||||
private void initViewTreeOwners() {
|
||||
ViewTreeLifecycleOwner.set(getWindow().getDecorView(), this);
|
||||
ViewTreeViewModelStoreOwner.set(getWindow().getDecorView(), this);
|
||||
ViewTreeSavedStateRegistryOwner.set(getWindow().getDecorView(), this);
|
||||
}
|
||||
|
||||
@Override // androidx.activity.contextaware.ContextAware
|
||||
public Context peekAvailableContext() {
|
||||
return this.mContextAwareHelper.peekAvailableContext();
|
||||
}
|
||||
|
||||
@Override // androidx.activity.contextaware.ContextAware
|
||||
public final void addOnContextAvailableListener(OnContextAvailableListener listener) {
|
||||
this.mContextAwareHelper.addOnContextAvailableListener(listener);
|
||||
}
|
||||
|
||||
@Override // androidx.activity.contextaware.ContextAware
|
||||
public final void removeOnContextAvailableListener(OnContextAvailableListener listener) {
|
||||
this.mContextAwareHelper.removeOnContextAvailableListener(listener);
|
||||
}
|
||||
|
||||
@Override // androidx.core.app.ComponentActivity, androidx.lifecycle.LifecycleOwner
|
||||
public Lifecycle getLifecycle() {
|
||||
return this.mLifecycleRegistry;
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.ViewModelStoreOwner
|
||||
public ViewModelStore getViewModelStore() {
|
||||
if (getApplication() == null) {
|
||||
throw new IllegalStateException("Your activity is not yet attached to the Application instance. You can't request ViewModel before onCreate call.");
|
||||
}
|
||||
ensureViewModelStore();
|
||||
return this.mViewModelStore;
|
||||
}
|
||||
|
||||
void ensureViewModelStore() {
|
||||
if (this.mViewModelStore == null) {
|
||||
NonConfigurationInstances nc = (NonConfigurationInstances) getLastNonConfigurationInstance();
|
||||
if (nc != null) {
|
||||
this.mViewModelStore = nc.viewModelStore;
|
||||
}
|
||||
if (this.mViewModelStore == null) {
|
||||
this.mViewModelStore = new ViewModelStore();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.HasDefaultViewModelProviderFactory
|
||||
public ViewModelProvider.Factory getDefaultViewModelProviderFactory() {
|
||||
if (getApplication() == null) {
|
||||
throw new IllegalStateException("Your activity is not yet attached to the Application instance. You can't request ViewModel before onCreate call.");
|
||||
}
|
||||
if (this.mDefaultFactory == null) {
|
||||
this.mDefaultFactory = new SavedStateViewModelFactory(getApplication(), this, getIntent() != null ? getIntent().getExtras() : null);
|
||||
}
|
||||
return this.mDefaultFactory;
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
public void onBackPressed() {
|
||||
this.mOnBackPressedDispatcher.onBackPressed();
|
||||
}
|
||||
|
||||
@Override // androidx.activity.OnBackPressedDispatcherOwner
|
||||
public final OnBackPressedDispatcher getOnBackPressedDispatcher() {
|
||||
return this.mOnBackPressedDispatcher;
|
||||
}
|
||||
|
||||
@Override // androidx.savedstate.SavedStateRegistryOwner
|
||||
public final SavedStateRegistry getSavedStateRegistry() {
|
||||
return this.mSavedStateRegistryController.getSavedStateRegistry();
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
@Deprecated
|
||||
public void startActivityForResult(Intent intent, int requestCode) {
|
||||
super.startActivityForResult(intent, requestCode);
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
@Deprecated
|
||||
public void startActivityForResult(Intent intent, int requestCode, Bundle options) {
|
||||
super.startActivityForResult(intent, requestCode, options);
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
@Deprecated
|
||||
public void startIntentSenderForResult(IntentSender intent, int requestCode, Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags) throws IntentSender.SendIntentException {
|
||||
super.startIntentSenderForResult(intent, requestCode, fillInIntent, flagsMask, flagsValues, extraFlags);
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
@Deprecated
|
||||
public void startIntentSenderForResult(IntentSender intent, int requestCode, Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags, Bundle options) throws IntentSender.SendIntentException {
|
||||
super.startIntentSenderForResult(intent, requestCode, fillInIntent, flagsMask, flagsValues, extraFlags, options);
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
@Deprecated
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
if (!this.mActivityResultRegistry.dispatchResult(requestCode, resultCode, data)) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
@Deprecated
|
||||
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
|
||||
if (!this.mActivityResultRegistry.dispatchResult(requestCode, -1, new Intent().putExtra(ActivityResultContracts.RequestMultiplePermissions.EXTRA_PERMISSIONS, permissions).putExtra(ActivityResultContracts.RequestMultiplePermissions.EXTRA_PERMISSION_GRANT_RESULTS, grantResults)) && Build.VERSION.SDK_INT >= 23) {
|
||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.activity.result.ActivityResultCaller
|
||||
public final <I, O> ActivityResultLauncher<I> registerForActivityResult(ActivityResultContract<I, O> contract, ActivityResultRegistry registry, ActivityResultCallback<O> callback) {
|
||||
return registry.register("activity_rq#" + this.mNextLocalRequestCode.getAndIncrement(), this, contract, callback);
|
||||
}
|
||||
|
||||
@Override // androidx.activity.result.ActivityResultCaller
|
||||
public final <I, O> ActivityResultLauncher<I> registerForActivityResult(ActivityResultContract<I, O> contract, ActivityResultCallback<O> callback) {
|
||||
return registerForActivityResult(contract, this.mActivityResultRegistry, callback);
|
||||
}
|
||||
|
||||
@Override // androidx.activity.result.ActivityResultRegistryOwner
|
||||
public final ActivityResultRegistry getActivityResultRegistry() {
|
||||
return this.mActivityResultRegistry;
|
||||
}
|
||||
|
||||
@Override // android.app.Activity
|
||||
public void reportFullyDrawn() {
|
||||
try {
|
||||
if (Trace.isEnabled()) {
|
||||
Trace.beginSection("reportFullyDrawn() for " + getComponentName());
|
||||
}
|
||||
if (Build.VERSION.SDK_INT > 19) {
|
||||
super.reportFullyDrawn();
|
||||
} else if (Build.VERSION.SDK_INT == 19 && ContextCompat.checkSelfPermission(this, "android.permission.UPDATE_DEVICE_STATS") == 0) {
|
||||
super.reportFullyDrawn();
|
||||
}
|
||||
} finally {
|
||||
Trace.endSection();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
package androidx.activity;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.view.View;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
import androidx.lifecycle.LifecycleEventObserver;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class ImmLeaksCleaner implements LifecycleEventObserver {
|
||||
private static final int INIT_FAILED = 2;
|
||||
private static final int INIT_SUCCESS = 1;
|
||||
private static final int NOT_INITIALIAZED = 0;
|
||||
private static Field sHField;
|
||||
private static Field sNextServedViewField;
|
||||
private static int sReflectedFieldsInitialized = 0;
|
||||
private static Field sServedViewField;
|
||||
private Activity mActivity;
|
||||
|
||||
ImmLeaksCleaner(Activity activity) {
|
||||
this.mActivity = activity;
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.LifecycleEventObserver
|
||||
public void onStateChanged(LifecycleOwner source, Lifecycle.Event event) {
|
||||
if (event != Lifecycle.Event.ON_DESTROY) {
|
||||
return;
|
||||
}
|
||||
if (sReflectedFieldsInitialized == 0) {
|
||||
initializeReflectiveFields();
|
||||
}
|
||||
if (sReflectedFieldsInitialized == 1) {
|
||||
InputMethodManager inputMethodManager = (InputMethodManager) this.mActivity.getSystemService("input_method");
|
||||
try {
|
||||
Object lock = sHField.get(inputMethodManager);
|
||||
if (lock == null) {
|
||||
return;
|
||||
}
|
||||
synchronized (lock) {
|
||||
try {
|
||||
try {
|
||||
View servedView = (View) sServedViewField.get(inputMethodManager);
|
||||
if (servedView == null) {
|
||||
return;
|
||||
}
|
||||
if (servedView.isAttachedToWindow()) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
sNextServedViewField.set(inputMethodManager, null);
|
||||
inputMethodManager.isActive();
|
||||
} catch (IllegalAccessException e) {
|
||||
}
|
||||
} catch (ClassCastException e2) {
|
||||
} catch (IllegalAccessException e3) {
|
||||
}
|
||||
} catch (Throwable th) {
|
||||
throw th;
|
||||
}
|
||||
}
|
||||
} catch (IllegalAccessException e4) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void initializeReflectiveFields() {
|
||||
try {
|
||||
sReflectedFieldsInitialized = 2;
|
||||
Field declaredField = InputMethodManager.class.getDeclaredField("mServedView");
|
||||
sServedViewField = declaredField;
|
||||
declaredField.setAccessible(true);
|
||||
Field declaredField2 = InputMethodManager.class.getDeclaredField("mNextServedView");
|
||||
sNextServedViewField = declaredField2;
|
||||
declaredField2.setAccessible(true);
|
||||
Field declaredField3 = InputMethodManager.class.getDeclaredField("mH");
|
||||
sHField = declaredField3;
|
||||
declaredField3.setAccessible(true);
|
||||
sReflectedFieldsInitialized = 1;
|
||||
} catch (NoSuchFieldException e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package androidx.activity;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class OnBackPressedCallback {
|
||||
private CopyOnWriteArrayList<Cancellable> mCancellables = new CopyOnWriteArrayList<>();
|
||||
private boolean mEnabled;
|
||||
|
||||
public abstract void handleOnBackPressed();
|
||||
|
||||
public OnBackPressedCallback(boolean enabled) {
|
||||
this.mEnabled = enabled;
|
||||
}
|
||||
|
||||
public final void setEnabled(boolean enabled) {
|
||||
this.mEnabled = enabled;
|
||||
}
|
||||
|
||||
public final boolean isEnabled() {
|
||||
return this.mEnabled;
|
||||
}
|
||||
|
||||
public final void remove() {
|
||||
Iterator<Cancellable> it = this.mCancellables.iterator();
|
||||
while (it.hasNext()) {
|
||||
Cancellable cancellable = it.next();
|
||||
cancellable.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
void addCancellable(Cancellable cancellable) {
|
||||
this.mCancellables.add(cancellable);
|
||||
}
|
||||
|
||||
void removeCancellable(Cancellable cancellable) {
|
||||
this.mCancellables.remove(cancellable);
|
||||
}
|
||||
}
|
||||
+122
@@ -0,0 +1,122 @@
|
||||
package androidx.activity;
|
||||
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
import androidx.lifecycle.LifecycleEventObserver;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
import java.util.ArrayDeque;
|
||||
import java.util.Iterator;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class OnBackPressedDispatcher {
|
||||
private final Runnable mFallbackOnBackPressed;
|
||||
final ArrayDeque<OnBackPressedCallback> mOnBackPressedCallbacks;
|
||||
|
||||
public OnBackPressedDispatcher() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public OnBackPressedDispatcher(Runnable fallbackOnBackPressed) {
|
||||
this.mOnBackPressedCallbacks = new ArrayDeque<>();
|
||||
this.mFallbackOnBackPressed = fallbackOnBackPressed;
|
||||
}
|
||||
|
||||
public void addCallback(OnBackPressedCallback onBackPressedCallback) {
|
||||
addCancellableCallback(onBackPressedCallback);
|
||||
}
|
||||
|
||||
Cancellable addCancellableCallback(OnBackPressedCallback onBackPressedCallback) {
|
||||
this.mOnBackPressedCallbacks.add(onBackPressedCallback);
|
||||
OnBackPressedCancellable cancellable = new OnBackPressedCancellable(onBackPressedCallback);
|
||||
onBackPressedCallback.addCancellable(cancellable);
|
||||
return cancellable;
|
||||
}
|
||||
|
||||
public void addCallback(LifecycleOwner owner, OnBackPressedCallback onBackPressedCallback) {
|
||||
Lifecycle lifecycle = owner.getLifecycle();
|
||||
if (lifecycle.getCurrentState() == Lifecycle.State.DESTROYED) {
|
||||
return;
|
||||
}
|
||||
onBackPressedCallback.addCancellable(new LifecycleOnBackPressedCancellable(lifecycle, onBackPressedCallback));
|
||||
}
|
||||
|
||||
public boolean hasEnabledCallbacks() {
|
||||
Iterator<OnBackPressedCallback> iterator = this.mOnBackPressedCallbacks.descendingIterator();
|
||||
while (iterator.hasNext()) {
|
||||
if (iterator.next().isEnabled()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void onBackPressed() {
|
||||
Iterator<OnBackPressedCallback> iterator = this.mOnBackPressedCallbacks.descendingIterator();
|
||||
while (iterator.hasNext()) {
|
||||
OnBackPressedCallback callback = iterator.next();
|
||||
if (callback.isEnabled()) {
|
||||
callback.handleOnBackPressed();
|
||||
return;
|
||||
}
|
||||
}
|
||||
Runnable runnable = this.mFallbackOnBackPressed;
|
||||
if (runnable != null) {
|
||||
runnable.run();
|
||||
}
|
||||
}
|
||||
|
||||
private class OnBackPressedCancellable implements Cancellable {
|
||||
private final OnBackPressedCallback mOnBackPressedCallback;
|
||||
|
||||
OnBackPressedCancellable(OnBackPressedCallback onBackPressedCallback) {
|
||||
this.mOnBackPressedCallback = onBackPressedCallback;
|
||||
}
|
||||
|
||||
@Override // androidx.activity.Cancellable
|
||||
public void cancel() {
|
||||
OnBackPressedDispatcher.this.mOnBackPressedCallbacks.remove(this.mOnBackPressedCallback);
|
||||
this.mOnBackPressedCallback.removeCancellable(this);
|
||||
}
|
||||
}
|
||||
|
||||
private class LifecycleOnBackPressedCancellable implements LifecycleEventObserver, Cancellable {
|
||||
private Cancellable mCurrentCancellable;
|
||||
private final Lifecycle mLifecycle;
|
||||
private final OnBackPressedCallback mOnBackPressedCallback;
|
||||
|
||||
LifecycleOnBackPressedCancellable(Lifecycle lifecycle, OnBackPressedCallback onBackPressedCallback) {
|
||||
this.mLifecycle = lifecycle;
|
||||
this.mOnBackPressedCallback = onBackPressedCallback;
|
||||
lifecycle.addObserver(this);
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.LifecycleEventObserver
|
||||
public void onStateChanged(LifecycleOwner source, Lifecycle.Event event) {
|
||||
if (event == Lifecycle.Event.ON_START) {
|
||||
this.mCurrentCancellable = OnBackPressedDispatcher.this.addCancellableCallback(this.mOnBackPressedCallback);
|
||||
return;
|
||||
}
|
||||
if (event == Lifecycle.Event.ON_STOP) {
|
||||
Cancellable cancellable = this.mCurrentCancellable;
|
||||
if (cancellable != null) {
|
||||
cancellable.cancel();
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (event == Lifecycle.Event.ON_DESTROY) {
|
||||
cancel();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.activity.Cancellable
|
||||
public void cancel() {
|
||||
this.mLifecycle.removeObserver(this);
|
||||
this.mOnBackPressedCallback.removeCancellable(this);
|
||||
Cancellable cancellable = this.mCurrentCancellable;
|
||||
if (cancellable != null) {
|
||||
cancellable.cancel();
|
||||
this.mCurrentCancellable = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package androidx.activity;
|
||||
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface OnBackPressedDispatcherOwner extends LifecycleOwner {
|
||||
OnBackPressedDispatcher getOnBackPressedDispatcher();
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package androidx.activity.contextaware;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface ContextAware {
|
||||
void addOnContextAvailableListener(OnContextAvailableListener onContextAvailableListener);
|
||||
|
||||
Context peekAvailableContext();
|
||||
|
||||
void removeOnContextAvailableListener(OnContextAvailableListener onContextAvailableListener);
|
||||
}
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
package androidx.activity.contextaware;
|
||||
|
||||
import android.content.Context;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.CopyOnWriteArraySet;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class ContextAwareHelper {
|
||||
private volatile Context mContext;
|
||||
private final Set<OnContextAvailableListener> mListeners = new CopyOnWriteArraySet();
|
||||
|
||||
public Context peekAvailableContext() {
|
||||
return this.mContext;
|
||||
}
|
||||
|
||||
public void addOnContextAvailableListener(OnContextAvailableListener listener) {
|
||||
if (this.mContext != null) {
|
||||
listener.onContextAvailable(this.mContext);
|
||||
}
|
||||
this.mListeners.add(listener);
|
||||
}
|
||||
|
||||
public void removeOnContextAvailableListener(OnContextAvailableListener listener) {
|
||||
this.mListeners.remove(listener);
|
||||
}
|
||||
|
||||
public void dispatchOnContextAvailable(Context context) {
|
||||
this.mContext = context;
|
||||
for (OnContextAvailableListener listener : this.mListeners) {
|
||||
listener.onContextAvailable(context);
|
||||
}
|
||||
}
|
||||
|
||||
public void clearAvailableContext() {
|
||||
this.mContext = null;
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package androidx.activity.contextaware;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface OnContextAvailableListener {
|
||||
void onContextAvailable(Context context);
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package androidx.activity.result;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class ActivityResult implements Parcelable {
|
||||
public static final Parcelable.Creator<ActivityResult> CREATOR = new Parcelable.Creator<ActivityResult>() { // from class: androidx.activity.result.ActivityResult.1
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public ActivityResult createFromParcel(Parcel in) {
|
||||
return new ActivityResult(in);
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public ActivityResult[] newArray(int size) {
|
||||
return new ActivityResult[size];
|
||||
}
|
||||
};
|
||||
private final Intent mData;
|
||||
private final int mResultCode;
|
||||
|
||||
public ActivityResult(int resultCode, Intent data) {
|
||||
this.mResultCode = resultCode;
|
||||
this.mData = data;
|
||||
}
|
||||
|
||||
ActivityResult(Parcel in) {
|
||||
this.mResultCode = in.readInt();
|
||||
this.mData = in.readInt() == 0 ? null : (Intent) Intent.CREATOR.createFromParcel(in);
|
||||
}
|
||||
|
||||
public int getResultCode() {
|
||||
return this.mResultCode;
|
||||
}
|
||||
|
||||
public Intent getData() {
|
||||
return this.mData;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "ActivityResult{resultCode=" + resultCodeToString(this.mResultCode) + ", data=" + this.mData + '}';
|
||||
}
|
||||
|
||||
public static String resultCodeToString(int resultCode) {
|
||||
switch (resultCode) {
|
||||
case -1:
|
||||
return "RESULT_OK";
|
||||
case 0:
|
||||
return "RESULT_CANCELED";
|
||||
default:
|
||||
return String.valueOf(resultCode);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeInt(this.mResultCode);
|
||||
dest.writeInt(this.mData == null ? 0 : 1);
|
||||
Intent intent = this.mData;
|
||||
if (intent != null) {
|
||||
intent.writeToParcel(dest, flags);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
package androidx.activity.result;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface ActivityResultCallback<O> {
|
||||
void onActivityResult(O o);
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
package androidx.activity.result;
|
||||
|
||||
import androidx.activity.result.contract.ActivityResultContract;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface ActivityResultCaller {
|
||||
<I, O> ActivityResultLauncher<I> registerForActivityResult(ActivityResultContract<I, O> activityResultContract, ActivityResultCallback<O> activityResultCallback);
|
||||
|
||||
<I, O> ActivityResultLauncher<I> registerForActivityResult(ActivityResultContract<I, O> activityResultContract, ActivityResultRegistry activityResultRegistry, ActivityResultCallback<O> activityResultCallback);
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package androidx.activity.result;
|
||||
|
||||
import androidx.activity.result.contract.ActivityResultContract;
|
||||
import androidx.core.app.ActivityOptionsCompat;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class ActivityResultLauncher<I> {
|
||||
public abstract ActivityResultContract<I, ?> getContract();
|
||||
|
||||
public abstract void launch(I i, ActivityOptionsCompat activityOptionsCompat);
|
||||
|
||||
public abstract void unregister();
|
||||
|
||||
public void launch(I input) {
|
||||
launch(input, null);
|
||||
}
|
||||
}
|
||||
+277
@@ -0,0 +1,277 @@
|
||||
package androidx.activity.result;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import androidx.activity.result.contract.ActivityResultContract;
|
||||
import androidx.core.app.ActivityOptionsCompat;
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
import androidx.lifecycle.LifecycleEventObserver;
|
||||
import androidx.lifecycle.LifecycleOwner;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class ActivityResultRegistry {
|
||||
private static final int INITIAL_REQUEST_CODE_VALUE = 65536;
|
||||
private static final String KEY_COMPONENT_ACTIVITY_LAUNCHED_KEYS = "KEY_COMPONENT_ACTIVITY_LAUNCHED_KEYS";
|
||||
private static final String KEY_COMPONENT_ACTIVITY_PENDING_RESULTS = "KEY_COMPONENT_ACTIVITY_PENDING_RESULT";
|
||||
private static final String KEY_COMPONENT_ACTIVITY_RANDOM_OBJECT = "KEY_COMPONENT_ACTIVITY_RANDOM_OBJECT";
|
||||
private static final String KEY_COMPONENT_ACTIVITY_REGISTERED_KEYS = "KEY_COMPONENT_ACTIVITY_REGISTERED_KEYS";
|
||||
private static final String KEY_COMPONENT_ACTIVITY_REGISTERED_RCS = "KEY_COMPONENT_ACTIVITY_REGISTERED_RCS";
|
||||
private static final String LOG_TAG = "ActivityResultRegistry";
|
||||
private Random mRandom = new Random();
|
||||
private final Map<Integer, String> mRcToKey = new HashMap();
|
||||
final Map<String, Integer> mKeyToRc = new HashMap();
|
||||
private final Map<String, LifecycleContainer> mKeyToLifecycleContainers = new HashMap();
|
||||
ArrayList<String> mLaunchedKeys = new ArrayList<>();
|
||||
final transient Map<String, CallbackAndContract<?>> mKeyToCallback = new HashMap();
|
||||
final Map<String, Object> mParsedPendingResults = new HashMap();
|
||||
final Bundle mPendingResults = new Bundle();
|
||||
|
||||
public abstract <I, O> void onLaunch(int i, ActivityResultContract<I, O> activityResultContract, I i2, ActivityOptionsCompat activityOptionsCompat);
|
||||
|
||||
public final <I, O> ActivityResultLauncher<I> register(final String key, LifecycleOwner lifecycleOwner, final ActivityResultContract<I, O> contract, final ActivityResultCallback<O> callback) {
|
||||
Lifecycle lifecycle = lifecycleOwner.getLifecycle();
|
||||
if (lifecycle.getCurrentState().isAtLeast(Lifecycle.State.STARTED)) {
|
||||
throw new IllegalStateException("LifecycleOwner " + lifecycleOwner + " is attempting to register while current state is " + lifecycle.getCurrentState() + ". LifecycleOwners must call register before they are STARTED.");
|
||||
}
|
||||
final int requestCode = registerKey(key);
|
||||
LifecycleContainer lifecycleContainer = this.mKeyToLifecycleContainers.get(key);
|
||||
if (lifecycleContainer == null) {
|
||||
lifecycleContainer = new LifecycleContainer(lifecycle);
|
||||
}
|
||||
LifecycleEventObserver observer = new LifecycleEventObserver() { // from class: androidx.activity.result.ActivityResultRegistry.1
|
||||
@Override // androidx.lifecycle.LifecycleEventObserver
|
||||
public void onStateChanged(LifecycleOwner lifecycleOwner2, Lifecycle.Event event) {
|
||||
if (!Lifecycle.Event.ON_START.equals(event)) {
|
||||
if (Lifecycle.Event.ON_STOP.equals(event)) {
|
||||
ActivityResultRegistry.this.mKeyToCallback.remove(key);
|
||||
return;
|
||||
} else {
|
||||
if (Lifecycle.Event.ON_DESTROY.equals(event)) {
|
||||
ActivityResultRegistry.this.unregister(key);
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
ActivityResultRegistry.this.mKeyToCallback.put(key, new CallbackAndContract<>(callback, contract));
|
||||
if (ActivityResultRegistry.this.mParsedPendingResults.containsKey(key)) {
|
||||
Object obj = ActivityResultRegistry.this.mParsedPendingResults.get(key);
|
||||
ActivityResultRegistry.this.mParsedPendingResults.remove(key);
|
||||
callback.onActivityResult(obj);
|
||||
}
|
||||
ActivityResult pendingResult = (ActivityResult) ActivityResultRegistry.this.mPendingResults.getParcelable(key);
|
||||
if (pendingResult != null) {
|
||||
ActivityResultRegistry.this.mPendingResults.remove(key);
|
||||
callback.onActivityResult(contract.parseResult(pendingResult.getResultCode(), pendingResult.getData()));
|
||||
}
|
||||
}
|
||||
};
|
||||
lifecycleContainer.addObserver(observer);
|
||||
this.mKeyToLifecycleContainers.put(key, lifecycleContainer);
|
||||
return new ActivityResultLauncher<I>() { // from class: androidx.activity.result.ActivityResultRegistry.2
|
||||
@Override // androidx.activity.result.ActivityResultLauncher
|
||||
public void launch(I input, ActivityOptionsCompat options) {
|
||||
ActivityResultRegistry.this.mLaunchedKeys.add(key);
|
||||
Integer innerCode = ActivityResultRegistry.this.mKeyToRc.get(key);
|
||||
ActivityResultRegistry.this.onLaunch(innerCode != null ? innerCode.intValue() : requestCode, contract, input, options);
|
||||
}
|
||||
|
||||
@Override // androidx.activity.result.ActivityResultLauncher
|
||||
public void unregister() {
|
||||
ActivityResultRegistry.this.unregister(key);
|
||||
}
|
||||
|
||||
@Override // androidx.activity.result.ActivityResultLauncher
|
||||
public ActivityResultContract<I, ?> getContract() {
|
||||
return contract;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public final <I, O> ActivityResultLauncher<I> register(final String key, final ActivityResultContract<I, O> contract, ActivityResultCallback<O> activityResultCallback) {
|
||||
final int requestCode = registerKey(key);
|
||||
this.mKeyToCallback.put(key, new CallbackAndContract<>(activityResultCallback, contract));
|
||||
if (this.mParsedPendingResults.containsKey(key)) {
|
||||
Object obj = this.mParsedPendingResults.get(key);
|
||||
this.mParsedPendingResults.remove(key);
|
||||
activityResultCallback.onActivityResult(obj);
|
||||
}
|
||||
ActivityResult pendingResult = (ActivityResult) this.mPendingResults.getParcelable(key);
|
||||
if (pendingResult != null) {
|
||||
this.mPendingResults.remove(key);
|
||||
activityResultCallback.onActivityResult(contract.parseResult(pendingResult.getResultCode(), pendingResult.getData()));
|
||||
}
|
||||
return new ActivityResultLauncher<I>() { // from class: androidx.activity.result.ActivityResultRegistry.3
|
||||
@Override // androidx.activity.result.ActivityResultLauncher
|
||||
public void launch(I input, ActivityOptionsCompat options) {
|
||||
ActivityResultRegistry.this.mLaunchedKeys.add(key);
|
||||
Integer innerCode = ActivityResultRegistry.this.mKeyToRc.get(key);
|
||||
ActivityResultRegistry.this.onLaunch(innerCode != null ? innerCode.intValue() : requestCode, contract, input, options);
|
||||
}
|
||||
|
||||
@Override // androidx.activity.result.ActivityResultLauncher
|
||||
public void unregister() {
|
||||
ActivityResultRegistry.this.unregister(key);
|
||||
}
|
||||
|
||||
@Override // androidx.activity.result.ActivityResultLauncher
|
||||
public ActivityResultContract<I, ?> getContract() {
|
||||
return contract;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
final void unregister(String key) {
|
||||
Integer rc;
|
||||
if (!this.mLaunchedKeys.contains(key) && (rc = this.mKeyToRc.remove(key)) != null) {
|
||||
this.mRcToKey.remove(rc);
|
||||
}
|
||||
this.mKeyToCallback.remove(key);
|
||||
if (this.mParsedPendingResults.containsKey(key)) {
|
||||
Log.w(LOG_TAG, "Dropping pending result for request " + key + ": " + this.mParsedPendingResults.get(key));
|
||||
this.mParsedPendingResults.remove(key);
|
||||
}
|
||||
if (this.mPendingResults.containsKey(key)) {
|
||||
Log.w(LOG_TAG, "Dropping pending result for request " + key + ": " + this.mPendingResults.getParcelable(key));
|
||||
this.mPendingResults.remove(key);
|
||||
}
|
||||
LifecycleContainer lifecycleContainer = this.mKeyToLifecycleContainers.get(key);
|
||||
if (lifecycleContainer != null) {
|
||||
lifecycleContainer.clearObservers();
|
||||
this.mKeyToLifecycleContainers.remove(key);
|
||||
}
|
||||
}
|
||||
|
||||
public final void onSaveInstanceState(Bundle outState) {
|
||||
outState.putIntegerArrayList(KEY_COMPONENT_ACTIVITY_REGISTERED_RCS, new ArrayList<>(this.mKeyToRc.values()));
|
||||
outState.putStringArrayList(KEY_COMPONENT_ACTIVITY_REGISTERED_KEYS, new ArrayList<>(this.mKeyToRc.keySet()));
|
||||
outState.putStringArrayList(KEY_COMPONENT_ACTIVITY_LAUNCHED_KEYS, new ArrayList<>(this.mLaunchedKeys));
|
||||
outState.putBundle(KEY_COMPONENT_ACTIVITY_PENDING_RESULTS, (Bundle) this.mPendingResults.clone());
|
||||
outState.putSerializable(KEY_COMPONENT_ACTIVITY_RANDOM_OBJECT, this.mRandom);
|
||||
}
|
||||
|
||||
public final void onRestoreInstanceState(Bundle savedInstanceState) {
|
||||
if (savedInstanceState == null) {
|
||||
return;
|
||||
}
|
||||
ArrayList<Integer> rcs = savedInstanceState.getIntegerArrayList(KEY_COMPONENT_ACTIVITY_REGISTERED_RCS);
|
||||
ArrayList<String> keys = savedInstanceState.getStringArrayList(KEY_COMPONENT_ACTIVITY_REGISTERED_KEYS);
|
||||
if (keys == null || rcs == null) {
|
||||
return;
|
||||
}
|
||||
this.mLaunchedKeys = savedInstanceState.getStringArrayList(KEY_COMPONENT_ACTIVITY_LAUNCHED_KEYS);
|
||||
this.mRandom = (Random) savedInstanceState.getSerializable(KEY_COMPONENT_ACTIVITY_RANDOM_OBJECT);
|
||||
this.mPendingResults.putAll(savedInstanceState.getBundle(KEY_COMPONENT_ACTIVITY_PENDING_RESULTS));
|
||||
for (int i = 0; i < keys.size(); i++) {
|
||||
String key = keys.get(i);
|
||||
if (this.mKeyToRc.containsKey(key)) {
|
||||
Integer newRequestCode = this.mKeyToRc.remove(key);
|
||||
if (!this.mPendingResults.containsKey(key)) {
|
||||
this.mRcToKey.remove(newRequestCode);
|
||||
}
|
||||
}
|
||||
Integer newRequestCode2 = rcs.get(i);
|
||||
bindRcKey(newRequestCode2.intValue(), keys.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
public final boolean dispatchResult(int requestCode, int resultCode, Intent data) {
|
||||
String key = this.mRcToKey.get(Integer.valueOf(requestCode));
|
||||
if (key == null) {
|
||||
return false;
|
||||
}
|
||||
this.mLaunchedKeys.remove(key);
|
||||
doDispatch(key, resultCode, data, this.mKeyToCallback.get(key));
|
||||
return true;
|
||||
}
|
||||
|
||||
public final <O> boolean dispatchResult(int requestCode, O result) {
|
||||
String key = this.mRcToKey.get(Integer.valueOf(requestCode));
|
||||
if (key == null) {
|
||||
return false;
|
||||
}
|
||||
this.mLaunchedKeys.remove(key);
|
||||
CallbackAndContract<?> callbackAndContract = this.mKeyToCallback.get(key);
|
||||
if (callbackAndContract == null || callbackAndContract.mCallback == null) {
|
||||
this.mPendingResults.remove(key);
|
||||
this.mParsedPendingResults.put(key, result);
|
||||
return true;
|
||||
}
|
||||
callbackAndContract.mCallback.onActivityResult(result);
|
||||
return true;
|
||||
}
|
||||
|
||||
private <O> void doDispatch(String key, int resultCode, Intent data, CallbackAndContract<O> callbackAndContract) {
|
||||
if (callbackAndContract != null && callbackAndContract.mCallback != null) {
|
||||
ActivityResultCallback<O> callback = callbackAndContract.mCallback;
|
||||
ActivityResultContract<?, O> contract = callbackAndContract.mContract;
|
||||
callback.onActivityResult(contract.parseResult(resultCode, data));
|
||||
} else {
|
||||
this.mParsedPendingResults.remove(key);
|
||||
this.mPendingResults.putParcelable(key, new ActivityResult(resultCode, data));
|
||||
}
|
||||
}
|
||||
|
||||
private int registerKey(String key) {
|
||||
Integer existing = this.mKeyToRc.get(key);
|
||||
if (existing != null) {
|
||||
return existing.intValue();
|
||||
}
|
||||
int rc = generateRandomNumber();
|
||||
bindRcKey(rc, key);
|
||||
return rc;
|
||||
}
|
||||
|
||||
private int generateRandomNumber() {
|
||||
int number = this.mRandom.nextInt(2147418112) + 65536;
|
||||
while (this.mRcToKey.containsKey(Integer.valueOf(number))) {
|
||||
number = this.mRandom.nextInt(2147418112) + 65536;
|
||||
}
|
||||
return number;
|
||||
}
|
||||
|
||||
private void bindRcKey(int rc, String key) {
|
||||
this.mRcToKey.put(Integer.valueOf(rc), key);
|
||||
this.mKeyToRc.put(key, Integer.valueOf(rc));
|
||||
}
|
||||
|
||||
private static class CallbackAndContract<O> {
|
||||
final ActivityResultCallback<O> mCallback;
|
||||
final ActivityResultContract<?, O> mContract;
|
||||
|
||||
CallbackAndContract(ActivityResultCallback<O> callback, ActivityResultContract<?, O> contract) {
|
||||
this.mCallback = callback;
|
||||
this.mContract = contract;
|
||||
}
|
||||
}
|
||||
|
||||
private static class LifecycleContainer {
|
||||
final Lifecycle mLifecycle;
|
||||
private final ArrayList<LifecycleEventObserver> mObservers = new ArrayList<>();
|
||||
|
||||
LifecycleContainer(Lifecycle lifecycle) {
|
||||
this.mLifecycle = lifecycle;
|
||||
}
|
||||
|
||||
void addObserver(LifecycleEventObserver observer) {
|
||||
this.mLifecycle.addObserver(observer);
|
||||
this.mObservers.add(observer);
|
||||
}
|
||||
|
||||
void clearObservers() {
|
||||
Iterator<LifecycleEventObserver> it = this.mObservers.iterator();
|
||||
while (it.hasNext()) {
|
||||
LifecycleEventObserver observer = it.next();
|
||||
this.mLifecycle.removeObserver(observer);
|
||||
}
|
||||
this.mObservers.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
package androidx.activity.result;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface ActivityResultRegistryOwner {
|
||||
ActivityResultRegistry getActivityResultRegistry();
|
||||
}
|
||||
+101
@@ -0,0 +1,101 @@
|
||||
package androidx.activity.result;
|
||||
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentSender;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class IntentSenderRequest implements Parcelable {
|
||||
public static final Parcelable.Creator<IntentSenderRequest> CREATOR = new Parcelable.Creator<IntentSenderRequest>() { // from class: androidx.activity.result.IntentSenderRequest.1
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public IntentSenderRequest createFromParcel(Parcel in) {
|
||||
return new IntentSenderRequest(in);
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public IntentSenderRequest[] newArray(int size) {
|
||||
return new IntentSenderRequest[size];
|
||||
}
|
||||
};
|
||||
private final Intent mFillInIntent;
|
||||
private final int mFlagsMask;
|
||||
private final int mFlagsValues;
|
||||
private final IntentSender mIntentSender;
|
||||
|
||||
IntentSenderRequest(IntentSender intentSender, Intent intent, int flagsMask, int flagsValues) {
|
||||
this.mIntentSender = intentSender;
|
||||
this.mFillInIntent = intent;
|
||||
this.mFlagsMask = flagsMask;
|
||||
this.mFlagsValues = flagsValues;
|
||||
}
|
||||
|
||||
public IntentSender getIntentSender() {
|
||||
return this.mIntentSender;
|
||||
}
|
||||
|
||||
public Intent getFillInIntent() {
|
||||
return this.mFillInIntent;
|
||||
}
|
||||
|
||||
public int getFlagsMask() {
|
||||
return this.mFlagsMask;
|
||||
}
|
||||
|
||||
public int getFlagsValues() {
|
||||
return this.mFlagsValues;
|
||||
}
|
||||
|
||||
IntentSenderRequest(Parcel in) {
|
||||
this.mIntentSender = (IntentSender) in.readParcelable(IntentSender.class.getClassLoader());
|
||||
this.mFillInIntent = (Intent) in.readParcelable(Intent.class.getClassLoader());
|
||||
this.mFlagsMask = in.readInt();
|
||||
this.mFlagsValues = in.readInt();
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeParcelable(this.mIntentSender, flags);
|
||||
dest.writeParcelable(this.mFillInIntent, flags);
|
||||
dest.writeInt(this.mFlagsMask);
|
||||
dest.writeInt(this.mFlagsValues);
|
||||
}
|
||||
|
||||
public static final class Builder {
|
||||
private Intent mFillInIntent;
|
||||
private int mFlagsMask;
|
||||
private int mFlagsValues;
|
||||
private IntentSender mIntentSender;
|
||||
|
||||
public Builder(IntentSender intentSender) {
|
||||
this.mIntentSender = intentSender;
|
||||
}
|
||||
|
||||
public Builder(PendingIntent pendingIntent) {
|
||||
this(pendingIntent.getIntentSender());
|
||||
}
|
||||
|
||||
public Builder setFillInIntent(Intent fillInIntent) {
|
||||
this.mFillInIntent = fillInIntent;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setFlags(int values, int mask) {
|
||||
this.mFlagsValues = values;
|
||||
this.mFlagsMask = mask;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IntentSenderRequest build() {
|
||||
return new IntentSenderRequest(this.mIntentSender, this.mFillInIntent, this.mFlagsMask, this.mFlagsValues);
|
||||
}
|
||||
}
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
package androidx.activity.result.contract;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class ActivityResultContract<I, O> {
|
||||
public abstract Intent createIntent(Context context, I i);
|
||||
|
||||
public abstract O parseResult(int i, Intent intent);
|
||||
|
||||
public SynchronousResult<O> getSynchronousResult(Context context, I input) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static final class SynchronousResult<T> {
|
||||
private final T mValue;
|
||||
|
||||
public SynchronousResult(T value) {
|
||||
this.mValue = value;
|
||||
}
|
||||
|
||||
public T getValue() {
|
||||
return this.mValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
+362
@@ -0,0 +1,362 @@
|
||||
package androidx.activity.result.contract;
|
||||
|
||||
import android.content.ClipData;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import androidx.activity.result.ActivityResult;
|
||||
import androidx.activity.result.IntentSenderRequest;
|
||||
import androidx.activity.result.contract.ActivityResultContract;
|
||||
import androidx.collection.ArrayMap;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class ActivityResultContracts {
|
||||
private ActivityResultContracts() {
|
||||
}
|
||||
|
||||
public static final class StartActivityForResult extends ActivityResultContract<Intent, ActivityResult> {
|
||||
public static final String EXTRA_ACTIVITY_OPTIONS_BUNDLE = "androidx.activity.result.contract.extra.ACTIVITY_OPTIONS_BUNDLE";
|
||||
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public Intent createIntent(Context context, Intent input) {
|
||||
return input;
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public ActivityResult parseResult(int resultCode, Intent intent) {
|
||||
return new ActivityResult(resultCode, intent);
|
||||
}
|
||||
}
|
||||
|
||||
public static final class StartIntentSenderForResult extends ActivityResultContract<IntentSenderRequest, ActivityResult> {
|
||||
public static final String ACTION_INTENT_SENDER_REQUEST = "androidx.activity.result.contract.action.INTENT_SENDER_REQUEST";
|
||||
public static final String EXTRA_INTENT_SENDER_REQUEST = "androidx.activity.result.contract.extra.INTENT_SENDER_REQUEST";
|
||||
public static final String EXTRA_SEND_INTENT_EXCEPTION = "androidx.activity.result.contract.extra.SEND_INTENT_EXCEPTION";
|
||||
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public Intent createIntent(Context context, IntentSenderRequest input) {
|
||||
return new Intent(ACTION_INTENT_SENDER_REQUEST).putExtra(EXTRA_INTENT_SENDER_REQUEST, input);
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public ActivityResult parseResult(int resultCode, Intent intent) {
|
||||
return new ActivityResult(resultCode, intent);
|
||||
}
|
||||
}
|
||||
|
||||
public static final class RequestMultiplePermissions extends ActivityResultContract<String[], Map<String, Boolean>> {
|
||||
public static final String ACTION_REQUEST_PERMISSIONS = "androidx.activity.result.contract.action.REQUEST_PERMISSIONS";
|
||||
public static final String EXTRA_PERMISSIONS = "androidx.activity.result.contract.extra.PERMISSIONS";
|
||||
public static final String EXTRA_PERMISSION_GRANT_RESULTS = "androidx.activity.result.contract.extra.PERMISSION_GRANT_RESULTS";
|
||||
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public Intent createIntent(Context context, String[] input) {
|
||||
return createIntent(input);
|
||||
}
|
||||
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public ActivityResultContract.SynchronousResult<Map<String, Boolean>> getSynchronousResult(Context context, String[] input) {
|
||||
if (input == null || input.length == 0) {
|
||||
return new ActivityResultContract.SynchronousResult<>(Collections.emptyMap());
|
||||
}
|
||||
Map<String, Boolean> grantState = new ArrayMap<>();
|
||||
boolean allGranted = true;
|
||||
for (String permission : input) {
|
||||
boolean granted = ContextCompat.checkSelfPermission(context, permission) == 0;
|
||||
grantState.put(permission, Boolean.valueOf(granted));
|
||||
if (!granted) {
|
||||
allGranted = false;
|
||||
}
|
||||
}
|
||||
if (allGranted) {
|
||||
return new ActivityResultContract.SynchronousResult<>(grantState);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public Map<String, Boolean> parseResult(int resultCode, Intent intent) {
|
||||
if (resultCode == -1 && intent != null) {
|
||||
String[] permissions = intent.getStringArrayExtra(EXTRA_PERMISSIONS);
|
||||
int[] grantResults = intent.getIntArrayExtra(EXTRA_PERMISSION_GRANT_RESULTS);
|
||||
if (grantResults == null || permissions == null) {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
Map<String, Boolean> result = new HashMap<>();
|
||||
int size = permissions.length;
|
||||
for (int i = 0; i < size; i++) {
|
||||
result.put(permissions[i], Boolean.valueOf(grantResults[i] == 0));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
|
||||
static Intent createIntent(String[] input) {
|
||||
return new Intent(ACTION_REQUEST_PERMISSIONS).putExtra(EXTRA_PERMISSIONS, input);
|
||||
}
|
||||
}
|
||||
|
||||
public static final class RequestPermission extends ActivityResultContract<String, Boolean> {
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public Intent createIntent(Context context, String input) {
|
||||
return RequestMultiplePermissions.createIntent(new String[]{input});
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public Boolean parseResult(int resultCode, Intent intent) {
|
||||
int[] grantResults;
|
||||
if (intent == null || resultCode != -1 || (grantResults = intent.getIntArrayExtra(RequestMultiplePermissions.EXTRA_PERMISSION_GRANT_RESULTS)) == null || grantResults.length == 0) {
|
||||
return false;
|
||||
}
|
||||
return Boolean.valueOf(grantResults[0] == 0);
|
||||
}
|
||||
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public ActivityResultContract.SynchronousResult<Boolean> getSynchronousResult(Context context, String input) {
|
||||
if (input == null) {
|
||||
return new ActivityResultContract.SynchronousResult<>(false);
|
||||
}
|
||||
if (ContextCompat.checkSelfPermission(context, input) == 0) {
|
||||
return new ActivityResultContract.SynchronousResult<>(true);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static class TakePicturePreview extends ActivityResultContract<Void, Bitmap> {
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public Intent createIntent(Context context, Void input) {
|
||||
return new Intent("android.media.action.IMAGE_CAPTURE");
|
||||
}
|
||||
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public final ActivityResultContract.SynchronousResult<Bitmap> getSynchronousResult(Context context, Void input) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public final Bitmap parseResult(int resultCode, Intent intent) {
|
||||
if (intent == null || resultCode != -1) {
|
||||
return null;
|
||||
}
|
||||
return (Bitmap) intent.getParcelableExtra("data");
|
||||
}
|
||||
}
|
||||
|
||||
public static class TakePicture extends ActivityResultContract<Uri, Boolean> {
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public Intent createIntent(Context context, Uri input) {
|
||||
return new Intent("android.media.action.IMAGE_CAPTURE").putExtra("output", input);
|
||||
}
|
||||
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public final ActivityResultContract.SynchronousResult<Boolean> getSynchronousResult(Context context, Uri input) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public final Boolean parseResult(int resultCode, Intent intent) {
|
||||
return Boolean.valueOf(resultCode == -1);
|
||||
}
|
||||
}
|
||||
|
||||
public static class TakeVideo extends ActivityResultContract<Uri, Bitmap> {
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public Intent createIntent(Context context, Uri input) {
|
||||
return new Intent("android.media.action.VIDEO_CAPTURE").putExtra("output", input);
|
||||
}
|
||||
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public final ActivityResultContract.SynchronousResult<Bitmap> getSynchronousResult(Context context, Uri input) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public final Bitmap parseResult(int resultCode, Intent intent) {
|
||||
if (intent == null || resultCode != -1) {
|
||||
return null;
|
||||
}
|
||||
return (Bitmap) intent.getParcelableExtra("data");
|
||||
}
|
||||
}
|
||||
|
||||
public static final class PickContact extends ActivityResultContract<Void, Uri> {
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public Intent createIntent(Context context, Void input) {
|
||||
return new Intent("android.intent.action.PICK").setType("vnd.android.cursor.dir/contact");
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public Uri parseResult(int resultCode, Intent intent) {
|
||||
if (intent == null || resultCode != -1) {
|
||||
return null;
|
||||
}
|
||||
return intent.getData();
|
||||
}
|
||||
}
|
||||
|
||||
public static class GetContent extends ActivityResultContract<String, Uri> {
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public Intent createIntent(Context context, String input) {
|
||||
return new Intent("android.intent.action.GET_CONTENT").addCategory("android.intent.category.OPENABLE").setType(input);
|
||||
}
|
||||
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public final ActivityResultContract.SynchronousResult<Uri> getSynchronousResult(Context context, String input) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public final Uri parseResult(int resultCode, Intent intent) {
|
||||
if (intent == null || resultCode != -1) {
|
||||
return null;
|
||||
}
|
||||
return intent.getData();
|
||||
}
|
||||
}
|
||||
|
||||
public static class GetMultipleContents extends ActivityResultContract<String, List<Uri>> {
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public Intent createIntent(Context context, String input) {
|
||||
return new Intent("android.intent.action.GET_CONTENT").addCategory("android.intent.category.OPENABLE").setType(input).putExtra("android.intent.extra.ALLOW_MULTIPLE", true);
|
||||
}
|
||||
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public final ActivityResultContract.SynchronousResult<List<Uri>> getSynchronousResult(Context context, String input) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public final List<Uri> parseResult(int resultCode, Intent intent) {
|
||||
if (intent == null || resultCode != -1) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return getClipDataUris(intent);
|
||||
}
|
||||
|
||||
static List<Uri> getClipDataUris(Intent intent) {
|
||||
LinkedHashSet<Uri> resultSet = new LinkedHashSet<>();
|
||||
if (intent.getData() != null) {
|
||||
resultSet.add(intent.getData());
|
||||
}
|
||||
ClipData clipData = intent.getClipData();
|
||||
if (clipData == null && resultSet.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
if (clipData != null) {
|
||||
for (int i = 0; i < clipData.getItemCount(); i++) {
|
||||
Uri uri = clipData.getItemAt(i).getUri();
|
||||
if (uri != null) {
|
||||
resultSet.add(uri);
|
||||
}
|
||||
}
|
||||
}
|
||||
return new ArrayList(resultSet);
|
||||
}
|
||||
}
|
||||
|
||||
public static class OpenDocument extends ActivityResultContract<String[], Uri> {
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public Intent createIntent(Context context, String[] input) {
|
||||
return new Intent("android.intent.action.OPEN_DOCUMENT").putExtra("android.intent.extra.MIME_TYPES", input).setType("*/*");
|
||||
}
|
||||
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public final ActivityResultContract.SynchronousResult<Uri> getSynchronousResult(Context context, String[] input) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public final Uri parseResult(int resultCode, Intent intent) {
|
||||
if (intent == null || resultCode != -1) {
|
||||
return null;
|
||||
}
|
||||
return intent.getData();
|
||||
}
|
||||
}
|
||||
|
||||
public static class OpenMultipleDocuments extends ActivityResultContract<String[], List<Uri>> {
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public Intent createIntent(Context context, String[] input) {
|
||||
return new Intent("android.intent.action.OPEN_DOCUMENT").putExtra("android.intent.extra.MIME_TYPES", input).putExtra("android.intent.extra.ALLOW_MULTIPLE", true).setType("*/*");
|
||||
}
|
||||
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public final ActivityResultContract.SynchronousResult<List<Uri>> getSynchronousResult(Context context, String[] input) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public final List<Uri> parseResult(int resultCode, Intent intent) {
|
||||
if (resultCode != -1 || intent == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return GetMultipleContents.getClipDataUris(intent);
|
||||
}
|
||||
}
|
||||
|
||||
public static class OpenDocumentTree extends ActivityResultContract<Uri, Uri> {
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public Intent createIntent(Context context, Uri input) {
|
||||
Intent intent = new Intent("android.intent.action.OPEN_DOCUMENT_TREE");
|
||||
if (Build.VERSION.SDK_INT >= 26 && input != null) {
|
||||
intent.putExtra("android.provider.extra.INITIAL_URI", input);
|
||||
}
|
||||
return intent;
|
||||
}
|
||||
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public final ActivityResultContract.SynchronousResult<Uri> getSynchronousResult(Context context, Uri input) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public final Uri parseResult(int resultCode, Intent intent) {
|
||||
if (intent == null || resultCode != -1) {
|
||||
return null;
|
||||
}
|
||||
return intent.getData();
|
||||
}
|
||||
}
|
||||
|
||||
public static class CreateDocument extends ActivityResultContract<String, Uri> {
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public Intent createIntent(Context context, String input) {
|
||||
return new Intent("android.intent.action.CREATE_DOCUMENT").setType("*/*").putExtra("android.intent.extra.TITLE", input);
|
||||
}
|
||||
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public final ActivityResultContract.SynchronousResult<Uri> getSynchronousResult(Context context, String input) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // androidx.activity.result.contract.ActivityResultContract
|
||||
public final Uri parseResult(int resultCode, Intent intent) {
|
||||
if (intent == null || resultCode != -1) {
|
||||
return null;
|
||||
}
|
||||
return intent.getData();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface AnimRes {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface AnimatorRes {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface AnyRes {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.TYPE, ElementType.PARAMETER})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface AnyThread {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface ArrayRes {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface AttrRes {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.TYPE, ElementType.PARAMETER})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface BinderThread {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface BoolRes {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface CallSuper {
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface CheckResult {
|
||||
String suggest() default "";
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.FIELD})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface ChecksSdkIntAtLeast {
|
||||
int api() default -1;
|
||||
|
||||
String codename() default "";
|
||||
|
||||
int lambda() default -1;
|
||||
|
||||
int parameter() default -1;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.PARAMETER, ElementType.METHOD, ElementType.LOCAL_VARIABLE, ElementType.FIELD})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface ColorInt {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.PARAMETER, ElementType.METHOD, ElementType.LOCAL_VARIABLE, ElementType.FIELD})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface ColorLong {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface ColorRes {
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.CONSTRUCTOR})
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface ContentView {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface DimenRes {
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE, ElementType.ANNOTATION_TYPE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface Dimension {
|
||||
|
||||
/* renamed from: DP */
|
||||
public static final int f0DP = 0;
|
||||
|
||||
/* renamed from: PX */
|
||||
public static final int f1PX = 1;
|
||||
|
||||
/* renamed from: SP */
|
||||
public static final int f2SP = 2;
|
||||
|
||||
int unit() default 1;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD})
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface DoNotInline {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface DrawableRes {
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE, ElementType.ANNOTATION_TYPE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface FloatRange {
|
||||
double from() default Double.NEGATIVE_INFINITY;
|
||||
|
||||
boolean fromInclusive() default true;
|
||||
|
||||
/* renamed from: to */
|
||||
double m0to() default Double.POSITIVE_INFINITY;
|
||||
|
||||
boolean toInclusive() default true;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface FontRes {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface FractionRes {
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.FIELD, ElementType.METHOD})
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface GuardedBy {
|
||||
String value();
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.PARAMETER, ElementType.METHOD, ElementType.LOCAL_VARIABLE, ElementType.FIELD})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface HalfFloat {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface IdRes {
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD})
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface InspectableProperty {
|
||||
|
||||
@Target({ElementType.TYPE})
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface EnumEntry {
|
||||
String name();
|
||||
|
||||
int value();
|
||||
}
|
||||
|
||||
@Target({ElementType.TYPE})
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface FlagEntry {
|
||||
int mask() default 0;
|
||||
|
||||
String name();
|
||||
|
||||
int target();
|
||||
}
|
||||
|
||||
public enum ValueType {
|
||||
NONE,
|
||||
INFERRED,
|
||||
INT_ENUM,
|
||||
INT_FLAG,
|
||||
COLOR,
|
||||
GRAVITY,
|
||||
RESOURCE_ID
|
||||
}
|
||||
|
||||
int attributeId() default 0;
|
||||
|
||||
EnumEntry[] enumMapping() default {};
|
||||
|
||||
FlagEntry[] flagMapping() default {};
|
||||
|
||||
boolean hasAttributeId() default true;
|
||||
|
||||
String name() default "";
|
||||
|
||||
ValueType valueType() default ValueType.INFERRED;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.ANNOTATION_TYPE})
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface IntDef {
|
||||
boolean flag() default false;
|
||||
|
||||
boolean open() default false;
|
||||
|
||||
int[] value() default {};
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE, ElementType.ANNOTATION_TYPE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface IntRange {
|
||||
long from() default Long.MIN_VALUE;
|
||||
|
||||
/* renamed from: to */
|
||||
long m1to() default Long.MAX_VALUE;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface IntegerRes {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface InterpolatorRes {
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.PACKAGE, ElementType.TYPE, ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR, ElementType.METHOD, ElementType.FIELD})
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface Keep {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface LayoutRes {
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.ANNOTATION_TYPE})
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface LongDef {
|
||||
boolean flag() default false;
|
||||
|
||||
boolean open() default false;
|
||||
|
||||
long[] value() default {};
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.TYPE, ElementType.PARAMETER})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface MainThread {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface MenuRes {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface NavigationRes {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE, ElementType.ANNOTATION_TYPE, ElementType.PACKAGE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface NonNull {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE, ElementType.ANNOTATION_TYPE, ElementType.PACKAGE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface Nullable {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface PluralsRes {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface Px {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface RawRes {
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.TYPE, ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.FIELD, ElementType.PACKAGE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface RequiresApi {
|
||||
int api() default 1;
|
||||
|
||||
int value() default 1;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD, ElementType.CONSTRUCTOR})
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface RequiresFeature {
|
||||
String enforcement();
|
||||
|
||||
String name();
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.ANNOTATION_TYPE, ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.FIELD, ElementType.PARAMETER})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface RequiresPermission {
|
||||
|
||||
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
|
||||
public @interface Read {
|
||||
RequiresPermission value() default @RequiresPermission;
|
||||
}
|
||||
|
||||
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
|
||||
public @interface Write {
|
||||
RequiresPermission value() default @RequiresPermission;
|
||||
}
|
||||
|
||||
String[] allOf() default {};
|
||||
|
||||
String[] anyOf() default {};
|
||||
|
||||
boolean conditional() default false;
|
||||
|
||||
String value() default "";
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.ANNOTATION_TYPE, ElementType.TYPE, ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.FIELD, ElementType.PACKAGE})
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface RestrictTo {
|
||||
|
||||
public enum Scope {
|
||||
LIBRARY,
|
||||
LIBRARY_GROUP,
|
||||
LIBRARY_GROUP_PREFIX,
|
||||
GROUP_ID,
|
||||
TESTS,
|
||||
SUBCLASSES
|
||||
}
|
||||
|
||||
Scope[] value();
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.PARAMETER, ElementType.LOCAL_VARIABLE, ElementType.METHOD, ElementType.FIELD, ElementType.ANNOTATION_TYPE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface Size {
|
||||
long max() default Long.MAX_VALUE;
|
||||
|
||||
long min() default Long.MIN_VALUE;
|
||||
|
||||
long multiple() default 1;
|
||||
|
||||
long value() default -1;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.ANNOTATION_TYPE})
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface StringDef {
|
||||
boolean open() default false;
|
||||
|
||||
String[] value() default {};
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface StringRes {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface StyleRes {
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package androidx.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.LOCAL_VARIABLE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
/* loaded from: classes.dex */
|
||||
public @interface StyleableRes {
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user