public abstract class BaseFileServiceUIGuard<CALLBACK extends Binder,INTERFACE extends IInterface> extends Object implements IFileDownloadServiceProxy, ServiceConnection
| Modifier | Constructor and Description |
|---|---|
protected |
BaseFileServiceUIGuard(Class<?> serviceClass) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract INTERFACE |
asInterface(IBinder service) |
void |
bindStartByContext(Context context) |
void |
bindStartByContext(Context context,
Runnable connectedRunnable) |
protected abstract CALLBACK |
createCallback() |
protected CALLBACK |
getCallback() |
protected INTERFACE |
getService() |
boolean |
isConnected() |
void |
onServiceConnected(ComponentName name,
IBinder service) |
void |
onServiceDisconnected(ComponentName name) |
protected Object |
popCache(String key) |
protected String |
putCache(Object object) |
protected abstract void |
registerCallback(INTERFACE service,
CALLBACK callback) |
void |
startService(Context context) |
void |
unbindByContext(Context context) |
protected abstract void |
unregisterCallback(INTERFACE service,
CALLBACK callback) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclearAllTaskData, clearTaskData, getSofar, getStatus, getTotal, isDownloading, isIdle, pause, pauseAllTasks, setMaxNetworkThreadCount, start, startForeground, stopForegroundonBindingDiedprotected BaseFileServiceUIGuard(Class<?> serviceClass)
protected CALLBACK getCallback()
protected INTERFACE getService()
protected abstract CALLBACK createCallback()
public void onServiceConnected(ComponentName name, IBinder service)
onServiceConnected in interface ServiceConnectionpublic void onServiceDisconnected(ComponentName name)
onServiceDisconnected in interface ServiceConnectionpublic void bindStartByContext(Context context)
bindStartByContext in interface IFileDownloadServiceProxypublic void bindStartByContext(Context context, Runnable connectedRunnable)
bindStartByContext in interface IFileDownloadServiceProxypublic void unbindByContext(Context context)
unbindByContext in interface IFileDownloadServiceProxypublic void startService(Context context)
protected abstract void registerCallback(INTERFACE service, CALLBACK callback) throws RemoteException
RemoteExceptionprotected abstract void unregisterCallback(INTERFACE service, CALLBACK callback) throws RemoteException
RemoteExceptionpublic boolean isConnected()
isConnected in interface IFileDownloadServiceProxy