- Added realracing3-community.apk (71.57 MB) - Removed 32-bit support (armeabi-v7a) - Only includes arm64-v8a libraries - Decompiled source code included - Added README-community.md with analysis
103 lines
4.3 KiB
Java
103 lines
4.3 KiB
Java
package androidx.work.impl;
|
|
|
|
import androidx.annotation.RestrictTo;
|
|
import androidx.work.DirectExecutor;
|
|
import androidx.work.ListenableWorker;
|
|
import androidx.work.Logger;
|
|
import com.google.common.util.concurrent.ListenableFuture;
|
|
import java.util.concurrent.ExecutionException;
|
|
import java.util.concurrent.Future;
|
|
import kotlin.Unit;
|
|
import kotlin.coroutines.Continuation;
|
|
import kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsJvmKt;
|
|
import kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsKt;
|
|
import kotlin.coroutines.jvm.internal.DebugProbesKt;
|
|
import kotlin.jvm.functions.Function1;
|
|
import kotlin.jvm.internal.Intrinsics;
|
|
import kotlin.jvm.internal.SourceDebugExtension;
|
|
import kotlinx.coroutines.CancellableContinuationImpl;
|
|
|
|
@SourceDebugExtension({"SMAP\nWorkerWrapper.kt\nKotlin\n*S Kotlin\n*F\n+ 1 WorkerWrapper.kt\nandroidx/work/impl/WorkerWrapperKt\n+ 2 CancellableContinuation.kt\nkotlinx/coroutines/CancellableContinuationKt\n*L\n1#1,607:1\n314#2,11:608\n*S KotlinDebug\n*F\n+ 1 WorkerWrapper.kt\nandroidx/work/impl/WorkerWrapperKt\n*L\n553#1:608,11\n*E\n"})
|
|
/* loaded from: classes.dex */
|
|
public final class WorkerWrapperKt {
|
|
private static final String TAG;
|
|
|
|
static {
|
|
String tagWithPrefix = Logger.tagWithPrefix("WorkerWrapper");
|
|
Intrinsics.checkNotNullExpressionValue(tagWithPrefix, "tagWithPrefix(\"WorkerWrapper\")");
|
|
TAG = tagWithPrefix;
|
|
}
|
|
|
|
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
|
|
public static final <T> Object awaitWithin(final ListenableFuture listenableFuture, final ListenableWorker listenableWorker, Continuation continuation) {
|
|
Continuation intercepted;
|
|
Object coroutine_suspended;
|
|
try {
|
|
if (listenableFuture.isDone()) {
|
|
return getUninterruptibly(listenableFuture);
|
|
}
|
|
intercepted = IntrinsicsKt__IntrinsicsJvmKt.intercepted(continuation);
|
|
CancellableContinuationImpl cancellableContinuationImpl = new CancellableContinuationImpl(intercepted, 1);
|
|
cancellableContinuationImpl.initCancellability();
|
|
listenableFuture.addListener(new ToContinuation(listenableFuture, cancellableContinuationImpl), DirectExecutor.INSTANCE);
|
|
cancellableContinuationImpl.invokeOnCancellation(new Function1() { // from class: androidx.work.impl.WorkerWrapperKt$awaitWithin$2$1
|
|
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
|
{
|
|
super(1);
|
|
}
|
|
|
|
@Override // kotlin.jvm.functions.Function1
|
|
public /* bridge */ /* synthetic */ Object invoke(Object obj) {
|
|
invoke((Throwable) obj);
|
|
return Unit.INSTANCE;
|
|
}
|
|
|
|
public final void invoke(Throwable th) {
|
|
if (th instanceof WorkerStoppedException) {
|
|
ListenableWorker.this.stop(((WorkerStoppedException) th).getReason());
|
|
}
|
|
listenableFuture.cancel(false);
|
|
}
|
|
});
|
|
Object result = cancellableContinuationImpl.getResult();
|
|
coroutine_suspended = IntrinsicsKt__IntrinsicsKt.getCOROUTINE_SUSPENDED();
|
|
if (result == coroutine_suspended) {
|
|
DebugProbesKt.probeCoroutineSuspended(continuation);
|
|
}
|
|
return result;
|
|
} catch (ExecutionException e) {
|
|
throw nonNullCause(e);
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public static final <V> V getUninterruptibly(Future<V> future) {
|
|
V v;
|
|
boolean z = false;
|
|
while (true) {
|
|
try {
|
|
v = future.get();
|
|
break;
|
|
} catch (InterruptedException unused) {
|
|
z = true;
|
|
} catch (Throwable th) {
|
|
if (z) {
|
|
Thread.currentThread().interrupt();
|
|
}
|
|
throw th;
|
|
}
|
|
}
|
|
if (z) {
|
|
Thread.currentThread().interrupt();
|
|
}
|
|
return v;
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public static final Throwable nonNullCause(ExecutionException executionException) {
|
|
Throwable cause = executionException.getCause();
|
|
Intrinsics.checkNotNull(cause);
|
|
return cause;
|
|
}
|
|
}
|