95 lines
3.6 KiB
Java
95 lines
3.6 KiB
Java
package com.liulishuo.filedownloader;
|
|
|
|
import android.os.IBinder;
|
|
import android.os.RemoteException;
|
|
import com.liulishuo.filedownloader.i.IFileDownloadIPCCallback;
|
|
import com.liulishuo.filedownloader.i.IFileDownloadIPCService;
|
|
import com.liulishuo.filedownloader.message.MessageSnapshot;
|
|
import com.liulishuo.filedownloader.message.MessageSnapshotFlow;
|
|
import com.liulishuo.filedownloader.model.FileDownloadHeader;
|
|
import com.liulishuo.filedownloader.services.BaseFileServiceUIGuard;
|
|
import com.liulishuo.filedownloader.services.FileDownloadService;
|
|
import com.liulishuo.filedownloader.util.DownloadServiceNotConnectedHelper;
|
|
|
|
/* loaded from: classes.dex */
|
|
class FileDownloadServiceUIGuard extends BaseFileServiceUIGuard<FileDownloadServiceCallback, IFileDownloadIPCService> {
|
|
|
|
protected static class FileDownloadServiceCallback extends IFileDownloadIPCCallback.Stub {
|
|
protected FileDownloadServiceCallback() {
|
|
}
|
|
|
|
@Override // com.liulishuo.filedownloader.i.IFileDownloadIPCCallback
|
|
public void a(MessageSnapshot messageSnapshot) throws RemoteException {
|
|
MessageSnapshotFlow.a().a(messageSnapshot);
|
|
}
|
|
}
|
|
|
|
FileDownloadServiceUIGuard() {
|
|
super(FileDownloadService.SeparateProcessService.class);
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: protected */
|
|
@Override // com.liulishuo.filedownloader.services.BaseFileServiceUIGuard
|
|
public void b(IFileDownloadIPCService iFileDownloadIPCService, FileDownloadServiceCallback fileDownloadServiceCallback) throws RemoteException {
|
|
iFileDownloadIPCService.b(fileDownloadServiceCallback);
|
|
}
|
|
|
|
@Override // com.liulishuo.filedownloader.IFileDownloadServiceProxy
|
|
public boolean b(int i) {
|
|
if (!b()) {
|
|
return DownloadServiceNotConnectedHelper.b(i);
|
|
}
|
|
try {
|
|
return c().b(i);
|
|
} catch (RemoteException e) {
|
|
e.printStackTrace();
|
|
return false;
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: protected */
|
|
@Override // com.liulishuo.filedownloader.services.BaseFileServiceUIGuard
|
|
public FileDownloadServiceCallback a() {
|
|
return new FileDownloadServiceCallback();
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: protected */
|
|
@Override // com.liulishuo.filedownloader.services.BaseFileServiceUIGuard
|
|
public IFileDownloadIPCService a(IBinder iBinder) {
|
|
return IFileDownloadIPCService.Stub.a(iBinder);
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: protected */
|
|
@Override // com.liulishuo.filedownloader.services.BaseFileServiceUIGuard
|
|
public void a(IFileDownloadIPCService iFileDownloadIPCService, FileDownloadServiceCallback fileDownloadServiceCallback) throws RemoteException {
|
|
iFileDownloadIPCService.a(fileDownloadServiceCallback);
|
|
}
|
|
|
|
@Override // com.liulishuo.filedownloader.IFileDownloadServiceProxy
|
|
public boolean a(String str, String str2, boolean z, int i, int i2, int i3, boolean z2, FileDownloadHeader fileDownloadHeader, boolean z3) {
|
|
if (!b()) {
|
|
return DownloadServiceNotConnectedHelper.a(str, str2, z);
|
|
}
|
|
try {
|
|
c().a(str, str2, z, i, i2, i3, z2, fileDownloadHeader, z3);
|
|
return true;
|
|
} catch (RemoteException e) {
|
|
e.printStackTrace();
|
|
return false;
|
|
}
|
|
}
|
|
|
|
@Override // com.liulishuo.filedownloader.IFileDownloadServiceProxy
|
|
public byte a(int i) {
|
|
if (!b()) {
|
|
return DownloadServiceNotConnectedHelper.a(i);
|
|
}
|
|
try {
|
|
return c().a(i);
|
|
} catch (RemoteException e) {
|
|
e.printStackTrace();
|
|
return (byte) 0;
|
|
}
|
|
}
|
|
}
|