Add decompiled APK source code (JADX)

- 28,932 files
- Full Java source code
- Smali files
- Resources

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-02-18 14:52:23 -08:00
parent cc210a65ea
commit f9d20bb3fc
26991 changed files with 2541449 additions and 0 deletions

View File

@@ -0,0 +1,76 @@
package androidx.work;
import androidx.work.Data;
import java.lang.reflect.Array;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class ArrayCreatingInputMerger extends InputMerger {
@Override // androidx.work.InputMerger
public Data merge(List<Data> inputs) {
Intrinsics.checkNotNullParameter(inputs, "inputs");
Data.Builder builder = new Data.Builder();
HashMap hashMap = new HashMap();
Iterator<Data> it = inputs.iterator();
while (it.hasNext()) {
for (Map.Entry<String, Object> entry : it.next().getKeyValueMap().entrySet()) {
String key = entry.getKey();
Object value = entry.getValue();
Class cls = value != null ? value.getClass() : String.class;
Object obj = hashMap.get(key);
if (obj == null) {
if (cls.isArray()) {
Intrinsics.checkNotNull(value, "null cannot be cast to non-null type kotlin.Any");
} else {
value = createArrayFor(value, cls);
}
} else {
Class<?> cls2 = obj.getClass();
if (Intrinsics.areEqual(cls2, cls)) {
Intrinsics.checkNotNull(value, "null cannot be cast to non-null type kotlin.Any");
value = concatenateArrays(obj, value);
} else if (Intrinsics.areEqual(cls2.getComponentType(), cls)) {
value = concatenateArrayAndNonArray(obj, value, cls);
} else {
throw new IllegalArgumentException();
}
}
hashMap.put(key, value);
}
}
builder.putAll(hashMap);
return builder.build();
}
private final Object concatenateArrays(Object obj, Object obj2) {
int length = Array.getLength(obj);
int length2 = Array.getLength(obj2);
Class<?> componentType = obj.getClass().getComponentType();
Intrinsics.checkNotNull(componentType);
Object newArray = Array.newInstance(componentType, length + length2);
System.arraycopy(obj, 0, newArray, 0, length);
System.arraycopy(obj2, 0, newArray, length, length2);
Intrinsics.checkNotNullExpressionValue(newArray, "newArray");
return newArray;
}
private final Object concatenateArrayAndNonArray(Object obj, Object obj2, Class<?> cls) {
int length = Array.getLength(obj);
Object newArray = Array.newInstance(cls, length + 1);
System.arraycopy(obj, 0, newArray, 0, length);
Array.set(newArray, length, obj2);
Intrinsics.checkNotNullExpressionValue(newArray, "newArray");
return newArray;
}
private final Object createArrayFor(Object obj, Class<?> cls) {
Object newArray = Array.newInstance(cls, 1);
Array.set(newArray, 0, obj);
Intrinsics.checkNotNullExpressionValue(newArray, "newArray");
return newArray;
}
}

View File

@@ -0,0 +1,7 @@
package androidx.work;
/* loaded from: classes.dex */
public enum BackoffPolicy {
EXPONENTIAL,
LINEAR
}

View File

@@ -0,0 +1,6 @@
package androidx.work;
/* loaded from: classes.dex */
public interface Clock {
long currentTimeMillis();
}

View File

@@ -0,0 +1,505 @@
package androidx.work;
import androidx.annotation.IntRange;
import androidx.annotation.RestrictTo;
import androidx.core.util.Consumer;
import androidx.work.impl.DefaultRunnableScheduler;
import java.util.concurrent.Executor;
import kotlin.coroutines.CoroutineContext;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlinx.coroutines.Dispatchers;
import kotlinx.coroutines.ExecutorsKt;
/* loaded from: classes.dex */
public final class Configuration {
public static final Companion Companion = new Companion(null);
public static final int MIN_SCHEDULER_LIMIT = 20;
private final Clock clock;
private final int contentUriTriggerWorkersLimit;
private final String defaultProcessName;
private final Executor executor;
private final Consumer<Throwable> initializationExceptionHandler;
private final InputMergerFactory inputMergerFactory;
private final boolean isMarkingJobsAsImportantWhileForeground;
private final boolean isUsingDefaultTaskExecutor;
private final int maxJobSchedulerId;
private final int maxSchedulerLimit;
private final int minJobSchedulerId;
private final int minimumLoggingLevel;
private final RunnableScheduler runnableScheduler;
private final Consumer<Throwable> schedulingExceptionHandler;
private final Executor taskExecutor;
private final Tracer tracer;
private final CoroutineContext workerCoroutineContext;
private final Consumer<WorkerExceptionInfo> workerExecutionExceptionHandler;
private final WorkerFactory workerFactory;
private final Consumer<WorkerExceptionInfo> workerInitializationExceptionHandler;
public interface Provider {
Configuration getWorkManagerConfiguration();
}
@ExperimentalConfigurationApi
public static /* synthetic */ void isMarkingJobsAsImportantWhileForeground$annotations() {
}
public final Clock getClock() {
return this.clock;
}
public final int getContentUriTriggerWorkersLimit() {
return this.contentUriTriggerWorkersLimit;
}
public final String getDefaultProcessName() {
return this.defaultProcessName;
}
public final Executor getExecutor() {
return this.executor;
}
public final Consumer<Throwable> getInitializationExceptionHandler() {
return this.initializationExceptionHandler;
}
public final InputMergerFactory getInputMergerFactory() {
return this.inputMergerFactory;
}
public final int getMaxJobSchedulerId() {
return this.maxJobSchedulerId;
}
@IntRange(from = 20, to = 50)
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
public final int getMaxSchedulerLimit() {
return this.maxSchedulerLimit;
}
public final int getMinJobSchedulerId() {
return this.minJobSchedulerId;
}
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
public final int getMinimumLoggingLevel() {
return this.minimumLoggingLevel;
}
public final RunnableScheduler getRunnableScheduler() {
return this.runnableScheduler;
}
public final Consumer<Throwable> getSchedulingExceptionHandler() {
return this.schedulingExceptionHandler;
}
public final Executor getTaskExecutor() {
return this.taskExecutor;
}
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
public final Tracer getTracer() {
return this.tracer;
}
public final CoroutineContext getWorkerCoroutineContext() {
return this.workerCoroutineContext;
}
public final Consumer<WorkerExceptionInfo> getWorkerExecutionExceptionHandler() {
return this.workerExecutionExceptionHandler;
}
public final WorkerFactory getWorkerFactory() {
return this.workerFactory;
}
public final Consumer<WorkerExceptionInfo> getWorkerInitializationExceptionHandler() {
return this.workerInitializationExceptionHandler;
}
@ExperimentalConfigurationApi
public final boolean isMarkingJobsAsImportantWhileForeground() {
return this.isMarkingJobsAsImportantWhileForeground;
}
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
public final boolean isUsingDefaultTaskExecutor() {
return this.isUsingDefaultTaskExecutor;
}
public Configuration(Builder builder) {
Intrinsics.checkNotNullParameter(builder, "builder");
CoroutineContext workerContext$work_runtime_release = builder.getWorkerContext$work_runtime_release();
Executor executor$work_runtime_release = builder.getExecutor$work_runtime_release();
if (executor$work_runtime_release == null) {
executor$work_runtime_release = workerContext$work_runtime_release != null ? ConfigurationKt.asExecutor(workerContext$work_runtime_release) : null;
if (executor$work_runtime_release == null) {
executor$work_runtime_release = ConfigurationKt.createDefaultExecutor(false);
}
}
this.executor = executor$work_runtime_release;
this.workerCoroutineContext = workerContext$work_runtime_release == null ? builder.getExecutor$work_runtime_release() != null ? ExecutorsKt.from(executor$work_runtime_release) : Dispatchers.getDefault() : workerContext$work_runtime_release;
this.isUsingDefaultTaskExecutor = builder.getTaskExecutor$work_runtime_release() == null;
Executor taskExecutor$work_runtime_release = builder.getTaskExecutor$work_runtime_release();
this.taskExecutor = taskExecutor$work_runtime_release == null ? ConfigurationKt.createDefaultExecutor(true) : taskExecutor$work_runtime_release;
Clock clock$work_runtime_release = builder.getClock$work_runtime_release();
this.clock = clock$work_runtime_release == null ? new SystemClock() : clock$work_runtime_release;
WorkerFactory workerFactory$work_runtime_release = builder.getWorkerFactory$work_runtime_release();
this.workerFactory = workerFactory$work_runtime_release == null ? DefaultWorkerFactory.INSTANCE : workerFactory$work_runtime_release;
InputMergerFactory inputMergerFactory$work_runtime_release = builder.getInputMergerFactory$work_runtime_release();
this.inputMergerFactory = inputMergerFactory$work_runtime_release == null ? NoOpInputMergerFactory.INSTANCE : inputMergerFactory$work_runtime_release;
RunnableScheduler runnableScheduler$work_runtime_release = builder.getRunnableScheduler$work_runtime_release();
this.runnableScheduler = runnableScheduler$work_runtime_release == null ? new DefaultRunnableScheduler() : runnableScheduler$work_runtime_release;
this.minimumLoggingLevel = builder.getLoggingLevel$work_runtime_release();
this.minJobSchedulerId = builder.getMinJobSchedulerId$work_runtime_release();
this.maxJobSchedulerId = builder.getMaxJobSchedulerId$work_runtime_release();
this.maxSchedulerLimit = builder.getMaxSchedulerLimit$work_runtime_release();
this.initializationExceptionHandler = builder.getInitializationExceptionHandler$work_runtime_release();
this.schedulingExceptionHandler = builder.getSchedulingExceptionHandler$work_runtime_release();
this.workerInitializationExceptionHandler = builder.getWorkerInitializationExceptionHandler$work_runtime_release();
this.workerExecutionExceptionHandler = builder.getWorkerExecutionExceptionHandler$work_runtime_release();
this.defaultProcessName = builder.getDefaultProcessName$work_runtime_release();
this.contentUriTriggerWorkersLimit = builder.getContentUriTriggerWorkersLimit$work_runtime_release();
this.isMarkingJobsAsImportantWhileForeground = builder.getMarkJobsAsImportantWhileForeground$work_runtime_release();
Tracer tracer$work_runtime_release = builder.getTracer$work_runtime_release();
this.tracer = tracer$work_runtime_release == null ? ConfigurationKt.createDefaultTracer() : tracer$work_runtime_release;
}
public static final class Builder {
private Clock clock;
private int contentUriTriggerWorkersLimit;
private String defaultProcessName;
private Executor executor;
private Consumer<Throwable> initializationExceptionHandler;
private InputMergerFactory inputMergerFactory;
private int loggingLevel;
private boolean markJobsAsImportantWhileForeground;
private int maxJobSchedulerId;
private int maxSchedulerLimit;
private int minJobSchedulerId;
private RunnableScheduler runnableScheduler;
private Consumer<Throwable> schedulingExceptionHandler;
private Executor taskExecutor;
private Tracer tracer;
private CoroutineContext workerContext;
private Consumer<WorkerExceptionInfo> workerExecutionExceptionHandler;
private WorkerFactory workerFactory;
private Consumer<WorkerExceptionInfo> workerInitializationExceptionHandler;
public final Clock getClock$work_runtime_release() {
return this.clock;
}
public final int getContentUriTriggerWorkersLimit$work_runtime_release() {
return this.contentUriTriggerWorkersLimit;
}
public final String getDefaultProcessName$work_runtime_release() {
return this.defaultProcessName;
}
public final Executor getExecutor$work_runtime_release() {
return this.executor;
}
public final Consumer<Throwable> getInitializationExceptionHandler$work_runtime_release() {
return this.initializationExceptionHandler;
}
public final InputMergerFactory getInputMergerFactory$work_runtime_release() {
return this.inputMergerFactory;
}
public final int getLoggingLevel$work_runtime_release() {
return this.loggingLevel;
}
public final boolean getMarkJobsAsImportantWhileForeground$work_runtime_release() {
return this.markJobsAsImportantWhileForeground;
}
public final int getMaxJobSchedulerId$work_runtime_release() {
return this.maxJobSchedulerId;
}
public final int getMaxSchedulerLimit$work_runtime_release() {
return this.maxSchedulerLimit;
}
public final int getMinJobSchedulerId$work_runtime_release() {
return this.minJobSchedulerId;
}
public final RunnableScheduler getRunnableScheduler$work_runtime_release() {
return this.runnableScheduler;
}
public final Consumer<Throwable> getSchedulingExceptionHandler$work_runtime_release() {
return this.schedulingExceptionHandler;
}
public final Executor getTaskExecutor$work_runtime_release() {
return this.taskExecutor;
}
public final Tracer getTracer$work_runtime_release() {
return this.tracer;
}
public final CoroutineContext getWorkerContext$work_runtime_release() {
return this.workerContext;
}
public final Consumer<WorkerExceptionInfo> getWorkerExecutionExceptionHandler$work_runtime_release() {
return this.workerExecutionExceptionHandler;
}
public final WorkerFactory getWorkerFactory$work_runtime_release() {
return this.workerFactory;
}
public final Consumer<WorkerExceptionInfo> getWorkerInitializationExceptionHandler$work_runtime_release() {
return this.workerInitializationExceptionHandler;
}
public final Builder setClock(Clock clock) {
Intrinsics.checkNotNullParameter(clock, "clock");
this.clock = clock;
return this;
}
public final void setClock$work_runtime_release(Clock clock) {
this.clock = clock;
}
public final void setContentUriTriggerWorkersLimit$work_runtime_release(int i) {
this.contentUriTriggerWorkersLimit = i;
}
public final Builder setDefaultProcessName(String processName) {
Intrinsics.checkNotNullParameter(processName, "processName");
this.defaultProcessName = processName;
return this;
}
public final void setDefaultProcessName$work_runtime_release(String str) {
this.defaultProcessName = str;
}
public final Builder setExecutor(Executor executor) {
Intrinsics.checkNotNullParameter(executor, "executor");
this.executor = executor;
return this;
}
public final void setExecutor$work_runtime_release(Executor executor) {
this.executor = executor;
}
public final Builder setInitializationExceptionHandler(Consumer<Throwable> exceptionHandler) {
Intrinsics.checkNotNullParameter(exceptionHandler, "exceptionHandler");
this.initializationExceptionHandler = exceptionHandler;
return this;
}
public final void setInitializationExceptionHandler$work_runtime_release(Consumer<Throwable> consumer) {
this.initializationExceptionHandler = consumer;
}
public final Builder setInputMergerFactory(InputMergerFactory inputMergerFactory) {
Intrinsics.checkNotNullParameter(inputMergerFactory, "inputMergerFactory");
this.inputMergerFactory = inputMergerFactory;
return this;
}
public final void setInputMergerFactory$work_runtime_release(InputMergerFactory inputMergerFactory) {
this.inputMergerFactory = inputMergerFactory;
}
public final void setLoggingLevel$work_runtime_release(int i) {
this.loggingLevel = i;
}
public final void setMarkJobsAsImportantWhileForeground$work_runtime_release(boolean z) {
this.markJobsAsImportantWhileForeground = z;
}
@ExperimentalConfigurationApi
public final Builder setMarkingJobsAsImportantWhileForeground(boolean z) {
this.markJobsAsImportantWhileForeground = z;
return this;
}
public final void setMaxJobSchedulerId$work_runtime_release(int i) {
this.maxJobSchedulerId = i;
}
public final void setMaxSchedulerLimit$work_runtime_release(int i) {
this.maxSchedulerLimit = i;
}
public final void setMinJobSchedulerId$work_runtime_release(int i) {
this.minJobSchedulerId = i;
}
public final Builder setMinimumLoggingLevel(int i) {
this.loggingLevel = i;
return this;
}
public final Builder setRunnableScheduler(RunnableScheduler runnableScheduler) {
Intrinsics.checkNotNullParameter(runnableScheduler, "runnableScheduler");
this.runnableScheduler = runnableScheduler;
return this;
}
public final void setRunnableScheduler$work_runtime_release(RunnableScheduler runnableScheduler) {
this.runnableScheduler = runnableScheduler;
}
public final Builder setSchedulingExceptionHandler(Consumer<Throwable> schedulingExceptionHandler) {
Intrinsics.checkNotNullParameter(schedulingExceptionHandler, "schedulingExceptionHandler");
this.schedulingExceptionHandler = schedulingExceptionHandler;
return this;
}
public final void setSchedulingExceptionHandler$work_runtime_release(Consumer<Throwable> consumer) {
this.schedulingExceptionHandler = consumer;
}
public final Builder setTaskExecutor(Executor taskExecutor) {
Intrinsics.checkNotNullParameter(taskExecutor, "taskExecutor");
this.taskExecutor = taskExecutor;
return this;
}
public final void setTaskExecutor$work_runtime_release(Executor executor) {
this.taskExecutor = executor;
}
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
public final Builder setTracer(Tracer tracer) {
Intrinsics.checkNotNullParameter(tracer, "tracer");
this.tracer = tracer;
return this;
}
public final void setTracer$work_runtime_release(Tracer tracer) {
this.tracer = tracer;
}
public final void setWorkerContext$work_runtime_release(CoroutineContext coroutineContext) {
this.workerContext = coroutineContext;
}
public final Builder setWorkerCoroutineContext(CoroutineContext context) {
Intrinsics.checkNotNullParameter(context, "context");
this.workerContext = context;
return this;
}
public final Builder setWorkerExecutionExceptionHandler(Consumer<WorkerExceptionInfo> workerExceptionHandler) {
Intrinsics.checkNotNullParameter(workerExceptionHandler, "workerExceptionHandler");
this.workerExecutionExceptionHandler = workerExceptionHandler;
return this;
}
public final void setWorkerExecutionExceptionHandler$work_runtime_release(Consumer<WorkerExceptionInfo> consumer) {
this.workerExecutionExceptionHandler = consumer;
}
public final Builder setWorkerFactory(WorkerFactory workerFactory) {
Intrinsics.checkNotNullParameter(workerFactory, "workerFactory");
this.workerFactory = workerFactory;
return this;
}
public final void setWorkerFactory$work_runtime_release(WorkerFactory workerFactory) {
this.workerFactory = workerFactory;
}
public final Builder setWorkerInitializationExceptionHandler(Consumer<WorkerExceptionInfo> workerExceptionHandler) {
Intrinsics.checkNotNullParameter(workerExceptionHandler, "workerExceptionHandler");
this.workerInitializationExceptionHandler = workerExceptionHandler;
return this;
}
public final void setWorkerInitializationExceptionHandler$work_runtime_release(Consumer<WorkerExceptionInfo> consumer) {
this.workerInitializationExceptionHandler = consumer;
}
public Builder() {
this.loggingLevel = 4;
this.maxJobSchedulerId = Integer.MAX_VALUE;
this.maxSchedulerLimit = 20;
this.contentUriTriggerWorkersLimit = 8;
this.markJobsAsImportantWhileForeground = true;
}
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
public Builder(Configuration configuration) {
Intrinsics.checkNotNullParameter(configuration, "configuration");
this.loggingLevel = 4;
this.maxJobSchedulerId = Integer.MAX_VALUE;
this.maxSchedulerLimit = 20;
this.contentUriTriggerWorkersLimit = 8;
this.markJobsAsImportantWhileForeground = true;
this.executor = configuration.getExecutor();
this.workerFactory = configuration.getWorkerFactory();
this.inputMergerFactory = configuration.getInputMergerFactory();
this.taskExecutor = configuration.getTaskExecutor();
this.clock = configuration.getClock();
this.loggingLevel = configuration.getMinimumLoggingLevel();
this.minJobSchedulerId = configuration.getMinJobSchedulerId();
this.maxJobSchedulerId = configuration.getMaxJobSchedulerId();
this.maxSchedulerLimit = configuration.getMaxSchedulerLimit();
this.runnableScheduler = configuration.getRunnableScheduler();
this.initializationExceptionHandler = configuration.getInitializationExceptionHandler();
this.schedulingExceptionHandler = configuration.getSchedulingExceptionHandler();
this.workerInitializationExceptionHandler = configuration.getWorkerInitializationExceptionHandler();
this.workerExecutionExceptionHandler = configuration.getWorkerExecutionExceptionHandler();
this.defaultProcessName = configuration.getDefaultProcessName();
this.contentUriTriggerWorkersLimit = configuration.getContentUriTriggerWorkersLimit();
this.markJobsAsImportantWhileForeground = configuration.isMarkingJobsAsImportantWhileForeground();
this.tracer = configuration.getTracer();
}
public final Builder setJobSchedulerJobIdRange(int i, int i2) {
if (i2 - i < 1000) {
throw new IllegalArgumentException("WorkManager needs a range of at least 1000 job ids.".toString());
}
this.minJobSchedulerId = i;
this.maxJobSchedulerId = i2;
return this;
}
public final Builder setMaxSchedulerLimit(int i) {
if (i < 20) {
throw new IllegalArgumentException("WorkManager needs to be able to schedule at least 20 jobs in JobScheduler.".toString());
}
this.maxSchedulerLimit = Math.min(i, 50);
return this;
}
public final Builder setContentUriTriggerWorkersLimit(int i) {
this.contentUriTriggerWorkersLimit = Math.max(i, 0);
return this;
}
public final Configuration build() {
return new Configuration(this);
}
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
}
}

View File

@@ -0,0 +1,76 @@
package androidx.work;
import androidx.tracing.Trace;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.atomic.AtomicInteger;
import kotlin.coroutines.ContinuationInterceptor;
import kotlin.coroutines.CoroutineContext;
import kotlin.jvm.internal.Intrinsics;
import kotlinx.coroutines.CoroutineDispatcher;
import kotlinx.coroutines.ExecutorsKt;
/* loaded from: classes.dex */
public final class ConfigurationKt {
public static final int DEFAULT_CONTENT_URI_TRIGGERS_WORKERS_LIMIT = 8;
/* JADX INFO: Access modifiers changed from: private */
public static final Executor createDefaultExecutor(final boolean z) {
ExecutorService newFixedThreadPool = Executors.newFixedThreadPool(Math.max(2, Math.min(Runtime.getRuntime().availableProcessors() - 1, 4)), new ThreadFactory() { // from class: androidx.work.ConfigurationKt$createDefaultExecutor$factory$1
private final AtomicInteger threadCount = new AtomicInteger(0);
@Override // java.util.concurrent.ThreadFactory
public Thread newThread(Runnable runnable) {
Intrinsics.checkNotNullParameter(runnable, "runnable");
return new Thread(runnable, (z ? "WM.task-" : "androidx.work-") + this.threadCount.incrementAndGet());
}
});
Intrinsics.checkNotNullExpressionValue(newFixedThreadPool, "newFixedThreadPool(\n …)),\n factory\n )");
return newFixedThreadPool;
}
/* JADX INFO: Access modifiers changed from: private */
public static final Tracer createDefaultTracer() {
return new Tracer() { // from class: androidx.work.ConfigurationKt$createDefaultTracer$tracer$1
@Override // androidx.work.Tracer
public boolean isEnabled() {
return Trace.isEnabled();
}
@Override // androidx.work.Tracer
public void beginSection(String label) {
Intrinsics.checkNotNullParameter(label, "label");
Trace.beginSection(label);
}
@Override // androidx.work.Tracer
public void endSection() {
Trace.endSection();
}
@Override // androidx.work.Tracer
public void beginAsyncSection(String methodName, int i) {
Intrinsics.checkNotNullParameter(methodName, "methodName");
Trace.beginAsyncSection(methodName, i);
}
@Override // androidx.work.Tracer
public void endAsyncSection(String methodName, int i) {
Intrinsics.checkNotNullParameter(methodName, "methodName");
Trace.endAsyncSection(methodName, i);
}
};
}
/* JADX INFO: Access modifiers changed from: private */
public static final Executor asExecutor(CoroutineContext coroutineContext) {
ContinuationInterceptor continuationInterceptor = coroutineContext != null ? (ContinuationInterceptor) coroutineContext.get(ContinuationInterceptor.Key) : null;
CoroutineDispatcher coroutineDispatcher = continuationInterceptor instanceof CoroutineDispatcher ? (CoroutineDispatcher) continuationInterceptor : null;
if (coroutineDispatcher != null) {
return ExecutorsKt.asExecutor(coroutineDispatcher);
}
return null;
}
}

View File

