mirror of
https://github.com/VibedByKaKi/alexandroid.git
synced 2026-11-14 09:57:16 +01:00
356 lines
16 KiB
Java
356 lines
16 KiB
Java
package androidx.lifecycle;
|
|
|
|
import androidx.annotation.MainThread;
|
|
import androidx.annotation.RestrictTo;
|
|
import com.amazon.alexa.voice.tta.metrics.SimbaEventProcessor;
|
|
import com.amazon.coral.org.json.XML$$ExternalSyntheticBUOutline0;
|
|
import io.ktor.util.PathKt$$ExternalSyntheticBUOutline0;
|
|
import kotlin.Metadata;
|
|
import kotlin.enums.EnumEntries;
|
|
import kotlin.enums.EnumEntriesKt;
|
|
import kotlin.jvm.JvmStatic;
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
import kotlin.jvm.internal.SourceDebugExtension;
|
|
import kotlinx.coroutines.debug.internal.DebugCoroutineInfoImplKt;
|
|
import kotlinx.coroutines.flow.FlowKt;
|
|
import kotlinx.coroutines.flow.MutableStateFlow;
|
|
import kotlinx.coroutines.flow.StateFlow;
|
|
import kotlinx.coroutines.flow.StateFlowKt;
|
|
import org.jetbrains.annotations.NotNull;
|
|
import org.jetbrains.annotations.Nullable;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
@Metadata(d1 = {"\u00002\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0005\b&\u0018\u00002\u00020\u0001:\u0002\u0017\u0018B\u0007¢\u0006\u0004\b\u0002\u0010\u0003J\u0010\u0010\n\u001a\u00020\u000b2\u0006\u0010\f\u001a\u00020\rH'J\u0010\u0010\u000e\u001a\u00020\u000b2\u0006\u0010\f\u001a\u00020\rH'R\"\u0010\u0004\u001a\n\u0012\u0006\u0012\u0004\u0018\u00010\u00010\u0005X\u0087\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0006\u0010\u0007\"\u0004\b\b\u0010\tR\u0014\u0010\u000f\u001a\u00020\u00108'X¦\u0004¢\u0006\u0006\u001a\u0004\b\u0011\u0010\u0012R\u001a\u0010\u0013\u001a\b\u0012\u0004\u0012\u00020\u00100\u00148VX\u0096\u0004¢\u0006\u0006\u001a\u0004\b\u0015\u0010\u0016¨\u0006\u0019"}, d2 = {"Landroidx/lifecycle/Lifecycle;", "", "<init>", "()V", "internalScopeRef", "Landroidx/lifecycle/AtomicReference;", "getInternalScopeRef", "()Landroidx/lifecycle/AtomicReference;", "setInternalScopeRef", "(Landroidx/lifecycle/AtomicReference;)V", "addObserver", "", "observer", "Landroidx/lifecycle/LifecycleObserver;", "removeObserver", "currentState", "Landroidx/lifecycle/Lifecycle$State;", "getCurrentState", "()Landroidx/lifecycle/Lifecycle$State;", "currentStateFlow", "Lkotlinx/coroutines/flow/StateFlow;", "getCurrentStateFlow", "()Lkotlinx/coroutines/flow/StateFlow;", "Event", "State", "lifecycle-common"}, k = 1, mv = {2, 0, 0}, xi = 48)
|
|
@SourceDebugExtension({"SMAP\nLifecycle.kt\nKotlin\n*S Kotlin\n*F\n+ 1 Lifecycle.kt\nandroidx/lifecycle/Lifecycle\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,379:1\n1#2:380\n*E\n"})
|
|
/* loaded from: classes14.dex */
|
|
public abstract class Lifecycle {
|
|
|
|
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
|
|
@NotNull
|
|
private AtomicReference<Object> internalScopeRef = new AtomicReference<>(null);
|
|
|
|
/* 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\u0014\n\u0002\u0018\u0002\n\u0002\u0010\u0010\n\u0002\b\b\n\u0002\u0010\u000b\n\u0002\b\u0002\b\u0086\u0081\u0002\u0018\u00002\b\u0012\u0004\u0012\u00020\u00000\u0001B\t\b\u0002¢\u0006\u0004\b\u0002\u0010\u0003J\u000e\u0010\t\u001a\u00020\n2\u0006\u0010\u000b\u001a\u00020\u0000j\u0002\b\u0004j\u0002\b\u0005j\u0002\b\u0006j\u0002\b\u0007j\u0002\b\b¨\u0006\f"}, d2 = {"Landroidx/lifecycle/Lifecycle$State;", "", "<init>", "(Ljava/lang/String;I)V", "DESTROYED", "INITIALIZED", DebugCoroutineInfoImplKt.CREATED, SimbaEventProcessor.SOURCE_STARTED, "RESUMED", "isAtLeast", "", "state", "lifecycle-common"}, k = 1, mv = {2, 0, 0}, xi = 48)
|
|
public static final class State {
|
|
private static final /* synthetic */ EnumEntries $ENTRIES;
|
|
private static final /* synthetic */ State[] $VALUES;
|
|
public static final State DESTROYED = new State("DESTROYED", 0);
|
|
public static final State INITIALIZED = new State("INITIALIZED", 1);
|
|
public static final State CREATED = new State(DebugCoroutineInfoImplKt.CREATED, 2);
|
|
public static final State STARTED = new State(SimbaEventProcessor.SOURCE_STARTED, 3);
|
|
public static final State RESUMED = new State("RESUMED", 4);
|
|
|
|
private static final /* synthetic */ State[] $values() {
|
|
return new State[]{DESTROYED, INITIALIZED, CREATED, STARTED, RESUMED};
|
|
}
|
|
|
|
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 final boolean isAtLeast(@NotNull State state) {
|
|
state.getClass();
|
|
return compareTo(state) >= 0;
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public static final void _get_currentStateFlow_$lambda$0(MutableStateFlow mutableStateFlow, LifecycleOwner lifecycleOwner, Event event) {
|
|
lifecycleOwner.getClass();
|
|
event.getClass();
|
|
mutableStateFlow.setValue(event.getTargetState());
|
|
}
|
|
|
|
@MainThread
|
|
public abstract void addObserver(@NotNull LifecycleObserver observer);
|
|
|
|
@MainThread
|
|
@NotNull
|
|
/* renamed from: getCurrentState */
|
|
public abstract State getState();
|
|
|
|
@NotNull
|
|
public StateFlow<State> getCurrentStateFlow() {
|
|
MutableStateFlow MutableStateFlow = StateFlowKt.MutableStateFlow(getState());
|
|
addObserver(new Lifecycle$$ExternalSyntheticLambda0(MutableStateFlow, 0));
|
|
return FlowKt.asStateFlow(MutableStateFlow);
|
|
}
|
|
|
|
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
|
|
@NotNull
|
|
public final AtomicReference<Object> getInternalScopeRef() {
|
|
return this.internalScopeRef;
|
|
}
|
|
|
|
@MainThread
|
|
public abstract void removeObserver(@NotNull LifecycleObserver observer);
|
|
|
|
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
|
|
public final void setInternalScopeRef(@NotNull AtomicReference<Object> atomicReference) {
|
|
atomicReference.getClass();
|
|
this.internalScopeRef = atomicReference;
|
|
}
|
|
|
|
/* 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\u0014\n\u0002\u0018\u0002\n\u0002\u0010\u0010\n\u0002\b\n\n\u0002\u0018\u0002\n\u0002\b\u0004\b\u0086\u0081\u0002\u0018\u0000 \u000f2\b\u0012\u0004\u0012\u00020\u00000\u0001:\u0001\u000fB\t\b\u0002¢\u0006\u0004\b\u0002\u0010\u0003R\u0011\u0010\u000b\u001a\u00020\f8F¢\u0006\u0006\u001a\u0004\b\r\u0010\u000ej\u0002\b\u0004j\u0002\b\u0005j\u0002\b\u0006j\u0002\b\u0007j\u0002\b\bj\u0002\b\tj\u0002\b\n¨\u0006\u0010"}, d2 = {"Landroidx/lifecycle/Lifecycle$Event;", "", "<init>", "(Ljava/lang/String;I)V", "ON_CREATE", "ON_START", "ON_RESUME", "ON_PAUSE", "ON_STOP", "ON_DESTROY", "ON_ANY", "targetState", "Landroidx/lifecycle/Lifecycle$State;", "getTargetState", "()Landroidx/lifecycle/Lifecycle$State;", "Companion", "lifecycle-common"}, k = 1, mv = {2, 0, 0}, xi = 48)
|
|
public static final class Event {
|
|
private static final /* synthetic */ EnumEntries $ENTRIES;
|
|
private static final /* synthetic */ Event[] $VALUES;
|
|
|
|
/* renamed from: Companion, reason: from kotlin metadata */
|
|
@NotNull
|
|
public static final Companion INSTANCE;
|
|
public static final Event ON_CREATE = new Event("ON_CREATE", 0);
|
|
public static final Event ON_START = new Event("ON_START", 1);
|
|
public static final Event ON_RESUME = new Event("ON_RESUME", 2);
|
|
public static final Event ON_PAUSE = new Event("ON_PAUSE", 3);
|
|
public static final Event ON_STOP = new Event("ON_STOP", 4);
|
|
public static final Event ON_DESTROY = new Event("ON_DESTROY", 5);
|
|
public static final Event ON_ANY = new Event("ON_ANY", 6);
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
@Metadata(k = 3, mv = {2, 0, 0}, xi = 48)
|
|
public static final /* synthetic */ class WhenMappings {
|
|
public static final /* synthetic */ int[] $EnumSwitchMapping$0;
|
|
|
|
static {
|
|
int[] iArr = new int[Event.values().length];
|
|
try {
|
|
iArr[Event.ON_CREATE.ordinal()] = 1;
|
|
} catch (NoSuchFieldError unused) {
|
|
}
|
|
try {
|
|
iArr[Event.ON_STOP.ordinal()] = 2;
|
|
} catch (NoSuchFieldError unused2) {
|
|
}
|
|
try {
|
|
iArr[Event.ON_START.ordinal()] = 3;
|
|
} catch (NoSuchFieldError unused3) {
|
|
}
|
|
try {
|
|
iArr[Event.ON_PAUSE.ordinal()] = 4;
|
|
} catch (NoSuchFieldError unused4) {
|
|
}
|
|
try {
|
|
iArr[Event.ON_RESUME.ordinal()] = 5;
|
|
} catch (NoSuchFieldError unused5) {
|
|
}
|
|
try {
|
|
iArr[Event.ON_DESTROY.ordinal()] = 6;
|
|
} catch (NoSuchFieldError unused6) {
|
|
}
|
|
try {
|
|
iArr[Event.ON_ANY.ordinal()] = 7;
|
|
} catch (NoSuchFieldError unused7) {
|
|
}
|
|
$EnumSwitchMapping$0 = iArr;
|
|
}
|
|
}
|
|
|
|
private static final /* synthetic */ Event[] $values() {
|
|
return new Event[]{ON_CREATE, ON_START, ON_RESUME, ON_PAUSE, ON_STOP, ON_DESTROY, ON_ANY};
|
|
}
|
|
|
|
static {
|
|
Event[] $values = $values();
|
|
$VALUES = $values;
|
|
$ENTRIES = EnumEntriesKt.enumEntries($values);
|
|
INSTANCE = new Companion(null);
|
|
}
|
|
|
|
private Event(String str, int i) {
|
|
}
|
|
|
|
@JvmStatic
|
|
@Nullable
|
|
public static final Event downFrom(@NotNull State state) {
|
|
return INSTANCE.downFrom(state);
|
|
}
|
|
|
|
@JvmStatic
|
|
@Nullable
|
|
public static final Event downTo(@NotNull State state) {
|
|
return INSTANCE.downTo(state);
|
|
}
|
|
|
|
@NotNull
|
|
public static EnumEntries<Event> getEntries() {
|
|
return $ENTRIES;
|
|
}
|
|
|
|
@JvmStatic
|
|
@Nullable
|
|
public static final Event upFrom(@NotNull State state) {
|
|
return INSTANCE.upFrom(state);
|
|
}
|
|
|
|
@JvmStatic
|
|
@Nullable
|
|
public static final Event upTo(@NotNull State state) {
|
|
return INSTANCE.upTo(state);
|
|
}
|
|
|
|
public static Event valueOf(String str) {
|
|
return (Event) Enum.valueOf(Event.class, str);
|
|
}
|
|
|
|
public static Event[] values() {
|
|
return (Event[]) $VALUES.clone();
|
|
}
|
|
|
|
@NotNull
|
|
public final State getTargetState() {
|
|
switch (WhenMappings.$EnumSwitchMapping$0[ordinal()]) {
|
|
case 1:
|
|
case 2:
|
|
return State.CREATED;
|
|
case 3:
|
|
case 4:
|
|
return State.STARTED;
|
|
case 5:
|
|
return State.RESUMED;
|
|
case 6:
|
|
return State.DESTROYED;
|
|
case 7:
|
|
XML$$ExternalSyntheticBUOutline0.m(this, " has no target state");
|
|
return null;
|
|
default:
|
|
PathKt$$ExternalSyntheticBUOutline0.m();
|
|
return null;
|
|
}
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
@Metadata(d1 = {"\u0000\u001a\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\b\u0086\u0003\u0018\u00002\u00020\u0001B\t\b\u0002¢\u0006\u0004\b\u0002\u0010\u0003J\u0012\u0010\u0004\u001a\u0004\u0018\u00010\u00052\u0006\u0010\u0006\u001a\u00020\u0007H\u0007J\u0012\u0010\b\u001a\u0004\u0018\u00010\u00052\u0006\u0010\u0006\u001a\u00020\u0007H\u0007J\u0012\u0010\t\u001a\u0004\u0018\u00010\u00052\u0006\u0010\u0006\u001a\u00020\u0007H\u0007J\u0012\u0010\n\u001a\u0004\u0018\u00010\u00052\u0006\u0010\u0006\u001a\u00020\u0007H\u0007¨\u0006\u000b"}, d2 = {"Landroidx/lifecycle/Lifecycle$Event$Companion;", "", "<init>", "()V", "downFrom", "Landroidx/lifecycle/Lifecycle$Event;", "state", "Landroidx/lifecycle/Lifecycle$State;", "downTo", "upFrom", "upTo", "lifecycle-common"}, k = 1, mv = {2, 0, 0}, xi = 48)
|
|
public static final class Companion {
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
@Metadata(k = 3, mv = {2, 0, 0}, xi = 48)
|
|
public static final /* synthetic */ class WhenMappings {
|
|
public static final /* synthetic */ int[] $EnumSwitchMapping$0;
|
|
|
|
static {
|
|
int[] iArr = new int[State.values().length];
|
|
try {
|
|
iArr[State.CREATED.ordinal()] = 1;
|
|
} catch (NoSuchFieldError unused) {
|
|
}
|
|
try {
|
|
iArr[State.STARTED.ordinal()] = 2;
|
|
} catch (NoSuchFieldError unused2) {
|
|
}
|
|
try {
|
|
iArr[State.RESUMED.ordinal()] = 3;
|
|
} catch (NoSuchFieldError unused3) {
|
|
}
|
|
try {
|
|
iArr[State.DESTROYED.ordinal()] = 4;
|
|
} catch (NoSuchFieldError unused4) {
|
|
}
|
|
try {
|
|
iArr[State.INITIALIZED.ordinal()] = 5;
|
|
} catch (NoSuchFieldError unused5) {
|
|
}
|
|
$EnumSwitchMapping$0 = iArr;
|
|
}
|
|
}
|
|
|
|
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
|
this();
|
|
}
|
|
|
|
@JvmStatic
|
|
@Nullable
|
|
public final Event downFrom(@NotNull State state) {
|
|
state.getClass();
|
|
int i = WhenMappings.$EnumSwitchMapping$0[state.ordinal()];
|
|
if (i == 1) {
|
|
return Event.ON_DESTROY;
|
|
}
|
|
if (i == 2) {
|
|
return Event.ON_STOP;
|
|
}
|
|
if (i != 3) {
|
|
return null;
|
|
}
|
|
return Event.ON_PAUSE;
|
|
}
|
|
|
|
@JvmStatic
|
|
@Nullable
|
|
public final Event downTo(@NotNull State state) {
|
|
state.getClass();
|
|
int i = WhenMappings.$EnumSwitchMapping$0[state.ordinal()];
|
|
if (i == 1) {
|
|
return Event.ON_STOP;
|
|
}
|
|
if (i == 2) {
|
|
return Event.ON_PAUSE;
|
|
}
|
|
if (i != 4) {
|
|
return null;
|
|
}
|
|
return Event.ON_DESTROY;
|
|
}
|
|
|
|
@JvmStatic
|
|
@Nullable
|
|
public final Event upFrom(@NotNull State state) {
|
|
state.getClass();
|
|
int i = WhenMappings.$EnumSwitchMapping$0[state.ordinal()];
|
|
if (i == 1) {
|
|
return Event.ON_START;
|
|
}
|
|
if (i == 2) {
|
|
return Event.ON_RESUME;
|
|
}
|
|
if (i != 5) {
|
|
return null;
|
|
}
|
|
return Event.ON_CREATE;
|
|
}
|
|
|
|
@JvmStatic
|
|
@Nullable
|
|
public final Event upTo(@NotNull State state) {
|
|
state.getClass();
|
|
int i = WhenMappings.$EnumSwitchMapping$0[state.ordinal()];
|
|
if (i == 1) {
|
|
return Event.ON_CREATE;
|
|
}
|
|
if (i == 2) {
|
|
return Event.ON_START;
|
|
}
|
|
if (i != 3) {
|
|
return null;
|
|
}
|
|
return Event.ON_RESUME;
|
|
}
|
|
|
|
private Companion() {
|
|
}
|
|
}
|
|
}
|
|
}
|