package androidx.room; import java.util.Set; import java.util.concurrent.atomic.AtomicBoolean; import kotlin.KotlinNothingValueException; import kotlin.ResultKt; import kotlin.Unit; import kotlin.collections.ArraysKt___ArraysKt; import kotlin.coroutines.Continuation; import kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsKt; import kotlin.coroutines.jvm.internal.DebugMetadata; import kotlin.coroutines.jvm.internal.SuspendLambda; import kotlin.jvm.functions.Function2; import kotlinx.coroutines.CoroutineScope; import kotlinx.coroutines.DelayKt; import kotlinx.coroutines.channels.ProducerScope; @DebugMetadata(c = "androidx.room.RoomDatabaseKt$invalidationTrackerFlow$1$job$1", f = "RoomDatabaseExt.kt", l = {230}, m = "invokeSuspend") /* loaded from: classes.dex */ public final class RoomDatabaseKt$invalidationTrackerFlow$1$job$1 extends SuspendLambda implements Function2 { final /* synthetic */ ProducerScope $$this$callbackFlow; final /* synthetic */ boolean $emitInitialState; final /* synthetic */ AtomicBoolean $ignoreInvalidation; final /* synthetic */ RoomDatabaseKt$invalidationTrackerFlow$1$observer$1 $observer; final /* synthetic */ String[] $tables; final /* synthetic */ RoomDatabase $this_invalidationTrackerFlow; int label; /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ public RoomDatabaseKt$invalidationTrackerFlow$1$job$1(RoomDatabase roomDatabase, RoomDatabaseKt$invalidationTrackerFlow$1$observer$1 roomDatabaseKt$invalidationTrackerFlow$1$observer$1, boolean z, ProducerScope producerScope, String[] strArr, AtomicBoolean atomicBoolean, Continuation continuation) { super(2, continuation); this.$this_invalidationTrackerFlow = roomDatabase; this.$observer = roomDatabaseKt$invalidationTrackerFlow$1$observer$1; this.$emitInitialState = z; this.$$this$callbackFlow = producerScope; this.$tables = strArr; this.$ignoreInvalidation = atomicBoolean; } @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl public final Continuation create(Object obj, Continuation continuation) { return new RoomDatabaseKt$invalidationTrackerFlow$1$job$1(this.$this_invalidationTrackerFlow, this.$observer, this.$emitInitialState, this.$$this$callbackFlow, this.$tables, this.$ignoreInvalidation, continuation); } @Override // kotlin.jvm.functions.Function2 public final Object invoke(CoroutineScope coroutineScope, Continuation continuation) { return ((RoomDatabaseKt$invalidationTrackerFlow$1$job$1) create(coroutineScope, continuation)).invokeSuspend(Unit.INSTANCE); } @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl public final Object invokeSuspend(Object obj) { Object coroutine_suspended; Set set; coroutine_suspended = IntrinsicsKt__IntrinsicsKt.getCOROUTINE_SUSPENDED(); int i = this.label; try { if (i == 0) { ResultKt.throwOnFailure(obj); this.$this_invalidationTrackerFlow.getInvalidationTracker().addObserver(this.$observer); if (this.$emitInitialState) { ProducerScope producerScope = this.$$this$callbackFlow; set = ArraysKt___ArraysKt.toSet(this.$tables); producerScope.mo4126trySendJP2dKIU(set); } this.$ignoreInvalidation.set(false); this.label = 1; if (DelayKt.awaitCancellation(this) == coroutine_suspended) { return coroutine_suspended; } } else { if (i != 1) { throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine"); } ResultKt.throwOnFailure(obj); } throw new KotlinNothingValueException(); } catch (Throwable th) { this.$this_invalidationTrackerFlow.getInvalidationTracker().removeObserver(this.$observer); throw th; } } }