mirror of
https://github.com/VibedByKaKi/alexandroid.git
synced 2026-11-16 02:47:17 +01:00
210 lines
9.2 KiB
Java
210 lines
9.2 KiB
Java
package com.facebook.react.runtime;
|
|
|
|
import ai.onnxruntime.OnnxMap$$ExternalSyntheticBUOutline0;
|
|
import android.annotation.SuppressLint;
|
|
import androidx.exifinterface.media.ExifInterface;
|
|
import com.dee.app.metrics.MetricsConstants;
|
|
import kotlin.Metadata;
|
|
import kotlin.Unit;
|
|
import kotlin.enums.EnumEntries;
|
|
import kotlin.enums.EnumEntriesKt;
|
|
import kotlin.jvm.JvmName;
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
import org.jetbrains.annotations.NotNull;
|
|
import org.jetbrains.annotations.Nullable;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
@Metadata(d1 = {"\u0000,\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0000\n\u0002\b\u000b\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0010\u0002\n\u0002\b\u0004\b\u0000\u0018\u0000*\u0004\b\u0000\u0010\u00012\u00020\u0002:\u0002\u001a\u001bB\u0013\u0012\n\b\u0002\u0010\u0003\u001a\u0004\u0018\u00018\u0000¢\u0006\u0004\b\u0004\u0010\u0005J\u001b\u0010\u0011\u001a\u00028\u00002\f\u0010\u0012\u001a\b\u0012\u0004\u0012\u00028\u00000\u0013H\u0007¢\u0006\u0002\u0010\u0014J\u0006\u0010\u0017\u001a\u00020\u0018J\u000b\u0010\u0019\u001a\u00028\u0000¢\u0006\u0002\u0010\u0007R \u0010\u0003\u001a\u0004\u0018\u00018\u00008GX\u0086\u000e¢\u0006\u0010\n\u0002\u0010\t\u001a\u0004\b\u0006\u0010\u0007\"\u0004\b\b\u0010\u0005R\u001e\u0010\n\u001a\u0004\u0018\u00018\u0000X\u0086\u000e¢\u0006\u0010\n\u0002\u0010\t\u001a\u0004\b\u000b\u0010\u0007\"\u0004\b\f\u0010\u0005R\u000e\u0010\r\u001a\u00020\u000eX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u000f\u001a\u00020\u0010X\u0082\u000e¢\u0006\u0002\n\u0000R\u0011\u0010\u0015\u001a\u00028\u00008F¢\u0006\u0006\u001a\u0004\b\u0016\u0010\u0007¨\u0006\u001c"}, d2 = {"Lcom/facebook/react/runtime/BridgelessAtomicRef;", ExifInterface.GPS_DIRECTION_TRUE, "", "value", "<init>", "(Ljava/lang/Object;)V", "getNullable", "()Ljava/lang/Object;", "setValue", "Ljava/lang/Object;", "initialValue", "getInitialValue", "setInitialValue", "state", "Lcom/facebook/react/runtime/BridgelessAtomicRef$State;", "failureMessage", "", "getOrCreate", "provider", "Lcom/facebook/react/runtime/BridgelessAtomicRef$Provider;", "(Lcom/facebook/react/runtime/BridgelessAtomicRef$Provider;)Ljava/lang/Object;", "andReset", "getAndReset", "reset", "", MetricsConstants.Method.CACHE_GET, "Provider", "State", "ReactAndroid_release"}, k = 1, mv = {2, 1, 0}, xi = 48)
|
|
/* loaded from: classes6.dex */
|
|
public final class BridgelessAtomicRef<T> {
|
|
|
|
@NotNull
|
|
private volatile String failureMessage;
|
|
|
|
@Nullable
|
|
private T initialValue;
|
|
|
|
@NotNull
|
|
private volatile State state;
|
|
|
|
@Nullable
|
|
private volatile T value;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
@Metadata(d1 = {"\u0000\u000e\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0000\n\u0002\b\u0003\bà\u0080\u0001\u0018\u0000*\u0004\b\u0001\u0010\u00012\u00020\u0002J\r\u0010\u0003\u001a\u00028\u0001H&¢\u0006\u0002\u0010\u0004ø\u0001\u0000\u0082\u0002\u0006\n\u0004\b!0\u0001¨\u0006\u0005À\u0006\u0001"}, d2 = {"Lcom/facebook/react/runtime/BridgelessAtomicRef$Provider;", ExifInterface.GPS_DIRECTION_TRUE, "", MetricsConstants.Method.CACHE_GET, "()Ljava/lang/Object;", "ReactAndroid_release"}, k = 1, mv = {2, 1, 0}, xi = 48)
|
|
public interface Provider<T> {
|
|
T get();
|
|
}
|
|
|
|
/* JADX WARN: Failed to restore enum class, 'enum' modifier and super class removed */
|
|
/* JADX WARN: Unknown enum class pattern. Please report as an issue! */
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
@Metadata(d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0002\u0010\u0010\n\u0002\b\u0007\b\u0080\u0081\u0002\u0018\u00002\b\u0012\u0004\u0012\u00020\u00000\u0001B\t\b\u0002¢\u0006\u0004\b\u0002\u0010\u0003j\u0002\b\u0004j\u0002\b\u0005j\u0002\b\u0006j\u0002\b\u0007¨\u0006\b"}, d2 = {"Lcom/facebook/react/runtime/BridgelessAtomicRef$State;", "", "<init>", "(Ljava/lang/String;I)V", "Init", "Creating", "Success", "Failure", "ReactAndroid_release"}, k = 1, mv = {2, 1, 0}, xi = 48)
|
|
public static final class State {
|
|
private static final /* synthetic */ EnumEntries $ENTRIES;
|
|
private static final /* synthetic */ State[] $VALUES;
|
|
public static final State Init = new State("Init", 0);
|
|
public static final State Creating = new State("Creating", 1);
|
|
public static final State Success = new State("Success", 2);
|
|
public static final State Failure = new State("Failure", 3);
|
|
|
|
private static final /* synthetic */ State[] $values() {
|
|
return new State[]{Init, Creating, Success, Failure};
|
|
}
|
|
|
|
static {
|
|
State[] $values = $values();
|
|
$VALUES = $values;
|
|
$ENTRIES = EnumEntriesKt.enumEntries($values);
|
|
}
|
|
|
|
private State(String str, int i) {
|
|
}
|
|
|
|
@NotNull
|
|
public static EnumEntries<State> getEntries() {
|
|
return $ENTRIES;
|
|
}
|
|
|
|
public static State valueOf(String str) {
|
|
return (State) Enum.valueOf(State.class, str);
|
|
}
|
|
|
|
public static State[] values() {
|
|
return (State[]) $VALUES.clone();
|
|
}
|
|
}
|
|
|
|
public BridgelessAtomicRef(@Nullable T t) {
|
|
this.value = t;
|
|
this.initialValue = this.value;
|
|
this.state = State.Init;
|
|
this.failureMessage = "";
|
|
}
|
|
|
|
public final synchronized T get() {
|
|
T t;
|
|
t = this.value;
|
|
if (t == null) {
|
|
throw new IllegalStateException("Required value was null.");
|
|
}
|
|
return t;
|
|
}
|
|
|
|
public final synchronized T getAndReset() {
|
|
T t;
|
|
t = get();
|
|
reset();
|
|
return t;
|
|
}
|
|
|
|
@Nullable
|
|
public final T getInitialValue() {
|
|
return this.initialValue;
|
|
}
|
|
|
|
@JvmName(name = "getNullable")
|
|
@Nullable
|
|
public final synchronized T getNullable() {
|
|
return this.value;
|
|
}
|
|
|
|
@SuppressLint({"CatchGeneralException"})
|
|
public final T getOrCreate(@NotNull Provider<T> provider) {
|
|
boolean z;
|
|
T t;
|
|
T t2;
|
|
provider.getClass();
|
|
synchronized (this) {
|
|
State state = this.state;
|
|
State state2 = State.Success;
|
|
if (state == state2) {
|
|
return get();
|
|
}
|
|
if (this.state == State.Failure) {
|
|
throw new RuntimeException("BridgelessAtomicRef: Failed to create object. Reason: " + this.failureMessage);
|
|
}
|
|
State state3 = this.state;
|
|
State state4 = State.Creating;
|
|
boolean z2 = false;
|
|
if (state3 != state4) {
|
|
this.state = state4;
|
|
z = true;
|
|
} else {
|
|
z = false;
|
|
}
|
|
Unit unit = Unit.INSTANCE;
|
|
if (z) {
|
|
try {
|
|
this.value = provider.get();
|
|
synchronized (this) {
|
|
this.state = state2;
|
|
notifyAll();
|
|
t = get();
|
|
}
|
|
return t;
|
|
} catch (RuntimeException e) {
|
|
synchronized (this) {
|
|
this.state = State.Failure;
|
|
this.failureMessage = String.valueOf(e.getMessage());
|
|
notifyAll();
|
|
Unit unit2 = Unit.INSTANCE;
|
|
OnnxMap$$ExternalSyntheticBUOutline0.m("BridgelessAtomicRef: Failed to create object.", e);
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
synchronized (this) {
|
|
while (this.state == State.Creating) {
|
|
try {
|
|
wait();
|
|
} catch (InterruptedException unused) {
|
|
z2 = true;
|
|
}
|
|
}
|
|
if (z2) {
|
|
Thread.currentThread().interrupt();
|
|
}
|
|
if (this.state == State.Failure) {
|
|
throw new RuntimeException("BridgelessAtomicRef: Failed to create object. Reason: " + this.failureMessage);
|
|
}
|
|
t2 = get();
|
|
}
|
|
return t2;
|
|
}
|
|
}
|
|
|
|
public final synchronized void reset() {
|
|
this.value = this.initialValue;
|
|
this.state = State.Init;
|
|
this.failureMessage = "";
|
|
}
|
|
|
|
public final void setInitialValue(@Nullable T t) {
|
|
this.initialValue = t;
|
|
}
|
|
|
|
public final void setValue(@Nullable T t) {
|
|
this.value = t;
|
|
}
|
|
|
|
/* JADX WARN: Illegal instructions before constructor call */
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct add '--show-bad-code' argument
|
|
*/
|
|
public BridgelessAtomicRef() {
|
|
/*
|
|
r2 = this;
|
|
r0 = 0
|
|
r1 = 1
|
|
r2.<init>(r0, r1, r0)
|
|
return
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: com.facebook.react.runtime.BridgelessAtomicRef.<init>():void");
|
|
}
|
|
|
|
public /* synthetic */ BridgelessAtomicRef(Object obj, int i, DefaultConstructorMarker defaultConstructorMarker) {
|
|
this((i & 1) != 0 ? null : obj);
|
|
}
|
|
}
|