279 lines
13 KiB
Java
279 lines
13 KiB
Java
package androidx.lifecycle;
|
|
|
|
import c.q.a.k.a;
|
|
import d0.l;
|
|
import d0.w.h.a.e;
|
|
import d0.w.h.a.k;
|
|
import d0.z.d.m;
|
|
import kotlin.Unit;
|
|
import kotlin.coroutines.Continuation;
|
|
import kotlin.jvm.functions.Function2;
|
|
import kotlinx.coroutines.CoroutineDispatcher;
|
|
import kotlinx.coroutines.CoroutineScope;
|
|
import s.a.a.n;
|
|
import s.a.a2.c;
|
|
import s.a.j0;
|
|
import s.a.k1;
|
|
import s.a.w0;
|
|
import s.a.z1.d;
|
|
import s.a.z1.g;
|
|
/* compiled from: FlowLiveData.kt */
|
|
@e(c = "androidx.lifecycle.FlowLiveDataConversions$asFlow$1", f = "FlowLiveData.kt", l = {96, 100, 101}, m = "invokeSuspend")
|
|
public final class FlowLiveDataConversions$asFlow$1 extends k implements Function2<c<? super T>, Continuation<? super Unit>, Object> {
|
|
public final /* synthetic */ LiveData $this_asFlow;
|
|
private /* synthetic */ Object L$0;
|
|
public Object L$1;
|
|
public Object L$2;
|
|
public int label;
|
|
|
|
/* compiled from: FlowLiveData.kt */
|
|
@e(c = "androidx.lifecycle.FlowLiveDataConversions$asFlow$1$1", f = "FlowLiveData.kt", l = {}, m = "invokeSuspend")
|
|
/* renamed from: androidx.lifecycle.FlowLiveDataConversions$asFlow$1$1 reason: invalid class name */
|
|
public static final class AnonymousClass1 extends k implements Function2<CoroutineScope, Continuation<? super Unit>, Object> {
|
|
public final /* synthetic */ Observer $observer;
|
|
public int label;
|
|
public final /* synthetic */ FlowLiveDataConversions$asFlow$1 this$0;
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public AnonymousClass1(FlowLiveDataConversions$asFlow$1 flowLiveDataConversions$asFlow$1, Observer observer, Continuation continuation) {
|
|
super(2, continuation);
|
|
this.this$0 = flowLiveDataConversions$asFlow$1;
|
|
this.$observer = observer;
|
|
}
|
|
|
|
@Override // d0.w.h.a.a
|
|
public final Continuation<Unit> create(Object obj, Continuation<?> continuation) {
|
|
m.checkNotNullParameter(continuation, "completion");
|
|
return new AnonymousClass1(this.this$0, this.$observer, continuation);
|
|
}
|
|
|
|
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object, java.lang.Object] */
|
|
@Override // kotlin.jvm.functions.Function2
|
|
public final Object invoke(CoroutineScope coroutineScope, Continuation<? super Unit> continuation) {
|
|
return ((AnonymousClass1) create(coroutineScope, continuation)).invokeSuspend(Unit.a);
|
|
}
|
|
|
|
@Override // d0.w.h.a.a
|
|
public final Object invokeSuspend(Object obj) {
|
|
d0.w.g.c.getCOROUTINE_SUSPENDED();
|
|
if (this.label == 0) {
|
|
l.throwOnFailure(obj);
|
|
this.this$0.$this_asFlow.observeForever(this.$observer);
|
|
return Unit.a;
|
|
}
|
|
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
|
|
}
|
|
}
|
|
|
|
/* compiled from: FlowLiveData.kt */
|
|
@e(c = "androidx.lifecycle.FlowLiveDataConversions$asFlow$1$2", f = "FlowLiveData.kt", l = {}, m = "invokeSuspend")
|
|
/* renamed from: androidx.lifecycle.FlowLiveDataConversions$asFlow$1$2 reason: invalid class name */
|
|
public static final class AnonymousClass2 extends k implements Function2<CoroutineScope, Continuation<? super Unit>, Object> {
|
|
public final /* synthetic */ Observer $observer;
|
|
public int label;
|
|
public final /* synthetic */ FlowLiveDataConversions$asFlow$1 this$0;
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public AnonymousClass2(FlowLiveDataConversions$asFlow$1 flowLiveDataConversions$asFlow$1, Observer observer, Continuation continuation) {
|
|
super(2, continuation);
|
|
this.this$0 = flowLiveDataConversions$asFlow$1;
|
|
this.$observer = observer;
|
|
}
|
|
|
|
@Override // d0.w.h.a.a
|
|
public final Continuation<Unit> create(Object obj, Continuation<?> continuation) {
|
|
m.checkNotNullParameter(continuation, "completion");
|
|
return new AnonymousClass2(this.this$0, this.$observer, continuation);
|
|
}
|
|
|
|
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object, java.lang.Object] */
|
|
@Override // kotlin.jvm.functions.Function2
|
|
public final Object invoke(CoroutineScope coroutineScope, Continuation<? super Unit> continuation) {
|
|
return ((AnonymousClass2) create(coroutineScope, continuation)).invokeSuspend(Unit.a);
|
|
}
|
|
|
|
@Override // d0.w.h.a.a
|
|
public final Object invokeSuspend(Object obj) {
|
|
d0.w.g.c.getCOROUTINE_SUSPENDED();
|
|
if (this.label == 0) {
|
|
l.throwOnFailure(obj);
|
|
this.this$0.$this_asFlow.removeObserver(this.$observer);
|
|
return Unit.a;
|
|
}
|
|
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public FlowLiveDataConversions$asFlow$1(LiveData liveData, Continuation continuation) {
|
|
super(2, continuation);
|
|
this.$this_asFlow = liveData;
|
|
}
|
|
|
|
@Override // d0.w.h.a.a
|
|
public final Continuation<Unit> create(Object obj, Continuation<?> continuation) {
|
|
m.checkNotNullParameter(continuation, "completion");
|
|
FlowLiveDataConversions$asFlow$1 flowLiveDataConversions$asFlow$1 = new FlowLiveDataConversions$asFlow$1(this.$this_asFlow, continuation);
|
|
flowLiveDataConversions$asFlow$1.L$0 = obj;
|
|
return flowLiveDataConversions$asFlow$1;
|
|
}
|
|
|
|
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object, java.lang.Object] */
|
|
@Override // kotlin.jvm.functions.Function2
|
|
public final Object invoke(Object obj, Continuation<? super Unit> continuation) {
|
|
return ((FlowLiveDataConversions$asFlow$1) create(obj, continuation)).invokeSuspend(Unit.a);
|
|
}
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:25:0x009a */
|
|
/* JADX WARNING: Removed duplicated region for block: B:29:0x00a9 A[Catch:{ all -> 0x00da }] */
|
|
@Override // d0.w.h.a.a
|
|
public final Object invokeSuspend(Object obj) {
|
|
FlowLiveDataConversions$asFlow$1 flowLiveDataConversions$asFlow$1;
|
|
Observer observer;
|
|
Throwable th;
|
|
Throwable th2;
|
|
c cVar;
|
|
Observer observer2;
|
|
s.a.z1.e eVar;
|
|
Object obj2;
|
|
FlowLiveDataConversions$asFlow$1 flowLiveDataConversions$asFlow$12;
|
|
s.a.z1.e eVar2;
|
|
c cVar2;
|
|
Object a;
|
|
d dVar;
|
|
Observer observer3;
|
|
Object coroutine_suspended = d0.w.g.c.getCOROUTINE_SUSPENDED();
|
|
int i = this.label;
|
|
if (i == 0) {
|
|
l.throwOnFailure(obj);
|
|
c cVar3 = (c) this.L$0;
|
|
g gVar = new g(null);
|
|
FlowLiveDataConversions$asFlow$1$observer$1 flowLiveDataConversions$asFlow$1$observer$1 = new FlowLiveDataConversions$asFlow$1$observer$1(gVar);
|
|
CoroutineDispatcher coroutineDispatcher = j0.a;
|
|
k1 H = n.b.H();
|
|
AnonymousClass1 r8 = new AnonymousClass1(this, flowLiveDataConversions$asFlow$1$observer$1, null);
|
|
this.L$0 = cVar3;
|
|
this.L$1 = gVar;
|
|
this.L$2 = flowLiveDataConversions$asFlow$1$observer$1;
|
|
this.label = 1;
|
|
if (a.i0(H, r8, this) == coroutine_suspended) {
|
|
return coroutine_suspended;
|
|
}
|
|
dVar = gVar;
|
|
observer3 = flowLiveDataConversions$asFlow$1$observer$1;
|
|
cVar2 = cVar3;
|
|
} else if (i == 1) {
|
|
observer3 = (Observer) this.L$2;
|
|
dVar = (d) this.L$1;
|
|
cVar2 = (c) this.L$0;
|
|
l.throwOnFailure(obj);
|
|
} else if (i == 2) {
|
|
l.throwOnFailure(obj);
|
|
cVar = (c) this.L$0;
|
|
observer2 = (Observer) this.L$1;
|
|
eVar = (s.a.z1.e) this.L$2;
|
|
obj2 = coroutine_suspended;
|
|
flowLiveDataConversions$asFlow$12 = this;
|
|
if (!((Boolean) obj).booleanValue()) {
|
|
}
|
|
w0 w0Var = w0.i;
|
|
CoroutineDispatcher coroutineDispatcher2 = j0.a;
|
|
a.G(w0Var, n.b.H(), null, new AnonymousClass2(flowLiveDataConversions$asFlow$12, observer2, null), 2, null);
|
|
return Unit.a;
|
|
} else if (i == 3) {
|
|
eVar2 = (s.a.z1.e) this.L$2;
|
|
observer = (Observer) this.L$1;
|
|
cVar2 = (c) this.L$0;
|
|
try {
|
|
l.throwOnFailure(obj);
|
|
flowLiveDataConversions$asFlow$1 = this;
|
|
flowLiveDataConversions$asFlow$1.L$0 = cVar2;
|
|
flowLiveDataConversions$asFlow$1.L$1 = observer;
|
|
flowLiveDataConversions$asFlow$1.L$2 = eVar2;
|
|
flowLiveDataConversions$asFlow$1.label = 2;
|
|
a = eVar2.a(flowLiveDataConversions$asFlow$1);
|
|
if (a != coroutine_suspended) {
|
|
flowLiveDataConversions$asFlow$12 = flowLiveDataConversions$asFlow$1;
|
|
obj = a;
|
|
cVar = cVar2;
|
|
observer2 = observer;
|
|
eVar = eVar2;
|
|
obj2 = coroutine_suspended;
|
|
try {
|
|
if (!((Boolean) obj).booleanValue()) {
|
|
Object next = eVar.next();
|
|
flowLiveDataConversions$asFlow$12.L$0 = cVar;
|
|
flowLiveDataConversions$asFlow$12.L$1 = observer2;
|
|
flowLiveDataConversions$asFlow$12.L$2 = eVar;
|
|
flowLiveDataConversions$asFlow$12.label = 3;
|
|
if (cVar.emit(next, flowLiveDataConversions$asFlow$12) != obj2) {
|
|
flowLiveDataConversions$asFlow$1 = flowLiveDataConversions$asFlow$12;
|
|
coroutine_suspended = obj2;
|
|
eVar2 = eVar;
|
|
observer = observer2;
|
|
cVar2 = cVar;
|
|
flowLiveDataConversions$asFlow$1.L$0 = cVar2;
|
|
flowLiveDataConversions$asFlow$1.L$1 = observer;
|
|
flowLiveDataConversions$asFlow$1.L$2 = eVar2;
|
|
flowLiveDataConversions$asFlow$1.label = 2;
|
|
a = eVar2.a(flowLiveDataConversions$asFlow$1);
|
|
if (a != coroutine_suspended) {
|
|
}
|
|
}
|
|
return obj2;
|
|
}
|
|
w0 w0Var = w0.i;
|
|
CoroutineDispatcher coroutineDispatcher2 = j0.a;
|
|
a.G(w0Var, n.b.H(), null, new AnonymousClass2(flowLiveDataConversions$asFlow$12, observer2, null), 2, null);
|
|
return Unit.a;
|
|
} catch (Throwable th3) {
|
|
observer = observer2;
|
|
th = th3;
|
|
flowLiveDataConversions$asFlow$1 = flowLiveDataConversions$asFlow$12;
|
|
w0 w0Var2 = w0.i;
|
|
CoroutineDispatcher coroutineDispatcher3 = j0.a;
|
|
a.G(w0Var2, n.b.H(), null, new AnonymousClass2(flowLiveDataConversions$asFlow$1, observer, null), 2, null);
|
|
throw th;
|
|
}
|
|
}
|
|
return coroutine_suspended;
|
|
} catch (Throwable th4) {
|
|
th2 = th4;
|
|
}
|
|
} else {
|
|
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
|
|
}
|
|
try {
|
|
s.a.z1.e it = dVar.iterator();
|
|
observer = observer3;
|
|
eVar2 = it;
|
|
flowLiveDataConversions$asFlow$1 = this;
|
|
} catch (Throwable th5) {
|
|
th2 = th5;
|
|
observer = observer3;
|
|
th = th2;
|
|
flowLiveDataConversions$asFlow$1 = this;
|
|
w0 w0Var2 = w0.i;
|
|
CoroutineDispatcher coroutineDispatcher3 = j0.a;
|
|
a.G(w0Var2, n.b.H(), null, new AnonymousClass2(flowLiveDataConversions$asFlow$1, observer, null), 2, null);
|
|
throw th;
|
|
}
|
|
try {
|
|
flowLiveDataConversions$asFlow$1.L$0 = cVar2;
|
|
flowLiveDataConversions$asFlow$1.L$1 = observer;
|
|
flowLiveDataConversions$asFlow$1.L$2 = eVar2;
|
|
flowLiveDataConversions$asFlow$1.label = 2;
|
|
a = eVar2.a(flowLiveDataConversions$asFlow$1);
|
|
if (a != coroutine_suspended) {
|
|
}
|
|
return coroutine_suspended;
|
|
} catch (Throwable th6) {
|
|
th = th6;
|
|
w0 w0Var2 = w0.i;
|
|
CoroutineDispatcher coroutineDispatcher3 = j0.a;
|
|
a.G(w0Var2, n.b.H(), null, new AnonymousClass2(flowLiveDataConversions$asFlow$1, observer, null), 2, null);
|
|
throw th;
|
|
}
|
|
}
|
|
}
|