discord-jadx/app/src/main/java/b/a/q/c.java

121 lines
4.0 KiB
Java
Raw Normal View History

2021-12-17 22:01:24 +00:00
package b.a.q;
2021-09-14 16:14:33 +00:00
import android.os.Handler;
import android.os.Looper;
2021-08-18 07:29:27 +00:00
import android.os.Process;
2021-12-17 22:01:24 +00:00
import b.c.a.a0.d;
2021-11-01 07:19:03 +00:00
import d0.z.d.m;
2021-08-18 07:29:27 +00:00
import java.util.Collection;
import java.util.List;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
/* compiled from: MediaEngineExecutorService.kt */
public final class c implements ExecutorService {
2021-12-17 22:01:24 +00:00
public static final AtomicInteger j = new AtomicInteger();
public volatile int k = -1;
public final ExecutorService l;
public final boolean m;
2021-08-18 07:29:27 +00:00
/* compiled from: MediaEngineExecutorService.kt */
public static final class a implements Runnable {
2021-12-17 22:01:24 +00:00
public final /* synthetic */ c j;
2021-08-18 07:29:27 +00:00
public a(c cVar) {
2021-12-17 22:01:24 +00:00
this.j = cVar;
2021-08-18 07:29:27 +00:00
}
@Override // java.lang.Runnable
public final void run() {
2021-12-17 22:01:24 +00:00
this.j.k = Process.myTid();
2021-08-18 07:29:27 +00:00
Thread currentThread = Thread.currentThread();
m.checkNotNullExpressionValue(currentThread, "Thread.currentThread()");
2021-12-17 22:01:24 +00:00
currentThread.setName("MediaEngineExecutor-" + c.j.getAndIncrement());
2021-08-18 07:29:27 +00:00
}
}
public c(ExecutorService executorService, boolean z2) {
m.checkNotNullParameter(executorService, "es");
2021-12-17 22:01:24 +00:00
this.l = executorService;
this.m = z2;
2021-08-18 07:29:27 +00:00
executorService.submit(new a(this));
}
2021-09-14 16:14:33 +00:00
public final void a() {
2021-12-17 22:01:24 +00:00
if (Process.myTid() != this.k) {
2021-09-14 16:14:33 +00:00
IllegalStateException illegalStateException = new IllegalStateException("oops! not called on the MediaEngineExecutor");
2022-01-17 16:29:36 +00:00
d.c1("MediaEngineExecutor", "oops! not called on the MediaEngineExecutor", illegalStateException);
2021-12-17 22:01:24 +00:00
if (this.m) {
2021-09-14 16:14:33 +00:00
new Handler(Looper.getMainLooper()).post(new d(illegalStateException));
}
}
}
2021-08-18 07:29:27 +00:00
@Override // java.util.concurrent.ExecutorService
2021-12-17 22:01:24 +00:00
public boolean awaitTermination(long j2, TimeUnit timeUnit) {
return this.l.awaitTermination(j2, timeUnit);
2021-08-18 07:29:27 +00:00
}
@Override // java.util.concurrent.Executor
public void execute(Runnable runnable) {
2021-12-17 22:01:24 +00:00
this.l.execute(runnable);
2021-08-18 07:29:27 +00:00
}
@Override // java.util.concurrent.ExecutorService
public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> collection) {
2021-12-17 22:01:24 +00:00
return this.l.invokeAll(collection);
2021-08-18 07:29:27 +00:00
}
@Override // java.util.concurrent.ExecutorService
2021-12-17 22:01:24 +00:00
public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> collection, long j2, TimeUnit timeUnit) {
return this.l.invokeAll(collection, j2, timeUnit);
2021-08-18 07:29:27 +00:00
}
@Override // java.util.concurrent.ExecutorService
public <T> T invokeAny(Collection<? extends Callable<T>> collection) {
2021-12-17 22:01:24 +00:00
return (T) this.l.invokeAny(collection);
2021-08-18 07:29:27 +00:00
}
@Override // java.util.concurrent.ExecutorService
2021-12-17 22:01:24 +00:00
public <T> T invokeAny(Collection<? extends Callable<T>> collection, long j2, TimeUnit timeUnit) {
return (T) this.l.invokeAny(collection, j2, timeUnit);
2021-08-18 07:29:27 +00:00
}
@Override // java.util.concurrent.ExecutorService
public boolean isShutdown() {
2021-12-17 22:01:24 +00:00
return this.l.isShutdown();
2021-08-18 07:29:27 +00:00
}
@Override // java.util.concurrent.ExecutorService
public boolean isTerminated() {
2021-12-17 22:01:24 +00:00
return this.l.isTerminated();
2021-08-18 07:29:27 +00:00
}
@Override // java.util.concurrent.ExecutorService
public void shutdown() {
2021-12-17 22:01:24 +00:00
this.l.shutdown();
2021-08-18 07:29:27 +00:00
}
@Override // java.util.concurrent.ExecutorService
public List<Runnable> shutdownNow() {
2021-12-17 22:01:24 +00:00
return this.l.shutdownNow();
2021-08-18 07:29:27 +00:00
}
@Override // java.util.concurrent.ExecutorService
public Future<?> submit(Runnable runnable) {
2021-12-17 22:01:24 +00:00
return this.l.submit(runnable);
2021-08-18 07:29:27 +00:00
}
@Override // java.util.concurrent.ExecutorService
public <T> Future<T> submit(Runnable runnable, T t) {
2021-12-17 22:01:24 +00:00
return this.l.submit(runnable, t);
2021-08-18 07:29:27 +00:00
}
@Override // java.util.concurrent.ExecutorService
public <T> Future<T> submit(Callable<T> callable) {
2021-12-17 22:01:24 +00:00
return this.l.submit(callable);
}
}