@@ -0,0 +1,382 @@
package androidx.work;
import android.annotation.SuppressLint;
import android.net.NetworkRequest;
import android.net.Uri;
import android.os.Build;
import androidx.annotation.RequiresApi;
import androidx.annotation.RestrictTo;
import androidx.room.ColumnInfo;
import androidx.room.Ignore;
import androidx.work.impl.utils.DurationApi26Impl;
import androidx.work.impl.utils.NetworkRequest30;
import androidx.work.impl.utils.NetworkRequestCompat;
import com.mbridge.msdk.playercommon.exoplayer2.extractor.ts.PsExtractor;
import java.time.Duration;
import java.util.LinkedHashSet;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import kotlin.collections.CollectionsKt___CollectionsKt;
import kotlin.collections.SetsKt__SetsKt;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class Constraints {
public static final Companion Companion = new Companion(null);
public static final Constraints NONE = new Constraints(null, false, false, false, 15, null);
@ColumnInfo(name = "trigger_max_content_delay")
private final long contentTriggerMaxDelayMillis;
@ColumnInfo(name = "trigger_content_update_delay")
private final long contentTriggerUpdateDelayMillis;
@ColumnInfo(name = "content_uri_triggers")
private final Set<ContentUriTrigger> contentUriTriggers;
@ColumnInfo(defaultValue = "x''", name = "required_network_request")
private final NetworkRequestCompat requiredNetworkRequestCompat;
@ColumnInfo(name = "required_network_type")
private final NetworkType requiredNetworkType;
@ColumnInfo(name = "requires_battery_not_low")
private final boolean requiresBatteryNotLow;
@ColumnInfo(name = "requires_charging")
private final boolean requiresCharging;
@ColumnInfo(name = "requires_device_idle")
private final boolean requiresDeviceIdle;
@ColumnInfo(name = "requires_storage_not_low")
private final boolean requiresStorageNotLow;
@RequiresApi(24)
public final long getContentTriggerMaxDelayMillis() {
return this.contentTriggerMaxDelayMillis;
}
@RequiresApi(24)
public final long getContentTriggerUpdateDelayMillis() {
return this.contentTriggerUpdateDelayMillis;
}
@RequiresApi(24)
public final Set<ContentUriTrigger> getContentUriTriggers() {
return this.contentUriTriggers;
}
public final NetworkRequestCompat getRequiredNetworkRequestCompat$work_runtime_release() {
return this.requiredNetworkRequestCompat;
}
public final NetworkType getRequiredNetworkType() {
return this.requiredNetworkType;
}
public final boolean requiresBatteryNotLow() {
return this.requiresBatteryNotLow;
}
public final boolean requiresCharging() {
return this.requiresCharging;
}
@RequiresApi(23)
public final boolean requiresDeviceIdle() {
return this.requiresDeviceIdle;
}
public final boolean requiresStorageNotLow() {
return this.requiresStorageNotLow;
}
@RequiresApi(21)
public final NetworkRequest getRequiredNetworkRequest() {
return this.requiredNetworkRequestCompat.getNetworkRequest();
}
public /* synthetic */ Constraints(NetworkType networkType, boolean z, boolean z2, boolean z3, int i, DefaultConstructorMarker defaultConstructorMarker) {
this((i & 1) != 0 ? NetworkType.NOT_REQUIRED : networkType, (i & 2) != 0 ? false : z, (i & 4) != 0 ? false : z2, (i & 8) != 0 ? false : z3);
}
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
@SuppressLint({"NewApi"})
@Ignore
public Constraints(NetworkType requiredNetworkType, boolean z, boolean z2, boolean z3) {
this(requiredNetworkType, z, false, z2, z3);
Intrinsics.checkNotNullParameter(requiredNetworkType, "requiredNetworkType");
}
public /* synthetic */ Constraints(NetworkType networkType, boolean z, boolean z2, boolean z3, boolean z4, int i, DefaultConstructorMarker defaultConstructorMarker) {
this((i & 1) != 0 ? NetworkType.NOT_REQUIRED : networkType, (i & 2) != 0 ? false : z, (i & 4) != 0 ? false : z2, (i & 8) != 0 ? false : z3, (i & 16) == 0 ? z4 : false);
}
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
@RequiresApi(23)
@SuppressLint({"NewApi"})
@Ignore
public Constraints(NetworkType requiredNetworkType, boolean z, boolean z2, boolean z3, boolean z4) {
this(requiredNetworkType, z, z2, z3, z4, -1L, 0L, null, PsExtractor.AUDIO_STREAM, null);
Intrinsics.checkNotNullParameter(requiredNetworkType, "requiredNetworkType");
}
public /* synthetic */ Constraints(NetworkType networkType, boolean z, boolean z2, boolean z3, boolean z4, long j, long j2, Set set, int i, DefaultConstructorMarker defaultConstructorMarker) {
this((i & 1) != 0 ? NetworkType.NOT_REQUIRED : networkType, (i & 2) != 0 ? false : z, (i & 4) != 0 ? false : z2, (i & 8) != 0 ? false : z3, (i & 16) == 0 ? z4 : false, (i & 32) != 0 ? -1L : j, (i & 64) == 0 ? j2 : -1L, (i & 128) != 0 ? SetsKt__SetsKt.emptySet() : set);
}
@RequiresApi(24)
@Ignore
public Constraints(NetworkType requiredNetworkType, boolean z, boolean z2, boolean z3, boolean z4, long j, long j2, Set<ContentUriTrigger> contentUriTriggers) {
Intrinsics.checkNotNullParameter(requiredNetworkType, "requiredNetworkType");
Intrinsics.checkNotNullParameter(contentUriTriggers, "contentUriTriggers");
this.requiredNetworkRequestCompat = new NetworkRequestCompat(null, 1, null);
this.requiredNetworkType = requiredNetworkType;
this.requiresCharging = z;
this.requiresDeviceIdle = z2;
this.requiresBatteryNotLow = z3;
this.requiresStorageNotLow = z4;
this.contentTriggerUpdateDelayMillis = j;
this.contentTriggerMaxDelayMillis = j2;
this.contentUriTriggers = contentUriTriggers;
}
public /* synthetic */ Constraints(NetworkRequestCompat networkRequestCompat, NetworkType networkType, boolean z, boolean z2, boolean z3, boolean z4, long j, long j2, Set set, int i, DefaultConstructorMarker defaultConstructorMarker) {
this(networkRequestCompat, (i & 2) != 0 ? NetworkType.NOT_REQUIRED : networkType, (i & 4) != 0 ? false : z, (i & 8) != 0 ? false : z2, (i & 16) != 0 ? false : z3, (i & 32) == 0 ? z4 : false, (i & 64) != 0 ? -1L : j, (i & 128) == 0 ? j2 : -1L, (i & 256) != 0 ? SetsKt__SetsKt.emptySet() : set);
}
public Constraints(NetworkRequestCompat requiredNetworkRequestCompat, NetworkType requiredNetworkType, boolean z, boolean z2, boolean z3, boolean z4, long j, long j2, Set<ContentUriTrigger> contentUriTriggers) {
Intrinsics.checkNotNullParameter(requiredNetworkRequestCompat, "requiredNetworkRequestCompat");
Intrinsics.checkNotNullParameter(requiredNetworkType, "requiredNetworkType");
Intrinsics.checkNotNullParameter(contentUriTriggers, "contentUriTriggers");
this.requiredNetworkRequestCompat = requiredNetworkRequestCompat;
this.requiredNetworkType = requiredNetworkType;
this.requiresCharging = z;
this.requiresDeviceIdle = z2;
this.requiresBatteryNotLow = z3;
this.requiresStorageNotLow = z4;
this.contentTriggerUpdateDelayMillis = j;
this.contentTriggerMaxDelayMillis = j2;
this.contentUriTriggers = contentUriTriggers;
}
@SuppressLint({"NewApi"})
public Constraints(Constraints other) {
Intrinsics.checkNotNullParameter(other, "other");
this.requiresCharging = other.requiresCharging;
this.requiresDeviceIdle = other.requiresDeviceIdle;
this.requiredNetworkRequestCompat = other.requiredNetworkRequestCompat;
this.requiredNetworkType = other.requiredNetworkType;
this.requiresBatteryNotLow = other.requiresBatteryNotLow;
this.requiresStorageNotLow = other.requiresStorageNotLow;
this.contentUriTriggers = other.contentUriTriggers;
this.contentTriggerUpdateDelayMillis = other.contentTriggerUpdateDelayMillis;
this.contentTriggerMaxDelayMillis = other.contentTriggerMaxDelayMillis;
}
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
public final boolean hasContentUriTriggers() {
return !this.contentUriTriggers.isEmpty();
}
@SuppressLint({"NewApi"})
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null || !Intrinsics.areEqual(Constraints.class, obj.getClass())) {
return false;
}
Constraints constraints = (Constraints) obj;
if (this.requiresCharging == constraints.requiresCharging && this.requiresDeviceIdle == constraints.requiresDeviceIdle && this.requiresBatteryNotLow == constraints.requiresBatteryNotLow && this.requiresStorageNotLow == constraints.requiresStorageNotLow && this.contentTriggerUpdateDelayMillis == constraints.contentTriggerUpdateDelayMillis && this.contentTriggerMaxDelayMillis == constraints.contentTriggerMaxDelayMillis && Intrinsics.areEqual(getRequiredNetworkRequest(), constraints.getRequiredNetworkRequest()) && this.requiredNetworkType == constraints.requiredNetworkType) {
return Intrinsics.areEqual(this.contentUriTriggers, constraints.contentUriTriggers);
}
return false;
}
@SuppressLint({"NewApi"})
public int hashCode() {
int hashCode = ((((((((this.requiredNetworkType.hashCode() * 31) + (this.requiresCharging ? 1 : 0)) * 31) + (this.requiresDeviceIdle ? 1 : 0)) * 31) + (this.requiresBatteryNotLow ? 1 : 0)) * 31) + (this.requiresStorageNotLow ? 1 : 0)) * 31;
long j = this.contentTriggerUpdateDelayMillis;
int i = (hashCode + ((int) (j ^ (j >>> 32)))) * 31;
long j2 = this.contentTriggerMaxDelayMillis;
int hashCode2 = (((i + ((int) (j2 ^ (j2 >>> 32)))) * 31) + this.contentUriTriggers.hashCode()) * 31;
NetworkRequest requiredNetworkRequest = getRequiredNetworkRequest();
return hashCode2 + (requiredNetworkRequest != null ? requiredNetworkRequest.hashCode() : 0);
}
@SuppressLint({"NewApi"})
public String toString() {
return "Constraints{requiredNetworkType=" + this.requiredNetworkType + ", requiresCharging=" + this.requiresCharging + ", requiresDeviceIdle=" + this.requiresDeviceIdle + ", requiresBatteryNotLow=" + this.requiresBatteryNotLow + ", requiresStorageNotLow=" + this.requiresStorageNotLow + ", contentTriggerUpdateDelayMillis=" + this.contentTriggerUpdateDelayMillis + ", contentTriggerMaxDelayMillis=" + this.contentTriggerMaxDelayMillis + ", contentUriTriggers=" + this.contentUriTriggers + ", }";
}
public static final class Builder {
private Set<ContentUriTrigger> contentUriTriggers;
private NetworkRequestCompat requiredNetworkRequest;
private NetworkType requiredNetworkType;
private boolean requiresBatteryNotLow;
private boolean requiresCharging;
private boolean requiresDeviceIdle;
private boolean requiresStorageNotLow;
private long triggerContentMaxDelay;
private long triggerContentUpdateDelay;
public final Builder setRequiresBatteryNotLow(boolean z) {
this.requiresBatteryNotLow = z;
return this;
}
public final Builder setRequiresCharging(boolean z) {
this.requiresCharging = z;
return this;
}
@RequiresApi(23)
public final Builder setRequiresDeviceIdle(boolean z) {
this.requiresDeviceIdle = z;
return this;
}
public final Builder setRequiresStorageNotLow(boolean z) {
this.requiresStorageNotLow = z;
return this;
}
public Builder() {
this.requiredNetworkRequest = new NetworkRequestCompat(null, 1, null);
this.requiredNetworkType = NetworkType.NOT_REQUIRED;
this.triggerContentUpdateDelay = -1L;
this.triggerContentMaxDelay = -1L;
this.contentUriTriggers = new LinkedHashSet();
}
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
public Builder(Constraints constraints) {
Intrinsics.checkNotNullParameter(constraints, "constraints");
this.requiredNetworkRequest = new NetworkRequestCompat(null, 1, null);
this.requiredNetworkType = NetworkType.NOT_REQUIRED;
this.triggerContentUpdateDelay = -1L;
this.triggerContentMaxDelay = -1L;
this.contentUriTriggers = new LinkedHashSet();
this.requiresCharging = constraints.requiresCharging();
this.requiresDeviceIdle = constraints.requiresDeviceIdle();
this.requiredNetworkType = constraints.getRequiredNetworkType();
this.requiresBatteryNotLow = constraints.requiresBatteryNotLow();
this.requiresStorageNotLow = constraints.requiresStorageNotLow();
this.triggerContentUpdateDelay = constraints.getContentTriggerUpdateDelayMillis();
this.triggerContentMaxDelay = constraints.getContentTriggerMaxDelayMillis();
this.contentUriTriggers = CollectionsKt___CollectionsKt.toMutableSet(constraints.getContentUriTriggers());
}
public final Builder setRequiredNetworkType(NetworkType networkType) {
Intrinsics.checkNotNullParameter(networkType, "networkType");
this.requiredNetworkType = networkType;
this.requiredNetworkRequest = new NetworkRequestCompat(null, 1, null);
return this;
}
@RequiresApi(21)
public final Builder setRequiredNetworkRequest(NetworkRequest networkRequest, NetworkType networkType) {
Intrinsics.checkNotNullParameter(networkRequest, "networkRequest");
Intrinsics.checkNotNullParameter(networkType, "networkType");
int i = Build.VERSION.SDK_INT;
if (i < 28) {
this.requiredNetworkType = networkType;
} else {
if (i >= 31 && NetworkRequest30.INSTANCE.getNetworkSpecifier(networkRequest) != null) {
throw new IllegalArgumentException("NetworkRequests with NetworkSpecifiers set aren't supported.");
}
this.requiredNetworkRequest = new NetworkRequestCompat(networkRequest);
this.requiredNetworkType = NetworkType.NOT_REQUIRED;
}
return this;
}
@RequiresApi(24)
public final Builder addContentUriTrigger(Uri uri, boolean z) {
Intrinsics.checkNotNullParameter(uri, "uri");
this.contentUriTriggers.add(new ContentUriTrigger(uri, z));
return this;
}
@RequiresApi(24)
public final Builder setTriggerContentUpdateDelay(long j, TimeUnit timeUnit) {
Intrinsics.checkNotNullParameter(timeUnit, "timeUnit");
this.triggerContentUpdateDelay = timeUnit.toMillis(j);
return this;
}
@RequiresApi(26)
public final Builder setTriggerContentUpdateDelay(Duration duration) {
Intrinsics.checkNotNullParameter(duration, "duration");
this.triggerContentUpdateDelay = DurationApi26Impl.toMillisCompat(duration);
return this;
}
@RequiresApi(24)
public final Builder setTriggerContentMaxDelay(long j, TimeUnit timeUnit) {
Intrinsics.checkNotNullParameter(timeUnit, "timeUnit");
this.triggerContentMaxDelay = timeUnit.toMillis(j);
return this;
}
@RequiresApi(26)
public final Builder setTriggerContentMaxDelay(Duration duration) {
Intrinsics.checkNotNullParameter(duration, "duration");
this.triggerContentMaxDelay = DurationApi26Impl.toMillisCompat(duration);
return this;
}
public final Constraints build() {
Set set;
set = CollectionsKt___CollectionsKt.toSet(this.contentUriTriggers);
return new Constraints(this.requiredNetworkRequest, this.requiredNetworkType, this.requiresCharging, this.requiresDeviceIdle, this.requiresBatteryNotLow, this.requiresStorageNotLow, this.triggerContentUpdateDelay, this.triggerContentMaxDelay, set);
}
}
public static final class ContentUriTrigger {
private final boolean isTriggeredForDescendants;
private final Uri uri;
public final Uri getUri() {
return this.uri;
}
public final boolean isTriggeredForDescendants() {
return this.isTriggeredForDescendants;
}
public ContentUriTrigger(Uri uri, boolean z) {
Intrinsics.checkNotNullParameter(uri, "uri");
this.uri = uri;
this.isTriggeredForDescendants = z;
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!Intrinsics.areEqual(ContentUriTrigger.class, obj != null ? obj.getClass() : null)) {
return false;
}
Intrinsics.checkNotNull(obj, "null cannot be cast to non-null type androidx.work.Constraints.ContentUriTrigger");
ContentUriTrigger contentUriTrigger = (ContentUriTrigger) obj;
return Intrinsics.areEqual(this.uri, contentUriTrigger.uri) && this.isTriggeredForDescendants == contentUriTrigger.isTriggeredForDescendants;
}
public int hashCode() {
return (this.uri.hashCode() * 31) + Boolean.hashCode(this.isTriggeredForDescendants);
}
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
}
}

View File

@@ -0,0 +1,6 @@
package androidx.work;
/* loaded from: classes.dex */
public final class ConstraintsKt {
public static final String CONSTRAINTS_COLUMNS = "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";
}

View File

