271 lines
12 KiB
Java
271 lines
12 KiB
Java
package androidx.lifecycle;
|
|
|
|
import d0.l;
|
|
import d0.w.h.c;
|
|
import d0.w.i.a.e;
|
|
import d0.w.i.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.b2.f;
|
|
import s.a.b2.g;
|
|
import s.a.k0;
|
|
import s.a.l1;
|
|
import s.a.x0;
|
|
/* 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<s.a.c2.e<? 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.i.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.i.a.a
|
|
public final Object invokeSuspend(Object obj) {
|
|
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.i.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.i.a.a
|
|
public final Object invokeSuspend(Object obj) {
|
|
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.i.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:27:0x0098 */
|
|
/* JADX WARNING: Removed duplicated region for block: B:31:0x00a5 A[Catch:{ all -> 0x00d4 }] */
|
|
@Override // d0.w.i.a.a
|
|
public final Object invokeSuspend(Object obj) {
|
|
Throwable th;
|
|
Observer observer;
|
|
FlowLiveDataConversions$asFlow$1 flowLiveDataConversions$asFlow$1;
|
|
s.a.c2.e eVar;
|
|
Observer observer2;
|
|
g gVar;
|
|
g gVar2;
|
|
s.a.c2.e eVar2;
|
|
Object a;
|
|
f fVar;
|
|
Observer observer3;
|
|
Object coroutine_suspended = c.getCOROUTINE_SUSPENDED();
|
|
int i = this.label;
|
|
if (i == 0) {
|
|
l.throwOnFailure(obj);
|
|
eVar2 = (s.a.c2.e) this.L$0;
|
|
f b = c.i.a.f.e.o.f.b(-1, null, null, 6);
|
|
observer3 = new FlowLiveDataConversions$asFlow$1$observer$1(b);
|
|
CoroutineDispatcher coroutineDispatcher = k0.a;
|
|
l1 H = n.b.H();
|
|
AnonymousClass1 r8 = new AnonymousClass1(this, observer3, null);
|
|
this.L$0 = eVar2;
|
|
this.L$1 = b;
|
|
this.L$2 = observer3;
|
|
this.label = 1;
|
|
if (c.i.a.f.e.o.f.t1(H, r8, this) == coroutine_suspended) {
|
|
return coroutine_suspended;
|
|
}
|
|
fVar = b;
|
|
} else if (i == 1) {
|
|
observer3 = (Observer) this.L$2;
|
|
fVar = (f) this.L$1;
|
|
eVar2 = (s.a.c2.e) this.L$0;
|
|
l.throwOnFailure(obj);
|
|
} else if (i == 2) {
|
|
l.throwOnFailure(obj);
|
|
eVar = (s.a.c2.e) this.L$0;
|
|
observer2 = (Observer) this.L$1;
|
|
gVar = (g) this.L$2;
|
|
flowLiveDataConversions$asFlow$1 = this;
|
|
if (!((Boolean) obj).booleanValue()) {
|
|
}
|
|
x0 x0Var = x0.j;
|
|
CoroutineDispatcher coroutineDispatcher2 = k0.a;
|
|
c.i.a.f.e.o.f.F0(x0Var, n.b.H(), null, new AnonymousClass2(flowLiveDataConversions$asFlow$1, observer2, null), 2, null);
|
|
return Unit.a;
|
|
} else if (i == 3) {
|
|
g gVar3 = (g) this.L$2;
|
|
observer = (Observer) this.L$1;
|
|
eVar2 = (s.a.c2.e) this.L$0;
|
|
try {
|
|
l.throwOnFailure(obj);
|
|
gVar2 = gVar3;
|
|
flowLiveDataConversions$asFlow$1 = this;
|
|
flowLiveDataConversions$asFlow$1.L$0 = eVar2;
|
|
flowLiveDataConversions$asFlow$1.L$1 = observer;
|
|
flowLiveDataConversions$asFlow$1.L$2 = gVar2;
|
|
flowLiveDataConversions$asFlow$1.label = 2;
|
|
a = gVar2.a(flowLiveDataConversions$asFlow$1);
|
|
if (a != coroutine_suspended) {
|
|
gVar = gVar2;
|
|
obj = a;
|
|
eVar = eVar2;
|
|
observer2 = observer;
|
|
try {
|
|
if (!((Boolean) obj).booleanValue()) {
|
|
Object next = gVar.next();
|
|
flowLiveDataConversions$asFlow$1.L$0 = eVar;
|
|
flowLiveDataConversions$asFlow$1.L$1 = observer2;
|
|
flowLiveDataConversions$asFlow$1.L$2 = gVar;
|
|
flowLiveDataConversions$asFlow$1.label = 3;
|
|
if (eVar.emit(next, flowLiveDataConversions$asFlow$1) != coroutine_suspended) {
|
|
gVar2 = gVar;
|
|
observer = observer2;
|
|
eVar2 = eVar;
|
|
flowLiveDataConversions$asFlow$1.L$0 = eVar2;
|
|
flowLiveDataConversions$asFlow$1.L$1 = observer;
|
|
flowLiveDataConversions$asFlow$1.L$2 = gVar2;
|
|
flowLiveDataConversions$asFlow$1.label = 2;
|
|
a = gVar2.a(flowLiveDataConversions$asFlow$1);
|
|
if (a != coroutine_suspended) {
|
|
}
|
|
}
|
|
return coroutine_suspended;
|
|
}
|
|
x0 x0Var = x0.j;
|
|
CoroutineDispatcher coroutineDispatcher2 = k0.a;
|
|
c.i.a.f.e.o.f.F0(x0Var, n.b.H(), null, new AnonymousClass2(flowLiveDataConversions$asFlow$1, observer2, null), 2, null);
|
|
return Unit.a;
|
|
} catch (Throwable th2) {
|
|
th = th2;
|
|
observer = observer2;
|
|
x0 x0Var2 = x0.j;
|
|
CoroutineDispatcher coroutineDispatcher3 = k0.a;
|
|
c.i.a.f.e.o.f.F0(x0Var2, n.b.H(), null, new AnonymousClass2(flowLiveDataConversions$asFlow$1, observer, null), 2, null);
|
|
throw th;
|
|
}
|
|
}
|
|
return coroutine_suspended;
|
|
} catch (Throwable th3) {
|
|
th = th3;
|
|
flowLiveDataConversions$asFlow$1 = this;
|
|
x0 x0Var2 = x0.j;
|
|
CoroutineDispatcher coroutineDispatcher3 = k0.a;
|
|
c.i.a.f.e.o.f.F0(x0Var2, n.b.H(), null, new AnonymousClass2(flowLiveDataConversions$asFlow$1, observer, null), 2, null);
|
|
throw th;
|
|
}
|
|
} else {
|
|
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
|
|
}
|
|
try {
|
|
gVar2 = fVar.iterator();
|
|
observer = observer3;
|
|
flowLiveDataConversions$asFlow$1 = this;
|
|
} catch (Throwable th4) {
|
|
th = th4;
|
|
observer = observer3;
|
|
flowLiveDataConversions$asFlow$1 = this;
|
|
x0 x0Var2 = x0.j;
|
|
CoroutineDispatcher coroutineDispatcher3 = k0.a;
|
|
c.i.a.f.e.o.f.F0(x0Var2, n.b.H(), null, new AnonymousClass2(flowLiveDataConversions$asFlow$1, observer, null), 2, null);
|
|
throw th;
|
|
}
|
|
try {
|
|
flowLiveDataConversions$asFlow$1.L$0 = eVar2;
|
|
flowLiveDataConversions$asFlow$1.L$1 = observer;
|
|
flowLiveDataConversions$asFlow$1.L$2 = gVar2;
|
|
flowLiveDataConversions$asFlow$1.label = 2;
|
|
a = gVar2.a(flowLiveDataConversions$asFlow$1);
|
|
if (a != coroutine_suspended) {
|
|
}
|
|
return coroutine_suspended;
|
|
} catch (Throwable th5) {
|
|
th = th5;
|
|
x0 x0Var2 = x0.j;
|
|
CoroutineDispatcher coroutineDispatcher3 = k0.a;
|
|
c.i.a.f.e.o.f.F0(x0Var2, n.b.H(), null, new AnonymousClass2(flowLiveDataConversions$asFlow$1, observer, null), 2, null);
|
|
throw th;
|
|
}
|
|
}
|
|
}
|