mirror of
https://github.com/VibedByKaKi/alexandroid.git
synced 2026-11-15 10:27:17 +01:00
590 lines
36 KiB
Java
590 lines
36 KiB
Java
package androidx.compose.runtime.snapshots;
|
||
|
||
import androidx.collection.MutableScatterSet;
|
||
import androidx.compose.runtime.InternalComposeApi;
|
||
import androidx.compose.runtime.PreconditionsKt;
|
||
import androidx.compose.runtime.internal.AtomicInt;
|
||
import androidx.compose.runtime.internal.SnapshotThreadLocal;
|
||
import androidx.compose.runtime.internal.StabilityInferred;
|
||
import androidx.compose.runtime.internal.Thread_jvmKt;
|
||
import androidx.exifinterface.media.ExifInterface;
|
||
import com.amazon.alexa.accessory.metrics.MetricsConstants;
|
||
import com.amazon.alexa.ra.core.data.fragments.SmartFragmentContent;
|
||
import com.amazon.alexa.voice.nowplaying.bridge.VoiceBridgePayloadUtil;
|
||
import io.ktor.util.PathKt$$ExternalSyntheticBUOutline0;
|
||
import java.util.Collection;
|
||
import java.util.List;
|
||
import java.util.Set;
|
||
import kotlin.Deprecated;
|
||
import kotlin.DeprecationLevel;
|
||
import kotlin.Metadata;
|
||
import kotlin.PublishedApi;
|
||
import kotlin.ReplaceWith;
|
||
import kotlin.Unit;
|
||
import kotlin.collections.CollectionsKt;
|
||
import kotlin.jvm.functions.Function0;
|
||
import kotlin.jvm.functions.Function1;
|
||
import kotlin.jvm.functions.Function2;
|
||
import kotlin.jvm.internal.DefaultConstructorMarker;
|
||
import kotlin.jvm.internal.InlineMarker;
|
||
import kotlin.jvm.internal.SourceDebugExtension;
|
||
import okio.Buffer$$ExternalSyntheticBUOutline0;
|
||
import org.jetbrains.annotations.NotNull;
|
||
import org.jetbrains.annotations.Nullable;
|
||
import rx.Single$$ExternalSyntheticBUOutline0;
|
||
|
||
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
||
@StabilityInferred(parameters = 0)
|
||
@Metadata(d1 = {"\u0000f\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\t\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\b\n\u0002\b\u0017\n\u0002\u0010\u000b\n\u0002\b\u0003\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u001a\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0011\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\b7\u0018\u0000 ]2\u00020\u0001:\u0001]B\u001d\b\u0004\u0012\n\u0010\u0002\u001a\u00060\u0003j\u0002`\u0004\u0012\u0006\u0010\u0005\u001a\u00020\u0006¢\u0006\u0004\b\u0007\u0010\bB\u0019\b\u0015\u0012\u0006\u0010\t\u001a\u00020\n\u0012\u0006\u0010\u0005\u001a\u00020\u0006¢\u0006\u0004\b\u0007\u0010\u000bJ\b\u0010%\u001a\u00020&H\u0016J \u0010'\u001a\u00020\u00002\u0016\b\u0002\u0010(\u001a\u0010\u0012\u0004\u0012\u00020\u0001\u0012\u0004\u0012\u00020&\u0018\u00010)H&J\b\u0010*\u001a\u00020\"H&J\"\u0010+\u001a\u0002H,\"\u0004\b\u0000\u0010,2\f\u0010-\u001a\b\u0012\u0004\u0012\u0002H,0.H\u0086\b¢\u0006\u0002\u0010/J\n\u00100\u001a\u0004\u0018\u00010\u0000H\u0011J\u0012\u00101\u001a\u00020&2\b\u00102\u001a\u0004\u0018\u00010\u0000H\u0011J\b\u00103\u001a\u0004\u0018\u00010\u0000J\u0010\u00104\u001a\u00020&2\b\u00105\u001a\u0004\u0018\u00010\u0000J\u0015\u0010C\u001a\u00020&2\u0006\u00102\u001a\u00020\u0000H ¢\u0006\u0002\bDJ\u0015\u0010E\u001a\u00020&2\u0006\u00102\u001a\u00020\u0000H ¢\u0006\u0002\bFJ\u0015\u0010G\u001a\u00020&2\u0006\u0010H\u001a\u00020IH ¢\u0006\u0002\bJJ\r\u0010O\u001a\u00020&H ¢\u0006\u0002\bPJ\r\u0010Q\u001a\u00020&H\u0000¢\u0006\u0002\bRJ\r\u0010S\u001a\u00020&H\u0010¢\u0006\u0002\bTJ\r\u0010U\u001a\u00020&H\u0010¢\u0006\u0002\bVJ\r\u0010W\u001a\u00020&H\u0000¢\u0006\u0002\bXJ\r\u0010Y\u001a\u00020&H\u0000¢\u0006\u0002\bZJ\r\u0010[\u001a\u00020\nH\u0000¢\u0006\u0002\b\\R\u001a\u0010\u0005\u001a\u00020\u0006X\u0090\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\f\u0010\r\"\u0004\b\u000e\u0010\u000fR\u001a\u0010\t\u001a\u00020\n8VX\u0097\u0004¢\u0006\f\u0012\u0004\b\u0010\u0010\u0011\u001a\u0004\b\u0012\u0010\u0013R.\u0010\u0002\u001a\u00060\u0003j\u0002`\u00042\n\u0010\u0014\u001a\u00060\u0003j\u0002`\u0004@PX\u0096\u000e¢\u0006\u0010\n\u0002\u0010\u0019\u001a\u0004\b\u0015\u0010\u0016\"\u0004\b\u0017\u0010\u0018R$\u0010\u001a\u001a\u00020\n2\u0006\u0010\u0014\u001a\u00020\n8P@PX\u0090\u000e¢\u0006\f\u001a\u0004\b\u001b\u0010\u0013\"\u0004\b\u001c\u0010\u001dR\u0012\u0010\u001e\u001a\u00020\u0000X¦\u0004¢\u0006\u0006\u001a\u0004\b\u001f\u0010 R\u0012\u0010!\u001a\u00020\"X¦\u0004¢\u0006\u0006\u001a\u0004\b#\u0010$R\u001a\u00106\u001a\u00020\"X\u0080\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b7\u0010$\"\u0004\b8\u00109R\u0014\u0010:\u001a\u00020\nX\u0082\u000e¢\u0006\b\n\u0000\u0012\u0004\b;\u0010\u0011R\u0015\u0010<\u001a\u00020\"8À\u0002X\u0080\u0004¢\u0006\u0006\u001a\u0004\b=\u0010$R(\u0010(\u001a\u0010\u0012\u0004\u0012\u00020\u0001\u0012\u0004\u0012\u00020&\u0018\u00010)8 X¡\u0004¢\u0006\f\u0012\u0004\b>\u0010\u0011\u001a\u0004\b?\u0010@R \u0010A\u001a\u0010\u0012\u0004\u0012\u00020\u0001\u0012\u0004\u0012\u00020&\u0018\u00010)X \u0004¢\u0006\u0006\u001a\u0004\bB\u0010@R\u001a\u0010K\u001a\n\u0012\u0004\u0012\u00020I\u0018\u00010LX \u0004¢\u0006\u0006\u001a\u0004\bM\u0010N\u0082\u0001\u0004^_`a¨\u0006b"}, d2 = {"Landroidx/compose/runtime/snapshots/Snapshot;", "", "snapshotId", "", "Landroidx/compose/runtime/snapshots/SnapshotId;", "invalid", "Landroidx/compose/runtime/snapshots/SnapshotIdSet;", "<init>", "(JLandroidx/compose/runtime/snapshots/SnapshotIdSet;)V", "id", "", "(ILandroidx/compose/runtime/snapshots/SnapshotIdSet;)V", "getInvalid$runtime", "()Landroidx/compose/runtime/snapshots/SnapshotIdSet;", "setInvalid$runtime", "(Landroidx/compose/runtime/snapshots/SnapshotIdSet;)V", "getId$annotations", "()V", "getId", "()I", "value", "getSnapshotId", "()J", "setSnapshotId$runtime", "(J)V", "J", "writeCount", "getWriteCount$runtime", "setWriteCount$runtime", "(I)V", "root", "getRoot", "()Landroidx/compose/runtime/snapshots/Snapshot;", "readOnly", "", "getReadOnly", "()Z", "dispose", "", "takeNestedSnapshot", "readObserver", "Lkotlin/Function1;", "hasPendingChanges", "enter", ExifInterface.GPS_DIRECTION_TRUE, "block", "Lkotlin/Function0;", "(Lkotlin/jvm/functions/Function0;)Ljava/lang/Object;", "makeCurrent", "restoreCurrent", "snapshot", "unsafeEnter", "unsafeLeave", "oldSnapshot", MetricsConstants.Firmware.CAUSE_DISPOSED, "getDisposed$runtime", "setDisposed$runtime", "(Z)V", "pinningTrackingHandle", "getPinningTrackingHandle$annotations", "isPinned", "isPinned$runtime", "getReadObserver$annotations", "getReadObserver", "()Lkotlin/jvm/functions/Function1;", "writeObserver", "getWriteObserver$runtime", "nestedActivated", "nestedActivated$runtime", "nestedDeactivated", "nestedDeactivated$runtime", "recordModified", "state", "Landroidx/compose/runtime/snapshots/StateObject;", "recordModified$runtime", "modified", "Landroidx/collection/MutableScatterSet;", "getModified$runtime", "()Landroidx/collection/MutableScatterSet;", "notifyObjectsInitialized", "notifyObjectsInitialized$runtime", "closeAndReleasePinning", "closeAndReleasePinning$runtime", "closeLocked", "closeLocked$runtime", "releasePinnedSnapshotsForCloseLocked", "releasePinnedSnapshotsForCloseLocked$runtime", "validateNotDisposed", "validateNotDisposed$runtime", "releasePinnedSnapshotLocked", "releasePinnedSnapshotLocked$runtime", "takeoverPinnedSnapshot", "takeoverPinnedSnapshot$runtime", "Companion", "Landroidx/compose/runtime/snapshots/MutableSnapshot;", "Landroidx/compose/runtime/snapshots/NestedReadonlySnapshot;", "Landroidx/compose/runtime/snapshots/ReadonlySnapshot;", "Landroidx/compose/runtime/snapshots/TransparentObserverSnapshot;", SmartFragmentContent.RUNTIME}, k = 1, mv = {2, 0, 0}, xi = 48)
|
||
@SourceDebugExtension({"SMAP\nSnapshot.kt\nKotlin\n*S Kotlin\n*F\n+ 1 Snapshot.kt\nandroidx/compose/runtime/snapshots/Snapshot\n+ 2 SnapshotId.jvm.kt\nandroidx/compose/runtime/snapshots/SnapshotId_jvmKt\n+ 3 Snapshot.kt\nandroidx/compose/runtime/snapshots/SnapshotKt\n+ 4 Synchronization.android.kt\nandroidx/compose/runtime/platform/Synchronization_androidKt\n+ 5 Preconditions.kt\nandroidx/compose/runtime/PreconditionsKt\n+ 6 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,2486:1\n46#2:2487\n1893#3:2488\n1893#3:2494\n33#4:2489\n33#4:2495\n49#5,4:2490\n34#5,4:2496\n1#6:2500\n*S KotlinDebug\n*F\n+ 1 Snapshot.kt\nandroidx/compose/runtime/snapshots/Snapshot\n*L\n81#1:2487\n113#1:2488\n245#1:2494\n113#1:2489\n245#1:2495\n190#1:2490,4\n274#1:2496,4\n*E\n"})
|
||
/* loaded from: classes13.dex */
|
||
public abstract class Snapshot {
|
||
public static final int PreexistingSnapshotId = 1;
|
||
private boolean disposed;
|
||
|
||
@NotNull
|
||
private SnapshotIdSet invalid;
|
||
private int pinningTrackingHandle;
|
||
private long snapshotId;
|
||
|
||
/* renamed from: Companion, reason: from kotlin metadata */
|
||
@NotNull
|
||
public static final Companion INSTANCE = new Companion(null);
|
||
public static final int $stable = 8;
|
||
|
||
private Snapshot(long j, SnapshotIdSet snapshotIdSet) {
|
||
long j2;
|
||
this.invalid = snapshotIdSet;
|
||
this.snapshotId = j;
|
||
j2 = SnapshotKt.INVALID_SNAPSHOT;
|
||
this.pinningTrackingHandle = j != j2 ? SnapshotKt.trackPinning(j, getInvalid()) : -1;
|
||
}
|
||
|
||
/* JADX WARN: Multi-variable type inference failed */
|
||
public static /* synthetic */ Snapshot takeNestedSnapshot$default(Snapshot snapshot, Function1 function1, int i, Object obj) {
|
||
if (obj != null) {
|
||
Buffer$$ExternalSyntheticBUOutline0.m$1("Super calls with default arguments not supported in this target, function: takeNestedSnapshot");
|
||
return null;
|
||
}
|
||
if ((i & 1) != 0) {
|
||
function1 = null;
|
||
}
|
||
return snapshot.takeNestedSnapshot(function1);
|
||
}
|
||
|
||
public final void closeAndReleasePinning$runtime() {
|
||
synchronized (SnapshotKt.getLock()) {
|
||
closeLocked$runtime();
|
||
releasePinnedSnapshotsForCloseLocked$runtime();
|
||
Unit unit = Unit.INSTANCE;
|
||
}
|
||
}
|
||
|
||
public void closeLocked$runtime() {
|
||
SnapshotIdSet snapshotIdSet;
|
||
snapshotIdSet = SnapshotKt.openSnapshots;
|
||
SnapshotKt.openSnapshots = snapshotIdSet.clear(getSnapshotId());
|
||
}
|
||
|
||
public void dispose() {
|
||
this.disposed = true;
|
||
synchronized (SnapshotKt.getLock()) {
|
||
releasePinnedSnapshotLocked$runtime();
|
||
Unit unit = Unit.INSTANCE;
|
||
}
|
||
}
|
||
|
||
public final <T> T enter(@NotNull Function0<? extends T> block) {
|
||
Snapshot makeCurrent = makeCurrent();
|
||
try {
|
||
return block.invoke();
|
||
} finally {
|
||
InlineMarker.finallyStart(1);
|
||
restoreCurrent(makeCurrent);
|
||
InlineMarker.finallyEnd(1);
|
||
}
|
||
}
|
||
|
||
/* renamed from: getDisposed$runtime, reason: from getter */
|
||
public final boolean getDisposed() {
|
||
return this.disposed;
|
||
}
|
||
|
||
public int getId() {
|
||
return (int) getSnapshotId();
|
||
}
|
||
|
||
@NotNull
|
||
/* renamed from: getInvalid$runtime, reason: from getter */
|
||
public SnapshotIdSet getInvalid() {
|
||
return this.invalid;
|
||
}
|
||
|
||
@Nullable
|
||
public abstract MutableScatterSet<StateObject> getModified$runtime();
|
||
|
||
@Nullable
|
||
public abstract Function1<Object, Unit> getReadObserver();
|
||
|
||
public abstract boolean getReadOnly();
|
||
|
||
@NotNull
|
||
public abstract Snapshot getRoot();
|
||
|
||
public long getSnapshotId() {
|
||
return this.snapshotId;
|
||
}
|
||
|
||
public int getWriteCount$runtime() {
|
||
return 0;
|
||
}
|
||
|
||
@Nullable
|
||
public abstract Function1<Object, Unit> getWriteObserver$runtime();
|
||
|
||
public abstract boolean hasPendingChanges();
|
||
|
||
public final boolean isPinned$runtime() {
|
||
return this.pinningTrackingHandle >= 0;
|
||
}
|
||
|
||
@PublishedApi
|
||
@Nullable
|
||
public Snapshot makeCurrent() {
|
||
SnapshotThreadLocal snapshotThreadLocal;
|
||
SnapshotThreadLocal snapshotThreadLocal2;
|
||
snapshotThreadLocal = SnapshotKt.threadSnapshot;
|
||
Snapshot snapshot = (Snapshot) snapshotThreadLocal.get();
|
||
snapshotThreadLocal2 = SnapshotKt.threadSnapshot;
|
||
snapshotThreadLocal2.set(this);
|
||
return snapshot;
|
||
}
|
||
|
||
/* renamed from: nestedActivated$runtime */
|
||
public abstract void mo4099nestedActivated$runtime(@NotNull Snapshot snapshot);
|
||
|
||
/* renamed from: nestedDeactivated$runtime */
|
||
public abstract void mo4100nestedDeactivated$runtime(@NotNull Snapshot snapshot);
|
||
|
||
public abstract void notifyObjectsInitialized$runtime();
|
||
|
||
/* renamed from: recordModified$runtime */
|
||
public abstract void mo4101recordModified$runtime(@NotNull StateObject state);
|
||
|
||
public final void releasePinnedSnapshotLocked$runtime() {
|
||
int i = this.pinningTrackingHandle;
|
||
if (i >= 0) {
|
||
SnapshotKt.releasePinningLocked(i);
|
||
this.pinningTrackingHandle = -1;
|
||
}
|
||
}
|
||
|
||
public void releasePinnedSnapshotsForCloseLocked$runtime() {
|
||
releasePinnedSnapshotLocked$runtime();
|
||
}
|
||
|
||
@PublishedApi
|
||
public void restoreCurrent(@Nullable Snapshot snapshot) {
|
||
SnapshotThreadLocal snapshotThreadLocal;
|
||
snapshotThreadLocal = SnapshotKt.threadSnapshot;
|
||
snapshotThreadLocal.set(snapshot);
|
||
}
|
||
|
||
public final void setDisposed$runtime(boolean z) {
|
||
this.disposed = z;
|
||
}
|
||
|
||
public void setInvalid$runtime(@NotNull SnapshotIdSet snapshotIdSet) {
|
||
this.invalid = snapshotIdSet;
|
||
}
|
||
|
||
public void setSnapshotId$runtime(long j) {
|
||
this.snapshotId = j;
|
||
}
|
||
|
||
public void setWriteCount$runtime(int i) {
|
||
throw new IllegalStateException("Updating write count is not supported for this snapshot");
|
||
}
|
||
|
||
@NotNull
|
||
public abstract Snapshot takeNestedSnapshot(@Nullable Function1<Object, Unit> readObserver);
|
||
|
||
public final int takeoverPinnedSnapshot$runtime() {
|
||
int i = this.pinningTrackingHandle;
|
||
this.pinningTrackingHandle = -1;
|
||
return i;
|
||
}
|
||
|
||
@Nullable
|
||
public final Snapshot unsafeEnter() {
|
||
return makeCurrent();
|
||
}
|
||
|
||
public final void unsafeLeave(@Nullable Snapshot oldSnapshot) {
|
||
SnapshotThreadLocal snapshotThreadLocal;
|
||
snapshotThreadLocal = SnapshotKt.threadSnapshot;
|
||
if (!(snapshotThreadLocal.get() == this)) {
|
||
PreconditionsKt.throwIllegalStateException("Cannot leave snapshot; " + this + " is not the current snapshot");
|
||
}
|
||
restoreCurrent(oldSnapshot);
|
||
}
|
||
|
||
public final void validateNotDisposed$runtime() {
|
||
if (this.disposed) {
|
||
PreconditionsKt.throwIllegalArgumentException("Cannot use a disposed snapshot");
|
||
}
|
||
}
|
||
|
||
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
||
@Metadata(d1 = {"\u0000d\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u000b\n\u0002\b\u0003\n\u0002\u0010\b\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\n\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\"\n\u0002\b\u0007\b\u0086\u0003\u0018\u00002\u00020\u0001B\t\b\u0002¢\u0006\u0004\b\u0002\u0010\u0003J\u001e\u0010\u000f\u001a\u00020\u00052\u0016\b\u0002\u0010\u0010\u001a\u0010\u0012\u0004\u0012\u00020\u0001\u0012\u0004\u0012\u00020\u0012\u0018\u00010\u0011J6\u0010\u0013\u001a\u00020\u00142\u0016\b\u0002\u0010\u0010\u001a\u0010\u0012\u0004\u0012\u00020\u0001\u0012\u0004\u0012\u00020\u0012\u0018\u00010\u00112\u0016\b\u0002\u0010\u0015\u001a\u0010\u0012\u0004\u0012\u00020\u0001\u0012\u0004\u0012\u00020\u0012\u0018\u00010\u0011J\"\u0010\u0016\u001a\u0002H\u0017\"\u0004\b\u0000\u0010\u00172\f\u0010\u0018\u001a\b\u0012\u0004\u0012\u0002H\u00170\u0019H\u0086\b¢\u0006\u0002\u0010\u001aJ\"\u0010\u001b\u001a\u0002H\u001c\"\u0004\b\u0000\u0010\u001c2\f\u0010\u0018\u001a\b\u0012\u0004\u0012\u0002H\u001c0\u0019H\u0086\b¢\u0006\u0002\u0010\u001aJO\u0010\u001d\u001a\u0002H\u0017\"\u0004\b\u0000\u0010\u00172\u0016\b\u0002\u0010\u0010\u001a\u0010\u0012\u0004\u0012\u00020\u0001\u0012\u0004\u0012\u00020\u0012\u0018\u00010\u00112\u0016\b\u0002\u0010\u0015\u001a\u0010\u0012\u0004\u0012\u00020\u0001\u0012\u0004\u0012\u00020\u0012\u0018\u00010\u00112\f\u0010\u0018\u001a\b\u0012\u0004\u0012\u0002H\u00170\u0019¢\u0006\u0002\u0010\u001eJ\b\u0010\u001f\u001a\u00020\u0005H\u0001J\u0012\u0010)\u001a\u00020\u00052\b\u0010*\u001a\u0004\u0018\u00010\u0005H\u0001J0\u0010+\u001a\u00020\u00122\b\u0010*\u001a\u0004\u0018\u00010\u00052\u0006\u0010,\u001a\u00020\u00052\u0014\u0010-\u001a\u0010\u0012\u0004\u0012\u00020\u0001\u0012\u0004\u0012\u00020\u0012\u0018\u00010\u0011H\u0001J4\u0010.\u001a\u0002H\u0017\"\u0004\b\u0000\u0010\u00172\u0011\u0010\u0018\u001a\r\u0012\u0004\u0012\u0002H\u00170\u0019¢\u0006\u0002\b/H\u0086\b\u0082\u0002\n\n\b\b\u0001\u0012\u0002\u0010\u0001 \u0001¢\u0006\u0002\u0010\u001aJ&\u00100\u001a\u0002012\u001e\u0010-\u001a\u001a\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u000103\u0012\u0004\u0012\u00020\u0005\u0012\u0004\u0012\u00020\u001202J\u001a\u00104\u001a\u0002012\u0012\u0010-\u001a\u000e\u0012\u0004\u0012\u00020\u0001\u0012\u0004\u0012\u00020\u00120\u0011J\u0006\u00105\u001a\u00020\u0012J\u0006\u00106\u001a\u00020\u0012J\b\u00107\u001a\u00020\rH\u0007J\n\u00108\u001a\u0004\u0018\u00010\u0005H\u0001J\u0012\u00109\u001a\u00020\u00122\b\u0010*\u001a\u0004\u0018\u00010\u0005H\u0001R\u0011\u0010\u0004\u001a\u00020\u00058F¢\u0006\u0006\u001a\u0004\b\u0006\u0010\u0007R\u0011\u0010\b\u001a\u00020\t8F¢\u0006\u0006\u001a\u0004\b\b\u0010\nR\u0011\u0010\u000b\u001a\u00020\t8F¢\u0006\u0006\u001a\u0004\b\u000b\u0010\nR\u0014\u0010\f\u001a\u00020\rX\u0086T¢\u0006\b\n\u0000\u0012\u0004\b\u000e\u0010\u0003R\u001c\u0010 \u001a\u0004\u0018\u00010\u00058@X\u0081\u0004¢\u0006\f\u0012\u0004\b!\u0010\u0003\u001a\u0004\b\"\u0010\u0007R\u0019\u0010#\u001a\u00020\t*\u00020$8Â\u0002X\u0082\u0004¢\u0006\u0006\u001a\u0004\b%\u0010&R\u0019\u0010#\u001a\u00020\t*\u00020'8Â\u0002X\u0082\u0004¢\u0006\u0006\u001a\u0004\b%\u0010(¨\u0006:"}, d2 = {"Landroidx/compose/runtime/snapshots/Snapshot$Companion;", "", "<init>", "()V", "current", "Landroidx/compose/runtime/snapshots/Snapshot;", "getCurrent", "()Landroidx/compose/runtime/snapshots/Snapshot;", "isInSnapshot", "", "()Z", "isApplyObserverNotificationPending", "PreexistingSnapshotId", "", "getPreexistingSnapshotId$annotations", "takeSnapshot", "readObserver", "Lkotlin/Function1;", "", "takeMutableSnapshot", "Landroidx/compose/runtime/snapshots/MutableSnapshot;", "writeObserver", "global", ExifInterface.GPS_DIRECTION_TRUE, "block", "Lkotlin/Function0;", "(Lkotlin/jvm/functions/Function0;)Ljava/lang/Object;", "withMutableSnapshot", "R", "observe", "(Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;)Ljava/lang/Object;", "createNonObservableSnapshot", "currentThreadSnapshot", "getCurrentThreadSnapshot$annotations", "getCurrentThreadSnapshot", "canBeReused", "Landroidx/compose/runtime/snapshots/TransparentObserverMutableSnapshot;", "getCanBeReused", "(Landroidx/compose/runtime/snapshots/TransparentObserverMutableSnapshot;)Z", "Landroidx/compose/runtime/snapshots/TransparentObserverSnapshot;", "(Landroidx/compose/runtime/snapshots/TransparentObserverSnapshot;)Z", "makeCurrentNonObservable", VoiceBridgePayloadUtil.PayloadCommand.PREVIOUS, "restoreNonObservable", "nonObservable", "observer", "withoutReadObservation", "Landroidx/compose/runtime/DisallowComposableCalls;", "registerApplyObserver", "Landroidx/compose/runtime/snapshots/ObserverHandle;", "Lkotlin/Function2;", "", "registerGlobalWriteObserver", "notifyObjectsInitialized", "sendApplyNotifications", "openSnapshotCount", "removeCurrent", "restoreCurrent", SmartFragmentContent.RUNTIME}, k = 1, mv = {2, 0, 0}, xi = 48)
|
||
@SourceDebugExtension({"SMAP\nSnapshot.kt\nKotlin\n*S Kotlin\n*F\n+ 1 Snapshot.kt\nandroidx/compose/runtime/snapshots/Snapshot$Companion\n+ 2 Snapshot.kt\nandroidx/compose/runtime/snapshots/Snapshot\n+ 3 Snapshot.kt\nandroidx/compose/runtime/snapshots/SnapshotKt\n+ 4 Synchronization.android.kt\nandroidx/compose/runtime/platform/Synchronization_androidKt\n*L\n1#1,2486:1\n547#1:2492\n547#1:2498\n550#1:2499\n149#2,5:2487\n149#2,5:2493\n1893#3:2500\n1893#3:2502\n1893#3:2504\n1893#3:2506\n1893#3:2508\n33#4:2501\n33#4:2503\n33#4:2505\n33#4:2507\n33#4:2509\n*S KotlinDebug\n*F\n+ 1 Snapshot.kt\nandroidx/compose/runtime/snapshots/Snapshot$Companion\n*L\n493#1:2492\n555#1:2498\n559#1:2499\n456#1:2487,5\n528#1:2493,5\n624#1:2500\n645#1:2502\n679#1:2504\n625#1:2506\n648#1:2508\n624#1:2501\n645#1:2503\n679#1:2505\n625#1:2507\n648#1:2509\n*E\n"})
|
||
public static final class Companion {
|
||
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
||
this();
|
||
}
|
||
|
||
private final boolean getCanBeReused(TransparentObserverMutableSnapshot transparentObserverMutableSnapshot) {
|
||
return transparentObserverMutableSnapshot.getThreadId() == Thread_jvmKt.currentThreadId();
|
||
}
|
||
|
||
/* JADX WARN: Multi-variable type inference failed */
|
||
public static /* synthetic */ Object observe$default(Companion companion, Function1 function1, Function1 function12, Function0 function0, int i, Object obj) {
|
||
if ((i & 1) != 0) {
|
||
function1 = null;
|
||
}
|
||
if ((i & 2) != 0) {
|
||
function12 = null;
|
||
}
|
||
return companion.observe(function1, function12, function0);
|
||
}
|
||
|
||
/* JADX INFO: Access modifiers changed from: private */
|
||
public static final void registerApplyObserver$lambda$3(Function2 function2) {
|
||
List list;
|
||
synchronized (SnapshotKt.getLock()) {
|
||
list = SnapshotKt.applyObservers;
|
||
SnapshotKt.applyObservers = CollectionsKt.minus(list, function2);
|
||
Unit unit = Unit.INSTANCE;
|
||
}
|
||
}
|
||
|
||
/* JADX INFO: Access modifiers changed from: private */
|
||
public static final void registerGlobalWriteObserver$lambda$6(Function1 function1) {
|
||
List list;
|
||
synchronized (SnapshotKt.getLock()) {
|
||
list = SnapshotKt.globalWriteObservers;
|
||
SnapshotKt.globalWriteObservers = CollectionsKt.minus(list, function1);
|
||
Unit unit = Unit.INSTANCE;
|
||
}
|
||
SnapshotKt.advanceGlobalSnapshot();
|
||
}
|
||
|
||
/* JADX WARN: Multi-variable type inference failed */
|
||
public static /* synthetic */ MutableSnapshot takeMutableSnapshot$default(Companion companion, Function1 function1, Function1 function12, int i, Object obj) {
|
||
if ((i & 1) != 0) {
|
||
function1 = null;
|
||
}
|
||
if ((i & 2) != 0) {
|
||
function12 = null;
|
||
}
|
||
return companion.takeMutableSnapshot(function1, function12);
|
||
}
|
||
|
||
/* JADX WARN: Multi-variable type inference failed */
|
||
public static /* synthetic */ Snapshot takeSnapshot$default(Companion companion, Function1 function1, int i, Object obj) {
|
||
if ((i & 1) != 0) {
|
||
function1 = null;
|
||
}
|
||
return companion.takeSnapshot(function1);
|
||
}
|
||
|
||
@PublishedApi
|
||
@NotNull
|
||
public final Snapshot createNonObservableSnapshot() {
|
||
SnapshotThreadLocal snapshotThreadLocal;
|
||
snapshotThreadLocal = SnapshotKt.threadSnapshot;
|
||
return SnapshotKt.createTransparentSnapshotWithNoParentReadObserver$default((Snapshot) snapshotThreadLocal.get(), null, false, 6, null);
|
||
}
|
||
|
||
@NotNull
|
||
public final Snapshot getCurrent() {
|
||
return SnapshotKt.currentSnapshot();
|
||
}
|
||
|
||
@Nullable
|
||
public final Snapshot getCurrentThreadSnapshot() {
|
||
SnapshotThreadLocal snapshotThreadLocal;
|
||
snapshotThreadLocal = SnapshotKt.threadSnapshot;
|
||
return (Snapshot) snapshotThreadLocal.get();
|
||
}
|
||
|
||
public final <T> T global(@NotNull Function0<? extends T> block) {
|
||
Snapshot removeCurrent = removeCurrent();
|
||
try {
|
||
return block.invoke();
|
||
} finally {
|
||
InlineMarker.finallyStart(1);
|
||
restoreCurrent(removeCurrent);
|
||
InlineMarker.finallyEnd(1);
|
||
}
|
||
}
|
||
|
||
public final boolean isApplyObserverNotificationPending() {
|
||
AtomicInt atomicInt;
|
||
atomicInt = SnapshotKt.pendingApplyObserverCount;
|
||
return atomicInt.get() > 0;
|
||
}
|
||
|
||
public final boolean isInSnapshot() {
|
||
SnapshotThreadLocal snapshotThreadLocal;
|
||
snapshotThreadLocal = SnapshotKt.threadSnapshot;
|
||
return snapshotThreadLocal.get() != null;
|
||
}
|
||
|
||
@PublishedApi
|
||
@NotNull
|
||
public final Snapshot makeCurrentNonObservable(@Nullable Snapshot previous) {
|
||
if (previous instanceof TransparentObserverMutableSnapshot) {
|
||
TransparentObserverMutableSnapshot transparentObserverMutableSnapshot = (TransparentObserverMutableSnapshot) previous;
|
||
if (transparentObserverMutableSnapshot.getThreadId() == Thread_jvmKt.currentThreadId()) {
|
||
transparentObserverMutableSnapshot.setReadObserver$runtime(null);
|
||
return previous;
|
||
}
|
||
}
|
||
if (previous instanceof TransparentObserverSnapshot) {
|
||
TransparentObserverSnapshot transparentObserverSnapshot = (TransparentObserverSnapshot) previous;
|
||
if (transparentObserverSnapshot.getThreadId$runtime() == Thread_jvmKt.currentThreadId()) {
|
||
transparentObserverSnapshot.setReadObserver$runtime(null);
|
||
return previous;
|
||
}
|
||
}
|
||
Snapshot createTransparentSnapshotWithNoParentReadObserver$default = SnapshotKt.createTransparentSnapshotWithNoParentReadObserver$default(previous, null, false, 6, null);
|
||
createTransparentSnapshotWithNoParentReadObserver$default.makeCurrent();
|
||
return createTransparentSnapshotWithNoParentReadObserver$default;
|
||
}
|
||
|
||
public final void notifyObjectsInitialized() {
|
||
SnapshotKt.currentSnapshot().notifyObjectsInitialized$runtime();
|
||
}
|
||
|
||
public final <T> T observe(@Nullable Function1<Object, Unit> readObserver, @Nullable Function1<Object, Unit> writeObserver, @NotNull Function0<? extends T> block) {
|
||
SnapshotThreadLocal snapshotThreadLocal;
|
||
Snapshot transparentObserverMutableSnapshot;
|
||
Function1<Object, Unit> mergedWriteObserver;
|
||
if (readObserver == null && writeObserver == null) {
|
||
return block.invoke();
|
||
}
|
||
snapshotThreadLocal = SnapshotKt.threadSnapshot;
|
||
Snapshot snapshot = (Snapshot) snapshotThreadLocal.get();
|
||
if (snapshot instanceof TransparentObserverMutableSnapshot) {
|
||
TransparentObserverMutableSnapshot transparentObserverMutableSnapshot2 = (TransparentObserverMutableSnapshot) snapshot;
|
||
if (transparentObserverMutableSnapshot2.getThreadId() == Thread_jvmKt.currentThreadId()) {
|
||
Function1<Object, Unit> readObserver2 = transparentObserverMutableSnapshot2.getReadObserver();
|
||
Function1<Object, Unit> writeObserver$runtime = transparentObserverMutableSnapshot2.getWriteObserver$runtime();
|
||
try {
|
||
((TransparentObserverMutableSnapshot) snapshot).setReadObserver$runtime(SnapshotKt.mergedReadObserver$default(readObserver, readObserver2, false, 4, null));
|
||
mergedWriteObserver = SnapshotKt.mergedWriteObserver(writeObserver, writeObserver$runtime);
|
||
((TransparentObserverMutableSnapshot) snapshot).setWriteObserver$runtime(mergedWriteObserver);
|
||
return block.invoke();
|
||
} finally {
|
||
transparentObserverMutableSnapshot2.setReadObserver$runtime(readObserver2);
|
||
transparentObserverMutableSnapshot2.setWriteObserver$runtime(writeObserver$runtime);
|
||
}
|
||
}
|
||
}
|
||
if (snapshot == null || (snapshot instanceof MutableSnapshot)) {
|
||
transparentObserverMutableSnapshot = new TransparentObserverMutableSnapshot(snapshot instanceof MutableSnapshot ? (MutableSnapshot) snapshot : null, readObserver, writeObserver, true, false);
|
||
} else {
|
||
if (readObserver == null) {
|
||
return block.invoke();
|
||
}
|
||
transparentObserverMutableSnapshot = snapshot.takeNestedSnapshot(readObserver);
|
||
}
|
||
try {
|
||
Snapshot makeCurrent = transparentObserverMutableSnapshot.makeCurrent();
|
||
try {
|
||
T invoke = block.invoke();
|
||
transparentObserverMutableSnapshot.restoreCurrent(makeCurrent);
|
||
transparentObserverMutableSnapshot.dispose();
|
||
return invoke;
|
||
} catch (Throwable th) {
|
||
transparentObserverMutableSnapshot.restoreCurrent(makeCurrent);
|
||
throw th;
|
||
}
|
||
} catch (Throwable th2) {
|
||
transparentObserverMutableSnapshot.dispose();
|
||
throw th2;
|
||
}
|
||
}
|
||
|
||
@InternalComposeApi
|
||
public final int openSnapshotCount() {
|
||
SnapshotIdSet snapshotIdSet;
|
||
snapshotIdSet = SnapshotKt.openSnapshots;
|
||
return CollectionsKt.toList(snapshotIdSet).size();
|
||
}
|
||
|
||
@NotNull
|
||
public final ObserverHandle registerApplyObserver(@NotNull Function2<? super Set<? extends Object>, ? super Snapshot, Unit> observer) {
|
||
Function1 function1;
|
||
List list;
|
||
function1 = SnapshotKt.emptyLambda;
|
||
SnapshotKt.advanceGlobalSnapshot(function1);
|
||
synchronized (SnapshotKt.getLock()) {
|
||
list = SnapshotKt.applyObservers;
|
||
SnapshotKt.applyObservers = CollectionsKt.plus((Collection<? extends Function2<? super Set<? extends Object>, ? super Snapshot, Unit>>) list, observer);
|
||
Unit unit = Unit.INSTANCE;
|
||
}
|
||
return new Snapshot$Companion$$ExternalSyntheticLambda0(observer, 0);
|
||
}
|
||
|
||
@NotNull
|
||
public final ObserverHandle registerGlobalWriteObserver(@NotNull Function1<Object, Unit> observer) {
|
||
List list;
|
||
synchronized (SnapshotKt.getLock()) {
|
||
list = SnapshotKt.globalWriteObservers;
|
||
SnapshotKt.globalWriteObservers = CollectionsKt.plus((Collection<? extends Function1<Object, Unit>>) list, observer);
|
||
Unit unit = Unit.INSTANCE;
|
||
}
|
||
SnapshotKt.advanceGlobalSnapshot();
|
||
return new Snapshot$Companion$$ExternalSyntheticLambda0(observer, 1);
|
||
}
|
||
|
||
@PublishedApi
|
||
@Nullable
|
||
public final Snapshot removeCurrent() {
|
||
SnapshotThreadLocal snapshotThreadLocal;
|
||
SnapshotThreadLocal snapshotThreadLocal2;
|
||
snapshotThreadLocal = SnapshotKt.threadSnapshot;
|
||
Snapshot snapshot = (Snapshot) snapshotThreadLocal.get();
|
||
if (snapshot != null) {
|
||
snapshotThreadLocal2 = SnapshotKt.threadSnapshot;
|
||
snapshotThreadLocal2.set(null);
|
||
}
|
||
return snapshot;
|
||
}
|
||
|
||
@PublishedApi
|
||
public final void restoreCurrent(@Nullable Snapshot previous) {
|
||
SnapshotThreadLocal snapshotThreadLocal;
|
||
if (previous != null) {
|
||
snapshotThreadLocal = SnapshotKt.threadSnapshot;
|
||
snapshotThreadLocal.set(previous);
|
||
}
|
||
}
|
||
|
||
@PublishedApi
|
||
public final void restoreNonObservable(@Nullable Snapshot previous, @NotNull Snapshot nonObservable, @Nullable Function1<Object, Unit> observer) {
|
||
if (previous != nonObservable) {
|
||
nonObservable.restoreCurrent(previous);
|
||
nonObservable.dispose();
|
||
} else if (previous instanceof TransparentObserverMutableSnapshot) {
|
||
((TransparentObserverMutableSnapshot) previous).setReadObserver$runtime(observer);
|
||
} else if (previous instanceof TransparentObserverSnapshot) {
|
||
((TransparentObserverSnapshot) previous).setReadObserver$runtime(observer);
|
||
} else {
|
||
PathKt$$ExternalSyntheticBUOutline0.m$3(previous, "Non-transparent snapshot was reused: ");
|
||
}
|
||
}
|
||
|
||
public final void sendApplyNotifications() {
|
||
GlobalSnapshot globalSnapshot;
|
||
boolean hasPendingChanges;
|
||
synchronized (SnapshotKt.getLock()) {
|
||
globalSnapshot = SnapshotKt.globalSnapshot;
|
||
hasPendingChanges = globalSnapshot.hasPendingChanges();
|
||
}
|
||
if (hasPendingChanges) {
|
||
SnapshotKt.advanceGlobalSnapshot();
|
||
}
|
||
}
|
||
|
||
@NotNull
|
||
public final MutableSnapshot takeMutableSnapshot(@Nullable Function1<Object, Unit> readObserver, @Nullable Function1<Object, Unit> writeObserver) {
|
||
MutableSnapshot takeNestedMutableSnapshot;
|
||
Snapshot currentSnapshot = SnapshotKt.currentSnapshot();
|
||
MutableSnapshot mutableSnapshot = currentSnapshot instanceof MutableSnapshot ? (MutableSnapshot) currentSnapshot : null;
|
||
if (mutableSnapshot != null && (takeNestedMutableSnapshot = mutableSnapshot.takeNestedMutableSnapshot(readObserver, writeObserver)) != null) {
|
||
return takeNestedMutableSnapshot;
|
||
}
|
||
Single$$ExternalSyntheticBUOutline0.m$2("Cannot create a mutable snapshot of an read-only snapshot");
|
||
return null;
|
||
}
|
||
|
||
@NotNull
|
||
public final Snapshot takeSnapshot(@Nullable Function1<Object, Unit> readObserver) {
|
||
return SnapshotKt.currentSnapshot().takeNestedSnapshot(readObserver);
|
||
}
|
||
|
||
public final <R> R withMutableSnapshot(@NotNull Function0<? extends R> block) {
|
||
MutableSnapshot takeMutableSnapshot$default = takeMutableSnapshot$default(this, null, null, 3, null);
|
||
try {
|
||
Snapshot makeCurrent = takeMutableSnapshot$default.makeCurrent();
|
||
try {
|
||
R invoke = block.invoke();
|
||
InlineMarker.finallyStart(1);
|
||
takeMutableSnapshot$default.apply().check();
|
||
takeMutableSnapshot$default.dispose();
|
||
InlineMarker.finallyEnd(1);
|
||
return invoke;
|
||
} finally {
|
||
InlineMarker.finallyStart(1);
|
||
takeMutableSnapshot$default.restoreCurrent(makeCurrent);
|
||
InlineMarker.finallyEnd(1);
|
||
}
|
||
} finally {
|
||
}
|
||
}
|
||
|
||
public final <T> T withoutReadObservation(@NotNull Function0<? extends T> block) {
|
||
Snapshot currentThreadSnapshot = getCurrentThreadSnapshot();
|
||
Function1<Object, Unit> readObserver = currentThreadSnapshot != null ? currentThreadSnapshot.getReadObserver() : null;
|
||
Snapshot makeCurrentNonObservable = makeCurrentNonObservable(currentThreadSnapshot);
|
||
try {
|
||
return block.invoke();
|
||
} finally {
|
||
InlineMarker.finallyStart(1);
|
||
restoreNonObservable(currentThreadSnapshot, makeCurrentNonObservable, readObserver);
|
||
InlineMarker.finallyEnd(1);
|
||
}
|
||
}
|
||
|
||
private Companion() {
|
||
}
|
||
|
||
@PublishedApi
|
||
public static /* synthetic */ void getCurrentThreadSnapshot$annotations() {
|
||
}
|
||
|
||
public static /* synthetic */ void getPreexistingSnapshotId$annotations() {
|
||
}
|
||
|
||
private final boolean getCanBeReused(TransparentObserverSnapshot transparentObserverSnapshot) {
|
||
return transparentObserverSnapshot.getThreadId$runtime() == Thread_jvmKt.currentThreadId();
|
||
}
|
||
}
|
||
|
||
@Deprecated(message = "Use snapshotId instead", replaceWith = @ReplaceWith(expression = "snapshotId", imports = {}))
|
||
public static /* synthetic */ void getId$annotations() {
|
||
}
|
||
|
||
private static /* synthetic */ void getPinningTrackingHandle$annotations() {
|
||
}
|
||
|
||
@PublishedApi
|
||
public static /* synthetic */ void getReadObserver$annotations() {
|
||
}
|
||
|
||
public /* synthetic */ Snapshot(long j, SnapshotIdSet snapshotIdSet, DefaultConstructorMarker defaultConstructorMarker) {
|
||
this(j, snapshotIdSet);
|
||
}
|
||
|
||
public /* synthetic */ Snapshot(int i, SnapshotIdSet snapshotIdSet, DefaultConstructorMarker defaultConstructorMarker) {
|
||
this(i, snapshotIdSet);
|
||
}
|
||
|
||
@Deprecated(level = DeprecationLevel.HIDDEN, message = "Use id: Long constructor instead")
|
||
private /* synthetic */ Snapshot(int i, SnapshotIdSet snapshotIdSet) {
|
||
this(SnapshotId_jvmKt.toSnapshotId(i), snapshotIdSet, (DefaultConstructorMarker) null);
|
||
}
|
||
}
|