- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
256 lines
17 KiB
Java
256 lines
17 KiB
Java
package androidx.work.impl.model;
|
|
|
|
import com.vungle.ads.internal.protos.Sdk;
|
|
import java.util.UUID;
|
|
import kotlin.Unit;
|
|
import kotlin.collections.CollectionsKt__CollectionsJVMKt;
|
|
import kotlin.coroutines.Continuation;
|
|
import kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsKt;
|
|
import kotlin.coroutines.jvm.internal.ContinuationImpl;
|
|
import kotlin.coroutines.jvm.internal.DebugMetadata;
|
|
import kotlin.jvm.internal.Intrinsics;
|
|
import kotlin.jvm.internal.SourceDebugExtension;
|
|
import kotlinx.coroutines.CoroutineDispatcher;
|
|
import kotlinx.coroutines.flow.Flow;
|
|
import kotlinx.coroutines.flow.FlowCollector;
|
|
import kotlinx.coroutines.flow.FlowKt;
|
|
|
|
@SourceDebugExtension({"SMAP\nWorkSpecDao.kt\nKotlin\n*S Kotlin\n*F\n+ 1 WorkSpecDao.kt\nandroidx/work/impl/model/WorkSpecDaoKt\n+ 2 Transform.kt\nkotlinx/coroutines/flow/FlowKt__TransformKt\n+ 3 Emitters.kt\nkotlinx/coroutines/flow/FlowKt__EmittersKt\n+ 4 SafeCollector.common.kt\nkotlinx/coroutines/flow/internal/SafeCollector_commonKt\n*L\n1#1,511:1\n53#2:512\n55#2:516\n53#2:517\n55#2:521\n50#3:513\n55#3:515\n50#3:518\n55#3:520\n107#4:514\n107#4:519\n*S KotlinDebug\n*F\n+ 1 WorkSpecDao.kt\nandroidx/work/impl/model/WorkSpecDaoKt\n*L\n475#1:512\n475#1:516\n491#1:517\n491#1:521\n475#1:513\n475#1:515\n491#1:518\n491#1:520\n475#1:514\n491#1:519\n*E\n"})
|
|
/* loaded from: classes.dex */
|
|
public final class WorkSpecDaoKt {
|
|
private static final String WORK_INFO_BY_IDS = "SELECT id, state, output, run_attempt_count, generation, required_network_type, required_network_request, requires_charging, requires_device_idle, requires_battery_not_low, requires_storage_not_low, trigger_content_update_delay, trigger_max_content_delay, content_uri_triggers, initial_delay, interval_duration, flex_duration, backoff_policy, backoff_delay_duration, last_enqueue_time, period_count, next_schedule_time_override, stop_reason FROM workspec WHERE id IN (:ids)";
|
|
private static final String WORK_INFO_BY_NAME = "SELECT id, state, output, run_attempt_count, generation, required_network_type, required_network_request, requires_charging, requires_device_idle, requires_battery_not_low, requires_storage_not_low, trigger_content_update_delay, trigger_max_content_delay, content_uri_triggers, initial_delay, interval_duration, flex_duration, backoff_policy, backoff_delay_duration, last_enqueue_time, period_count, next_schedule_time_override, stop_reason FROM workspec WHERE id IN (SELECT work_spec_id FROM workname WHERE name=:name)";
|
|
private static final String WORK_INFO_BY_TAG = "SELECT id, state, output, run_attempt_count, generation, required_network_type, required_network_request, requires_charging, requires_device_idle, requires_battery_not_low, requires_storage_not_low, trigger_content_update_delay, trigger_max_content_delay, content_uri_triggers, initial_delay, interval_duration, flex_duration, backoff_policy, backoff_delay_duration, last_enqueue_time, period_count, next_schedule_time_override, stop_reason FROM workspec WHERE id IN\n (SELECT work_spec_id FROM worktag WHERE tag=:tag)";
|
|
private static final String WORK_INFO_COLUMNS = "id, state, output, run_attempt_count, generation, required_network_type, required_network_request, requires_charging, requires_device_idle, requires_battery_not_low, requires_storage_not_low, trigger_content_update_delay, trigger_max_content_delay, content_uri_triggers, initial_delay, interval_duration, flex_duration, backoff_policy, backoff_delay_duration, last_enqueue_time, period_count, next_schedule_time_override, stop_reason";
|
|
|
|
public static final Flow dedup(final Flow flow, CoroutineDispatcher dispatcher) {
|
|
Intrinsics.checkNotNullParameter(flow, "<this>");
|
|
Intrinsics.checkNotNullParameter(dispatcher, "dispatcher");
|
|
return FlowKt.flowOn(FlowKt.distinctUntilChanged(new Flow() { // from class: androidx.work.impl.model.WorkSpecDaoKt$dedup$$inlined$map$1
|
|
@Override // kotlinx.coroutines.flow.Flow
|
|
public Object collect(FlowCollector flowCollector, Continuation continuation) {
|
|
Object coroutine_suspended;
|
|
Object collect = Flow.this.collect(new AnonymousClass2(flowCollector), continuation);
|
|
coroutine_suspended = IntrinsicsKt__IntrinsicsKt.getCOROUTINE_SUSPENDED();
|
|
return collect == coroutine_suspended ? collect : Unit.INSTANCE;
|
|
}
|
|
|
|
@SourceDebugExtension({"SMAP\nEmitters.kt\nKotlin\n*S Kotlin\n*F\n+ 1 Emitters.kt\nkotlinx/coroutines/flow/FlowKt__EmittersKt$unsafeTransform$1$1\n+ 2 Transform.kt\nkotlinx/coroutines/flow/FlowKt__TransformKt\n+ 3 WorkSpecDao.kt\nandroidx/work/impl/model/WorkSpecDaoKt\n+ 4 _Collections.kt\nkotlin/collections/CollectionsKt___CollectionsKt\n*L\n1#1,222:1\n54#2:223\n491#3:224\n1549#4:225\n1620#4,3:226\n*S KotlinDebug\n*F\n+ 1 WorkSpecDao.kt\nandroidx/work/impl/model/WorkSpecDaoKt\n*L\n491#1:225\n491#1:226,3\n*E\n"})
|
|
/* renamed from: androidx.work.impl.model.WorkSpecDaoKt$dedup$$inlined$map$1$2, reason: invalid class name */
|
|
public static final class AnonymousClass2<T> implements FlowCollector {
|
|
final /* synthetic */ FlowCollector $this_unsafeFlow;
|
|
|
|
@DebugMetadata(c = "androidx.work.impl.model.WorkSpecDaoKt$dedup$$inlined$map$1$2", f = "WorkSpecDao.kt", l = {Sdk.SDKError.Reason.STALE_CACHED_RESPONSE_VALUE}, m = "emit")
|
|
/* renamed from: androidx.work.impl.model.WorkSpecDaoKt$dedup$$inlined$map$1$2$1, reason: invalid class name */
|
|
public static final class AnonymousClass1 extends ContinuationImpl {
|
|
Object L$0;
|
|
int label;
|
|
/* synthetic */ Object result;
|
|
|
|
public AnonymousClass1(Continuation continuation) {
|
|
super(continuation);
|
|
}
|
|
|
|
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
|
public final Object invokeSuspend(Object obj) {
|
|
this.result = obj;
|
|
this.label |= Integer.MIN_VALUE;
|
|
return AnonymousClass2.this.emit(null, this);
|
|
}
|
|
}
|
|
|
|
public AnonymousClass2(FlowCollector flowCollector) {
|
|
this.$this_unsafeFlow = flowCollector;
|
|
}
|
|
|
|
/* JADX WARN: Removed duplicated region for block: B:15:0x0031 */
|
|
/* JADX WARN: Removed duplicated region for block: B:8:0x0023 */
|
|
@Override // kotlinx.coroutines.flow.FlowCollector
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct add '--show-bad-code' argument
|
|
*/
|
|
public final java.lang.Object emit(java.lang.Object r6, kotlin.coroutines.Continuation r7) {
|
|
/*
|
|
r5 = this;
|
|
boolean r0 = r7 instanceof androidx.work.impl.model.WorkSpecDaoKt$dedup$$inlined$map$1.AnonymousClass2.AnonymousClass1
|
|
if (r0 == 0) goto L13
|
|
r0 = r7
|
|
androidx.work.impl.model.WorkSpecDaoKt$dedup$$inlined$map$1$2$1 r0 = (androidx.work.impl.model.WorkSpecDaoKt$dedup$$inlined$map$1.AnonymousClass2.AnonymousClass1) r0
|
|
int r1 = r0.label
|
|
r2 = -2147483648(0xffffffff80000000, float:-0.0)
|
|
r3 = r1 & r2
|
|
if (r3 == 0) goto L13
|
|
int r1 = r1 - r2
|
|
r0.label = r1
|
|
goto L18
|
|
L13:
|
|
androidx.work.impl.model.WorkSpecDaoKt$dedup$$inlined$map$1$2$1 r0 = new androidx.work.impl.model.WorkSpecDaoKt$dedup$$inlined$map$1$2$1
|
|
r0.<init>(r7)
|
|
L18:
|
|
java.lang.Object r7 = r0.result
|
|
java.lang.Object r1 = kotlin.coroutines.intrinsics.IntrinsicsKt.getCOROUTINE_SUSPENDED()
|
|
int r2 = r0.label
|
|
r3 = 1
|
|
if (r2 == 0) goto L31
|
|
if (r2 != r3) goto L29
|
|
kotlin.ResultKt.throwOnFailure(r7)
|
|
goto L66
|
|
L29:
|
|
java.lang.IllegalStateException r6 = new java.lang.IllegalStateException
|
|
java.lang.String r7 = "call to 'resume' before 'invoke' with coroutine"
|
|
r6.<init>(r7)
|
|
throw r6
|
|
L31:
|
|
kotlin.ResultKt.throwOnFailure(r7)
|
|
kotlinx.coroutines.flow.FlowCollector r7 = r5.$this_unsafeFlow
|
|
java.util.List r6 = (java.util.List) r6
|
|
java.lang.Iterable r6 = (java.lang.Iterable) r6
|
|
java.util.ArrayList r2 = new java.util.ArrayList
|
|
r4 = 10
|
|
int r4 = kotlin.collections.CollectionsKt.collectionSizeOrDefault(r6, r4)
|
|
r2.<init>(r4)
|
|
java.util.Iterator r6 = r6.iterator()
|
|
L49:
|
|
boolean r4 = r6.hasNext()
|
|
if (r4 == 0) goto L5d
|
|
java.lang.Object r4 = r6.next()
|
|
androidx.work.impl.model.WorkSpec$WorkInfoPojo r4 = (androidx.work.impl.model.WorkSpec.WorkInfoPojo) r4
|
|
androidx.work.WorkInfo r4 = r4.toWorkInfo()
|
|
r2.add(r4)
|
|
goto L49
|
|
L5d:
|
|
r0.label = r3
|
|
java.lang.Object r6 = r7.emit(r2, r0)
|
|
if (r6 != r1) goto L66
|
|
return r1
|
|
L66:
|
|
kotlin.Unit r6 = kotlin.Unit.INSTANCE
|
|
return r6
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: androidx.work.impl.model.WorkSpecDaoKt$dedup$$inlined$map$1.AnonymousClass2.emit(java.lang.Object, kotlin.coroutines.Continuation):java.lang.Object");
|
|
}
|
|
}
|
|
}), dispatcher);
|
|
}
|
|
|
|
public static final Flow getWorkStatusPojoFlowDataForIds(WorkSpecDao workSpecDao, UUID id) {
|
|
Intrinsics.checkNotNullParameter(workSpecDao, "<this>");
|
|
Intrinsics.checkNotNullParameter(id, "id");
|
|
final Flow workStatusPojoFlowDataForIds = workSpecDao.getWorkStatusPojoFlowDataForIds(CollectionsKt__CollectionsJVMKt.listOf(String.valueOf(id)));
|
|
return FlowKt.distinctUntilChanged(new Flow() { // from class: androidx.work.impl.model.WorkSpecDaoKt$getWorkStatusPojoFlowDataForIds$$inlined$map$1
|
|
@Override // kotlinx.coroutines.flow.Flow
|
|
public Object collect(FlowCollector flowCollector, Continuation continuation) {
|
|
Object coroutine_suspended;
|
|
Object collect = Flow.this.collect(new AnonymousClass2(flowCollector), continuation);
|
|
coroutine_suspended = IntrinsicsKt__IntrinsicsKt.getCOROUTINE_SUSPENDED();
|
|
return collect == coroutine_suspended ? collect : Unit.INSTANCE;
|
|
}
|
|
|
|
@SourceDebugExtension({"SMAP\nEmitters.kt\nKotlin\n*S Kotlin\n*F\n+ 1 Emitters.kt\nkotlinx/coroutines/flow/FlowKt__EmittersKt$unsafeTransform$1$1\n+ 2 Transform.kt\nkotlinx/coroutines/flow/FlowKt__TransformKt\n+ 3 WorkSpecDao.kt\nandroidx/work/impl/model/WorkSpecDaoKt\n*L\n1#1,222:1\n54#2:223\n475#3:224\n*E\n"})
|
|
/* renamed from: androidx.work.impl.model.WorkSpecDaoKt$getWorkStatusPojoFlowDataForIds$$inlined$map$1$2, reason: invalid class name */
|
|
public static final class AnonymousClass2<T> implements FlowCollector {
|
|
final /* synthetic */ FlowCollector $this_unsafeFlow;
|
|
|
|
@DebugMetadata(c = "androidx.work.impl.model.WorkSpecDaoKt$getWorkStatusPojoFlowDataForIds$$inlined$map$1$2", f = "WorkSpecDao.kt", l = {Sdk.SDKError.Reason.STALE_CACHED_RESPONSE_VALUE}, m = "emit")
|
|
/* renamed from: androidx.work.impl.model.WorkSpecDaoKt$getWorkStatusPojoFlowDataForIds$$inlined$map$1$2$1, reason: invalid class name */
|
|
public static final class AnonymousClass1 extends ContinuationImpl {
|
|
Object L$0;
|
|
int label;
|
|
/* synthetic */ Object result;
|
|
|
|
public AnonymousClass1(Continuation continuation) {
|
|
super(continuation);
|
|
}
|
|
|
|
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
|
public final Object invokeSuspend(Object obj) {
|
|
this.result = obj;
|
|
this.label |= Integer.MIN_VALUE;
|
|
return AnonymousClass2.this.emit(null, this);
|
|
}
|
|
}
|
|
|
|
public AnonymousClass2(FlowCollector flowCollector) {
|
|
this.$this_unsafeFlow = flowCollector;
|
|
}
|
|
|
|
/* JADX WARN: Removed duplicated region for block: B:15:0x0031 */
|
|
/* JADX WARN: Removed duplicated region for block: B:8:0x0023 */
|
|
@Override // kotlinx.coroutines.flow.FlowCollector
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct add '--show-bad-code' argument
|
|
*/
|
|
public final java.lang.Object emit(java.lang.Object r5, kotlin.coroutines.Continuation r6) {
|
|
/*
|
|
r4 = this;
|
|
boolean r0 = r6 instanceof androidx.work.impl.model.WorkSpecDaoKt$getWorkStatusPojoFlowDataForIds$$inlined$map$1.AnonymousClass2.AnonymousClass1
|
|
if (r0 == 0) goto L13
|
|
r0 = r6
|
|
androidx.work.impl.model.WorkSpecDaoKt$getWorkStatusPojoFlowDataForIds$$inlined$map$1$2$1 r0 = (androidx.work.impl.model.WorkSpecDaoKt$getWorkStatusPojoFlowDataForIds$$inlined$map$1.AnonymousClass2.AnonymousClass1) r0
|
|
int r1 = r0.label
|
|
r2 = -2147483648(0xffffffff80000000, float:-0.0)
|
|
r3 = r1 & r2
|
|
if (r3 == 0) goto L13
|
|
int r1 = r1 - r2
|
|
r0.label = r1
|
|
goto L18
|
|
L13:
|
|
androidx.work.impl.model.WorkSpecDaoKt$getWorkStatusPojoFlowDataForIds$$inlined$map$1$2$1 r0 = new androidx.work.impl.model.WorkSpecDaoKt$getWorkStatusPojoFlowDataForIds$$inlined$map$1$2$1
|
|
r0.<init>(r6)
|
|
L18:
|
|
java.lang.Object r6 = r0.result
|
|
java.lang.Object r1 = kotlin.coroutines.intrinsics.IntrinsicsKt.getCOROUTINE_SUSPENDED()
|
|
int r2 = r0.label
|
|
r3 = 1
|
|
if (r2 == 0) goto L31
|
|
if (r2 != r3) goto L29
|
|
kotlin.ResultKt.throwOnFailure(r6)
|
|
goto L4f
|
|
L29:
|
|
java.lang.IllegalStateException r5 = new java.lang.IllegalStateException
|
|
java.lang.String r6 = "call to 'resume' before 'invoke' with coroutine"
|
|
r5.<init>(r6)
|
|
throw r5
|
|
L31:
|
|
kotlin.ResultKt.throwOnFailure(r6)
|
|
kotlinx.coroutines.flow.FlowCollector r6 = r4.$this_unsafeFlow
|
|
java.util.List r5 = (java.util.List) r5
|
|
java.lang.Object r5 = kotlin.collections.CollectionsKt.firstOrNull(r5)
|
|
androidx.work.impl.model.WorkSpec$WorkInfoPojo r5 = (androidx.work.impl.model.WorkSpec.WorkInfoPojo) r5
|
|
if (r5 == 0) goto L45
|
|
androidx.work.WorkInfo r5 = r5.toWorkInfo()
|
|
goto L46
|
|
L45:
|
|
r5 = 0
|
|
L46:
|
|
r0.label = r3
|
|
java.lang.Object r5 = r6.emit(r5, r0)
|
|
if (r5 != r1) goto L4f
|
|
return r1
|
|
L4f:
|
|
kotlin.Unit r5 = kotlin.Unit.INSTANCE
|
|
return r5
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: androidx.work.impl.model.WorkSpecDaoKt$getWorkStatusPojoFlowDataForIds$$inlined$map$1.AnonymousClass2.emit(java.lang.Object, kotlin.coroutines.Continuation):java.lang.Object");
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
public static final Flow getWorkStatusPojoFlowForName(WorkSpecDao workSpecDao, CoroutineDispatcher dispatcher, String name) {
|
|
Intrinsics.checkNotNullParameter(workSpecDao, "<this>");
|
|
Intrinsics.checkNotNullParameter(dispatcher, "dispatcher");
|
|
Intrinsics.checkNotNullParameter(name, "name");
|
|
return dedup(workSpecDao.getWorkStatusPojoFlowForName(name), dispatcher);
|
|
}
|
|
|
|
public static final Flow getWorkStatusPojoFlowForTag(WorkSpecDao workSpecDao, CoroutineDispatcher dispatcher, String tag) {
|
|
Intrinsics.checkNotNullParameter(workSpecDao, "<this>");
|
|
Intrinsics.checkNotNullParameter(dispatcher, "dispatcher");
|
|
Intrinsics.checkNotNullParameter(tag, "tag");
|
|
return dedup(workSpecDao.getWorkStatusPojoFlowForTag(tag), dispatcher);
|
|
}
|
|
}
|