Source code
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.QueueItem;
import android.text.TextUtils;
import java.util.List;
public interface IMediaControllerCallback extends IInterface {
public static abstract class Stub extends Binder implements IMediaControllerCallback {
private static final String DESCRIPTOR = "android.support.v4.media.session.IMediaControllerCallback";
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_onSessionDestroyed = 2;
static final int TRANSACTION_onVolumeInfoChanged = 8;
private static class Proxy implements IMediaControllerCallback {
private IBinder mRemote;
Proxy(IBinder remote) {
this.mRemote = remote;
}
public IBinder asBinder() {
return this.mRemote;
}
public String getInterfaceDescriptor() {
return Stub.DESCRIPTOR;
}
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();
}
}
public void onSessionDestroyed() throws RemoteException {
Parcel _data = Parcel.obtain();
try {
_data.writeInterfaceToken(Stub.DESCRIPTOR);
this.mRemote.transact(2, _data, null, 1);
} finally {
_data.recycle();
}
}
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();
}
}
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();
}
}
public void onQueueChanged(List<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();
}
}
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();
}
}
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();
}
}
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();
}
}
}
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 new Proxy(obj);
}
return (IMediaControllerCallback) iin;
}
public IBinder asBinder() {
return this;
}
public boolean onTransact(int code, Parcel data, Parcel reply, int flags) throws RemoteException {
switch (code) {
case 1:
Bundle _arg1;
data.enforceInterface(DESCRIPTOR);
String _arg0 = data.readString();
if (data.readInt() != 0) {
_arg1 = (Bundle) Bundle.CREATOR.createFromParcel(data);
} else {
_arg1 = null;
}
onEvent(_arg0, _arg1);
return true;
case 2:
data.enforceInterface(DESCRIPTOR);
onSessionDestroyed();
return true;
case 3:
PlaybackStateCompat _arg02;
data.enforceInterface(DESCRIPTOR);
if (data.readInt() != 0) {
_arg02 = (PlaybackStateCompat) PlaybackStateCompat.CREATOR.createFromParcel(data);
} else {
_arg02 = null;
}
onPlaybackStateChanged(_arg02);
return true;
case 4:
MediaMetadataCompat _arg03;
data.enforceInterface(DESCRIPTOR);
if (data.readInt() != 0) {
_arg03 = (MediaMetadataCompat) MediaMetadataCompat.CREATOR.createFromParcel(data);
} else {
_arg03 = null;
}
onMetadataChanged(_arg03);
return true;
case 5:
data.enforceInterface(DESCRIPTOR);
onQueueChanged(data.createTypedArrayList(QueueItem.CREATOR));
return true;
case 6:
CharSequence _arg04;
data.enforceInterface(DESCRIPTOR);
if (data.readInt() != 0) {
_arg04 = (CharSequence) TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data);
} else {
_arg04 = null;
}
onQueueTitleChanged(_arg04);
return true;
case 7:
Bundle _arg05;
data.enforceInterface(DESCRIPTOR);
if (data.readInt() != 0) {
_arg05 = (Bundle) Bundle.CREATOR.createFromParcel(data);
} else {
_arg05 = null;
}
onExtrasChanged(_arg05);
return true;
case 8:
ParcelableVolumeInfo _arg06;
data.enforceInterface(DESCRIPTOR);
if (data.readInt() != 0) {
_arg06 = (ParcelableVolumeInfo) ParcelableVolumeInfo.CREATOR.createFromParcel(data);
} else {
_arg06 = null;
}
onVolumeInfoChanged(_arg06);
return true;
case 1598968902:
reply.writeString(DESCRIPTOR);
return true;
default:
return super.onTransact(code, data, reply, flags);
}
}
}
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<QueueItem> list) throws RemoteException;
void onQueueTitleChanged(CharSequence charSequence) throws RemoteException;
void onSessionDestroyed() throws RemoteException;
void onVolumeInfoChanged(ParcelableVolumeInfo parcelableVolumeInfo) throws RemoteException;
}