package com.baidu.license.download.a; import android.os.Handler; import com.baidu.license.download.base.DownloadCallback; import com.baidu.license.download.base.DownloadStatus; import com.baidu.license.download.base.DownloadStatusDelivery; import com.baidu.license.download.exception.DownloadException; import com.baidu.license.download.utils.LogUtils; import java.util.concurrent.Executor; /* compiled from: DownloadStatusDeliveryImpl.java */ /* loaded from: classes.dex */ public final class trw implements DownloadStatusDelivery { private Executor a; /* compiled from: DownloadStatusDeliveryImpl.java */ private static class oi implements Runnable { private final DownloadStatus a; private final DownloadCallback b; public oi(DownloadStatus downloadStatus) { this.a = downloadStatus; this.b = this.a.a(); } @Override // java.lang.Runnable public final void run() { switch (this.a.h()) { case 102: LogUtils.a("DownloadStatusDelivery", "STATUS_CONNECTING"); this.b.a(); break; case 103: LogUtils.a("DownloadStatusDelivery", "STATUS_CONNECTED length: " + this.a.e() + " acceptRanges: " + this.a.i()); this.b.a(this.a.e(), this.a.i()); break; case 104: LogUtils.a("DownloadStatusDelivery", "STATUS_PROGRESS finished: " + this.a.d() + " length: " + this.a.e() + " percent: " + this.a.f()); this.b.a(this.a.d(), this.a.e(), this.a.f()); break; case 105: LogUtils.a("DownloadStatusDelivery", "STATUS_COMPLETED Path:" + this.a.g()); if (!this.a.b()) { this.a.b(true); this.b.a(this.a.g()); break; } break; case 106: LogUtils.a("DownloadStatusDelivery", "STATUS_PAUSED"); this.b.c(); break; case 107: LogUtils.a("DownloadStatusDelivery", "STATUS_CANCELED"); this.b.b(); break; case 108: LogUtils.b("DownloadStatusDelivery", "STATUS_FAILED error: " + this.a.c().getCause()); this.b.a((DownloadException) this.a.c()); break; } } } public trw(Handler handler) { this.a = new mas(this, handler); } @Override // com.baidu.license.download.base.DownloadStatusDelivery public final void a(DownloadStatus downloadStatus) { this.a.execute(new oi(downloadStatus)); } }