124 lines
4.0 KiB
Java
124 lines
4.0 KiB
Java
package com.liulishuo.filedownloader.services;
|
|
|
|
import android.app.Notification;
|
|
import android.content.Intent;
|
|
import android.os.IBinder;
|
|
import com.liulishuo.filedownloader.FileDownloadServiceProxy;
|
|
import com.liulishuo.filedownloader.i.IFileDownloadIPCCallback;
|
|
import com.liulishuo.filedownloader.i.IFileDownloadIPCService;
|
|
import com.liulishuo.filedownloader.model.FileDownloadHeader;
|
|
import java.lang.ref.WeakReference;
|
|
|
|
/* loaded from: classes.dex */
|
|
public class FDServiceSharedHandler extends IFileDownloadIPCService.Stub implements IFileDownloadServiceHandler {
|
|
private final FileDownloadManager a;
|
|
private final WeakReference<FileDownloadService> b;
|
|
|
|
public interface FileDownloadServiceSharedConnection {
|
|
void a(FDServiceSharedHandler fDServiceSharedHandler);
|
|
|
|
void onDisconnected();
|
|
}
|
|
|
|
FDServiceSharedHandler(WeakReference<FileDownloadService> weakReference, FileDownloadManager fileDownloadManager) {
|
|
this.b = weakReference;
|
|
this.a = fileDownloadManager;
|
|
}
|
|
|
|
@Override // com.liulishuo.filedownloader.services.IFileDownloadServiceHandler
|
|
public IBinder a(Intent intent) {
|
|
return null;
|
|
}
|
|
|
|
@Override // com.liulishuo.filedownloader.i.IFileDownloadIPCService
|
|
public void a(IFileDownloadIPCCallback iFileDownloadIPCCallback) {
|
|
}
|
|
|
|
@Override // com.liulishuo.filedownloader.i.IFileDownloadIPCService
|
|
public boolean a(String str, String str2) {
|
|
return this.a.a(str, str2);
|
|
}
|
|
|
|
@Override // com.liulishuo.filedownloader.i.IFileDownloadIPCService
|
|
public void b(IFileDownloadIPCCallback iFileDownloadIPCCallback) {
|
|
}
|
|
|
|
@Override // com.liulishuo.filedownloader.i.IFileDownloadIPCService
|
|
public boolean b(int i) {
|
|
return this.a.f(i);
|
|
}
|
|
|
|
@Override // com.liulishuo.filedownloader.i.IFileDownloadIPCService
|
|
public boolean c(int i) {
|
|
return this.a.g(i);
|
|
}
|
|
|
|
@Override // com.liulishuo.filedownloader.i.IFileDownloadIPCService
|
|
public boolean d() {
|
|
return this.a.b();
|
|
}
|
|
|
|
@Override // com.liulishuo.filedownloader.i.IFileDownloadIPCService
|
|
public void e() {
|
|
this.a.c();
|
|
}
|
|
|
|
@Override // com.liulishuo.filedownloader.i.IFileDownloadIPCService
|
|
public long f(int i) {
|
|
return this.a.b(i);
|
|
}
|
|
|
|
@Override // com.liulishuo.filedownloader.i.IFileDownloadIPCService
|
|
public void a(String str, String str2, boolean z, int i, int i2, int i3, boolean z2, FileDownloadHeader fileDownloadHeader, boolean z3) {
|
|
this.a.a(str, str2, z, i, i2, i3, z2, fileDownloadHeader, z3);
|
|
}
|
|
|
|
@Override // com.liulishuo.filedownloader.i.IFileDownloadIPCService
|
|
public void c() {
|
|
this.a.a();
|
|
}
|
|
|
|
@Override // com.liulishuo.filedownloader.i.IFileDownloadIPCService
|
|
public boolean d(int i) {
|
|
return this.a.a(i);
|
|
}
|
|
|
|
@Override // com.liulishuo.filedownloader.i.IFileDownloadIPCService
|
|
public long e(int i) {
|
|
return this.a.d(i);
|
|
}
|
|
|
|
@Override // com.liulishuo.filedownloader.i.IFileDownloadIPCService
|
|
public byte a(int i) {
|
|
return this.a.c(i);
|
|
}
|
|
|
|
@Override // com.liulishuo.filedownloader.i.IFileDownloadIPCService
|
|
public void a(int i, Notification notification) {
|
|
WeakReference<FileDownloadService> weakReference = this.b;
|
|
if (weakReference == null || weakReference.get() == null) {
|
|
return;
|
|
}
|
|
this.b.get().startForeground(i, notification);
|
|
}
|
|
|
|
@Override // com.liulishuo.filedownloader.i.IFileDownloadIPCService
|
|
public void a(boolean z) {
|
|
WeakReference<FileDownloadService> weakReference = this.b;
|
|
if (weakReference == null || weakReference.get() == null) {
|
|
return;
|
|
}
|
|
this.b.get().stopForeground(z);
|
|
}
|
|
|
|
@Override // com.liulishuo.filedownloader.services.IFileDownloadServiceHandler
|
|
public void a(Intent intent, int i, int i2) {
|
|
FileDownloadServiceProxy.a().a(this);
|
|
}
|
|
|
|
@Override // com.liulishuo.filedownloader.services.IFileDownloadServiceHandler
|
|
public void a() {
|
|
FileDownloadServiceProxy.a().onDisconnected();
|
|
}
|
|
}
|