Initial import of ADIF API reverse-engineering toolkit
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
package com.google.firebase.concurrent;
|
||||
|
||||
import android.os.Process;
|
||||
import android.os.StrictMode;
|
||||
import java.util.Locale;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ThreadFactory;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
class CustomThreadFactory implements ThreadFactory {
|
||||
private static final ThreadFactory DEFAULT = Executors.defaultThreadFactory();
|
||||
private final String namePrefix;
|
||||
private final StrictMode.ThreadPolicy policy;
|
||||
private final int priority;
|
||||
private final AtomicLong threadCount = new AtomicLong();
|
||||
|
||||
public CustomThreadFactory(String str, int i, StrictMode.ThreadPolicy threadPolicy) {
|
||||
this.namePrefix = str;
|
||||
this.priority = i;
|
||||
this.policy = threadPolicy;
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public /* synthetic */ void lambda$newThread$0(Runnable runnable) {
|
||||
Process.setThreadPriority(this.priority);
|
||||
StrictMode.ThreadPolicy threadPolicy = this.policy;
|
||||
if (threadPolicy != null) {
|
||||
StrictMode.setThreadPolicy(threadPolicy);
|
||||
}
|
||||
runnable.run();
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.ThreadFactory
|
||||
public Thread newThread(Runnable runnable) {
|
||||
Thread newThread = DEFAULT.newThread(new a(0, this, runnable));
|
||||
Locale locale = Locale.ROOT;
|
||||
newThread.setName(this.namePrefix + " Thread #" + this.threadCount.getAndIncrement());
|
||||
return newThread;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,182 @@
|
||||
package com.google.firebase.concurrent;
|
||||
|
||||
import com.google.firebase.concurrent.DelegatingScheduledFuture;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public class DelegatingScheduledExecutorService implements ScheduledExecutorService {
|
||||
private final ExecutorService delegate;
|
||||
private final ScheduledExecutorService scheduler;
|
||||
|
||||
public DelegatingScheduledExecutorService(ExecutorService executorService, ScheduledExecutorService scheduledExecutorService) {
|
||||
this.delegate = executorService;
|
||||
this.scheduler = scheduledExecutorService;
|
||||
}
|
||||
|
||||
public static /* synthetic */ void lambda$schedule$0(Runnable runnable, DelegatingScheduledFuture.Completer completer) {
|
||||
try {
|
||||
runnable.run();
|
||||
completer.set(null);
|
||||
} catch (Exception e4) {
|
||||
completer.setException(e4);
|
||||
}
|
||||
}
|
||||
|
||||
public /* synthetic */ void lambda$schedule$1(Runnable runnable, DelegatingScheduledFuture.Completer completer) {
|
||||
this.delegate.execute(new c(runnable, completer, 1));
|
||||
}
|
||||
|
||||
public /* synthetic */ ScheduledFuture lambda$schedule$2(Runnable runnable, long j4, TimeUnit timeUnit, DelegatingScheduledFuture.Completer completer) {
|
||||
return this.scheduler.schedule(new d(this, runnable, completer, 2), j4, timeUnit);
|
||||
}
|
||||
|
||||
public static /* synthetic */ void lambda$schedule$3(Callable callable, DelegatingScheduledFuture.Completer completer) {
|
||||
try {
|
||||
completer.set(callable.call());
|
||||
} catch (Exception e4) {
|
||||
completer.setException(e4);
|
||||
}
|
||||
}
|
||||
|
||||
public /* synthetic */ Future lambda$schedule$4(Callable callable, DelegatingScheduledFuture.Completer completer) throws Exception {
|
||||
return this.delegate.submit(new a(1, callable, completer));
|
||||
}
|
||||
|
||||
public /* synthetic */ ScheduledFuture lambda$schedule$5(final Callable callable, long j4, TimeUnit timeUnit, final DelegatingScheduledFuture.Completer completer) {
|
||||
return this.scheduler.schedule(new Callable() { // from class: com.google.firebase.concurrent.f
|
||||
@Override // java.util.concurrent.Callable
|
||||
public final Object call() {
|
||||
Future lambda$schedule$4;
|
||||
lambda$schedule$4 = DelegatingScheduledExecutorService.this.lambda$schedule$4(callable, completer);
|
||||
return lambda$schedule$4;
|
||||
}
|
||||
}, j4, timeUnit);
|
||||
}
|
||||
|
||||
public static /* synthetic */ void lambda$scheduleAtFixedRate$6(Runnable runnable, DelegatingScheduledFuture.Completer completer) {
|
||||
try {
|
||||
runnable.run();
|
||||
} catch (Exception e4) {
|
||||
completer.setException(e4);
|
||||
throw e4;
|
||||
}
|
||||
}
|
||||
|
||||
public /* synthetic */ void lambda$scheduleAtFixedRate$7(Runnable runnable, DelegatingScheduledFuture.Completer completer) {
|
||||
this.delegate.execute(new c(runnable, completer, 2));
|
||||
}
|
||||
|
||||
public /* synthetic */ ScheduledFuture lambda$scheduleAtFixedRate$8(Runnable runnable, long j4, long j5, TimeUnit timeUnit, DelegatingScheduledFuture.Completer completer) {
|
||||
return this.scheduler.scheduleAtFixedRate(new d(this, runnable, completer, 1), j4, j5, timeUnit);
|
||||
}
|
||||
|
||||
public /* synthetic */ void lambda$scheduleWithFixedDelay$10(Runnable runnable, DelegatingScheduledFuture.Completer completer) {
|
||||
this.delegate.execute(new c(runnable, completer, 0));
|
||||
}
|
||||
|
||||
public /* synthetic */ ScheduledFuture lambda$scheduleWithFixedDelay$11(Runnable runnable, long j4, long j5, TimeUnit timeUnit, DelegatingScheduledFuture.Completer completer) {
|
||||
return this.scheduler.scheduleWithFixedDelay(new d(this, runnable, completer, 0), j4, j5, timeUnit);
|
||||
}
|
||||
|
||||
public static /* synthetic */ void lambda$scheduleWithFixedDelay$9(Runnable runnable, DelegatingScheduledFuture.Completer completer) {
|
||||
try {
|
||||
runnable.run();
|
||||
} catch (Exception e4) {
|
||||
completer.setException(e4);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.ExecutorService
|
||||
public boolean awaitTermination(long j4, TimeUnit timeUnit) throws InterruptedException {
|
||||
return this.delegate.awaitTermination(j4, timeUnit);
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.Executor
|
||||
public void execute(Runnable runnable) {
|
||||
this.delegate.execute(runnable);
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.ExecutorService
|
||||
public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> collection) throws InterruptedException {
|
||||
return this.delegate.invokeAll(collection);
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.ExecutorService
|
||||
public <T> T invokeAny(Collection<? extends Callable<T>> collection) throws ExecutionException, InterruptedException {
|
||||
return (T) this.delegate.invokeAny(collection);
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.ExecutorService
|
||||
public boolean isShutdown() {
|
||||
return this.delegate.isShutdown();
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.ExecutorService
|
||||
public boolean isTerminated() {
|
||||
return this.delegate.isTerminated();
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.ScheduledExecutorService
|
||||
public ScheduledFuture<?> schedule(Runnable runnable, long j4, TimeUnit timeUnit) {
|
||||
return new DelegatingScheduledFuture(new b(this, runnable, j4, timeUnit, 0));
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.ScheduledExecutorService
|
||||
public ScheduledFuture<?> scheduleAtFixedRate(Runnable runnable, long j4, long j5, TimeUnit timeUnit) {
|
||||
return new DelegatingScheduledFuture(new e(this, runnable, j4, j5, timeUnit, 0));
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.ScheduledExecutorService
|
||||
public ScheduledFuture<?> scheduleWithFixedDelay(Runnable runnable, long j4, long j5, TimeUnit timeUnit) {
|
||||
return new DelegatingScheduledFuture(new e(this, runnable, j4, j5, timeUnit, 1));
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.ExecutorService
|
||||
public void shutdown() {
|
||||
throw new UnsupportedOperationException("Shutting down is not allowed.");
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.ExecutorService
|
||||
public List<Runnable> shutdownNow() {
|
||||
throw new UnsupportedOperationException("Shutting down is not allowed.");
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.ExecutorService
|
||||
public <T> Future<T> submit(Callable<T> callable) {
|
||||
return this.delegate.submit(callable);
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.ExecutorService
|
||||
public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> collection, long j4, TimeUnit timeUnit) throws InterruptedException {
|
||||
return this.delegate.invokeAll(collection, j4, timeUnit);
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.ExecutorService
|
||||
public <T> T invokeAny(Collection<? extends Callable<T>> collection, long j4, TimeUnit timeUnit) throws ExecutionException, InterruptedException, TimeoutException {
|
||||
return (T) this.delegate.invokeAny(collection, j4, timeUnit);
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.ScheduledExecutorService
|
||||
public <V> ScheduledFuture<V> schedule(Callable<V> callable, long j4, TimeUnit timeUnit) {
|
||||
return new DelegatingScheduledFuture(new b(this, callable, j4, timeUnit, 1));
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.ExecutorService
|
||||
public <T> Future<T> submit(Runnable runnable, T t2) {
|
||||
return this.delegate.submit(runnable, t2);
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.ExecutorService
|
||||
public Future<?> submit(Runnable runnable) {
|
||||
return this.delegate.submit(runnable);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.google.firebase.concurrent;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import androidx.concurrent.futures.j;
|
||||
import java.util.concurrent.Delayed;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@SuppressLint({"RestrictedApi"})
|
||||
/* loaded from: classes3.dex */
|
||||
class DelegatingScheduledFuture<V> extends j implements ScheduledFuture<V> {
|
||||
private final ScheduledFuture<?> upstreamFuture;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public interface Completer<T> {
|
||||
void set(T t2);
|
||||
|
||||
void setException(Throwable th);
|
||||
}
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public interface Resolver<T> {
|
||||
ScheduledFuture<?> addCompleter(Completer<T> completer);
|
||||
}
|
||||
|
||||
public DelegatingScheduledFuture(Resolver<V> resolver) {
|
||||
this.upstreamFuture = resolver.addCompleter(new Completer<V>() { // from class: com.google.firebase.concurrent.DelegatingScheduledFuture.1
|
||||
@Override // com.google.firebase.concurrent.DelegatingScheduledFuture.Completer
|
||||
public void set(V v3) {
|
||||
DelegatingScheduledFuture.this.set(v3);
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.concurrent.DelegatingScheduledFuture.Completer
|
||||
public void setException(Throwable th) {
|
||||
DelegatingScheduledFuture.this.setException(th);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override // androidx.concurrent.futures.j
|
||||
public void afterDone() {
|
||||
this.upstreamFuture.cancel(wasInterrupted());
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.Delayed
|
||||
public long getDelay(TimeUnit timeUnit) {
|
||||
return this.upstreamFuture.getDelay(timeUnit);
|
||||
}
|
||||
|
||||
@Override // java.lang.Comparable
|
||||
public int compareTo(Delayed delayed) {
|
||||
return this.upstreamFuture.compareTo(delayed);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
package com.google.firebase.concurrent;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.os.StrictMode;
|
||||
import com.google.firebase.annotations.concurrent.Background;
|
||||
import com.google.firebase.annotations.concurrent.Blocking;
|
||||
import com.google.firebase.annotations.concurrent.Lightweight;
|
||||
import com.google.firebase.annotations.concurrent.UiThread;
|
||||
import com.google.firebase.components.Component;
|
||||
import com.google.firebase.components.ComponentContainer;
|
||||
import com.google.firebase.components.ComponentRegistrar;
|
||||
import com.google.firebase.components.Lazy;
|
||||
import com.google.firebase.components.Qualified;
|
||||
import com.google.firebase.inject.Provider;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.ThreadFactory;
|
||||
|
||||
@SuppressLint({"ThreadPoolCreation"})
|
||||
/* loaded from: classes3.dex */
|
||||
public class ExecutorsRegistrar implements ComponentRegistrar {
|
||||
static final Lazy<ScheduledExecutorService> BG_EXECUTOR = new Lazy<>((Provider) new g(0));
|
||||
static final Lazy<ScheduledExecutorService> LITE_EXECUTOR = new Lazy<>((Provider) new g(1));
|
||||
static final Lazy<ScheduledExecutorService> BLOCKING_EXECUTOR = new Lazy<>((Provider) new g(2));
|
||||
static final Lazy<ScheduledExecutorService> SCHEDULER = new Lazy<>((Provider) new g(3));
|
||||
|
||||
private static StrictMode.ThreadPolicy bgPolicy() {
|
||||
StrictMode.ThreadPolicy.Builder detectNetwork = new StrictMode.ThreadPolicy.Builder().detectNetwork();
|
||||
detectNetwork.detectResourceMismatches();
|
||||
detectNetwork.detectUnbufferedIo();
|
||||
return detectNetwork.penaltyLog().build();
|
||||
}
|
||||
|
||||
private static ThreadFactory factory(String str, int i) {
|
||||
return new CustomThreadFactory(str, i, null);
|
||||
}
|
||||
|
||||
public static /* synthetic */ ScheduledExecutorService lambda$getComponents$4(ComponentContainer componentContainer) {
|
||||
return BG_EXECUTOR.get();
|
||||
}
|
||||
|
||||
public static /* synthetic */ ScheduledExecutorService lambda$getComponents$5(ComponentContainer componentContainer) {
|
||||
return BLOCKING_EXECUTOR.get();
|
||||
}
|
||||
|
||||
public static /* synthetic */ ScheduledExecutorService lambda$getComponents$6(ComponentContainer componentContainer) {
|
||||
return LITE_EXECUTOR.get();
|
||||
}
|
||||
|
||||
public static /* synthetic */ Executor lambda$getComponents$7(ComponentContainer componentContainer) {
|
||||
return UiExecutor.INSTANCE;
|
||||
}
|
||||
|
||||
public static /* synthetic */ ScheduledExecutorService lambda$static$0() {
|
||||
return scheduled(Executors.newFixedThreadPool(4, factory("Firebase Background", 10, bgPolicy())));
|
||||
}
|
||||
|
||||
public static /* synthetic */ ScheduledExecutorService lambda$static$1() {
|
||||
return scheduled(Executors.newFixedThreadPool(Math.max(2, Runtime.getRuntime().availableProcessors()), factory("Firebase Lite", 0, litePolicy())));
|
||||
}
|
||||
|
||||
public static /* synthetic */ ScheduledExecutorService lambda$static$2() {
|
||||
return scheduled(Executors.newCachedThreadPool(factory("Firebase Blocking", 11)));
|
||||
}
|
||||
|
||||
public static /* synthetic */ ScheduledExecutorService lambda$static$3() {
|
||||
return Executors.newSingleThreadScheduledExecutor(factory("Firebase Scheduler", 0));
|
||||
}
|
||||
|
||||
private static StrictMode.ThreadPolicy litePolicy() {
|
||||
return new StrictMode.ThreadPolicy.Builder().detectAll().penaltyLog().build();
|
||||
}
|
||||
|
||||
private static ScheduledExecutorService scheduled(ExecutorService executorService) {
|
||||
return new DelegatingScheduledExecutorService(executorService, SCHEDULER.get());
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.components.ComponentRegistrar
|
||||
public List<Component<?>> getComponents() {
|
||||
return Arrays.asList(Component.builder(Qualified.qualified(Background.class, ScheduledExecutorService.class), Qualified.qualified(Background.class, ExecutorService.class), Qualified.qualified(Background.class, Executor.class)).factory(new M2.a(2)).build(), Component.builder(Qualified.qualified(Blocking.class, ScheduledExecutorService.class), Qualified.qualified(Blocking.class, ExecutorService.class), Qualified.qualified(Blocking.class, Executor.class)).factory(new M2.a(3)).build(), Component.builder(Qualified.qualified(Lightweight.class, ScheduledExecutorService.class), Qualified.qualified(Lightweight.class, ExecutorService.class), Qualified.qualified(Lightweight.class, Executor.class)).factory(new M2.a(4)).build(), Component.builder(Qualified.qualified(UiThread.class, Executor.class)).factory(new M2.a(5)).build());
|
||||
}
|
||||
|
||||
private static ThreadFactory factory(String str, int i, StrictMode.ThreadPolicy threadPolicy) {
|
||||
return new CustomThreadFactory(str, i, threadPolicy);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.google.firebase.concurrent;
|
||||
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public class FirebaseExecutors {
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public enum DirectExecutor implements Executor {
|
||||
INSTANCE;
|
||||
|
||||
@Override // java.util.concurrent.Executor
|
||||
public void execute(Runnable runnable) {
|
||||
runnable.run();
|
||||
}
|
||||
}
|
||||
|
||||
private FirebaseExecutors() {
|
||||
}
|
||||
|
||||
public static Executor directExecutor() {
|
||||
return DirectExecutor.INSTANCE;
|
||||
}
|
||||
|
||||
public static Executor newLimitedConcurrencyExecutor(Executor executor, int i) {
|
||||
return new LimitedConcurrencyExecutor(executor, i);
|
||||
}
|
||||
|
||||
public static ExecutorService newLimitedConcurrencyExecutorService(ExecutorService executorService, int i) {
|
||||
return new LimitedConcurrencyExecutorService(executorService, i);
|
||||
}
|
||||
|
||||
public static ScheduledExecutorService newLimitedConcurrencyScheduledExecutorService(ExecutorService executorService, int i) {
|
||||
return new DelegatingScheduledExecutorService(newLimitedConcurrencyExecutorService(executorService, i), ExecutorsRegistrar.SCHEDULER.get());
|
||||
}
|
||||
|
||||
public static PausableExecutor newPausableExecutor(Executor executor) {
|
||||
return new PausableExecutorImpl(false, executor);
|
||||
}
|
||||
|
||||
public static PausableExecutorService newPausableExecutorService(ExecutorService executorService) {
|
||||
return new PausableExecutorServiceImpl(false, executorService);
|
||||
}
|
||||
|
||||
public static PausableScheduledExecutorService newPausableScheduledExecutorService(ScheduledExecutorService scheduledExecutorService) {
|
||||
return new PausableScheduledExecutorServiceImpl(newPausableExecutorService(scheduledExecutorService), ExecutorsRegistrar.SCHEDULER.get());
|
||||
}
|
||||
|
||||
public static Executor newSequentialExecutor(Executor executor) {
|
||||
return new SequentialExecutor(executor);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.google.firebase.concurrent;
|
||||
|
||||
import com.google.firebase.components.Preconditions;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.concurrent.Semaphore;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public class LimitedConcurrencyExecutor implements Executor {
|
||||
private final Executor delegate;
|
||||
private final LinkedBlockingQueue<Runnable> queue = new LinkedBlockingQueue<>();
|
||||
private final Semaphore semaphore;
|
||||
|
||||
public LimitedConcurrencyExecutor(Executor executor, int i) {
|
||||
Preconditions.checkArgument(i > 0, "concurrency must be positive.");
|
||||
this.delegate = executor;
|
||||
this.semaphore = new Semaphore(i, true);
|
||||
}
|
||||
|
||||
public static /* synthetic */ void a(LimitedConcurrencyExecutor limitedConcurrencyExecutor, Runnable runnable) {
|
||||
limitedConcurrencyExecutor.lambda$decorate$0(runnable);
|
||||
}
|
||||
|
||||
private Runnable decorate(Runnable runnable) {
|
||||
return new a(2, this, runnable);
|
||||
}
|
||||
|
||||
public /* synthetic */ void lambda$decorate$0(Runnable runnable) {
|
||||
try {
|
||||
runnable.run();
|
||||
} finally {
|
||||
this.semaphore.release();
|
||||
maybeEnqueueNext();
|
||||
}
|
||||
}
|
||||
|
||||
private void maybeEnqueueNext() {
|
||||
while (this.semaphore.tryAcquire()) {
|
||||
Runnable poll = this.queue.poll();
|
||||
if (poll == null) {
|
||||
this.semaphore.release();
|
||||
return;
|
||||
}
|
||||
this.delegate.execute(decorate(poll));
|
||||
}
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.Executor
|
||||
public void execute(Runnable runnable) {
|
||||
this.queue.offer(runnable);
|
||||
maybeEnqueueNext();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.google.firebase.concurrent;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.concurrent.FutureTask;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
final class LimitedConcurrencyExecutorService extends LimitedConcurrencyExecutor implements ExecutorService {
|
||||
private final ExecutorService delegate;
|
||||
|
||||
public LimitedConcurrencyExecutorService(ExecutorService executorService, int i) {
|
||||
super(executorService, i);
|
||||
this.delegate = executorService;
|
||||
}
|
||||
|
||||
public static /* synthetic */ Object lambda$submit$0(Runnable runnable, Object obj) throws Exception {
|
||||
runnable.run();
|
||||
return obj;
|
||||
}
|
||||
|
||||
public static /* synthetic */ Object lambda$submit$1(Runnable runnable) throws Exception {
|
||||
runnable.run();
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.ExecutorService
|
||||
public boolean awaitTermination(long j4, TimeUnit timeUnit) throws InterruptedException {
|
||||
return this.delegate.awaitTermination(j4, timeUnit);
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.ExecutorService
|
||||
public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> collection) throws InterruptedException {
|
||||
return this.delegate.invokeAll(collection);
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.ExecutorService
|
||||
public <T> T invokeAny(Collection<? extends Callable<T>> collection) throws ExecutionException, InterruptedException {
|
||||
return (T) this.delegate.invokeAny(collection);
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.ExecutorService
|
||||
public boolean isShutdown() {
|
||||
return this.delegate.isShutdown();
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.ExecutorService
|
||||
public boolean isTerminated() {
|
||||
return this.delegate.isTerminated();
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.ExecutorService
|
||||
public void shutdown() {
|
||||
throw new UnsupportedOperationException("Shutting down is not allowed.");
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.ExecutorService
|
||||
public List<Runnable> shutdownNow() {
|
||||
throw new UnsupportedOperationException("Shutting down is not allowed.");
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.ExecutorService
|
||||
public <T> Future<T> submit(Callable<T> callable) {
|
||||
FutureTask futureTask = new FutureTask(callable);
|
||||
execute(futureTask);
|
||||
return futureTask;
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.ExecutorService
|
||||
public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> collection, long j4, TimeUnit timeUnit) throws InterruptedException {
|
||||
return this.delegate.invokeAll(collection, j4, timeUnit);
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.ExecutorService
|
||||
public <T> T invokeAny(Collection<? extends Callable<T>> collection, long j4, TimeUnit timeUnit) throws ExecutionException, InterruptedException, TimeoutException {
|
||||
return (T) this.delegate.invokeAny(collection, j4, timeUnit);
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.ExecutorService
|
||||
public <T> Future<T> submit(Runnable runnable, T t2) {
|
||||
return submit(new i(runnable, t2, 0));
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.ExecutorService
|
||||
public Future<?> submit(Runnable runnable) {
|
||||
return submit(new h(runnable, 0));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.google.firebase.concurrent;
|
||||
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public interface PausableExecutor extends Executor {
|
||||
boolean isPaused();
|
||||
|
||||
void pause();
|
||||
|
||||
void resume();
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.google.firebase.concurrent;
|
||||
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: package-private */
|
||||
/* loaded from: classes3.dex */
|
||||
public final class PausableExecutorImpl implements PausableExecutor {
|
||||
private final Executor delegate;
|
||||
private volatile boolean paused;
|
||||
final LinkedBlockingQueue<Runnable> queue = new LinkedBlockingQueue<>();
|
||||
|
||||
public PausableExecutorImpl(boolean z3, Executor executor) {
|
||||
this.paused = z3;
|
||||
this.delegate = executor;
|
||||
}
|
||||
|
||||
private void maybeEnqueueNext() {
|
||||
if (this.paused) {
|
||||
return;
|
||||
}
|
||||
Runnable poll = this.queue.poll();
|
||||
while (poll != null) {
|
||||
this.delegate.execute(poll);
|
||||
poll = !this.paused ? this.queue.poll() : null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.Executor
|
||||
public void execute(Runnable runnable) {
|
||||
this.queue.offer(runnable);
|
||||
maybeEnqueueNext();
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.concurrent.PausableExecutor
|
||||
public boolean isPaused() {
|
||||
return this.paused;
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.concurrent.PausableExecutor
|
||||
public void pause() {
|
||||
this.paused = true;
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.concurrent.PausableExecutor
|
||||
public void resume() {
|
||||
this.paused = false;
|
||||
maybeEnqueueNext();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.google.firebase.concurrent;
|
||||
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public interface PausableExecutorService extends ExecutorService, PausableExecutor {
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
package com.google.firebase.concurrent;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.concurrent.FutureTask;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: package-private */
|
||||
/* loaded from: classes3.dex */
|
||||
public final class PausableExecutorServiceImpl implements PausableExecutorService {
|
||||
private final ExecutorService delegateService;
|
||||
private final PausableExecutor pausableDelegate;
|
||||
|
||||
public PausableExecutorServiceImpl(boolean z3, ExecutorService executorService) {
|
||||
this.delegateService = executorService;
|
||||
this.pausableDelegate = new PausableExecutorImpl(z3, executorService);
|
||||
}
|
||||
|
||||
public static /* synthetic */ Object lambda$submit$0(Runnable runnable, Object obj) throws Exception {
|
||||
runnable.run();
|
||||
return obj;
|
||||
}
|
||||
|
||||
public static /* synthetic */ Object lambda$submit$1(Runnable runnable) throws Exception {
|
||||
runnable.run();
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.ExecutorService
|
||||
public boolean awaitTermination(long j4, TimeUnit timeUnit) throws InterruptedException {
|
||||
return this.delegateService.awaitTermination(j4, timeUnit);
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.Executor
|
||||
public void execute(Runnable runnable) {
|
||||
this.pausableDelegate.execute(runnable);
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.ExecutorService
|
||||
public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> collection) throws InterruptedException {
|
||||
return this.delegateService.invokeAll(collection);
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.ExecutorService
|
||||
public <T> T invokeAny(Collection<? extends Callable<T>> collection) throws ExecutionException, InterruptedException {
|
||||
return (T) this.delegateService.invokeAny(collection);
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.concurrent.PausableExecutor
|
||||
public boolean isPaused() {
|
||||
return this.pausableDelegate.isPaused();
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.ExecutorService
|
||||
public boolean isShutdown() {
|
||||
return this.delegateService.isShutdown();
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.ExecutorService
|
||||
public boolean isTerminated() {
|
||||
return this.delegateService.isTerminated();
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.concurrent.PausableExecutor
|
||||
public void pause() {
|
||||
this.pausableDelegate.pause();
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.concurrent.PausableExecutor
|
||||
public void resume() {
|
||||
this.pausableDelegate.resume();
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.ExecutorService
|
||||
public void shutdown() {
|
||||
throw new UnsupportedOperationException("Shutting down is not allowed.");
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.ExecutorService
|
||||
public List<Runnable> shutdownNow() {
|
||||
throw new UnsupportedOperationException("Shutting down is not allowed.");
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.ExecutorService
|
||||
public <T> Future<T> submit(Callable<T> callable) {
|
||||
FutureTask futureTask = new FutureTask(callable);
|
||||
execute(futureTask);
|
||||
return futureTask;
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.ExecutorService
|
||||
public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> collection, long j4, TimeUnit timeUnit) throws InterruptedException {
|
||||
return this.delegateService.invokeAll(collection, j4, timeUnit);
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.ExecutorService
|
||||
public <T> T invokeAny(Collection<? extends Callable<T>> collection, long j4, TimeUnit timeUnit) throws ExecutionException, InterruptedException, TimeoutException {
|
||||
return (T) this.delegateService.invokeAny(collection, j4, timeUnit);
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.ExecutorService
|
||||
public <T> Future<T> submit(Runnable runnable, T t2) {
|
||||
return submit(new i(runnable, t2, 1));
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.ExecutorService
|
||||
public Future<?> submit(Runnable runnable) {
|
||||
return submit(new h(runnable, 1));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.google.firebase.concurrent;
|
||||
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public interface PausableScheduledExecutorService extends ScheduledExecutorService, PausableExecutorService {
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.google.firebase.concurrent;
|
||||
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
final class PausableScheduledExecutorServiceImpl extends DelegatingScheduledExecutorService implements PausableScheduledExecutorService {
|
||||
private final PausableExecutorService delegate;
|
||||
|
||||
public PausableScheduledExecutorServiceImpl(PausableExecutorService pausableExecutorService, ScheduledExecutorService scheduledExecutorService) {
|
||||
super(pausableExecutorService, scheduledExecutorService);
|
||||
this.delegate = pausableExecutorService;
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.concurrent.PausableExecutor
|
||||
public boolean isPaused() {
|
||||
return this.delegate.isPaused();
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.concurrent.PausableExecutor
|
||||
public void pause() {
|
||||
this.delegate.pause();
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.concurrent.PausableExecutor
|
||||
public void resume() {
|
||||
this.delegate.resume();
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.concurrent.DelegatingScheduledExecutorService, java.util.concurrent.ScheduledExecutorService
|
||||
public ScheduledFuture<?> scheduleAtFixedRate(Runnable runnable, long j4, long j5, TimeUnit timeUnit) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.concurrent.DelegatingScheduledExecutorService, java.util.concurrent.ScheduledExecutorService
|
||||
public ScheduledFuture<?> scheduleWithFixedDelay(Runnable runnable, long j4, long j5, TimeUnit timeUnit) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,297 @@
|
||||
package com.google.firebase.concurrent;
|
||||
|
||||
import com.google.android.gms.common.internal.Preconditions;
|
||||
import java.util.ArrayDeque;
|
||||
import java.util.Deque;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: package-private */
|
||||
/* loaded from: classes3.dex */
|
||||
public final class SequentialExecutor implements Executor {
|
||||
private static final Logger log = Logger.getLogger(SequentialExecutor.class.getName());
|
||||
private final Executor executor;
|
||||
private final Deque<Runnable> queue = new ArrayDeque();
|
||||
private WorkerRunningState workerRunningState = WorkerRunningState.IDLE;
|
||||
private long workerRunCount = 0;
|
||||
private final QueueWorker worker = new QueueWorker();
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public final class QueueWorker implements Runnable {
|
||||
Runnable task;
|
||||
|
||||
private QueueWorker() {
|
||||
}
|
||||
|
||||
/* JADX WARN: Code restructure failed: missing block: B:10:0x004e, code lost:
|
||||
|
||||
r1 = r1 | java.lang.Thread.interrupted();
|
||||
r2 = null;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:12:0x0050, code lost:
|
||||
|
||||
r8.task.run();
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:16:0x005a, code lost:
|
||||
|
||||
r0 = move-exception;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:17:0x007a, code lost:
|
||||
|
||||
r8.task = null;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:18:0x007c, code lost:
|
||||
|
||||
throw r0;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:20:0x005c, code lost:
|
||||
|
||||
r3 = move-exception;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:21:0x005d, code lost:
|
||||
|
||||
com.google.firebase.concurrent.SequentialExecutor.log.log(java.util.logging.Level.SEVERE, "Exception while executing runnable " + r8.task, (java.lang.Throwable) r3);
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:26:0x0045, code lost:
|
||||
|
||||
if (r1 == false) goto L50;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:30:?, code lost:
|
||||
|
||||
return;
|
||||
*/
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct add '--show-bad-code' argument
|
||||
*/
|
||||
private void workOnQueue() {
|
||||
/*
|
||||
r8 = this;
|
||||
r0 = 0
|
||||
r1 = r0
|
||||
L2:
|
||||
com.google.firebase.concurrent.SequentialExecutor r2 = com.google.firebase.concurrent.SequentialExecutor.this // Catch: java.lang.Throwable -> L58
|
||||
java.util.Deque r2 = com.google.firebase.concurrent.SequentialExecutor.access$100(r2) // Catch: java.lang.Throwable -> L58
|
||||
monitor-enter(r2) // Catch: java.lang.Throwable -> L58
|
||||
if (r0 != 0) goto L2d
|
||||
com.google.firebase.concurrent.SequentialExecutor r0 = com.google.firebase.concurrent.SequentialExecutor.this // Catch: java.lang.Throwable -> L20
|
||||
com.google.firebase.concurrent.SequentialExecutor$WorkerRunningState r0 = com.google.firebase.concurrent.SequentialExecutor.access$200(r0) // Catch: java.lang.Throwable -> L20
|
||||
com.google.firebase.concurrent.SequentialExecutor$WorkerRunningState r3 = com.google.firebase.concurrent.SequentialExecutor.WorkerRunningState.RUNNING // Catch: java.lang.Throwable -> L20
|
||||
if (r0 != r3) goto L22
|
||||
monitor-exit(r2) // Catch: java.lang.Throwable -> L20
|
||||
if (r1 == 0) goto L48
|
||||
L18:
|
||||
java.lang.Thread r8 = java.lang.Thread.currentThread()
|
||||
r8.interrupt()
|
||||
goto L48
|
||||
L20:
|
||||
r8 = move-exception
|
||||
goto L7d
|
||||
L22:
|
||||
com.google.firebase.concurrent.SequentialExecutor r0 = com.google.firebase.concurrent.SequentialExecutor.this // Catch: java.lang.Throwable -> L20
|
||||
com.google.firebase.concurrent.SequentialExecutor.access$308(r0) // Catch: java.lang.Throwable -> L20
|
||||
com.google.firebase.concurrent.SequentialExecutor r0 = com.google.firebase.concurrent.SequentialExecutor.this // Catch: java.lang.Throwable -> L20
|
||||
com.google.firebase.concurrent.SequentialExecutor.access$202(r0, r3) // Catch: java.lang.Throwable -> L20
|
||||
r0 = 1
|
||||
L2d:
|
||||
com.google.firebase.concurrent.SequentialExecutor r3 = com.google.firebase.concurrent.SequentialExecutor.this // Catch: java.lang.Throwable -> L20
|
||||
java.util.Deque r3 = com.google.firebase.concurrent.SequentialExecutor.access$100(r3) // Catch: java.lang.Throwable -> L20
|
||||
java.lang.Object r3 = r3.poll() // Catch: java.lang.Throwable -> L20
|
||||
java.lang.Runnable r3 = (java.lang.Runnable) r3 // Catch: java.lang.Throwable -> L20
|
||||
r8.task = r3 // Catch: java.lang.Throwable -> L20
|
||||
if (r3 != 0) goto L49
|
||||
com.google.firebase.concurrent.SequentialExecutor r8 = com.google.firebase.concurrent.SequentialExecutor.this // Catch: java.lang.Throwable -> L20
|
||||
com.google.firebase.concurrent.SequentialExecutor$WorkerRunningState r0 = com.google.firebase.concurrent.SequentialExecutor.WorkerRunningState.IDLE // Catch: java.lang.Throwable -> L20
|
||||
com.google.firebase.concurrent.SequentialExecutor.access$202(r8, r0) // Catch: java.lang.Throwable -> L20
|
||||
monitor-exit(r2) // Catch: java.lang.Throwable -> L20
|
||||
if (r1 == 0) goto L48
|
||||
goto L18
|
||||
L48:
|
||||
return
|
||||
L49:
|
||||
monitor-exit(r2) // Catch: java.lang.Throwable -> L20
|
||||
boolean r2 = java.lang.Thread.interrupted() // Catch: java.lang.Throwable -> L58
|
||||
r1 = r1 | r2
|
||||
r2 = 0
|
||||
java.lang.Runnable r3 = r8.task // Catch: java.lang.Throwable -> L5a java.lang.RuntimeException -> L5c
|
||||
r3.run() // Catch: java.lang.Throwable -> L5a java.lang.RuntimeException -> L5c
|
||||
L55:
|
||||
r8.task = r2 // Catch: java.lang.Throwable -> L58
|
||||
goto L2
|
||||
L58:
|
||||
r8 = move-exception
|
||||
goto L7f
|
||||
L5a:
|
||||
r0 = move-exception
|
||||
goto L7a
|
||||
L5c:
|
||||
r3 = move-exception
|
||||
java.util.logging.Logger r4 = com.google.firebase.concurrent.SequentialExecutor.access$400() // Catch: java.lang.Throwable -> L5a
|
||||
java.util.logging.Level r5 = java.util.logging.Level.SEVERE // Catch: java.lang.Throwable -> L5a
|
||||
java.lang.StringBuilder r6 = new java.lang.StringBuilder // Catch: java.lang.Throwable -> L5a
|
||||
r6.<init>() // Catch: java.lang.Throwable -> L5a
|
||||
java.lang.String r7 = "Exception while executing runnable "
|
||||
r6.append(r7) // Catch: java.lang.Throwable -> L5a
|
||||
java.lang.Runnable r7 = r8.task // Catch: java.lang.Throwable -> L5a
|
||||
r6.append(r7) // Catch: java.lang.Throwable -> L5a
|
||||
java.lang.String r6 = r6.toString() // Catch: java.lang.Throwable -> L5a
|
||||
r4.log(r5, r6, r3) // Catch: java.lang.Throwable -> L5a
|
||||
goto L55
|
||||
L7a:
|
||||
r8.task = r2 // Catch: java.lang.Throwable -> L58
|
||||
throw r0 // Catch: java.lang.Throwable -> L58
|
||||
L7d:
|
||||
monitor-exit(r2) // Catch: java.lang.Throwable -> L20
|
||||
throw r8 // Catch: java.lang.Throwable -> L58
|
||||
L7f:
|
||||
if (r1 == 0) goto L88
|
||||
java.lang.Thread r0 = java.lang.Thread.currentThread()
|
||||
r0.interrupt()
|
||||
L88:
|
||||
throw r8
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: com.google.firebase.concurrent.SequentialExecutor.QueueWorker.workOnQueue():void");
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
try {
|
||||
workOnQueue();
|
||||
} catch (Error e4) {
|
||||
synchronized (SequentialExecutor.this.queue) {
|
||||
SequentialExecutor.this.workerRunningState = WorkerRunningState.IDLE;
|
||||
throw e4;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
Runnable runnable = this.task;
|
||||
if (runnable != null) {
|
||||
return "SequentialExecutorWorker{running=" + runnable + "}";
|
||||
}
|
||||
return "SequentialExecutorWorker{state=" + SequentialExecutor.this.workerRunningState + "}";
|
||||
}
|
||||
}
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public enum WorkerRunningState {
|
||||
IDLE,
|
||||
QUEUING,
|
||||
QUEUED,
|
||||
RUNNING
|
||||
}
|
||||
|
||||
public SequentialExecutor(Executor executor) {
|
||||
this.executor = (Executor) Preconditions.checkNotNull(executor);
|
||||
}
|
||||
|
||||
public static /* synthetic */ long access$308(SequentialExecutor sequentialExecutor) {
|
||||
long j4 = sequentialExecutor.workerRunCount;
|
||||
sequentialExecutor.workerRunCount = 1 + j4;
|
||||
return j4;
|
||||
}
|
||||
|
||||
/* JADX WARN: Removed duplicated region for block: B:45:0x0064 A[ADDED_TO_REGION] */
|
||||
@Override // java.util.concurrent.Executor
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct add '--show-bad-code' argument
|
||||
*/
|
||||
public void execute(final java.lang.Runnable r8) {
|
||||
/*
|
||||
r7 = this;
|
||||
com.google.android.gms.common.internal.Preconditions.checkNotNull(r8)
|
||||
java.util.Deque<java.lang.Runnable> r0 = r7.queue
|
||||
monitor-enter(r0)
|
||||
com.google.firebase.concurrent.SequentialExecutor$WorkerRunningState r1 = r7.workerRunningState // Catch: java.lang.Throwable -> L6b
|
||||
com.google.firebase.concurrent.SequentialExecutor$WorkerRunningState r2 = com.google.firebase.concurrent.SequentialExecutor.WorkerRunningState.RUNNING // Catch: java.lang.Throwable -> L6b
|
||||
if (r1 == r2) goto L6d
|
||||
com.google.firebase.concurrent.SequentialExecutor$WorkerRunningState r2 = com.google.firebase.concurrent.SequentialExecutor.WorkerRunningState.QUEUED // Catch: java.lang.Throwable -> L6b
|
||||
if (r1 != r2) goto L11
|
||||
goto L6d
|
||||
L11:
|
||||
long r3 = r7.workerRunCount // Catch: java.lang.Throwable -> L6b
|
||||
com.google.firebase.concurrent.SequentialExecutor$1 r1 = new com.google.firebase.concurrent.SequentialExecutor$1 // Catch: java.lang.Throwable -> L6b
|
||||
r1.<init>() // Catch: java.lang.Throwable -> L6b
|
||||
java.util.Deque<java.lang.Runnable> r8 = r7.queue // Catch: java.lang.Throwable -> L6b
|
||||
r8.add(r1) // Catch: java.lang.Throwable -> L6b
|
||||
com.google.firebase.concurrent.SequentialExecutor$WorkerRunningState r8 = com.google.firebase.concurrent.SequentialExecutor.WorkerRunningState.QUEUING // Catch: java.lang.Throwable -> L6b
|
||||
r7.workerRunningState = r8 // Catch: java.lang.Throwable -> L6b
|
||||
monitor-exit(r0) // Catch: java.lang.Throwable -> L6b
|
||||
java.util.concurrent.Executor r0 = r7.executor // Catch: java.lang.Throwable -> L44
|
||||
com.google.firebase.concurrent.SequentialExecutor$QueueWorker r5 = r7.worker // Catch: java.lang.Throwable -> L44
|
||||
r0.execute(r5) // Catch: java.lang.Throwable -> L44
|
||||
com.google.firebase.concurrent.SequentialExecutor$WorkerRunningState r0 = r7.workerRunningState
|
||||
if (r0 == r8) goto L2e
|
||||
return
|
||||
L2e:
|
||||
java.util.Deque<java.lang.Runnable> r0 = r7.queue
|
||||
monitor-enter(r0)
|
||||
long r5 = r7.workerRunCount // Catch: java.lang.Throwable -> L3e
|
||||
int r1 = (r5 > r3 ? 1 : (r5 == r3 ? 0 : -1))
|
||||
if (r1 != 0) goto L40
|
||||
com.google.firebase.concurrent.SequentialExecutor$WorkerRunningState r1 = r7.workerRunningState // Catch: java.lang.Throwable -> L3e
|
||||
if (r1 != r8) goto L40
|
||||
r7.workerRunningState = r2 // Catch: java.lang.Throwable -> L3e
|
||||
goto L40
|
||||
L3e:
|
||||
r7 = move-exception
|
||||
goto L42
|
||||
L40:
|
||||
monitor-exit(r0) // Catch: java.lang.Throwable -> L3e
|
||||
return
|
||||
L42:
|
||||
monitor-exit(r0) // Catch: java.lang.Throwable -> L3e
|
||||
throw r7
|
||||
L44:
|
||||
r8 = move-exception
|
||||
java.util.Deque<java.lang.Runnable> r2 = r7.queue
|
||||
monitor-enter(r2)
|
||||
com.google.firebase.concurrent.SequentialExecutor$WorkerRunningState r0 = r7.workerRunningState // Catch: java.lang.Throwable -> L53
|
||||
com.google.firebase.concurrent.SequentialExecutor$WorkerRunningState r3 = com.google.firebase.concurrent.SequentialExecutor.WorkerRunningState.IDLE // Catch: java.lang.Throwable -> L53
|
||||
if (r0 == r3) goto L55
|
||||
com.google.firebase.concurrent.SequentialExecutor$WorkerRunningState r3 = com.google.firebase.concurrent.SequentialExecutor.WorkerRunningState.QUEUING // Catch: java.lang.Throwable -> L53
|
||||
if (r0 != r3) goto L5f
|
||||
goto L55
|
||||
L53:
|
||||
r7 = move-exception
|
||||
goto L69
|
||||
L55:
|
||||
java.util.Deque<java.lang.Runnable> r7 = r7.queue // Catch: java.lang.Throwable -> L53
|
||||
boolean r7 = r7.removeLastOccurrence(r1) // Catch: java.lang.Throwable -> L53
|
||||
if (r7 == 0) goto L5f
|
||||
r7 = 1
|
||||
goto L60
|
||||
L5f:
|
||||
r7 = 0
|
||||
L60:
|
||||
boolean r0 = r8 instanceof java.util.concurrent.RejectedExecutionException // Catch: java.lang.Throwable -> L53
|
||||
if (r0 == 0) goto L68
|
||||
if (r7 != 0) goto L68
|
||||
monitor-exit(r2) // Catch: java.lang.Throwable -> L53
|
||||
return
|
||||
L68:
|
||||
throw r8 // Catch: java.lang.Throwable -> L53
|
||||
L69:
|
||||
monitor-exit(r2) // Catch: java.lang.Throwable -> L53
|
||||
throw r7
|
||||
L6b:
|
||||
r7 = move-exception
|
||||
goto L74
|
||||
L6d:
|
||||
java.util.Deque<java.lang.Runnable> r7 = r7.queue // Catch: java.lang.Throwable -> L6b
|
||||
r7.add(r8) // Catch: java.lang.Throwable -> L6b
|
||||
monitor-exit(r0) // Catch: java.lang.Throwable -> L6b
|
||||
return
|
||||
L74:
|
||||
monitor-exit(r0) // Catch: java.lang.Throwable -> L6b
|
||||
throw r7
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: com.google.firebase.concurrent.SequentialExecutor.execute(java.lang.Runnable):void");
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "SequentialExecutor@" + System.identityHashCode(this) + "{" + this.executor + "}";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.google.firebase.concurrent;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public enum UiExecutor implements Executor {
|
||||
INSTANCE;
|
||||
|
||||
|
||||
@SuppressLint({"ThreadPoolCreation"})
|
||||
private static final Handler HANDLER = new Handler(Looper.getMainLooper());
|
||||
|
||||
@Override // java.util.concurrent.Executor
|
||||
public void execute(Runnable runnable) {
|
||||
HANDLER.post(runnable);
|
||||
}
|
||||
}
|
||||
38
apk_decompiled/sources/com/google/firebase/concurrent/a.java
Normal file
38
apk_decompiled/sources/com/google/firebase/concurrent/a.java
Normal file
@@ -0,0 +1,38 @@
|
||||
package com.google.firebase.concurrent;
|
||||
|
||||
import com.google.firebase.concurrent.DelegatingScheduledFuture;
|
||||
import java.util.concurrent.Callable;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public final /* synthetic */ class a implements Runnable {
|
||||
|
||||
/* renamed from: a, reason: collision with root package name */
|
||||
public final /* synthetic */ int f5936a;
|
||||
|
||||
/* renamed from: b, reason: collision with root package name */
|
||||
public final /* synthetic */ Object f5937b;
|
||||
|
||||
/* renamed from: c, reason: collision with root package name */
|
||||
public final /* synthetic */ Object f5938c;
|
||||
|
||||
public /* synthetic */ a(int i, Object obj, Object obj2) {
|
||||
this.f5936a = i;
|
||||
this.f5937b = obj;
|
||||
this.f5938c = obj2;
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public final void run() {
|
||||
switch (this.f5936a) {
|
||||
case 0:
|
||||
((CustomThreadFactory) this.f5937b).lambda$newThread$0((Runnable) this.f5938c);
|
||||
return;
|
||||
case 1:
|
||||
DelegatingScheduledExecutorService.d((Callable) this.f5937b, (DelegatingScheduledFuture.Completer) this.f5938c);
|
||||
return;
|
||||
default:
|
||||
LimitedConcurrencyExecutor.a((LimitedConcurrencyExecutor) this.f5937b, (Runnable) this.f5938c);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
43
apk_decompiled/sources/com/google/firebase/concurrent/b.java
Normal file
43
apk_decompiled/sources/com/google/firebase/concurrent/b.java
Normal file
@@ -0,0 +1,43 @@
|
||||
package com.google.firebase.concurrent;
|
||||
|
||||
import com.google.firebase.concurrent.DelegatingScheduledFuture;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public final /* synthetic */ class b implements DelegatingScheduledFuture.Resolver {
|
||||
|
||||
/* renamed from: a, reason: collision with root package name */
|
||||
public final /* synthetic */ int f5939a;
|
||||
|
||||
/* renamed from: b, reason: collision with root package name */
|
||||
public final /* synthetic */ DelegatingScheduledExecutorService f5940b;
|
||||
|
||||
/* renamed from: c, reason: collision with root package name */
|
||||
public final /* synthetic */ long f5941c;
|
||||
|
||||
/* renamed from: d, reason: collision with root package name */
|
||||
public final /* synthetic */ TimeUnit f5942d;
|
||||
|
||||
/* renamed from: e, reason: collision with root package name */
|
||||
public final /* synthetic */ Object f5943e;
|
||||
|
||||
public /* synthetic */ b(DelegatingScheduledExecutorService delegatingScheduledExecutorService, Object obj, long j4, TimeUnit timeUnit, int i) {
|
||||
this.f5939a = i;
|
||||
this.f5940b = delegatingScheduledExecutorService;
|
||||
this.f5943e = obj;
|
||||
this.f5941c = j4;
|
||||
this.f5942d = timeUnit;
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.concurrent.DelegatingScheduledFuture.Resolver
|
||||
public final ScheduledFuture addCompleter(DelegatingScheduledFuture.Completer completer) {
|
||||
switch (this.f5939a) {
|
||||
case 0:
|
||||
return DelegatingScheduledExecutorService.l(this.f5940b, (Runnable) this.f5943e, this.f5941c, this.f5942d, completer);
|
||||
default:
|
||||
return DelegatingScheduledExecutorService.a(this.f5940b, (Callable) this.f5943e, this.f5941c, this.f5942d, completer);
|
||||
}
|
||||
}
|
||||
}
|
||||
37
apk_decompiled/sources/com/google/firebase/concurrent/c.java
Normal file
37
apk_decompiled/sources/com/google/firebase/concurrent/c.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package com.google.firebase.concurrent;
|
||||
|
||||
import com.google.firebase.concurrent.DelegatingScheduledFuture;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public final /* synthetic */ class c implements Runnable {
|
||||
|
||||
/* renamed from: a, reason: collision with root package name */
|
||||
public final /* synthetic */ int f5944a;
|
||||
|
||||
/* renamed from: b, reason: collision with root package name */
|
||||
public final /* synthetic */ Runnable f5945b;
|
||||
|
||||
/* renamed from: c, reason: collision with root package name */
|
||||
public final /* synthetic */ DelegatingScheduledFuture.Completer f5946c;
|
||||
|
||||
public /* synthetic */ c(Runnable runnable, DelegatingScheduledFuture.Completer completer, int i) {
|
||||
this.f5944a = i;
|
||||
this.f5945b = runnable;
|
||||
this.f5946c = completer;
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public final void run() {
|
||||
switch (this.f5944a) {
|
||||
case 0:
|
||||
DelegatingScheduledExecutorService.h(this.f5945b, this.f5946c);
|
||||
return;
|
||||
case 1:
|
||||
DelegatingScheduledExecutorService.j(this.f5945b, this.f5946c);
|
||||
return;
|
||||
default:
|
||||
DelegatingScheduledExecutorService.e(this.f5945b, this.f5946c);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
41
apk_decompiled/sources/com/google/firebase/concurrent/d.java
Normal file
41
apk_decompiled/sources/com/google/firebase/concurrent/d.java
Normal file
@@ -0,0 +1,41 @@
|
||||
package com.google.firebase.concurrent;
|
||||
|
||||
import com.google.firebase.concurrent.DelegatingScheduledFuture;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public final /* synthetic */ class d implements Runnable {
|
||||
|
||||
/* renamed from: a, reason: collision with root package name */
|
||||
public final /* synthetic */ int f5947a;
|
||||
|
||||
/* renamed from: b, reason: collision with root package name */
|
||||
public final /* synthetic */ DelegatingScheduledExecutorService f5948b;
|
||||
|
||||
/* renamed from: c, reason: collision with root package name */
|
||||
public final /* synthetic */ Runnable f5949c;
|
||||
|
||||
/* renamed from: d, reason: collision with root package name */
|
||||
public final /* synthetic */ DelegatingScheduledFuture.Completer f5950d;
|
||||
|
||||
public /* synthetic */ d(DelegatingScheduledExecutorService delegatingScheduledExecutorService, Runnable runnable, DelegatingScheduledFuture.Completer completer, int i) {
|
||||
this.f5947a = i;
|
||||
this.f5948b = delegatingScheduledExecutorService;
|
||||
this.f5949c = runnable;
|
||||
this.f5950d = completer;
|
||||
}
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public final void run() {
|
||||
switch (this.f5947a) {
|
||||
case 0:
|
||||
this.f5948b.lambda$scheduleWithFixedDelay$10(this.f5949c, this.f5950d);
|
||||
return;
|
||||
case 1:
|
||||
this.f5948b.lambda$scheduleAtFixedRate$7(this.f5949c, this.f5950d);
|
||||
return;
|
||||
default:
|
||||
DelegatingScheduledExecutorService.i(this.f5948b, this.f5949c, this.f5950d);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
50
apk_decompiled/sources/com/google/firebase/concurrent/e.java
Normal file
50
apk_decompiled/sources/com/google/firebase/concurrent/e.java
Normal file
@@ -0,0 +1,50 @@
|
||||
package com.google.firebase.concurrent;
|
||||
|
||||
import com.google.firebase.concurrent.DelegatingScheduledFuture;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public final /* synthetic */ class e implements DelegatingScheduledFuture.Resolver {
|
||||
|
||||
/* renamed from: a, reason: collision with root package name */
|
||||
public final /* synthetic */ int f5951a;
|
||||
|
||||
/* renamed from: b, reason: collision with root package name */
|
||||
public final /* synthetic */ DelegatingScheduledExecutorService f5952b;
|
||||
|
||||
/* renamed from: c, reason: collision with root package name */
|
||||
public final /* synthetic */ Runnable f5953c;
|
||||
|
||||
/* renamed from: d, reason: collision with root package name */
|
||||
public final /* synthetic */ long f5954d;
|
||||
|
||||
/* renamed from: e, reason: collision with root package name */
|
||||
public final /* synthetic */ long f5955e;
|
||||
|
||||
/* renamed from: f, reason: collision with root package name */
|
||||
public final /* synthetic */ TimeUnit f5956f;
|
||||
|
||||
public /* synthetic */ e(DelegatingScheduledExecutorService delegatingScheduledExecutorService, Runnable runnable, long j4, long j5, TimeUnit timeUnit, int i) {
|
||||
this.f5951a = i;
|
||||
this.f5952b = delegatingScheduledExecutorService;
|
||||
this.f5953c = runnable;
|
||||
this.f5954d = j4;
|
||||
this.f5955e = j5;
|
||||
this.f5956f = timeUnit;
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.concurrent.DelegatingScheduledFuture.Resolver
|
||||
public final ScheduledFuture addCompleter(DelegatingScheduledFuture.Completer completer) {
|
||||
ScheduledFuture lambda$scheduleAtFixedRate$8;
|
||||
ScheduledFuture lambda$scheduleWithFixedDelay$11;
|
||||
switch (this.f5951a) {
|
||||
case 0:
|
||||
lambda$scheduleAtFixedRate$8 = this.f5952b.lambda$scheduleAtFixedRate$8(this.f5953c, this.f5954d, this.f5955e, this.f5956f, completer);
|
||||
return lambda$scheduleAtFixedRate$8;
|
||||
default:
|
||||
lambda$scheduleWithFixedDelay$11 = this.f5952b.lambda$scheduleWithFixedDelay$11(this.f5953c, this.f5954d, this.f5955e, this.f5956f, completer);
|
||||
return lambda$scheduleWithFixedDelay$11;
|
||||
}
|
||||
}
|
||||
}
|
||||
31
apk_decompiled/sources/com/google/firebase/concurrent/g.java
Normal file
31
apk_decompiled/sources/com/google/firebase/concurrent/g.java
Normal file
@@ -0,0 +1,31 @@
|
||||
package com.google.firebase.concurrent;
|
||||
|
||||
import com.google.firebase.inject.Provider;
|
||||
import com.google.firebase.remoteconfig.RemoteConfigComponent;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public final /* synthetic */ class g implements Provider {
|
||||
|
||||
/* renamed from: a, reason: collision with root package name */
|
||||
public final /* synthetic */ int f5960a;
|
||||
|
||||
public /* synthetic */ g(int i) {
|
||||
this.f5960a = i;
|
||||
}
|
||||
|
||||
@Override // com.google.firebase.inject.Provider
|
||||
public final Object get() {
|
||||
switch (this.f5960a) {
|
||||
case 0:
|
||||
return ExecutorsRegistrar.f();
|
||||
case 1:
|
||||
return ExecutorsRegistrar.c();
|
||||
case 2:
|
||||
return ExecutorsRegistrar.h();
|
||||
case 3:
|
||||
return ExecutorsRegistrar.b();
|
||||
default:
|
||||
return RemoteConfigComponent.a();
|
||||
}
|
||||
}
|
||||
}
|
||||
30
apk_decompiled/sources/com/google/firebase/concurrent/h.java
Normal file
30
apk_decompiled/sources/com/google/firebase/concurrent/h.java
Normal file
@@ -0,0 +1,30 @@
|
||||
package com.google.firebase.concurrent;
|
||||
|
||||
import java.util.concurrent.Callable;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public final /* synthetic */ class h implements Callable {
|
||||
|
||||
/* renamed from: a, reason: collision with root package name */
|
||||
public final /* synthetic */ int f5961a;
|
||||
|
||||
/* renamed from: b, reason: collision with root package name */
|
||||
public final /* synthetic */ Runnable f5962b;
|
||||
|
||||
public /* synthetic */ h(Runnable runnable, int i) {
|
||||
this.f5961a = i;
|
||||
this.f5962b = runnable;
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.Callable
|
||||
public final Object call() {
|
||||
int i = this.f5961a;
|
||||
Runnable runnable = this.f5962b;
|
||||
switch (i) {
|
||||
case 0:
|
||||
return LimitedConcurrencyExecutorService.c(runnable);
|
||||
default:
|
||||
return PausableExecutorServiceImpl.a(runnable);
|
||||
}
|
||||
}
|
||||
}
|
||||
36
apk_decompiled/sources/com/google/firebase/concurrent/i.java
Normal file
36
apk_decompiled/sources/com/google/firebase/concurrent/i.java
Normal file
@@ -0,0 +1,36 @@
|
||||
package com.google.firebase.concurrent;
|
||||
|
||||
import java.util.concurrent.Callable;
|
||||
|
||||
/* loaded from: classes3.dex */
|
||||
public final /* synthetic */ class i implements Callable {
|
||||
|
||||
/* renamed from: a, reason: collision with root package name */
|
||||
public final /* synthetic */ int f5963a;
|
||||
|
||||
/* renamed from: b, reason: collision with root package name */
|
||||
public final /* synthetic */ Runnable f5964b;
|
||||
|
||||
/* renamed from: c, reason: collision with root package name */
|
||||
public final /* synthetic */ Object f5965c;
|
||||
|
||||
public /* synthetic */ i(Runnable runnable, Object obj, int i) {
|
||||
this.f5963a = i;
|
||||
this.f5964b = runnable;
|
||||
this.f5965c = obj;
|
||||
}
|
||||
|
||||
@Override // java.util.concurrent.Callable
|
||||
public final Object call() {
|
||||
Object lambda$submit$0;
|
||||
Object lambda$submit$02;
|
||||
switch (this.f5963a) {
|
||||
case 0:
|
||||
lambda$submit$0 = LimitedConcurrencyExecutorService.lambda$submit$0(this.f5964b, this.f5965c);
|
||||
return lambda$submit$0;
|
||||
default:
|
||||
lambda$submit$02 = PausableExecutorServiceImpl.lambda$submit$0(this.f5964b, this.f5965c);
|
||||
return lambda$submit$02;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user