/**
* IMusicService.aidl
* com.androidtest.service.mediaplayer
*
* Function: TODO
*
* ver date author
* ──────────────────────────────────
* 2011-5-19 Leon
*
* Copyright (c) 2011, TNT All Rights Reserved.
*/
package com.androidtest.service.mediaplayer;
/**
* ClassName:IMusicService
* Function: TODO ADD FUNCTION
* Reason: TODO ADD REASON
*
* @author Leon
* @version
* @since Ver 1.1
* @Date 2011-5-19
*/
interface IMusicService{
void play();
void pause();
void stop();
}
/*
* This file is auto-generated. DO NOT MODIFY.
* Original file: D:\\Backup\\�ҵ��ĵ�\\Dropbox\\investment\\A8\\workspace\\androidtest\\src\\com\\androidtest\\service\\mediaplayer\\IMusicService.aidl
*/
package com.androidtest.service.mediaplayer;
/**
* ClassName:IMusicService Function: TODO ADD FUNCTION Reason: TODO ADD REASON
*
* @author Leon
* @version
* @since Ver 1.1
* @Date 2011-5-19
*/
public interface IMusicService extends android.os.IInterface {
/** Local-side IPC implementation stub class. */
public static abstract class Stub extends android.os.Binder implements
com.androidtest.service.mediaplayer.IMusicService {
private static final java.lang.StringDESCRIPTOR="com.androidtest.service.mediaplayer.IMusicService";
/** Construct the stub at attach it to the interface. */
public Stub() {
this.attachInterface(this, DESCRIPTOR);
}
/**
* Cast an IBinder object into an
* com.androidtest.service.mediaplayer.IMusicService interface,
* generating a proxy if needed.
*/
public static com.androidtest.service.mediaplayer.IMusicService asInterface(
android.os.IBinder obj) {
if ((obj== null)) {
return null;
}
android.os.IInterfaceiin= (android.os.IInterface) obj
.queryLocalInterface(DESCRIPTOR);
if (((iin != null) && (iin instanceof com.androidtest.service.mediaplayer.IMusicService))) {
return ((com.androidtest.service.mediaplayer.IMusicService) iin);
}
return new com.androidtest.service.mediaplayer.IMusicService.Stub.Proxy(
obj);
}
public android.os.IBinder asBinder() {
return this;
}
@Override
public boolean onTransact(int code, android.os.Parcel data,
android.os.Parcel reply, int flags)
throws android.os.RemoteException {
switch (code) {
case INTERFACE_TRANSACTION: {
reply.writeString(DESCRIPTOR);
return true;
}
case TRANSACTION_play: {
data.enforceInterface(DESCRIPTOR);
this.play();
reply.writeNoException();
return true;
}
case TRANSACTION_pause: {
data.enforceInterface(DESCRIPTOR);
this.pause();
reply.writeNoException();
return true;
}
case TRANSACTION_stop: {
data.enforceInterface(DESCRIPTOR);
this.stop();
reply.writeNoException();
return true;
}
}
return super.onTransact(code, data, reply, flags);
}
private static class Proxy implements
com.androidtest.service.mediaplayer.IMusicService {
private android.os.IBinder mRemote;
Proxy(android.os.IBinder remote) {
mRemote=remote;
}
public android.os.IBinder asBinder() {
return mRemote;
}
public java.lang.String getInterfaceDescriptor() {
return DESCRIPTOR;
}
public void play() throws android.os.RemoteException {
android.os.Parcel_data=android.os.Parcel.obtain();
android.os.Parcel_reply=android.os.Parcel.obtain();
try {
_data.writeInterfaceToken(DESCRIPTOR);
mRemote.transact(Stub.TRANSACTION_play, _data, _reply, 0);
_reply.readException();
} finally {
_reply.recycle();
_data.recycle();
}
}
public void pause() throws android.os.RemoteException {
android.os.Parcel_data=android.os.Parcel.obtain();
android.os.Parcel_reply=android.os.Parcel.obtain();
try {
_data.writeInterfaceToken(DESCRIPTOR);
mRemote.transact(Stub.TRANSACTION_pause, _data, _reply, 0);
_reply.readException();
} finally {
_reply.recycle();
_data.recycle();
}
}
public void stop() throws android.os.RemoteException {
android.os.Parcel_data=android.os.Parcel.obtain();
android.os.Parcel_reply=android.os.Parcel.obtain();
try {
_data.writeInterfaceToken(DESCRIPTOR);
mRemote.transact(Stub.TRANSACTION_stop, _data, _reply, 0);
_reply.readException();
} finally {
_reply.recycle();
_data.recycle();
}
}
}
static final intTRANSACTION_play= (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
static final intTRANSACTION_pause= (android.os.IBinder.FIRST_CALL_TRANSACTION + 1);
static final intTRANSACTION_stop= (android.os.IBinder.FIRST_CALL_TRANSACTION + 2);
}
public void play() throws android.os.RemoteException;
public void pause() throws android.os.RemoteException;
public void stop() throws android.os.RemoteException;
}
该博客内容展示了Android中一个名为IMusicService的接口定义,主要用于控制音乐播放。接口包含了play、pause和stop三个方法,用于播放、暂停和停止音乐播放。此外,还详细描述了接口的实现类Stub及其实现的onTransact方法,用于处理 Binder 通信。
9218

被折叠的 条评论
为什么被折叠?



