53 lines
2.8 KiB
Java
53 lines
2.8 KiB
Java
package androidx.lifecycle;
|
|
|
|
import androidx.lifecycle.Lifecycle;
|
|
import d0.k;
|
|
import d0.l;
|
|
import d0.z.d.m;
|
|
import kotlin.jvm.functions.Function0;
|
|
import kotlinx.coroutines.CancellableContinuation;
|
|
import kotlinx.coroutines.CoroutineDispatcher;
|
|
/* compiled from: WithLifecycleState.kt */
|
|
public final class WithLifecycleStateKt$suspendWithStateAtLeastUnchecked$$inlined$suspendCancellableCoroutine$lambda$1 implements LifecycleEventObserver {
|
|
public final /* synthetic */ Function0 $block$inlined;
|
|
public final /* synthetic */ CancellableContinuation $co;
|
|
public final /* synthetic */ boolean $dispatchNeeded$inlined;
|
|
public final /* synthetic */ CoroutineDispatcher $lifecycleDispatcher$inlined;
|
|
public final /* synthetic */ Lifecycle.State $state$inlined;
|
|
public final /* synthetic */ Lifecycle $this_suspendWithStateAtLeastUnchecked$inlined;
|
|
|
|
public WithLifecycleStateKt$suspendWithStateAtLeastUnchecked$$inlined$suspendCancellableCoroutine$lambda$1(CancellableContinuation cancellableContinuation, Lifecycle lifecycle, Lifecycle.State state, Function0 function0, boolean z2, CoroutineDispatcher coroutineDispatcher) {
|
|
this.$co = cancellableContinuation;
|
|
this.$this_suspendWithStateAtLeastUnchecked$inlined = lifecycle;
|
|
this.$state$inlined = state;
|
|
this.$block$inlined = function0;
|
|
this.$dispatchNeeded$inlined = z2;
|
|
this.$lifecycleDispatcher$inlined = coroutineDispatcher;
|
|
}
|
|
|
|
@Override // androidx.lifecycle.LifecycleEventObserver
|
|
public void onStateChanged(LifecycleOwner lifecycleOwner, Lifecycle.Event event) {
|
|
Object obj;
|
|
m.checkNotNullParameter(lifecycleOwner, "source");
|
|
m.checkNotNullParameter(event, "event");
|
|
if (event == Lifecycle.Event.upTo(this.$state$inlined)) {
|
|
this.$this_suspendWithStateAtLeastUnchecked$inlined.removeObserver(this);
|
|
CancellableContinuation cancellableContinuation = this.$co;
|
|
Function0 function0 = this.$block$inlined;
|
|
try {
|
|
k.a aVar = k.j;
|
|
obj = k.m72constructorimpl(function0.mo1invoke());
|
|
} catch (Throwable th) {
|
|
k.a aVar2 = k.j;
|
|
obj = k.m72constructorimpl(l.createFailure(th));
|
|
}
|
|
cancellableContinuation.resumeWith(obj);
|
|
} else if (event == Lifecycle.Event.ON_DESTROY) {
|
|
this.$this_suspendWithStateAtLeastUnchecked$inlined.removeObserver(this);
|
|
CancellableContinuation cancellableContinuation2 = this.$co;
|
|
LifecycleDestroyedException lifecycleDestroyedException = new LifecycleDestroyedException();
|
|
k.a aVar3 = k.j;
|
|
cancellableContinuation2.resumeWith(k.m72constructorimpl(l.createFailure(lifecycleDestroyedException)));
|
|
}
|
|
}
|
|
}
|