alexandroid/decompiled/jadx/sources/com/google/common/util/concurrent/FakeTimeLimiter.java
KaKi87 a47fad5135 📦 Add decompiled Alexa 2.2.730155.0 (jadx, apktool, Hermes strings)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 00:04:16 +01:00

67 lines
2.5 KiB
Java

package com.google.common.util.concurrent;
import com.google.common.annotations.GwtIncompatible;
import com.google.common.annotations.J2ktIncompatible;
import com.google.common.base.Preconditions;
import com.google.errorprone.annotations.CanIgnoreReturnValue;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
@J2ktIncompatible
@GwtIncompatible
/* loaded from: classes8.dex */
public final class FakeTimeLimiter implements TimeLimiter {
@Override // com.google.common.util.concurrent.TimeLimiter
@CanIgnoreReturnValue
@ParametricNullness
public <T> T callUninterruptiblyWithTimeout(Callable<T> callable, long j, TimeUnit timeUnit) throws ExecutionException {
return (T) callWithTimeout(callable, j, timeUnit);
}
@Override // com.google.common.util.concurrent.TimeLimiter
@CanIgnoreReturnValue
@ParametricNullness
public <T> T callWithTimeout(Callable<T> callable, long j, TimeUnit timeUnit) throws ExecutionException {
Preconditions.checkNotNull(callable);
Preconditions.checkNotNull(timeUnit);
try {
return callable.call();
} catch (Error e) {
throw new ExecutionError(e);
} catch (RuntimeException e2) {
throw new UncheckedExecutionException(e2);
} catch (Exception e3) {
Platform.restoreInterruptIfIsInterruptedException(e3);
throw new ExecutionException(e3);
}
}
@Override // com.google.common.util.concurrent.TimeLimiter
@CanIgnoreReturnValue
public <T> T newProxy(T t, Class<T> cls, long j, TimeUnit timeUnit) {
Preconditions.checkNotNull(t);
Preconditions.checkNotNull(cls);
Preconditions.checkNotNull(timeUnit);
return t;
}
@Override // com.google.common.util.concurrent.TimeLimiter
public void runUninterruptiblyWithTimeout(Runnable runnable, long j, TimeUnit timeUnit) {
runWithTimeout(runnable, j, timeUnit);
}
@Override // com.google.common.util.concurrent.TimeLimiter
public void runWithTimeout(Runnable runnable, long j, TimeUnit timeUnit) {
Preconditions.checkNotNull(runnable);
Preconditions.checkNotNull(timeUnit);
try {
runnable.run();
} catch (Error e) {
throw new ExecutionError(e);
} catch (Exception e2) {
throw new UncheckedExecutionException(e2);
}
}
}