@@ -0,0 +1,55 @@
package androidx.work;
import kotlin.ResultKt;
import kotlin.Unit;
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;
@DebugMetadata(c = "androidx.work.CoroutineWorker$getForegroundInfoAsync$1", f = "CoroutineWorker.kt", l = {121}, m = "invokeSuspend")
/* loaded from: classes.dex */
public final class CoroutineWorker$getForegroundInfoAsync$1 extends SuspendLambda implements Function2 {
int label;
final /* synthetic */ CoroutineWorker this$0;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public CoroutineWorker$getForegroundInfoAsync$1(CoroutineWorker coroutineWorker, Continuation continuation) {
super(2, continuation);
this.this$0 = coroutineWorker;
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Continuation create(Object obj, Continuation continuation) {
return new CoroutineWorker$getForegroundInfoAsync$1(this.this$0, continuation);
}
@Override // kotlin.jvm.functions.Function2
public final Object invoke(CoroutineScope coroutineScope, Continuation continuation) {
return ((CoroutineWorker$getForegroundInfoAsync$1) create(coroutineScope, continuation)).invokeSuspend(Unit.INSTANCE);
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Object invokeSuspend(Object obj) {
Object coroutine_suspended;
coroutine_suspended = IntrinsicsKt__IntrinsicsKt.getCOROUTINE_SUSPENDED();
int i = this.label;
if (i == 0) {
ResultKt.throwOnFailure(obj);
CoroutineWorker coroutineWorker = this.this$0;
this.label = 1;
obj = coroutineWorker.getForegroundInfo(this);
if (obj == coroutine_suspended) {
return coroutine_suspended;
}
} else {
if (i != 1) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
ResultKt.throwOnFailure(obj);
}
return obj;
}
}

View File

@@ -0,0 +1,56 @@
package androidx.work;
import com.fyber.inneractive.sdk.bidder.TokenParametersOuterClass$TokenParameters;
import kotlin.ResultKt;
import kotlin.Unit;
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;
@DebugMetadata(c = "androidx.work.CoroutineWorker$startWork$1", f = "CoroutineWorker.kt", l = {TokenParametersOuterClass$TokenParameters.IGNITEVERSION_FIELD_NUMBER}, m = "invokeSuspend")
/* loaded from: classes.dex */
public final class CoroutineWorker$startWork$1 extends SuspendLambda implements Function2 {
int label;
final /* synthetic */ CoroutineWorker this$0;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public CoroutineWorker$startWork$1(CoroutineWorker coroutineWorker, Continuation continuation) {
super(2, continuation);
this.this$0 = coroutineWorker;
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Continuation create(Object obj, Continuation continuation) {
return new CoroutineWorker$startWork$1(this.this$0, continuation);
}
@Override // kotlin.jvm.functions.Function2
public final Object invoke(CoroutineScope coroutineScope, Continuation continuation) {
return ((CoroutineWorker$startWork$1) create(coroutineScope, continuation)).invokeSuspend(Unit.INSTANCE);
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Object invokeSuspend(Object obj) {
Object coroutine_suspended;
coroutine_suspended = IntrinsicsKt__IntrinsicsKt.getCOROUTINE_SUSPENDED();
int i = this.label;
if (i == 0) {
ResultKt.throwOnFailure(obj);
CoroutineWorker coroutineWorker = this.this$0;
this.label = 1;
obj = coroutineWorker.doWork(this);
if (obj == coroutine_suspended) {
return coroutine_suspended;
}
} else {
if (i != 1) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
ResultKt.throwOnFailure(obj);
}
return obj;
}
}

View File

@@ -0,0 +1,116 @@
package androidx.work;
import android.content.Context;
import com.google.common.util.concurrent.ListenableFuture;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.CoroutineContext;
import kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsKt;
import kotlin.jvm.internal.Intrinsics;
import kotlinx.coroutines.CompletableJob;
import kotlinx.coroutines.CoroutineDispatcher;
import kotlinx.coroutines.Dispatchers;
import kotlinx.coroutines.JobKt__JobKt;
/* loaded from: classes.dex */
public abstract class CoroutineWorker extends ListenableWorker {
private final CoroutineDispatcher coroutineContext;
private final WorkerParameters params;
public static /* synthetic */ void getCoroutineContext$annotations() {
}
public abstract Object doWork(Continuation continuation);
public CoroutineDispatcher getCoroutineContext() {
return this.coroutineContext;
}
public Object getForegroundInfo(Continuation continuation) {
return getForegroundInfo$suspendImpl(this, continuation);
}
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public CoroutineWorker(Context appContext, WorkerParameters params) {
super(appContext, params);
Intrinsics.checkNotNullParameter(appContext, "appContext");
Intrinsics.checkNotNullParameter(params, "params");
this.params = params;
this.coroutineContext = DeprecatedDispatcher.INSTANCE;
}
@Override // androidx.work.ListenableWorker
public final ListenableFuture startWork() {
CoroutineContext workerContext;
CompletableJob Job$default;
if (!Intrinsics.areEqual(getCoroutineContext(), DeprecatedDispatcher.INSTANCE)) {
workerContext = getCoroutineContext();
} else {
workerContext = this.params.getWorkerContext();
}
Intrinsics.checkNotNullExpressionValue(workerContext, "if (coroutineContext != …rkerContext\n }");
Job$default = JobKt__JobKt.Job$default(null, 1, null);
return ListenableFutureKt.launchFuture$default(workerContext.plus(Job$default), null, new CoroutineWorker$startWork$1(this, null), 2, null);
}
public static /* synthetic */ Object getForegroundInfo$suspendImpl(CoroutineWorker coroutineWorker, Continuation continuation) {
throw new IllegalStateException("Not implemented");
}
public final Object setProgress(Data data, Continuation continuation) {
Object coroutine_suspended;
ListenableFuture progressAsync = setProgressAsync(data);
Intrinsics.checkNotNullExpressionValue(progressAsync, "setProgressAsync(data)");
Object await = androidx.concurrent.futures.ListenableFutureKt.await(progressAsync, continuation);
coroutine_suspended = IntrinsicsKt__IntrinsicsKt.getCOROUTINE_SUSPENDED();
return await == coroutine_suspended ? await : Unit.INSTANCE;
}
public final Object setForeground(ForegroundInfo foregroundInfo, Continuation continuation) {
Object coroutine_suspended;
ListenableFuture foregroundAsync = setForegroundAsync(foregroundInfo);
Intrinsics.checkNotNullExpressionValue(foregroundAsync, "setForegroundAsync(foregroundInfo)");
Object await = androidx.concurrent.futures.ListenableFutureKt.await(foregroundAsync, continuation);
coroutine_suspended = IntrinsicsKt__IntrinsicsKt.getCOROUTINE_SUSPENDED();
return await == coroutine_suspended ? await : Unit.INSTANCE;
}
@Override // androidx.work.ListenableWorker
public final ListenableFuture getForegroundInfoAsync() {
CompletableJob Job$default;
CoroutineDispatcher coroutineContext = getCoroutineContext();
Job$default = JobKt__JobKt.Job$default(null, 1, null);
return ListenableFutureKt.launchFuture$default(coroutineContext.plus(Job$default), null, new CoroutineWorker$getForegroundInfoAsync$1(this, null), 2, null);
}
@Override // androidx.work.ListenableWorker
public final void onStopped() {
super.onStopped();
}
public static final class DeprecatedDispatcher extends CoroutineDispatcher {
public static final DeprecatedDispatcher INSTANCE = new DeprecatedDispatcher();
private static final CoroutineDispatcher dispatcher = Dispatchers.getDefault();
public final CoroutineDispatcher getDispatcher() {
return dispatcher;
}
private DeprecatedDispatcher() {
}
@Override // kotlinx.coroutines.CoroutineDispatcher
/* renamed from: dispatch */
public void mo4148dispatch(CoroutineContext context, Runnable block) {
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(block, "block");
dispatcher.mo4148dispatch(context, block);
}
@Override // kotlinx.coroutines.CoroutineDispatcher
public boolean isDispatchNeeded(CoroutineContext context) {
Intrinsics.checkNotNullParameter(context, "context");
return dispatcher.isDispatchNeeded(context);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,25 @@
package androidx.work;
import androidx.work.Data;
import com.google.android.gms.ads.RequestConfiguration;
import kotlin.Pair;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class DataKt {
public static final Data workDataOf(Pair... pairs) {
Intrinsics.checkNotNullParameter(pairs, "pairs");
Data.Builder builder = new Data.Builder();
for (Pair pair : pairs) {
builder.put((String) pair.getFirst(), pair.getSecond());
}
return builder.build();
}
public static final /* synthetic */ <T> boolean hasKeyWithValueOfType(Data data, String key) {
Intrinsics.checkNotNullParameter(data, "<this>");
Intrinsics.checkNotNullParameter(key, "key");
Intrinsics.reifiedOperationMarker(4, RequestConfiguration.MAX_AD_CONTENT_RATING_T);
return data.hasKeyWithValueOfType(key, Object.class);
}
}

View File

@@ -0,0 +1,74 @@
package androidx.work;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class Data_Kt {
private static final String TAG;
/* JADX INFO: Access modifiers changed from: private */
public static final Boolean[] convertPrimitiveArray(boolean[] zArr) {
int length = zArr.length;
Boolean[] boolArr = new Boolean[length];
for (int i = 0; i < length; i++) {
boolArr[i] = Boolean.valueOf(zArr[i]);
}
return boolArr;
}
/* JADX INFO: Access modifiers changed from: private */
public static final Byte[] convertPrimitiveArray(byte[] bArr) {
int length = bArr.length;
Byte[] bArr2 = new Byte[length];
for (int i = 0; i < length; i++) {
bArr2[i] = Byte.valueOf(bArr[i]);
}
return bArr2;
}
/* JADX INFO: Access modifiers changed from: private */
public static final Integer[] convertPrimitiveArray(int[] iArr) {
int length = iArr.length;
Integer[] numArr = new Integer[length];
for (int i = 0; i < length; i++) {
numArr[i] = Integer.valueOf(iArr[i]);
}
return numArr;
}
/* JADX INFO: Access modifiers changed from: private */
public static final Long[] convertPrimitiveArray(long[] jArr) {
int length = jArr.length;
Long[] lArr = new Long[length];
for (int i = 0; i < length; i++) {
lArr[i] = Long.valueOf(jArr[i]);
}
return lArr;
}
/* JADX INFO: Access modifiers changed from: private */
public static final Float[] convertPrimitiveArray(float[] fArr) {
int length = fArr.length;
Float[] fArr2 = new Float[length];
for (int i = 0; i < length; i++) {
fArr2[i] = Float.valueOf(fArr[i]);
}
return fArr2;
}
/* JADX INFO: Access modifiers changed from: private */
public static final Double[] convertPrimitiveArray(double[] dArr) {
int length = dArr.length;
Double[] dArr2 = new Double[length];
for (int i = 0; i < length; i++) {
dArr2[i] = Double.valueOf(dArr[i]);
}
return dArr2;
}
static {
String tagWithPrefix = Logger.tagWithPrefix("Data");
Intrinsics.checkNotNullExpressionValue(tagWithPrefix, "tagWithPrefix(\"Data\")");
TAG = tagWithPrefix;
}
}

View File

@@ -0,0 +1,27 @@
package androidx.work;
import android.content.Context;
import androidx.annotation.RestrictTo;
import kotlin.jvm.internal.Intrinsics;
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
/* loaded from: classes.dex */
public final class DefaultWorkerFactory extends WorkerFactory {
public static final DefaultWorkerFactory INSTANCE = new DefaultWorkerFactory();
/* renamed from: createWorker, reason: collision with other method in class */
public Void m178createWorker(Context appContext, String workerClassName, WorkerParameters workerParameters) {
Intrinsics.checkNotNullParameter(appContext, "appContext");
Intrinsics.checkNotNullParameter(workerClassName, "workerClassName");
Intrinsics.checkNotNullParameter(workerParameters, "workerParameters");
return null;
}
@Override // androidx.work.WorkerFactory
public /* bridge */ /* synthetic */ ListenableWorker createWorker(Context context, String str, WorkerParameters workerParameters) {
return (ListenableWorker) m178createWorker(context, str, workerParameters);
}
private DefaultWorkerFactory() {
}
}

View File

@@ -0,0 +1,40 @@
package androidx.work;
import android.content.Context;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public class DelegatingWorkerFactory extends WorkerFactory {
private final List<WorkerFactory> factories = new CopyOnWriteArrayList();
public final void addFactory(WorkerFactory workerFactory) {
Intrinsics.checkNotNullParameter(workerFactory, "workerFactory");
this.factories.add(workerFactory);
}
@Override // androidx.work.WorkerFactory
public final ListenableWorker createWorker(Context appContext, String workerClassName, WorkerParameters workerParameters) {
String str;
Intrinsics.checkNotNullParameter(appContext, "appContext");
Intrinsics.checkNotNullParameter(workerClassName, "workerClassName");
Intrinsics.checkNotNullParameter(workerParameters, "workerParameters");
Iterator<T> it = this.factories.iterator();
while (it.hasNext()) {
try {
ListenableWorker createWorker = ((WorkerFactory) it.next()).createWorker(appContext, workerClassName, workerParameters);
if (createWorker != null) {
return createWorker;
}
} catch (Throwable th) {
Logger logger = Logger.get();
str = DelegatingWorkerFactoryKt.TAG;
logger.error(str, "Unable to instantiate a ListenableWorker (" + workerClassName + ')', th);
throw th;
}
}
return null;
}
}

View File

@@ -0,0 +1,14 @@
package androidx.work;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class DelegatingWorkerFactoryKt {
private static final String TAG;
static {
String tagWithPrefix = Logger.tagWithPrefix("DelegatingWkrFctry");
Intrinsics.checkNotNullExpressionValue(tagWithPrefix, "tagWithPrefix(\"DelegatingWkrFctry\")");
TAG = tagWithPrefix;
}
}

View File

@@ -0,0 +1,22 @@
package androidx.work;
import androidx.annotation.RestrictTo;
import java.util.concurrent.Executor;
import kotlin.jvm.internal.Intrinsics;
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
/* loaded from: classes.dex */
public enum DirectExecutor implements Executor {
INSTANCE;
@Override // java.lang.Enum
public String toString() {
return "DirectExecutor";
}
@Override // java.util.concurrent.Executor
public void execute(Runnable command) {
Intrinsics.checkNotNullParameter(command, "command");
command.run();
}
}

View File

@@ -0,0 +1,9 @@
package androidx.work;
/* loaded from: classes.dex */
public enum ExistingPeriodicWorkPolicy {
REPLACE,
KEEP,
UPDATE,
CANCEL_AND_REENQUEUE
}

View File

@@ -0,0 +1,9 @@
package androidx.work;
/* loaded from: classes.dex */
public enum ExistingWorkPolicy {
REPLACE,
KEEP,
APPEND,
APPEND_OR_REPLACE
}

View File

@@ -0,0 +1,12 @@
package androidx.work;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({ElementType.TYPE, ElementType.METHOD})
@Retention(RetentionPolicy.CLASS)
/* loaded from: classes.dex */
public @interface ExperimentalConfigurationApi {
}

View File

@@ -0,0 +1,56 @@
package androidx.work;
import android.app.Notification;
import androidx.annotation.NonNull;
/* loaded from: classes.dex */
public final class ForegroundInfo {
private final int mForegroundServiceType;
private final Notification mNotification;
private final int mNotificationId;
public int getForegroundServiceType() {
return this.mForegroundServiceType;
}
@NonNull
public Notification getNotification() {
return this.mNotification;
}
public int getNotificationId() {
return this.mNotificationId;
}
public ForegroundInfo(int i, @NonNull Notification notification) {
this(i, notification, 0);
}
public ForegroundInfo(int i, @NonNull Notification notification, int i2) {
this.mNotificationId = i;
this.mNotification = notification;
this.mForegroundServiceType = i2;
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null || ForegroundInfo.class != obj.getClass()) {
return false;
}
ForegroundInfo foregroundInfo = (ForegroundInfo) obj;
if (this.mNotificationId == foregroundInfo.mNotificationId && this.mForegroundServiceType == foregroundInfo.mForegroundServiceType) {
return this.mNotification.equals(foregroundInfo.mNotification);
}
return false;
}
public int hashCode() {
return (((this.mNotificationId * 31) + this.mForegroundServiceType) * 31) + this.mNotification.hashCode();
}
public String toString() {
return "ForegroundInfo{mNotificationId=" + this.mNotificationId + ", mForegroundServiceType=" + this.mForegroundServiceType + ", mNotification=" + this.mNotification + '}';
}
}

View File

@@ -0,0 +1,12 @@
package androidx.work;
import android.content.Context;
import androidx.annotation.NonNull;
import com.google.common.util.concurrent.ListenableFuture;
import java.util.UUID;
/* loaded from: classes.dex */
public interface ForegroundUpdater {
@NonNull
ListenableFuture setForegroundAsync(@NonNull Context context, @NonNull UUID uuid, @NonNull ForegroundInfo foregroundInfo);
}

View File

@@ -0,0 +1,8 @@
package androidx.work;
import java.util.List;
/* loaded from: classes.dex */
public abstract class InputMerger {
public abstract Data merge(List<Data> list);
}

View File

@@ -0,0 +1,16 @@
package androidx.work;
import androidx.annotation.RestrictTo;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public abstract class InputMergerFactory {
public abstract InputMerger createInputMerger(String str);
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
public final InputMerger createInputMergerWithDefaultFallback(String className) {
Intrinsics.checkNotNullParameter(className, "className");
InputMerger createInputMerger = createInputMerger(className);
return createInputMerger == null ? InputMergerKt.fromClassName(className) : createInputMerger;
}
}

View File

@@ -0,0 +1,26 @@
package androidx.work;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class InputMergerKt {
private static final String TAG;
static {
String tagWithPrefix = Logger.tagWithPrefix("InputMerger");
Intrinsics.checkNotNullExpressionValue(tagWithPrefix, "tagWithPrefix(\"InputMerger\")");
TAG = tagWithPrefix;
}
public static final InputMerger fromClassName(String className) {
Intrinsics.checkNotNullParameter(className, "className");
try {
Object newInstance = Class.forName(className).getDeclaredConstructor(new Class[0]).newInstance(new Object[0]);
Intrinsics.checkNotNull(newInstance, "null cannot be cast to non-null type androidx.work.InputMerger");
return (InputMerger) newInstance;
} catch (Exception e) {
Logger.get().error(TAG, "Trouble instantiating " + className, e);
return null;
}
}
}

View File

@@ -0,0 +1,70 @@
package androidx.work;
import androidx.concurrent.futures.CallbackToFutureAdapter;
import java.util.concurrent.CancellationException;
import kotlin.ResultKt;
import kotlin.Unit;
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;
@DebugMetadata(c = "androidx.work.ListenableFutureKt$launchFuture$1$2", f = "ListenableFuture.kt", l = {42}, m = "invokeSuspend")
/* loaded from: classes.dex */
public final class ListenableFutureKt$launchFuture$1$2 extends SuspendLambda implements Function2 {
final /* synthetic */ Function2 $block;
final /* synthetic */ CallbackToFutureAdapter.Completer<T> $completer;
private /* synthetic */ Object L$0;
int label;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public ListenableFutureKt$launchFuture$1$2(Function2 function2, CallbackToFutureAdapter.Completer<T> completer, Continuation continuation) {
super(2, continuation);
this.$block = function2;
this.$completer = completer;
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Continuation create(Object obj, Continuation continuation) {
ListenableFutureKt$launchFuture$1$2 listenableFutureKt$launchFuture$1$2 = new ListenableFutureKt$launchFuture$1$2(this.$block, this.$completer, continuation);
listenableFutureKt$launchFuture$1$2.L$0 = obj;
return listenableFutureKt$launchFuture$1$2;
}
@Override // kotlin.jvm.functions.Function2
public final Object invoke(CoroutineScope coroutineScope, Continuation continuation) {
return ((ListenableFutureKt$launchFuture$1$2) create(coroutineScope, continuation)).invokeSuspend(Unit.INSTANCE);
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Object invokeSuspend(Object obj) {
Object coroutine_suspended;
coroutine_suspended = IntrinsicsKt__IntrinsicsKt.getCOROUTINE_SUSPENDED();
int i = this.label;
try {
if (i == 0) {
ResultKt.throwOnFailure(obj);
CoroutineScope coroutineScope = (CoroutineScope) this.L$0;
Function2 function2 = this.$block;
this.label = 1;
obj = function2.invoke(coroutineScope, this);
if (obj == coroutine_suspended) {
return coroutine_suspended;
}
} else {
if (i != 1) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
ResultKt.throwOnFailure(obj);
}
this.$completer.set(obj);
} catch (CancellationException unused) {
this.$completer.setCancelled();
} catch (Throwable th) {
this.$completer.setException(th);
}
return Unit.INSTANCE;
}
}

View File

@@ -0,0 +1,113 @@
package androidx.work;
import androidx.concurrent.futures.CallbackToFutureAdapter;
import com.google.common.util.concurrent.ListenableFuture;
import java.util.concurrent.Executor;
import java.util.concurrent.atomic.AtomicBoolean;
import kotlin.coroutines.CoroutineContext;
import kotlin.coroutines.EmptyCoroutineContext;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.Intrinsics;
import kotlinx.coroutines.BuildersKt__Builders_commonKt;
import kotlinx.coroutines.CoroutineScopeKt;
import kotlinx.coroutines.CoroutineStart;
import kotlinx.coroutines.Job;
/* loaded from: classes.dex */
public final class ListenableFutureKt {
public static /* synthetic */ ListenableFuture launchFuture$default(CoroutineContext coroutineContext, CoroutineStart coroutineStart, Function2 function2, int i, Object obj) {
if ((i & 1) != 0) {
coroutineContext = EmptyCoroutineContext.INSTANCE;
}
if ((i & 2) != 0) {
coroutineStart = CoroutineStart.DEFAULT;
}
return launchFuture(coroutineContext, coroutineStart, function2);
}
public static final <T> ListenableFuture launchFuture(final CoroutineContext context, final CoroutineStart start, final Function2 block) {
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(start, "start");
Intrinsics.checkNotNullParameter(block, "block");
ListenableFuture future = CallbackToFutureAdapter.getFuture(new CallbackToFutureAdapter.Resolver() { // from class: androidx.work.ListenableFutureKt$$ExternalSyntheticLambda2
@Override // androidx.concurrent.futures.CallbackToFutureAdapter.Resolver
public final Object attachCompleter(CallbackToFutureAdapter.Completer completer) {
Object launchFuture$lambda$1;
launchFuture$lambda$1 = ListenableFutureKt.launchFuture$lambda$1(CoroutineContext.this, start, block, completer);
return launchFuture$lambda$1;
}
});
Intrinsics.checkNotNullExpressionValue(future, "getFuture { completer ->…owable)\n }\n }\n}");
return future;
}
/* JADX INFO: Access modifiers changed from: private */
public static final Object launchFuture$lambda$1(CoroutineContext coroutineContext, CoroutineStart coroutineStart, Function2 function2, CallbackToFutureAdapter.Completer completer) {
Job launch$default;
Intrinsics.checkNotNullParameter(completer, "completer");
final Job job = (Job) coroutineContext.get(Job.Key);
completer.addCancellationListener(new Runnable() { // from class: androidx.work.ListenableFutureKt$$ExternalSyntheticLambda0
@Override // java.lang.Runnable
public final void run() {
ListenableFutureKt.launchFuture$lambda$1$lambda$0(Job.this);
}
}, DirectExecutor.INSTANCE);
launch$default = BuildersKt__Builders_commonKt.launch$default(CoroutineScopeKt.CoroutineScope(coroutineContext), null, coroutineStart, new ListenableFutureKt$launchFuture$1$2(function2, completer, null), 1, null);
return launch$default;
}
/* JADX INFO: Access modifiers changed from: private */
public static final void launchFuture$lambda$1$lambda$0(Job job) {
if (job != null) {
Job.DefaultImpls.cancel$default(job, null, 1, null);
}
}
public static final <V> ListenableFuture executeAsync(final Executor executor, final String debugTag, final Function0 block) {
Intrinsics.checkNotNullParameter(executor, "<this>");
Intrinsics.checkNotNullParameter(debugTag, "debugTag");
Intrinsics.checkNotNullParameter(block, "block");
ListenableFuture future = CallbackToFutureAdapter.getFuture(new CallbackToFutureAdapter.Resolver() { // from class: androidx.work.ListenableFutureKt$$ExternalSyntheticLambda1
@Override // androidx.concurrent.futures.CallbackToFutureAdapter.Resolver
public final Object attachCompleter(CallbackToFutureAdapter.Completer completer) {
Object executeAsync$lambda$4;
executeAsync$lambda$4 = ListenableFutureKt.executeAsync$lambda$4(executor, debugTag, block, completer);
return executeAsync$lambda$4;
}
});
Intrinsics.checkNotNullExpressionValue(future, "getFuture { completer ->… }\n debugTag\n }");
return future;
}
/* JADX INFO: Access modifiers changed from: private */
public static final Object executeAsync$lambda$4(Executor executor, String str, final Function0 function0, final CallbackToFutureAdapter.Completer completer) {
Intrinsics.checkNotNullParameter(completer, "completer");
final AtomicBoolean atomicBoolean = new AtomicBoolean(false);
completer.addCancellationListener(new Runnable() { // from class: androidx.work.ListenableFutureKt$$ExternalSyntheticLambda3
@Override // java.lang.Runnable
public final void run() {
atomicBoolean.set(true);
}
}, DirectExecutor.INSTANCE);
executor.execute(new Runnable() { // from class: androidx.work.ListenableFutureKt$$ExternalSyntheticLambda4
@Override // java.lang.Runnable
public final void run() {
ListenableFutureKt.executeAsync$lambda$4$lambda$3(atomicBoolean, completer, function0);
}
});
return str;
}
/* JADX INFO: Access modifiers changed from: private */
public static final void executeAsync$lambda$4$lambda$3(AtomicBoolean atomicBoolean, CallbackToFutureAdapter.Completer completer, Function0 function0) {
if (atomicBoolean.get()) {
return;
}
try {
completer.set(function0.invoke());
} catch (Throwable th) {
completer.setException(th);
}
}
}

View File

@@ -0,0 +1,299 @@
package androidx.work;
import android.content.Context;
import android.net.Network;
import android.net.Uri;
import androidx.annotation.IntRange;
import androidx.annotation.MainThread;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.annotation.RestrictTo;
import androidx.concurrent.futures.CallbackToFutureAdapter;
import androidx.work.impl.utils.taskexecutor.TaskExecutor;
import com.google.common.util.concurrent.ListenableFuture;
import java.util.List;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.Executor;
import java.util.concurrent.atomic.AtomicInteger;
/* loaded from: classes.dex */
public abstract class ListenableWorker {
@NonNull
private Context mAppContext;
private final AtomicInteger mStopReason = new AtomicInteger(-256);
private boolean mUsed;
@NonNull
private WorkerParameters mWorkerParams;
@NonNull
public final Context getApplicationContext() {
return this.mAppContext;
}
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
public final boolean isUsed() {
return this.mUsed;
}
public void onStopped() {
}
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
public final void setUsed() {
this.mUsed = true;
}
@NonNull
@MainThread
public abstract ListenableFuture startWork();
public ListenableWorker(@NonNull Context context, @NonNull WorkerParameters workerParameters) {
if (context == null) {
throw new IllegalArgumentException("Application Context is null");
}
if (workerParameters == null) {
throw new IllegalArgumentException("WorkerParameters is null");
}
this.mAppContext = context;
this.mWorkerParams = workerParameters;
}
@NonNull
public final UUID getId() {
return this.mWorkerParams.getId();
}
@NonNull
public final Data getInputData() {
return this.mWorkerParams.getInputData();
}
@NonNull
public final Set<String> getTags() {
return this.mWorkerParams.getTags();
}
@NonNull
@RequiresApi(24)
public final List<Uri> getTriggeredContentUris() {
return this.mWorkerParams.getTriggeredContentUris();
}
@NonNull
@RequiresApi(24)
public final List<String> getTriggeredContentAuthorities() {
return this.mWorkerParams.getTriggeredContentAuthorities();
}
@Nullable
@RequiresApi(28)
public final Network getNetwork() {
return this.mWorkerParams.getNetwork();
}
@IntRange(from = 0)
public final int getRunAttemptCount() {
return this.mWorkerParams.getRunAttemptCount();
}
@NonNull
public ListenableFuture setProgressAsync(@NonNull Data data) {
return this.mWorkerParams.getProgressUpdater().updateProgress(getApplicationContext(), getId(), data);
}
@NonNull
public final ListenableFuture setForegroundAsync(@NonNull ForegroundInfo foregroundInfo) {
return this.mWorkerParams.getForegroundUpdater().setForegroundAsync(getApplicationContext(), getId(), foregroundInfo);
}
@NonNull
public ListenableFuture getForegroundInfoAsync() {
return CallbackToFutureAdapter.getFuture(new CallbackToFutureAdapter.Resolver() { // from class: androidx.work.ListenableWorker$$ExternalSyntheticLambda0
@Override // androidx.concurrent.futures.CallbackToFutureAdapter.Resolver
public final Object attachCompleter(CallbackToFutureAdapter.Completer completer) {
Object lambda$getForegroundInfoAsync$0;
lambda$getForegroundInfoAsync$0 = ListenableWorker.lambda$getForegroundInfoAsync$0(completer);
return lambda$getForegroundInfoAsync$0;
}
});
}
/* JADX INFO: Access modifiers changed from: private */
public static /* synthetic */ Object lambda$getForegroundInfoAsync$0(CallbackToFutureAdapter.Completer completer) throws Exception {
completer.setException(new IllegalStateException("Expedited WorkRequests require a ListenableWorker to provide an implementation for`getForegroundInfoAsync()`"));
return "default failing getForegroundInfoAsync";
}
public final boolean isStopped() {
return this.mStopReason.get() != -256;
}
@RequiresApi(31)
public final int getStopReason() {
return this.mStopReason.get();
}
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
public final void stop(int i) {
if (this.mStopReason.compareAndSet(-256, i)) {
onStopped();
}
}
@NonNull
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
public Executor getBackgroundExecutor() {
return this.mWorkerParams.getBackgroundExecutor();
}
@NonNull
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
public TaskExecutor getTaskExecutor() {
return this.mWorkerParams.getTaskExecutor();
}
@NonNull
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
public WorkerFactory getWorkerFactory() {
return this.mWorkerParams.getWorkerFactory();
}
public static abstract class Result {
@NonNull
public abstract Data getOutputData();
@NonNull
public static Result success() {
return new Success();
}
@NonNull
public static Result success(@NonNull Data data) {
return new Success(data);
}
@NonNull
public static Result retry() {
return new Retry();
}
@NonNull
public static Result failure() {
return new Failure();
}
@NonNull
public static Result failure(@NonNull Data data) {
return new Failure(data);
}
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
public Result() {
}
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
public static final class Success extends Result {
private final Data mOutputData;
@Override // androidx.work.ListenableWorker.Result
@NonNull
public Data getOutputData() {
return this.mOutputData;
}
public Success() {
this(Data.EMPTY);
}
public Success(@NonNull Data data) {
this.mOutputData = data;
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null || Success.class != obj.getClass()) {
return false;
}
return this.mOutputData.equals(((Success) obj).mOutputData);
}
public int hashCode() {
return (Success.class.getName().hashCode() * 31) + this.mOutputData.hashCode();
}
@NonNull
public String toString() {
return "Success {mOutputData=" + this.mOutputData + '}';
}
}
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
public static final class Failure extends Result {
private final Data mOutputData;
@Override // androidx.work.ListenableWorker.Result
@NonNull
public Data getOutputData() {
return this.mOutputData;
}
public Failure() {
this(Data.EMPTY);
}
public Failure(@NonNull Data data) {
this.mOutputData = data;
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null || Failure.class != obj.getClass()) {
return false;
}
return this.mOutputData.equals(((Failure) obj).mOutputData);
}
public int hashCode() {
return (Failure.class.getName().hashCode() * 31) + this.mOutputData.hashCode();
}
@NonNull
public String toString() {
return "Failure {mOutputData=" + this.mOutputData + '}';
}
}
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
public static final class Retry extends Result {
@NonNull
public String toString() {
return "Retry";
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
return obj != null && Retry.class == obj.getClass();
}
public int hashCode() {
return Retry.class.getName().hashCode();
}
@Override // androidx.work.ListenableWorker.Result
@NonNull
public Data getOutputData() {
return Data.EMPTY;
}
}
}
}

View File

@@ -0,0 +1,141 @@
package androidx.work;
import android.util.Log;
import androidx.annotation.NonNull;
import androidx.annotation.RestrictTo;
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
/* loaded from: classes.dex */
public abstract class Logger {
private static final int MAX_PREFIXED_TAG_LENGTH = 20;
private static final int MAX_TAG_LENGTH = 23;
private static final String TAG_PREFIX = "WM-";
private static final Object sLock = new Object();
private static volatile Logger sLogger;
public abstract void debug(@NonNull String str, @NonNull String str2);
public abstract void debug(@NonNull String str, @NonNull String str2, @NonNull Throwable th);
public abstract void error(@NonNull String str, @NonNull String str2);
public abstract void error(@NonNull String str, @NonNull String str2, @NonNull Throwable th);
public abstract void info(@NonNull String str, @NonNull String str2);
public abstract void info(@NonNull String str, @NonNull String str2, @NonNull Throwable th);
public abstract void verbose(@NonNull String str, @NonNull String str2);
public abstract void verbose(@NonNull String str, @NonNull String str2, @NonNull Throwable th);
public abstract void warning(@NonNull String str, @NonNull String str2);
public abstract void warning(@NonNull String str, @NonNull String str2, @NonNull Throwable th);
public static void setLogger(@NonNull Logger logger) {
synchronized (sLock) {
try {
if (sLogger == null) {
sLogger = logger;
}
} catch (Throwable th) {
throw th;
}
}
}
@NonNull
public static String tagWithPrefix(@NonNull String str) {
int length = str.length();
StringBuilder sb = new StringBuilder(23);
sb.append(TAG_PREFIX);
int i = MAX_PREFIXED_TAG_LENGTH;
if (length >= i) {
sb.append(str.substring(0, i));
} else {
sb.append(str);
}
return sb.toString();
}
@NonNull
public static Logger get() {
Logger logger;
synchronized (sLock) {
try {
if (sLogger == null) {
sLogger = new LogcatLogger(3);
}
logger = sLogger;
} catch (Throwable th) {
throw th;
}
}
return logger;
}
public Logger(int i) {
}
public static class LogcatLogger extends Logger {
private final int mLoggingLevel;
@Override // androidx.work.Logger
public void debug(@NonNull String str, @NonNull String str2) {
}
@Override // androidx.work.Logger
public void debug(@NonNull String str, @NonNull String str2, @NonNull Throwable th) {
}
@Override // androidx.work.Logger
public void info(@NonNull String str, @NonNull String str2) {
}
@Override // androidx.work.Logger
public void info(@NonNull String str, @NonNull String str2, @NonNull Throwable th) {
}
@Override // androidx.work.Logger
public void verbose(@NonNull String str, @NonNull String str2) {
}
@Override // androidx.work.Logger
public void verbose(@NonNull String str, @NonNull String str2, @NonNull Throwable th) {
}
public LogcatLogger(int i) {
super(i);
this.mLoggingLevel = i;
}
@Override // androidx.work.Logger
public void warning(@NonNull String str, @NonNull String str2) {
if (this.mLoggingLevel <= 5) {
Log.w(str, str2);
}
}
@Override // androidx.work.Logger
public void warning(@NonNull String str, @NonNull String str2, @NonNull Throwable th) {
if (this.mLoggingLevel <= 5) {
Log.w(str, str2, th);
}
}
@Override // androidx.work.Logger
public void error(@NonNull String str, @NonNull String str2) {
if (this.mLoggingLevel <= 6) {
Log.e(str, str2);
}
}
@Override // androidx.work.Logger
public void error(@NonNull String str, @NonNull String str2, @NonNull Throwable th) {
if (this.mLoggingLevel <= 6) {
Log.e(str, str2, th);
}
}
}
}

View File

@@ -0,0 +1,46 @@
package androidx.work;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class LoggerExtKt {
public static final void logd(String tag, Function0 block) {
Intrinsics.checkNotNullParameter(tag, "tag");
Intrinsics.checkNotNullParameter(block, "block");
Logger.get().debug(tag, (String) block.invoke());
}
public static final void logd(String tag, Throwable t, Function0 block) {
Intrinsics.checkNotNullParameter(tag, "tag");
Intrinsics.checkNotNullParameter(t, "t");
Intrinsics.checkNotNullParameter(block, "block");
Logger.get().debug(tag, (String) block.invoke(), t);
}
public static final void logi(String tag, Function0 block) {
Intrinsics.checkNotNullParameter(tag, "tag");
Intrinsics.checkNotNullParameter(block, "block");
Logger.get().info(tag, (String) block.invoke());
}
public static final void logi(String tag, Throwable t, Function0 block) {
Intrinsics.checkNotNullParameter(tag, "tag");
Intrinsics.checkNotNullParameter(t, "t");
Intrinsics.checkNotNullParameter(block, "block");
Logger.get().info(tag, (String) block.invoke(), t);
}
public static final void loge(String tag, Function0 block) {
Intrinsics.checkNotNullParameter(tag, "tag");
Intrinsics.checkNotNullParameter(block, "block");
Logger.get().error(tag, (String) block.invoke());
}
public static final void loge(String tag, Throwable t, Function0 block) {
Intrinsics.checkNotNullParameter(tag, "tag");
Intrinsics.checkNotNullParameter(t, "t");
Intrinsics.checkNotNullParameter(block, "block");
Logger.get().error(tag, (String) block.invoke(), t);
}
}

View File

@@ -0,0 +1,11 @@
package androidx.work;
/* loaded from: classes.dex */
public enum NetworkType {
NOT_REQUIRED,
CONNECTED,
UNMETERED,
NOT_ROAMING,
METERED,
TEMPORARILY_UNMETERED
}

View File

@@ -0,0 +1,22 @@
package androidx.work;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class NoOpInputMergerFactory extends InputMergerFactory {
public static final NoOpInputMergerFactory INSTANCE = new NoOpInputMergerFactory();
/* renamed from: createInputMerger, reason: collision with other method in class */
public Void m182createInputMerger(String className) {
Intrinsics.checkNotNullParameter(className, "className");
return null;
}
private NoOpInputMergerFactory() {
}
@Override // androidx.work.InputMergerFactory
public /* bridge */ /* synthetic */ InputMerger createInputMerger(String str) {
return (InputMerger) m182createInputMerger(str);
}
}

View File

@@ -0,0 +1,96 @@
package androidx.work;
import androidx.work.WorkRequest;
import androidx.work.impl.model.WorkSpec;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import kotlin.collections.CollectionsKt__IterablesKt;
import kotlin.jvm.JvmClassMappingKt;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.SourceDebugExtension;
import kotlin.reflect.KClass;
/* loaded from: classes.dex */
public final class OneTimeWorkRequest extends WorkRequest {
public static final Companion Companion = new Companion(null);
public static final OneTimeWorkRequest from(Class<? extends ListenableWorker> cls) {
return Companion.from(cls);
}
public static final List<OneTimeWorkRequest> from(List<? extends Class<? extends ListenableWorker>> list) {
return Companion.from(list);
}
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public OneTimeWorkRequest(Builder builder) {
super(builder.getId$work_runtime_release(), builder.getWorkSpec$work_runtime_release(), builder.getTags$work_runtime_release());
Intrinsics.checkNotNullParameter(builder, "builder");
}
public static final class Builder extends WorkRequest.Builder<Builder, OneTimeWorkRequest> {
/* JADX WARN: Can't rename method to resolve collision */
@Override // androidx.work.WorkRequest.Builder
public Builder getThisObject$work_runtime_release() {
return this;
}
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public Builder(Class<? extends ListenableWorker> workerClass) {
super(workerClass);
Intrinsics.checkNotNullParameter(workerClass, "workerClass");
}
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
public Builder(KClass workerClass) {
this((Class<? extends ListenableWorker>) JvmClassMappingKt.getJavaClass(workerClass));
Intrinsics.checkNotNullParameter(workerClass, "workerClass");
}
public final Builder setInputMerger(Class<? extends InputMerger> inputMerger) {
Intrinsics.checkNotNullParameter(inputMerger, "inputMerger");
WorkSpec workSpec$work_runtime_release = getWorkSpec$work_runtime_release();
String name = inputMerger.getName();
Intrinsics.checkNotNullExpressionValue(name, "inputMerger.name");
workSpec$work_runtime_release.inputMergerClassName = name;
return this;
}
/* JADX WARN: Can't rename method to resolve collision */
@Override // androidx.work.WorkRequest.Builder
public OneTimeWorkRequest buildInternal$work_runtime_release() {
if (getBackoffCriteriaSet$work_runtime_release() && getWorkSpec$work_runtime_release().constraints.requiresDeviceIdle()) {
throw new IllegalArgumentException("Cannot set backoff criteria on an idle mode job".toString());
}
return new OneTimeWorkRequest(this);
}
}
@SourceDebugExtension({"SMAP\nOneTimeWorkRequest.kt\nKotlin\n*S Kotlin\n*F\n+ 1 OneTimeWorkRequest.kt\nandroidx/work/OneTimeWorkRequest$Companion\n+ 2 _Collections.kt\nkotlin/collections/CollectionsKt___CollectionsKt\n*L\n1#1,112:1\n1549#2:113\n1620#2,3:114\n*S KotlinDebug\n*F\n+ 1 OneTimeWorkRequest.kt\nandroidx/work/OneTimeWorkRequest$Companion\n*L\n98#1:113\n98#1:114,3\n*E\n"})
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
public final OneTimeWorkRequest from(Class<? extends ListenableWorker> workerClass) {
Intrinsics.checkNotNullParameter(workerClass, "workerClass");
return new Builder(workerClass).build();
}
public final List<OneTimeWorkRequest> from(List<? extends Class<? extends ListenableWorker>> workerClasses) {
Intrinsics.checkNotNullParameter(workerClasses, "workerClasses");
List<? extends Class<? extends ListenableWorker>> list = workerClasses;
ArrayList arrayList = new ArrayList(CollectionsKt__IterablesKt.collectionSizeOrDefault(list, 10));
Iterator<T> it = list.iterator();
while (it.hasNext()) {
arrayList.add(new Builder((Class<? extends ListenableWorker>) it.next()).build());
}
return arrayList;
}
}
}

View File

@@ -0,0 +1,21 @@
package androidx.work;
import androidx.annotation.NonNull;
import androidx.work.OneTimeWorkRequest;
import kotlin.jvm.JvmClassMappingKt;
import kotlin.jvm.internal.Intrinsics;
import kotlin.reflect.KClass;
/* loaded from: classes.dex */
public final class OneTimeWorkRequestKt {
public static final /* synthetic */ <W extends ListenableWorker> OneTimeWorkRequest.Builder OneTimeWorkRequestBuilder() {
Intrinsics.reifiedOperationMarker(4, "W");
return new OneTimeWorkRequest.Builder((Class<? extends ListenableWorker>) ListenableWorker.class);
}
public static final OneTimeWorkRequest.Builder setInputMerger(OneTimeWorkRequest.Builder builder, @NonNull KClass inputMerger) {
Intrinsics.checkNotNullParameter(builder, "<this>");
Intrinsics.checkNotNullParameter(inputMerger, "inputMerger");
return builder.setInputMerger(JvmClassMappingKt.getJavaClass(inputMerger));
}
}

View File

@@ -0,0 +1,71 @@
package androidx.work;
import androidx.annotation.NonNull;
import androidx.annotation.RestrictTo;
import androidx.lifecycle.LiveData;
import com.google.common.util.concurrent.ListenableFuture;
/* loaded from: classes.dex */
public interface Operation {
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
public static final State.IN_PROGRESS IN_PROGRESS;
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
public static final State.SUCCESS SUCCESS;
@NonNull
ListenableFuture getResult();
@NonNull
LiveData<State> getState();
static {
SUCCESS = new State.SUCCESS();
IN_PROGRESS = new State.IN_PROGRESS();
}
public static abstract class State {
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
public State() {
}
public static final class SUCCESS extends State {
@NonNull
public String toString() {
return "SUCCESS";
}
private SUCCESS() {
}
}
public static final class IN_PROGRESS extends State {
@NonNull
public String toString() {
return "IN_PROGRESS";
}
private IN_PROGRESS() {
}
}
public static final class FAILURE extends State {
private final Throwable mThrowable;
@NonNull
public Throwable getThrowable() {
return this.mThrowable;
}
public FAILURE(@NonNull Throwable th) {
this.mThrowable = th;
}
@NonNull
public String toString() {
return "FAILURE (" + this.mThrowable.getMessage() + ")";
}
}
}
}

View File

@@ -0,0 +1,29 @@
package androidx.work;
import androidx.lifecycle.LiveData;
import androidx.work.Operation;
import com.google.common.util.concurrent.ListenableFuture;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
final class OperationImpl implements Operation {
private final ListenableFuture future;
private final LiveData<Operation.State> state;
@Override // androidx.work.Operation
public ListenableFuture getResult() {
return this.future;
}
@Override // androidx.work.Operation
public LiveData<Operation.State> getState() {
return this.state;
}
public OperationImpl(LiveData<Operation.State> state, ListenableFuture future) {
Intrinsics.checkNotNullParameter(state, "state");
Intrinsics.checkNotNullParameter(future, "future");
this.state = state;
this.future = future;
}
}

View File

@@ -0,0 +1,23 @@
package androidx.work;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.jvm.internal.ContinuationImpl;
import kotlin.coroutines.jvm.internal.DebugMetadata;
@DebugMetadata(c = "androidx.work.OperationKt", f = "Operation.kt", l = {36}, m = "await")
/* loaded from: classes.dex */
public final class OperationKt$await$1 extends ContinuationImpl {
int label;
/* synthetic */ Object result;
public OperationKt$await$1(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 OperationKt.await(null, this);
}
}

View File

@@ -0,0 +1,134 @@
package androidx.work;
import androidx.concurrent.futures.CallbackToFutureAdapter;
import androidx.lifecycle.MutableLiveData;
import androidx.work.Operation;
import com.google.common.util.concurrent.ListenableFuture;
import java.util.concurrent.Executor;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.internal.InlineMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.SourceDebugExtension;
@SourceDebugExtension({"SMAP\nOperation.kt\nKotlin\n*S Kotlin\n*F\n+ 1 Operation.kt\nandroidx/work/OperationKt\n+ 2 Tracer.kt\nandroidx/work/TracerKt\n*L\n1#1,71:1\n53#2,9:72\n*S KotlinDebug\n*F\n+ 1 Operation.kt\nandroidx/work/OperationKt\n*L\n48#1:72,9\n*E\n"})
/* loaded from: classes.dex */
public final class OperationKt {
/* JADX WARN: Removed duplicated region for block: B:15:0x0031 */
/* JADX WARN: Removed duplicated region for block: B:8:0x0023 */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public static final java.lang.Object await(androidx.work.Operation r4, kotlin.coroutines.Continuation r5) {
/*
boolean r0 = r5 instanceof androidx.work.OperationKt$await$1
if (r0 == 0) goto L13
r0 = r5
androidx.work.OperationKt$await$1 r0 = (androidx.work.OperationKt$await$1) 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.OperationKt$await$1 r0 = new androidx.work.OperationKt$await$1
r0.<init>(r5)
L18:
java.lang.Object r5 = 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(r5)
goto L46
L29:
java.lang.IllegalStateException r4 = new java.lang.IllegalStateException
java.lang.String r5 = "call to 'resume' before 'invoke' with coroutine"
r4.<init>(r5)
throw r4
L31:
kotlin.ResultKt.throwOnFailure(r5)
com.google.common.util.concurrent.ListenableFuture r4 = r4.getResult()
java.lang.String r5 = "result"
kotlin.jvm.internal.Intrinsics.checkNotNullExpressionValue(r4, r5)
r0.label = r3
java.lang.Object r5 = androidx.concurrent.futures.ListenableFutureKt.await(r4, r0)
if (r5 != r1) goto L46
return r1
L46:
java.lang.String r4 = "result.await()"
kotlin.jvm.internal.Intrinsics.checkNotNullExpressionValue(r5, r4)
return r5
*/
throw new UnsupportedOperationException("Method not decompiled: androidx.work.OperationKt.await(androidx.work.Operation, kotlin.coroutines.Continuation):java.lang.Object");
}
private static final Object await$$forInline(Operation operation, Continuation continuation) {
ListenableFuture result = operation.getResult();
Intrinsics.checkNotNullExpressionValue(result, "result");
InlineMarker.mark(0);
Object await = androidx.concurrent.futures.ListenableFutureKt.await(result, continuation);
InlineMarker.mark(1);
Intrinsics.checkNotNullExpressionValue(await, "result.await()");
return await;
}
public static final Operation launchOperation(final Tracer tracer, final String label, final Executor executor, final Function0 block) {
Intrinsics.checkNotNullParameter(tracer, "tracer");
Intrinsics.checkNotNullParameter(label, "label");
Intrinsics.checkNotNullParameter(executor, "executor");
Intrinsics.checkNotNullParameter(block, "block");
final MutableLiveData mutableLiveData = new MutableLiveData(Operation.IN_PROGRESS);
ListenableFuture future = CallbackToFutureAdapter.getFuture(new CallbackToFutureAdapter.Resolver() { // from class: androidx.work.OperationKt$$ExternalSyntheticLambda1
@Override // androidx.concurrent.futures.CallbackToFutureAdapter.Resolver
public final Object attachCompleter(CallbackToFutureAdapter.Completer completer) {
Unit launchOperation$lambda$2;
launchOperation$lambda$2 = OperationKt.launchOperation$lambda$2(executor, tracer, label, block, mutableLiveData, completer);
return launchOperation$lambda$2;
}
});
Intrinsics.checkNotNullExpressionValue(future, "getFuture { completer ->…}\n }\n }");
return new OperationImpl(mutableLiveData, future);
}
/* JADX INFO: Access modifiers changed from: private */
public static final Unit launchOperation$lambda$2(Executor executor, final Tracer tracer, final String str, final Function0 function0, final MutableLiveData mutableLiveData, final CallbackToFutureAdapter.Completer completer) {
Intrinsics.checkNotNullParameter(completer, "completer");
executor.execute(new Runnable() { // from class: androidx.work.OperationKt$$ExternalSyntheticLambda0
@Override // java.lang.Runnable
public final void run() {
OperationKt.launchOperation$lambda$2$lambda$1(Tracer.this, str, function0, mutableLiveData, completer);
}
});
return Unit.INSTANCE;
}
/* JADX INFO: Access modifiers changed from: private */
public static final void launchOperation$lambda$2$lambda$1(Tracer tracer, String str, Function0 function0, MutableLiveData mutableLiveData, CallbackToFutureAdapter.Completer completer) {
boolean isEnabled = tracer.isEnabled();
if (isEnabled) {
try {
tracer.beginSection(str);
} finally {
if (isEnabled) {
tracer.endSection();
}
}
}
try {
function0.invoke();
Operation.State.SUCCESS success = Operation.SUCCESS;
mutableLiveData.postValue(success);
completer.set(success);
} catch (Throwable th) {
mutableLiveData.postValue(new Operation.State.FAILURE(th));
completer.setException(th);
}
Unit unit = Unit.INSTANCE;
}
}

View File

@@ -0,0 +1,7 @@
package androidx.work;
/* loaded from: classes.dex */
public enum OutOfQuotaPolicy {
RUN_AS_NON_EXPEDITED_WORK_REQUEST,
DROP_WORK_REQUEST
}

View File

@@ -0,0 +1,23 @@
package androidx.work;
import androidx.work.Data;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class OverwritingInputMerger extends InputMerger {
@Override // androidx.work.InputMerger
public Data merge(List<Data> inputs) {
Intrinsics.checkNotNullParameter(inputs, "inputs");
Data.Builder builder = new Data.Builder();
LinkedHashMap linkedHashMap = new LinkedHashMap();
Iterator<Data> it = inputs.iterator();
while (it.hasNext()) {
linkedHashMap.putAll(it.next().getKeyValueMap());
}
builder.putAll(linkedHashMap);
return builder.build();
}
}

View File

@@ -0,0 +1,147 @@
package androidx.work;
import android.annotation.SuppressLint;
import androidx.annotation.RequiresApi;
import androidx.work.WorkRequest;
import androidx.work.impl.utils.DurationApi26Impl;
import java.time.Duration;
import java.util.concurrent.TimeUnit;
import kotlin.jvm.JvmClassMappingKt;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.SourceDebugExtension;
import kotlin.reflect.KClass;
/* loaded from: classes.dex */
public final class PeriodicWorkRequest extends WorkRequest {
public static final Companion Companion = new Companion(null);
@SuppressLint({"MinMaxConstant"})
public static final long MIN_PERIODIC_FLEX_MILLIS = 300000;
@SuppressLint({"MinMaxConstant"})
public static final long MIN_PERIODIC_INTERVAL_MILLIS = 900000;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public PeriodicWorkRequest(Builder builder) {
super(builder.getId$work_runtime_release(), builder.getWorkSpec$work_runtime_release(), builder.getTags$work_runtime_release());
Intrinsics.checkNotNullParameter(builder, "builder");
}
@SourceDebugExtension({"SMAP\nPeriodicWorkRequest.kt\nKotlin\n*S Kotlin\n*F\n+ 1 PeriodicWorkRequest.kt\nandroidx/work/PeriodicWorkRequest$Builder\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,420:1\n1#2:421\n*E\n"})
public static final class Builder extends WorkRequest.Builder<Builder, PeriodicWorkRequest> {
/* JADX WARN: Can't rename method to resolve collision */
@Override // androidx.work.WorkRequest.Builder
public Builder getThisObject$work_runtime_release() {
return this;
}
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public Builder(Class<? extends ListenableWorker> workerClass, long j, TimeUnit repeatIntervalTimeUnit) {
super(workerClass);
Intrinsics.checkNotNullParameter(workerClass, "workerClass");
Intrinsics.checkNotNullParameter(repeatIntervalTimeUnit, "repeatIntervalTimeUnit");
getWorkSpec$work_runtime_release().setPeriodic(repeatIntervalTimeUnit.toMillis(j));
}
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public Builder(KClass workerClass, long j, TimeUnit repeatIntervalTimeUnit) {
super(JvmClassMappingKt.getJavaClass(workerClass));
Intrinsics.checkNotNullParameter(workerClass, "workerClass");
Intrinsics.checkNotNullParameter(repeatIntervalTimeUnit, "repeatIntervalTimeUnit");
getWorkSpec$work_runtime_release().setPeriodic(repeatIntervalTimeUnit.toMillis(j));
}
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
@RequiresApi(26)
public Builder(Class<? extends ListenableWorker> workerClass, Duration repeatInterval) {
super(workerClass);
Intrinsics.checkNotNullParameter(workerClass, "workerClass");
Intrinsics.checkNotNullParameter(repeatInterval, "repeatInterval");
getWorkSpec$work_runtime_release().setPeriodic(DurationApi26Impl.toMillisCompat(repeatInterval));
}
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
@RequiresApi(26)
public Builder(KClass workerClass, Duration repeatInterval) {
super(JvmClassMappingKt.getJavaClass(workerClass));
Intrinsics.checkNotNullParameter(workerClass, "workerClass");
Intrinsics.checkNotNullParameter(repeatInterval, "repeatInterval");
getWorkSpec$work_runtime_release().setPeriodic(DurationApi26Impl.toMillisCompat(repeatInterval));
}
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public Builder(Class<? extends ListenableWorker> workerClass, long j, TimeUnit repeatIntervalTimeUnit, long j2, TimeUnit flexIntervalTimeUnit) {
super(workerClass);
Intrinsics.checkNotNullParameter(workerClass, "workerClass");
Intrinsics.checkNotNullParameter(repeatIntervalTimeUnit, "repeatIntervalTimeUnit");
Intrinsics.checkNotNullParameter(flexIntervalTimeUnit, "flexIntervalTimeUnit");
getWorkSpec$work_runtime_release().setPeriodic(repeatIntervalTimeUnit.toMillis(j), flexIntervalTimeUnit.toMillis(j2));
}
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public Builder(KClass workerClass, long j, TimeUnit repeatIntervalTimeUnit, long j2, TimeUnit flexIntervalTimeUnit) {
super(JvmClassMappingKt.getJavaClass(workerClass));
Intrinsics.checkNotNullParameter(workerClass, "workerClass");
Intrinsics.checkNotNullParameter(repeatIntervalTimeUnit, "repeatIntervalTimeUnit");
Intrinsics.checkNotNullParameter(flexIntervalTimeUnit, "flexIntervalTimeUnit");
getWorkSpec$work_runtime_release().setPeriodic(repeatIntervalTimeUnit.toMillis(j), flexIntervalTimeUnit.toMillis(j2));
}
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
@RequiresApi(26)
public Builder(Class<? extends ListenableWorker> workerClass, Duration repeatInterval, Duration flexInterval) {
super(workerClass);
Intrinsics.checkNotNullParameter(workerClass, "workerClass");
Intrinsics.checkNotNullParameter(repeatInterval, "repeatInterval");
Intrinsics.checkNotNullParameter(flexInterval, "flexInterval");
getWorkSpec$work_runtime_release().setPeriodic(DurationApi26Impl.toMillisCompat(repeatInterval), DurationApi26Impl.toMillisCompat(flexInterval));
}
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
@RequiresApi(26)
public Builder(KClass workerClass, Duration repeatInterval, Duration flexInterval) {
super(JvmClassMappingKt.getJavaClass(workerClass));
Intrinsics.checkNotNullParameter(workerClass, "workerClass");
Intrinsics.checkNotNullParameter(repeatInterval, "repeatInterval");
Intrinsics.checkNotNullParameter(flexInterval, "flexInterval");
getWorkSpec$work_runtime_release().setPeriodic(DurationApi26Impl.toMillisCompat(repeatInterval), DurationApi26Impl.toMillisCompat(flexInterval));
}
public final Builder setNextScheduleTimeOverride(long j) {
if (j == Long.MAX_VALUE) {
throw new IllegalArgumentException("Cannot set Long.MAX_VALUE as the schedule override time".toString());
}
getWorkSpec$work_runtime_release().setNextScheduleTimeOverride(j);
getWorkSpec$work_runtime_release().setNextScheduleTimeOverrideGeneration(1);
return this;
}
public final Builder clearNextScheduleTimeOverride() {
getWorkSpec$work_runtime_release().setNextScheduleTimeOverride(Long.MAX_VALUE);
getWorkSpec$work_runtime_release().setNextScheduleTimeOverrideGeneration(1);
return this;
}
/* JADX WARN: Can't rename method to resolve collision */
@Override // androidx.work.WorkRequest.Builder
public PeriodicWorkRequest buildInternal$work_runtime_release() {
if (getBackoffCriteriaSet$work_runtime_release() && getWorkSpec$work_runtime_release().constraints.requiresDeviceIdle()) {
throw new IllegalArgumentException("Cannot set backoff criteria on an idle mode job".toString());
}
if (!(!getWorkSpec$work_runtime_release().expedited)) {
throw new IllegalArgumentException("PeriodicWorkRequests cannot be expedited".toString());
}
return new PeriodicWorkRequest(this);
}
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
}
}

View File

@@ -0,0 +1,38 @@
package androidx.work;
import androidx.annotation.RequiresApi;
import androidx.work.PeriodicWorkRequest;
import java.time.Duration;
import java.util.concurrent.TimeUnit;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class PeriodicWorkRequestKt {
public static final /* synthetic */ <W extends ListenableWorker> PeriodicWorkRequest.Builder PeriodicWorkRequestBuilder(long j, TimeUnit repeatIntervalTimeUnit) {
Intrinsics.checkNotNullParameter(repeatIntervalTimeUnit, "repeatIntervalTimeUnit");
Intrinsics.reifiedOperationMarker(4, "W");
return new PeriodicWorkRequest.Builder((Class<? extends ListenableWorker>) ListenableWorker.class, j, repeatIntervalTimeUnit);
}
@RequiresApi(26)
public static final /* synthetic */ <W extends ListenableWorker> PeriodicWorkRequest.Builder PeriodicWorkRequestBuilder(Duration repeatInterval) {
Intrinsics.checkNotNullParameter(repeatInterval, "repeatInterval");
Intrinsics.reifiedOperationMarker(4, "W");
return new PeriodicWorkRequest.Builder((Class<? extends ListenableWorker>) ListenableWorker.class, repeatInterval);
}
public static final /* synthetic */ <W extends ListenableWorker> PeriodicWorkRequest.Builder PeriodicWorkRequestBuilder(long j, TimeUnit repeatIntervalTimeUnit, long j2, TimeUnit flexTimeIntervalUnit) {
Intrinsics.checkNotNullParameter(repeatIntervalTimeUnit, "repeatIntervalTimeUnit");
Intrinsics.checkNotNullParameter(flexTimeIntervalUnit, "flexTimeIntervalUnit");
Intrinsics.reifiedOperationMarker(4, "W");
return new PeriodicWorkRequest.Builder((Class<? extends ListenableWorker>) ListenableWorker.class, j, repeatIntervalTimeUnit, j2, flexTimeIntervalUnit);
}
@RequiresApi(26)
public static final /* synthetic */ <W extends ListenableWorker> PeriodicWorkRequest.Builder PeriodicWorkRequestBuilder(Duration repeatInterval, Duration flexTimeInterval) {
Intrinsics.checkNotNullParameter(repeatInterval, "repeatInterval");
Intrinsics.checkNotNullParameter(flexTimeInterval, "flexTimeInterval");
Intrinsics.reifiedOperationMarker(4, "W");
return new PeriodicWorkRequest.Builder((Class<? extends ListenableWorker>) ListenableWorker.class, repeatInterval, flexTimeInterval);
}
}

View File

@@ -0,0 +1,12 @@
package androidx.work;
import android.content.Context;
import androidx.annotation.NonNull;
import com.google.common.util.concurrent.ListenableFuture;
import java.util.UUID;
/* loaded from: classes.dex */
public interface ProgressUpdater {
@NonNull
ListenableFuture updateProgress(@NonNull Context context, @NonNull UUID uuid, @NonNull Data data);
}

View File

@@ -0,0 +1,18 @@
package androidx.work;
/* loaded from: classes.dex */
public final class R {
public static final class bool {
public static int enable_system_alarm_service_default = 0x7f050002;
public static int enable_system_foreground_service_default = 0x7f050003;
public static int enable_system_job_service_default = 0x7f050004;
public static int workmanager_test_configuration = 0x7f050005;
private bool() {
}
}
private R() {
}
}

View File

@@ -0,0 +1,11 @@
package androidx.work;
import androidx.annotation.IntRange;
import androidx.annotation.NonNull;
/* loaded from: classes.dex */
public interface RunnableScheduler {
void cancel(@NonNull Runnable runnable);
void scheduleWithDelay(@IntRange(from = 0) long j, @NonNull Runnable runnable);
}

View File

@@ -0,0 +1,9 @@
package androidx.work;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@Retention(RetentionPolicy.SOURCE)
/* loaded from: classes.dex */
public @interface StopReason {
}

View File

@@ -0,0 +1,12 @@
package androidx.work;
import androidx.annotation.RestrictTo;
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
/* loaded from: classes.dex */
public class SystemClock implements Clock {
@Override // androidx.work.Clock
public long currentTimeMillis() {
return System.currentTimeMillis();
}
}

View File

@@ -0,0 +1,17 @@
package androidx.work;
import androidx.annotation.RestrictTo;
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
/* loaded from: classes.dex */
public interface Tracer {
void beginAsyncSection(String str, int i);
void beginSection(String str);
void endAsyncSection(String str, int i);
void endSection();
boolean isEnabled();
}

View File

@@ -0,0 +1,34 @@
package androidx.work;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.internal.InlineMarker;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class TracerKt {
public static final <T> T traced(Tracer tracer, String label, Function0 block) {
Intrinsics.checkNotNullParameter(tracer, "<this>");
Intrinsics.checkNotNullParameter(label, "label");
Intrinsics.checkNotNullParameter(block, "block");
boolean isEnabled = tracer.isEnabled();
if (isEnabled) {
try {
tracer.beginSection(label);
} catch (Throwable th) {
InlineMarker.finallyStart(1);
if (isEnabled) {
tracer.endSection();
}
InlineMarker.finallyEnd(1);
throw th;
}
}
T t = (T) block.invoke();
InlineMarker.finallyStart(1);
if (isEnabled) {
tracer.endSection();
}
InlineMarker.finallyEnd(1);
return t;
}
}

View File

@@ -0,0 +1,37 @@
package androidx.work;
import androidx.annotation.NonNull;
import androidx.annotation.RestrictTo;
import androidx.lifecycle.LiveData;
import com.google.common.util.concurrent.ListenableFuture;
import java.util.Collections;
import java.util.List;
/* loaded from: classes.dex */
public abstract class WorkContinuation {
@NonNull
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
public abstract WorkContinuation combineInternal(@NonNull List<WorkContinuation> list);
@NonNull
public abstract Operation enqueue();
@NonNull
public abstract ListenableFuture getWorkInfos();
@NonNull
public abstract LiveData<List<WorkInfo>> getWorkInfosLiveData();
@NonNull
public abstract WorkContinuation then(@NonNull List<OneTimeWorkRequest> list);
@NonNull
public final WorkContinuation then(@NonNull OneTimeWorkRequest oneTimeWorkRequest) {
return then(Collections.singletonList(oneTimeWorkRequest));
}
@NonNull
public static WorkContinuation combine(@NonNull List<WorkContinuation> list) {
return list.get(0).combineInternal(list);
}
}

View File

@@ -0,0 +1,292 @@
package androidx.work;
import androidx.annotation.IntRange;
import androidx.annotation.RequiresApi;
import java.util.Set;
import java.util.UUID;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class WorkInfo {
public static final Companion Companion = new Companion(null);
public static final int STOP_REASON_APP_STANDBY = 12;
public static final int STOP_REASON_BACKGROUND_RESTRICTION = 11;
public static final int STOP_REASON_CANCELLED_BY_APP = 1;
public static final int STOP_REASON_CONSTRAINT_BATTERY_NOT_LOW = 5;
public static final int STOP_REASON_CONSTRAINT_CHARGING = 6;
public static final int STOP_REASON_CONSTRAINT_CONNECTIVITY = 7;
public static final int STOP_REASON_CONSTRAINT_DEVICE_IDLE = 8;
public static final int STOP_REASON_CONSTRAINT_STORAGE_NOT_LOW = 9;
public static final int STOP_REASON_DEVICE_STATE = 4;
public static final int STOP_REASON_ESTIMATED_APP_LAUNCH_TIME_CHANGED = 15;
public static final int STOP_REASON_FOREGROUND_SERVICE_TIMEOUT = -128;
public static final int STOP_REASON_NOT_STOPPED = -256;
public static final int STOP_REASON_PREEMPT = 2;
public static final int STOP_REASON_QUOTA = 10;
public static final int STOP_REASON_SYSTEM_PROCESSING = 14;
public static final int STOP_REASON_TIMEOUT = 3;
public static final int STOP_REASON_UNKNOWN = -512;
public static final int STOP_REASON_USER = 13;
private final Constraints constraints;
private final int generation;
private final UUID id;
private final long initialDelayMillis;
private final long nextScheduleTimeMillis;
private final Data outputData;
private final PeriodicityInfo periodicityInfo;
private final Data progress;
private final int runAttemptCount;
private final State state;
private final int stopReason;
private final Set<String> tags;
public enum State {
ENQUEUED,
RUNNING,
SUCCEEDED,
FAILED,
BLOCKED,
CANCELLED;
public final boolean isFinished() {
return this == SUCCEEDED || this == FAILED || this == CANCELLED;
}
}
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
public WorkInfo(UUID id, State state, Set<String> tags) {
this(id, state, tags, null, null, 0, 0, null, 0L, null, 0L, 0, 4088, null);
Intrinsics.checkNotNullParameter(id, "id");
Intrinsics.checkNotNullParameter(state, "state");
Intrinsics.checkNotNullParameter(tags, "tags");
}
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
public WorkInfo(UUID id, State state, Set<String> tags, Data outputData) {
this(id, state, tags, outputData, null, 0, 0, null, 0L, null, 0L, 0, 4080, null);
Intrinsics.checkNotNullParameter(id, "id");
Intrinsics.checkNotNullParameter(state, "state");
Intrinsics.checkNotNullParameter(tags, "tags");
Intrinsics.checkNotNullParameter(outputData, "outputData");
}
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
public WorkInfo(UUID id, State state, Set<String> tags, Data outputData, Data progress) {
this(id, state, tags, outputData, progress, 0, 0, null, 0L, null, 0L, 0, 4064, null);
Intrinsics.checkNotNullParameter(id, "id");
Intrinsics.checkNotNullParameter(state, "state");
Intrinsics.checkNotNullParameter(tags, "tags");
Intrinsics.checkNotNullParameter(outputData, "outputData");
Intrinsics.checkNotNullParameter(progress, "progress");
}
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
public WorkInfo(UUID id, State state, Set<String> tags, Data outputData, Data progress, int i) {
this(id, state, tags, outputData, progress, i, 0, null, 0L, null, 0L, 0, 4032, null);
Intrinsics.checkNotNullParameter(id, "id");
Intrinsics.checkNotNullParameter(state, "state");
Intrinsics.checkNotNullParameter(tags, "tags");
Intrinsics.checkNotNullParameter(outputData, "outputData");
Intrinsics.checkNotNullParameter(progress, "progress");
}
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
public WorkInfo(UUID id, State state, Set<String> tags, Data outputData, Data progress, int i, int i2) {
this(id, state, tags, outputData, progress, i, i2, null, 0L, null, 0L, 0, 3968, null);
Intrinsics.checkNotNullParameter(id, "id");
Intrinsics.checkNotNullParameter(state, "state");
Intrinsics.checkNotNullParameter(tags, "tags");
Intrinsics.checkNotNullParameter(outputData, "outputData");
Intrinsics.checkNotNullParameter(progress, "progress");
}
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
public WorkInfo(UUID id, State state, Set<String> tags, Data outputData, Data progress, int i, int i2, Constraints constraints) {
this(id, state, tags, outputData, progress, i, i2, constraints, 0L, null, 0L, 0, 3840, null);
Intrinsics.checkNotNullParameter(id, "id");
Intrinsics.checkNotNullParameter(state, "state");
Intrinsics.checkNotNullParameter(tags, "tags");
Intrinsics.checkNotNullParameter(outputData, "outputData");
Intrinsics.checkNotNullParameter(progress, "progress");
Intrinsics.checkNotNullParameter(constraints, "constraints");
}
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
public WorkInfo(UUID id, State state, Set<String> tags, Data outputData, Data progress, int i, int i2, Constraints constraints, long j) {
this(id, state, tags, outputData, progress, i, i2, constraints, j, null, 0L, 0, 3584, null);
Intrinsics.checkNotNullParameter(id, "id");
Intrinsics.checkNotNullParameter(state, "state");
Intrinsics.checkNotNullParameter(tags, "tags");
Intrinsics.checkNotNullParameter(outputData, "outputData");
Intrinsics.checkNotNullParameter(progress, "progress");
Intrinsics.checkNotNullParameter(constraints, "constraints");
}
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
public WorkInfo(UUID id, State state, Set<String> tags, Data outputData, Data progress, int i, int i2, Constraints constraints, long j, PeriodicityInfo periodicityInfo) {
this(id, state, tags, outputData, progress, i, i2, constraints, j, periodicityInfo, 0L, 0, 3072, null);
Intrinsics.checkNotNullParameter(id, "id");
Intrinsics.checkNotNullParameter(state, "state");
Intrinsics.checkNotNullParameter(tags, "tags");
Intrinsics.checkNotNullParameter(outputData, "outputData");
Intrinsics.checkNotNullParameter(progress, "progress");
Intrinsics.checkNotNullParameter(constraints, "constraints");
}
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
public WorkInfo(UUID id, State state, Set<String> tags, Data outputData, Data progress, int i, int i2, Constraints constraints, long j, PeriodicityInfo periodicityInfo, long j2) {
this(id, state, tags, outputData, progress, i, i2, constraints, j, periodicityInfo, j2, 0, 2048, null);
Intrinsics.checkNotNullParameter(id, "id");
Intrinsics.checkNotNullParameter(state, "state");
Intrinsics.checkNotNullParameter(tags, "tags");
Intrinsics.checkNotNullParameter(outputData, "outputData");
Intrinsics.checkNotNullParameter(progress, "progress");
Intrinsics.checkNotNullParameter(constraints, "constraints");
}
public final Constraints getConstraints() {
return this.constraints;
}
public final int getGeneration() {
return this.generation;
}
public final UUID getId() {
return this.id;
}
public final long getInitialDelayMillis() {
return this.initialDelayMillis;
}
public final long getNextScheduleTimeMillis() {
return this.nextScheduleTimeMillis;
}
public final Data getOutputData() {
return this.outputData;
}
public final PeriodicityInfo getPeriodicityInfo() {
return this.periodicityInfo;
}
public final Data getProgress() {
return this.progress;
}
@IntRange(from = 0)
public final int getRunAttemptCount() {
return this.runAttemptCount;
}
public final State getState() {
return this.state;
}
@RequiresApi(31)
public final int getStopReason() {
return this.stopReason;
}
public final Set<String> getTags() {
return this.tags;
}
public WorkInfo(UUID id, State state, Set<String> tags, Data outputData, Data progress, int i, int i2, Constraints constraints, long j, PeriodicityInfo periodicityInfo, long j2, int i3) {
Intrinsics.checkNotNullParameter(id, "id");
Intrinsics.checkNotNullParameter(state, "state");
Intrinsics.checkNotNullParameter(tags, "tags");
Intrinsics.checkNotNullParameter(outputData, "outputData");
Intrinsics.checkNotNullParameter(progress, "progress");
Intrinsics.checkNotNullParameter(constraints, "constraints");
this.id = id;
this.state = state;
this.tags = tags;
this.outputData = outputData;
this.progress = progress;
this.runAttemptCount = i;
this.generation = i2;
this.constraints = constraints;
this.initialDelayMillis = j;
this.periodicityInfo = periodicityInfo;
this.nextScheduleTimeMillis = j2;
this.stopReason = i3;
}
public /* synthetic */ WorkInfo(UUID uuid, State state, Set set, Data data, Data data2, int i, int i2, Constraints constraints, long j, PeriodicityInfo periodicityInfo, long j2, int i3, int i4, DefaultConstructorMarker defaultConstructorMarker) {
this(uuid, state, set, (i4 & 8) != 0 ? Data.EMPTY : data, (i4 & 16) != 0 ? Data.EMPTY : data2, (i4 & 32) != 0 ? 0 : i, (i4 & 64) != 0 ? 0 : i2, (i4 & 128) != 0 ? Constraints.NONE : constraints, (i4 & 256) != 0 ? 0L : j, (i4 & 512) != 0 ? null : periodicityInfo, (i4 & 1024) != 0 ? Long.MAX_VALUE : j2, (i4 & 2048) != 0 ? -256 : i3);
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null || !Intrinsics.areEqual(WorkInfo.class, obj.getClass())) {
return false;
}
WorkInfo workInfo = (WorkInfo) obj;
if (this.runAttemptCount == workInfo.runAttemptCount && this.generation == workInfo.generation && Intrinsics.areEqual(this.id, workInfo.id) && this.state == workInfo.state && Intrinsics.areEqual(this.outputData, workInfo.outputData) && Intrinsics.areEqual(this.constraints, workInfo.constraints) && this.initialDelayMillis == workInfo.initialDelayMillis && Intrinsics.areEqual(this.periodicityInfo, workInfo.periodicityInfo) && this.nextScheduleTimeMillis == workInfo.nextScheduleTimeMillis && this.stopReason == workInfo.stopReason && Intrinsics.areEqual(this.tags, workInfo.tags)) {
return Intrinsics.areEqual(this.progress, workInfo.progress);
}
return false;
}
public int hashCode() {
int hashCode = ((((((((((((((((this.id.hashCode() * 31) + this.state.hashCode()) * 31) + this.outputData.hashCode()) * 31) + this.tags.hashCode()) * 31) + this.progress.hashCode()) * 31) + this.runAttemptCount) * 31) + this.generation) * 31) + this.constraints.hashCode()) * 31) + Long.hashCode(this.initialDelayMillis)) * 31;
PeriodicityInfo periodicityInfo = this.periodicityInfo;
return ((((hashCode + (periodicityInfo != null ? periodicityInfo.hashCode() : 0)) * 31) + Long.hashCode(this.nextScheduleTimeMillis)) * 31) + Integer.hashCode(this.stopReason);
}
public String toString() {
return "WorkInfo{id='" + this.id + "', state=" + this.state + ", outputData=" + this.outputData + ", tags=" + this.tags + ", progress=" + this.progress + ", runAttemptCount=" + this.runAttemptCount + ", generation=" + this.generation + ", constraints=" + this.constraints + ", initialDelayMillis=" + this.initialDelayMillis + ", periodicityInfo=" + this.periodicityInfo + ", nextScheduleTimeMillis=" + this.nextScheduleTimeMillis + "}, stopReason=" + this.stopReason;
}
public static final class PeriodicityInfo {
private final long flexIntervalMillis;
private final long repeatIntervalMillis;
public final long getFlexIntervalMillis() {
return this.flexIntervalMillis;
}
public final long getRepeatIntervalMillis() {
return this.repeatIntervalMillis;
}
public PeriodicityInfo(long j, long j2) {
this.repeatIntervalMillis = j;
this.flexIntervalMillis = j2;
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null || !Intrinsics.areEqual(PeriodicityInfo.class, obj.getClass())) {
return false;
}
PeriodicityInfo periodicityInfo = (PeriodicityInfo) obj;
return periodicityInfo.repeatIntervalMillis == this.repeatIntervalMillis && periodicityInfo.flexIntervalMillis == this.flexIntervalMillis;
}
public int hashCode() {
return (Long.hashCode(this.repeatIntervalMillis) * 31) + Long.hashCode(this.flexIntervalMillis);
}
public String toString() {
return "PeriodicityInfo{repeatIntervalMillis=" + this.repeatIntervalMillis + ", flexIntervalMillis=" + this.flexIntervalMillis + '}';
}
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
}
}

View File

@@ -0,0 +1,154 @@
package androidx.work;
import android.annotation.SuppressLint;
import android.app.PendingIntent;
import android.content.Context;
import androidx.lifecycle.LiveData;
import androidx.work.impl.WorkManagerImpl;
import com.google.common.util.concurrent.ListenableFuture;
import java.util.List;
import java.util.UUID;
import kotlin.collections.CollectionsKt__CollectionsJVMKt;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlinx.coroutines.flow.Flow;
@SuppressLint({"AddedAbstractMethod"})
/* loaded from: classes.dex */
public abstract class WorkManager {
public static final Companion Companion = new Companion(null);
public enum UpdateResult {
NOT_APPLIED,
APPLIED_IMMEDIATELY,
APPLIED_FOR_NEXT_RUN
}
public static WorkManager getInstance() {
return Companion.getInstance();
}
public static WorkManager getInstance(Context context) {
return Companion.getInstance(context);
}
public static void initialize(Context context, Configuration configuration) {
Companion.initialize(context, configuration);
}
public static boolean isInitialized() {
return Companion.isInitialized();
}
public abstract WorkContinuation beginUniqueWork(String str, ExistingWorkPolicy existingWorkPolicy, List<OneTimeWorkRequest> list);
public abstract WorkContinuation beginWith(List<OneTimeWorkRequest> list);
public abstract Operation cancelAllWork();
public abstract Operation cancelAllWorkByTag(String str);
public abstract Operation cancelUniqueWork(String str);
public abstract Operation cancelWorkById(UUID uuid);
public abstract PendingIntent createCancelPendingIntent(UUID uuid);
public abstract Operation enqueue(List<? extends WorkRequest> list);
public abstract Operation enqueueUniquePeriodicWork(String str, ExistingPeriodicWorkPolicy existingPeriodicWorkPolicy, PeriodicWorkRequest periodicWorkRequest);
public abstract Operation enqueueUniqueWork(String str, ExistingWorkPolicy existingWorkPolicy, List<OneTimeWorkRequest> list);
public abstract Configuration getConfiguration();
public abstract ListenableFuture getLastCancelAllTimeMillis();
public abstract LiveData<Long> getLastCancelAllTimeMillisLiveData();
public abstract ListenableFuture getWorkInfoById(UUID uuid);
public abstract Flow getWorkInfoByIdFlow(UUID uuid);
public abstract LiveData<WorkInfo> getWorkInfoByIdLiveData(UUID uuid);
public abstract ListenableFuture getWorkInfos(WorkQuery workQuery);
public abstract ListenableFuture getWorkInfosByTag(String str);
public abstract Flow getWorkInfosByTagFlow(String str);
public abstract LiveData<List<WorkInfo>> getWorkInfosByTagLiveData(String str);
public abstract Flow getWorkInfosFlow(WorkQuery workQuery);
public abstract ListenableFuture getWorkInfosForUniqueWork(String str);
public abstract Flow getWorkInfosForUniqueWorkFlow(String str);
public abstract LiveData<List<WorkInfo>> getWorkInfosForUniqueWorkLiveData(String str);
public abstract LiveData<List<WorkInfo>> getWorkInfosLiveData(WorkQuery workQuery);
public abstract Operation pruneWork();
public abstract ListenableFuture updateWork(WorkRequest workRequest);
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
public WorkManager getInstance() {
WorkManagerImpl workManagerImpl = WorkManagerImpl.getInstance();
if (workManagerImpl != null) {
return workManagerImpl;
}
throw new IllegalStateException("WorkManager is not initialized properly. The most likely cause is that you disabled WorkManagerInitializer in your manifest but forgot to call WorkManager#initialize in your Application#onCreate or a ContentProvider.".toString());
}
public WorkManager getInstance(Context context) {
Intrinsics.checkNotNullParameter(context, "context");
WorkManagerImpl workManagerImpl = WorkManagerImpl.getInstance(context);
Intrinsics.checkNotNullExpressionValue(workManagerImpl, "getInstance(context)");
return workManagerImpl;
}
public void initialize(Context context, Configuration configuration) {
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(configuration, "configuration");
WorkManagerImpl.initialize(context, configuration);
}
public boolean isInitialized() {
return WorkManagerImpl.isInitialized();
}
}
public final Operation enqueue(WorkRequest request) {
Intrinsics.checkNotNullParameter(request, "request");
return enqueue(CollectionsKt__CollectionsJVMKt.listOf(request));
}
public final WorkContinuation beginWith(OneTimeWorkRequest request) {
Intrinsics.checkNotNullParameter(request, "request");
return beginWith(CollectionsKt__CollectionsJVMKt.listOf(request));
}
public final WorkContinuation beginUniqueWork(String uniqueWorkName, ExistingWorkPolicy existingWorkPolicy, OneTimeWorkRequest request) {
Intrinsics.checkNotNullParameter(uniqueWorkName, "uniqueWorkName");
Intrinsics.checkNotNullParameter(existingWorkPolicy, "existingWorkPolicy");
Intrinsics.checkNotNullParameter(request, "request");
return beginUniqueWork(uniqueWorkName, existingWorkPolicy, CollectionsKt__CollectionsJVMKt.listOf(request));
}
public Operation enqueueUniqueWork(String uniqueWorkName, ExistingWorkPolicy existingWorkPolicy, OneTimeWorkRequest request) {
Intrinsics.checkNotNullParameter(uniqueWorkName, "uniqueWorkName");
Intrinsics.checkNotNullParameter(existingWorkPolicy, "existingWorkPolicy");
Intrinsics.checkNotNullParameter(request, "request");
return enqueueUniqueWork(uniqueWorkName, existingWorkPolicy, CollectionsKt__CollectionsJVMKt.listOf(request));
}
}

View File

@@ -0,0 +1,28 @@
package androidx.work;
import android.content.Context;
import androidx.annotation.NonNull;
import androidx.startup.Initializer;
import androidx.work.Configuration;
import java.util.Collections;
import java.util.List;
/* loaded from: classes.dex */
public final class WorkManagerInitializer implements Initializer<WorkManager> {
private static final String TAG = Logger.tagWithPrefix("WrkMgrInitializer");
/* JADX WARN: Can't rename method to resolve collision */
@Override // androidx.startup.Initializer
@NonNull
public WorkManager create(@NonNull Context context) {
Logger.get().debug(TAG, "Initializing WorkManager with default configuration.");
WorkManager.initialize(context, new Configuration.Builder().build());
return WorkManager.getInstance(context);
}
@Override // androidx.startup.Initializer
@NonNull
public List<Class<? extends Initializer<?>>> dependencies() {
return Collections.emptyList();
}
}

View File

@@ -0,0 +1,257 @@
package androidx.work;
import android.annotation.SuppressLint;
import androidx.work.WorkInfo;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import kotlin.collections.ArraysKt___ArraysKt;
import kotlin.collections.CollectionsKt__CollectionsKt;
import kotlin.collections.CollectionsKt__MutableCollectionsKt;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class WorkQuery {
public static final Companion Companion = new Companion(null);
private final List<UUID> ids;
private final List<WorkInfo.State> states;
private final List<String> tags;
private final List<String> uniqueWorkNames;
public WorkQuery() {
this(null, null, null, null, 15, null);
}
public static final WorkQuery fromIds(List<UUID> list) {
return Companion.fromIds(list);
}
public static final WorkQuery fromIds(UUID... uuidArr) {
return Companion.fromIds(uuidArr);
}
public static final WorkQuery fromStates(List<? extends WorkInfo.State> list) {
return Companion.fromStates(list);
}
public static final WorkQuery fromStates(WorkInfo.State... stateArr) {
return Companion.fromStates(stateArr);
}
public static final WorkQuery fromTags(List<String> list) {
return Companion.fromTags(list);
}
public static final WorkQuery fromTags(String... strArr) {
return Companion.fromTags(strArr);
}
public static final WorkQuery fromUniqueWorkNames(List<String> list) {
return Companion.fromUniqueWorkNames(list);
}
public static final WorkQuery fromUniqueWorkNames(String... strArr) {
return Companion.fromUniqueWorkNames(strArr);
}
public final List<UUID> getIds() {
return this.ids;
}
public final List<WorkInfo.State> getStates() {
return this.states;
}
public final List<String> getTags() {
return this.tags;
}
public final List<String> getUniqueWorkNames() {
return this.uniqueWorkNames;
}
/* JADX WARN: Multi-variable type inference failed */
public WorkQuery(List<UUID> ids, List<String> uniqueWorkNames, List<String> tags, List<? extends WorkInfo.State> states) {
Intrinsics.checkNotNullParameter(ids, "ids");
Intrinsics.checkNotNullParameter(uniqueWorkNames, "uniqueWorkNames");
Intrinsics.checkNotNullParameter(tags, "tags");
Intrinsics.checkNotNullParameter(states, "states");
this.ids = ids;
this.uniqueWorkNames = uniqueWorkNames;
this.tags = tags;
this.states = states;
}
public /* synthetic */ WorkQuery(List list, List list2, List list3, List list4, int i, DefaultConstructorMarker defaultConstructorMarker) {
this((i & 1) != 0 ? CollectionsKt__CollectionsKt.emptyList() : list, (i & 2) != 0 ? CollectionsKt__CollectionsKt.emptyList() : list2, (i & 4) != 0 ? CollectionsKt__CollectionsKt.emptyList() : list3, (i & 8) != 0 ? CollectionsKt__CollectionsKt.emptyList() : list4);
}
public static final class Builder {
public static final Companion Companion = new Companion(null);
private final List<UUID> ids;
private final List<WorkInfo.State> states;
private final List<String> tags;
private final List<String> uniqueWorkNames;
public /* synthetic */ Builder(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
@SuppressLint({"BuilderSetStyle"})
public static final Builder fromIds(List<UUID> list) {
return Companion.fromIds(list);
}
@SuppressLint({"BuilderSetStyle"})
public static final Builder fromStates(List<? extends WorkInfo.State> list) {
return Companion.fromStates(list);
}
@SuppressLint({"BuilderSetStyle"})
public static final Builder fromTags(List<String> list) {
return Companion.fromTags(list);
}
@SuppressLint({"BuilderSetStyle"})
public static final Builder fromUniqueWorkNames(List<String> list) {
return Companion.fromUniqueWorkNames(list);
}
private Builder() {
this.ids = new ArrayList();
this.uniqueWorkNames = new ArrayList();
this.tags = new ArrayList();
this.states = new ArrayList();
}
public final Builder addIds(List<UUID> ids) {
Intrinsics.checkNotNullParameter(ids, "ids");
CollectionsKt__MutableCollectionsKt.addAll(this.ids, ids);
return this;
}
public final Builder addUniqueWorkNames(List<String> uniqueWorkNames) {
Intrinsics.checkNotNullParameter(uniqueWorkNames, "uniqueWorkNames");
CollectionsKt__MutableCollectionsKt.addAll(this.uniqueWorkNames, uniqueWorkNames);
return this;
}
public final Builder addTags(List<String> tags) {
Intrinsics.checkNotNullParameter(tags, "tags");
CollectionsKt__MutableCollectionsKt.addAll(this.tags, tags);
return this;
}
public final Builder addStates(List<? extends WorkInfo.State> states) {
Intrinsics.checkNotNullParameter(states, "states");
CollectionsKt__MutableCollectionsKt.addAll(this.states, states);
return this;
}
public final WorkQuery build() {
if (this.ids.isEmpty() && this.uniqueWorkNames.isEmpty() && this.tags.isEmpty() && this.states.isEmpty()) {
throw new IllegalArgumentException("Must specify ids, uniqueNames, tags or states when building a WorkQuery");
}
return new WorkQuery(this.ids, this.uniqueWorkNames, this.tags, this.states);
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
@SuppressLint({"BuilderSetStyle"})
public final Builder fromIds(List<UUID> ids) {
Intrinsics.checkNotNullParameter(ids, "ids");
Builder builder = new Builder(null);
builder.addIds(ids);
return builder;
}
@SuppressLint({"BuilderSetStyle"})
public final Builder fromUniqueWorkNames(List<String> uniqueWorkNames) {
Intrinsics.checkNotNullParameter(uniqueWorkNames, "uniqueWorkNames");
Builder builder = new Builder(null);
builder.addUniqueWorkNames(uniqueWorkNames);
return builder;
}
@SuppressLint({"BuilderSetStyle"})
public final Builder fromTags(List<String> tags) {
Intrinsics.checkNotNullParameter(tags, "tags");
Builder builder = new Builder(null);
builder.addTags(tags);
return builder;
}
@SuppressLint({"BuilderSetStyle"})
public final Builder fromStates(List<? extends WorkInfo.State> states) {
Intrinsics.checkNotNullParameter(states, "states");
Builder builder = new Builder(null);
builder.addStates(states);
return builder;
}
}
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
public final WorkQuery fromIds(List<UUID> ids) {
Intrinsics.checkNotNullParameter(ids, "ids");
return new WorkQuery(ids, null, null, null, 14, null);
}
public final WorkQuery fromIds(UUID... ids) {
List list;
Intrinsics.checkNotNullParameter(ids, "ids");
list = ArraysKt___ArraysKt.toList(ids);
return new WorkQuery(list, null, null, null, 14, null);
}
public final WorkQuery fromTags(List<String> tags) {
Intrinsics.checkNotNullParameter(tags, "tags");
return new WorkQuery(null, null, tags, null, 11, null);
}
public final WorkQuery fromTags(String... tags) {
List list;
Intrinsics.checkNotNullParameter(tags, "tags");
list = ArraysKt___ArraysKt.toList(tags);
return new WorkQuery(null, null, list, null, 11, null);
}
public final WorkQuery fromUniqueWorkNames(String... uniqueWorkNames) {
List list;
Intrinsics.checkNotNullParameter(uniqueWorkNames, "uniqueWorkNames");
list = ArraysKt___ArraysKt.toList(uniqueWorkNames);
return new WorkQuery(null, list, null, null, 13, null);
}
public final WorkQuery fromUniqueWorkNames(List<String> uniqueWorkNames) {
Intrinsics.checkNotNullParameter(uniqueWorkNames, "uniqueWorkNames");
return new WorkQuery(null, uniqueWorkNames, null, null, 13, null);
}
public final WorkQuery fromStates(List<? extends WorkInfo.State> states) {
Intrinsics.checkNotNullParameter(states, "states");
return new WorkQuery(null, null, null, states, 7, null);
}
public final WorkQuery fromStates(WorkInfo.State... states) {
List list;
Intrinsics.checkNotNullParameter(states, "states");
list = ArraysKt___ArraysKt.toList(states);
return new WorkQuery(null, null, null, list, 7, null);
}
}
}

View File

@@ -0,0 +1,309 @@
package androidx.work;
import android.annotation.SuppressLint;
import androidx.annotation.RequiresApi;
import androidx.annotation.RestrictTo;
import androidx.annotation.VisibleForTesting;
import androidx.work.WorkInfo;
import androidx.work.impl.model.WorkSpec;
import androidx.work.impl.utils.DurationApi26Impl;
import csdk.gluads.Consts;
import java.time.Duration;
import java.util.List;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
import kotlin.collections.CollectionsKt___CollectionsKt;
import kotlin.collections.SetsKt__SetsKt;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.SourceDebugExtension;
import kotlin.text.StringsKt__StringsKt;
import kotlin.text.StringsKt___StringsKt;
/* loaded from: classes.dex */
public abstract class WorkRequest {
public static final Companion Companion = new Companion(null);
public static final long DEFAULT_BACKOFF_DELAY_MILLIS = 30000;
@SuppressLint({"MinMaxConstant"})
public static final long MAX_BACKOFF_MILLIS = 18000000;
private static final int MAX_TRACE_SPAN_LENGTH = 127;
@SuppressLint({"MinMaxConstant"})
public static final long MIN_BACKOFF_MILLIS = 10000;
private final UUID id;
private final Set<String> tags;
private final WorkSpec workSpec;
public UUID getId() {
return this.id;
}
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
public final Set<String> getTags() {
return this.tags;
}
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
public final WorkSpec getWorkSpec() {
return this.workSpec;
}
public WorkRequest(UUID id, WorkSpec workSpec, Set<String> tags) {
Intrinsics.checkNotNullParameter(id, "id");
Intrinsics.checkNotNullParameter(workSpec, "workSpec");
Intrinsics.checkNotNullParameter(tags, "tags");
this.id = id;
this.workSpec = workSpec;
this.tags = tags;
}
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
public final String getStringId() {
String uuid = getId().toString();
Intrinsics.checkNotNullExpressionValue(uuid, "id.toString()");
return uuid;
}
@SourceDebugExtension({"SMAP\nWorkRequest.kt\nKotlin\n*S Kotlin\n*F\n+ 1 WorkRequest.kt\nandroidx/work/WorkRequest$Builder\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,387:1\n1#2:388\n*E\n"})
public static abstract class Builder<B extends Builder<B, ?>, W extends WorkRequest> {
private boolean backoffCriteriaSet;
private UUID id;
private final Set<String> tags;
private WorkSpec workSpec;
private final Class<? extends ListenableWorker> workerClass;
public abstract W buildInternal$work_runtime_release();
public final boolean getBackoffCriteriaSet$work_runtime_release() {
return this.backoffCriteriaSet;
}
public final UUID getId$work_runtime_release() {
return this.id;
}
public final Set<String> getTags$work_runtime_release() {
return this.tags;
}
public abstract B getThisObject$work_runtime_release();
public final WorkSpec getWorkSpec$work_runtime_release() {
return this.workSpec;
}
public final Class<? extends ListenableWorker> getWorkerClass$work_runtime_release() {
return this.workerClass;
}
public final void setBackoffCriteriaSet$work_runtime_release(boolean z) {
this.backoffCriteriaSet = z;
}
public final void setId$work_runtime_release(UUID uuid) {
Intrinsics.checkNotNullParameter(uuid, "<set-?>");
this.id = uuid;
}
public final void setWorkSpec$work_runtime_release(WorkSpec workSpec) {
Intrinsics.checkNotNullParameter(workSpec, "<set-?>");
this.workSpec = workSpec;
}
public Builder(Class<? extends ListenableWorker> workerClass) {
Set<String> mutableSetOf;
Intrinsics.checkNotNullParameter(workerClass, "workerClass");
this.workerClass = workerClass;
UUID randomUUID = UUID.randomUUID();
Intrinsics.checkNotNullExpressionValue(randomUUID, "randomUUID()");
this.id = randomUUID;
String uuid = this.id.toString();
Intrinsics.checkNotNullExpressionValue(uuid, "id.toString()");
String name = workerClass.getName();
Intrinsics.checkNotNullExpressionValue(name, "workerClass.name");
this.workSpec = new WorkSpec(uuid, name);
String name2 = workerClass.getName();
Intrinsics.checkNotNullExpressionValue(name2, "workerClass.name");
mutableSetOf = SetsKt__SetsKt.mutableSetOf(name2);
this.tags = mutableSetOf;
}
public final B setId(UUID id) {
Intrinsics.checkNotNullParameter(id, "id");
this.id = id;
String uuid = id.toString();
Intrinsics.checkNotNullExpressionValue(uuid, "id.toString()");
this.workSpec = new WorkSpec(uuid, this.workSpec);
return getThisObject$work_runtime_release();
}
public final B setBackoffCriteria(BackoffPolicy backoffPolicy, long j, TimeUnit timeUnit) {
Intrinsics.checkNotNullParameter(backoffPolicy, "backoffPolicy");
Intrinsics.checkNotNullParameter(timeUnit, "timeUnit");
this.backoffCriteriaSet = true;
WorkSpec workSpec = this.workSpec;
workSpec.backoffPolicy = backoffPolicy;
workSpec.setBackoffDelayDuration(timeUnit.toMillis(j));
return getThisObject$work_runtime_release();
}
@RequiresApi(26)
public final B setBackoffCriteria(BackoffPolicy backoffPolicy, Duration duration) {
Intrinsics.checkNotNullParameter(backoffPolicy, "backoffPolicy");
Intrinsics.checkNotNullParameter(duration, "duration");
this.backoffCriteriaSet = true;
WorkSpec workSpec = this.workSpec;
workSpec.backoffPolicy = backoffPolicy;
workSpec.setBackoffDelayDuration(DurationApi26Impl.toMillisCompat(duration));
return getThisObject$work_runtime_release();
}
public final B setConstraints(Constraints constraints) {
Intrinsics.checkNotNullParameter(constraints, "constraints");
this.workSpec.constraints = constraints;
return getThisObject$work_runtime_release();
}
public final B setInputData(Data inputData) {
Intrinsics.checkNotNullParameter(inputData, "inputData");
this.workSpec.input = inputData;
return getThisObject$work_runtime_release();
}
public final B addTag(String tag) {
Intrinsics.checkNotNullParameter(tag, "tag");
this.tags.add(tag);
return getThisObject$work_runtime_release();
}
public final B setTraceTag(String traceTag) {
Intrinsics.checkNotNullParameter(traceTag, "traceTag");
this.workSpec.setTraceTag(traceTag);
return getThisObject$work_runtime_release();
}
public final B keepResultsForAtLeast(long j, TimeUnit timeUnit) {
Intrinsics.checkNotNullParameter(timeUnit, "timeUnit");
this.workSpec.minimumRetentionDuration = timeUnit.toMillis(j);
return getThisObject$work_runtime_release();
}
@RequiresApi(26)
public final B keepResultsForAtLeast(Duration duration) {
Intrinsics.checkNotNullParameter(duration, "duration");
this.workSpec.minimumRetentionDuration = DurationApi26Impl.toMillisCompat(duration);
return getThisObject$work_runtime_release();
}
public B setInitialDelay(long j, TimeUnit timeUnit) {
Intrinsics.checkNotNullParameter(timeUnit, "timeUnit");
this.workSpec.initialDelay = timeUnit.toMillis(j);
if (Long.MAX_VALUE - System.currentTimeMillis() <= this.workSpec.initialDelay) {
throw new IllegalArgumentException("The given initial delay is too large and will cause an overflow!".toString());
}
return getThisObject$work_runtime_release();
}
@RequiresApi(26)
public B setInitialDelay(Duration duration) {
Intrinsics.checkNotNullParameter(duration, "duration");
this.workSpec.initialDelay = DurationApi26Impl.toMillisCompat(duration);
if (Long.MAX_VALUE - System.currentTimeMillis() <= this.workSpec.initialDelay) {
throw new IllegalArgumentException("The given initial delay is too large and will cause an overflow!".toString());
}
return getThisObject$work_runtime_release();
}
@SuppressLint({"MissingGetterMatchingBuilder"})
public B setExpedited(OutOfQuotaPolicy policy) {
Intrinsics.checkNotNullParameter(policy, "policy");
WorkSpec workSpec = this.workSpec;
workSpec.expedited = true;
workSpec.outOfQuotaPolicy = policy;
return getThisObject$work_runtime_release();
}
public final W build() {
W buildInternal$work_runtime_release = buildInternal$work_runtime_release();
Constraints constraints = this.workSpec.constraints;
boolean z = constraints.hasContentUriTriggers() || constraints.requiresBatteryNotLow() || constraints.requiresCharging() || constraints.requiresDeviceIdle();
WorkSpec workSpec = this.workSpec;
if (workSpec.expedited) {
if (!(!z)) {
throw new IllegalArgumentException("Expedited jobs only support network and storage constraints".toString());
}
if (workSpec.initialDelay > 0) {
throw new IllegalArgumentException("Expedited jobs cannot be delayed".toString());
}
}
if (workSpec.getTraceTag() == null) {
WorkSpec workSpec2 = this.workSpec;
workSpec2.setTraceTag(WorkRequest.Companion.deriveTraceTagFromClassName(workSpec2.workerClassName));
}
UUID randomUUID = UUID.randomUUID();
Intrinsics.checkNotNullExpressionValue(randomUUID, "randomUUID()");
setId(randomUUID);
return buildInternal$work_runtime_release;
}
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
@VisibleForTesting
public final B setInitialState(WorkInfo.State state) {
Intrinsics.checkNotNullParameter(state, "state");
this.workSpec.state = state;
return getThisObject$work_runtime_release();
}
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
@VisibleForTesting
public final B setInitialRunAttemptCount(int i) {
this.workSpec.runAttemptCount = i;
return getThisObject$work_runtime_release();
}
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
@VisibleForTesting
public final B setLastEnqueueTime(long j, TimeUnit timeUnit) {
Intrinsics.checkNotNullParameter(timeUnit, "timeUnit");
this.workSpec.lastEnqueueTime = timeUnit.toMillis(j);
return getThisObject$work_runtime_release();
}
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
@VisibleForTesting
public final B setScheduleRequestedAt(long j, TimeUnit timeUnit) {
Intrinsics.checkNotNullParameter(timeUnit, "timeUnit");
this.workSpec.scheduleRequestedAt = timeUnit.toMillis(j);
return getThisObject$work_runtime_release();
}
}
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
/* JADX INFO: Access modifiers changed from: private */
public final String deriveTraceTagFromClassName(String str) {
List split$default;
String str2;
String take;
split$default = StringsKt__StringsKt.split$default((CharSequence) str, new String[]{Consts.STRING_PERIOD}, false, 0, 6, (Object) null);
if (split$default.size() == 1) {
str2 = (String) split$default.get(0);
} else {
str2 = (String) CollectionsKt___CollectionsKt.last(split$default);
}
if (str2.length() <= 127) {
return str2;
}
take = StringsKt___StringsKt.take(str2, 127);
return take;
}
}
}

View File

@@ -0,0 +1,63 @@
package androidx.work;
import android.content.Context;
import androidx.annotation.WorkerThread;
import androidx.work.ListenableWorker;
import com.google.common.util.concurrent.ListenableFuture;
import java.util.concurrent.Executor;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public abstract class Worker extends ListenableWorker {
@WorkerThread
public abstract ListenableWorker.Result doWork();
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public Worker(Context context, WorkerParameters workerParams) {
super(context, workerParams);
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(workerParams, "workerParams");
}
@Override // androidx.work.ListenableWorker
public final ListenableFuture startWork() {
ListenableFuture future;
Executor backgroundExecutor = getBackgroundExecutor();
Intrinsics.checkNotNullExpressionValue(backgroundExecutor, "backgroundExecutor");
future = WorkerKt.future(backgroundExecutor, new Function0() { // from class: androidx.work.Worker$startWork$1
{
super(0);
}
@Override // kotlin.jvm.functions.Function0
public final ListenableWorker.Result invoke() {
return Worker.this.doWork();
}
});
return future;
}
@Override // androidx.work.ListenableWorker
public ListenableFuture getForegroundInfoAsync() {
ListenableFuture future;
Executor backgroundExecutor = getBackgroundExecutor();
Intrinsics.checkNotNullExpressionValue(backgroundExecutor, "backgroundExecutor");
future = WorkerKt.future(backgroundExecutor, new Function0() { // from class: androidx.work.Worker$getForegroundInfoAsync$1
{
super(0);
}
@Override // kotlin.jvm.functions.Function0
public final ForegroundInfo invoke() {
return Worker.this.getForegroundInfo();
}
});
return future;
}
@WorkerThread
public ForegroundInfo getForegroundInfo() {
throw new IllegalStateException("Expedited WorkRequests require a Worker to provide an implementation for `getForegroundInfo()`");
}
}

View File

@@ -0,0 +1,31 @@
package androidx.work;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class WorkerExceptionInfo {
private final Throwable throwable;
private final String workerClassName;
private final WorkerParameters workerParameters;
public final Throwable getThrowable() {
return this.throwable;
}
public final String getWorkerClassName() {
return this.workerClassName;
}
public final WorkerParameters getWorkerParameters() {
return this.workerParameters;
}
public WorkerExceptionInfo(String workerClassName, WorkerParameters workerParameters, Throwable throwable) {
Intrinsics.checkNotNullParameter(workerClassName, "workerClassName");
Intrinsics.checkNotNullParameter(workerParameters, "workerParameters");
Intrinsics.checkNotNullParameter(throwable, "throwable");
this.workerClassName = workerClassName;
this.workerParameters = workerParameters;
this.throwable = throwable;
}
}

View File

@@ -0,0 +1,53 @@
package androidx.work;
import android.content.Context;
import androidx.annotation.RestrictTo;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public abstract class WorkerFactory {
public abstract ListenableWorker createWorker(Context context, String str, WorkerParameters workerParameters);
private static final Class<? extends ListenableWorker> createWorkerWithDefaultFallback$getWorkerClass(String str) {
String str2;
try {
Class asSubclass = Class.forName(str).asSubclass(ListenableWorker.class);
Intrinsics.checkNotNullExpressionValue(asSubclass, "{\n Class.…class.java)\n }");
return asSubclass;
} catch (Throwable th) {
Logger logger = Logger.get();
str2 = WorkerFactoryKt.TAG;
logger.error(str2, "Invalid class: " + str, th);
throw th;
}
}
private static final ListenableWorker createWorkerWithDefaultFallback$fallbackToReflection(Context context, String str, WorkerParameters workerParameters) {
String str2;
try {
ListenableWorker newInstance = createWorkerWithDefaultFallback$getWorkerClass(str).getDeclaredConstructor(Context.class, WorkerParameters.class).newInstance(context, workerParameters);
Intrinsics.checkNotNullExpressionValue(newInstance, "{\n val co…Parameters)\n }");
return newInstance;
} catch (Throwable th) {
Logger logger = Logger.get();
str2 = WorkerFactoryKt.TAG;
logger.error(str2, "Could not instantiate " + str, th);
throw th;
}
}
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
public final ListenableWorker createWorkerWithDefaultFallback(Context appContext, String workerClassName, WorkerParameters workerParameters) {
Intrinsics.checkNotNullParameter(appContext, "appContext");
Intrinsics.checkNotNullParameter(workerClassName, "workerClassName");
Intrinsics.checkNotNullParameter(workerParameters, "workerParameters");
ListenableWorker createWorker = createWorker(appContext, workerClassName, workerParameters);
if (createWorker == null) {
createWorker = createWorkerWithDefaultFallback$fallbackToReflection(appContext, workerClassName, workerParameters);
}
if (!createWorker.isUsed()) {
return createWorker;
}
throw new IllegalStateException("WorkerFactory (" + getClass().getName() + ") returned an instance of a ListenableWorker (" + workerClassName + ") which has already been invoked. createWorker() must always return a new instance of a ListenableWorker.");
}
}

View File

@@ -0,0 +1,14 @@
package androidx.work;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class WorkerFactoryKt {
private static final String TAG;
static {
String tagWithPrefix = Logger.tagWithPrefix("WorkerFactory");
Intrinsics.checkNotNullExpressionValue(tagWithPrefix, "tagWithPrefix(\"WorkerFactory\")");
TAG = tagWithPrefix;
}
}

View File

@@ -0,0 +1,57 @@
package androidx.work;
import androidx.concurrent.futures.CallbackToFutureAdapter;
import com.google.common.util.concurrent.ListenableFuture;
import java.util.concurrent.Executor;
import java.util.concurrent.atomic.AtomicBoolean;
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class WorkerKt {
/* JADX INFO: Access modifiers changed from: private */
public static final <T> ListenableFuture future(final Executor executor, final Function0 function0) {
ListenableFuture future = CallbackToFutureAdapter.getFuture(new CallbackToFutureAdapter.Resolver() { // from class: androidx.work.WorkerKt$$ExternalSyntheticLambda0
@Override // androidx.concurrent.futures.CallbackToFutureAdapter.Resolver
public final Object attachCompleter(CallbackToFutureAdapter.Completer completer) {
Unit future$lambda$2;
future$lambda$2 = WorkerKt.future$lambda$2(executor, function0, completer);
return future$lambda$2;
}
});
Intrinsics.checkNotNullExpressionValue(future, "getFuture {\n val … }\n }\n }");
return future;
}
/* JADX INFO: Access modifiers changed from: private */
public static final Unit future$lambda$2(Executor executor, final Function0 function0, final CallbackToFutureAdapter.Completer it) {
Intrinsics.checkNotNullParameter(it, "it");
final AtomicBoolean atomicBoolean = new AtomicBoolean(false);
it.addCancellationListener(new Runnable() { // from class: androidx.work.WorkerKt$$ExternalSyntheticLambda1
@Override // java.lang.Runnable
public final void run() {
atomicBoolean.set(true);
}
}, DirectExecutor.INSTANCE);
executor.execute(new Runnable() { // from class: androidx.work.WorkerKt$$ExternalSyntheticLambda2
@Override // java.lang.Runnable
public final void run() {
WorkerKt.future$lambda$2$lambda$1(atomicBoolean, it, function0);
}
});
return Unit.INSTANCE;
}
/* JADX INFO: Access modifiers changed from: private */
public static final void future$lambda$2$lambda$1(AtomicBoolean atomicBoolean, CallbackToFutureAdapter.Completer completer, Function0 function0) {
if (atomicBoolean.get()) {
return;
}
try {
completer.set(function0.invoke());
} catch (Throwable th) {
completer.setException(th);
}
}
}

View File

@@ -0,0 +1,169 @@
package androidx.work;
import android.net.Network;
import android.net.Uri;
import androidx.annotation.IntRange;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.annotation.RestrictTo;
import androidx.work.impl.utils.taskexecutor.TaskExecutor;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.Executor;
import kotlin.coroutines.CoroutineContext;
/* loaded from: classes.dex */
public final class WorkerParameters {
@NonNull
private Executor mBackgroundExecutor;
@NonNull
private ForegroundUpdater mForegroundUpdater;
private int mGeneration;
@NonNull
private UUID mId;
@NonNull
private Data mInputData;
@NonNull
private ProgressUpdater mProgressUpdater;
private int mRunAttemptCount;
@NonNull
private RuntimeExtras mRuntimeExtras;
@NonNull
private Set<String> mTags;
@NonNull
private TaskExecutor mWorkTaskExecutor;
@NonNull
private CoroutineContext mWorkerContext;
@NonNull
private WorkerFactory mWorkerFactory;
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
public static class RuntimeExtras {
@Nullable
@RequiresApi(28)
public Network network;
@NonNull
public List<String> triggeredContentAuthorities = Collections.emptyList();
@NonNull
public List<Uri> triggeredContentUris = Collections.emptyList();
}
@NonNull
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
public Executor getBackgroundExecutor() {
return this.mBackgroundExecutor;
}
@NonNull
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
public ForegroundUpdater getForegroundUpdater() {
return this.mForegroundUpdater;
}
@IntRange(from = 0)
public int getGeneration() {
return this.mGeneration;
}
@NonNull
public UUID getId() {
return this.mId;
}
@NonNull
public Data getInputData() {
return this.mInputData;
}
@NonNull
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
public ProgressUpdater getProgressUpdater() {
return this.mProgressUpdater;
}
@IntRange(from = 0)
public int getRunAttemptCount() {
return this.mRunAttemptCount;
}
@NonNull
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
public RuntimeExtras getRuntimeExtras() {
return this.mRuntimeExtras;
}
@NonNull
public Set<String> getTags() {
return this.mTags;
}
@NonNull
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
public TaskExecutor getTaskExecutor() {
return this.mWorkTaskExecutor;
}
@NonNull
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
public CoroutineContext getWorkerContext() {
return this.mWorkerContext;
}
@NonNull
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
public WorkerFactory getWorkerFactory() {
return this.mWorkerFactory;
}
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
public WorkerParameters(@NonNull UUID uuid, @NonNull Data data, @NonNull Collection<String> collection, @NonNull RuntimeExtras runtimeExtras, @IntRange(from = 0) int i, @IntRange(from = 0) int i2, @NonNull Executor executor, @NonNull CoroutineContext coroutineContext, @NonNull TaskExecutor taskExecutor, @NonNull WorkerFactory workerFactory, @NonNull ProgressUpdater progressUpdater, @NonNull ForegroundUpdater foregroundUpdater) {
this.mId = uuid;
this.mInputData = data;
this.mTags = new HashSet(collection);
this.mRuntimeExtras = runtimeExtras;
this.mRunAttemptCount = i;
this.mGeneration = i2;
this.mBackgroundExecutor = executor;
this.mWorkerContext = coroutineContext;
this.mWorkTaskExecutor = taskExecutor;
this.mWorkerFactory = workerFactory;
this.mProgressUpdater = progressUpdater;
this.mForegroundUpdater = foregroundUpdater;
}
@NonNull
@RequiresApi(24)
public List<Uri> getTriggeredContentUris() {
return this.mRuntimeExtras.triggeredContentUris;
}
@NonNull
@RequiresApi(24)
public List<String> getTriggeredContentAuthorities() {
return this.mRuntimeExtras.triggeredContentAuthorities;
}
@Nullable
@RequiresApi(28)
public Network getNetwork() {
return this.mRuntimeExtras.network;
}
}

View File

@@ -0,0 +1,56 @@
package androidx.work;
import android.content.ComponentName;
import androidx.annotation.RestrictTo;
import androidx.work.Data;
import androidx.work.impl.utils.EnqueueUtilsKt;
import com.google.android.gms.ads.RequestConfiguration;
import java.util.UUID;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.SourceDebugExtension;
@SourceDebugExtension({"SMAP\nWorkerParameters.kt\nKotlin\n*S Kotlin\n*F\n+ 1 WorkerParameters.kt\nandroidx/work/WorkerParametersExtensions\n+ 2 Data_.kt\nandroidx/work/Data\n*L\n1#1,100:1\n229#2:101\n229#2:102\n229#2:103\n*S KotlinDebug\n*F\n+ 1 WorkerParameters.kt\nandroidx/work/WorkerParametersExtensions\n*L\n96#1:101\n97#1:102\n98#1:103\n*E\n"})
/* loaded from: classes.dex */
public final class WorkerParametersExtensions {
public static final boolean isRemoteWorkRequest(WorkerParameters workerParameters) {
Intrinsics.checkNotNullParameter(workerParameters, "<this>");
Data inputData = workerParameters.getInputData();
Intrinsics.checkNotNullExpressionValue(inputData, "inputData");
return isRemoteWorkRequest(inputData);
}
public static final /* synthetic */ <T extends ListenableWorker> WorkerParameters usingRemoteService(WorkerParameters workerParameters, ComponentName componentName) {
Intrinsics.checkNotNullParameter(workerParameters, "<this>");
Intrinsics.checkNotNullParameter(componentName, "componentName");
Intrinsics.reifiedOperationMarker(4, RequestConfiguration.MAX_AD_CONTENT_RATING_T);
String name = ListenableWorker.class.getName();
Intrinsics.checkNotNullExpressionValue(name, "T::class.java.name");
return usingRemoteService(workerParameters, name, componentName);
}
public static final WorkerParameters usingRemoteService(WorkerParameters workerParameters, String workerClassName, ComponentName componentName) {
Intrinsics.checkNotNullParameter(workerParameters, "<this>");
Intrinsics.checkNotNullParameter(workerClassName, "workerClassName");
Intrinsics.checkNotNullParameter(componentName, "componentName");
UUID id = workerParameters.getId();
Data inputData = workerParameters.getInputData();
Intrinsics.checkNotNullExpressionValue(inputData, "inputData");
return new WorkerParameters(id, buildDelegatedRemoteRequestData(workerClassName, componentName, inputData), workerParameters.getTags(), workerParameters.getRuntimeExtras(), workerParameters.getRunAttemptCount(), workerParameters.getGeneration(), workerParameters.getBackgroundExecutor(), workerParameters.getWorkerContext(), workerParameters.getTaskExecutor(), workerParameters.getWorkerFactory(), workerParameters.getProgressUpdater(), workerParameters.getForegroundUpdater());
}
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
public static final Data buildDelegatedRemoteRequestData(String delegatedWorkerName, ComponentName componentName, Data inputData) {
Intrinsics.checkNotNullParameter(delegatedWorkerName, "delegatedWorkerName");
Intrinsics.checkNotNullParameter(componentName, "componentName");
Intrinsics.checkNotNullParameter(inputData, "inputData");
Data.Builder builder = new Data.Builder();
builder.putAll(inputData).putString(EnqueueUtilsKt.ARGUMENT_SERVICE_PACKAGE_NAME, componentName.getPackageName()).putString(EnqueueUtilsKt.ARGUMENT_SERVICE_CLASS_NAME, componentName.getClassName()).putString(EnqueueUtilsKt.ARGUMENT_REMOTE_LISTENABLE_WORKER_NAME, delegatedWorkerName);
return builder.build();
}
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
public static final boolean isRemoteWorkRequest(Data data) {
Intrinsics.checkNotNullParameter(data, "<this>");
return data.hasKeyWithValueOfType(EnqueueUtilsKt.ARGUMENT_SERVICE_PACKAGE_NAME, String.class) && data.hasKeyWithValueOfType(EnqueueUtilsKt.ARGUMENT_SERVICE_CLASS_NAME, String.class) && data.hasKeyWithValueOfType(EnqueueUtilsKt.ARGUMENT_REMOTE_LISTENABLE_WORKER_NAME, String.class);
}
}

View File

@@ -0,0 +1,22 @@
package androidx.work.impl;
import android.content.Context;
import androidx.annotation.RequiresApi;
import java.io.File;
import kotlin.jvm.internal.Intrinsics;
@RequiresApi(21)
/* loaded from: classes.dex */
public final class Api21Impl {
public static final Api21Impl INSTANCE = new Api21Impl();
private Api21Impl() {
}
public final File getNoBackupFilesDir(Context context) {
Intrinsics.checkNotNullParameter(context, "context");
File noBackupFilesDir = context.getNoBackupFilesDir();
Intrinsics.checkNotNullExpressionValue(noBackupFilesDir, "context.noBackupFilesDir");
return noBackupFilesDir;
}
}

View File

@@ -0,0 +1,20 @@
package androidx.work.impl;
import android.content.ContentValues;
import androidx.room.RenameColumn;
import androidx.room.migration.AutoMigrationSpec;
import androidx.sqlite.db.SupportSQLiteDatabase;
import kotlin.jvm.internal.Intrinsics;
@RenameColumn(fromColumnName = "period_start_time", tableName = "WorkSpec", toColumnName = "last_enqueue_time")
/* loaded from: classes.dex */
public final class AutoMigration_14_15 implements AutoMigrationSpec {
@Override // androidx.room.migration.AutoMigrationSpec
public void onPostMigrate(SupportSQLiteDatabase db) {
Intrinsics.checkNotNullParameter(db, "db");
db.execSQL("UPDATE workspec SET period_count = 1 WHERE last_enqueue_time <> 0 AND interval_duration <> 0");
ContentValues contentValues = new ContentValues(1);
contentValues.put("last_enqueue_time", Long.valueOf(System.currentTimeMillis()));
db.update("WorkSpec", 3, contentValues, "last_enqueue_time = 0 AND interval_duration <> 0 ", new Object[0]);
}
}

View File

@@ -0,0 +1,14 @@
package androidx.work.impl;
import androidx.room.migration.AutoMigrationSpec;
import androidx.sqlite.db.SupportSQLiteDatabase;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class AutoMigration_19_20 implements AutoMigrationSpec {
@Override // androidx.room.migration.AutoMigrationSpec
public void onPostMigrate(SupportSQLiteDatabase db) {
Intrinsics.checkNotNullParameter(db, "db");
db.execSQL("UPDATE WorkSpec SET `last_enqueue_time` = -1 WHERE `last_enqueue_time` = 0");
}
}

View File

@@ -0,0 +1,41 @@
package androidx.work.impl;
import androidx.room.RoomDatabase;
import androidx.sqlite.db.SupportSQLiteDatabase;
import androidx.work.Clock;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class CleanupCallback extends RoomDatabase.Callback {
private final Clock clock;
public final Clock getClock() {
return this.clock;
}
public CleanupCallback(Clock clock) {
Intrinsics.checkNotNullParameter(clock, "clock");
this.clock = clock;
}
private final String getPruneSQL() {
return "DELETE FROM workspec WHERE state IN (2, 3, 5) AND (last_enqueue_time + minimum_retention_duration) < " + getPruneDate() + " AND (SELECT COUNT(*)=0 FROM dependency WHERE prerequisite_id=id AND work_spec_id NOT IN (SELECT id FROM workspec WHERE state IN (2, 3, 5)))";
}
private final long getPruneDate() {
return this.clock.currentTimeMillis() - WorkDatabaseKt.PRUNE_THRESHOLD_MILLIS;
}
@Override // androidx.room.RoomDatabase.Callback
public void onOpen(SupportSQLiteDatabase db) {
Intrinsics.checkNotNullParameter(db, "db");
super.onOpen(db);
db.beginTransaction();
try {
db.execSQL(getPruneSQL());
db.setTransactionSuccessful();
} finally {
db.endTransaction();
}
}
}

View File

@@ -0,0 +1,29 @@
package androidx.work.impl;
import android.os.Handler;
import android.os.Looper;
import androidx.annotation.NonNull;
import androidx.annotation.RestrictTo;
import androidx.core.os.HandlerCompat;
import androidx.work.RunnableScheduler;
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
/* loaded from: classes.dex */
public class DefaultRunnableScheduler implements RunnableScheduler {
private final Handler mHandler = HandlerCompat.createAsync(Looper.getMainLooper());
@NonNull
public Handler getHandler() {
return this.mHandler;
}
@Override // androidx.work.RunnableScheduler
public void scheduleWithDelay(long j, @NonNull Runnable runnable) {
this.mHandler.postDelayed(runnable, j);
}
@Override // androidx.work.RunnableScheduler
public void cancel(@NonNull Runnable runnable) {
this.mHandler.removeCallbacks(runnable);
}
}

View File

@@ -0,0 +1,11 @@
package androidx.work.impl;
import androidx.annotation.NonNull;
import androidx.annotation.RestrictTo;
import androidx.work.impl.model.WorkGenerationalId;
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
/* loaded from: classes.dex */
public interface ExecutionListener {
void onExecuted(@NonNull WorkGenerationalId workGenerationalId, boolean z);
}

View File

@@ -0,0 +1,20 @@
package androidx.work.impl;
import androidx.room.migration.Migration;
import androidx.sqlite.db.SupportSQLiteDatabase;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class Migration_11_12 extends Migration {
public static final Migration_11_12 INSTANCE = new Migration_11_12();
private Migration_11_12() {
super(11, 12);
}
@Override // androidx.room.migration.Migration
public void migrate(SupportSQLiteDatabase db) {
Intrinsics.checkNotNullParameter(db, "db");
db.execSQL("ALTER TABLE workspec ADD COLUMN `out_of_quota_policy` INTEGER NOT NULL DEFAULT 0");
}
}

View File

@@ -0,0 +1,21 @@
package androidx.work.impl;
import androidx.room.migration.Migration;
import androidx.sqlite.db.SupportSQLiteDatabase;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class Migration_12_13 extends Migration {
public static final Migration_12_13 INSTANCE = new Migration_12_13();
private Migration_12_13() {
super(12, 13);
}
@Override // androidx.room.migration.Migration
public void migrate(SupportSQLiteDatabase db) {
Intrinsics.checkNotNullParameter(db, "db");
db.execSQL("UPDATE workspec SET required_network_type = 0 WHERE required_network_type IS NULL ");
db.execSQL("UPDATE workspec SET content_uri_triggers = x'' WHERE content_uri_triggers is NULL");
}
}

View File

@@ -0,0 +1,25 @@
package androidx.work.impl;
import androidx.room.migration.Migration;
import androidx.sqlite.db.SupportSQLiteDatabase;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class Migration_15_16 extends Migration {
public static final Migration_15_16 INSTANCE = new Migration_15_16();
private Migration_15_16() {
super(15, 16);
}
@Override // androidx.room.migration.Migration
public void migrate(SupportSQLiteDatabase db) {
Intrinsics.checkNotNullParameter(db, "db");
db.execSQL("DELETE FROM SystemIdInfo WHERE work_spec_id IN (SELECT work_spec_id FROM SystemIdInfo LEFT JOIN WorkSpec ON work_spec_id = id WHERE WorkSpec.id IS NULL)");
db.execSQL("ALTER TABLE `WorkSpec` ADD COLUMN `generation` INTEGER NOT NULL DEFAULT 0");
db.execSQL("CREATE TABLE IF NOT EXISTS `_new_SystemIdInfo` (\n `work_spec_id` TEXT NOT NULL, \n `generation` INTEGER NOT NULL DEFAULT 0, \n `system_id` INTEGER NOT NULL, \n PRIMARY KEY(`work_spec_id`, `generation`), \n FOREIGN KEY(`work_spec_id`) REFERENCES `WorkSpec`(`id`) \n ON UPDATE CASCADE ON DELETE CASCADE )");
db.execSQL("INSERT INTO `_new_SystemIdInfo` (`work_spec_id`,`system_id`) SELECT `work_spec_id`,`system_id` FROM `SystemIdInfo`");
db.execSQL("DROP TABLE `SystemIdInfo`");
db.execSQL("ALTER TABLE `_new_SystemIdInfo` RENAME TO `SystemIdInfo`");
}
}

View File

@@ -0,0 +1,30 @@
package androidx.work.impl;
import androidx.room.migration.Migration;
import androidx.sqlite.db.SupportSQLiteDatabase;
import androidx.work.OverwritingInputMerger;
import kotlin.jvm.internal.Intrinsics;
import kotlin.text.StringsKt__IndentKt;
/* loaded from: classes.dex */
public final class Migration_16_17 extends Migration {
public static final Migration_16_17 INSTANCE = new Migration_16_17();
private Migration_16_17() {
super(16, 17);
}
@Override // androidx.room.migration.Migration
public void migrate(SupportSQLiteDatabase db) {
String trimIndent;
Intrinsics.checkNotNullParameter(db, "db");
trimIndent = StringsKt__IndentKt.trimIndent("UPDATE WorkSpec\n SET input_merger_class_name = '" + OverwritingInputMerger.class.getName() + "'\n WHERE input_merger_class_name IS NULL\n ");
db.execSQL(trimIndent);
db.execSQL("CREATE TABLE IF NOT EXISTS `_new_WorkSpec` (\n `id` TEXT NOT NULL,\n `state` INTEGER NOT NULL,\n `worker_class_name` TEXT NOT NULL,\n `input_merger_class_name` TEXT NOT NULL,\n `input` BLOB NOT NULL,\n `output` BLOB NOT NULL,\n `initial_delay` INTEGER NOT NULL,\n `interval_duration` INTEGER NOT NULL,\n `flex_duration` INTEGER NOT NULL,\n `run_attempt_count` INTEGER NOT NULL,\n `backoff_policy` INTEGER NOT NULL,\n `backoff_delay_duration` INTEGER NOT NULL,\n `last_enqueue_time` INTEGER NOT NULL,\n `minimum_retention_duration` INTEGER NOT NULL,\n `schedule_requested_at` INTEGER NOT NULL,\n `run_in_foreground` INTEGER NOT NULL,\n `out_of_quota_policy` INTEGER NOT NULL,\n `period_count` INTEGER NOT NULL DEFAULT 0,\n `generation` INTEGER NOT NULL DEFAULT 0,\n `required_network_type` INTEGER NOT NULL,\n `requires_charging` INTEGER NOT NULL,\n `requires_device_idle` INTEGER NOT NULL,\n `requires_battery_not_low` INTEGER NOT NULL,\n `requires_storage_not_low` INTEGER NOT NULL,\n `trigger_content_update_delay` INTEGER NOT NULL,\n `trigger_max_content_delay` INTEGER NOT NULL,\n `content_uri_triggers` BLOB NOT NULL,\n PRIMARY KEY(`id`)\n )");
db.execSQL("INSERT INTO `_new_WorkSpec` (\n `id`,\n `state`,\n `worker_class_name`,\n `input_merger_class_name`,\n `input`,\n `output`,\n `initial_delay`,\n `interval_duration`,\n `flex_duration`,\n `run_attempt_count`,\n `backoff_policy`,\n `backoff_delay_duration`,\n `last_enqueue_time`,\n `minimum_retention_duration`,\n `schedule_requested_at`,\n `run_in_foreground`,\n `out_of_quota_policy`,\n `period_count`,\n `generation`,\n `required_network_type`,\n `requires_charging`,\n `requires_device_idle`,\n `requires_battery_not_low`,\n `requires_storage_not_low`,\n `trigger_content_update_delay`,\n `trigger_max_content_delay`,\n `content_uri_triggers`\n ) SELECT\n `id`,\n `state`,\n `worker_class_name`,\n `input_merger_class_name`,\n `input`,\n `output`,\n `initial_delay`,\n `interval_duration`,\n `flex_duration`,\n `run_attempt_count`,\n `backoff_policy`,\n `backoff_delay_duration`,\n `last_enqueue_time`,\n `minimum_retention_duration`,\n `schedule_requested_at`,\n `run_in_foreground`,\n `out_of_quota_policy`,\n `period_count`,\n `generation`,\n `required_network_type`,\n `requires_charging`,\n `requires_device_idle`,\n `requires_battery_not_low`,\n `requires_storage_not_low`,\n `trigger_content_update_delay`,\n `trigger_max_content_delay`,\n `content_uri_triggers`\n FROM `WorkSpec`");
db.execSQL("DROP TABLE `WorkSpec`");
db.execSQL("ALTER TABLE `_new_WorkSpec` RENAME TO `WorkSpec`");
db.execSQL("CREATE INDEX IF NOT EXISTS `index_WorkSpec_schedule_requested_at`ON `WorkSpec` (`schedule_requested_at`)");
db.execSQL("CREATE INDEX IF NOT EXISTS `index_WorkSpec_last_enqueue_time` ON`WorkSpec` (`last_enqueue_time`)");
}
}

View File

@@ -0,0 +1,23 @@
package androidx.work.impl;
import androidx.room.migration.Migration;
import androidx.sqlite.db.SupportSQLiteDatabase;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class Migration_1_2 extends Migration {
public static final Migration_1_2 INSTANCE = new Migration_1_2();
private Migration_1_2() {
super(1, 2);
}
@Override // androidx.room.migration.Migration
public void migrate(SupportSQLiteDatabase db) {
Intrinsics.checkNotNullParameter(db, "db");
db.execSQL("\n CREATE TABLE IF NOT EXISTS `SystemIdInfo` (`work_spec_id` TEXT NOT NULL, `system_id`\n INTEGER NOT NULL, PRIMARY KEY(`work_spec_id`), FOREIGN KEY(`work_spec_id`)\n REFERENCES `WorkSpec`(`id`) ON UPDATE CASCADE ON DELETE CASCADE )\n ");
db.execSQL("\n INSERT INTO SystemIdInfo(work_spec_id, system_id)\n SELECT work_spec_id, alarm_id AS system_id FROM alarmInfo\n ");
db.execSQL("DROP TABLE IF EXISTS alarmInfo");
db.execSQL("\n INSERT OR IGNORE INTO worktag(tag, work_spec_id)\n SELECT worker_class_name AS tag, id AS work_spec_id FROM workspec\n ");
}
}

View File

@@ -0,0 +1,20 @@
package androidx.work.impl;
import androidx.room.migration.Migration;
import androidx.sqlite.db.SupportSQLiteDatabase;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class Migration_3_4 extends Migration {
public static final Migration_3_4 INSTANCE = new Migration_3_4();
private Migration_3_4() {
super(3, 4);
}
@Override // androidx.room.migration.Migration
public void migrate(SupportSQLiteDatabase db) {
Intrinsics.checkNotNullParameter(db, "db");
db.execSQL("\n UPDATE workspec SET schedule_requested_at = 0\n WHERE state NOT IN (2, 3, 5)\n AND schedule_requested_at = -1\n AND interval_duration <> 0\n ");
}
}

View File

@@ -0,0 +1,21 @@
package androidx.work.impl;
import androidx.room.migration.Migration;
import androidx.sqlite.db.SupportSQLiteDatabase;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class Migration_4_5 extends Migration {
public static final Migration_4_5 INSTANCE = new Migration_4_5();
private Migration_4_5() {
super(4, 5);
}
@Override // androidx.room.migration.Migration
public void migrate(SupportSQLiteDatabase db) {
Intrinsics.checkNotNullParameter(db, "db");
db.execSQL("ALTER TABLE workspec ADD COLUMN `trigger_content_update_delay` INTEGER NOT NULL DEFAULT -1");
db.execSQL("ALTER TABLE workspec ADD COLUMN `trigger_max_content_delay` INTEGER NOT NULL DEFAULT -1");
}
}

View File

@@ -0,0 +1,20 @@
package androidx.work.impl;
import androidx.room.migration.Migration;
import androidx.sqlite.db.SupportSQLiteDatabase;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class Migration_6_7 extends Migration {
public static final Migration_6_7 INSTANCE = new Migration_6_7();
private Migration_6_7() {
super(6, 7);
}
@Override // androidx.room.migration.Migration
public void migrate(SupportSQLiteDatabase db) {
Intrinsics.checkNotNullParameter(db, "db");
db.execSQL("\n CREATE TABLE IF NOT EXISTS `WorkProgress` (`work_spec_id` TEXT NOT NULL, `progress`\n BLOB NOT NULL, PRIMARY KEY(`work_spec_id`), FOREIGN KEY(`work_spec_id`)\n REFERENCES `WorkSpec`(`id`) ON UPDATE CASCADE ON DELETE CASCADE )\n ");
}
}

View File

@@ -0,0 +1,20 @@
package androidx.work.impl;
import androidx.room.migration.Migration;
import androidx.sqlite.db.SupportSQLiteDatabase;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class Migration_7_8 extends Migration {
public static final Migration_7_8 INSTANCE = new Migration_7_8();
private Migration_7_8() {
super(7, 8);
}
@Override // androidx.room.migration.Migration
public void migrate(SupportSQLiteDatabase db) {
Intrinsics.checkNotNullParameter(db, "db");
db.execSQL("\n CREATE INDEX IF NOT EXISTS `index_WorkSpec_period_start_time` ON `workspec`(`period_start_time`)\n ");
}
}

View File

@@ -0,0 +1,20 @@
package androidx.work.impl;
import androidx.room.migration.Migration;
import androidx.sqlite.db.SupportSQLiteDatabase;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class Migration_8_9 extends Migration {
public static final Migration_8_9 INSTANCE = new Migration_8_9();
private Migration_8_9() {
super(8, 9);
}
@Override // androidx.room.migration.Migration
public void migrate(SupportSQLiteDatabase db) {
Intrinsics.checkNotNullParameter(db, "db");
db.execSQL("ALTER TABLE workspec ADD COLUMN `run_in_foreground` INTEGER NOT NULL DEFAULT 0");
}
}

View File

@@ -0,0 +1,335 @@
package androidx.work.impl;
import android.content.Context;
import android.os.PowerManager;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RestrictTo;
import androidx.core.content.ContextCompat;
import androidx.work.Configuration;
import androidx.work.ForegroundInfo;
import androidx.work.Logger;
import androidx.work.WorkerParameters;
import androidx.work.impl.WorkerWrapper;
import androidx.work.impl.foreground.ForegroundProcessor;
import androidx.work.impl.foreground.SystemForegroundDispatcher;
import androidx.work.impl.model.WorkGenerationalId;
import androidx.work.impl.model.WorkSpec;
import androidx.work.impl.utils.WakeLocks;
import androidx.work.impl.utils.taskexecutor.TaskExecutor;
import com.google.common.util.concurrent.ListenableFuture;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
/* loaded from: classes.dex */
public class Processor implements ForegroundProcessor {
private static final String FOREGROUND_WAKELOCK_TAG = "ProcessorForegroundLck";
private static final String TAG = Logger.tagWithPrefix("Processor");
private Context mAppContext;
private Configuration mConfiguration;
private WorkDatabase mWorkDatabase;
private TaskExecutor mWorkTaskExecutor;
private Map<String, WorkerWrapper> mEnqueuedWorkMap = new HashMap();
private Map<String, WorkerWrapper> mForegroundWorkMap = new HashMap();
private Set<String> mCancelledIds = new HashSet();
private final List<ExecutionListener> mOuterListeners = new ArrayList();
@Nullable
private PowerManager.WakeLock mForegroundLock = null;
private final Object mLock = new Object();
private Map<String, Set<StartStopToken>> mWorkRuns = new HashMap();
public Processor(@NonNull Context context, @NonNull Configuration configuration, @NonNull TaskExecutor taskExecutor, @NonNull WorkDatabase workDatabase) {
this.mAppContext = context;
this.mConfiguration = configuration;
this.mWorkTaskExecutor = taskExecutor;
this.mWorkDatabase = workDatabase;
}
public boolean startWork(@NonNull StartStopToken startStopToken) {
return startWork(startStopToken, null);
}
public boolean startWork(@NonNull StartStopToken startStopToken, @Nullable WorkerParameters.RuntimeExtras runtimeExtras) {
WorkGenerationalId id = startStopToken.getId();
final String workSpecId = id.getWorkSpecId();
final ArrayList arrayList = new ArrayList();
WorkSpec workSpec = (WorkSpec) this.mWorkDatabase.runInTransaction(new Callable() { // from class: androidx.work.impl.Processor$$ExternalSyntheticLambda0
@Override // java.util.concurrent.Callable
public final Object call() {
WorkSpec lambda$startWork$0;
lambda$startWork$0 = Processor.this.lambda$startWork$0(arrayList, workSpecId);
return lambda$startWork$0;
}
});
if (workSpec == null) {
Logger.get().warning(TAG, "Didn't find WorkSpec for id " + id);
runOnExecuted(id, false);
return false;
}
synchronized (this.mLock) {
try {
if (isEnqueued(workSpecId)) {
Set<StartStopToken> set = this.mWorkRuns.get(workSpecId);
if (set.iterator().next().getId().getGeneration() == id.getGeneration()) {
set.add(startStopToken);
Logger.get().debug(TAG, "Work " + id + " is already enqueued for processing");
} else {
runOnExecuted(id, false);
}
return false;
}
if (workSpec.getGeneration() != id.getGeneration()) {
runOnExecuted(id, false);
return false;
}
final WorkerWrapper build = new WorkerWrapper.Builder(this.mAppContext, this.mConfiguration, this.mWorkTaskExecutor, this, this.mWorkDatabase, workSpec, arrayList).withRuntimeExtras(runtimeExtras).build();
final ListenableFuture launch = build.launch();
launch.addListener(new Runnable() { // from class: androidx.work.impl.Processor$$ExternalSyntheticLambda1
@Override // java.lang.Runnable
public final void run() {
Processor.this.lambda$startWork$1(launch, build);
}
}, this.mWorkTaskExecutor.getMainThreadExecutor());
this.mEnqueuedWorkMap.put(workSpecId, build);
HashSet hashSet = new HashSet();
hashSet.add(startStopToken);
this.mWorkRuns.put(workSpecId, hashSet);
Logger.get().debug(TAG, getClass().getSimpleName() + ": processing " + id);
return true;
} catch (Throwable th) {
throw th;
}
}
}
/* JADX INFO: Access modifiers changed from: private */
public /* synthetic */ WorkSpec lambda$startWork$0(ArrayList arrayList, String str) throws Exception {
arrayList.addAll(this.mWorkDatabase.workTagDao().getTagsForWorkSpecId(str));
return this.mWorkDatabase.workSpecDao().getWorkSpec(str);
}
/* JADX INFO: Access modifiers changed from: private */
public /* synthetic */ void lambda$startWork$1(ListenableFuture listenableFuture, WorkerWrapper workerWrapper) {
boolean z;
try {
z = ((Boolean) listenableFuture.get()).booleanValue();
} catch (InterruptedException | ExecutionException unused) {
z = true;
}
onExecuted(workerWrapper, z);
}
@Override // androidx.work.impl.foreground.ForegroundProcessor
public void startForeground(@NonNull String str, @NonNull ForegroundInfo foregroundInfo) {
synchronized (this.mLock) {
try {
Logger.get().info(TAG, "Moving WorkSpec (" + str + ") to the foreground");
WorkerWrapper remove = this.mEnqueuedWorkMap.remove(str);
if (remove != null) {
if (this.mForegroundLock == null) {
PowerManager.WakeLock newWakeLock = WakeLocks.newWakeLock(this.mAppContext, FOREGROUND_WAKELOCK_TAG);
this.mForegroundLock = newWakeLock;
newWakeLock.acquire();
}
this.mForegroundWorkMap.put(str, remove);
ContextCompat.startForegroundService(this.mAppContext, SystemForegroundDispatcher.createStartForegroundIntent(this.mAppContext, remove.getWorkGenerationalId(), foregroundInfo));
}
} catch (Throwable th) {
throw th;
}
}
}
public boolean stopForegroundWork(@NonNull StartStopToken startStopToken, int i) {
WorkerWrapper cleanUpWorkerUnsafe;
String workSpecId = startStopToken.getId().getWorkSpecId();
synchronized (this.mLock) {
cleanUpWorkerUnsafe = cleanUpWorkerUnsafe(workSpecId);
}
return interrupt(workSpecId, cleanUpWorkerUnsafe, i);
}
public boolean stopWork(@NonNull StartStopToken startStopToken, int i) {
String workSpecId = startStopToken.getId().getWorkSpecId();
synchronized (this.mLock) {
try {
if (this.mForegroundWorkMap.get(workSpecId) != null) {
Logger.get().debug(TAG, "Ignored stopWork. WorkerWrapper " + workSpecId + " is in foreground");
return false;
}
Set<StartStopToken> set = this.mWorkRuns.get(workSpecId);
if (set != null && set.contains(startStopToken)) {
return interrupt(workSpecId, cleanUpWorkerUnsafe(workSpecId), i);
}
return false;
} finally {
}
}
}
public boolean stopAndCancelWork(@NonNull String str, int i) {
WorkerWrapper cleanUpWorkerUnsafe;
synchronized (this.mLock) {
Logger.get().debug(TAG, "Processor cancelling " + str);
this.mCancelledIds.add(str);
cleanUpWorkerUnsafe = cleanUpWorkerUnsafe(str);
}
return interrupt(str, cleanUpWorkerUnsafe, i);
}
public boolean isCancelled(@NonNull String str) {
boolean contains;
synchronized (this.mLock) {
contains = this.mCancelledIds.contains(str);
}
return contains;
}
public boolean hasWork() {
boolean z;
synchronized (this.mLock) {
try {
z = (this.mEnqueuedWorkMap.isEmpty() && this.mForegroundWorkMap.isEmpty()) ? false : true;
} finally {
}
}
return z;
}
public boolean isEnqueued(@NonNull String str) {
boolean z;
synchronized (this.mLock) {
z = getWorkerWrapperUnsafe(str) != null;
}
return z;
}
public void addExecutionListener(@NonNull ExecutionListener executionListener) {
synchronized (this.mLock) {
this.mOuterListeners.add(executionListener);
}
}
public void removeExecutionListener(@NonNull ExecutionListener executionListener) {
synchronized (this.mLock) {
this.mOuterListeners.remove(executionListener);
}
}
private void onExecuted(@NonNull WorkerWrapper workerWrapper, boolean z) {
synchronized (this.mLock) {
try {
WorkGenerationalId workGenerationalId = workerWrapper.getWorkGenerationalId();
String workSpecId = workGenerationalId.getWorkSpecId();
if (getWorkerWrapperUnsafe(workSpecId) == workerWrapper) {
cleanUpWorkerUnsafe(workSpecId);
}
Logger.get().debug(TAG, getClass().getSimpleName() + " " + workSpecId + " executed; reschedule = " + z);
Iterator<ExecutionListener> it = this.mOuterListeners.iterator();
while (it.hasNext()) {
it.next().onExecuted(workGenerationalId, z);
}
} catch (Throwable th) {
throw th;
}
}
}
@Nullable
private WorkerWrapper getWorkerWrapperUnsafe(@NonNull String str) {
WorkerWrapper workerWrapper = this.mForegroundWorkMap.get(str);
return workerWrapper == null ? this.mEnqueuedWorkMap.get(str) : workerWrapper;
}
@Nullable
public WorkSpec getRunningWorkSpec(@NonNull String str) {
synchronized (this.mLock) {
try {
WorkerWrapper workerWrapperUnsafe = getWorkerWrapperUnsafe(str);
if (workerWrapperUnsafe == null) {
return null;
}
return workerWrapperUnsafe.getWorkSpec();
} catch (Throwable th) {
throw th;
}
}
}
private void runOnExecuted(@NonNull final WorkGenerationalId workGenerationalId, final boolean z) {
this.mWorkTaskExecutor.getMainThreadExecutor().execute(new Runnable() { // from class: androidx.work.impl.Processor$$ExternalSyntheticLambda2
@Override // java.lang.Runnable
public final void run() {
Processor.this.lambda$runOnExecuted$2(workGenerationalId, z);
}
});
}
/* JADX INFO: Access modifiers changed from: private */
public /* synthetic */ void lambda$runOnExecuted$2(WorkGenerationalId workGenerationalId, boolean z) {
synchronized (this.mLock) {
try {
Iterator<ExecutionListener> it = this.mOuterListeners.iterator();
while (it.hasNext()) {
it.next().onExecuted(workGenerationalId, z);
}
} catch (Throwable th) {
throw th;
}
}
}
private void stopForegroundService() {
synchronized (this.mLock) {
try {
if (!(!this.mForegroundWorkMap.isEmpty())) {
try {
this.mAppContext.startService(SystemForegroundDispatcher.createStopForegroundIntent(this.mAppContext));
} catch (Throwable th) {
Logger.get().error(TAG, "Unable to stop foreground service", th);
}
PowerManager.WakeLock wakeLock = this.mForegroundLock;
if (wakeLock != null) {
wakeLock.release();
this.mForegroundLock = null;
}
}
} catch (Throwable th2) {
throw th2;
}
}
}
@Nullable
private WorkerWrapper cleanUpWorkerUnsafe(@NonNull String str) {
WorkerWrapper remove = this.mForegroundWorkMap.remove(str);
boolean z = remove != null;
if (!z) {
remove = this.mEnqueuedWorkMap.remove(str);
}
this.mWorkRuns.remove(str);
if (z) {
stopForegroundService();
}
return remove;
}
private static boolean interrupt(@NonNull String str, @Nullable WorkerWrapper workerWrapper, int i) {
if (workerWrapper != null) {
workerWrapper.interrupt(i);
Logger.get().debug(TAG, "WorkerWrapper interrupted for " + str);
return true;
}
Logger.get().debug(TAG, "WorkerWrapper could not be found for " + str);
return false;
}
}

View File

@@ -0,0 +1,33 @@
package androidx.work.impl;
import android.content.Context;
import androidx.room.migration.Migration;
import androidx.sqlite.db.SupportSQLiteDatabase;
import androidx.work.impl.utils.PreferenceUtils;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class RescheduleMigration extends Migration {
private final Context mContext;
public final Context getMContext() {
return this.mContext;
}
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public RescheduleMigration(Context mContext, int i, int i2) {
super(i, i2);
Intrinsics.checkNotNullParameter(mContext, "mContext");
this.mContext = mContext;
}
@Override // androidx.room.migration.Migration
public void migrate(SupportSQLiteDatabase db) {
Intrinsics.checkNotNullParameter(db, "db");
if (this.endVersion >= 10) {
db.execSQL(PreferenceUtils.INSERT_PREFERENCE, new Object[]{PreferenceUtils.KEY_RESCHEDULE_NEEDED, 1});
} else {
this.mContext.getSharedPreferences(PreferenceUtils.PREFERENCES_FILE_NAME, 0).edit().putBoolean(PreferenceUtils.KEY_RESCHEDULE_NEEDED, true).apply();
}
}
}

View File

@@ -0,0 +1,18 @@
package androidx.work.impl;
import androidx.annotation.NonNull;
import androidx.annotation.RestrictTo;
import androidx.work.impl.model.WorkSpec;
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
/* loaded from: classes.dex */
public interface Scheduler {
public static final int MAX_GREEDY_SCHEDULER_LIMIT = 200;
public static final int MAX_SCHEDULER_LIMIT = 50;
void cancel(@NonNull String str);
boolean hasLimitedSchedulingSlots();
void schedule(@NonNull WorkSpec... workSpecArr);
}

View File

@@ -0,0 +1,125 @@
package androidx.work.impl;
import android.content.Context;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RestrictTo;
import androidx.work.Clock;
import androidx.work.Configuration;
import androidx.work.Logger;
import androidx.work.impl.background.systemjob.SystemJobScheduler;
import androidx.work.impl.background.systemjob.SystemJobService;
import androidx.work.impl.model.WorkGenerationalId;
import androidx.work.impl.model.WorkSpec;
import androidx.work.impl.model.WorkSpecDao;
import androidx.work.impl.utils.PackageManagerHelper;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.Executor;
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
/* loaded from: classes.dex */
public class Schedulers {
public static final String GCM_SCHEDULER = "androidx.work.impl.background.gcm.GcmScheduler";
private static final String TAG = Logger.tagWithPrefix("Schedulers");
public static void registerRescheduling(@NonNull final List<Scheduler> list, @NonNull Processor processor, @NonNull final Executor executor, @NonNull final WorkDatabase workDatabase, @NonNull final Configuration configuration) {
processor.addExecutionListener(new ExecutionListener() { // from class: androidx.work.impl.Schedulers$$ExternalSyntheticLambda1
@Override // androidx.work.impl.ExecutionListener
public final void onExecuted(WorkGenerationalId workGenerationalId, boolean z) {
Schedulers.lambda$registerRescheduling$1(executor, list, configuration, workDatabase, workGenerationalId, z);
}
});
}
/* JADX INFO: Access modifiers changed from: private */
public static /* synthetic */ void lambda$registerRescheduling$1(Executor executor, final List list, final Configuration configuration, final WorkDatabase workDatabase, final WorkGenerationalId workGenerationalId, boolean z) {
executor.execute(new Runnable() { // from class: androidx.work.impl.Schedulers$$ExternalSyntheticLambda0
@Override // java.lang.Runnable
public final void run() {
Schedulers.lambda$registerRescheduling$0(list, workGenerationalId, configuration, workDatabase);
}
});
}
/* JADX INFO: Access modifiers changed from: private */
public static /* synthetic */ void lambda$registerRescheduling$0(List list, WorkGenerationalId workGenerationalId, Configuration configuration, WorkDatabase workDatabase) {
Iterator it = list.iterator();
while (it.hasNext()) {
((Scheduler) it.next()).cancel(workGenerationalId.getWorkSpecId());
}
schedule(configuration, workDatabase, list);
}
public static void schedule(@NonNull Configuration configuration, @NonNull WorkDatabase workDatabase, @Nullable List<Scheduler> list) {
if (list == null || list.size() == 0) {
return;
}
WorkSpecDao workSpecDao = workDatabase.workSpecDao();
workDatabase.beginTransaction();
try {
List<WorkSpec> eligibleWorkForSchedulingWithContentUris = workSpecDao.getEligibleWorkForSchedulingWithContentUris();
markScheduled(workSpecDao, configuration.getClock(), eligibleWorkForSchedulingWithContentUris);
List<WorkSpec> eligibleWorkForScheduling = workSpecDao.getEligibleWorkForScheduling(configuration.getMaxSchedulerLimit());
markScheduled(workSpecDao, configuration.getClock(), eligibleWorkForScheduling);
if (eligibleWorkForSchedulingWithContentUris != null) {
eligibleWorkForScheduling.addAll(eligibleWorkForSchedulingWithContentUris);
}
List<WorkSpec> allEligibleWorkSpecsForScheduling = workSpecDao.getAllEligibleWorkSpecsForScheduling(200);
workDatabase.setTransactionSuccessful();
workDatabase.endTransaction();
if (eligibleWorkForScheduling.size() > 0) {
WorkSpec[] workSpecArr = (WorkSpec[]) eligibleWorkForScheduling.toArray(new WorkSpec[eligibleWorkForScheduling.size()]);
for (Scheduler scheduler : list) {
if (scheduler.hasLimitedSchedulingSlots()) {
scheduler.schedule(workSpecArr);
}
}
}
if (allEligibleWorkSpecsForScheduling.size() > 0) {
WorkSpec[] workSpecArr2 = (WorkSpec[]) allEligibleWorkSpecsForScheduling.toArray(new WorkSpec[allEligibleWorkSpecsForScheduling.size()]);
for (Scheduler scheduler2 : list) {
if (!scheduler2.hasLimitedSchedulingSlots()) {
scheduler2.schedule(workSpecArr2);
}
}
}
} catch (Throwable th) {
workDatabase.endTransaction();
throw th;
}
}
@NonNull
public static Scheduler createBestAvailableBackgroundScheduler(@NonNull Context context, @NonNull WorkDatabase workDatabase, Configuration configuration) {
SystemJobScheduler systemJobScheduler = new SystemJobScheduler(context, workDatabase, configuration);
PackageManagerHelper.setComponentEnabled(context, SystemJobService.class, true);
Logger.get().debug(TAG, "Created SystemJobScheduler and enabled SystemJobService");
return systemJobScheduler;
}
@Nullable
private static Scheduler tryCreateGcmBasedScheduler(@NonNull Context context, Clock clock) {
try {
Scheduler scheduler = (Scheduler) Class.forName(GCM_SCHEDULER).getConstructor(Context.class, Clock.class).newInstance(context, clock);
Logger.get().debug(TAG, "Created androidx.work.impl.background.gcm.GcmScheduler");
return scheduler;
} catch (Throwable th) {
Logger.get().debug(TAG, "Unable to create GCM Scheduler", th);
return null;
}
}
private Schedulers() {
}
private static void markScheduled(WorkSpecDao workSpecDao, Clock clock, List<WorkSpec> list) {
if (list.size() > 0) {
long currentTimeMillis = clock.currentTimeMillis();
Iterator<WorkSpec> it = list.iterator();
while (it.hasNext()) {
workSpecDao.markWorkSpecScheduled(it.next().id, currentTimeMillis);
}
}
}
}

View File

@@ -0,0 +1,18 @@
package androidx.work.impl;
import androidx.work.impl.model.WorkGenerationalId;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class StartStopToken {
private final WorkGenerationalId id;
public final WorkGenerationalId getId() {
return this.id;
}
public StartStopToken(WorkGenerationalId id) {
Intrinsics.checkNotNullParameter(id, "id");
this.id = id;
}
}

View File

@@ -0,0 +1,61 @@
package androidx.work.impl;
import androidx.work.impl.model.WorkGenerationalId;
import androidx.work.impl.model.WorkSpec;
import androidx.work.impl.model.WorkSpecKt;
import java.util.List;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public interface StartStopTokens {
public static final Companion Companion = Companion.$$INSTANCE;
static StartStopTokens create() {
return Companion.create();
}
static StartStopTokens create(boolean z) {
return Companion.create(z);
}
boolean contains(WorkGenerationalId workGenerationalId);
StartStopToken remove(WorkGenerationalId workGenerationalId);
List<StartStopToken> remove(String str);
StartStopToken tokenFor(WorkGenerationalId workGenerationalId);
default StartStopToken tokenFor(WorkSpec spec) {
Intrinsics.checkNotNullParameter(spec, "spec");
return tokenFor(WorkSpecKt.generationalId(spec));
}
default StartStopToken remove(WorkSpec spec) {
Intrinsics.checkNotNullParameter(spec, "spec");
return remove(WorkSpecKt.generationalId(spec));
}
public static final class Companion {
static final /* synthetic */ Companion $$INSTANCE = new Companion();
public final StartStopTokens create() {
return create$default(this, false, 1, null);
}
private Companion() {
}
public static /* synthetic */ StartStopTokens create$default(Companion companion, boolean z, int i, Object obj) {
if ((i & 1) != 0) {
z = true;
}
return companion.create(z);
}
public final StartStopTokens create(boolean z) {
StartStopTokensImpl startStopTokensImpl = new StartStopTokensImpl();
return z ? new SynchronizedStartStopTokensImpl(startStopTokensImpl) : startStopTokensImpl;
}
}
}

View File

@@ -0,0 +1,57 @@
package androidx.work.impl;
import androidx.work.impl.model.WorkGenerationalId;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import kotlin.collections.CollectionsKt___CollectionsKt;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.SourceDebugExtension;
@SourceDebugExtension({"SMAP\nStartStopToken.kt\nKotlin\n*S Kotlin\n*F\n+ 1 StartStopToken.kt\nandroidx/work/impl/StartStopTokensImpl\n+ 2 Maps.kt\nkotlin/collections/MapsKt__MapsKt\n+ 3 _Collections.kt\nkotlin/collections/CollectionsKt___CollectionsKt\n*L\n1#1,104:1\n361#2,7:105\n467#2,7:112\n1855#3,2:119\n*S KotlinDebug\n*F\n+ 1 StartStopToken.kt\nandroidx/work/impl/StartStopTokensImpl\n*L\n65#1:105,7\n73#1:112,7\n74#1:119,2\n*E\n"})
/* loaded from: classes.dex */
final class StartStopTokensImpl implements StartStopTokens {
private final Map<WorkGenerationalId, StartStopToken> runs = new LinkedHashMap();
@Override // androidx.work.impl.StartStopTokens
public StartStopToken remove(WorkGenerationalId id) {
Intrinsics.checkNotNullParameter(id, "id");
return this.runs.remove(id);
}
@Override // androidx.work.impl.StartStopTokens
public boolean contains(WorkGenerationalId id) {
Intrinsics.checkNotNullParameter(id, "id");
return this.runs.containsKey(id);
}
@Override // androidx.work.impl.StartStopTokens
public StartStopToken tokenFor(WorkGenerationalId id) {
Intrinsics.checkNotNullParameter(id, "id");
Map<WorkGenerationalId, StartStopToken> map = this.runs;
StartStopToken startStopToken = map.get(id);
if (startStopToken == null) {
startStopToken = new StartStopToken(id);
map.put(id, startStopToken);
}
return startStopToken;
}
@Override // androidx.work.impl.StartStopTokens
public List<StartStopToken> remove(String workSpecId) {
Intrinsics.checkNotNullParameter(workSpecId, "workSpecId");
Map<WorkGenerationalId, StartStopToken> map = this.runs;
LinkedHashMap linkedHashMap = new LinkedHashMap();
for (Map.Entry<WorkGenerationalId, StartStopToken> entry : map.entrySet()) {
if (Intrinsics.areEqual(entry.getKey().getWorkSpecId(), workSpecId)) {
linkedHashMap.put(entry.getKey(), entry.getValue());
}
}
Iterator it = linkedHashMap.keySet().iterator();
while (it.hasNext()) {
this.runs.remove((WorkGenerationalId) it.next());
}
return CollectionsKt___CollectionsKt.toList(linkedHashMap.values());
}
}

View File

@@ -0,0 +1,59 @@
package androidx.work.impl;
import androidx.work.impl.model.WorkGenerationalId;
import java.util.List;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.SourceDebugExtension;
@SourceDebugExtension({"SMAP\nStartStopToken.kt\nKotlin\n*S Kotlin\n*F\n+ 1 StartStopToken.kt\nandroidx/work/impl/SynchronizedStartStopTokensImpl\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,104:1\n1#2:105\n*E\n"})
/* loaded from: classes.dex */
final class SynchronizedStartStopTokensImpl implements StartStopTokens {
private final StartStopTokens delegate;
private final Object lock;
public SynchronizedStartStopTokensImpl(StartStopTokens delegate) {
Intrinsics.checkNotNullParameter(delegate, "delegate");
this.delegate = delegate;
this.lock = new Object();
}
@Override // androidx.work.impl.StartStopTokens
public StartStopToken tokenFor(WorkGenerationalId id) {
StartStopToken startStopToken;
Intrinsics.checkNotNullParameter(id, "id");
synchronized (this.lock) {
startStopToken = this.delegate.tokenFor(id);
}
return startStopToken;
}
@Override // androidx.work.impl.StartStopTokens
public StartStopToken remove(WorkGenerationalId id) {
StartStopToken remove;
Intrinsics.checkNotNullParameter(id, "id");
synchronized (this.lock) {
remove = this.delegate.remove(id);
}
return remove;
}
@Override // androidx.work.impl.StartStopTokens
public List<StartStopToken> remove(String workSpecId) {
List<StartStopToken> remove;
Intrinsics.checkNotNullParameter(workSpecId, "workSpecId");
synchronized (this.lock) {
remove = this.delegate.remove(workSpecId);
}
return remove;
}
@Override // androidx.work.impl.StartStopTokens
public boolean contains(WorkGenerationalId id) {
boolean contains;
Intrinsics.checkNotNullParameter(id, "id");
synchronized (this.lock) {
contains = this.delegate.contains(id);
}
return contains;
}
}

View File

@@ -0,0 +1,50 @@
package androidx.work.impl;
import com.google.common.util.concurrent.ListenableFuture;
import java.util.concurrent.ExecutionException;
import kotlin.Result;
import kotlin.ResultKt;
import kotlin.jvm.internal.Intrinsics;
import kotlinx.coroutines.CancellableContinuation;
/* loaded from: classes.dex */
final class ToContinuation<T> implements Runnable {
private final CancellableContinuation continuation;
private final ListenableFuture futureToObserve;
public final CancellableContinuation getContinuation() {
return this.continuation;
}
public final ListenableFuture getFutureToObserve() {
return this.futureToObserve;
}
public ToContinuation(ListenableFuture futureToObserve, CancellableContinuation continuation) {
Intrinsics.checkNotNullParameter(futureToObserve, "futureToObserve");
Intrinsics.checkNotNullParameter(continuation, "continuation");
this.futureToObserve = futureToObserve;
this.continuation = continuation;
}
@Override // java.lang.Runnable
public void run() {
Throwable nonNullCause;
Object uninterruptibly;
if (this.futureToObserve.isCancelled()) {
CancellableContinuation.DefaultImpls.cancel$default(this.continuation, null, 1, null);
return;
}
try {
CancellableContinuation cancellableContinuation = this.continuation;
Result.Companion companion = Result.Companion;
uninterruptibly = WorkerWrapperKt.getUninterruptibly(this.futureToObserve);
cancellableContinuation.resumeWith(Result.m4060constructorimpl(uninterruptibly));
} catch (ExecutionException e) {
CancellableContinuation cancellableContinuation2 = this.continuation;
Result.Companion companion2 = Result.Companion;
nonNullCause = WorkerWrapperKt.nonNullCause(e);
cancellableContinuation2.resumeWith(Result.m4060constructorimpl(ResultKt.createFailure(nonNullCause)));
}
}
}

View File

@@ -0,0 +1,67 @@
package androidx.work.impl;
import androidx.work.Logger;
import com.fyber.inneractive.sdk.bidder.TokenParametersOuterClass$TokenParameters;
import kotlin.ResultKt;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsKt;
import kotlin.coroutines.jvm.internal.Boxing;
import kotlin.coroutines.jvm.internal.DebugMetadata;
import kotlin.coroutines.jvm.internal.SuspendLambda;
import kotlin.jvm.functions.Function4;
import kotlinx.coroutines.DelayKt;
import kotlinx.coroutines.flow.FlowCollector;
@DebugMetadata(c = "androidx.work.impl.UnfinishedWorkListenerKt$maybeLaunchUnfinishedWorkListener$1", f = "UnfinishedWorkListener.kt", l = {TokenParametersOuterClass$TokenParameters.PRIORCLICKS_FIELD_NUMBER}, m = "invokeSuspend")
/* loaded from: classes.dex */
public final class UnfinishedWorkListenerKt$maybeLaunchUnfinishedWorkListener$1 extends SuspendLambda implements Function4 {
/* synthetic */ long J$0;
/* synthetic */ Object L$0;
int label;
public UnfinishedWorkListenerKt$maybeLaunchUnfinishedWorkListener$1(Continuation continuation) {
super(4, continuation);
}
@Override // kotlin.jvm.functions.Function4
public /* bridge */ /* synthetic */ Object invoke(Object obj, Object obj2, Object obj3, Object obj4) {
return invoke((FlowCollector) obj, (Throwable) obj2, ((Number) obj3).longValue(), (Continuation) obj4);
}
public final Object invoke(FlowCollector flowCollector, Throwable th, long j, Continuation continuation) {
UnfinishedWorkListenerKt$maybeLaunchUnfinishedWorkListener$1 unfinishedWorkListenerKt$maybeLaunchUnfinishedWorkListener$1 = new UnfinishedWorkListenerKt$maybeLaunchUnfinishedWorkListener$1(continuation);
unfinishedWorkListenerKt$maybeLaunchUnfinishedWorkListener$1.L$0 = th;
unfinishedWorkListenerKt$maybeLaunchUnfinishedWorkListener$1.J$0 = j;
return unfinishedWorkListenerKt$maybeLaunchUnfinishedWorkListener$1.invokeSuspend(Unit.INSTANCE);
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Object invokeSuspend(Object obj) {
Object coroutine_suspended;
String str;
long j;
coroutine_suspended = IntrinsicsKt__IntrinsicsKt.getCOROUTINE_SUSPENDED();
int i = this.label;
if (i == 0) {
ResultKt.throwOnFailure(obj);
Throwable th = (Throwable) this.L$0;
long j2 = this.J$0;
Logger logger = Logger.get();
str = UnfinishedWorkListenerKt.TAG;
logger.error(str, "Cannot check for unfinished work", th);
j = UnfinishedWorkListenerKt.MAX_DELAY_MS;
long min = Math.min(j2 * 30000, j);
this.label = 1;
if (DelayKt.delay(min, this) == coroutine_suspended) {
return coroutine_suspended;
}
} else {
if (i != 1) {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
ResultKt.throwOnFailure(obj);
}
return Boxing.boxBoolean(true);
}
}

View File

@@ -0,0 +1,53 @@
package androidx.work.impl;
import android.content.Context;
import androidx.work.impl.background.systemalarm.RescheduleReceiver;
import androidx.work.impl.utils.PackageManagerHelper;
import kotlin.ResultKt;
import kotlin.Unit;
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;
@DebugMetadata(c = "androidx.work.impl.UnfinishedWorkListenerKt$maybeLaunchUnfinishedWorkListener$2", f = "UnfinishedWorkListener.kt", l = {}, m = "invokeSuspend")
/* loaded from: classes.dex */
public final class UnfinishedWorkListenerKt$maybeLaunchUnfinishedWorkListener$2 extends SuspendLambda implements Function2 {
final /* synthetic */ Context $appContext;
/* synthetic */ boolean Z$0;
int label;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public UnfinishedWorkListenerKt$maybeLaunchUnfinishedWorkListener$2(Context context, Continuation continuation) {
super(2, continuation);
this.$appContext = context;
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Continuation create(Object obj, Continuation continuation) {
UnfinishedWorkListenerKt$maybeLaunchUnfinishedWorkListener$2 unfinishedWorkListenerKt$maybeLaunchUnfinishedWorkListener$2 = new UnfinishedWorkListenerKt$maybeLaunchUnfinishedWorkListener$2(this.$appContext, continuation);
unfinishedWorkListenerKt$maybeLaunchUnfinishedWorkListener$2.Z$0 = ((Boolean) obj).booleanValue();
return unfinishedWorkListenerKt$maybeLaunchUnfinishedWorkListener$2;
}
@Override // kotlin.jvm.functions.Function2
public /* bridge */ /* synthetic */ Object invoke(Object obj, Object obj2) {
return invoke(((Boolean) obj).booleanValue(), (Continuation) obj2);
}
public final Object invoke(boolean z, Continuation continuation) {
return ((UnfinishedWorkListenerKt$maybeLaunchUnfinishedWorkListener$2) create(Boolean.valueOf(z), continuation)).invokeSuspend(Unit.INSTANCE);
}
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
public final Object invokeSuspend(Object obj) {
IntrinsicsKt__IntrinsicsKt.getCOROUTINE_SUSPENDED();
if (this.label == 0) {
ResultKt.throwOnFailure(obj);
PackageManagerHelper.setComponentEnabled(this.$appContext, RescheduleReceiver.class, this.Z$0);
return Unit.INSTANCE;
}
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
}

View File

@@ -0,0 +1,34 @@
package androidx.work.impl;
import android.content.Context;
import androidx.work.Configuration;
import androidx.work.Logger;
import androidx.work.impl.utils.ProcessUtils;
import java.util.concurrent.TimeUnit;
import kotlin.jvm.internal.Intrinsics;
import kotlinx.coroutines.CoroutineScope;
import kotlinx.coroutines.flow.FlowKt;
/* loaded from: classes.dex */
public final class UnfinishedWorkListenerKt {
private static final int DELAY_MS = 30000;
private static final long MAX_DELAY_MS;
private static final String TAG;
static {
String tagWithPrefix = Logger.tagWithPrefix("UnfinishedWorkListener");
Intrinsics.checkNotNullExpressionValue(tagWithPrefix, "tagWithPrefix(\"UnfinishedWorkListener\")");
TAG = tagWithPrefix;
MAX_DELAY_MS = TimeUnit.HOURS.toMillis(1L);
}
public static final void maybeLaunchUnfinishedWorkListener(CoroutineScope coroutineScope, Context appContext, Configuration configuration, WorkDatabase db) {
Intrinsics.checkNotNullParameter(coroutineScope, "<this>");
Intrinsics.checkNotNullParameter(appContext, "appContext");
Intrinsics.checkNotNullParameter(configuration, "configuration");
Intrinsics.checkNotNullParameter(db, "db");
if (ProcessUtils.isDefaultProcess(appContext, configuration)) {
FlowKt.launchIn(FlowKt.onEach(FlowKt.distinctUntilChanged(FlowKt.conflate(FlowKt.retryWhen(db.workSpecDao().hasUnfinishedWorkFlow(), new UnfinishedWorkListenerKt$maybeLaunchUnfinishedWorkListener$1(null)))), new UnfinishedWorkListenerKt$maybeLaunchUnfinishedWorkListener$2(appContext, null)), coroutineScope);
}
}
}

View File

@@ -0,0 +1,215 @@
package androidx.work.impl;
import android.text.TextUtils;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RestrictTo;
import androidx.lifecycle.LiveData;
import androidx.work.ArrayCreatingInputMerger;
import androidx.work.ExistingWorkPolicy;
import androidx.work.ListenableWorker;
import androidx.work.Logger;
import androidx.work.OneTimeWorkRequest;
import androidx.work.Operation;
import androidx.work.OperationKt;
import androidx.work.WorkContinuation;
import androidx.work.WorkInfo;
import androidx.work.WorkRequest;
import androidx.work.impl.utils.EnqueueRunnable;
import androidx.work.impl.utils.StatusRunnable;
import androidx.work.impl.workers.CombineContinuationsWorker;
import com.google.common.util.concurrent.ListenableFuture;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
/* loaded from: classes.dex */
public class WorkContinuationImpl extends WorkContinuation {
private static final String TAG = Logger.tagWithPrefix("WorkContinuationImpl");
private final List<String> mAllIds;
private boolean mEnqueued;
private final ExistingWorkPolicy mExistingWorkPolicy;
private final List<String> mIds;
private final String mName;
private Operation mOperation;
private final List<WorkContinuationImpl> mParents;
private final List<? extends WorkRequest> mWork;
private final WorkManagerImpl mWorkManagerImpl;
@NonNull
public List<String> getAllIds() {
return this.mAllIds;
}
@NonNull
public ExistingWorkPolicy getExistingWorkPolicy() {
return this.mExistingWorkPolicy;
}
@NonNull
public List<String> getIds() {
return this.mIds;
}
@Nullable
public String getName() {
return this.mName;
}
@Nullable
public List<WorkContinuationImpl> getParents() {
return this.mParents;
}
@NonNull
public List<? extends WorkRequest> getWork() {
return this.mWork;
}
@NonNull
public WorkManagerImpl getWorkManagerImpl() {
return this.mWorkManagerImpl;
}
public boolean isEnqueued() {
return this.mEnqueued;
}
public void markEnqueued() {
this.mEnqueued = true;
}
public WorkContinuationImpl(@NonNull WorkManagerImpl workManagerImpl, @NonNull List<? extends WorkRequest> list) {
this(workManagerImpl, null, ExistingWorkPolicy.KEEP, list, null);
}
public WorkContinuationImpl(@NonNull WorkManagerImpl workManagerImpl, @Nullable String str, @NonNull ExistingWorkPolicy existingWorkPolicy, @NonNull List<? extends WorkRequest> list) {
this(workManagerImpl, str, existingWorkPolicy, list, null);
}
public WorkContinuationImpl(@NonNull WorkManagerImpl workManagerImpl, @Nullable String str, @NonNull ExistingWorkPolicy existingWorkPolicy, @NonNull List<? extends WorkRequest> list, @Nullable List<WorkContinuationImpl> list2) {
this.mWorkManagerImpl = workManagerImpl;
this.mName = str;
this.mExistingWorkPolicy = existingWorkPolicy;
this.mWork = list;
this.mParents = list2;
this.mIds = new ArrayList(list.size());
this.mAllIds = new ArrayList();
if (list2 != null) {
Iterator<WorkContinuationImpl> it = list2.iterator();
while (it.hasNext()) {
this.mAllIds.addAll(it.next().mAllIds);
}
}
for (int i = 0; i < list.size(); i++) {
if (existingWorkPolicy == ExistingWorkPolicy.REPLACE && list.get(i).getWorkSpec().getNextScheduleTimeOverride() != Long.MAX_VALUE) {
throw new IllegalArgumentException("Next Schedule Time Override must be used with ExistingPeriodicWorkPolicyUPDATE (preferably) or KEEP");
}
String stringId = list.get(i).getStringId();
this.mIds.add(stringId);
this.mAllIds.add(stringId);
}
}
@Override // androidx.work.WorkContinuation
@NonNull
public WorkContinuation then(@NonNull List<OneTimeWorkRequest> list) {
return list.isEmpty() ? this : new WorkContinuationImpl(this.mWorkManagerImpl, this.mName, ExistingWorkPolicy.KEEP, list, Collections.singletonList(this));
}
@Override // androidx.work.WorkContinuation
@NonNull
public LiveData<List<WorkInfo>> getWorkInfosLiveData() {
return this.mWorkManagerImpl.getWorkInfosById(this.mAllIds);
}
@Override // androidx.work.WorkContinuation
@NonNull
public ListenableFuture getWorkInfos() {
return StatusRunnable.forStringIds(this.mWorkManagerImpl.getWorkDatabase(), this.mWorkManagerImpl.getWorkTaskExecutor(), this.mAllIds);
}
@Override // androidx.work.WorkContinuation
@NonNull
public Operation enqueue() {
if (!this.mEnqueued) {
this.mOperation = OperationKt.launchOperation(this.mWorkManagerImpl.getConfiguration().getTracer(), "EnqueueRunnable_" + getExistingWorkPolicy().name(), this.mWorkManagerImpl.getWorkTaskExecutor().getSerialTaskExecutor(), new Function0() { // from class: androidx.work.impl.WorkContinuationImpl$$ExternalSyntheticLambda0
@Override // kotlin.jvm.functions.Function0
public final Object invoke() {
Unit lambda$enqueue$0;
lambda$enqueue$0 = WorkContinuationImpl.this.lambda$enqueue$0();
return lambda$enqueue$0;
}
});
} else {
Logger.get().warning(TAG, "Already enqueued work ids (" + TextUtils.join(", ", this.mIds) + ")");
}
return this.mOperation;
}
/* JADX INFO: Access modifiers changed from: private */
public /* synthetic */ Unit lambda$enqueue$0() {
EnqueueRunnable.enqueue(this);
return Unit.INSTANCE;
}
@Override // androidx.work.WorkContinuation
@NonNull
public WorkContinuation combineInternal(@NonNull List<WorkContinuation> list) {
OneTimeWorkRequest build = new OneTimeWorkRequest.Builder((Class<? extends ListenableWorker>) CombineContinuationsWorker.class).setInputMerger(ArrayCreatingInputMerger.class).build();
ArrayList arrayList = new ArrayList(list.size());
Iterator<WorkContinuation> it = list.iterator();
while (it.hasNext()) {
arrayList.add((WorkContinuationImpl) it.next());
}
return new WorkContinuationImpl(this.mWorkManagerImpl, null, ExistingWorkPolicy.KEEP, Collections.singletonList(build), arrayList);
}
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
public boolean hasCycles() {
return hasCycles(this, new HashSet());
}
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
private static boolean hasCycles(@NonNull WorkContinuationImpl workContinuationImpl, @NonNull Set<String> set) {
set.addAll(workContinuationImpl.getIds());
Set<String> prerequisitesFor = prerequisitesFor(workContinuationImpl);
Iterator<String> it = set.iterator();
while (it.hasNext()) {
if (prerequisitesFor.contains(it.next())) {
return true;
}
}
List<WorkContinuationImpl> parents = workContinuationImpl.getParents();
if (parents != null && !parents.isEmpty()) {
Iterator<WorkContinuationImpl> it2 = parents.iterator();
while (it2.hasNext()) {
if (hasCycles(it2.next(), set)) {
return true;
}
}
}
set.removeAll(workContinuationImpl.getIds());
return false;
}
@NonNull
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
public static Set<String> prerequisitesFor(@NonNull WorkContinuationImpl workContinuationImpl) {
HashSet hashSet = new HashSet();
List<WorkContinuationImpl> parents = workContinuationImpl.getParents();
if (parents != null && !parents.isEmpty()) {
Iterator<WorkContinuationImpl> it = parents.iterator();
while (it.hasNext()) {
hashSet.addAll(it.next().getIds());
}
}
return hashSet;
}
}

View File

@@ -0,0 +1,98 @@
package androidx.work.impl;
import android.content.Context;
import androidx.annotation.RestrictTo;
import androidx.room.AutoMigration;
import androidx.room.Database;
import androidx.room.Room;
import androidx.room.RoomDatabase;
import androidx.room.TypeConverters;
import androidx.sqlite.db.SupportSQLiteOpenHelper;
import androidx.sqlite.db.framework.FrameworkSQLiteOpenHelperFactory;
import androidx.work.Clock;
import androidx.work.Data;
import androidx.work.impl.WorkDatabase;
import androidx.work.impl.model.Dependency;
import androidx.work.impl.model.DependencyDao;
import androidx.work.impl.model.Preference;
import androidx.work.impl.model.PreferenceDao;
import androidx.work.impl.model.RawWorkInfoDao;
import androidx.work.impl.model.SystemIdInfo;
import androidx.work.impl.model.SystemIdInfoDao;
import androidx.work.impl.model.WorkName;
import androidx.work.impl.model.WorkNameDao;
import androidx.work.impl.model.WorkProgress;
import androidx.work.impl.model.WorkProgressDao;
import androidx.work.impl.model.WorkSpec;
import androidx.work.impl.model.WorkSpecDao;
import androidx.work.impl.model.WorkTag;
import androidx.work.impl.model.WorkTagDao;
import androidx.work.impl.model.WorkTypeConverters;
import java.util.concurrent.Executor;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
@TypeConverters({Data.class, WorkTypeConverters.class})
@Database(autoMigrations = {@AutoMigration(from = 13, to = 14), @AutoMigration(from = 14, spec = AutoMigration_14_15.class, to = 15), @AutoMigration(from = 16, to = 17), @AutoMigration(from = 17, to = 18), @AutoMigration(from = 18, to = 19), @AutoMigration(from = 19, spec = AutoMigration_19_20.class, to = 20), @AutoMigration(from = 20, to = 21), @AutoMigration(from = 22, to = 23)}, entities = {Dependency.class, WorkSpec.class, WorkTag.class, SystemIdInfo.class, WorkName.class, WorkProgress.class, Preference.class}, version = 23)
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
/* loaded from: classes.dex */
public abstract class WorkDatabase extends RoomDatabase {
public static final Companion Companion = new Companion(null);
public static final WorkDatabase create(Context context, Executor executor, Clock clock, boolean z) {
return Companion.create(context, executor, clock, z);
}
public abstract DependencyDao dependencyDao();
public abstract PreferenceDao preferenceDao();
public abstract RawWorkInfoDao rawWorkInfoDao();
public abstract SystemIdInfoDao systemIdInfoDao();
public abstract WorkNameDao workNameDao();
public abstract WorkProgressDao workProgressDao();
public abstract WorkSpecDao workSpecDao();
public abstract WorkTagDao workTagDao();
public static final class Companion {
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
public final WorkDatabase create(final Context context, Executor queryExecutor, Clock clock, boolean z) {
RoomDatabase.Builder openHelperFactory;
Intrinsics.checkNotNullParameter(context, "context");
Intrinsics.checkNotNullParameter(queryExecutor, "queryExecutor");
Intrinsics.checkNotNullParameter(clock, "clock");
if (z) {
openHelperFactory = Room.inMemoryDatabaseBuilder(context, WorkDatabase.class).allowMainThreadQueries();
} else {
openHelperFactory = Room.databaseBuilder(context, WorkDatabase.class, WorkDatabasePathHelperKt.WORK_DATABASE_NAME).openHelperFactory(new SupportSQLiteOpenHelper.Factory() { // from class: androidx.work.impl.WorkDatabase$Companion$$ExternalSyntheticLambda0
@Override // androidx.sqlite.db.SupportSQLiteOpenHelper.Factory
public final SupportSQLiteOpenHelper create(SupportSQLiteOpenHelper.Configuration configuration) {
SupportSQLiteOpenHelper create$lambda$0;
create$lambda$0 = WorkDatabase.Companion.create$lambda$0(context, configuration);
return create$lambda$0;
}
});
}
return (WorkDatabase) openHelperFactory.setQueryExecutor(queryExecutor).addCallback(new CleanupCallback(clock)).addMigrations(Migration_1_2.INSTANCE).addMigrations(new RescheduleMigration(context, 2, 3)).addMigrations(Migration_3_4.INSTANCE).addMigrations(Migration_4_5.INSTANCE).addMigrations(new RescheduleMigration(context, 5, 6)).addMigrations(Migration_6_7.INSTANCE).addMigrations(Migration_7_8.INSTANCE).addMigrations(Migration_8_9.INSTANCE).addMigrations(new WorkMigration9To10(context)).addMigrations(new RescheduleMigration(context, 10, 11)).addMigrations(Migration_11_12.INSTANCE).addMigrations(Migration_12_13.INSTANCE).addMigrations(Migration_15_16.INSTANCE).addMigrations(Migration_16_17.INSTANCE).addMigrations(new RescheduleMigration(context, 21, 22)).fallbackToDestructiveMigration().build();
}
/* JADX INFO: Access modifiers changed from: private */
public static final SupportSQLiteOpenHelper create$lambda$0(Context context, SupportSQLiteOpenHelper.Configuration configuration) {
Intrinsics.checkNotNullParameter(configuration, "configuration");
SupportSQLiteOpenHelper.Configuration.Builder builder = SupportSQLiteOpenHelper.Configuration.Companion.builder(context);
builder.name(configuration.name).callback(configuration.callback).noBackupDirectory(true).allowDataLossOnRecovery(true);
return new FrameworkSQLiteOpenHelperFactory().create(builder.build());
}
}
}

View File

@@ -0,0 +1,10 @@
package androidx.work.impl;
import java.util.concurrent.TimeUnit;
/* loaded from: classes.dex */
public final class WorkDatabaseKt {
private static final String PRUNE_SQL_FORMAT_PREFIX = "DELETE FROM workspec WHERE state IN (2, 3, 5) AND (last_enqueue_time + minimum_retention_duration) < ";
private static final String PRUNE_SQL_FORMAT_SUFFIX = " AND (SELECT COUNT(*)=0 FROM dependency WHERE prerequisite_id=id AND work_spec_id NOT IN (SELECT id FROM workspec WHERE state IN (2, 3, 5)))";
public static final long PRUNE_THRESHOLD_MILLIS = TimeUnit.DAYS.toMillis(1);
}

View File

@@ -0,0 +1,18 @@
package androidx.work.impl;
/* loaded from: classes.dex */
public final class WorkDatabaseMigrationsKt {
private static final String CREATE_INDEX_PERIOD_START_TIME = "\n CREATE INDEX IF NOT EXISTS `index_WorkSpec_period_start_time` ON `workspec`(`period_start_time`)\n ";
private static final String CREATE_OUT_OF_QUOTA_POLICY = "ALTER TABLE workspec ADD COLUMN `out_of_quota_policy` INTEGER NOT NULL DEFAULT 0";
private static final String CREATE_RUN_IN_FOREGROUND = "ALTER TABLE workspec ADD COLUMN `run_in_foreground` INTEGER NOT NULL DEFAULT 0";
private static final String CREATE_SYSTEM_ID_INFO = "\n CREATE TABLE IF NOT EXISTS `SystemIdInfo` (`work_spec_id` TEXT NOT NULL, `system_id`\n INTEGER NOT NULL, PRIMARY KEY(`work_spec_id`), FOREIGN KEY(`work_spec_id`)\n REFERENCES `WorkSpec`(`id`) ON UPDATE CASCADE ON DELETE CASCADE )\n ";
private static final String CREATE_WORK_PROGRESS = "\n CREATE TABLE IF NOT EXISTS `WorkProgress` (`work_spec_id` TEXT NOT NULL, `progress`\n BLOB NOT NULL, PRIMARY KEY(`work_spec_id`), FOREIGN KEY(`work_spec_id`)\n REFERENCES `WorkSpec`(`id`) ON UPDATE CASCADE ON DELETE CASCADE )\n ";
private static final String INITIALIZE_PERIOD_COUNTER = "UPDATE workspec SET period_count = 1 WHERE last_enqueue_time <> 0 AND interval_duration <> 0";
private static final String MIGRATE_ALARM_INFO_TO_SYSTEM_ID_INFO = "\n INSERT INTO SystemIdInfo(work_spec_id, system_id)\n SELECT work_spec_id, alarm_id AS system_id FROM alarmInfo\n ";
private static final String PERIODIC_WORK_SET_SCHEDULE_REQUESTED_AT = "\n UPDATE workspec SET schedule_requested_at = 0\n WHERE state NOT IN (2, 3, 5)\n AND schedule_requested_at = -1\n AND interval_duration <> 0\n ";
private static final String REMOVE_ALARM_INFO = "DROP TABLE IF EXISTS alarmInfo";
private static final String SET_DEFAULT_CONTENT_URI_TRIGGERS = "UPDATE workspec SET content_uri_triggers = x'' WHERE content_uri_triggers is NULL";
private static final String SET_DEFAULT_NETWORK_TYPE = "UPDATE workspec SET required_network_type = 0 WHERE required_network_type IS NULL ";
private static final String WORKSPEC_ADD_TRIGGER_MAX_CONTENT_DELAY = "ALTER TABLE workspec ADD COLUMN `trigger_max_content_delay` INTEGER NOT NULL DEFAULT -1";
private static final String WORKSPEC_ADD_TRIGGER_UPDATE_DELAY = "ALTER TABLE workspec ADD COLUMN `trigger_content_update_delay` INTEGER NOT NULL DEFAULT -1";
}

View File

@@ -0,0 +1,91 @@
package androidx.work.impl;
import android.content.Context;
import androidx.annotation.RequiresApi;
import androidx.annotation.RestrictTo;
import androidx.work.Logger;
import java.io.File;
import java.util.LinkedHashMap;
import java.util.Map;
import kotlin.Pair;
import kotlin.TuplesKt;
import kotlin.collections.MapsKt__MapsJVMKt;
import kotlin.collections.MapsKt__MapsKt;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.SourceDebugExtension;
import kotlin.ranges.RangesKt___RangesKt;
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP})
@SourceDebugExtension({"SMAP\nWorkDatabasePathHelper.kt\nKotlin\n*S Kotlin\n*F\n+ 1 WorkDatabasePathHelper.kt\nandroidx/work/impl/WorkDatabasePathHelper\n+ 2 _Maps.kt\nkotlin/collections/MapsKt___MapsKt\n+ 3 _Arrays.kt\nkotlin/collections/ArraysKt___ArraysKt\n*L\n1#1,122:1\n215#2,2:123\n8676#3,2:125\n9358#3,4:127\n*S KotlinDebug\n*F\n+ 1 WorkDatabasePathHelper.kt\nandroidx/work/impl/WorkDatabasePathHelper\n*L\n46#1:123,2\n75#1:125,2\n75#1:127,4\n*E\n"})
/* loaded from: classes.dex */
public final class WorkDatabasePathHelper {
public static final WorkDatabasePathHelper INSTANCE = new WorkDatabasePathHelper();
private WorkDatabasePathHelper() {
}
public static final void migrateDatabase(Context context) {
String str;
String str2;
String str3;
Intrinsics.checkNotNullParameter(context, "context");
WorkDatabasePathHelper workDatabasePathHelper = INSTANCE;
if (workDatabasePathHelper.getDefaultDatabasePath(context).exists()) {
Logger logger = Logger.get();
str = WorkDatabasePathHelperKt.TAG;
logger.debug(str, "Migrating WorkDatabase to the no-backup directory");
for (Map.Entry<File, File> entry : workDatabasePathHelper.migrationPaths(context).entrySet()) {
File key = entry.getKey();
File value = entry.getValue();
if (key.exists()) {
if (value.exists()) {
Logger logger2 = Logger.get();
str3 = WorkDatabasePathHelperKt.TAG;
logger2.warning(str3, "Over-writing contents of " + value);
}
String str4 = key.renameTo(value) ? "Migrated " + key + "to " + value : "Renaming " + key + " to " + value + " failed";
Logger logger3 = Logger.get();
str2 = WorkDatabasePathHelperKt.TAG;
logger3.debug(str2, str4);
}
}
}
}
public final Map<File, File> migrationPaths(Context context) {
String[] strArr;
int mapCapacity;
int coerceAtLeast;
Map<File, File> plus;
Intrinsics.checkNotNullParameter(context, "context");
File defaultDatabasePath = getDefaultDatabasePath(context);
File databasePath = getDatabasePath(context);
strArr = WorkDatabasePathHelperKt.DATABASE_EXTRA_FILES;
mapCapacity = MapsKt__MapsJVMKt.mapCapacity(strArr.length);
coerceAtLeast = RangesKt___RangesKt.coerceAtLeast(mapCapacity, 16);
LinkedHashMap linkedHashMap = new LinkedHashMap(coerceAtLeast);
for (String str : strArr) {
Pair pair = TuplesKt.to(new File(defaultDatabasePath.getPath() + str), new File(databasePath.getPath() + str));
linkedHashMap.put(pair.getFirst(), pair.getSecond());
}
plus = MapsKt__MapsKt.plus(linkedHashMap, TuplesKt.to(defaultDatabasePath, databasePath));
return plus;
}
public final File getDefaultDatabasePath(Context context) {
Intrinsics.checkNotNullParameter(context, "context");
File databasePath = context.getDatabasePath(WorkDatabasePathHelperKt.WORK_DATABASE_NAME);
Intrinsics.checkNotNullExpressionValue(databasePath, "context.getDatabasePath(WORK_DATABASE_NAME)");
return databasePath;
}
public final File getDatabasePath(Context context) {
Intrinsics.checkNotNullParameter(context, "context");
return getNoBackupPath(context);
}
@RequiresApi(23)
private final File getNoBackupPath(Context context) {
return new File(Api21Impl.INSTANCE.getNoBackupFilesDir(context), WorkDatabasePathHelperKt.WORK_DATABASE_NAME);
}
}

View File

@@ -0,0 +1,18 @@
package androidx.work.impl;
import androidx.work.Logger;
import kotlin.jvm.internal.Intrinsics;
/* loaded from: classes.dex */
public final class WorkDatabasePathHelperKt {
private static final String[] DATABASE_EXTRA_FILES;
private static final String TAG;
public static final String WORK_DATABASE_NAME = "androidx.work.workdb";
static {
String tagWithPrefix = Logger.tagWithPrefix("WrkDbPathHelper");
Intrinsics.checkNotNullExpressionValue(tagWithPrefix, "tagWithPrefix(\"WrkDbPathHelper\")");
TAG = tagWithPrefix;
DATABASE_EXTRA_FILES = new String[]{"-journal", "-shm", "-wal"};
}
}

View File

@@ -0,0 +1,34 @@
package androidx.work.impl;
/* loaded from: classes.dex */
public final class WorkDatabaseVersions {
public static final WorkDatabaseVersions INSTANCE = new WorkDatabaseVersions();
public static final int VERSION_1 = 1;
public static final int VERSION_10 = 10;
public static final int VERSION_11 = 11;
public static final int VERSION_12 = 12;
public static final int VERSION_13 = 13;
public static final int VERSION_14 = 14;
public static final int VERSION_15 = 15;
public static final int VERSION_16 = 16;
public static final int VERSION_17 = 17;
public static final int VERSION_18 = 18;
public static final int VERSION_19 = 19;
public static final int VERSION_2 = 2;
public static final int VERSION_20 = 20;
public static final int VERSION_21 = 21;
public static final int VERSION_22 = 22;
public static final int VERSION_3 = 3;
public static final int VERSION_4 = 4;
public static final int VERSION_5 = 5;
public static final int VERSION_6 = 6;
public static final int VERSION_7 = 7;
public static final int VERSION_8 = 8;
public static final int VERSION_9 = 9;
public static /* synthetic */ void getVERSION_18$annotations() {
}
private WorkDatabaseVersions() {
}
}

View File

@@ -0,0 +1,22 @@
package androidx.work.impl;
import androidx.annotation.NonNull;
import androidx.room.migration.Migration;
import androidx.sqlite.db.SupportSQLiteDatabase;
/* loaded from: classes.dex */
final class WorkDatabase_AutoMigration_13_14_Impl extends Migration {
public WorkDatabase_AutoMigration_13_14_Impl() {
super(13, 14);
}
@Override // androidx.room.migration.Migration
public void migrate(@NonNull SupportSQLiteDatabase supportSQLiteDatabase) {
supportSQLiteDatabase.execSQL("CREATE TABLE IF NOT EXISTS `_new_WorkSpec` (`id` TEXT NOT NULL, `state` INTEGER NOT NULL, `worker_class_name` TEXT NOT NULL, `input_merger_class_name` TEXT, `input` BLOB NOT NULL, `output` BLOB NOT NULL, `initial_delay` INTEGER NOT NULL, `interval_duration` INTEGER NOT NULL, `flex_duration` INTEGER NOT NULL, `run_attempt_count` INTEGER NOT NULL, `backoff_policy` INTEGER NOT NULL, `backoff_delay_duration` INTEGER NOT NULL, `period_start_time` INTEGER NOT NULL, `minimum_retention_duration` INTEGER NOT NULL, `schedule_requested_at` INTEGER NOT NULL, `run_in_foreground` INTEGER NOT NULL, `out_of_quota_policy` INTEGER NOT NULL, `required_network_type` INTEGER NOT NULL, `requires_charging` INTEGER NOT NULL, `requires_device_idle` INTEGER NOT NULL, `requires_battery_not_low` INTEGER NOT NULL, `requires_storage_not_low` INTEGER NOT NULL, `trigger_content_update_delay` INTEGER NOT NULL, `trigger_max_content_delay` INTEGER NOT NULL, `content_uri_triggers` BLOB NOT NULL, PRIMARY KEY(`id`))");
supportSQLiteDatabase.execSQL("INSERT INTO `_new_WorkSpec` (`id`,`state`,`worker_class_name`,`input_merger_class_name`,`input`,`output`,`initial_delay`,`interval_duration`,`flex_duration`,`run_attempt_count`,`backoff_policy`,`backoff_delay_duration`,`period_start_time`,`minimum_retention_duration`,`schedule_requested_at`,`run_in_foreground`,`out_of_quota_policy`,`required_network_type`,`requires_charging`,`requires_device_idle`,`requires_battery_not_low`,`requires_storage_not_low`,`trigger_content_update_delay`,`trigger_max_content_delay`,`content_uri_triggers`) SELECT `id`,`state`,`worker_class_name`,`input_merger_class_name`,`input`,`output`,`initial_delay`,`interval_duration`,`flex_duration`,`run_attempt_count`,`backoff_policy`,`backoff_delay_duration`,`period_start_time`,`minimum_retention_duration`,`schedule_requested_at`,`run_in_foreground`,`out_of_quota_policy`,`required_network_type`,`requires_charging`,`requires_device_idle`,`requires_battery_not_low`,`requires_storage_not_low`,`trigger_content_update_delay`,`trigger_max_content_delay`,`content_uri_triggers` FROM `WorkSpec`");
supportSQLiteDatabase.execSQL("DROP TABLE `WorkSpec`");
supportSQLiteDatabase.execSQL("ALTER TABLE `_new_WorkSpec` RENAME TO `WorkSpec`");
supportSQLiteDatabase.execSQL("CREATE INDEX IF NOT EXISTS `index_WorkSpec_schedule_requested_at` ON `WorkSpec` (`schedule_requested_at`)");
supportSQLiteDatabase.execSQL("CREATE INDEX IF NOT EXISTS `index_WorkSpec_period_start_time` ON `WorkSpec` (`period_start_time`)");
}
}

View File

@@ -0,0 +1,27 @@
package androidx.work.impl;
import androidx.annotation.NonNull;
import androidx.room.migration.AutoMigrationSpec;
import androidx.room.migration.Migration;
import androidx.sqlite.db.SupportSQLiteDatabase;
/* loaded from: classes.dex */
final class WorkDatabase_AutoMigration_14_15_Impl extends Migration {
private final AutoMigrationSpec callback;
public WorkDatabase_AutoMigration_14_15_Impl() {
super(14, 15);
this.callback = new AutoMigration_14_15();
}
@Override // androidx.room.migration.Migration
public void migrate(@NonNull SupportSQLiteDatabase supportSQLiteDatabase) {
supportSQLiteDatabase.execSQL("CREATE TABLE IF NOT EXISTS `_new_WorkSpec` (`id` TEXT NOT NULL, `state` INTEGER NOT NULL, `worker_class_name` TEXT NOT NULL, `input_merger_class_name` TEXT, `input` BLOB NOT NULL, `output` BLOB NOT NULL, `initial_delay` INTEGER NOT NULL, `interval_duration` INTEGER NOT NULL, `flex_duration` INTEGER NOT NULL, `run_attempt_count` INTEGER NOT NULL, `backoff_policy` INTEGER NOT NULL, `backoff_delay_duration` INTEGER NOT NULL, `last_enqueue_time` INTEGER NOT NULL, `minimum_retention_duration` INTEGER NOT NULL, `schedule_requested_at` INTEGER NOT NULL, `run_in_foreground` INTEGER NOT NULL, `out_of_quota_policy` INTEGER NOT NULL, `period_count` INTEGER NOT NULL DEFAULT 0, `required_network_type` INTEGER NOT NULL, `requires_charging` INTEGER NOT NULL, `requires_device_idle` INTEGER NOT NULL, `requires_battery_not_low` INTEGER NOT NULL, `requires_storage_not_low` INTEGER NOT NULL, `trigger_content_update_delay` INTEGER NOT NULL, `trigger_max_content_delay` INTEGER NOT NULL, `content_uri_triggers` BLOB NOT NULL, PRIMARY KEY(`id`))");
supportSQLiteDatabase.execSQL("INSERT INTO `_new_WorkSpec` (`id`,`state`,`worker_class_name`,`input_merger_class_name`,`input`,`output`,`initial_delay`,`interval_duration`,`flex_duration`,`run_attempt_count`,`backoff_policy`,`backoff_delay_duration`,`last_enqueue_time`,`minimum_retention_duration`,`schedule_requested_at`,`run_in_foreground`,`out_of_quota_policy`,`required_network_type`,`requires_charging`,`requires_device_idle`,`requires_battery_not_low`,`requires_storage_not_low`,`trigger_content_update_delay`,`trigger_max_content_delay`,`content_uri_triggers`) SELECT `id`,`state`,`worker_class_name`,`input_merger_class_name`,`input`,`output`,`initial_delay`,`interval_duration`,`flex_duration`,`run_attempt_count`,`backoff_policy`,`backoff_delay_duration`,`period_start_time`,`minimum_retention_duration`,`schedule_requested_at`,`run_in_foreground`,`out_of_quota_policy`,`required_network_type`,`requires_charging`,`requires_device_idle`,`requires_battery_not_low`,`requires_storage_not_low`,`trigger_content_update_delay`,`trigger_max_content_delay`,`content_uri_triggers` FROM `WorkSpec`");
supportSQLiteDatabase.execSQL("DROP TABLE `WorkSpec`");
supportSQLiteDatabase.execSQL("ALTER TABLE `_new_WorkSpec` RENAME TO `WorkSpec`");
supportSQLiteDatabase.execSQL("CREATE INDEX IF NOT EXISTS `index_WorkSpec_schedule_requested_at` ON `WorkSpec` (`schedule_requested_at`)");
supportSQLiteDatabase.execSQL("CREATE INDEX IF NOT EXISTS `index_WorkSpec_last_enqueue_time` ON `WorkSpec` (`last_enqueue_time`)");
this.callback.onPostMigrate(supportSQLiteDatabase);
}
}

View File

@@ -0,0 +1,22 @@
package androidx.work.impl;
import androidx.annotation.NonNull;
import androidx.room.migration.Migration;
import androidx.sqlite.db.SupportSQLiteDatabase;
/* loaded from: classes.dex */
final class WorkDatabase_AutoMigration_16_17_Impl extends Migration {
public WorkDatabase_AutoMigration_16_17_Impl() {
super(16, 17);
}
@Override // androidx.room.migration.Migration
public void migrate(@NonNull SupportSQLiteDatabase supportSQLiteDatabase) {
supportSQLiteDatabase.execSQL("CREATE TABLE IF NOT EXISTS `_new_WorkSpec` (`id` TEXT NOT NULL, `state` INTEGER NOT NULL, `worker_class_name` TEXT NOT NULL, `input_merger_class_name` TEXT NOT NULL, `input` BLOB NOT NULL, `output` BLOB NOT NULL, `initial_delay` INTEGER NOT NULL, `interval_duration` INTEGER NOT NULL, `flex_duration` INTEGER NOT NULL, `run_attempt_count` INTEGER NOT NULL, `backoff_policy` INTEGER NOT NULL, `backoff_delay_duration` INTEGER NOT NULL, `last_enqueue_time` INTEGER NOT NULL, `minimum_retention_duration` INTEGER NOT NULL, `schedule_requested_at` INTEGER NOT NULL, `run_in_foreground` INTEGER NOT NULL, `out_of_quota_policy` INTEGER NOT NULL, `period_count` INTEGER NOT NULL DEFAULT 0, `generation` INTEGER NOT NULL DEFAULT 0, `required_network_type` INTEGER NOT NULL, `requires_charging` INTEGER NOT NULL, `requires_device_idle` INTEGER NOT NULL, `requires_battery_not_low` INTEGER NOT NULL, `requires_storage_not_low` INTEGER NOT NULL, `trigger_content_update_delay` INTEGER NOT NULL, `trigger_max_content_delay` INTEGER NOT NULL, `content_uri_triggers` BLOB NOT NULL, PRIMARY KEY(`id`))");
supportSQLiteDatabase.execSQL("INSERT INTO `_new_WorkSpec` (`id`,`state`,`worker_class_name`,`input_merger_class_name`,`input`,`output`,`initial_delay`,`interval_duration`,`flex_duration`,`run_attempt_count`,`backoff_policy`,`backoff_delay_duration`,`last_enqueue_time`,`minimum_retention_duration`,`schedule_requested_at`,`run_in_foreground`,`out_of_quota_policy`,`period_count`,`generation`,`required_network_type`,`requires_charging`,`requires_device_idle`,`requires_battery_not_low`,`requires_storage_not_low`,`trigger_content_update_delay`,`trigger_max_content_delay`,`content_uri_triggers`) SELECT `id`,`state`,`worker_class_name`,`input_merger_class_name`,`input`,`output`,`initial_delay`,`interval_duration`,`flex_duration`,`run_attempt_count`,`backoff_policy`,`backoff_delay_duration`,`last_enqueue_time`,`minimum_retention_duration`,`schedule_requested_at`,`run_in_foreground`,`out_of_quota_policy`,`period_count`,`generation`,`required_network_type`,`requires_charging`,`requires_device_idle`,`requires_battery_not_low`,`requires_storage_not_low`,`trigger_content_update_delay`,`trigger_max_content_delay`,`content_uri_triggers` FROM `WorkSpec`");
supportSQLiteDatabase.execSQL("DROP TABLE `WorkSpec`");
supportSQLiteDatabase.execSQL("ALTER TABLE `_new_WorkSpec` RENAME TO `WorkSpec`");
supportSQLiteDatabase.execSQL("CREATE INDEX IF NOT EXISTS `index_WorkSpec_schedule_requested_at` ON `WorkSpec` (`schedule_requested_at`)");
supportSQLiteDatabase.execSQL("CREATE INDEX IF NOT EXISTS `index_WorkSpec_last_enqueue_time` ON `WorkSpec` (`last_enqueue_time`)");
}
}

Some files were not shown because too many files have changed in this diff Show More