ADD week 5
This commit is contained in:
@ -0,0 +1,81 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import android.os.Bundle;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.lifecycle.viewmodel.CreationExtras;
|
||||
import androidx.savedstate.SavedStateRegistry;
|
||||
import androidx.savedstate.SavedStateRegistryOwner;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: AbstractSavedStateViewModelFactory.kt */
|
||||
@Metadata(d1 = {"\u0000Z\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0003\b&\u0018\u0000 \u001f2\u00020\u00012\u00020\u0002:\u0001\u001fB\u0007\b\u0016¢\u0006\u0002\u0010\u0003B\u0019\b\u0016\u0012\u0006\u0010\u0004\u001a\u00020\u0005\u0012\b\u0010\u0006\u001a\u0004\u0018\u00010\u0007¢\u0006\u0002\u0010\bJ%\u0010\r\u001a\u0002H\u000e\"\b\b\u0000\u0010\u000e*\u00020\u000f2\f\u0010\u0010\u001a\b\u0012\u0004\u0012\u0002H\u000e0\u0011H\u0016¢\u0006\u0002\u0010\u0012J-\u0010\r\u001a\u0002H\u000e\"\b\b\u0000\u0010\u000e*\u00020\u000f2\f\u0010\u0010\u001a\b\u0012\u0004\u0012\u0002H\u000e0\u00112\u0006\u0010\u0013\u001a\u00020\u0014H\u0016¢\u0006\u0002\u0010\u0015J-\u0010\r\u001a\u0002H\u000e\"\b\b\u0000\u0010\u000e*\u00020\u000f2\u0006\u0010\u0016\u001a\u00020\u00172\f\u0010\u0010\u001a\b\u0012\u0004\u0012\u0002H\u000e0\u0011H\u0002¢\u0006\u0002\u0010\u0018J5\u0010\r\u001a\u0002H\u000e\"\b\b\u0000\u0010\u000e*\u00020\u000f2\u0006\u0010\u0016\u001a\u00020\u00172\f\u0010\u0010\u001a\b\u0012\u0004\u0012\u0002H\u000e0\u00112\u0006\u0010\u0019\u001a\u00020\u001aH$¢\u0006\u0002\u0010\u001bJ\u0010\u0010\u001c\u001a\u00020\u001d2\u0006\u0010\u001e\u001a\u00020\u000fH\u0017R\u0010\u0010\u0006\u001a\u0004\u0018\u00010\u0007X\u0082\u000e¢\u0006\u0002\n\u0000R\u0010\u0010\t\u001a\u0004\u0018\u00010\nX\u0082\u000e¢\u0006\u0002\n\u0000R\u0010\u0010\u000b\u001a\u0004\u0018\u00010\fX\u0082\u000e¢\u0006\u0002\n\u0000¨\u0006 "}, d2 = {"Landroidx/lifecycle/AbstractSavedStateViewModelFactory;", "Landroidx/lifecycle/ViewModelProvider$OnRequeryFactory;", "Landroidx/lifecycle/ViewModelProvider$Factory;", "()V", "owner", "Landroidx/savedstate/SavedStateRegistryOwner;", "defaultArgs", "Landroid/os/Bundle;", "(Landroidx/savedstate/SavedStateRegistryOwner;Landroid/os/Bundle;)V", "lifecycle", "Landroidx/lifecycle/Lifecycle;", "savedStateRegistry", "Landroidx/savedstate/SavedStateRegistry;", "create", "T", "Landroidx/lifecycle/ViewModel;", "modelClass", "Ljava/lang/Class;", "(Ljava/lang/Class;)Landroidx/lifecycle/ViewModel;", "extras", "Landroidx/lifecycle/viewmodel/CreationExtras;", "(Ljava/lang/Class;Landroidx/lifecycle/viewmodel/CreationExtras;)Landroidx/lifecycle/ViewModel;", "key", "", "(Ljava/lang/String;Ljava/lang/Class;)Landroidx/lifecycle/ViewModel;", "handle", "Landroidx/lifecycle/SavedStateHandle;", "(Ljava/lang/String;Ljava/lang/Class;Landroidx/lifecycle/SavedStateHandle;)Landroidx/lifecycle/ViewModel;", "onRequery", "", "viewModel", "Companion", "lifecycle-viewmodel-savedstate_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class AbstractSavedStateViewModelFactory extends ViewModelProvider.OnRequeryFactory implements ViewModelProvider.Factory {
|
||||
public static final String TAG_SAVED_STATE_HANDLE_CONTROLLER = "androidx.lifecycle.savedstate.vm.tag";
|
||||
private Bundle defaultArgs;
|
||||
private Lifecycle lifecycle;
|
||||
private SavedStateRegistry savedStateRegistry;
|
||||
|
||||
protected abstract <T extends ViewModel> T create(String key, Class<T> modelClass, SavedStateHandle handle);
|
||||
|
||||
public AbstractSavedStateViewModelFactory() {
|
||||
}
|
||||
|
||||
public AbstractSavedStateViewModelFactory(SavedStateRegistryOwner owner, Bundle bundle) {
|
||||
Intrinsics.checkNotNullParameter(owner, "owner");
|
||||
this.savedStateRegistry = owner.getSavedStateRegistry();
|
||||
this.lifecycle = owner.getLifecycle();
|
||||
this.defaultArgs = bundle;
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.ViewModelProvider.Factory
|
||||
public <T extends ViewModel> T create(Class<T> modelClass, CreationExtras extras) {
|
||||
Intrinsics.checkNotNullParameter(modelClass, "modelClass");
|
||||
Intrinsics.checkNotNullParameter(extras, "extras");
|
||||
String str = (String) extras.get(ViewModelProvider.NewInstanceFactory.VIEW_MODEL_KEY);
|
||||
if (str == null) {
|
||||
throw new IllegalStateException("VIEW_MODEL_KEY must always be provided by ViewModelProvider");
|
||||
}
|
||||
if (this.savedStateRegistry != null) {
|
||||
return (T) create(str, modelClass);
|
||||
}
|
||||
return (T) create(str, modelClass, SavedStateHandleSupport.createSavedStateHandle(extras));
|
||||
}
|
||||
|
||||
private final <T extends ViewModel> T create(String key, Class<T> modelClass) {
|
||||
SavedStateRegistry savedStateRegistry = this.savedStateRegistry;
|
||||
Intrinsics.checkNotNull(savedStateRegistry);
|
||||
Lifecycle lifecycle = this.lifecycle;
|
||||
Intrinsics.checkNotNull(lifecycle);
|
||||
SavedStateHandleController create = LegacySavedStateHandleController.create(savedStateRegistry, lifecycle, key, this.defaultArgs);
|
||||
T t = (T) create(key, modelClass, create.getHandle());
|
||||
t.setTagIfAbsent("androidx.lifecycle.savedstate.vm.tag", create);
|
||||
return t;
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.ViewModelProvider.Factory
|
||||
public <T extends ViewModel> T create(Class<T> modelClass) {
|
||||
Intrinsics.checkNotNullParameter(modelClass, "modelClass");
|
||||
String canonicalName = modelClass.getCanonicalName();
|
||||
if (canonicalName == null) {
|
||||
throw new IllegalArgumentException("Local and anonymous classes can not be ViewModels");
|
||||
}
|
||||
if (this.lifecycle == null) {
|
||||
throw new UnsupportedOperationException("AbstractSavedStateViewModelFactory constructed with empty constructor supports only calls to create(modelClass: Class<T>, extras: CreationExtras).");
|
||||
}
|
||||
return (T) create(canonicalName, modelClass);
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.ViewModelProvider.OnRequeryFactory
|
||||
public void onRequery(ViewModel viewModel) {
|
||||
Intrinsics.checkNotNullParameter(viewModel, "viewModel");
|
||||
SavedStateRegistry savedStateRegistry = this.savedStateRegistry;
|
||||
if (savedStateRegistry != null) {
|
||||
Intrinsics.checkNotNull(savedStateRegistry);
|
||||
Lifecycle lifecycle = this.lifecycle;
|
||||
Intrinsics.checkNotNull(lifecycle);
|
||||
LegacySavedStateHandleController.attachHandleIfNeeded(viewModel, savedStateRegistry, lifecycle);
|
||||
}
|
||||
}
|
||||
}
|
23
02-Easy5/E5/sources/androidx/lifecycle/AndroidViewModel.java
Normal file
23
02-Easy5/E5/sources/androidx/lifecycle/AndroidViewModel.java
Normal file
@ -0,0 +1,23 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import android.app.Application;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: AndroidViewModel.kt */
|
||||
@Metadata(d1 = {"\u0000\u0012\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\b\u0016\u0018\u00002\u00020\u0001B\r\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0002\u0010\u0004J\u0017\u0010\u0005\u001a\u0002H\u0006\"\b\b\u0000\u0010\u0006*\u00020\u0003H\u0016¢\u0006\u0002\u0010\u0007R\u000e\u0010\u0002\u001a\u00020\u0003X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\b"}, d2 = {"Landroidx/lifecycle/AndroidViewModel;", "Landroidx/lifecycle/ViewModel;", "application", "Landroid/app/Application;", "(Landroid/app/Application;)V", "getApplication", "T", "()Landroid/app/Application;", "lifecycle-viewmodel_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public class AndroidViewModel extends ViewModel {
|
||||
private final Application application;
|
||||
|
||||
public AndroidViewModel(Application application) {
|
||||
Intrinsics.checkNotNullParameter(application, "application");
|
||||
this.application = application;
|
||||
}
|
||||
|
||||
public <T extends Application> T getApplication() {
|
||||
T t = (T) this.application;
|
||||
Intrinsics.checkNotNull(t, "null cannot be cast to non-null type T of androidx.lifecycle.AndroidViewModel.getApplication");
|
||||
return t;
|
||||
}
|
||||
}
|
20
02-Easy5/E5/sources/androidx/lifecycle/Api26Impl.java
Normal file
20
02-Easy5/E5/sources/androidx/lifecycle/Api26Impl.java
Normal file
@ -0,0 +1,20 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import java.time.Duration;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: CoroutineLiveData.kt */
|
||||
@Metadata(d1 = {"\u0000\u0018\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\t\n\u0000\n\u0002\u0018\u0002\n\u0000\bÁ\u0002\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\u000e\u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0006¨\u0006\u0007"}, d2 = {"Landroidx/lifecycle/Api26Impl;", "", "()V", "toMillis", "", "timeout", "Ljava/time/Duration;", "lifecycle-livedata_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class Api26Impl {
|
||||
public static final Api26Impl INSTANCE = new Api26Impl();
|
||||
|
||||
private Api26Impl() {
|
||||
}
|
||||
|
||||
public final long toMillis(Duration timeout) {
|
||||
Intrinsics.checkNotNullParameter(timeout, "timeout");
|
||||
return timeout.toMillis();
|
||||
}
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import java.util.concurrent.CancellationException;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.ResultKt;
|
||||
import kotlin.Unit;
|
||||
import kotlin.coroutines.Continuation;
|
||||
import kotlin.coroutines.intrinsics.IntrinsicsKt;
|
||||
import kotlin.coroutines.jvm.internal.DebugMetadata;
|
||||
import kotlin.coroutines.jvm.internal.SuspendLambda;
|
||||
import kotlin.jvm.functions.Function2;
|
||||
import kotlinx.coroutines.CoroutineScope;
|
||||
import kotlinx.coroutines.DelayKt;
|
||||
import kotlinx.coroutines.Job;
|
||||
|
||||
/* compiled from: CoroutineLiveData.kt */
|
||||
@Metadata(d1 = {"\u0000\f\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0000\u0010\u0003\u001a\u00020\u0002\"\u0004\b\u0000\u0010\u0000*\u00020\u0001H\u008a@"}, d2 = {"T", "Lkotlinx/coroutines/CoroutineScope;", "", "<anonymous>"}, k = 3, mv = {1, 8, 0})
|
||||
@DebugMetadata(c = "androidx.lifecycle.BlockRunner$cancel$1", f = "CoroutineLiveData.kt", i = {}, l = {188}, m = "invokeSuspend", n = {}, s = {})
|
||||
/* loaded from: classes.dex */
|
||||
final class BlockRunner$cancel$1 extends SuspendLambda implements Function2<CoroutineScope, Continuation<? super Unit>, Object> {
|
||||
int label;
|
||||
final /* synthetic */ BlockRunner<T> this$0;
|
||||
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
BlockRunner$cancel$1(BlockRunner<T> blockRunner, Continuation<? super BlockRunner$cancel$1> continuation) {
|
||||
super(2, continuation);
|
||||
this.this$0 = blockRunner;
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
||||
public final Continuation<Unit> create(Object obj, Continuation<?> continuation) {
|
||||
return new BlockRunner$cancel$1(this.this$0, continuation);
|
||||
}
|
||||
|
||||
@Override // kotlin.jvm.functions.Function2
|
||||
public final Object invoke(CoroutineScope coroutineScope, Continuation<? super Unit> continuation) {
|
||||
return ((BlockRunner$cancel$1) create(coroutineScope, continuation)).invokeSuspend(Unit.INSTANCE);
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
||||
public final Object invokeSuspend(Object obj) {
|
||||
long j;
|
||||
CoroutineLiveData coroutineLiveData;
|
||||
Job job;
|
||||
Object coroutine_suspended = IntrinsicsKt.getCOROUTINE_SUSPENDED();
|
||||
int i = this.label;
|
||||
if (i == 0) {
|
||||
ResultKt.throwOnFailure(obj);
|
||||
j = ((BlockRunner) this.this$0).timeoutInMs;
|
||||
this.label = 1;
|
||||
if (DelayKt.delay(j, this) == coroutine_suspended) {
|
||||
return coroutine_suspended;
|
||||
}
|
||||
} else {
|
||||
if (i != 1) {
|
||||
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
|
||||
}
|
||||
ResultKt.throwOnFailure(obj);
|
||||
}
|
||||
coroutineLiveData = ((BlockRunner) this.this$0).liveData;
|
||||
if (!coroutineLiveData.hasActiveObservers()) {
|
||||
job = ((BlockRunner) this.this$0).runningJob;
|
||||
if (job != null) {
|
||||
Job.DefaultImpls.cancel$default(job, (CancellationException) null, 1, (Object) null);
|
||||
}
|
||||
((BlockRunner) this.this$0).runningJob = null;
|
||||
}
|
||||
return Unit.INSTANCE;
|
||||
}
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import kotlin.Metadata;
|
||||
import kotlin.ResultKt;
|
||||
import kotlin.Unit;
|
||||
import kotlin.coroutines.Continuation;
|
||||
import kotlin.coroutines.intrinsics.IntrinsicsKt;
|
||||
import kotlin.coroutines.jvm.internal.DebugMetadata;
|
||||
import kotlin.coroutines.jvm.internal.SuspendLambda;
|
||||
import kotlin.jvm.functions.Function0;
|
||||
import kotlin.jvm.functions.Function2;
|
||||
import kotlinx.coroutines.CoroutineScope;
|
||||
|
||||
/* compiled from: CoroutineLiveData.kt */
|
||||
@Metadata(d1 = {"\u0000\f\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0000\u0010\u0003\u001a\u00020\u0002\"\u0004\b\u0000\u0010\u0000*\u00020\u0001H\u008a@"}, d2 = {"T", "Lkotlinx/coroutines/CoroutineScope;", "", "<anonymous>"}, k = 3, mv = {1, 8, 0})
|
||||
@DebugMetadata(c = "androidx.lifecycle.BlockRunner$maybeRun$1", f = "CoroutineLiveData.kt", i = {}, l = {177}, m = "invokeSuspend", n = {}, s = {})
|
||||
/* loaded from: classes.dex */
|
||||
final class BlockRunner$maybeRun$1 extends SuspendLambda implements Function2<CoroutineScope, Continuation<? super Unit>, Object> {
|
||||
private /* synthetic */ Object L$0;
|
||||
int label;
|
||||
final /* synthetic */ BlockRunner<T> this$0;
|
||||
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
BlockRunner$maybeRun$1(BlockRunner<T> blockRunner, Continuation<? super BlockRunner$maybeRun$1> continuation) {
|
||||
super(2, continuation);
|
||||
this.this$0 = blockRunner;
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
||||
public final Continuation<Unit> create(Object obj, Continuation<?> continuation) {
|
||||
BlockRunner$maybeRun$1 blockRunner$maybeRun$1 = new BlockRunner$maybeRun$1(this.this$0, continuation);
|
||||
blockRunner$maybeRun$1.L$0 = obj;
|
||||
return blockRunner$maybeRun$1;
|
||||
}
|
||||
|
||||
@Override // kotlin.jvm.functions.Function2
|
||||
public final Object invoke(CoroutineScope coroutineScope, Continuation<? super Unit> continuation) {
|
||||
return ((BlockRunner$maybeRun$1) create(coroutineScope, continuation)).invokeSuspend(Unit.INSTANCE);
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
||||
public final Object invokeSuspend(Object obj) {
|
||||
CoroutineLiveData coroutineLiveData;
|
||||
Function2 function2;
|
||||
Function0 function0;
|
||||
Object coroutine_suspended = IntrinsicsKt.getCOROUTINE_SUSPENDED();
|
||||
int i = this.label;
|
||||
if (i == 0) {
|
||||
ResultKt.throwOnFailure(obj);
|
||||
CoroutineScope coroutineScope = (CoroutineScope) this.L$0;
|
||||
coroutineLiveData = ((BlockRunner) this.this$0).liveData;
|
||||
LiveDataScopeImpl liveDataScopeImpl = new LiveDataScopeImpl(coroutineLiveData, coroutineScope.getCoroutineContext());
|
||||
function2 = ((BlockRunner) this.this$0).block;
|
||||
this.label = 1;
|
||||
if (function2.invoke(liveDataScopeImpl, this) == coroutine_suspended) {
|
||||
return coroutine_suspended;
|
||||
}
|
||||
} else {
|
||||
if (i != 1) {
|
||||
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
|
||||
}
|
||||
ResultKt.throwOnFailure(obj);
|
||||
}
|
||||
function0 = ((BlockRunner) this.this$0).onDone;
|
||||
function0.invoke();
|
||||
return Unit.INSTANCE;
|
||||
}
|
||||
}
|
63
02-Easy5/E5/sources/androidx/lifecycle/BlockRunner.java
Normal file
63
02-Easy5/E5/sources/androidx/lifecycle/BlockRunner.java
Normal file
@ -0,0 +1,63 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import java.util.concurrent.CancellationException;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.Unit;
|
||||
import kotlin.coroutines.Continuation;
|
||||
import kotlin.jvm.functions.Function0;
|
||||
import kotlin.jvm.functions.Function2;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import kotlinx.coroutines.BuildersKt__Builders_commonKt;
|
||||
import kotlinx.coroutines.CoroutineScope;
|
||||
import kotlinx.coroutines.Dispatchers;
|
||||
import kotlinx.coroutines.Job;
|
||||
|
||||
/* compiled from: CoroutineLiveData.kt */
|
||||
@Metadata(d1 = {"\u0000D\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\t\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0004\b\u0000\u0018\u0000*\u0004\b\u0000\u0010\u00012\u00020\u0002B`\u0012\f\u0010\u0003\u001a\b\u0012\u0004\u0012\u00028\u00000\u0004\u0012-\u0010\u0005\u001a)\b\u0001\u0012\n\u0012\b\u0012\u0004\u0012\u00028\u00000\u0007\u0012\n\u0012\b\u0012\u0004\u0012\u00020\t0\b\u0012\u0006\u0012\u0004\u0018\u00010\u00020\u0006¢\u0006\u0002\b\n\u0012\u0006\u0010\u000b\u001a\u00020\f\u0012\u0006\u0010\r\u001a\u00020\u000e\u0012\f\u0010\u000f\u001a\b\u0012\u0004\u0012\u00020\t0\u0010¢\u0006\u0002\u0010\u0011J\b\u0010\u0016\u001a\u00020\tH\u0007J\b\u0010\u0017\u001a\u00020\tH\u0007R7\u0010\u0005\u001a)\b\u0001\u0012\n\u0012\b\u0012\u0004\u0012\u00028\u00000\u0007\u0012\n\u0012\b\u0012\u0004\u0012\u00020\t0\b\u0012\u0006\u0012\u0004\u0018\u00010\u00020\u0006¢\u0006\u0002\b\nX\u0082\u0004¢\u0006\u0004\n\u0002\u0010\u0012R\u0010\u0010\u0013\u001a\u0004\u0018\u00010\u0014X\u0082\u000e¢\u0006\u0002\n\u0000R\u0014\u0010\u0003\u001a\b\u0012\u0004\u0012\u00028\u00000\u0004X\u0082\u0004¢\u0006\u0002\n\u0000R\u0014\u0010\u000f\u001a\b\u0012\u0004\u0012\u00020\t0\u0010X\u0082\u0004¢\u0006\u0002\n\u0000R\u0010\u0010\u0015\u001a\u0004\u0018\u00010\u0014X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\r\u001a\u00020\u000eX\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u000b\u001a\u00020\fX\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u0018"}, d2 = {"Landroidx/lifecycle/BlockRunner;", "T", "", "liveData", "Landroidx/lifecycle/CoroutineLiveData;", "block", "Lkotlin/Function2;", "Landroidx/lifecycle/LiveDataScope;", "Lkotlin/coroutines/Continuation;", "", "Lkotlin/ExtensionFunctionType;", "timeoutInMs", "", "scope", "Lkotlinx/coroutines/CoroutineScope;", "onDone", "Lkotlin/Function0;", "(Landroidx/lifecycle/CoroutineLiveData;Lkotlin/jvm/functions/Function2;JLkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function0;)V", "Lkotlin/jvm/functions/Function2;", "cancellationJob", "Lkotlinx/coroutines/Job;", "runningJob", "cancel", "maybeRun", "lifecycle-livedata_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class BlockRunner<T> {
|
||||
private final Function2<LiveDataScope<T>, Continuation<? super Unit>, Object> block;
|
||||
private Job cancellationJob;
|
||||
private final CoroutineLiveData<T> liveData;
|
||||
private final Function0<Unit> onDone;
|
||||
private Job runningJob;
|
||||
private final CoroutineScope scope;
|
||||
private final long timeoutInMs;
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public BlockRunner(CoroutineLiveData<T> liveData, Function2<? super LiveDataScope<T>, ? super Continuation<? super Unit>, ? extends Object> block, long j, CoroutineScope scope, Function0<Unit> onDone) {
|
||||
Intrinsics.checkNotNullParameter(liveData, "liveData");
|
||||
Intrinsics.checkNotNullParameter(block, "block");
|
||||
Intrinsics.checkNotNullParameter(scope, "scope");
|
||||
Intrinsics.checkNotNullParameter(onDone, "onDone");
|
||||
this.liveData = liveData;
|
||||
this.block = block;
|
||||
this.timeoutInMs = j;
|
||||
this.scope = scope;
|
||||
this.onDone = onDone;
|
||||
}
|
||||
|
||||
public final void maybeRun() {
|
||||
Job launch$default;
|
||||
Job job = this.cancellationJob;
|
||||
if (job != null) {
|
||||
Job.DefaultImpls.cancel$default(job, (CancellationException) null, 1, (Object) null);
|
||||
}
|
||||
this.cancellationJob = null;
|
||||
if (this.runningJob != null) {
|
||||
return;
|
||||
}
|
||||
launch$default = BuildersKt__Builders_commonKt.launch$default(this.scope, null, null, new BlockRunner$maybeRun$1(this, null), 3, null);
|
||||
this.runningJob = launch$default;
|
||||
}
|
||||
|
||||
public final void cancel() {
|
||||
Job launch$default;
|
||||
if (this.cancellationJob == null) {
|
||||
launch$default = BuildersKt__Builders_commonKt.launch$default(this.scope, Dispatchers.getMain().getImmediate(), null, new BlockRunner$cancel$1(this, null), 2, null);
|
||||
this.cancellationJob = launch$default;
|
||||
return;
|
||||
}
|
||||
throw new IllegalStateException("Cancel call cannot happen without a maybeRun".toString());
|
||||
}
|
||||
}
|
195
02-Easy5/E5/sources/androidx/lifecycle/ClassesInfoCache.java
Normal file
195
02-Easy5/E5/sources/androidx/lifecycle/ClassesInfoCache.java
Normal file
@ -0,0 +1,195 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Deprecated
|
||||
/* loaded from: classes.dex */
|
||||
final class ClassesInfoCache {
|
||||
private static final int CALL_TYPE_NO_ARG = 0;
|
||||
private static final int CALL_TYPE_PROVIDER = 1;
|
||||
private static final int CALL_TYPE_PROVIDER_WITH_EVENT = 2;
|
||||
static ClassesInfoCache sInstance = new ClassesInfoCache();
|
||||
private final Map<Class<?>, CallbackInfo> mCallbackMap = new HashMap();
|
||||
private final Map<Class<?>, Boolean> mHasLifecycleMethods = new HashMap();
|
||||
|
||||
ClassesInfoCache() {
|
||||
}
|
||||
|
||||
boolean hasLifecycleMethods(Class<?> cls) {
|
||||
Boolean bool = this.mHasLifecycleMethods.get(cls);
|
||||
if (bool != null) {
|
||||
return bool.booleanValue();
|
||||
}
|
||||
Method[] declaredMethods = getDeclaredMethods(cls);
|
||||
for (Method method : declaredMethods) {
|
||||
if (((OnLifecycleEvent) method.getAnnotation(OnLifecycleEvent.class)) != null) {
|
||||
createInfo(cls, declaredMethods);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
this.mHasLifecycleMethods.put(cls, false);
|
||||
return false;
|
||||
}
|
||||
|
||||
private Method[] getDeclaredMethods(Class<?> cls) {
|
||||
try {
|
||||
return cls.getDeclaredMethods();
|
||||
} catch (NoClassDefFoundError e) {
|
||||
throw new IllegalArgumentException("The observer class has some methods that use newer APIs which are not available in the current OS version. Lifecycles cannot access even other methods so you should make sure that your observer classes only access framework classes that are available in your min API level OR use lifecycle:compiler annotation processor.", e);
|
||||
}
|
||||
}
|
||||
|
||||
CallbackInfo getInfo(Class<?> cls) {
|
||||
CallbackInfo callbackInfo = this.mCallbackMap.get(cls);
|
||||
return callbackInfo != null ? callbackInfo : createInfo(cls, null);
|
||||
}
|
||||
|
||||
private void verifyAndPutHandler(Map<MethodReference, Lifecycle.Event> map, MethodReference methodReference, Lifecycle.Event event, Class<?> cls) {
|
||||
Lifecycle.Event event2 = map.get(methodReference);
|
||||
if (event2 == null || event == event2) {
|
||||
if (event2 == null) {
|
||||
map.put(methodReference, event);
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
throw new IllegalArgumentException("Method " + methodReference.mMethod.getName() + " in " + cls.getName() + " already declared with different @OnLifecycleEvent value: previous value " + event2 + ", new value " + event);
|
||||
}
|
||||
|
||||
private CallbackInfo createInfo(Class<?> cls, Method[] methodArr) {
|
||||
int i;
|
||||
CallbackInfo info;
|
||||
Class<? super Object> superclass = cls.getSuperclass();
|
||||
HashMap hashMap = new HashMap();
|
||||
if (superclass != null && (info = getInfo(superclass)) != null) {
|
||||
hashMap.putAll(info.mHandlerToEvent);
|
||||
}
|
||||
for (Class<?> cls2 : cls.getInterfaces()) {
|
||||
for (Map.Entry<MethodReference, Lifecycle.Event> entry : getInfo(cls2).mHandlerToEvent.entrySet()) {
|
||||
verifyAndPutHandler(hashMap, entry.getKey(), entry.getValue(), cls);
|
||||
}
|
||||
}
|
||||
if (methodArr == null) {
|
||||
methodArr = getDeclaredMethods(cls);
|
||||
}
|
||||
boolean z = false;
|
||||
for (Method method : methodArr) {
|
||||
OnLifecycleEvent onLifecycleEvent = (OnLifecycleEvent) method.getAnnotation(OnLifecycleEvent.class);
|
||||
if (onLifecycleEvent != null) {
|
||||
Class<?>[] parameterTypes = method.getParameterTypes();
|
||||
if (parameterTypes.length <= 0) {
|
||||
i = 0;
|
||||
} else {
|
||||
if (!LifecycleOwner.class.isAssignableFrom(parameterTypes[0])) {
|
||||
throw new IllegalArgumentException("invalid parameter type. Must be one and instanceof LifecycleOwner");
|
||||
}
|
||||
i = 1;
|
||||
}
|
||||
Lifecycle.Event value = onLifecycleEvent.value();
|
||||
if (parameterTypes.length > 1) {
|
||||
if (!Lifecycle.Event.class.isAssignableFrom(parameterTypes[1])) {
|
||||
throw new IllegalArgumentException("invalid parameter type. second arg must be an event");
|
||||
}
|
||||
if (value != Lifecycle.Event.ON_ANY) {
|
||||
throw new IllegalArgumentException("Second arg is supported only for ON_ANY value");
|
||||
}
|
||||
i = 2;
|
||||
}
|
||||
if (parameterTypes.length > 2) {
|
||||
throw new IllegalArgumentException("cannot have more than 2 params");
|
||||
}
|
||||
verifyAndPutHandler(hashMap, new MethodReference(i, method), value, cls);
|
||||
z = true;
|
||||
}
|
||||
}
|
||||
CallbackInfo callbackInfo = new CallbackInfo(hashMap);
|
||||
this.mCallbackMap.put(cls, callbackInfo);
|
||||
this.mHasLifecycleMethods.put(cls, Boolean.valueOf(z));
|
||||
return callbackInfo;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
static class CallbackInfo {
|
||||
final Map<Lifecycle.Event, List<MethodReference>> mEventToHandlers = new HashMap();
|
||||
final Map<MethodReference, Lifecycle.Event> mHandlerToEvent;
|
||||
|
||||
CallbackInfo(Map<MethodReference, Lifecycle.Event> map) {
|
||||
this.mHandlerToEvent = map;
|
||||
for (Map.Entry<MethodReference, Lifecycle.Event> entry : map.entrySet()) {
|
||||
Lifecycle.Event value = entry.getValue();
|
||||
List<MethodReference> list = this.mEventToHandlers.get(value);
|
||||
if (list == null) {
|
||||
list = new ArrayList<>();
|
||||
this.mEventToHandlers.put(value, list);
|
||||
}
|
||||
list.add(entry.getKey());
|
||||
}
|
||||
}
|
||||
|
||||
void invokeCallbacks(LifecycleOwner lifecycleOwner, Lifecycle.Event event, Object obj) {
|
||||
invokeMethodsForEvent(this.mEventToHandlers.get(event), lifecycleOwner, event, obj);
|
||||
invokeMethodsForEvent(this.mEventToHandlers.get(Lifecycle.Event.ON_ANY), lifecycleOwner, event, obj);
|
||||
}
|
||||
|
||||
private static void invokeMethodsForEvent(List<MethodReference> list, LifecycleOwner lifecycleOwner, Lifecycle.Event event, Object obj) {
|
||||
if (list != null) {
|
||||
for (int size = list.size() - 1; size >= 0; size--) {
|
||||
list.get(size).invokeCallback(lifecycleOwner, event, obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
static final class MethodReference {
|
||||
final int mCallType;
|
||||
final Method mMethod;
|
||||
|
||||
MethodReference(int i, Method method) {
|
||||
this.mCallType = i;
|
||||
this.mMethod = method;
|
||||
method.setAccessible(true);
|
||||
}
|
||||
|
||||
void invokeCallback(LifecycleOwner lifecycleOwner, Lifecycle.Event event, Object obj) {
|
||||
try {
|
||||
int i = this.mCallType;
|
||||
if (i == 0) {
|
||||
this.mMethod.invoke(obj, new Object[0]);
|
||||
} else if (i == 1) {
|
||||
this.mMethod.invoke(obj, lifecycleOwner);
|
||||
} else {
|
||||
if (i != 2) {
|
||||
return;
|
||||
}
|
||||
this.mMethod.invoke(obj, lifecycleOwner, event);
|
||||
}
|
||||
} catch (IllegalAccessException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (InvocationTargetException e2) {
|
||||
throw new RuntimeException("Failed to call observer method", e2.getCause());
|
||||
}
|
||||
}
|
||||
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (!(obj instanceof MethodReference)) {
|
||||
return false;
|
||||
}
|
||||
MethodReference methodReference = (MethodReference) obj;
|
||||
return this.mCallType == methodReference.mCallType && this.mMethod.getName().equals(methodReference.mMethod.getName());
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return (this.mCallType * 31) + this.mMethod.getName().hashCode();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.util.concurrent.CancellationException;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.coroutines.CoroutineContext;
|
||||
import kotlinx.coroutines.CoroutineScope;
|
||||
import kotlinx.coroutines.JobKt__JobKt;
|
||||
|
||||
/* compiled from: ViewModel.kt */
|
||||
@Metadata(d1 = {"\u0000\u001c\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\u0002\n\u0000\b\u0000\u0018\u00002\u00020\u00012\u00020\u0002B\r\u0012\u0006\u0010\u0003\u001a\u00020\u0004¢\u0006\u0002\u0010\u0005J\b\u0010\t\u001a\u00020\nH\u0016R\u0014\u0010\u0006\u001a\u00020\u0004X\u0096\u0004¢\u0006\b\n\u0000\u001a\u0004\b\u0007\u0010\b¨\u0006\u000b"}, d2 = {"Landroidx/lifecycle/CloseableCoroutineScope;", "Ljava/io/Closeable;", "Lkotlinx/coroutines/CoroutineScope;", "context", "Lkotlin/coroutines/CoroutineContext;", "(Lkotlin/coroutines/CoroutineContext;)V", "coroutineContext", "getCoroutineContext", "()Lkotlin/coroutines/CoroutineContext;", "close", "", "lifecycle-viewmodel-ktx_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class CloseableCoroutineScope implements Closeable, CoroutineScope {
|
||||
private final CoroutineContext coroutineContext;
|
||||
|
||||
@Override // kotlinx.coroutines.CoroutineScope
|
||||
public CoroutineContext getCoroutineContext() {
|
||||
return this.coroutineContext;
|
||||
}
|
||||
|
||||
public CloseableCoroutineScope(CoroutineContext coroutineContext) {
|
||||
this.coroutineContext = coroutineContext;
|
||||
}
|
||||
|
||||
@Override // java.io.Closeable, java.lang.AutoCloseable
|
||||
public void close() {
|
||||
JobKt__JobKt.cancel$default(getCoroutineContext(), (CancellationException) null, 1, (Object) null);
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import androidx.core.app.NotificationCompat;
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: CompositeGeneratedAdaptersObserver.kt */
|
||||
@Metadata(d1 = {"\u0000(\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0011\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\b\u0000\u0018\u00002\u00020\u0001B\u0013\u0012\f\u0010\u0002\u001a\b\u0012\u0004\u0012\u00020\u00040\u0003¢\u0006\u0002\u0010\u0005J\u0018\u0010\u0007\u001a\u00020\b2\u0006\u0010\t\u001a\u00020\n2\u0006\u0010\u000b\u001a\u00020\fH\u0016R\u0016\u0010\u0002\u001a\b\u0012\u0004\u0012\u00020\u00040\u0003X\u0082\u0004¢\u0006\u0004\n\u0002\u0010\u0006¨\u0006\r"}, d2 = {"Landroidx/lifecycle/CompositeGeneratedAdaptersObserver;", "Landroidx/lifecycle/LifecycleEventObserver;", "generatedAdapters", "", "Landroidx/lifecycle/GeneratedAdapter;", "([Landroidx/lifecycle/GeneratedAdapter;)V", "[Landroidx/lifecycle/GeneratedAdapter;", "onStateChanged", "", "source", "Landroidx/lifecycle/LifecycleOwner;", NotificationCompat.CATEGORY_EVENT, "Landroidx/lifecycle/Lifecycle$Event;", "lifecycle-common"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class CompositeGeneratedAdaptersObserver implements LifecycleEventObserver {
|
||||
private final GeneratedAdapter[] generatedAdapters;
|
||||
|
||||
public CompositeGeneratedAdaptersObserver(GeneratedAdapter[] generatedAdapters) {
|
||||
Intrinsics.checkNotNullParameter(generatedAdapters, "generatedAdapters");
|
||||
this.generatedAdapters = generatedAdapters;
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.LifecycleEventObserver
|
||||
public void onStateChanged(LifecycleOwner source, Lifecycle.Event event) {
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
Intrinsics.checkNotNullParameter(event, "event");
|
||||
MethodCallsLogger methodCallsLogger = new MethodCallsLogger();
|
||||
for (GeneratedAdapter generatedAdapter : this.generatedAdapters) {
|
||||
generatedAdapter.callMethods(source, event, false, methodCallsLogger);
|
||||
}
|
||||
for (GeneratedAdapter generatedAdapter2 : this.generatedAdapters) {
|
||||
generatedAdapter2.callMethods(source, event, true, methodCallsLogger);
|
||||
}
|
||||
}
|
||||
}
|
145
02-Easy5/E5/sources/androidx/lifecycle/ComputableLiveData.java
Normal file
145
02-Easy5/E5/sources/androidx/lifecycle/ComputableLiveData.java
Normal file
@ -0,0 +1,145 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import androidx.arch.core.executor.ArchTaskExecutor;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: ComputableLiveData.kt */
|
||||
@Metadata(d1 = {"\u00000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0002\b\n\n\u0002\u0010\u0002\n\u0000\b'\u0018\u0000*\u0004\b\u0000\u0010\u00012\u00020\u0002B\u0011\b\u0007\u0012\b\b\u0002\u0010\u0003\u001a\u00020\u0004¢\u0006\u0002\u0010\u0005J\r\u0010\u0019\u001a\u00028\u0000H%¢\u0006\u0002\u0010\u001aJ\b\u0010\u001b\u001a\u00020\u001cH\u0016R\u0016\u0010\u0006\u001a\n\u0012\u0006\u0012\u0004\u0018\u00018\u00000\u0007X\u0082\u0004¢\u0006\u0002\n\u0000R\u0014\u0010\b\u001a\u00020\tX\u0080\u0004¢\u0006\b\n\u0000\u001a\u0004\b\n\u0010\u000bR\u0014\u0010\u0003\u001a\u00020\u0004X\u0080\u0004¢\u0006\b\n\u0000\u001a\u0004\b\f\u0010\rR\u0014\u0010\u000e\u001a\u00020\tX\u0080\u0004¢\u0006\b\n\u0000\u001a\u0004\b\u000f\u0010\u000bR\u0016\u0010\u0010\u001a\u00020\u00118\u0000X\u0081\u0004¢\u0006\b\n\u0000\u0012\u0004\b\u0012\u0010\u0013R\u001c\u0010\u0014\u001a\n\u0012\u0006\u0012\u0004\u0018\u00018\u00000\u0007X\u0096\u0004¢\u0006\b\n\u0000\u001a\u0004\b\u0015\u0010\u0016R\u0016\u0010\u0017\u001a\u00020\u00118\u0000X\u0081\u0004¢\u0006\b\n\u0000\u0012\u0004\b\u0018\u0010\u0013¨\u0006\u001d"}, d2 = {"Landroidx/lifecycle/ComputableLiveData;", "T", "", "executor", "Ljava/util/concurrent/Executor;", "(Ljava/util/concurrent/Executor;)V", "_liveData", "Landroidx/lifecycle/LiveData;", "computing", "Ljava/util/concurrent/atomic/AtomicBoolean;", "getComputing$lifecycle_livedata_release", "()Ljava/util/concurrent/atomic/AtomicBoolean;", "getExecutor$lifecycle_livedata_release", "()Ljava/util/concurrent/Executor;", "invalid", "getInvalid$lifecycle_livedata_release", "invalidationRunnable", "Ljava/lang/Runnable;", "getInvalidationRunnable$lifecycle_livedata_release$annotations", "()V", "liveData", "getLiveData", "()Landroidx/lifecycle/LiveData;", "refreshRunnable", "getRefreshRunnable$lifecycle_livedata_release$annotations", "compute", "()Ljava/lang/Object;", "invalidate", "", "lifecycle-livedata_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class ComputableLiveData<T> {
|
||||
private final LiveData<T> _liveData;
|
||||
private final AtomicBoolean computing;
|
||||
private final Executor executor;
|
||||
private final AtomicBoolean invalid;
|
||||
public final Runnable invalidationRunnable;
|
||||
private final LiveData<T> liveData;
|
||||
public final Runnable refreshRunnable;
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public ComputableLiveData() {
|
||||
this(null, 1, 0 == true ? 1 : 0);
|
||||
}
|
||||
|
||||
public static /* synthetic */ void getInvalidationRunnable$lifecycle_livedata_release$annotations() {
|
||||
}
|
||||
|
||||
public static /* synthetic */ void getRefreshRunnable$lifecycle_livedata_release$annotations() {
|
||||
}
|
||||
|
||||
protected abstract T compute();
|
||||
|
||||
/* renamed from: getComputing$lifecycle_livedata_release, reason: from getter */
|
||||
public final AtomicBoolean getComputing() {
|
||||
return this.computing;
|
||||
}
|
||||
|
||||
/* renamed from: getExecutor$lifecycle_livedata_release, reason: from getter */
|
||||
public final Executor getExecutor() {
|
||||
return this.executor;
|
||||
}
|
||||
|
||||
/* renamed from: getInvalid$lifecycle_livedata_release, reason: from getter */
|
||||
public final AtomicBoolean getInvalid() {
|
||||
return this.invalid;
|
||||
}
|
||||
|
||||
public LiveData<T> getLiveData() {
|
||||
return this.liveData;
|
||||
}
|
||||
|
||||
public ComputableLiveData(Executor executor) {
|
||||
Intrinsics.checkNotNullParameter(executor, "executor");
|
||||
this.executor = executor;
|
||||
LiveData<T> liveData = new LiveData<T>(this) { // from class: androidx.lifecycle.ComputableLiveData$_liveData$1
|
||||
final /* synthetic */ ComputableLiveData<T> this$0;
|
||||
|
||||
{
|
||||
this.this$0 = this;
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.LiveData
|
||||
protected void onActive() {
|
||||
this.this$0.getExecutor().execute(this.this$0.refreshRunnable);
|
||||
}
|
||||
};
|
||||
this._liveData = liveData;
|
||||
this.liveData = liveData;
|
||||
this.invalid = new AtomicBoolean(true);
|
||||
this.computing = new AtomicBoolean(false);
|
||||
this.refreshRunnable = new Runnable() { // from class: androidx.lifecycle.ComputableLiveData$$ExternalSyntheticLambda0
|
||||
@Override // java.lang.Runnable
|
||||
public final void run() {
|
||||
ComputableLiveData.refreshRunnable$lambda$0(ComputableLiveData.this);
|
||||
}
|
||||
};
|
||||
this.invalidationRunnable = new Runnable() { // from class: androidx.lifecycle.ComputableLiveData$$ExternalSyntheticLambda1
|
||||
@Override // java.lang.Runnable
|
||||
public final void run() {
|
||||
ComputableLiveData.invalidationRunnable$lambda$1(ComputableLiveData.this);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/* JADX WARN: Illegal instructions before constructor call */
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct add '--show-bad-code' argument
|
||||
*/
|
||||
public /* synthetic */ ComputableLiveData(java.util.concurrent.Executor r1, int r2, kotlin.jvm.internal.DefaultConstructorMarker r3) {
|
||||
/*
|
||||
r0 = this;
|
||||
r2 = r2 & 1
|
||||
if (r2 == 0) goto Ld
|
||||
java.util.concurrent.Executor r1 = androidx.arch.core.executor.ArchTaskExecutor.getIOThreadExecutor()
|
||||
java.lang.String r2 = "getIOThreadExecutor()"
|
||||
kotlin.jvm.internal.Intrinsics.checkNotNullExpressionValue(r1, r2)
|
||||
Ld:
|
||||
r0.<init>(r1)
|
||||
return
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: androidx.lifecycle.ComputableLiveData.<init>(java.util.concurrent.Executor, int, kotlin.jvm.internal.DefaultConstructorMarker):void");
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public static final void refreshRunnable$lambda$0(ComputableLiveData this$0) {
|
||||
Intrinsics.checkNotNullParameter(this$0, "this$0");
|
||||
do {
|
||||
if (!this$0.computing.compareAndSet(false, true)) {
|
||||
return;
|
||||
}
|
||||
Object obj = null;
|
||||
boolean z = false;
|
||||
while (this$0.invalid.compareAndSet(true, false)) {
|
||||
try {
|
||||
obj = this$0.compute();
|
||||
z = true;
|
||||
} finally {
|
||||
this$0.computing.set(false);
|
||||
}
|
||||
}
|
||||
if (z) {
|
||||
this$0.getLiveData().postValue(obj);
|
||||
}
|
||||
if (!z) {
|
||||
return;
|
||||
}
|
||||
} while (this$0.invalid.get());
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public static final void invalidationRunnable$lambda$1(ComputableLiveData this$0) {
|
||||
Intrinsics.checkNotNullParameter(this$0, "this$0");
|
||||
boolean hasActiveObservers = this$0.getLiveData().hasActiveObservers();
|
||||
if (this$0.invalid.compareAndSet(false, true) && hasActiveObservers) {
|
||||
this$0.executor.execute(this$0.refreshRunnable);
|
||||
}
|
||||
}
|
||||
|
||||
public void invalidate() {
|
||||
ArchTaskExecutor.getInstance().executeOnMainThread(this.invalidationRunnable);
|
||||
}
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import kotlin.Metadata;
|
||||
import kotlin.coroutines.Continuation;
|
||||
import kotlin.coroutines.jvm.internal.ContinuationImpl;
|
||||
import kotlin.coroutines.jvm.internal.DebugMetadata;
|
||||
|
||||
/* compiled from: CoroutineLiveData.kt */
|
||||
@Metadata(k = 3, mv = {1, 8, 0}, xi = 48)
|
||||
@DebugMetadata(c = "androidx.lifecycle.CoroutineLiveData", f = "CoroutineLiveData.kt", i = {0}, l = {235}, m = "clearSource$lifecycle_livedata_release", n = {"this"}, s = {"L$0"})
|
||||
/* loaded from: classes.dex */
|
||||
final class CoroutineLiveData$clearSource$1 extends ContinuationImpl {
|
||||
Object L$0;
|
||||
int label;
|
||||
/* synthetic */ Object result;
|
||||
final /* synthetic */ CoroutineLiveData<T> this$0;
|
||||
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
CoroutineLiveData$clearSource$1(CoroutineLiveData<T> coroutineLiveData, Continuation<? super CoroutineLiveData$clearSource$1> continuation) {
|
||||
super(continuation);
|
||||
this.this$0 = coroutineLiveData;
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
||||
public final Object invokeSuspend(Object obj) {
|
||||
this.result = obj;
|
||||
this.label |= Integer.MIN_VALUE;
|
||||
return this.this$0.clearSource$lifecycle_livedata_release(this);
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import kotlin.Metadata;
|
||||
import kotlin.coroutines.Continuation;
|
||||
import kotlin.coroutines.jvm.internal.ContinuationImpl;
|
||||
import kotlin.coroutines.jvm.internal.DebugMetadata;
|
||||
|
||||
/* compiled from: CoroutineLiveData.kt */
|
||||
@Metadata(k = 3, mv = {1, 8, 0}, xi = 48)
|
||||
@DebugMetadata(c = "androidx.lifecycle.CoroutineLiveData", f = "CoroutineLiveData.kt", i = {0, 0, 1}, l = {228, 229}, m = "emitSource$lifecycle_livedata_release", n = {"this", "source", "this"}, s = {"L$0", "L$1", "L$0"})
|
||||
/* loaded from: classes.dex */
|
||||
final class CoroutineLiveData$emitSource$1 extends ContinuationImpl {
|
||||
Object L$0;
|
||||
Object L$1;
|
||||
int label;
|
||||
/* synthetic */ Object result;
|
||||
final /* synthetic */ CoroutineLiveData<T> this$0;
|
||||
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
CoroutineLiveData$emitSource$1(CoroutineLiveData<T> coroutineLiveData, Continuation<? super CoroutineLiveData$emitSource$1> continuation) {
|
||||
super(continuation);
|
||||
this.this$0 = coroutineLiveData;
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
||||
public final Object invokeSuspend(Object obj) {
|
||||
this.result = obj;
|
||||
this.label |= Integer.MIN_VALUE;
|
||||
return this.this$0.emitSource$lifecycle_livedata_release(null, this);
|
||||
}
|
||||
}
|
211
02-Easy5/E5/sources/androidx/lifecycle/CoroutineLiveData.java
Normal file
211
02-Easy5/E5/sources/androidx/lifecycle/CoroutineLiveData.java
Normal file
@ -0,0 +1,211 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import kotlin.Metadata;
|
||||
import kotlin.Unit;
|
||||
import kotlin.coroutines.Continuation;
|
||||
import kotlin.coroutines.CoroutineContext;
|
||||
import kotlin.coroutines.EmptyCoroutineContext;
|
||||
import kotlin.jvm.functions.Function0;
|
||||
import kotlin.jvm.functions.Function2;
|
||||
import kotlin.jvm.internal.DefaultConstructorMarker;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import kotlinx.coroutines.CoroutineScopeKt;
|
||||
import kotlinx.coroutines.Dispatchers;
|
||||
import kotlinx.coroutines.Job;
|
||||
import kotlinx.coroutines.SupervisorKt;
|
||||
|
||||
/* compiled from: CoroutineLiveData.kt */
|
||||
@Metadata(d1 = {"\u0000P\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\t\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0002\u0010\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\b\u0000\u0018\u0000*\u0004\b\u0000\u0010\u00012\b\u0012\u0004\u0012\u0002H\u00010\u0002BH\u0012\b\b\u0002\u0010\u0003\u001a\u00020\u0004\u0012\b\b\u0002\u0010\u0005\u001a\u00020\u0006\u0012-\u0010\u0007\u001a)\b\u0001\u0012\n\u0012\b\u0012\u0004\u0012\u00028\u00000\t\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u000b0\n\u0012\u0006\u0012\u0004\u0018\u00010\f0\b¢\u0006\u0002\b\r¢\u0006\u0002\u0010\u000eJ\u0010\u0010\u0013\u001a\u00020\u000bH\u0080@¢\u0006\u0004\b\u0014\u0010\u0015J\u001e\u0010\u0016\u001a\u00020\u00172\f\u0010\u0018\u001a\b\u0012\u0004\u0012\u00028\u00000\u0019H\u0080@¢\u0006\u0004\b\u001a\u0010\u001bJ\b\u0010\u001c\u001a\u00020\u000bH\u0014J\b\u0010\u001d\u001a\u00020\u000bH\u0014R\u0016\u0010\u000f\u001a\n\u0012\u0004\u0012\u00028\u0000\u0018\u00010\u0010X\u0082\u000e¢\u0006\u0002\n\u0000R\u0010\u0010\u0011\u001a\u0004\u0018\u00010\u0012X\u0082\u000e¢\u0006\u0002\n\u0000¨\u0006\u001e"}, d2 = {"Landroidx/lifecycle/CoroutineLiveData;", "T", "Landroidx/lifecycle/MediatorLiveData;", "context", "Lkotlin/coroutines/CoroutineContext;", "timeoutInMs", "", "block", "Lkotlin/Function2;", "Landroidx/lifecycle/LiveDataScope;", "Lkotlin/coroutines/Continuation;", "", "", "Lkotlin/ExtensionFunctionType;", "(Lkotlin/coroutines/CoroutineContext;JLkotlin/jvm/functions/Function2;)V", "blockRunner", "Landroidx/lifecycle/BlockRunner;", "emittedSource", "Landroidx/lifecycle/EmittedSource;", "clearSource", "clearSource$lifecycle_livedata_release", "(Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "emitSource", "Lkotlinx/coroutines/DisposableHandle;", "source", "Landroidx/lifecycle/LiveData;", "emitSource$lifecycle_livedata_release", "(Landroidx/lifecycle/LiveData;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "onActive", "onInactive", "lifecycle-livedata_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class CoroutineLiveData<T> extends MediatorLiveData<T> {
|
||||
private BlockRunner<T> blockRunner;
|
||||
private EmittedSource emittedSource;
|
||||
|
||||
public /* synthetic */ CoroutineLiveData(EmptyCoroutineContext emptyCoroutineContext, long j, Function2 function2, int i, DefaultConstructorMarker defaultConstructorMarker) {
|
||||
this((i & 1) != 0 ? EmptyCoroutineContext.INSTANCE : emptyCoroutineContext, (i & 2) != 0 ? CoroutineLiveDataKt.DEFAULT_TIMEOUT : j, function2);
|
||||
}
|
||||
|
||||
public CoroutineLiveData(CoroutineContext context, long j, Function2<? super LiveDataScope<T>, ? super Continuation<? super Unit>, ? extends Object> block) {
|
||||
Intrinsics.checkNotNullParameter(context, "context");
|
||||
Intrinsics.checkNotNullParameter(block, "block");
|
||||
this.blockRunner = new BlockRunner<>(this, block, j, CoroutineScopeKt.CoroutineScope(Dispatchers.getMain().getImmediate().plus(context).plus(SupervisorKt.SupervisorJob((Job) context.get(Job.INSTANCE)))), new Function0<Unit>(this) { // from class: androidx.lifecycle.CoroutineLiveData.1
|
||||
final /* synthetic */ CoroutineLiveData<T> this$0;
|
||||
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
{
|
||||
super(0);
|
||||
this.this$0 = this;
|
||||
}
|
||||
|
||||
@Override // kotlin.jvm.functions.Function0
|
||||
public /* bridge */ /* synthetic */ Unit invoke() {
|
||||
invoke2();
|
||||
return Unit.INSTANCE;
|
||||
}
|
||||
|
||||
/* renamed from: invoke, reason: avoid collision after fix types in other method */
|
||||
public final void invoke2() {
|
||||
((CoroutineLiveData) this.this$0).blockRunner = null;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/* JADX WARN: Removed duplicated region for block: B:19:0x0069 A[RETURN] */
|
||||
/* JADX WARN: Removed duplicated region for block: B:20:0x0047 */
|
||||
/* JADX WARN: Removed duplicated region for block: B:8:0x0025 */
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct add '--show-bad-code' argument
|
||||
*/
|
||||
public final java.lang.Object emitSource$lifecycle_livedata_release(androidx.lifecycle.LiveData<T> r6, kotlin.coroutines.Continuation<? super kotlinx.coroutines.DisposableHandle> r7) {
|
||||
/*
|
||||
r5 = this;
|
||||
boolean r0 = r7 instanceof androidx.lifecycle.CoroutineLiveData$emitSource$1
|
||||
if (r0 == 0) goto L14
|
||||
r0 = r7
|
||||
androidx.lifecycle.CoroutineLiveData$emitSource$1 r0 = (androidx.lifecycle.CoroutineLiveData$emitSource$1) r0
|
||||
int r1 = r0.label
|
||||
r2 = -2147483648(0xffffffff80000000, float:-0.0)
|
||||
r1 = r1 & r2
|
||||
if (r1 == 0) goto L14
|
||||
int r7 = r0.label
|
||||
int r7 = r7 - r2
|
||||
r0.label = r7
|
||||
goto L19
|
||||
L14:
|
||||
androidx.lifecycle.CoroutineLiveData$emitSource$1 r0 = new androidx.lifecycle.CoroutineLiveData$emitSource$1
|
||||
r0.<init>(r5, r7)
|
||||
L19:
|
||||
java.lang.Object r7 = r0.result
|
||||
java.lang.Object r1 = kotlin.coroutines.intrinsics.IntrinsicsKt.getCOROUTINE_SUSPENDED()
|
||||
int r2 = r0.label
|
||||
r3 = 2
|
||||
r4 = 1
|
||||
if (r2 == 0) goto L47
|
||||
if (r2 == r4) goto L39
|
||||
if (r2 != r3) goto L31
|
||||
java.lang.Object r6 = r0.L$0
|
||||
androidx.lifecycle.CoroutineLiveData r6 = (androidx.lifecycle.CoroutineLiveData) r6
|
||||
kotlin.ResultKt.throwOnFailure(r7)
|
||||
goto L6a
|
||||
L31:
|
||||
java.lang.IllegalStateException r6 = new java.lang.IllegalStateException
|
||||
java.lang.String r7 = "call to 'resume' before 'invoke' with coroutine"
|
||||
r6.<init>(r7)
|
||||
throw r6
|
||||
L39:
|
||||
java.lang.Object r6 = r0.L$1
|
||||
androidx.lifecycle.LiveData r6 = (androidx.lifecycle.LiveData) r6
|
||||
java.lang.Object r2 = r0.L$0
|
||||
androidx.lifecycle.CoroutineLiveData r2 = (androidx.lifecycle.CoroutineLiveData) r2
|
||||
kotlin.ResultKt.throwOnFailure(r7)
|
||||
r7 = r6
|
||||
r6 = r2
|
||||
goto L59
|
||||
L47:
|
||||
kotlin.ResultKt.throwOnFailure(r7)
|
||||
r0.L$0 = r5
|
||||
r0.L$1 = r6
|
||||
r0.label = r4
|
||||
java.lang.Object r7 = r5.clearSource$lifecycle_livedata_release(r0)
|
||||
if (r7 != r1) goto L57
|
||||
return r1
|
||||
L57:
|
||||
r7 = r6
|
||||
r6 = r5
|
||||
L59:
|
||||
r2 = r6
|
||||
androidx.lifecycle.MediatorLiveData r2 = (androidx.lifecycle.MediatorLiveData) r2
|
||||
r0.L$0 = r6
|
||||
r4 = 0
|
||||
r0.L$1 = r4
|
||||
r0.label = r3
|
||||
java.lang.Object r7 = androidx.lifecycle.CoroutineLiveDataKt.addDisposableSource(r2, r7, r0)
|
||||
if (r7 != r1) goto L6a
|
||||
return r1
|
||||
L6a:
|
||||
androidx.lifecycle.EmittedSource r7 = (androidx.lifecycle.EmittedSource) r7
|
||||
r6.emittedSource = r7
|
||||
return r7
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: androidx.lifecycle.CoroutineLiveData.emitSource$lifecycle_livedata_release(androidx.lifecycle.LiveData, kotlin.coroutines.Continuation):java.lang.Object");
|
||||
}
|
||||
|
||||
/* JADX WARN: Removed duplicated region for block: B:15:0x0036 */
|
||||
/* JADX WARN: Removed duplicated region for block: B:8:0x0024 */
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct add '--show-bad-code' argument
|
||||
*/
|
||||
public final java.lang.Object clearSource$lifecycle_livedata_release(kotlin.coroutines.Continuation<? super kotlin.Unit> r5) {
|
||||
/*
|
||||
r4 = this;
|
||||
boolean r0 = r5 instanceof androidx.lifecycle.CoroutineLiveData$clearSource$1
|
||||
if (r0 == 0) goto L14
|
||||
r0 = r5
|
||||
androidx.lifecycle.CoroutineLiveData$clearSource$1 r0 = (androidx.lifecycle.CoroutineLiveData$clearSource$1) r0
|
||||
int r1 = r0.label
|
||||
r2 = -2147483648(0xffffffff80000000, float:-0.0)
|
||||
r1 = r1 & r2
|
||||
if (r1 == 0) goto L14
|
||||
int r5 = r0.label
|
||||
int r5 = r5 - r2
|
||||
r0.label = r5
|
||||
goto L19
|
||||
L14:
|
||||
androidx.lifecycle.CoroutineLiveData$clearSource$1 r0 = new androidx.lifecycle.CoroutineLiveData$clearSource$1
|
||||
r0.<init>(r4, r5)
|
||||
L19:
|
||||
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 L36
|
||||
if (r2 != r3) goto L2e
|
||||
java.lang.Object r0 = r0.L$0
|
||||
androidx.lifecycle.CoroutineLiveData r0 = (androidx.lifecycle.CoroutineLiveData) r0
|
||||
kotlin.ResultKt.throwOnFailure(r5)
|
||||
goto L49
|
||||
L2e:
|
||||
java.lang.IllegalStateException r5 = new java.lang.IllegalStateException
|
||||
java.lang.String r0 = "call to 'resume' before 'invoke' with coroutine"
|
||||
r5.<init>(r0)
|
||||
throw r5
|
||||
L36:
|
||||
kotlin.ResultKt.throwOnFailure(r5)
|
||||
androidx.lifecycle.EmittedSource r5 = r4.emittedSource
|
||||
if (r5 == 0) goto L48
|
||||
r0.L$0 = r4
|
||||
r0.label = r3
|
||||
java.lang.Object r5 = r5.disposeNow(r0)
|
||||
if (r5 != r1) goto L48
|
||||
return r1
|
||||
L48:
|
||||
r0 = r4
|
||||
L49:
|
||||
r5 = 0
|
||||
r0.emittedSource = r5
|
||||
kotlin.Unit r5 = kotlin.Unit.INSTANCE
|
||||
return r5
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: androidx.lifecycle.CoroutineLiveData.clearSource$lifecycle_livedata_release(kotlin.coroutines.Continuation):java.lang.Object");
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.MediatorLiveData, androidx.lifecycle.LiveData
|
||||
protected void onActive() {
|
||||
super.onActive();
|
||||
BlockRunner<T> blockRunner = this.blockRunner;
|
||||
if (blockRunner != null) {
|
||||
blockRunner.maybeRun();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.MediatorLiveData, androidx.lifecycle.LiveData
|
||||
protected void onInactive() {
|
||||
super.onInactive();
|
||||
BlockRunner<T> blockRunner = this.blockRunner;
|
||||
if (blockRunner != null) {
|
||||
blockRunner.cancel();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import kotlin.Metadata;
|
||||
import kotlin.ResultKt;
|
||||
import kotlin.Unit;
|
||||
import kotlin.coroutines.Continuation;
|
||||
import kotlin.coroutines.intrinsics.IntrinsicsKt;
|
||||
import kotlin.coroutines.jvm.internal.DebugMetadata;
|
||||
import kotlin.coroutines.jvm.internal.SuspendLambda;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.functions.Function2;
|
||||
import kotlinx.coroutines.CoroutineScope;
|
||||
|
||||
/* compiled from: CoroutineLiveData.kt */
|
||||
@Metadata(d1 = {"\u0000\f\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\u0010\u0003\u001a\u00020\u0002\"\u0004\b\u0000\u0010\u0000*\u00020\u0001H\u008a@"}, d2 = {"T", "Lkotlinx/coroutines/CoroutineScope;", "Landroidx/lifecycle/EmittedSource;", "<anonymous>"}, k = 3, mv = {1, 8, 0})
|
||||
@DebugMetadata(c = "androidx.lifecycle.CoroutineLiveDataKt$addDisposableSource$2", f = "CoroutineLiveData.kt", i = {}, l = {}, m = "invokeSuspend", n = {}, s = {})
|
||||
/* loaded from: classes.dex */
|
||||
final class CoroutineLiveDataKt$addDisposableSource$2 extends SuspendLambda implements Function2<CoroutineScope, Continuation<? super EmittedSource>, Object> {
|
||||
final /* synthetic */ LiveData<T> $source;
|
||||
final /* synthetic */ MediatorLiveData<T> $this_addDisposableSource;
|
||||
int label;
|
||||
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
CoroutineLiveDataKt$addDisposableSource$2(MediatorLiveData<T> mediatorLiveData, LiveData<T> liveData, Continuation<? super CoroutineLiveDataKt$addDisposableSource$2> continuation) {
|
||||
super(2, continuation);
|
||||
this.$this_addDisposableSource = mediatorLiveData;
|
||||
this.$source = liveData;
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
||||
public final Continuation<Unit> create(Object obj, Continuation<?> continuation) {
|
||||
return new CoroutineLiveDataKt$addDisposableSource$2(this.$this_addDisposableSource, this.$source, continuation);
|
||||
}
|
||||
|
||||
@Override // kotlin.jvm.functions.Function2
|
||||
public final Object invoke(CoroutineScope coroutineScope, Continuation<? super EmittedSource> continuation) {
|
||||
return ((CoroutineLiveDataKt$addDisposableSource$2) create(coroutineScope, continuation)).invokeSuspend(Unit.INSTANCE);
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
||||
public final Object invokeSuspend(Object obj) {
|
||||
IntrinsicsKt.getCOROUTINE_SUSPENDED();
|
||||
if (this.label == 0) {
|
||||
ResultKt.throwOnFailure(obj);
|
||||
MediatorLiveData<T> mediatorLiveData = this.$this_addDisposableSource;
|
||||
Object obj2 = this.$source;
|
||||
final MediatorLiveData<T> mediatorLiveData2 = this.$this_addDisposableSource;
|
||||
mediatorLiveData.addSource(obj2, new CoroutineLiveDataKt$sam$androidx_lifecycle_Observer$0(new Function1<T, Unit>() { // from class: androidx.lifecycle.CoroutineLiveDataKt$addDisposableSource$2.1
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
{
|
||||
super(1);
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // kotlin.jvm.functions.Function1
|
||||
public /* bridge */ /* synthetic */ Unit invoke(Object obj3) {
|
||||
invoke2((AnonymousClass1<T>) obj3);
|
||||
return Unit.INSTANCE;
|
||||
}
|
||||
|
||||
/* renamed from: invoke, reason: avoid collision after fix types in other method */
|
||||
public final void invoke2(T t) {
|
||||
mediatorLiveData2.setValue(t);
|
||||
}
|
||||
}));
|
||||
return new EmittedSource(this.$source, this.$this_addDisposableSource);
|
||||
}
|
||||
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import kotlin.Function;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.internal.FunctionAdapter;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: CoroutineLiveData.kt */
|
||||
@Metadata(k = 3, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
final class CoroutineLiveDataKt$sam$androidx_lifecycle_Observer$0 implements Observer, FunctionAdapter {
|
||||
private final /* synthetic */ Function1 function;
|
||||
|
||||
CoroutineLiveDataKt$sam$androidx_lifecycle_Observer$0(Function1 function) {
|
||||
Intrinsics.checkNotNullParameter(function, "function");
|
||||
this.function = function;
|
||||
}
|
||||
|
||||
public final boolean equals(Object obj) {
|
||||
if ((obj instanceof Observer) && (obj instanceof FunctionAdapter)) {
|
||||
return Intrinsics.areEqual(getFunctionDelegate(), ((FunctionAdapter) obj).getFunctionDelegate());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // kotlin.jvm.internal.FunctionAdapter
|
||||
public final Function<?> getFunctionDelegate() {
|
||||
return this.function;
|
||||
}
|
||||
|
||||
public final int hashCode() {
|
||||
return getFunctionDelegate().hashCode();
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.Observer
|
||||
public final /* synthetic */ void onChanged(Object obj) {
|
||||
this.function.invoke(obj);
|
||||
}
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import java.time.Duration;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.Unit;
|
||||
import kotlin.coroutines.Continuation;
|
||||
import kotlin.coroutines.CoroutineContext;
|
||||
import kotlin.coroutines.EmptyCoroutineContext;
|
||||
import kotlin.jvm.functions.Function2;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import kotlinx.coroutines.BuildersKt;
|
||||
import kotlinx.coroutines.Dispatchers;
|
||||
|
||||
/* compiled from: CoroutineLiveData.kt */
|
||||
@Metadata(d1 = {"\u0000D\n\u0000\n\u0002\u0010\t\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0002\u0010\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\u001aZ\u0010\u0002\u001a\b\u0012\u0004\u0012\u0002H\u00040\u0003\"\u0004\b\u0000\u0010\u00042\u0006\u0010\u0005\u001a\u00020\u00062\b\b\u0002\u0010\u0007\u001a\u00020\b2-\u0010\t\u001a)\b\u0001\u0012\n\u0012\b\u0012\u0004\u0012\u0002H\u00040\u000b\u0012\n\u0012\b\u0012\u0004\u0012\u00020\r0\f\u0012\u0006\u0012\u0004\u0018\u00010\u000e0\n¢\u0006\u0002\b\u000fH\u0007¢\u0006\u0002\u0010\u0010\u001a\\\u0010\u0002\u001a\b\u0012\u0004\u0012\u0002H\u00040\u0003\"\u0004\b\u0000\u0010\u00042\b\b\u0002\u0010\u0007\u001a\u00020\b2\b\b\u0002\u0010\u0011\u001a\u00020\u00012-\u0010\t\u001a)\b\u0001\u0012\n\u0012\b\u0012\u0004\u0012\u0002H\u00040\u000b\u0012\n\u0012\b\u0012\u0004\u0012\u00020\r0\f\u0012\u0006\u0012\u0004\u0018\u00010\u000e0\n¢\u0006\u0002\b\u000fH\u0007¢\u0006\u0002\u0010\u0012\u001a,\u0010\u0013\u001a\u00020\u0014\"\u0004\b\u0000\u0010\u0004*\b\u0012\u0004\u0012\u0002H\u00040\u00152\f\u0010\u0016\u001a\b\u0012\u0004\u0012\u0002H\u00040\u0003H\u0080@¢\u0006\u0002\u0010\u0017\"\u000e\u0010\u0000\u001a\u00020\u0001X\u0080T¢\u0006\u0002\n\u0000*`\b\u0000\u0010\u0018\u001a\u0004\b\u0000\u0010\u0004\")\b\u0001\u0012\n\u0012\b\u0012\u0004\u0012\u0002H\u00040\u000b\u0012\n\u0012\b\u0012\u0004\u0012\u00020\r0\f\u0012\u0006\u0012\u0004\u0018\u00010\u000e0\n¢\u0006\u0002\b\u000f2)\b\u0001\u0012\n\u0012\b\u0012\u0004\u0012\u0002H\u00040\u000b\u0012\n\u0012\b\u0012\u0004\u0012\u00020\r0\f\u0012\u0006\u0012\u0004\u0018\u00010\u000e0\n¢\u0006\u0002\b\u000f¨\u0006\u0019"}, d2 = {"DEFAULT_TIMEOUT", "", "liveData", "Landroidx/lifecycle/LiveData;", "T", "timeout", "Ljava/time/Duration;", "context", "Lkotlin/coroutines/CoroutineContext;", "block", "Lkotlin/Function2;", "Landroidx/lifecycle/LiveDataScope;", "Lkotlin/coroutines/Continuation;", "", "", "Lkotlin/ExtensionFunctionType;", "(Ljava/time/Duration;Lkotlin/coroutines/CoroutineContext;Lkotlin/jvm/functions/Function2;)Landroidx/lifecycle/LiveData;", "timeoutInMs", "(Lkotlin/coroutines/CoroutineContext;JLkotlin/jvm/functions/Function2;)Landroidx/lifecycle/LiveData;", "addDisposableSource", "Landroidx/lifecycle/EmittedSource;", "Landroidx/lifecycle/MediatorLiveData;", "source", "(Landroidx/lifecycle/MediatorLiveData;Landroidx/lifecycle/LiveData;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "Block", "lifecycle-livedata_release"}, k = 2, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class CoroutineLiveDataKt {
|
||||
public static final long DEFAULT_TIMEOUT = 5000;
|
||||
|
||||
public static final <T> LiveData<T> liveData(Duration timeout, Function2<? super LiveDataScope<T>, ? super Continuation<? super Unit>, ? extends Object> block) {
|
||||
Intrinsics.checkNotNullParameter(timeout, "timeout");
|
||||
Intrinsics.checkNotNullParameter(block, "block");
|
||||
return liveData$default(timeout, (CoroutineContext) null, block, 2, (Object) null);
|
||||
}
|
||||
|
||||
public static final <T> LiveData<T> liveData(CoroutineContext context, Function2<? super LiveDataScope<T>, ? super Continuation<? super Unit>, ? extends Object> block) {
|
||||
Intrinsics.checkNotNullParameter(context, "context");
|
||||
Intrinsics.checkNotNullParameter(block, "block");
|
||||
return liveData$default(context, 0L, block, 2, (Object) null);
|
||||
}
|
||||
|
||||
public static final <T> LiveData<T> liveData(Function2<? super LiveDataScope<T>, ? super Continuation<? super Unit>, ? extends Object> block) {
|
||||
Intrinsics.checkNotNullParameter(block, "block");
|
||||
return liveData$default((CoroutineContext) null, 0L, block, 3, (Object) null);
|
||||
}
|
||||
|
||||
public static final <T> Object addDisposableSource(MediatorLiveData<T> mediatorLiveData, LiveData<T> liveData, Continuation<? super EmittedSource> continuation) {
|
||||
return BuildersKt.withContext(Dispatchers.getMain().getImmediate(), new CoroutineLiveDataKt$addDisposableSource$2(mediatorLiveData, liveData, null), continuation);
|
||||
}
|
||||
|
||||
public static /* synthetic */ LiveData liveData$default(CoroutineContext coroutineContext, long j, Function2 function2, int i, Object obj) {
|
||||
if ((i & 1) != 0) {
|
||||
coroutineContext = EmptyCoroutineContext.INSTANCE;
|
||||
}
|
||||
if ((i & 2) != 0) {
|
||||
j = DEFAULT_TIMEOUT;
|
||||
}
|
||||
return liveData(coroutineContext, j, function2);
|
||||
}
|
||||
|
||||
public static final <T> LiveData<T> liveData(CoroutineContext context, long j, Function2<? super LiveDataScope<T>, ? super Continuation<? super Unit>, ? extends Object> block) {
|
||||
Intrinsics.checkNotNullParameter(context, "context");
|
||||
Intrinsics.checkNotNullParameter(block, "block");
|
||||
return new CoroutineLiveData(context, j, block);
|
||||
}
|
||||
|
||||
public static /* synthetic */ LiveData liveData$default(Duration duration, CoroutineContext coroutineContext, Function2 function2, int i, Object obj) {
|
||||
if ((i & 2) != 0) {
|
||||
coroutineContext = EmptyCoroutineContext.INSTANCE;
|
||||
}
|
||||
return liveData(duration, coroutineContext, function2);
|
||||
}
|
||||
|
||||
public static final <T> LiveData<T> liveData(Duration timeout, CoroutineContext context, Function2<? super LiveDataScope<T>, ? super Continuation<? super Unit>, ? extends Object> block) {
|
||||
Intrinsics.checkNotNullParameter(timeout, "timeout");
|
||||
Intrinsics.checkNotNullParameter(context, "context");
|
||||
Intrinsics.checkNotNullParameter(block, "block");
|
||||
return new CoroutineLiveData(context, Api26Impl.INSTANCE.toMillis(timeout), block);
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import kotlin.Metadata;
|
||||
|
||||
/* compiled from: DefaultLifecycleObserver.kt */
|
||||
@Metadata(d1 = {"\u0000\u0018\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0006\bf\u0018\u00002\u00020\u0001J\u0010\u0010\u0002\u001a\u00020\u00032\u0006\u0010\u0004\u001a\u00020\u0005H\u0016J\u0010\u0010\u0006\u001a\u00020\u00032\u0006\u0010\u0004\u001a\u00020\u0005H\u0016J\u0010\u0010\u0007\u001a\u00020\u00032\u0006\u0010\u0004\u001a\u00020\u0005H\u0016J\u0010\u0010\b\u001a\u00020\u00032\u0006\u0010\u0004\u001a\u00020\u0005H\u0016J\u0010\u0010\t\u001a\u00020\u00032\u0006\u0010\u0004\u001a\u00020\u0005H\u0016J\u0010\u0010\n\u001a\u00020\u00032\u0006\u0010\u0004\u001a\u00020\u0005H\u0016ø\u0001\u0000\u0082\u0002\u0006\n\u0004\b!0\u0001¨\u0006\u000bÀ\u0006\u0001"}, d2 = {"Landroidx/lifecycle/DefaultLifecycleObserver;", "Landroidx/lifecycle/LifecycleObserver;", "onCreate", "", "owner", "Landroidx/lifecycle/LifecycleOwner;", "onDestroy", "onPause", "onResume", "onStart", "onStop", "lifecycle-common"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public interface DefaultLifecycleObserver extends LifecycleObserver {
|
||||
|
||||
/* compiled from: DefaultLifecycleObserver.kt */
|
||||
/* renamed from: androidx.lifecycle.DefaultLifecycleObserver$-CC, reason: invalid class name */
|
||||
public final /* synthetic */ class CC {
|
||||
}
|
||||
|
||||
void onCreate(LifecycleOwner owner);
|
||||
|
||||
void onDestroy(LifecycleOwner owner);
|
||||
|
||||
void onPause(LifecycleOwner owner);
|
||||
|
||||
void onResume(LifecycleOwner owner);
|
||||
|
||||
void onStart(LifecycleOwner owner);
|
||||
|
||||
void onStop(LifecycleOwner owner);
|
||||
}
|
@ -0,0 +1,91 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import androidx.core.app.NotificationCompat;
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: DefaultLifecycleObserverAdapter.kt */
|
||||
@Metadata(d1 = {"\u0000$\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\b\u0000\u0018\u00002\u00020\u0001B\u0017\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\b\u0010\u0004\u001a\u0004\u0018\u00010\u0001¢\u0006\u0002\u0010\u0005J\u0018\u0010\u0006\u001a\u00020\u00072\u0006\u0010\b\u001a\u00020\t2\u0006\u0010\n\u001a\u00020\u000bH\u0016R\u000e\u0010\u0002\u001a\u00020\u0003X\u0082\u0004¢\u0006\u0002\n\u0000R\u0010\u0010\u0004\u001a\u0004\u0018\u00010\u0001X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\f"}, d2 = {"Landroidx/lifecycle/DefaultLifecycleObserverAdapter;", "Landroidx/lifecycle/LifecycleEventObserver;", "defaultLifecycleObserver", "Landroidx/lifecycle/DefaultLifecycleObserver;", "lifecycleEventObserver", "(Landroidx/lifecycle/DefaultLifecycleObserver;Landroidx/lifecycle/LifecycleEventObserver;)V", "onStateChanged", "", "source", "Landroidx/lifecycle/LifecycleOwner;", NotificationCompat.CATEGORY_EVENT, "Landroidx/lifecycle/Lifecycle$Event;", "lifecycle-common"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class DefaultLifecycleObserverAdapter implements LifecycleEventObserver {
|
||||
private final DefaultLifecycleObserver defaultLifecycleObserver;
|
||||
private final LifecycleEventObserver lifecycleEventObserver;
|
||||
|
||||
/* compiled from: DefaultLifecycleObserverAdapter.kt */
|
||||
@Metadata(k = 3, mv = {1, 8, 0}, xi = 48)
|
||||
public /* synthetic */ class WhenMappings {
|
||||
public static final /* synthetic */ int[] $EnumSwitchMapping$0;
|
||||
|
||||
static {
|
||||
int[] iArr = new int[Lifecycle.Event.values().length];
|
||||
try {
|
||||
iArr[Lifecycle.Event.ON_CREATE.ordinal()] = 1;
|
||||
} catch (NoSuchFieldError unused) {
|
||||
}
|
||||
try {
|
||||
iArr[Lifecycle.Event.ON_START.ordinal()] = 2;
|
||||
} catch (NoSuchFieldError unused2) {
|
||||
}
|
||||
try {
|
||||
iArr[Lifecycle.Event.ON_RESUME.ordinal()] = 3;
|
||||
} catch (NoSuchFieldError unused3) {
|
||||
}
|
||||
try {
|
||||
iArr[Lifecycle.Event.ON_PAUSE.ordinal()] = 4;
|
||||
} catch (NoSuchFieldError unused4) {
|
||||
}
|
||||
try {
|
||||
iArr[Lifecycle.Event.ON_STOP.ordinal()] = 5;
|
||||
} catch (NoSuchFieldError unused5) {
|
||||
}
|
||||
try {
|
||||
iArr[Lifecycle.Event.ON_DESTROY.ordinal()] = 6;
|
||||
} catch (NoSuchFieldError unused6) {
|
||||
}
|
||||
try {
|
||||
iArr[Lifecycle.Event.ON_ANY.ordinal()] = 7;
|
||||
} catch (NoSuchFieldError unused7) {
|
||||
}
|
||||
$EnumSwitchMapping$0 = iArr;
|
||||
}
|
||||
}
|
||||
|
||||
public DefaultLifecycleObserverAdapter(DefaultLifecycleObserver defaultLifecycleObserver, LifecycleEventObserver lifecycleEventObserver) {
|
||||
Intrinsics.checkNotNullParameter(defaultLifecycleObserver, "defaultLifecycleObserver");
|
||||
this.defaultLifecycleObserver = defaultLifecycleObserver;
|
||||
this.lifecycleEventObserver = lifecycleEventObserver;
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.LifecycleEventObserver
|
||||
public void onStateChanged(LifecycleOwner source, Lifecycle.Event event) {
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
Intrinsics.checkNotNullParameter(event, "event");
|
||||
switch (WhenMappings.$EnumSwitchMapping$0[event.ordinal()]) {
|
||||
case 1:
|
||||
this.defaultLifecycleObserver.onCreate(source);
|
||||
break;
|
||||
case 2:
|
||||
this.defaultLifecycleObserver.onStart(source);
|
||||
break;
|
||||
case 3:
|
||||
this.defaultLifecycleObserver.onResume(source);
|
||||
break;
|
||||
case 4:
|
||||
this.defaultLifecycleObserver.onPause(source);
|
||||
break;
|
||||
case 5:
|
||||
this.defaultLifecycleObserver.onStop(source);
|
||||
break;
|
||||
case 6:
|
||||
this.defaultLifecycleObserver.onDestroy(source);
|
||||
break;
|
||||
case 7:
|
||||
throw new IllegalArgumentException("ON_ANY must not been send by anybody");
|
||||
}
|
||||
LifecycleEventObserver lifecycleEventObserver = this.lifecycleEventObserver;
|
||||
if (lifecycleEventObserver != null) {
|
||||
lifecycleEventObserver.onStateChanged(source, event);
|
||||
}
|
||||
}
|
||||
}
|
89
02-Easy5/E5/sources/androidx/lifecycle/DispatchQueue.java
Normal file
89
02-Easy5/E5/sources/androidx/lifecycle/DispatchQueue.java
Normal file
@ -0,0 +1,89 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import java.util.ArrayDeque;
|
||||
import java.util.Queue;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.coroutines.CoroutineContext;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import kotlinx.coroutines.Dispatchers;
|
||||
import kotlinx.coroutines.MainCoroutineDispatcher;
|
||||
|
||||
/* compiled from: DispatchQueue.kt */
|
||||
@Metadata(d1 = {"\u0000.\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0007\b\u0000\u0018\u00002\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0002J\b\u0010\n\u001a\u00020\u0004H\u0007J\u0018\u0010\u000b\u001a\u00020\f2\u0006\u0010\r\u001a\u00020\u000e2\u0006\u0010\u000f\u001a\u00020\tH\u0007J\b\u0010\u0010\u001a\u00020\fH\u0007J\u0010\u0010\u0011\u001a\u00020\f2\u0006\u0010\u000f\u001a\u00020\tH\u0003J\b\u0010\u0012\u001a\u00020\fH\u0007J\b\u0010\u0013\u001a\u00020\fH\u0007J\b\u0010\u0014\u001a\u00020\fH\u0007R\u000e\u0010\u0003\u001a\u00020\u0004X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0005\u001a\u00020\u0004X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0006\u001a\u00020\u0004X\u0082\u000e¢\u0006\u0002\n\u0000R\u0014\u0010\u0007\u001a\b\u0012\u0004\u0012\u00020\t0\bX\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u0015"}, d2 = {"Landroidx/lifecycle/DispatchQueue;", "", "()V", "finished", "", "isDraining", "paused", "queue", "Ljava/util/Queue;", "Ljava/lang/Runnable;", "canRun", "dispatchAndEnqueue", "", "context", "Lkotlin/coroutines/CoroutineContext;", "runnable", "drainQueue", "enqueue", "finish", "pause", "resume", "lifecycle-common"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class DispatchQueue {
|
||||
private boolean finished;
|
||||
private boolean isDraining;
|
||||
private boolean paused = true;
|
||||
private final Queue<Runnable> queue = new ArrayDeque();
|
||||
|
||||
public final boolean canRun() {
|
||||
return this.finished || !this.paused;
|
||||
}
|
||||
|
||||
public final void pause() {
|
||||
this.paused = true;
|
||||
}
|
||||
|
||||
public final void resume() {
|
||||
if (this.paused) {
|
||||
if (!(!this.finished)) {
|
||||
throw new IllegalStateException("Cannot resume a finished dispatcher".toString());
|
||||
}
|
||||
this.paused = false;
|
||||
drainQueue();
|
||||
}
|
||||
}
|
||||
|
||||
public final void finish() {
|
||||
this.finished = true;
|
||||
drainQueue();
|
||||
}
|
||||
|
||||
public final void drainQueue() {
|
||||
if (this.isDraining) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
this.isDraining = true;
|
||||
while ((!this.queue.isEmpty()) && canRun()) {
|
||||
Runnable poll = this.queue.poll();
|
||||
if (poll != null) {
|
||||
poll.run();
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
this.isDraining = false;
|
||||
}
|
||||
}
|
||||
|
||||
public final void dispatchAndEnqueue(CoroutineContext context, final Runnable runnable) {
|
||||
Intrinsics.checkNotNullParameter(context, "context");
|
||||
Intrinsics.checkNotNullParameter(runnable, "runnable");
|
||||
MainCoroutineDispatcher immediate = Dispatchers.getMain().getImmediate();
|
||||
if (immediate.isDispatchNeeded(context) || canRun()) {
|
||||
immediate.mo1907dispatch(context, new Runnable() { // from class: androidx.lifecycle.DispatchQueue$$ExternalSyntheticLambda0
|
||||
@Override // java.lang.Runnable
|
||||
public final void run() {
|
||||
DispatchQueue.dispatchAndEnqueue$lambda$2$lambda$1(DispatchQueue.this, runnable);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
enqueue(runnable);
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public static final void dispatchAndEnqueue$lambda$2$lambda$1(DispatchQueue this$0, Runnable runnable) {
|
||||
Intrinsics.checkNotNullParameter(this$0, "this$0");
|
||||
Intrinsics.checkNotNullParameter(runnable, "$runnable");
|
||||
this$0.enqueue(runnable);
|
||||
}
|
||||
|
||||
private final void enqueue(Runnable runnable) {
|
||||
if (!this.queue.offer(runnable)) {
|
||||
throw new IllegalStateException("cannot enqueue any more runnables".toString());
|
||||
}
|
||||
drainQueue();
|
||||
}
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import kotlin.Metadata;
|
||||
import kotlin.ResultKt;
|
||||
import kotlin.Unit;
|
||||
import kotlin.coroutines.Continuation;
|
||||
import kotlin.coroutines.intrinsics.IntrinsicsKt;
|
||||
import kotlin.coroutines.jvm.internal.DebugMetadata;
|
||||
import kotlin.coroutines.jvm.internal.SuspendLambda;
|
||||
import kotlin.jvm.functions.Function2;
|
||||
import kotlinx.coroutines.CoroutineScope;
|
||||
|
||||
/* compiled from: CoroutineLiveData.kt */
|
||||
@Metadata(d1 = {"\u0000\n\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0000\u0010\u0002\u001a\u00020\u0001*\u00020\u0000H\u008a@"}, d2 = {"Lkotlinx/coroutines/CoroutineScope;", "", "<anonymous>"}, k = 3, mv = {1, 8, 0})
|
||||
@DebugMetadata(c = "androidx.lifecycle.EmittedSource$dispose$1", f = "CoroutineLiveData.kt", i = {}, l = {}, m = "invokeSuspend", n = {}, s = {})
|
||||
/* loaded from: classes.dex */
|
||||
final class EmittedSource$dispose$1 extends SuspendLambda implements Function2<CoroutineScope, Continuation<? super Unit>, Object> {
|
||||
int label;
|
||||
final /* synthetic */ EmittedSource this$0;
|
||||
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
EmittedSource$dispose$1(EmittedSource emittedSource, Continuation<? super EmittedSource$dispose$1> continuation) {
|
||||
super(2, continuation);
|
||||
this.this$0 = emittedSource;
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
||||
public final Continuation<Unit> create(Object obj, Continuation<?> continuation) {
|
||||
return new EmittedSource$dispose$1(this.this$0, continuation);
|
||||
}
|
||||
|
||||
@Override // kotlin.jvm.functions.Function2
|
||||
public final Object invoke(CoroutineScope coroutineScope, Continuation<? super Unit> continuation) {
|
||||
return ((EmittedSource$dispose$1) create(coroutineScope, continuation)).invokeSuspend(Unit.INSTANCE);
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
||||
public final Object invokeSuspend(Object obj) {
|
||||
IntrinsicsKt.getCOROUTINE_SUSPENDED();
|
||||
if (this.label == 0) {
|
||||
ResultKt.throwOnFailure(obj);
|
||||
this.this$0.removeSource();
|
||||
return Unit.INSTANCE;
|
||||
}
|
||||
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
|
||||
}
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import kotlin.Metadata;
|
||||
import kotlin.ResultKt;
|
||||
import kotlin.Unit;
|
||||
import kotlin.coroutines.Continuation;
|
||||
import kotlin.coroutines.intrinsics.IntrinsicsKt;
|
||||
import kotlin.coroutines.jvm.internal.DebugMetadata;
|
||||
import kotlin.coroutines.jvm.internal.SuspendLambda;
|
||||
import kotlin.jvm.functions.Function2;
|
||||
import kotlinx.coroutines.CoroutineScope;
|
||||
|
||||
/* compiled from: CoroutineLiveData.kt */
|
||||
@Metadata(d1 = {"\u0000\n\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0000\u0010\u0002\u001a\u00020\u0001*\u00020\u0000H\u008a@"}, d2 = {"Lkotlinx/coroutines/CoroutineScope;", "", "<anonymous>"}, k = 3, mv = {1, 8, 0})
|
||||
@DebugMetadata(c = "androidx.lifecycle.EmittedSource$disposeNow$2", f = "CoroutineLiveData.kt", i = {}, l = {}, m = "invokeSuspend", n = {}, s = {})
|
||||
/* loaded from: classes.dex */
|
||||
final class EmittedSource$disposeNow$2 extends SuspendLambda implements Function2<CoroutineScope, Continuation<? super Unit>, Object> {
|
||||
int label;
|
||||
final /* synthetic */ EmittedSource this$0;
|
||||
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
EmittedSource$disposeNow$2(EmittedSource emittedSource, Continuation<? super EmittedSource$disposeNow$2> continuation) {
|
||||
super(2, continuation);
|
||||
this.this$0 = emittedSource;
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
||||
public final Continuation<Unit> create(Object obj, Continuation<?> continuation) {
|
||||
return new EmittedSource$disposeNow$2(this.this$0, continuation);
|
||||
}
|
||||
|
||||
@Override // kotlin.jvm.functions.Function2
|
||||
public final Object invoke(CoroutineScope coroutineScope, Continuation<? super Unit> continuation) {
|
||||
return ((EmittedSource$disposeNow$2) create(coroutineScope, continuation)).invokeSuspend(Unit.INSTANCE);
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
||||
public final Object invokeSuspend(Object obj) {
|
||||
IntrinsicsKt.getCOROUTINE_SUSPENDED();
|
||||
if (this.label == 0) {
|
||||
ResultKt.throwOnFailure(obj);
|
||||
this.this$0.removeSource();
|
||||
return Unit.INSTANCE;
|
||||
}
|
||||
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
|
||||
}
|
||||
}
|
47
02-Easy5/E5/sources/androidx/lifecycle/EmittedSource.java
Normal file
47
02-Easy5/E5/sources/androidx/lifecycle/EmittedSource.java
Normal file
@ -0,0 +1,47 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import kotlin.Metadata;
|
||||
import kotlin.Unit;
|
||||
import kotlin.coroutines.Continuation;
|
||||
import kotlin.coroutines.intrinsics.IntrinsicsKt;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import kotlinx.coroutines.BuildersKt;
|
||||
import kotlinx.coroutines.BuildersKt__Builders_commonKt;
|
||||
import kotlinx.coroutines.CoroutineScopeKt;
|
||||
import kotlinx.coroutines.Dispatchers;
|
||||
import kotlinx.coroutines.DisposableHandle;
|
||||
|
||||
/* compiled from: CoroutineLiveData.kt */
|
||||
@Metadata(d1 = {"\u0000&\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0004\b\u0000\u0018\u00002\u00020\u0001B\u001d\u0012\n\u0010\u0002\u001a\u0006\u0012\u0002\b\u00030\u0003\u0012\n\u0010\u0004\u001a\u0006\u0012\u0002\b\u00030\u0005¢\u0006\u0002\u0010\u0006J\b\u0010\t\u001a\u00020\nH\u0016J\u000e\u0010\u000b\u001a\u00020\nH\u0086@¢\u0006\u0002\u0010\fJ\b\u0010\r\u001a\u00020\nH\u0003R\u000e\u0010\u0007\u001a\u00020\bX\u0082\u000e¢\u0006\u0002\n\u0000R\u0012\u0010\u0004\u001a\u0006\u0012\u0002\b\u00030\u0005X\u0082\u0004¢\u0006\u0002\n\u0000R\u0012\u0010\u0002\u001a\u0006\u0012\u0002\b\u00030\u0003X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u000e"}, d2 = {"Landroidx/lifecycle/EmittedSource;", "Lkotlinx/coroutines/DisposableHandle;", "source", "Landroidx/lifecycle/LiveData;", "mediator", "Landroidx/lifecycle/MediatorLiveData;", "(Landroidx/lifecycle/LiveData;Landroidx/lifecycle/MediatorLiveData;)V", "disposed", "", "dispose", "", "disposeNow", "(Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "removeSource", "lifecycle-livedata_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class EmittedSource implements DisposableHandle {
|
||||
private boolean disposed;
|
||||
private final MediatorLiveData<?> mediator;
|
||||
private final LiveData<?> source;
|
||||
|
||||
public EmittedSource(LiveData<?> source, MediatorLiveData<?> mediator) {
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
Intrinsics.checkNotNullParameter(mediator, "mediator");
|
||||
this.source = source;
|
||||
this.mediator = mediator;
|
||||
}
|
||||
|
||||
public final Object disposeNow(Continuation<? super Unit> continuation) {
|
||||
Object withContext = BuildersKt.withContext(Dispatchers.getMain().getImmediate(), new EmittedSource$disposeNow$2(this, null), continuation);
|
||||
return withContext == IntrinsicsKt.getCOROUTINE_SUSPENDED() ? withContext : Unit.INSTANCE;
|
||||
}
|
||||
|
||||
@Override // kotlinx.coroutines.DisposableHandle
|
||||
public void dispose() {
|
||||
BuildersKt__Builders_commonKt.launch$default(CoroutineScopeKt.CoroutineScope(Dispatchers.getMain().getImmediate()), null, null, new EmittedSource$dispose$1(this, null), 3, null);
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public final void removeSource() {
|
||||
if (this.disposed) {
|
||||
return;
|
||||
}
|
||||
this.mediator.removeSource(this.source);
|
||||
this.disposed = true;
|
||||
}
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Application;
|
||||
import android.os.Bundle;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: EmptyActivityLifecycleCallbacks.kt */
|
||||
@Metadata(d1 = {"\u0000 \n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\b\b\u0010\u0018\u00002\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0002J\u001a\u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u00062\b\u0010\u0007\u001a\u0004\u0018\u00010\bH\u0016J\u0010\u0010\t\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0006H\u0016J\u0010\u0010\n\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0006H\u0016J\u0010\u0010\u000b\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0006H\u0016J\u0018\u0010\f\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u00062\u0006\u0010\r\u001a\u00020\bH\u0016J\u0010\u0010\u000e\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0006H\u0016J\u0010\u0010\u000f\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0006H\u0016¨\u0006\u0010"}, d2 = {"Landroidx/lifecycle/EmptyActivityLifecycleCallbacks;", "Landroid/app/Application$ActivityLifecycleCallbacks;", "()V", "onActivityCreated", "", "activity", "Landroid/app/Activity;", "savedInstanceState", "Landroid/os/Bundle;", "onActivityDestroyed", "onActivityPaused", "onActivityResumed", "onActivitySaveInstanceState", "outState", "onActivityStarted", "onActivityStopped", "lifecycle-process_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public class EmptyActivityLifecycleCallbacks implements Application.ActivityLifecycleCallbacks {
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
|
||||
Intrinsics.checkNotNullParameter(activity, "activity");
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivityDestroyed(Activity activity) {
|
||||
Intrinsics.checkNotNullParameter(activity, "activity");
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivityPaused(Activity activity) {
|
||||
Intrinsics.checkNotNullParameter(activity, "activity");
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivityResumed(Activity activity) {
|
||||
Intrinsics.checkNotNullParameter(activity, "activity");
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivitySaveInstanceState(Activity activity, Bundle outState) {
|
||||
Intrinsics.checkNotNullParameter(activity, "activity");
|
||||
Intrinsics.checkNotNullParameter(outState, "outState");
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivityStarted(Activity activity) {
|
||||
Intrinsics.checkNotNullParameter(activity, "activity");
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivityStopped(Activity activity) {
|
||||
Intrinsics.checkNotNullParameter(activity, "activity");
|
||||
}
|
||||
}
|
@ -0,0 +1,184 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import kotlin.Metadata;
|
||||
import kotlin.ResultKt;
|
||||
import kotlin.Unit;
|
||||
import kotlin.coroutines.Continuation;
|
||||
import kotlin.coroutines.intrinsics.IntrinsicsKt;
|
||||
import kotlin.coroutines.jvm.internal.DebugMetadata;
|
||||
import kotlin.coroutines.jvm.internal.SuspendLambda;
|
||||
import kotlin.jvm.functions.Function0;
|
||||
import kotlin.jvm.functions.Function2;
|
||||
import kotlinx.coroutines.BuildersKt;
|
||||
import kotlinx.coroutines.BuildersKt__Builders_commonKt;
|
||||
import kotlinx.coroutines.CoroutineScope;
|
||||
import kotlinx.coroutines.Dispatchers;
|
||||
import kotlinx.coroutines.GlobalScope;
|
||||
import kotlinx.coroutines.channels.ProduceKt;
|
||||
import kotlinx.coroutines.channels.ProducerScope;
|
||||
|
||||
/* JADX INFO: Add missing generic type declarations: [T] */
|
||||
/* compiled from: FlowLiveData.kt */
|
||||
@Metadata(d1 = {"\u0000\f\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0000\u0010\u0003\u001a\u00020\u0002\"\u0004\b\u0000\u0010\u0000*\b\u0012\u0004\u0012\u00028\u00000\u0001H\u008a@"}, d2 = {"T", "Lkotlinx/coroutines/channels/ProducerScope;", "", "<anonymous>"}, k = 3, mv = {1, 8, 0})
|
||||
@DebugMetadata(c = "androidx.lifecycle.FlowLiveDataConversions$asFlow$1", f = "FlowLiveData.kt", i = {0, 0}, l = {112, 116}, m = "invokeSuspend", n = {"$this$callbackFlow", "observer"}, s = {"L$0", "L$1"})
|
||||
/* loaded from: classes.dex */
|
||||
final class FlowLiveDataConversions$asFlow$1<T> extends SuspendLambda implements Function2<ProducerScope<? super T>, Continuation<? super Unit>, Object> {
|
||||
final /* synthetic */ LiveData<T> $this_asFlow;
|
||||
private /* synthetic */ Object L$0;
|
||||
Object L$1;
|
||||
int label;
|
||||
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
FlowLiveDataConversions$asFlow$1(LiveData<T> liveData, Continuation<? super FlowLiveDataConversions$asFlow$1> continuation) {
|
||||
super(2, continuation);
|
||||
this.$this_asFlow = liveData;
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
||||
public final Continuation<Unit> create(Object obj, Continuation<?> continuation) {
|
||||
FlowLiveDataConversions$asFlow$1 flowLiveDataConversions$asFlow$1 = new FlowLiveDataConversions$asFlow$1(this.$this_asFlow, continuation);
|
||||
flowLiveDataConversions$asFlow$1.L$0 = obj;
|
||||
return flowLiveDataConversions$asFlow$1;
|
||||
}
|
||||
|
||||
@Override // kotlin.jvm.functions.Function2
|
||||
public final Object invoke(ProducerScope<? super T> producerScope, Continuation<? super Unit> continuation) {
|
||||
return ((FlowLiveDataConversions$asFlow$1) create(producerScope, continuation)).invokeSuspend(Unit.INSTANCE);
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
||||
public final Object invokeSuspend(Object obj) {
|
||||
final Observer observer;
|
||||
ProducerScope producerScope;
|
||||
Object coroutine_suspended = IntrinsicsKt.getCOROUTINE_SUSPENDED();
|
||||
int i = this.label;
|
||||
if (i == 0) {
|
||||
ResultKt.throwOnFailure(obj);
|
||||
final ProducerScope producerScope2 = (ProducerScope) this.L$0;
|
||||
observer = new Observer() { // from class: androidx.lifecycle.FlowLiveDataConversions$asFlow$1$$ExternalSyntheticLambda0
|
||||
@Override // androidx.lifecycle.Observer
|
||||
public final void onChanged(Object obj2) {
|
||||
ProducerScope.this.mo1852trySendJP2dKIU(obj2);
|
||||
}
|
||||
};
|
||||
this.L$0 = producerScope2;
|
||||
this.L$1 = observer;
|
||||
this.label = 1;
|
||||
if (BuildersKt.withContext(Dispatchers.getMain().getImmediate(), new AnonymousClass1(this.$this_asFlow, observer, null), this) == coroutine_suspended) {
|
||||
return coroutine_suspended;
|
||||
}
|
||||
producerScope = producerScope2;
|
||||
} else {
|
||||
if (i != 1) {
|
||||
if (i != 2) {
|
||||
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
|
||||
}
|
||||
ResultKt.throwOnFailure(obj);
|
||||
return Unit.INSTANCE;
|
||||
}
|
||||
observer = (Observer) this.L$1;
|
||||
producerScope = (ProducerScope) this.L$0;
|
||||
ResultKt.throwOnFailure(obj);
|
||||
}
|
||||
final LiveData<T> liveData = this.$this_asFlow;
|
||||
this.L$0 = null;
|
||||
this.L$1 = null;
|
||||
this.label = 2;
|
||||
if (ProduceKt.awaitClose(producerScope, new Function0<Unit>() { // from class: androidx.lifecycle.FlowLiveDataConversions$asFlow$1.2
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
{
|
||||
super(0);
|
||||
}
|
||||
|
||||
/* compiled from: FlowLiveData.kt */
|
||||
@Metadata(d1 = {"\u0000\f\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0000\u0010\u0003\u001a\u00020\u0002\"\u0004\b\u0000\u0010\u0000*\u00020\u0001H\u008a@"}, d2 = {"T", "Lkotlinx/coroutines/CoroutineScope;", "", "<anonymous>"}, k = 3, mv = {1, 8, 0})
|
||||
@DebugMetadata(c = "androidx.lifecycle.FlowLiveDataConversions$asFlow$1$2$1", f = "FlowLiveData.kt", i = {}, l = {}, m = "invokeSuspend", n = {}, s = {})
|
||||
/* renamed from: androidx.lifecycle.FlowLiveDataConversions$asFlow$1$2$1, reason: invalid class name */
|
||||
static final class AnonymousClass1 extends SuspendLambda implements Function2<CoroutineScope, Continuation<? super Unit>, Object> {
|
||||
final /* synthetic */ Observer<T> $observer;
|
||||
final /* synthetic */ LiveData<T> $this_asFlow;
|
||||
int label;
|
||||
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
AnonymousClass1(LiveData<T> liveData, Observer<T> observer, Continuation<? super AnonymousClass1> continuation) {
|
||||
super(2, continuation);
|
||||
this.$this_asFlow = liveData;
|
||||
this.$observer = observer;
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
||||
public final Continuation<Unit> create(Object obj, Continuation<?> continuation) {
|
||||
return new AnonymousClass1(this.$this_asFlow, this.$observer, continuation);
|
||||
}
|
||||
|
||||
@Override // kotlin.jvm.functions.Function2
|
||||
public final Object invoke(CoroutineScope coroutineScope, Continuation<? super Unit> continuation) {
|
||||
return ((AnonymousClass1) create(coroutineScope, continuation)).invokeSuspend(Unit.INSTANCE);
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
||||
public final Object invokeSuspend(Object obj) {
|
||||
IntrinsicsKt.getCOROUTINE_SUSPENDED();
|
||||
if (this.label == 0) {
|
||||
ResultKt.throwOnFailure(obj);
|
||||
this.$this_asFlow.removeObserver(this.$observer);
|
||||
return Unit.INSTANCE;
|
||||
}
|
||||
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
|
||||
}
|
||||
}
|
||||
|
||||
@Override // kotlin.jvm.functions.Function0
|
||||
public /* bridge */ /* synthetic */ Unit invoke() {
|
||||
invoke2();
|
||||
return Unit.INSTANCE;
|
||||
}
|
||||
|
||||
/* renamed from: invoke, reason: avoid collision after fix types in other method */
|
||||
public final void invoke2() {
|
||||
BuildersKt__Builders_commonKt.launch$default(GlobalScope.INSTANCE, Dispatchers.getMain().getImmediate(), null, new AnonymousClass1(liveData, observer, null), 2, null);
|
||||
}
|
||||
}, this) == coroutine_suspended) {
|
||||
return coroutine_suspended;
|
||||
}
|
||||
return Unit.INSTANCE;
|
||||
}
|
||||
|
||||
/* compiled from: FlowLiveData.kt */
|
||||
@Metadata(d1 = {"\u0000\f\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0000\u0010\u0003\u001a\u00020\u0002\"\u0004\b\u0000\u0010\u0000*\u00020\u0001H\u008a@"}, d2 = {"T", "Lkotlinx/coroutines/CoroutineScope;", "", "<anonymous>"}, k = 3, mv = {1, 8, 0})
|
||||
@DebugMetadata(c = "androidx.lifecycle.FlowLiveDataConversions$asFlow$1$1", f = "FlowLiveData.kt", i = {}, l = {}, m = "invokeSuspend", n = {}, s = {})
|
||||
/* renamed from: androidx.lifecycle.FlowLiveDataConversions$asFlow$1$1, reason: invalid class name */
|
||||
static final class AnonymousClass1 extends SuspendLambda implements Function2<CoroutineScope, Continuation<? super Unit>, Object> {
|
||||
final /* synthetic */ Observer<T> $observer;
|
||||
final /* synthetic */ LiveData<T> $this_asFlow;
|
||||
int label;
|
||||
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
AnonymousClass1(LiveData<T> liveData, Observer<T> observer, Continuation<? super AnonymousClass1> continuation) {
|
||||
super(2, continuation);
|
||||
this.$this_asFlow = liveData;
|
||||
this.$observer = observer;
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
||||
public final Continuation<Unit> create(Object obj, Continuation<?> continuation) {
|
||||
return new AnonymousClass1(this.$this_asFlow, this.$observer, continuation);
|
||||
}
|
||||
|
||||
@Override // kotlin.jvm.functions.Function2
|
||||
public final Object invoke(CoroutineScope coroutineScope, Continuation<? super Unit> continuation) {
|
||||
return ((AnonymousClass1) create(coroutineScope, continuation)).invokeSuspend(Unit.INSTANCE);
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
||||
public final Object invokeSuspend(Object obj) {
|
||||
IntrinsicsKt.getCOROUTINE_SUSPENDED();
|
||||
if (this.label == 0) {
|
||||
ResultKt.throwOnFailure(obj);
|
||||
this.$this_asFlow.observeForever(this.$observer);
|
||||
return Unit.INSTANCE;
|
||||
}
|
||||
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import kotlin.Metadata;
|
||||
import kotlin.ResultKt;
|
||||
import kotlin.Unit;
|
||||
import kotlin.coroutines.Continuation;
|
||||
import kotlin.coroutines.intrinsics.IntrinsicsKt;
|
||||
import kotlin.coroutines.jvm.internal.DebugMetadata;
|
||||
import kotlin.coroutines.jvm.internal.SuspendLambda;
|
||||
import kotlin.jvm.functions.Function2;
|
||||
import kotlinx.coroutines.flow.Flow;
|
||||
import kotlinx.coroutines.flow.FlowCollector;
|
||||
|
||||
/* JADX INFO: Add missing generic type declarations: [T] */
|
||||
/* compiled from: FlowLiveData.kt */
|
||||
@Metadata(d1 = {"\u0000\f\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0000\u0010\u0003\u001a\u00020\u0002\"\u0004\b\u0000\u0010\u0000*\b\u0012\u0004\u0012\u00028\u00000\u0001H\u008a@"}, d2 = {"T", "Landroidx/lifecycle/LiveDataScope;", "", "<anonymous>"}, k = 3, mv = {1, 8, 0})
|
||||
@DebugMetadata(c = "androidx.lifecycle.FlowLiveDataConversions$asLiveData$1", f = "FlowLiveData.kt", i = {}, l = {81}, m = "invokeSuspend", n = {}, s = {})
|
||||
/* loaded from: classes.dex */
|
||||
final class FlowLiveDataConversions$asLiveData$1<T> extends SuspendLambda implements Function2<LiveDataScope<T>, Continuation<? super Unit>, Object> {
|
||||
final /* synthetic */ Flow<T> $this_asLiveData;
|
||||
private /* synthetic */ Object L$0;
|
||||
int label;
|
||||
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
FlowLiveDataConversions$asLiveData$1(Flow<? extends T> flow, Continuation<? super FlowLiveDataConversions$asLiveData$1> continuation) {
|
||||
super(2, continuation);
|
||||
this.$this_asLiveData = flow;
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
||||
public final Continuation<Unit> create(Object obj, Continuation<?> continuation) {
|
||||
FlowLiveDataConversions$asLiveData$1 flowLiveDataConversions$asLiveData$1 = new FlowLiveDataConversions$asLiveData$1(this.$this_asLiveData, continuation);
|
||||
flowLiveDataConversions$asLiveData$1.L$0 = obj;
|
||||
return flowLiveDataConversions$asLiveData$1;
|
||||
}
|
||||
|
||||
@Override // kotlin.jvm.functions.Function2
|
||||
public final Object invoke(LiveDataScope<T> liveDataScope, Continuation<? super Unit> continuation) {
|
||||
return ((FlowLiveDataConversions$asLiveData$1) create(liveDataScope, continuation)).invokeSuspend(Unit.INSTANCE);
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
||||
public final Object invokeSuspend(Object obj) {
|
||||
Object coroutine_suspended = IntrinsicsKt.getCOROUTINE_SUSPENDED();
|
||||
int i = this.label;
|
||||
if (i == 0) {
|
||||
ResultKt.throwOnFailure(obj);
|
||||
final LiveDataScope liveDataScope = (LiveDataScope) this.L$0;
|
||||
this.label = 1;
|
||||
if (this.$this_asLiveData.collect(new FlowCollector() { // from class: androidx.lifecycle.FlowLiveDataConversions$asLiveData$1.1
|
||||
@Override // kotlinx.coroutines.flow.FlowCollector
|
||||
public final Object emit(T t, Continuation<? super Unit> continuation) {
|
||||
Object emit = liveDataScope.emit(t, continuation);
|
||||
return emit == IntrinsicsKt.getCOROUTINE_SUSPENDED() ? emit : Unit.INSTANCE;
|
||||
}
|
||||
}, this) == coroutine_suspended) {
|
||||
return coroutine_suspended;
|
||||
}
|
||||
} else {
|
||||
if (i != 1) {
|
||||
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
|
||||
}
|
||||
ResultKt.throwOnFailure(obj);
|
||||
}
|
||||
return Unit.INSTANCE;
|
||||
}
|
||||
}
|
@ -0,0 +1,72 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import androidx.arch.core.executor.ArchTaskExecutor;
|
||||
import androidx.loader.app.LoaderManagerImpl;
|
||||
import java.time.Duration;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.coroutines.CoroutineContext;
|
||||
import kotlin.coroutines.EmptyCoroutineContext;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import kotlinx.coroutines.flow.Flow;
|
||||
import kotlinx.coroutines.flow.FlowKt;
|
||||
import kotlinx.coroutines.flow.StateFlow;
|
||||
|
||||
/* compiled from: FlowLiveData.kt */
|
||||
@Metadata(d1 = {"\u0000\"\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\t\n\u0000\u001a\u001c\u0010\u0000\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0001\"\u0004\b\u0000\u0010\u0002*\b\u0012\u0004\u0012\u0002H\u00020\u0003\u001a0\u0010\u0004\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0003\"\u0004\b\u0000\u0010\u0002*\b\u0012\u0004\u0012\u0002H\u00020\u00012\u0006\u0010\u0005\u001a\u00020\u00062\b\b\u0002\u0010\u0007\u001a\u00020\bH\u0007\u001a2\u0010\u0004\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0003\"\u0004\b\u0000\u0010\u0002*\b\u0012\u0004\u0012\u0002H\u00020\u00012\b\b\u0002\u0010\u0007\u001a\u00020\b2\b\b\u0002\u0010\t\u001a\u00020\nH\u0007¨\u0006\u000b"}, d2 = {"asFlow", "Lkotlinx/coroutines/flow/Flow;", "T", "Landroidx/lifecycle/LiveData;", "asLiveData", "timeout", "Ljava/time/Duration;", "context", "Lkotlin/coroutines/CoroutineContext;", "timeoutInMs", "", "lifecycle-livedata_release"}, k = 2, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class FlowLiveDataConversions {
|
||||
public static final <T> LiveData<T> asLiveData(Flow<? extends T> flow) {
|
||||
Intrinsics.checkNotNullParameter(flow, "<this>");
|
||||
return asLiveData$default(flow, (CoroutineContext) null, 0L, 3, (Object) null);
|
||||
}
|
||||
|
||||
public static final <T> LiveData<T> asLiveData(Flow<? extends T> flow, CoroutineContext context) {
|
||||
Intrinsics.checkNotNullParameter(flow, "<this>");
|
||||
Intrinsics.checkNotNullParameter(context, "context");
|
||||
return asLiveData$default(flow, context, 0L, 2, (Object) null);
|
||||
}
|
||||
|
||||
public static /* synthetic */ LiveData asLiveData$default(Flow flow, CoroutineContext coroutineContext, long j, int i, Object obj) {
|
||||
if ((i & 1) != 0) {
|
||||
coroutineContext = EmptyCoroutineContext.INSTANCE;
|
||||
}
|
||||
if ((i & 2) != 0) {
|
||||
j = CoroutineLiveDataKt.DEFAULT_TIMEOUT;
|
||||
}
|
||||
return asLiveData(flow, coroutineContext, j);
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public static final <T> LiveData<T> asLiveData(Flow<? extends T> flow, CoroutineContext context, long j) {
|
||||
Intrinsics.checkNotNullParameter(flow, "<this>");
|
||||
Intrinsics.checkNotNullParameter(context, "context");
|
||||
LoaderManagerImpl.LoaderInfo loaderInfo = (LiveData<T>) CoroutineLiveDataKt.liveData(context, j, new FlowLiveDataConversions$asLiveData$1(flow, null));
|
||||
if (flow instanceof StateFlow) {
|
||||
if (ArchTaskExecutor.getInstance().isMainThread()) {
|
||||
loaderInfo.setValue(((StateFlow) flow).getValue());
|
||||
} else {
|
||||
loaderInfo.postValue(((StateFlow) flow).getValue());
|
||||
}
|
||||
}
|
||||
return loaderInfo;
|
||||
}
|
||||
|
||||
public static final <T> Flow<T> asFlow(LiveData<T> liveData) {
|
||||
Intrinsics.checkNotNullParameter(liveData, "<this>");
|
||||
return FlowKt.conflate(FlowKt.callbackFlow(new FlowLiveDataConversions$asFlow$1(liveData, null)));
|
||||
}
|
||||
|
||||
public static /* synthetic */ LiveData asLiveData$default(Flow flow, Duration duration, CoroutineContext coroutineContext, int i, Object obj) {
|
||||
if ((i & 2) != 0) {
|
||||
coroutineContext = EmptyCoroutineContext.INSTANCE;
|
||||
}
|
||||
return asLiveData(flow, duration, coroutineContext);
|
||||
}
|
||||
|
||||
public static final <T> LiveData<T> asLiveData(Flow<? extends T> flow, Duration timeout, CoroutineContext context) {
|
||||
Intrinsics.checkNotNullParameter(flow, "<this>");
|
||||
Intrinsics.checkNotNullParameter(timeout, "timeout");
|
||||
Intrinsics.checkNotNullParameter(context, "context");
|
||||
return asLiveData(flow, context, Api26Impl.INSTANCE.toMillis(timeout));
|
||||
}
|
||||
}
|
12
02-Easy5/E5/sources/androidx/lifecycle/GeneratedAdapter.java
Normal file
12
02-Easy5/E5/sources/androidx/lifecycle/GeneratedAdapter.java
Normal file
@ -0,0 +1,12 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import androidx.core.app.NotificationCompat;
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
import kotlin.Metadata;
|
||||
|
||||
/* compiled from: GeneratedAdapter.kt */
|
||||
@Metadata(d1 = {"\u0000(\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0000\bg\u0018\u00002\u00020\u0001J*\u0010\u0002\u001a\u00020\u00032\u0006\u0010\u0004\u001a\u00020\u00052\u0006\u0010\u0006\u001a\u00020\u00072\u0006\u0010\b\u001a\u00020\t2\b\u0010\n\u001a\u0004\u0018\u00010\u000bH&ø\u0001\u0000\u0082\u0002\u0006\n\u0004\b!0\u0001¨\u0006\fÀ\u0006\u0001"}, d2 = {"Landroidx/lifecycle/GeneratedAdapter;", "", "callMethods", "", "source", "Landroidx/lifecycle/LifecycleOwner;", NotificationCompat.CATEGORY_EVENT, "Landroidx/lifecycle/Lifecycle$Event;", "onAny", "", "logger", "Landroidx/lifecycle/MethodCallsLogger;", "lifecycle-common"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public interface GeneratedAdapter {
|
||||
void callMethods(LifecycleOwner source, Lifecycle.Event event, boolean onAny, MethodCallsLogger logger);
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
@Deprecated
|
||||
/* loaded from: classes.dex */
|
||||
public interface GenericLifecycleObserver extends LifecycleEventObserver {
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.lifecycle.viewmodel.CreationExtras;
|
||||
import kotlin.Metadata;
|
||||
|
||||
/* compiled from: HasDefaultViewModelProviderFactory.kt */
|
||||
@Metadata(d1 = {"\u0000\u001a\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\bf\u0018\u00002\u00020\u0001R\u0014\u0010\u0002\u001a\u00020\u00038VX\u0096\u0004¢\u0006\u0006\u001a\u0004\b\u0004\u0010\u0005R\u0012\u0010\u0006\u001a\u00020\u0007X¦\u0004¢\u0006\u0006\u001a\u0004\b\b\u0010\tø\u0001\u0000\u0082\u0002\u0006\n\u0004\b!0\u0001¨\u0006\nÀ\u0006\u0001"}, d2 = {"Landroidx/lifecycle/HasDefaultViewModelProviderFactory;", "", "defaultViewModelCreationExtras", "Landroidx/lifecycle/viewmodel/CreationExtras;", "getDefaultViewModelCreationExtras", "()Landroidx/lifecycle/viewmodel/CreationExtras;", "defaultViewModelProviderFactory", "Landroidx/lifecycle/ViewModelProvider$Factory;", "getDefaultViewModelProviderFactory", "()Landroidx/lifecycle/ViewModelProvider$Factory;", "lifecycle-viewmodel_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public interface HasDefaultViewModelProviderFactory {
|
||||
CreationExtras getDefaultViewModelCreationExtras();
|
||||
|
||||
ViewModelProvider.Factory getDefaultViewModelProviderFactory();
|
||||
|
||||
/* compiled from: HasDefaultViewModelProviderFactory.kt */
|
||||
/* renamed from: androidx.lifecycle.HasDefaultViewModelProviderFactory$-CC, reason: invalid class name */
|
||||
public final /* synthetic */ class CC {
|
||||
}
|
||||
}
|
@ -0,0 +1,88 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import android.os.Bundle;
|
||||
import androidx.lifecycle.LegacySavedStateHandleController;
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
import androidx.savedstate.SavedStateRegistry;
|
||||
import androidx.savedstate.SavedStateRegistryOwner;
|
||||
import java.util.Iterator;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.JvmStatic;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: LegacySavedStateHandleController.kt */
|
||||
@Metadata(d1 = {"\u0000:\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\bÀ\u0002\u0018\u00002\u00020\u0001:\u0001\u0013B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J \u0010\u0005\u001a\u00020\u00062\u0006\u0010\u0007\u001a\u00020\b2\u0006\u0010\t\u001a\u00020\n2\u0006\u0010\u000b\u001a\u00020\fH\u0007J,\u0010\r\u001a\u00020\u000e2\u0006\u0010\t\u001a\u00020\n2\u0006\u0010\u000b\u001a\u00020\f2\b\u0010\u000f\u001a\u0004\u0018\u00010\u00042\b\u0010\u0010\u001a\u0004\u0018\u00010\u0011H\u0007J\u0018\u0010\u0012\u001a\u00020\u00062\u0006\u0010\t\u001a\u00020\n2\u0006\u0010\u000b\u001a\u00020\fH\u0002R\u000e\u0010\u0003\u001a\u00020\u0004X\u0086T¢\u0006\u0002\n\u0000¨\u0006\u0014"}, d2 = {"Landroidx/lifecycle/LegacySavedStateHandleController;", "", "()V", "TAG_SAVED_STATE_HANDLE_CONTROLLER", "", "attachHandleIfNeeded", "", "viewModel", "Landroidx/lifecycle/ViewModel;", "registry", "Landroidx/savedstate/SavedStateRegistry;", "lifecycle", "Landroidx/lifecycle/Lifecycle;", "create", "Landroidx/lifecycle/SavedStateHandleController;", "key", "defaultArgs", "Landroid/os/Bundle;", "tryToAddRecreator", "OnRecreation", "lifecycle-viewmodel-savedstate_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class LegacySavedStateHandleController {
|
||||
public static final LegacySavedStateHandleController INSTANCE = new LegacySavedStateHandleController();
|
||||
public static final String TAG_SAVED_STATE_HANDLE_CONTROLLER = "androidx.lifecycle.savedstate.vm.tag";
|
||||
|
||||
private LegacySavedStateHandleController() {
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public static final SavedStateHandleController create(SavedStateRegistry registry, Lifecycle lifecycle, String key, Bundle defaultArgs) {
|
||||
Intrinsics.checkNotNullParameter(registry, "registry");
|
||||
Intrinsics.checkNotNullParameter(lifecycle, "lifecycle");
|
||||
Intrinsics.checkNotNull(key);
|
||||
SavedStateHandleController savedStateHandleController = new SavedStateHandleController(key, SavedStateHandle.INSTANCE.createHandle(registry.consumeRestoredStateForKey(key), defaultArgs));
|
||||
savedStateHandleController.attachToLifecycle(registry, lifecycle);
|
||||
INSTANCE.tryToAddRecreator(registry, lifecycle);
|
||||
return savedStateHandleController;
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public static final void attachHandleIfNeeded(ViewModel viewModel, SavedStateRegistry registry, Lifecycle lifecycle) {
|
||||
Intrinsics.checkNotNullParameter(viewModel, "viewModel");
|
||||
Intrinsics.checkNotNullParameter(registry, "registry");
|
||||
Intrinsics.checkNotNullParameter(lifecycle, "lifecycle");
|
||||
SavedStateHandleController savedStateHandleController = (SavedStateHandleController) viewModel.getTag("androidx.lifecycle.savedstate.vm.tag");
|
||||
if (savedStateHandleController == null || savedStateHandleController.getIsAttached()) {
|
||||
return;
|
||||
}
|
||||
savedStateHandleController.attachToLifecycle(registry, lifecycle);
|
||||
INSTANCE.tryToAddRecreator(registry, lifecycle);
|
||||
}
|
||||
|
||||
private final void tryToAddRecreator(final SavedStateRegistry registry, final Lifecycle lifecycle) {
|
||||
Lifecycle.State state = lifecycle.getState();
|
||||
if (state == Lifecycle.State.INITIALIZED || state.isAtLeast(Lifecycle.State.STARTED)) {
|
||||
registry.runOnNextRecreation(OnRecreation.class);
|
||||
} else {
|
||||
lifecycle.addObserver(new LifecycleEventObserver() { // from class: androidx.lifecycle.LegacySavedStateHandleController$tryToAddRecreator$1
|
||||
@Override // androidx.lifecycle.LifecycleEventObserver
|
||||
public void onStateChanged(LifecycleOwner source, Lifecycle.Event event) {
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
Intrinsics.checkNotNullParameter(event, "event");
|
||||
if (event == Lifecycle.Event.ON_START) {
|
||||
Lifecycle.this.removeObserver(this);
|
||||
registry.runOnNextRecreation(LegacySavedStateHandleController.OnRecreation.class);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/* compiled from: LegacySavedStateHandleController.kt */
|
||||
@Metadata(d1 = {"\u0000\u0018\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\b\u0000\u0018\u00002\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0002J\u0010\u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0006H\u0016¨\u0006\u0007"}, d2 = {"Landroidx/lifecycle/LegacySavedStateHandleController$OnRecreation;", "Landroidx/savedstate/SavedStateRegistry$AutoRecreated;", "()V", "onRecreated", "", "owner", "Landroidx/savedstate/SavedStateRegistryOwner;", "lifecycle-viewmodel-savedstate_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
public static final class OnRecreation implements SavedStateRegistry.AutoRecreated {
|
||||
@Override // androidx.savedstate.SavedStateRegistry.AutoRecreated
|
||||
public void onRecreated(SavedStateRegistryOwner owner) {
|
||||
Intrinsics.checkNotNullParameter(owner, "owner");
|
||||
if (!(owner instanceof ViewModelStoreOwner)) {
|
||||
throw new IllegalStateException("Internal error: OnRecreation should be registered only on components that implement ViewModelStoreOwner".toString());
|
||||
}
|
||||
ViewModelStore viewModelStore = ((ViewModelStoreOwner) owner).getViewModelStore();
|
||||
SavedStateRegistry savedStateRegistry = owner.getSavedStateRegistry();
|
||||
Iterator<String> it = viewModelStore.keys().iterator();
|
||||
while (it.hasNext()) {
|
||||
ViewModel viewModel = viewModelStore.get(it.next());
|
||||
Intrinsics.checkNotNull(viewModel);
|
||||
LegacySavedStateHandleController.attachHandleIfNeeded(viewModel, savedStateRegistry, owner.getLifecycle());
|
||||
}
|
||||
if (!viewModelStore.keys().isEmpty()) {
|
||||
savedStateRegistry.runOnNextRecreation(OnRecreation.class);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
268
02-Easy5/E5/sources/androidx/lifecycle/Lifecycle.java
Normal file
268
02-Easy5/E5/sources/androidx/lifecycle/Lifecycle.java
Normal file
@ -0,0 +1,268 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.JvmStatic;
|
||||
import kotlin.jvm.internal.DefaultConstructorMarker;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import kotlinx.coroutines.debug.internal.DebugCoroutineInfoImplKt;
|
||||
import kotlinx.coroutines.flow.FlowKt;
|
||||
import kotlinx.coroutines.flow.MutableStateFlow;
|
||||
import kotlinx.coroutines.flow.StateFlow;
|
||||
import kotlinx.coroutines.flow.StateFlowKt;
|
||||
|
||||
/* compiled from: Lifecycle.kt */
|
||||
@Metadata(d1 = {"\u00002\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\b&\u0018\u00002\u00020\u0001:\u0002\u0017\u0018B\u0005¢\u0006\u0002\u0010\u0002J\u0010\u0010\u0012\u001a\u00020\u00132\u0006\u0010\u0014\u001a\u00020\u0015H'J\u0010\u0010\u0016\u001a\u00020\u00132\u0006\u0010\u0014\u001a\u00020\u0015H'R\u0014\u0010\u0003\u001a\u00020\u00048gX¦\u0004¢\u0006\u0006\u001a\u0004\b\u0005\u0010\u0006R\u001a\u0010\u0007\u001a\b\u0012\u0004\u0012\u00020\u00040\b8VX\u0096\u0004¢\u0006\u0006\u001a\u0004\b\t\u0010\nR2\u0010\r\u001a\b\u0012\u0004\u0012\u00020\u00010\f2\f\u0010\u000b\u001a\b\u0012\u0004\u0012\u00020\u00010\f8G@GX\u0087\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u000e\u0010\u000f\"\u0004\b\u0010\u0010\u0011¨\u0006\u0019"}, d2 = {"Landroidx/lifecycle/Lifecycle;", "", "()V", "currentState", "Landroidx/lifecycle/Lifecycle$State;", "getCurrentState", "()Landroidx/lifecycle/Lifecycle$State;", "currentStateFlow", "Lkotlinx/coroutines/flow/StateFlow;", "getCurrentStateFlow", "()Lkotlinx/coroutines/flow/StateFlow;", "<set-?>", "Ljava/util/concurrent/atomic/AtomicReference;", "internalScopeRef", "getInternalScopeRef", "()Ljava/util/concurrent/atomic/AtomicReference;", "setInternalScopeRef", "(Ljava/util/concurrent/atomic/AtomicReference;)V", "addObserver", "", "observer", "Landroidx/lifecycle/LifecycleObserver;", "removeObserver", "Event", "State", "lifecycle-common"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class Lifecycle {
|
||||
private AtomicReference<Object> internalScopeRef = new AtomicReference<>();
|
||||
|
||||
public abstract void addObserver(LifecycleObserver observer);
|
||||
|
||||
public abstract State getCurrentState();
|
||||
|
||||
public final AtomicReference<Object> getInternalScopeRef() {
|
||||
return this.internalScopeRef;
|
||||
}
|
||||
|
||||
public abstract void removeObserver(LifecycleObserver observer);
|
||||
|
||||
public final void setInternalScopeRef(AtomicReference<Object> atomicReference) {
|
||||
Intrinsics.checkNotNullParameter(atomicReference, "<set-?>");
|
||||
this.internalScopeRef = atomicReference;
|
||||
}
|
||||
|
||||
public StateFlow<State> getCurrentStateFlow() {
|
||||
final MutableStateFlow MutableStateFlow = StateFlowKt.MutableStateFlow(getCurrentState());
|
||||
addObserver(new LifecycleEventObserver() { // from class: androidx.lifecycle.Lifecycle$$ExternalSyntheticLambda0
|
||||
@Override // androidx.lifecycle.LifecycleEventObserver
|
||||
public final void onStateChanged(LifecycleOwner lifecycleOwner, Lifecycle.Event event) {
|
||||
Lifecycle._get_currentStateFlow_$lambda$0(MutableStateFlow.this, lifecycleOwner, event);
|
||||
}
|
||||
});
|
||||
return FlowKt.asStateFlow(MutableStateFlow);
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public static final void _get_currentStateFlow_$lambda$0(MutableStateFlow mutableStateFlow, LifecycleOwner lifecycleOwner, Event event) {
|
||||
Intrinsics.checkNotNullParameter(mutableStateFlow, "$mutableStateFlow");
|
||||
Intrinsics.checkNotNullParameter(lifecycleOwner, "<anonymous parameter 0>");
|
||||
Intrinsics.checkNotNullParameter(event, "event");
|
||||
mutableStateFlow.setValue(event.getTargetState());
|
||||
}
|
||||
|
||||
/* compiled from: Lifecycle.kt */
|
||||
@Metadata(d1 = {"\u0000\u0014\n\u0002\u0018\u0002\n\u0002\u0010\u0010\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u000b\b\u0086\u0001\u0018\u0000 \u000e2\b\u0012\u0004\u0012\u00020\u00000\u0001:\u0001\u000eB\u0007\b\u0002¢\u0006\u0002\u0010\u0002R\u0011\u0010\u0003\u001a\u00020\u00048F¢\u0006\u0006\u001a\u0004\b\u0005\u0010\u0006j\u0002\b\u0007j\u0002\b\bj\u0002\b\tj\u0002\b\nj\u0002\b\u000bj\u0002\b\fj\u0002\b\r¨\u0006\u000f"}, d2 = {"Landroidx/lifecycle/Lifecycle$Event;", "", "(Ljava/lang/String;I)V", "targetState", "Landroidx/lifecycle/Lifecycle$State;", "getTargetState", "()Landroidx/lifecycle/Lifecycle$State;", "ON_CREATE", "ON_START", "ON_RESUME", "ON_PAUSE", "ON_STOP", "ON_DESTROY", "ON_ANY", "Companion", "lifecycle-common"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
public enum Event {
|
||||
ON_CREATE,
|
||||
ON_START,
|
||||
ON_RESUME,
|
||||
ON_PAUSE,
|
||||
ON_STOP,
|
||||
ON_DESTROY,
|
||||
ON_ANY;
|
||||
|
||||
|
||||
/* renamed from: Companion, reason: from kotlin metadata */
|
||||
public static final Companion INSTANCE = new Companion(null);
|
||||
|
||||
/* compiled from: Lifecycle.kt */
|
||||
@Metadata(k = 3, mv = {1, 8, 0}, xi = 48)
|
||||
public /* synthetic */ class WhenMappings {
|
||||
public static final /* synthetic */ int[] $EnumSwitchMapping$0;
|
||||
|
||||
static {
|
||||
int[] iArr = new int[Event.values().length];
|
||||
try {
|
||||
iArr[Event.ON_CREATE.ordinal()] = 1;
|
||||
} catch (NoSuchFieldError unused) {
|
||||
}
|
||||
try {
|
||||
iArr[Event.ON_STOP.ordinal()] = 2;
|
||||
} catch (NoSuchFieldError unused2) {
|
||||
}
|
||||
try {
|
||||
iArr[Event.ON_START.ordinal()] = 3;
|
||||
} catch (NoSuchFieldError unused3) {
|
||||
}
|
||||
try {
|
||||
iArr[Event.ON_PAUSE.ordinal()] = 4;
|
||||
} catch (NoSuchFieldError unused4) {
|
||||
}
|
||||
try {
|
||||
iArr[Event.ON_RESUME.ordinal()] = 5;
|
||||
} catch (NoSuchFieldError unused5) {
|
||||
}
|
||||
try {
|
||||
iArr[Event.ON_DESTROY.ordinal()] = 6;
|
||||
} catch (NoSuchFieldError unused6) {
|
||||
}
|
||||
try {
|
||||
iArr[Event.ON_ANY.ordinal()] = 7;
|
||||
} catch (NoSuchFieldError unused7) {
|
||||
}
|
||||
$EnumSwitchMapping$0 = iArr;
|
||||
}
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public static final Event downFrom(State state) {
|
||||
return INSTANCE.downFrom(state);
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public static final Event downTo(State state) {
|
||||
return INSTANCE.downTo(state);
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public static final Event upFrom(State state) {
|
||||
return INSTANCE.upFrom(state);
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public static final Event upTo(State state) {
|
||||
return INSTANCE.upTo(state);
|
||||
}
|
||||
|
||||
public final State getTargetState() {
|
||||
switch (WhenMappings.$EnumSwitchMapping$0[ordinal()]) {
|
||||
case 1:
|
||||
case 2:
|
||||
return State.CREATED;
|
||||
case 3:
|
||||
case 4:
|
||||
return State.STARTED;
|
||||
case 5:
|
||||
return State.RESUMED;
|
||||
case 6:
|
||||
return State.DESTROYED;
|
||||
default:
|
||||
throw new IllegalArgumentException(this + " has no target state");
|
||||
}
|
||||
}
|
||||
|
||||
/* compiled from: Lifecycle.kt */
|
||||
@Metadata(d1 = {"\u0000\u001a\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\b\u0086\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\u0012\u0010\u0003\u001a\u0004\u0018\u00010\u00042\u0006\u0010\u0005\u001a\u00020\u0006H\u0007J\u0012\u0010\u0007\u001a\u0004\u0018\u00010\u00042\u0006\u0010\u0005\u001a\u00020\u0006H\u0007J\u0012\u0010\b\u001a\u0004\u0018\u00010\u00042\u0006\u0010\u0005\u001a\u00020\u0006H\u0007J\u0012\u0010\t\u001a\u0004\u0018\u00010\u00042\u0006\u0010\u0005\u001a\u00020\u0006H\u0007¨\u0006\n"}, d2 = {"Landroidx/lifecycle/Lifecycle$Event$Companion;", "", "()V", "downFrom", "Landroidx/lifecycle/Lifecycle$Event;", "state", "Landroidx/lifecycle/Lifecycle$State;", "downTo", "upFrom", "upTo", "lifecycle-common"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
public static final class Companion {
|
||||
|
||||
/* compiled from: Lifecycle.kt */
|
||||
@Metadata(k = 3, mv = {1, 8, 0}, xi = 48)
|
||||
public /* synthetic */ class WhenMappings {
|
||||
public static final /* synthetic */ int[] $EnumSwitchMapping$0;
|
||||
|
||||
static {
|
||||
int[] iArr = new int[State.values().length];
|
||||
try {
|
||||
iArr[State.CREATED.ordinal()] = 1;
|
||||
} catch (NoSuchFieldError unused) {
|
||||
}
|
||||
try {
|
||||
iArr[State.STARTED.ordinal()] = 2;
|
||||
} catch (NoSuchFieldError unused2) {
|
||||
}
|
||||
try {
|
||||
iArr[State.RESUMED.ordinal()] = 3;
|
||||
} catch (NoSuchFieldError unused3) {
|
||||
}
|
||||
try {
|
||||
iArr[State.DESTROYED.ordinal()] = 4;
|
||||
} catch (NoSuchFieldError unused4) {
|
||||
}
|
||||
try {
|
||||
iArr[State.INITIALIZED.ordinal()] = 5;
|
||||
} catch (NoSuchFieldError unused5) {
|
||||
}
|
||||
$EnumSwitchMapping$0 = iArr;
|
||||
}
|
||||
}
|
||||
|
||||
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
||||
this();
|
||||
}
|
||||
|
||||
private Companion() {
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public final Event downFrom(State state) {
|
||||
Intrinsics.checkNotNullParameter(state, "state");
|
||||
int i = WhenMappings.$EnumSwitchMapping$0[state.ordinal()];
|
||||
if (i == 1) {
|
||||
return Event.ON_DESTROY;
|
||||
}
|
||||
if (i == 2) {
|
||||
return Event.ON_STOP;
|
||||
}
|
||||
if (i != 3) {
|
||||
return null;
|
||||
}
|
||||
return Event.ON_PAUSE;
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public final Event downTo(State state) {
|
||||
Intrinsics.checkNotNullParameter(state, "state");
|
||||
int i = WhenMappings.$EnumSwitchMapping$0[state.ordinal()];
|
||||
if (i == 1) {
|
||||
return Event.ON_STOP;
|
||||
}
|
||||
if (i == 2) {
|
||||
return Event.ON_PAUSE;
|
||||
}
|
||||
if (i != 4) {
|
||||
return null;
|
||||
}
|
||||
return Event.ON_DESTROY;
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public final Event upFrom(State state) {
|
||||
Intrinsics.checkNotNullParameter(state, "state");
|
||||
int i = WhenMappings.$EnumSwitchMapping$0[state.ordinal()];
|
||||
if (i == 1) {
|
||||
return Event.ON_START;
|
||||
}
|
||||
if (i == 2) {
|
||||
return Event.ON_RESUME;
|
||||
}
|
||||
if (i != 5) {
|
||||
return null;
|
||||
}
|
||||
return Event.ON_CREATE;
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public final Event upTo(State state) {
|
||||
Intrinsics.checkNotNullParameter(state, "state");
|
||||
int i = WhenMappings.$EnumSwitchMapping$0[state.ordinal()];
|
||||
if (i == 1) {
|
||||
return Event.ON_CREATE;
|
||||
}
|
||||
if (i == 2) {
|
||||
return Event.ON_START;
|
||||
}
|
||||
if (i != 3) {
|
||||
return null;
|
||||
}
|
||||
return Event.ON_RESUME;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* compiled from: Lifecycle.kt */
|
||||
@Metadata(d1 = {"\u0000\u0014\n\u0002\u0018\u0002\n\u0002\u0010\u0010\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0002\b\u0007\b\u0086\u0001\u0018\u00002\b\u0012\u0004\u0012\u00020\u00000\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\u000e\u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0000j\u0002\b\u0006j\u0002\b\u0007j\u0002\b\bj\u0002\b\tj\u0002\b\n¨\u0006\u000b"}, d2 = {"Landroidx/lifecycle/Lifecycle$State;", "", "(Ljava/lang/String;I)V", "isAtLeast", "", "state", "DESTROYED", "INITIALIZED", DebugCoroutineInfoImplKt.CREATED, "STARTED", "RESUMED", "lifecycle-common"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
public enum State {
|
||||
DESTROYED,
|
||||
INITIALIZED,
|
||||
CREATED,
|
||||
STARTED,
|
||||
RESUMED;
|
||||
|
||||
public final boolean isAtLeast(State state) {
|
||||
Intrinsics.checkNotNullParameter(state, "state");
|
||||
return compareTo(state) >= 0;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
import java.util.concurrent.CancellationException;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import kotlinx.coroutines.Job;
|
||||
|
||||
/* compiled from: LifecycleController.kt */
|
||||
@Metadata(d1 = {"\u00002\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002\b\u0001\u0018\u00002\u00020\u0001B%\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\u0006\u0010\u0004\u001a\u00020\u0005\u0012\u0006\u0010\u0006\u001a\u00020\u0007\u0012\u0006\u0010\b\u001a\u00020\t¢\u0006\u0002\u0010\nJ\b\u0010\r\u001a\u00020\u000eH\u0007J\u0011\u0010\u000f\u001a\u00020\u000e2\u0006\u0010\b\u001a\u00020\tH\u0082\bR\u000e\u0010\u0006\u001a\u00020\u0007X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0002\u001a\u00020\u0003X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0004\u001a\u00020\u0005X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u000b\u001a\u00020\fX\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u0010"}, d2 = {"Landroidx/lifecycle/LifecycleController;", "", "lifecycle", "Landroidx/lifecycle/Lifecycle;", "minState", "Landroidx/lifecycle/Lifecycle$State;", "dispatchQueue", "Landroidx/lifecycle/DispatchQueue;", "parentJob", "Lkotlinx/coroutines/Job;", "(Landroidx/lifecycle/Lifecycle;Landroidx/lifecycle/Lifecycle$State;Landroidx/lifecycle/DispatchQueue;Lkotlinx/coroutines/Job;)V", "observer", "Landroidx/lifecycle/LifecycleEventObserver;", "finish", "", "handleDestroy", "lifecycle-common"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class LifecycleController {
|
||||
private final DispatchQueue dispatchQueue;
|
||||
private final Lifecycle lifecycle;
|
||||
private final Lifecycle.State minState;
|
||||
private final LifecycleEventObserver observer;
|
||||
|
||||
public LifecycleController(Lifecycle lifecycle, Lifecycle.State minState, DispatchQueue dispatchQueue, final Job parentJob) {
|
||||
Intrinsics.checkNotNullParameter(lifecycle, "lifecycle");
|
||||
Intrinsics.checkNotNullParameter(minState, "minState");
|
||||
Intrinsics.checkNotNullParameter(dispatchQueue, "dispatchQueue");
|
||||
Intrinsics.checkNotNullParameter(parentJob, "parentJob");
|
||||
this.lifecycle = lifecycle;
|
||||
this.minState = minState;
|
||||
this.dispatchQueue = dispatchQueue;
|
||||
LifecycleEventObserver lifecycleEventObserver = new LifecycleEventObserver() { // from class: androidx.lifecycle.LifecycleController$$ExternalSyntheticLambda0
|
||||
@Override // androidx.lifecycle.LifecycleEventObserver
|
||||
public final void onStateChanged(LifecycleOwner lifecycleOwner, Lifecycle.Event event) {
|
||||
LifecycleController.observer$lambda$0(LifecycleController.this, parentJob, lifecycleOwner, event);
|
||||
}
|
||||
};
|
||||
this.observer = lifecycleEventObserver;
|
||||
if (lifecycle.getState() != Lifecycle.State.DESTROYED) {
|
||||
lifecycle.addObserver(lifecycleEventObserver);
|
||||
} else {
|
||||
Job.DefaultImpls.cancel$default(parentJob, (CancellationException) null, 1, (Object) null);
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public static final void observer$lambda$0(LifecycleController this$0, Job parentJob, LifecycleOwner source, Lifecycle.Event event) {
|
||||
Intrinsics.checkNotNullParameter(this$0, "this$0");
|
||||
Intrinsics.checkNotNullParameter(parentJob, "$parentJob");
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
Intrinsics.checkNotNullParameter(event, "<anonymous parameter 1>");
|
||||
if (source.getLifecycle().getState() != Lifecycle.State.DESTROYED) {
|
||||
if (source.getLifecycle().getState().compareTo(this$0.minState) < 0) {
|
||||
this$0.dispatchQueue.pause();
|
||||
return;
|
||||
} else {
|
||||
this$0.dispatchQueue.resume();
|
||||
return;
|
||||
}
|
||||
}
|
||||
Job.DefaultImpls.cancel$default(parentJob, (CancellationException) null, 1, (Object) null);
|
||||
this$0.finish();
|
||||
}
|
||||
|
||||
private final void handleDestroy(Job parentJob) {
|
||||
Job.DefaultImpls.cancel$default(parentJob, (CancellationException) null, 1, (Object) null);
|
||||
finish();
|
||||
}
|
||||
|
||||
public final void finish() {
|
||||
this.lifecycle.removeObserver(this.observer);
|
||||
this.dispatchQueue.finish();
|
||||
}
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import kotlin.Metadata;
|
||||
import kotlin.ResultKt;
|
||||
import kotlin.Unit;
|
||||
import kotlin.coroutines.Continuation;
|
||||
import kotlin.coroutines.intrinsics.IntrinsicsKt;
|
||||
import kotlin.coroutines.jvm.internal.DebugMetadata;
|
||||
import kotlin.coroutines.jvm.internal.SuspendLambda;
|
||||
import kotlin.jvm.functions.Function2;
|
||||
import kotlinx.coroutines.CoroutineScope;
|
||||
|
||||
/* compiled from: Lifecycle.kt */
|
||||
@Metadata(d1 = {"\u0000\n\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0000\u0010\u0002\u001a\u00020\u0001*\u00020\u0000H\u008a@"}, d2 = {"Lkotlinx/coroutines/CoroutineScope;", "", "<anonymous>"}, k = 3, mv = {1, 8, 0})
|
||||
@DebugMetadata(c = "androidx.lifecycle.LifecycleCoroutineScope$launchWhenCreated$1", f = "Lifecycle.kt", i = {}, l = {362}, m = "invokeSuspend", n = {}, s = {})
|
||||
/* loaded from: classes.dex */
|
||||
final class LifecycleCoroutineScope$launchWhenCreated$1 extends SuspendLambda implements Function2<CoroutineScope, Continuation<? super Unit>, Object> {
|
||||
final /* synthetic */ Function2<CoroutineScope, Continuation<? super Unit>, Object> $block;
|
||||
int label;
|
||||
final /* synthetic */ LifecycleCoroutineScope this$0;
|
||||
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
LifecycleCoroutineScope$launchWhenCreated$1(LifecycleCoroutineScope lifecycleCoroutineScope, Function2<? super CoroutineScope, ? super Continuation<? super Unit>, ? extends Object> function2, Continuation<? super LifecycleCoroutineScope$launchWhenCreated$1> continuation) {
|
||||
super(2, continuation);
|
||||
this.this$0 = lifecycleCoroutineScope;
|
||||
this.$block = function2;
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
||||
public final Continuation<Unit> create(Object obj, Continuation<?> continuation) {
|
||||
return new LifecycleCoroutineScope$launchWhenCreated$1(this.this$0, this.$block, continuation);
|
||||
}
|
||||
|
||||
@Override // kotlin.jvm.functions.Function2
|
||||
public final Object invoke(CoroutineScope coroutineScope, Continuation<? super Unit> continuation) {
|
||||
return ((LifecycleCoroutineScope$launchWhenCreated$1) create(coroutineScope, continuation)).invokeSuspend(Unit.INSTANCE);
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
||||
public final Object invokeSuspend(Object obj) {
|
||||
Object coroutine_suspended = IntrinsicsKt.getCOROUTINE_SUSPENDED();
|
||||
int i = this.label;
|
||||
if (i == 0) {
|
||||
ResultKt.throwOnFailure(obj);
|
||||
this.label = 1;
|
||||
if (PausingDispatcherKt.whenCreated(this.this$0.getLifecycle(), this.$block, this) == coroutine_suspended) {
|
||||
return coroutine_suspended;
|
||||
}
|
||||
} else {
|
||||
if (i != 1) {
|
||||
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
|
||||
}
|
||||
ResultKt.throwOnFailure(obj);
|
||||
}
|
||||
return Unit.INSTANCE;
|
||||
}
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import kotlin.Metadata;
|
||||
import kotlin.ResultKt;
|
||||
import kotlin.Unit;
|
||||
import kotlin.coroutines.Continuation;
|
||||
import kotlin.coroutines.intrinsics.IntrinsicsKt;
|
||||
import kotlin.coroutines.jvm.internal.DebugMetadata;
|
||||
import kotlin.coroutines.jvm.internal.SuspendLambda;
|
||||
import kotlin.jvm.functions.Function2;
|
||||
import kotlinx.coroutines.CoroutineScope;
|
||||
|
||||
/* compiled from: Lifecycle.kt */
|
||||
@Metadata(d1 = {"\u0000\n\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0000\u0010\u0002\u001a\u00020\u0001*\u00020\u0000H\u008a@"}, d2 = {"Lkotlinx/coroutines/CoroutineScope;", "", "<anonymous>"}, k = 3, mv = {1, 8, 0})
|
||||
@DebugMetadata(c = "androidx.lifecycle.LifecycleCoroutineScope$launchWhenResumed$1", f = "Lifecycle.kt", i = {}, l = {400}, m = "invokeSuspend", n = {}, s = {})
|
||||
/* loaded from: classes.dex */
|
||||
final class LifecycleCoroutineScope$launchWhenResumed$1 extends SuspendLambda implements Function2<CoroutineScope, Continuation<? super Unit>, Object> {
|
||||
final /* synthetic */ Function2<CoroutineScope, Continuation<? super Unit>, Object> $block;
|
||||
int label;
|
||||
final /* synthetic */ LifecycleCoroutineScope this$0;
|
||||
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
LifecycleCoroutineScope$launchWhenResumed$1(LifecycleCoroutineScope lifecycleCoroutineScope, Function2<? super CoroutineScope, ? super Continuation<? super Unit>, ? extends Object> function2, Continuation<? super LifecycleCoroutineScope$launchWhenResumed$1> continuation) {
|
||||
super(2, continuation);
|
||||
this.this$0 = lifecycleCoroutineScope;
|
||||
this.$block = function2;
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
||||
public final Continuation<Unit> create(Object obj, Continuation<?> continuation) {
|
||||
return new LifecycleCoroutineScope$launchWhenResumed$1(this.this$0, this.$block, continuation);
|
||||
}
|
||||
|
||||
@Override // kotlin.jvm.functions.Function2
|
||||
public final Object invoke(CoroutineScope coroutineScope, Continuation<? super Unit> continuation) {
|
||||
return ((LifecycleCoroutineScope$launchWhenResumed$1) create(coroutineScope, continuation)).invokeSuspend(Unit.INSTANCE);
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
||||
public final Object invokeSuspend(Object obj) {
|
||||
Object coroutine_suspended = IntrinsicsKt.getCOROUTINE_SUSPENDED();
|
||||
int i = this.label;
|
||||
if (i == 0) {
|
||||
ResultKt.throwOnFailure(obj);
|
||||
this.label = 1;
|
||||
if (PausingDispatcherKt.whenResumed(this.this$0.getLifecycle(), this.$block, this) == coroutine_suspended) {
|
||||
return coroutine_suspended;
|
||||
}
|
||||
} else {
|
||||
if (i != 1) {
|
||||
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
|
||||
}
|
||||
ResultKt.throwOnFailure(obj);
|
||||
}
|
||||
return Unit.INSTANCE;
|
||||
}
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import kotlin.Metadata;
|
||||
import kotlin.ResultKt;
|
||||
import kotlin.Unit;
|
||||
import kotlin.coroutines.Continuation;
|
||||
import kotlin.coroutines.intrinsics.IntrinsicsKt;
|
||||
import kotlin.coroutines.jvm.internal.DebugMetadata;
|
||||
import kotlin.coroutines.jvm.internal.SuspendLambda;
|
||||
import kotlin.jvm.functions.Function2;
|
||||
import kotlinx.coroutines.CoroutineScope;
|
||||
|
||||
/* compiled from: Lifecycle.kt */
|
||||
@Metadata(d1 = {"\u0000\n\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0000\u0010\u0002\u001a\u00020\u0001*\u00020\u0000H\u008a@"}, d2 = {"Lkotlinx/coroutines/CoroutineScope;", "", "<anonymous>"}, k = 3, mv = {1, 8, 0})
|
||||
@DebugMetadata(c = "androidx.lifecycle.LifecycleCoroutineScope$launchWhenStarted$1", f = "Lifecycle.kt", i = {}, l = {381}, m = "invokeSuspend", n = {}, s = {})
|
||||
/* loaded from: classes.dex */
|
||||
final class LifecycleCoroutineScope$launchWhenStarted$1 extends SuspendLambda implements Function2<CoroutineScope, Continuation<? super Unit>, Object> {
|
||||
final /* synthetic */ Function2<CoroutineScope, Continuation<? super Unit>, Object> $block;
|
||||
int label;
|
||||
final /* synthetic */ LifecycleCoroutineScope this$0;
|
||||
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
LifecycleCoroutineScope$launchWhenStarted$1(LifecycleCoroutineScope lifecycleCoroutineScope, Function2<? super CoroutineScope, ? super Continuation<? super Unit>, ? extends Object> function2, Continuation<? super LifecycleCoroutineScope$launchWhenStarted$1> continuation) {
|
||||
super(2, continuation);
|
||||
this.this$0 = lifecycleCoroutineScope;
|
||||
this.$block = function2;
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
||||
public final Continuation<Unit> create(Object obj, Continuation<?> continuation) {
|
||||
return new LifecycleCoroutineScope$launchWhenStarted$1(this.this$0, this.$block, continuation);
|
||||
}
|
||||
|
||||
@Override // kotlin.jvm.functions.Function2
|
||||
public final Object invoke(CoroutineScope coroutineScope, Continuation<? super Unit> continuation) {
|
||||
return ((LifecycleCoroutineScope$launchWhenStarted$1) create(coroutineScope, continuation)).invokeSuspend(Unit.INSTANCE);
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
||||
public final Object invokeSuspend(Object obj) {
|
||||
Object coroutine_suspended = IntrinsicsKt.getCOROUTINE_SUSPENDED();
|
||||
int i = this.label;
|
||||
if (i == 0) {
|
||||
ResultKt.throwOnFailure(obj);
|
||||
this.label = 1;
|
||||
if (PausingDispatcherKt.whenStarted(this.this$0.getLifecycle(), this.$block, this) == coroutine_suspended) {
|
||||
return coroutine_suspended;
|
||||
}
|
||||
} else {
|
||||
if (i != 1) {
|
||||
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
|
||||
}
|
||||
ResultKt.throwOnFailure(obj);
|
||||
}
|
||||
return Unit.INSTANCE;
|
||||
}
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import kotlin.Deprecated;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.Unit;
|
||||
import kotlin.coroutines.Continuation;
|
||||
import kotlin.jvm.functions.Function2;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import kotlinx.coroutines.BuildersKt__Builders_commonKt;
|
||||
import kotlinx.coroutines.CoroutineScope;
|
||||
import kotlinx.coroutines.Job;
|
||||
|
||||
/* compiled from: Lifecycle.kt */
|
||||
@Metadata(d1 = {"\u00002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0002\u0010\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\b&\u0018\u00002\u00020\u0001B\u0007\b\u0000¢\u0006\u0002\u0010\u0002J6\u0010\u0007\u001a\u00020\b2'\u0010\t\u001a#\b\u0001\u0012\u0004\u0012\u00020\u0001\u0012\n\u0012\b\u0012\u0004\u0012\u00020\f0\u000b\u0012\u0006\u0012\u0004\u0018\u00010\r0\n¢\u0006\u0002\b\u000eH\u0007¢\u0006\u0002\u0010\u000fJ6\u0010\u0010\u001a\u00020\b2'\u0010\t\u001a#\b\u0001\u0012\u0004\u0012\u00020\u0001\u0012\n\u0012\b\u0012\u0004\u0012\u00020\f0\u000b\u0012\u0006\u0012\u0004\u0018\u00010\r0\n¢\u0006\u0002\b\u000eH\u0007¢\u0006\u0002\u0010\u000fJ6\u0010\u0011\u001a\u00020\b2'\u0010\t\u001a#\b\u0001\u0012\u0004\u0012\u00020\u0001\u0012\n\u0012\b\u0012\u0004\u0012\u00020\f0\u000b\u0012\u0006\u0012\u0004\u0018\u00010\r0\n¢\u0006\u0002\b\u000eH\u0007¢\u0006\u0002\u0010\u000fR\u0012\u0010\u0003\u001a\u00020\u0004X \u0004¢\u0006\u0006\u001a\u0004\b\u0005\u0010\u0006¨\u0006\u0012"}, d2 = {"Landroidx/lifecycle/LifecycleCoroutineScope;", "Lkotlinx/coroutines/CoroutineScope;", "()V", "lifecycle", "Landroidx/lifecycle/Lifecycle;", "getLifecycle$lifecycle_common", "()Landroidx/lifecycle/Lifecycle;", "launchWhenCreated", "Lkotlinx/coroutines/Job;", "block", "Lkotlin/Function2;", "Lkotlin/coroutines/Continuation;", "", "", "Lkotlin/ExtensionFunctionType;", "(Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/Job;", "launchWhenResumed", "launchWhenStarted", "lifecycle-common"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class LifecycleCoroutineScope implements CoroutineScope {
|
||||
public abstract Lifecycle getLifecycle$lifecycle_common();
|
||||
|
||||
@Deprecated(message = "launchWhenCreated is deprecated as it can lead to wasted resources in some cases. Replace with suspending repeatOnLifecycle to run the block whenever the Lifecycle state is at least Lifecycle.State.CREATED.")
|
||||
public final Job launchWhenCreated(Function2<? super CoroutineScope, ? super Continuation<? super Unit>, ? extends Object> block) {
|
||||
Job launch$default;
|
||||
Intrinsics.checkNotNullParameter(block, "block");
|
||||
launch$default = BuildersKt__Builders_commonKt.launch$default(this, null, null, new LifecycleCoroutineScope$launchWhenCreated$1(this, block, null), 3, null);
|
||||
return launch$default;
|
||||
}
|
||||
|
||||
@Deprecated(message = "launchWhenStarted is deprecated as it can lead to wasted resources in some cases. Replace with suspending repeatOnLifecycle to run the block whenever the Lifecycle state is at least Lifecycle.State.STARTED.")
|
||||
public final Job launchWhenStarted(Function2<? super CoroutineScope, ? super Continuation<? super Unit>, ? extends Object> block) {
|
||||
Job launch$default;
|
||||
Intrinsics.checkNotNullParameter(block, "block");
|
||||
launch$default = BuildersKt__Builders_commonKt.launch$default(this, null, null, new LifecycleCoroutineScope$launchWhenStarted$1(this, block, null), 3, null);
|
||||
return launch$default;
|
||||
}
|
||||
|
||||
@Deprecated(message = "launchWhenResumed is deprecated as it can lead to wasted resources in some cases. Replace with suspending repeatOnLifecycle to run the block whenever the Lifecycle state is at least Lifecycle.State.RESUMED.")
|
||||
public final Job launchWhenResumed(Function2<? super CoroutineScope, ? super Continuation<? super Unit>, ? extends Object> block) {
|
||||
Job launch$default;
|
||||
Intrinsics.checkNotNullParameter(block, "block");
|
||||
launch$default = BuildersKt__Builders_commonKt.launch$default(this, null, null, new LifecycleCoroutineScope$launchWhenResumed$1(this, block, null), 3, null);
|
||||
return launch$default;
|
||||
}
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
import java.util.concurrent.CancellationException;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.ResultKt;
|
||||
import kotlin.Unit;
|
||||
import kotlin.coroutines.Continuation;
|
||||
import kotlin.coroutines.intrinsics.IntrinsicsKt;
|
||||
import kotlin.coroutines.jvm.internal.DebugMetadata;
|
||||
import kotlin.coroutines.jvm.internal.SuspendLambda;
|
||||
import kotlin.jvm.functions.Function2;
|
||||
import kotlinx.coroutines.CoroutineScope;
|
||||
import kotlinx.coroutines.JobKt__JobKt;
|
||||
|
||||
/* compiled from: Lifecycle.kt */
|
||||
@Metadata(d1 = {"\u0000\n\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0000\u0010\u0002\u001a\u00020\u0001*\u00020\u0000H\u008a@"}, d2 = {"Lkotlinx/coroutines/CoroutineScope;", "", "<anonymous>"}, k = 3, mv = {1, 8, 0})
|
||||
@DebugMetadata(c = "androidx.lifecycle.LifecycleCoroutineScopeImpl$register$1", f = "Lifecycle.kt", i = {}, l = {}, m = "invokeSuspend", n = {}, s = {})
|
||||
/* loaded from: classes.dex */
|
||||
final class LifecycleCoroutineScopeImpl$register$1 extends SuspendLambda implements Function2<CoroutineScope, Continuation<? super Unit>, Object> {
|
||||
private /* synthetic */ Object L$0;
|
||||
int label;
|
||||
final /* synthetic */ LifecycleCoroutineScopeImpl this$0;
|
||||
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
LifecycleCoroutineScopeImpl$register$1(LifecycleCoroutineScopeImpl lifecycleCoroutineScopeImpl, Continuation<? super LifecycleCoroutineScopeImpl$register$1> continuation) {
|
||||
super(2, continuation);
|
||||
this.this$0 = lifecycleCoroutineScopeImpl;
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
||||
public final Continuation<Unit> create(Object obj, Continuation<?> continuation) {
|
||||
LifecycleCoroutineScopeImpl$register$1 lifecycleCoroutineScopeImpl$register$1 = new LifecycleCoroutineScopeImpl$register$1(this.this$0, continuation);
|
||||
lifecycleCoroutineScopeImpl$register$1.L$0 = obj;
|
||||
return lifecycleCoroutineScopeImpl$register$1;
|
||||
}
|
||||
|
||||
@Override // kotlin.jvm.functions.Function2
|
||||
public final Object invoke(CoroutineScope coroutineScope, Continuation<? super Unit> continuation) {
|
||||
return ((LifecycleCoroutineScopeImpl$register$1) create(coroutineScope, continuation)).invokeSuspend(Unit.INSTANCE);
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
||||
public final Object invokeSuspend(Object obj) {
|
||||
IntrinsicsKt.getCOROUTINE_SUSPENDED();
|
||||
if (this.label == 0) {
|
||||
ResultKt.throwOnFailure(obj);
|
||||
CoroutineScope coroutineScope = (CoroutineScope) this.L$0;
|
||||
if (this.this$0.getLifecycle().getState().compareTo(Lifecycle.State.INITIALIZED) < 0) {
|
||||
JobKt__JobKt.cancel$default(coroutineScope.getCoroutineContext(), (CancellationException) null, 1, (Object) null);
|
||||
} else {
|
||||
this.this$0.getLifecycle().addObserver(this.this$0);
|
||||
}
|
||||
return Unit.INSTANCE;
|
||||
}
|
||||
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
|
||||
}
|
||||
}
|
@ -0,0 +1,54 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import androidx.core.app.NotificationCompat;
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
import java.util.concurrent.CancellationException;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.coroutines.CoroutineContext;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import kotlinx.coroutines.BuildersKt__Builders_commonKt;
|
||||
import kotlinx.coroutines.Dispatchers;
|
||||
import kotlinx.coroutines.JobKt__JobKt;
|
||||
|
||||
/* compiled from: Lifecycle.kt */
|
||||
@Metadata(d1 = {"\u00000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\b\u0000\u0018\u00002\u00020\u00012\u00020\u0002B\u0015\u0012\u0006\u0010\u0003\u001a\u00020\u0004\u0012\u0006\u0010\u0005\u001a\u00020\u0006¢\u0006\u0002\u0010\u0007J\u0018\u0010\f\u001a\u00020\r2\u0006\u0010\u000e\u001a\u00020\u000f2\u0006\u0010\u0010\u001a\u00020\u0011H\u0016J\u0006\u0010\u0012\u001a\u00020\rR\u0014\u0010\u0005\u001a\u00020\u0006X\u0096\u0004¢\u0006\b\n\u0000\u001a\u0004\b\b\u0010\tR\u0014\u0010\u0003\u001a\u00020\u0004X\u0090\u0004¢\u0006\b\n\u0000\u001a\u0004\b\n\u0010\u000b¨\u0006\u0013"}, d2 = {"Landroidx/lifecycle/LifecycleCoroutineScopeImpl;", "Landroidx/lifecycle/LifecycleCoroutineScope;", "Landroidx/lifecycle/LifecycleEventObserver;", "lifecycle", "Landroidx/lifecycle/Lifecycle;", "coroutineContext", "Lkotlin/coroutines/CoroutineContext;", "(Landroidx/lifecycle/Lifecycle;Lkotlin/coroutines/CoroutineContext;)V", "getCoroutineContext", "()Lkotlin/coroutines/CoroutineContext;", "getLifecycle$lifecycle_common", "()Landroidx/lifecycle/Lifecycle;", "onStateChanged", "", "source", "Landroidx/lifecycle/LifecycleOwner;", NotificationCompat.CATEGORY_EVENT, "Landroidx/lifecycle/Lifecycle$Event;", "register", "lifecycle-common"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class LifecycleCoroutineScopeImpl extends LifecycleCoroutineScope implements LifecycleEventObserver {
|
||||
private final CoroutineContext coroutineContext;
|
||||
private final Lifecycle lifecycle;
|
||||
|
||||
@Override // kotlinx.coroutines.CoroutineScope
|
||||
public CoroutineContext getCoroutineContext() {
|
||||
return this.coroutineContext;
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.LifecycleCoroutineScope
|
||||
/* renamed from: getLifecycle$lifecycle_common, reason: from getter */
|
||||
public Lifecycle getLifecycle() {
|
||||
return this.lifecycle;
|
||||
}
|
||||
|
||||
public LifecycleCoroutineScopeImpl(Lifecycle lifecycle, CoroutineContext coroutineContext) {
|
||||
Intrinsics.checkNotNullParameter(lifecycle, "lifecycle");
|
||||
Intrinsics.checkNotNullParameter(coroutineContext, "coroutineContext");
|
||||
this.lifecycle = lifecycle;
|
||||
this.coroutineContext = coroutineContext;
|
||||
if (getLifecycle().getState() == Lifecycle.State.DESTROYED) {
|
||||
JobKt__JobKt.cancel$default(getCoroutineContext(), (CancellationException) null, 1, (Object) null);
|
||||
}
|
||||
}
|
||||
|
||||
public final void register() {
|
||||
BuildersKt__Builders_commonKt.launch$default(this, Dispatchers.getMain().getImmediate(), null, new LifecycleCoroutineScopeImpl$register$1(this, null), 2, null);
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.LifecycleEventObserver
|
||||
public void onStateChanged(LifecycleOwner source, Lifecycle.Event event) {
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
Intrinsics.checkNotNullParameter(event, "event");
|
||||
if (getLifecycle().getState().compareTo(Lifecycle.State.DESTROYED) <= 0) {
|
||||
getLifecycle().removeObserver(this);
|
||||
JobKt__JobKt.cancel$default(getCoroutineContext(), (CancellationException) null, 1, (Object) null);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.JvmStatic;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: LifecycleDispatcher.kt */
|
||||
@Metadata(d1 = {"\u0000 \n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\bÀ\u0002\u0018\u00002\u00020\u0001:\u0001\tB\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\u0010\u0010\u0005\u001a\u00020\u00062\u0006\u0010\u0007\u001a\u00020\bH\u0007R\u000e\u0010\u0003\u001a\u00020\u0004X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\n"}, d2 = {"Landroidx/lifecycle/LifecycleDispatcher;", "", "()V", "initialized", "Ljava/util/concurrent/atomic/AtomicBoolean;", "init", "", "context", "Landroid/content/Context;", "DispatcherActivityCallback", "lifecycle-process_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class LifecycleDispatcher {
|
||||
public static final LifecycleDispatcher INSTANCE = new LifecycleDispatcher();
|
||||
private static final AtomicBoolean initialized = new AtomicBoolean(false);
|
||||
|
||||
private LifecycleDispatcher() {
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public static final void init(Context context) {
|
||||
Intrinsics.checkNotNullParameter(context, "context");
|
||||
if (initialized.getAndSet(true)) {
|
||||
return;
|
||||
}
|
||||
Context applicationContext = context.getApplicationContext();
|
||||
Intrinsics.checkNotNull(applicationContext, "null cannot be cast to non-null type android.app.Application");
|
||||
((Application) applicationContext).registerActivityLifecycleCallbacks(new DispatcherActivityCallback());
|
||||
}
|
||||
|
||||
/* compiled from: LifecycleDispatcher.kt */
|
||||
@Metadata(d1 = {"\u0000\u001e\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\b\u0001\u0018\u00002\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0002J\u001a\u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u00062\b\u0010\u0007\u001a\u0004\u0018\u00010\bH\u0016¨\u0006\t"}, d2 = {"Landroidx/lifecycle/LifecycleDispatcher$DispatcherActivityCallback;", "Landroidx/lifecycle/EmptyActivityLifecycleCallbacks;", "()V", "onActivityCreated", "", "activity", "Landroid/app/Activity;", "savedInstanceState", "Landroid/os/Bundle;", "lifecycle-process_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
public static final class DispatcherActivityCallback extends EmptyActivityLifecycleCallbacks {
|
||||
@Override // androidx.lifecycle.EmptyActivityLifecycleCallbacks, android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
|
||||
Intrinsics.checkNotNullParameter(activity, "activity");
|
||||
ReportFragment.INSTANCE.injectIfNeededIn(activity);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import androidx.core.app.NotificationCompat;
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
import kotlin.Metadata;
|
||||
|
||||
/* compiled from: LifecycleEventObserver.kt */
|
||||
@Metadata(d1 = {"\u0000\u001c\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\bæ\u0080\u0001\u0018\u00002\u00020\u0001J\u0018\u0010\u0002\u001a\u00020\u00032\u0006\u0010\u0004\u001a\u00020\u00052\u0006\u0010\u0006\u001a\u00020\u0007H&ø\u0001\u0000\u0082\u0002\u0006\n\u0004\b!0\u0001¨\u0006\bÀ\u0006\u0001"}, d2 = {"Landroidx/lifecycle/LifecycleEventObserver;", "Landroidx/lifecycle/LifecycleObserver;", "onStateChanged", "", "source", "Landroidx/lifecycle/LifecycleOwner;", NotificationCompat.CATEGORY_EVENT, "Landroidx/lifecycle/Lifecycle$Event;", "lifecycle-common"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public interface LifecycleEventObserver extends LifecycleObserver {
|
||||
void onStateChanged(LifecycleOwner source, Lifecycle.Event event);
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
/* compiled from: D8$$SyntheticClass */
|
||||
/* loaded from: classes.dex */
|
||||
public final /* synthetic */ class LifecycleKt$$ExternalSyntheticBackportWithForwarding0 {
|
||||
public static /* synthetic */ boolean m(AtomicReference atomicReference, Object obj, Object obj2) {
|
||||
while (!atomicReference.compareAndSet(obj, obj2)) {
|
||||
if (atomicReference.get() != obj) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
@ -0,0 +1,86 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.ResultKt;
|
||||
import kotlin.Unit;
|
||||
import kotlin.coroutines.Continuation;
|
||||
import kotlin.coroutines.intrinsics.IntrinsicsKt;
|
||||
import kotlin.coroutines.jvm.internal.DebugMetadata;
|
||||
import kotlin.coroutines.jvm.internal.SuspendLambda;
|
||||
import kotlin.jvm.functions.Function0;
|
||||
import kotlin.jvm.functions.Function2;
|
||||
import kotlinx.coroutines.channels.ProduceKt;
|
||||
import kotlinx.coroutines.channels.ProducerScope;
|
||||
|
||||
/* compiled from: Lifecycle.kt */
|
||||
@Metadata(d1 = {"\u0000\u000e\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0000\u0010\u0003\u001a\u00020\u0002*\b\u0012\u0004\u0012\u00020\u00010\u0000H\u008a@"}, d2 = {"Lkotlinx/coroutines/channels/ProducerScope;", "Landroidx/lifecycle/Lifecycle$Event;", "", "<anonymous>"}, k = 3, mv = {1, 8, 0})
|
||||
@DebugMetadata(c = "androidx.lifecycle.LifecycleKt$eventFlow$1", f = "Lifecycle.kt", i = {}, l = {444}, m = "invokeSuspend", n = {}, s = {})
|
||||
/* loaded from: classes.dex */
|
||||
final class LifecycleKt$eventFlow$1 extends SuspendLambda implements Function2<ProducerScope<? super Lifecycle.Event>, Continuation<? super Unit>, Object> {
|
||||
final /* synthetic */ Lifecycle $this_eventFlow;
|
||||
private /* synthetic */ Object L$0;
|
||||
int label;
|
||||
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
LifecycleKt$eventFlow$1(Lifecycle lifecycle, Continuation<? super LifecycleKt$eventFlow$1> continuation) {
|
||||
super(2, continuation);
|
||||
this.$this_eventFlow = lifecycle;
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
||||
public final Continuation<Unit> create(Object obj, Continuation<?> continuation) {
|
||||
LifecycleKt$eventFlow$1 lifecycleKt$eventFlow$1 = new LifecycleKt$eventFlow$1(this.$this_eventFlow, continuation);
|
||||
lifecycleKt$eventFlow$1.L$0 = obj;
|
||||
return lifecycleKt$eventFlow$1;
|
||||
}
|
||||
|
||||
@Override // kotlin.jvm.functions.Function2
|
||||
public final Object invoke(ProducerScope<? super Lifecycle.Event> producerScope, Continuation<? super Unit> continuation) {
|
||||
return ((LifecycleKt$eventFlow$1) create(producerScope, continuation)).invokeSuspend(Unit.INSTANCE);
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
||||
public final Object invokeSuspend(Object obj) {
|
||||
Object coroutine_suspended = IntrinsicsKt.getCOROUTINE_SUSPENDED();
|
||||
int i = this.label;
|
||||
if (i == 0) {
|
||||
ResultKt.throwOnFailure(obj);
|
||||
final ProducerScope producerScope = (ProducerScope) this.L$0;
|
||||
final LifecycleEventObserver lifecycleEventObserver = new LifecycleEventObserver() { // from class: androidx.lifecycle.LifecycleKt$eventFlow$1$$ExternalSyntheticLambda0
|
||||
@Override // androidx.lifecycle.LifecycleEventObserver
|
||||
public final void onStateChanged(LifecycleOwner lifecycleOwner, Lifecycle.Event event) {
|
||||
ProducerScope.this.mo1852trySendJP2dKIU(event);
|
||||
}
|
||||
};
|
||||
this.$this_eventFlow.addObserver(lifecycleEventObserver);
|
||||
final Lifecycle lifecycle = this.$this_eventFlow;
|
||||
this.label = 1;
|
||||
if (ProduceKt.awaitClose(producerScope, new Function0<Unit>() { // from class: androidx.lifecycle.LifecycleKt$eventFlow$1.1
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
{
|
||||
super(0);
|
||||
}
|
||||
|
||||
@Override // kotlin.jvm.functions.Function0
|
||||
public /* bridge */ /* synthetic */ Unit invoke() {
|
||||
invoke2();
|
||||
return Unit.INSTANCE;
|
||||
}
|
||||
|
||||
/* renamed from: invoke, reason: avoid collision after fix types in other method */
|
||||
public final void invoke2() {
|
||||
Lifecycle.this.removeObserver(lifecycleEventObserver);
|
||||
}
|
||||
}, this) == coroutine_suspended) {
|
||||
return coroutine_suspended;
|
||||
}
|
||||
} else {
|
||||
if (i != 1) {
|
||||
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
|
||||
}
|
||||
ResultKt.throwOnFailure(obj);
|
||||
}
|
||||
return Unit.INSTANCE;
|
||||
}
|
||||
}
|
34
02-Easy5/E5/sources/androidx/lifecycle/LifecycleKt.java
Normal file
34
02-Easy5/E5/sources/androidx/lifecycle/LifecycleKt.java
Normal file
@ -0,0 +1,34 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import kotlinx.coroutines.Dispatchers;
|
||||
import kotlinx.coroutines.Job;
|
||||
import kotlinx.coroutines.SupervisorKt;
|
||||
import kotlinx.coroutines.flow.Flow;
|
||||
import kotlinx.coroutines.flow.FlowKt;
|
||||
|
||||
/* compiled from: Lifecycle.kt */
|
||||
@Metadata(d1 = {"\u0000\u001a\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\"\u0015\u0010\u0000\u001a\u00020\u0001*\u00020\u00028F¢\u0006\u0006\u001a\u0004\b\u0003\u0010\u0004\"\u001b\u0010\u0005\u001a\b\u0012\u0004\u0012\u00020\u00070\u0006*\u00020\u00028F¢\u0006\u0006\u001a\u0004\b\b\u0010\t¨\u0006\n"}, d2 = {"coroutineScope", "Landroidx/lifecycle/LifecycleCoroutineScope;", "Landroidx/lifecycle/Lifecycle;", "getCoroutineScope", "(Landroidx/lifecycle/Lifecycle;)Landroidx/lifecycle/LifecycleCoroutineScope;", "eventFlow", "Lkotlinx/coroutines/flow/Flow;", "Landroidx/lifecycle/Lifecycle$Event;", "getEventFlow", "(Landroidx/lifecycle/Lifecycle;)Lkotlinx/coroutines/flow/Flow;", "lifecycle-common"}, k = 2, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class LifecycleKt {
|
||||
public static final LifecycleCoroutineScope getCoroutineScope(Lifecycle lifecycle) {
|
||||
LifecycleCoroutineScopeImpl lifecycleCoroutineScopeImpl;
|
||||
Intrinsics.checkNotNullParameter(lifecycle, "<this>");
|
||||
do {
|
||||
LifecycleCoroutineScopeImpl lifecycleCoroutineScopeImpl2 = (LifecycleCoroutineScopeImpl) lifecycle.getInternalScopeRef().get();
|
||||
if (lifecycleCoroutineScopeImpl2 != null) {
|
||||
return lifecycleCoroutineScopeImpl2;
|
||||
}
|
||||
lifecycleCoroutineScopeImpl = new LifecycleCoroutineScopeImpl(lifecycle, SupervisorKt.SupervisorJob$default((Job) null, 1, (Object) null).plus(Dispatchers.getMain().getImmediate()));
|
||||
} while (!LifecycleKt$$ExternalSyntheticBackportWithForwarding0.m(lifecycle.getInternalScopeRef(), null, lifecycleCoroutineScopeImpl));
|
||||
lifecycleCoroutineScopeImpl.register();
|
||||
return lifecycleCoroutineScopeImpl;
|
||||
}
|
||||
|
||||
public static final Flow<Lifecycle.Event> getEventFlow(Lifecycle lifecycle) {
|
||||
Intrinsics.checkNotNullParameter(lifecycle, "<this>");
|
||||
return FlowKt.flowOn(FlowKt.callbackFlow(new LifecycleKt$eventFlow$1(lifecycle, null)), Dispatchers.getMain().getImmediate());
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import kotlin.Metadata;
|
||||
|
||||
/* compiled from: LifecycleObserver.kt */
|
||||
@Metadata(d1 = {"\u0000\n\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\bf\u0018\u00002\u00020\u0001ø\u0001\u0000\u0082\u0002\u0006\n\u0004\b!0\u0001¨\u0006\u0002À\u0006\u0001"}, d2 = {"Landroidx/lifecycle/LifecycleObserver;", "", "lifecycle-common"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public interface LifecycleObserver {
|
||||
}
|
10
02-Easy5/E5/sources/androidx/lifecycle/LifecycleOwner.java
Normal file
10
02-Easy5/E5/sources/androidx/lifecycle/LifecycleOwner.java
Normal file
@ -0,0 +1,10 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import kotlin.Metadata;
|
||||
|
||||
/* compiled from: LifecycleOwner.kt */
|
||||
@Metadata(d1 = {"\u0000\u0012\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\bf\u0018\u00002\u00020\u0001R\u0012\u0010\u0002\u001a\u00020\u0003X¦\u0004¢\u0006\u0006\u001a\u0004\b\u0004\u0010\u0005ø\u0001\u0000\u0082\u0002\u0006\n\u0004\b!0\u0001¨\u0006\u0006À\u0006\u0001"}, d2 = {"Landroidx/lifecycle/LifecycleOwner;", "", "lifecycle", "Landroidx/lifecycle/Lifecycle;", "getLifecycle", "()Landroidx/lifecycle/Lifecycle;", "lifecycle-common"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public interface LifecycleOwner {
|
||||
Lifecycle getLifecycle();
|
||||
}
|
14
02-Easy5/E5/sources/androidx/lifecycle/LifecycleOwnerKt.java
Normal file
14
02-Easy5/E5/sources/androidx/lifecycle/LifecycleOwnerKt.java
Normal file
@ -0,0 +1,14 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: LifecycleOwner.kt */
|
||||
@Metadata(d1 = {"\u0000\u000e\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\"\u0015\u0010\u0000\u001a\u00020\u0001*\u00020\u00028F¢\u0006\u0006\u001a\u0004\b\u0003\u0010\u0004¨\u0006\u0005"}, d2 = {"lifecycleScope", "Landroidx/lifecycle/LifecycleCoroutineScope;", "Landroidx/lifecycle/LifecycleOwner;", "getLifecycleScope", "(Landroidx/lifecycle/LifecycleOwner;)Landroidx/lifecycle/LifecycleCoroutineScope;", "lifecycle-common"}, k = 2, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class LifecycleOwnerKt {
|
||||
public static final LifecycleCoroutineScope getLifecycleScope(LifecycleOwner lifecycleOwner) {
|
||||
Intrinsics.checkNotNullParameter(lifecycleOwner, "<this>");
|
||||
return LifecycleKt.getCoroutineScope(lifecycleOwner.getLifecycle());
|
||||
}
|
||||
}
|
319
02-Easy5/E5/sources/androidx/lifecycle/LifecycleRegistry.java
Normal file
319
02-Easy5/E5/sources/androidx/lifecycle/LifecycleRegistry.java
Normal file
@ -0,0 +1,319 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import androidx.arch.core.executor.ArchTaskExecutor;
|
||||
import androidx.arch.core.internal.FastSafeIterableMap;
|
||||
import androidx.arch.core.internal.SafeIterableMap;
|
||||
import androidx.core.app.NotificationCompat;
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import kotlin.Deprecated;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.JvmStatic;
|
||||
import kotlin.jvm.internal.DefaultConstructorMarker;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import kotlinx.coroutines.flow.FlowKt;
|
||||
import kotlinx.coroutines.flow.MutableStateFlow;
|
||||
import kotlinx.coroutines.flow.StateFlow;
|
||||
import kotlinx.coroutines.flow.StateFlowKt;
|
||||
|
||||
/* compiled from: LifecycleRegistry.kt */
|
||||
@Metadata(d1 = {"\u0000l\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0005\n\u0002\u0010\u000e\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\n\b\u0016\u0018\u0000 :2\u00020\u0001:\u0002:;B\u000f\b\u0016\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0002\u0010\u0004B\u0017\b\u0002\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\u0006\u0010\u0005\u001a\u00020\u0006¢\u0006\u0002\u0010\u0007J\u0010\u0010'\u001a\u00020(2\u0006\u0010)\u001a\u00020\"H\u0016J\u0010\u0010*\u001a\u00020(2\u0006\u0010\u001a\u001a\u00020\u0003H\u0002J\u0010\u0010+\u001a\u00020\n2\u0006\u0010)\u001a\u00020\"H\u0002J\u0010\u0010,\u001a\u00020(2\u0006\u0010-\u001a\u00020.H\u0003J\u0010\u0010/\u001a\u00020(2\u0006\u0010\u001a\u001a\u00020\u0003H\u0002J\u0010\u00100\u001a\u00020(2\u0006\u00101\u001a\u000202H\u0016J\u0010\u00103\u001a\u00020(2\u0006\u0010\r\u001a\u00020\nH\u0017J\u0010\u00104\u001a\u00020(2\u0006\u00105\u001a\u00020\nH\u0002J\b\u00106\u001a\u00020(H\u0002J\u0010\u00107\u001a\u00020(2\u0006\u0010\r\u001a\u00020\nH\u0002J\u0010\u00108\u001a\u00020(2\u0006\u0010)\u001a\u00020\"H\u0016J\b\u00109\u001a\u00020(H\u0002R\u0014\u0010\b\u001a\b\u0012\u0004\u0012\u00020\n0\tX\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u000b\u001a\u00020\fX\u0082\u000e¢\u0006\u0002\n\u0000R$\u0010\u000e\u001a\u00020\n2\u0006\u0010\r\u001a\u00020\n8V@VX\u0096\u000e¢\u0006\f\u001a\u0004\b\u000f\u0010\u0010\"\u0004\b\u0011\u0010\u0012R\u001a\u0010\u0013\u001a\b\u0012\u0004\u0012\u00020\n0\u00148VX\u0096\u0004¢\u0006\u0006\u001a\u0004\b\u0015\u0010\u0016R\u000e\u0010\u0005\u001a\u00020\u0006X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0017\u001a\u00020\u0006X\u0082\u000e¢\u0006\u0002\n\u0000R\u0014\u0010\u0018\u001a\u00020\u00068BX\u0082\u0004¢\u0006\u0006\u001a\u0004\b\u0018\u0010\u0019R\u0014\u0010\u001a\u001a\b\u0012\u0004\u0012\u00020\u00030\u001bX\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u001c\u001a\u00020\u0006X\u0082\u000e¢\u0006\u0002\n\u0000R\u0014\u0010\u001d\u001a\u00020\f8VX\u0096\u0004¢\u0006\u0006\u001a\u0004\b\u001e\u0010\u001fR\u001a\u0010 \u001a\u000e\u0012\u0004\u0012\u00020\"\u0012\u0004\u0012\u00020#0!X\u0082\u000e¢\u0006\u0002\n\u0000R\u001e\u0010$\u001a\u0012\u0012\u0004\u0012\u00020\n0%j\b\u0012\u0004\u0012\u00020\n`&X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\r\u001a\u00020\nX\u0082\u000e¢\u0006\u0002\n\u0000¨\u0006<"}, d2 = {"Landroidx/lifecycle/LifecycleRegistry;", "Landroidx/lifecycle/Lifecycle;", "provider", "Landroidx/lifecycle/LifecycleOwner;", "(Landroidx/lifecycle/LifecycleOwner;)V", "enforceMainThread", "", "(Landroidx/lifecycle/LifecycleOwner;Z)V", "_currentStateFlow", "Lkotlinx/coroutines/flow/MutableStateFlow;", "Landroidx/lifecycle/Lifecycle$State;", "addingObserverCounter", "", "state", "currentState", "getCurrentState", "()Landroidx/lifecycle/Lifecycle$State;", "setCurrentState", "(Landroidx/lifecycle/Lifecycle$State;)V", "currentStateFlow", "Lkotlinx/coroutines/flow/StateFlow;", "getCurrentStateFlow", "()Lkotlinx/coroutines/flow/StateFlow;", "handlingEvent", "isSynced", "()Z", "lifecycleOwner", "Ljava/lang/ref/WeakReference;", "newEventOccurred", "observerCount", "getObserverCount", "()I", "observerMap", "Landroidx/arch/core/internal/FastSafeIterableMap;", "Landroidx/lifecycle/LifecycleObserver;", "Landroidx/lifecycle/LifecycleRegistry$ObserverWithState;", "parentStates", "Ljava/util/ArrayList;", "Lkotlin/collections/ArrayList;", "addObserver", "", "observer", "backwardPass", "calculateTargetState", "enforceMainThreadIfNeeded", "methodName", "", "forwardPass", "handleLifecycleEvent", NotificationCompat.CATEGORY_EVENT, "Landroidx/lifecycle/Lifecycle$Event;", "markState", "moveToState", "next", "popParentState", "pushParentState", "removeObserver", "sync", "Companion", "ObserverWithState", "lifecycle-runtime_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public class LifecycleRegistry extends Lifecycle {
|
||||
|
||||
/* renamed from: Companion, reason: from kotlin metadata */
|
||||
public static final Companion INSTANCE = new Companion(null);
|
||||
private final MutableStateFlow<Lifecycle.State> _currentStateFlow;
|
||||
private int addingObserverCounter;
|
||||
private final boolean enforceMainThread;
|
||||
private boolean handlingEvent;
|
||||
private final WeakReference<LifecycleOwner> lifecycleOwner;
|
||||
private boolean newEventOccurred;
|
||||
private FastSafeIterableMap<LifecycleObserver, ObserverWithState> observerMap;
|
||||
private ArrayList<Lifecycle.State> parentStates;
|
||||
private Lifecycle.State state;
|
||||
|
||||
public /* synthetic */ LifecycleRegistry(LifecycleOwner lifecycleOwner, boolean z, DefaultConstructorMarker defaultConstructorMarker) {
|
||||
this(lifecycleOwner, z);
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public static final LifecycleRegistry createUnsafe(LifecycleOwner lifecycleOwner) {
|
||||
return INSTANCE.createUnsafe(lifecycleOwner);
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.Lifecycle
|
||||
/* renamed from: getCurrentState, reason: from getter */
|
||||
public Lifecycle.State getState() {
|
||||
return this.state;
|
||||
}
|
||||
|
||||
private LifecycleRegistry(LifecycleOwner lifecycleOwner, boolean z) {
|
||||
this.enforceMainThread = z;
|
||||
this.observerMap = new FastSafeIterableMap<>();
|
||||
this.state = Lifecycle.State.INITIALIZED;
|
||||
this.parentStates = new ArrayList<>();
|
||||
this.lifecycleOwner = new WeakReference<>(lifecycleOwner);
|
||||
this._currentStateFlow = StateFlowKt.MutableStateFlow(Lifecycle.State.INITIALIZED);
|
||||
}
|
||||
|
||||
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
|
||||
public LifecycleRegistry(LifecycleOwner provider) {
|
||||
this(provider, true);
|
||||
Intrinsics.checkNotNullParameter(provider, "provider");
|
||||
}
|
||||
|
||||
@Deprecated(message = "Override [currentState].")
|
||||
public void markState(Lifecycle.State state) {
|
||||
Intrinsics.checkNotNullParameter(state, "state");
|
||||
enforceMainThreadIfNeeded("markState");
|
||||
setCurrentState(state);
|
||||
}
|
||||
|
||||
public void setCurrentState(Lifecycle.State state) {
|
||||
Intrinsics.checkNotNullParameter(state, "state");
|
||||
enforceMainThreadIfNeeded("setCurrentState");
|
||||
moveToState(state);
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.Lifecycle
|
||||
public StateFlow<Lifecycle.State> getCurrentStateFlow() {
|
||||
return FlowKt.asStateFlow(this._currentStateFlow);
|
||||
}
|
||||
|
||||
public void handleLifecycleEvent(Lifecycle.Event event) {
|
||||
Intrinsics.checkNotNullParameter(event, "event");
|
||||
enforceMainThreadIfNeeded("handleLifecycleEvent");
|
||||
moveToState(event.getTargetState());
|
||||
}
|
||||
|
||||
private final void moveToState(Lifecycle.State next) {
|
||||
Lifecycle.State state = this.state;
|
||||
if (state == next) {
|
||||
return;
|
||||
}
|
||||
if (state == Lifecycle.State.INITIALIZED && next == Lifecycle.State.DESTROYED) {
|
||||
throw new IllegalStateException(("no event down from " + this.state + " in component " + this.lifecycleOwner.get()).toString());
|
||||
}
|
||||
this.state = next;
|
||||
if (this.handlingEvent || this.addingObserverCounter != 0) {
|
||||
this.newEventOccurred = true;
|
||||
return;
|
||||
}
|
||||
this.handlingEvent = true;
|
||||
sync();
|
||||
this.handlingEvent = false;
|
||||
if (this.state == Lifecycle.State.DESTROYED) {
|
||||
this.observerMap = new FastSafeIterableMap<>();
|
||||
}
|
||||
}
|
||||
|
||||
private final boolean isSynced() {
|
||||
if (this.observerMap.size() == 0) {
|
||||
return true;
|
||||
}
|
||||
Map.Entry<LifecycleObserver, ObserverWithState> eldest = this.observerMap.eldest();
|
||||
Intrinsics.checkNotNull(eldest);
|
||||
Lifecycle.State state = eldest.getValue().getState();
|
||||
Map.Entry<LifecycleObserver, ObserverWithState> newest = this.observerMap.newest();
|
||||
Intrinsics.checkNotNull(newest);
|
||||
Lifecycle.State state2 = newest.getValue().getState();
|
||||
return state == state2 && this.state == state2;
|
||||
}
|
||||
|
||||
private final Lifecycle.State calculateTargetState(LifecycleObserver observer) {
|
||||
ObserverWithState value;
|
||||
Map.Entry<LifecycleObserver, ObserverWithState> ceil = this.observerMap.ceil(observer);
|
||||
Lifecycle.State state = null;
|
||||
Lifecycle.State state2 = (ceil == null || (value = ceil.getValue()) == null) ? null : value.getState();
|
||||
if (!this.parentStates.isEmpty()) {
|
||||
state = this.parentStates.get(r0.size() - 1);
|
||||
}
|
||||
Companion companion = INSTANCE;
|
||||
return companion.min$lifecycle_runtime_release(companion.min$lifecycle_runtime_release(this.state, state2), state);
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.Lifecycle
|
||||
public void addObserver(LifecycleObserver observer) {
|
||||
LifecycleOwner lifecycleOwner;
|
||||
Intrinsics.checkNotNullParameter(observer, "observer");
|
||||
enforceMainThreadIfNeeded("addObserver");
|
||||
ObserverWithState observerWithState = new ObserverWithState(observer, this.state == Lifecycle.State.DESTROYED ? Lifecycle.State.DESTROYED : Lifecycle.State.INITIALIZED);
|
||||
if (this.observerMap.putIfAbsent(observer, observerWithState) == null && (lifecycleOwner = this.lifecycleOwner.get()) != null) {
|
||||
boolean z = this.addingObserverCounter != 0 || this.handlingEvent;
|
||||
Lifecycle.State calculateTargetState = calculateTargetState(observer);
|
||||
this.addingObserverCounter++;
|
||||
while (observerWithState.getState().compareTo(calculateTargetState) < 0 && this.observerMap.contains(observer)) {
|
||||
pushParentState(observerWithState.getState());
|
||||
Lifecycle.Event upFrom = Lifecycle.Event.INSTANCE.upFrom(observerWithState.getState());
|
||||
if (upFrom == null) {
|
||||
throw new IllegalStateException("no event up from " + observerWithState.getState());
|
||||
}
|
||||
observerWithState.dispatchEvent(lifecycleOwner, upFrom);
|
||||
popParentState();
|
||||
calculateTargetState = calculateTargetState(observer);
|
||||
}
|
||||
if (!z) {
|
||||
sync();
|
||||
}
|
||||
this.addingObserverCounter--;
|
||||
}
|
||||
}
|
||||
|
||||
private final void popParentState() {
|
||||
this.parentStates.remove(r0.size() - 1);
|
||||
}
|
||||
|
||||
private final void pushParentState(Lifecycle.State state) {
|
||||
this.parentStates.add(state);
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.Lifecycle
|
||||
public void removeObserver(LifecycleObserver observer) {
|
||||
Intrinsics.checkNotNullParameter(observer, "observer");
|
||||
enforceMainThreadIfNeeded("removeObserver");
|
||||
this.observerMap.remove(observer);
|
||||
}
|
||||
|
||||
public int getObserverCount() {
|
||||
enforceMainThreadIfNeeded("getObserverCount");
|
||||
return this.observerMap.size();
|
||||
}
|
||||
|
||||
private final void forwardPass(LifecycleOwner lifecycleOwner) {
|
||||
SafeIterableMap<LifecycleObserver, ObserverWithState>.IteratorWithAdditions iteratorWithAdditions = this.observerMap.iteratorWithAdditions();
|
||||
Intrinsics.checkNotNullExpressionValue(iteratorWithAdditions, "observerMap.iteratorWithAdditions()");
|
||||
SafeIterableMap<LifecycleObserver, ObserverWithState>.IteratorWithAdditions iteratorWithAdditions2 = iteratorWithAdditions;
|
||||
while (iteratorWithAdditions2.hasNext() && !this.newEventOccurred) {
|
||||
Map.Entry next = iteratorWithAdditions2.next();
|
||||
LifecycleObserver lifecycleObserver = (LifecycleObserver) next.getKey();
|
||||
ObserverWithState observerWithState = (ObserverWithState) next.getValue();
|
||||
while (observerWithState.getState().compareTo(this.state) < 0 && !this.newEventOccurred && this.observerMap.contains(lifecycleObserver)) {
|
||||
pushParentState(observerWithState.getState());
|
||||
Lifecycle.Event upFrom = Lifecycle.Event.INSTANCE.upFrom(observerWithState.getState());
|
||||
if (upFrom == null) {
|
||||
throw new IllegalStateException("no event up from " + observerWithState.getState());
|
||||
}
|
||||
observerWithState.dispatchEvent(lifecycleOwner, upFrom);
|
||||
popParentState();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private final void backwardPass(LifecycleOwner lifecycleOwner) {
|
||||
Iterator<Map.Entry<LifecycleObserver, ObserverWithState>> descendingIterator = this.observerMap.descendingIterator();
|
||||
Intrinsics.checkNotNullExpressionValue(descendingIterator, "observerMap.descendingIterator()");
|
||||
while (descendingIterator.hasNext() && !this.newEventOccurred) {
|
||||
Map.Entry<LifecycleObserver, ObserverWithState> next = descendingIterator.next();
|
||||
Intrinsics.checkNotNullExpressionValue(next, "next()");
|
||||
LifecycleObserver key = next.getKey();
|
||||
ObserverWithState value = next.getValue();
|
||||
while (value.getState().compareTo(this.state) > 0 && !this.newEventOccurred && this.observerMap.contains(key)) {
|
||||
Lifecycle.Event downFrom = Lifecycle.Event.INSTANCE.downFrom(value.getState());
|
||||
if (downFrom == null) {
|
||||
throw new IllegalStateException("no event down from " + value.getState());
|
||||
}
|
||||
pushParentState(downFrom.getTargetState());
|
||||
value.dispatchEvent(lifecycleOwner, downFrom);
|
||||
popParentState();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private final void sync() {
|
||||
LifecycleOwner lifecycleOwner = this.lifecycleOwner.get();
|
||||
if (lifecycleOwner == null) {
|
||||
throw new IllegalStateException("LifecycleOwner of this LifecycleRegistry is already garbage collected. It is too late to change lifecycle state.");
|
||||
}
|
||||
while (!isSynced()) {
|
||||
this.newEventOccurred = false;
|
||||
Lifecycle.State state = this.state;
|
||||
Map.Entry<LifecycleObserver, ObserverWithState> eldest = this.observerMap.eldest();
|
||||
Intrinsics.checkNotNull(eldest);
|
||||
if (state.compareTo(eldest.getValue().getState()) < 0) {
|
||||
backwardPass(lifecycleOwner);
|
||||
}
|
||||
Map.Entry<LifecycleObserver, ObserverWithState> newest = this.observerMap.newest();
|
||||
if (!this.newEventOccurred && newest != null && this.state.compareTo(newest.getValue().getState()) > 0) {
|
||||
forwardPass(lifecycleOwner);
|
||||
}
|
||||
}
|
||||
this.newEventOccurred = false;
|
||||
this._currentStateFlow.setValue(getState());
|
||||
}
|
||||
|
||||
private final void enforceMainThreadIfNeeded(String methodName) {
|
||||
if (!this.enforceMainThread || ArchTaskExecutor.getInstance().isMainThread()) {
|
||||
return;
|
||||
}
|
||||
throw new IllegalStateException(("Method " + methodName + " must be called on the main thread").toString());
|
||||
}
|
||||
|
||||
/* compiled from: LifecycleRegistry.kt */
|
||||
@Metadata(d1 = {"\u00002\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\n\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\b\u0000\u0018\u00002\u00020\u0001B\u0017\u0012\b\u0010\u0002\u001a\u0004\u0018\u00010\u0003\u0012\u0006\u0010\u0004\u001a\u00020\u0005¢\u0006\u0002\u0010\u0006J\u0018\u0010\u0012\u001a\u00020\u00132\b\u0010\u0014\u001a\u0004\u0018\u00010\u00152\u0006\u0010\u0016\u001a\u00020\u0017R\u001a\u0010\u0007\u001a\u00020\bX\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\t\u0010\n\"\u0004\b\u000b\u0010\fR\u001a\u0010\r\u001a\u00020\u0005X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u000e\u0010\u000f\"\u0004\b\u0010\u0010\u0011¨\u0006\u0018"}, d2 = {"Landroidx/lifecycle/LifecycleRegistry$ObserverWithState;", "", "observer", "Landroidx/lifecycle/LifecycleObserver;", "initialState", "Landroidx/lifecycle/Lifecycle$State;", "(Landroidx/lifecycle/LifecycleObserver;Landroidx/lifecycle/Lifecycle$State;)V", "lifecycleObserver", "Landroidx/lifecycle/LifecycleEventObserver;", "getLifecycleObserver", "()Landroidx/lifecycle/LifecycleEventObserver;", "setLifecycleObserver", "(Landroidx/lifecycle/LifecycleEventObserver;)V", "state", "getState", "()Landroidx/lifecycle/Lifecycle$State;", "setState", "(Landroidx/lifecycle/Lifecycle$State;)V", "dispatchEvent", "", "owner", "Landroidx/lifecycle/LifecycleOwner;", NotificationCompat.CATEGORY_EVENT, "Landroidx/lifecycle/Lifecycle$Event;", "lifecycle-runtime_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
public static final class ObserverWithState {
|
||||
private LifecycleEventObserver lifecycleObserver;
|
||||
private Lifecycle.State state;
|
||||
|
||||
public final LifecycleEventObserver getLifecycleObserver() {
|
||||
return this.lifecycleObserver;
|
||||
}
|
||||
|
||||
public final Lifecycle.State getState() {
|
||||
return this.state;
|
||||
}
|
||||
|
||||
public final void setLifecycleObserver(LifecycleEventObserver lifecycleEventObserver) {
|
||||
Intrinsics.checkNotNullParameter(lifecycleEventObserver, "<set-?>");
|
||||
this.lifecycleObserver = lifecycleEventObserver;
|
||||
}
|
||||
|
||||
public final void setState(Lifecycle.State state) {
|
||||
Intrinsics.checkNotNullParameter(state, "<set-?>");
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public ObserverWithState(LifecycleObserver lifecycleObserver, Lifecycle.State initialState) {
|
||||
Intrinsics.checkNotNullParameter(initialState, "initialState");
|
||||
Intrinsics.checkNotNull(lifecycleObserver);
|
||||
this.lifecycleObserver = Lifecycling.lifecycleEventObserver(lifecycleObserver);
|
||||
this.state = initialState;
|
||||
}
|
||||
|
||||
public final void dispatchEvent(LifecycleOwner owner, Lifecycle.Event event) {
|
||||
Intrinsics.checkNotNullParameter(event, "event");
|
||||
Lifecycle.State targetState = event.getTargetState();
|
||||
this.state = LifecycleRegistry.INSTANCE.min$lifecycle_runtime_release(this.state, targetState);
|
||||
LifecycleEventObserver lifecycleEventObserver = this.lifecycleObserver;
|
||||
Intrinsics.checkNotNull(owner);
|
||||
lifecycleEventObserver.onStateChanged(owner, event);
|
||||
this.state = targetState;
|
||||
}
|
||||
}
|
||||
|
||||
/* compiled from: LifecycleRegistry.kt */
|
||||
@Metadata(d1 = {"\u0000 \n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\b\u0086\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\u0010\u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0006H\u0007J\u001f\u0010\u0007\u001a\u00020\b2\u0006\u0010\t\u001a\u00020\b2\b\u0010\n\u001a\u0004\u0018\u00010\bH\u0001¢\u0006\u0002\b\u000b¨\u0006\f"}, d2 = {"Landroidx/lifecycle/LifecycleRegistry$Companion;", "", "()V", "createUnsafe", "Landroidx/lifecycle/LifecycleRegistry;", "owner", "Landroidx/lifecycle/LifecycleOwner;", "min", "Landroidx/lifecycle/Lifecycle$State;", "state1", "state2", "min$lifecycle_runtime_release", "lifecycle-runtime_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
public static final class Companion {
|
||||
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
||||
this();
|
||||
}
|
||||
|
||||
private Companion() {
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public final LifecycleRegistry createUnsafe(LifecycleOwner owner) {
|
||||
Intrinsics.checkNotNullParameter(owner, "owner");
|
||||
return new LifecycleRegistry(owner, false, null);
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public final Lifecycle.State min$lifecycle_runtime_release(Lifecycle.State state1, Lifecycle.State state2) {
|
||||
Intrinsics.checkNotNullParameter(state1, "state1");
|
||||
return (state2 == null || state2.compareTo(state1) >= 0) ? state1 : state2;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
@Deprecated
|
||||
/* loaded from: classes.dex */
|
||||
public interface LifecycleRegistryOwner extends LifecycleOwner {
|
||||
@Override // androidx.lifecycle.LifecycleOwner
|
||||
LifecycleRegistry getLifecycle();
|
||||
|
||||
/* renamed from: androidx.lifecycle.LifecycleRegistryOwner$-CC, reason: invalid class name */
|
||||
public final /* synthetic */ class CC {
|
||||
}
|
||||
}
|
174
02-Easy5/E5/sources/androidx/lifecycle/Lifecycling.java
Normal file
174
02-Easy5/E5/sources/androidx/lifecycle/Lifecycling.java
Normal file
@ -0,0 +1,174 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.collections.CollectionsKt;
|
||||
import kotlin.jvm.JvmStatic;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import kotlin.text.StringsKt;
|
||||
|
||||
/* compiled from: Lifecycling.kt */
|
||||
@Metadata(d1 = {"\u0000D\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0010%\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0010\u000e\n\u0002\b\u0003\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\bÇ\u0002\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J \u0010\r\u001a\u00020\f2\u000e\u0010\u000e\u001a\n\u0012\u0006\b\u0001\u0012\u00020\f0\u000b2\u0006\u0010\u000f\u001a\u00020\u0001H\u0002J\u001e\u0010\u0010\u001a\f\u0012\u0006\b\u0001\u0012\u00020\f\u0018\u00010\u000b2\n\u0010\u0011\u001a\u0006\u0012\u0002\b\u00030\bH\u0002J\u0010\u0010\u0012\u001a\u00020\u00132\u0006\u0010\u0014\u001a\u00020\u0013H\u0007J\u0014\u0010\u0015\u001a\u00020\u00042\n\u0010\u0011\u001a\u0006\u0012\u0002\b\u00030\bH\u0002J\u0016\u0010\u0016\u001a\u00020\u00172\f\u0010\u0011\u001a\b\u0012\u0002\b\u0003\u0018\u00010\bH\u0002J\u0010\u0010\u0018\u001a\u00020\u00192\u0006\u0010\u000f\u001a\u00020\u0001H\u0007J\u0014\u0010\u001a\u001a\u00020\u00042\n\u0010\u0011\u001a\u0006\u0012\u0002\b\u00030\bH\u0002R\u000e\u0010\u0003\u001a\u00020\u0004X\u0082T¢\u0006\u0002\n\u0000R\u000e\u0010\u0005\u001a\u00020\u0004X\u0082T¢\u0006\u0002\n\u0000R\u001e\u0010\u0006\u001a\u0012\u0012\b\u0012\u0006\u0012\u0002\b\u00030\b\u0012\u0004\u0012\u00020\u00040\u0007X\u0082\u0004¢\u0006\u0002\n\u0000R,\u0010\t\u001a \u0012\b\u0012\u0006\u0012\u0002\b\u00030\b\u0012\u0012\u0012\u0010\u0012\f\u0012\n\u0012\u0006\b\u0001\u0012\u00020\f0\u000b0\n0\u0007X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u001b"}, d2 = {"Landroidx/lifecycle/Lifecycling;", "", "()V", "GENERATED_CALLBACK", "", "REFLECTIVE_CALLBACK", "callbackCache", "", "Ljava/lang/Class;", "classToAdapters", "", "Ljava/lang/reflect/Constructor;", "Landroidx/lifecycle/GeneratedAdapter;", "createGeneratedAdapter", "constructor", "object", "generatedConstructor", "klass", "getAdapterName", "", "className", "getObserverConstructorType", "isLifecycleParent", "", "lifecycleEventObserver", "Landroidx/lifecycle/LifecycleEventObserver;", "resolveObserverCallbackType", "lifecycle-common"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class Lifecycling {
|
||||
private static final int GENERATED_CALLBACK = 2;
|
||||
private static final int REFLECTIVE_CALLBACK = 1;
|
||||
public static final Lifecycling INSTANCE = new Lifecycling();
|
||||
private static final Map<Class<?>, Integer> callbackCache = new HashMap();
|
||||
private static final Map<Class<?>, List<Constructor<? extends GeneratedAdapter>>> classToAdapters = new HashMap();
|
||||
|
||||
private Lifecycling() {
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public static final LifecycleEventObserver lifecycleEventObserver(Object object) {
|
||||
Intrinsics.checkNotNullParameter(object, "object");
|
||||
boolean z = object instanceof LifecycleEventObserver;
|
||||
boolean z2 = object instanceof DefaultLifecycleObserver;
|
||||
if (z && z2) {
|
||||
return new DefaultLifecycleObserverAdapter((DefaultLifecycleObserver) object, (LifecycleEventObserver) object);
|
||||
}
|
||||
if (z2) {
|
||||
return new DefaultLifecycleObserverAdapter((DefaultLifecycleObserver) object, null);
|
||||
}
|
||||
if (z) {
|
||||
return (LifecycleEventObserver) object;
|
||||
}
|
||||
Class<?> cls = object.getClass();
|
||||
Lifecycling lifecycling = INSTANCE;
|
||||
if (lifecycling.getObserverConstructorType(cls) == 2) {
|
||||
List<Constructor<? extends GeneratedAdapter>> list = classToAdapters.get(cls);
|
||||
Intrinsics.checkNotNull(list);
|
||||
List<Constructor<? extends GeneratedAdapter>> list2 = list;
|
||||
if (list2.size() == 1) {
|
||||
return new SingleGeneratedAdapterObserver(lifecycling.createGeneratedAdapter(list2.get(0), object));
|
||||
}
|
||||
int size = list2.size();
|
||||
GeneratedAdapter[] generatedAdapterArr = new GeneratedAdapter[size];
|
||||
for (int i = 0; i < size; i++) {
|
||||
generatedAdapterArr[i] = INSTANCE.createGeneratedAdapter(list2.get(i), object);
|
||||
}
|
||||
return new CompositeGeneratedAdaptersObserver(generatedAdapterArr);
|
||||
}
|
||||
return new ReflectiveGenericLifecycleObserver(object);
|
||||
}
|
||||
|
||||
private final GeneratedAdapter createGeneratedAdapter(Constructor<? extends GeneratedAdapter> constructor, Object object) {
|
||||
try {
|
||||
GeneratedAdapter newInstance = constructor.newInstance(object);
|
||||
Intrinsics.checkNotNullExpressionValue(newInstance, "{\n constructo…tance(`object`)\n }");
|
||||
return newInstance;
|
||||
} catch (IllegalAccessException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (InstantiationException e2) {
|
||||
throw new RuntimeException(e2);
|
||||
} catch (InvocationTargetException e3) {
|
||||
throw new RuntimeException(e3);
|
||||
}
|
||||
}
|
||||
|
||||
private final Constructor<? extends GeneratedAdapter> generatedConstructor(Class<?> klass) {
|
||||
try {
|
||||
Package r0 = klass.getPackage();
|
||||
String name = klass.getCanonicalName();
|
||||
String fullPackage = r0 != null ? r0.getName() : "";
|
||||
Intrinsics.checkNotNullExpressionValue(fullPackage, "fullPackage");
|
||||
if (fullPackage.length() != 0) {
|
||||
Intrinsics.checkNotNullExpressionValue(name, "name");
|
||||
name = name.substring(fullPackage.length() + 1);
|
||||
Intrinsics.checkNotNullExpressionValue(name, "this as java.lang.String).substring(startIndex)");
|
||||
}
|
||||
Intrinsics.checkNotNullExpressionValue(name, "if (fullPackage.isEmpty(…g(fullPackage.length + 1)");
|
||||
String adapterName = getAdapterName(name);
|
||||
if (fullPackage.length() != 0) {
|
||||
adapterName = fullPackage + '.' + adapterName;
|
||||
}
|
||||
Class<?> cls = Class.forName(adapterName);
|
||||
Intrinsics.checkNotNull(cls, "null cannot be cast to non-null type java.lang.Class<out androidx.lifecycle.GeneratedAdapter>");
|
||||
Constructor declaredConstructor = cls.getDeclaredConstructor(klass);
|
||||
if (declaredConstructor.isAccessible()) {
|
||||
return declaredConstructor;
|
||||
}
|
||||
declaredConstructor.setAccessible(true);
|
||||
return declaredConstructor;
|
||||
} catch (ClassNotFoundException unused) {
|
||||
return null;
|
||||
} catch (NoSuchMethodException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private final int getObserverConstructorType(Class<?> klass) {
|
||||
Map<Class<?>, Integer> map = callbackCache;
|
||||
Integer num = map.get(klass);
|
||||
if (num != null) {
|
||||
return num.intValue();
|
||||
}
|
||||
int resolveObserverCallbackType = resolveObserverCallbackType(klass);
|
||||
map.put(klass, Integer.valueOf(resolveObserverCallbackType));
|
||||
return resolveObserverCallbackType;
|
||||
}
|
||||
|
||||
private final int resolveObserverCallbackType(Class<?> klass) {
|
||||
ArrayList arrayList;
|
||||
if (klass.getCanonicalName() == null) {
|
||||
return 1;
|
||||
}
|
||||
Constructor<? extends GeneratedAdapter> generatedConstructor = generatedConstructor(klass);
|
||||
if (generatedConstructor != null) {
|
||||
classToAdapters.put(klass, CollectionsKt.listOf(generatedConstructor));
|
||||
return 2;
|
||||
}
|
||||
if (ClassesInfoCache.sInstance.hasLifecycleMethods(klass)) {
|
||||
return 1;
|
||||
}
|
||||
Class<? super Object> superclass = klass.getSuperclass();
|
||||
if (isLifecycleParent(superclass)) {
|
||||
Intrinsics.checkNotNullExpressionValue(superclass, "superclass");
|
||||
if (getObserverConstructorType(superclass) == 1) {
|
||||
return 1;
|
||||
}
|
||||
List<Constructor<? extends GeneratedAdapter>> list = classToAdapters.get(superclass);
|
||||
Intrinsics.checkNotNull(list);
|
||||
arrayList = new ArrayList(list);
|
||||
} else {
|
||||
arrayList = null;
|
||||
}
|
||||
Class<?>[] interfaces = klass.getInterfaces();
|
||||
Intrinsics.checkNotNullExpressionValue(interfaces, "klass.interfaces");
|
||||
for (Class<?> intrface : interfaces) {
|
||||
if (isLifecycleParent(intrface)) {
|
||||
Intrinsics.checkNotNullExpressionValue(intrface, "intrface");
|
||||
if (getObserverConstructorType(intrface) == 1) {
|
||||
return 1;
|
||||
}
|
||||
if (arrayList == null) {
|
||||
arrayList = new ArrayList();
|
||||
}
|
||||
List<Constructor<? extends GeneratedAdapter>> list2 = classToAdapters.get(intrface);
|
||||
Intrinsics.checkNotNull(list2);
|
||||
arrayList.addAll(list2);
|
||||
}
|
||||
}
|
||||
if (arrayList == null) {
|
||||
return 1;
|
||||
}
|
||||
classToAdapters.put(klass, arrayList);
|
||||
return 2;
|
||||
}
|
||||
|
||||
private final boolean isLifecycleParent(Class<?> klass) {
|
||||
return klass != null && LifecycleObserver.class.isAssignableFrom(klass);
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public static final String getAdapterName(String className) {
|
||||
Intrinsics.checkNotNullParameter(className, "className");
|
||||
return StringsKt.replace$default(className, ".", "_", false, 4, (Object) null) + "_LifecycleAdapter";
|
||||
}
|
||||
}
|
318
02-Easy5/E5/sources/androidx/lifecycle/LiveData.java
Normal file
318
02-Easy5/E5/sources/androidx/lifecycle/LiveData.java
Normal file
@ -0,0 +1,318 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import androidx.arch.core.executor.ArchTaskExecutor;
|
||||
import androidx.arch.core.internal.SafeIterableMap;
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class LiveData<T> {
|
||||
static final Object NOT_SET = new Object();
|
||||
static final int START_VERSION = -1;
|
||||
int mActiveCount;
|
||||
private boolean mChangingActiveState;
|
||||
private volatile Object mData;
|
||||
final Object mDataLock;
|
||||
private boolean mDispatchInvalidated;
|
||||
private boolean mDispatchingValue;
|
||||
private SafeIterableMap<Observer<? super T>, LiveData<T>.ObserverWrapper> mObservers;
|
||||
volatile Object mPendingData;
|
||||
private final Runnable mPostValueRunnable;
|
||||
private int mVersion;
|
||||
|
||||
public T getValue() {
|
||||
T t = (T) this.mData;
|
||||
if (t != NOT_SET) {
|
||||
return t;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
int getVersion() {
|
||||
return this.mVersion;
|
||||
}
|
||||
|
||||
public boolean hasActiveObservers() {
|
||||
return this.mActiveCount > 0;
|
||||
}
|
||||
|
||||
public boolean isInitialized() {
|
||||
return this.mData != NOT_SET;
|
||||
}
|
||||
|
||||
protected void onActive() {
|
||||
}
|
||||
|
||||
protected void onInactive() {
|
||||
}
|
||||
|
||||
public LiveData(T t) {
|
||||
this.mDataLock = new Object();
|
||||
this.mObservers = new SafeIterableMap<>();
|
||||
this.mActiveCount = 0;
|
||||
this.mPendingData = NOT_SET;
|
||||
this.mPostValueRunnable = new Runnable() { // from class: androidx.lifecycle.LiveData.1
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
Object obj;
|
||||
synchronized (LiveData.this.mDataLock) {
|
||||
obj = LiveData.this.mPendingData;
|
||||
LiveData.this.mPendingData = LiveData.NOT_SET;
|
||||
}
|
||||
LiveData.this.setValue(obj);
|
||||
}
|
||||
};
|
||||
this.mData = t;
|
||||
this.mVersion = 0;
|
||||
}
|
||||
|
||||
public LiveData() {
|
||||
this.mDataLock = new Object();
|
||||
this.mObservers = new SafeIterableMap<>();
|
||||
this.mActiveCount = 0;
|
||||
Object obj = NOT_SET;
|
||||
this.mPendingData = obj;
|
||||
this.mPostValueRunnable = new Runnable() { // from class: androidx.lifecycle.LiveData.1
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // java.lang.Runnable
|
||||
public void run() {
|
||||
Object obj2;
|
||||
synchronized (LiveData.this.mDataLock) {
|
||||
obj2 = LiveData.this.mPendingData;
|
||||
LiveData.this.mPendingData = LiveData.NOT_SET;
|
||||
}
|
||||
LiveData.this.setValue(obj2);
|
||||
}
|
||||
};
|
||||
this.mData = obj;
|
||||
this.mVersion = -1;
|
||||
}
|
||||
|
||||
private void considerNotify(LiveData<T>.ObserverWrapper observerWrapper) {
|
||||
if (observerWrapper.mActive) {
|
||||
if (!observerWrapper.shouldBeActive()) {
|
||||
observerWrapper.activeStateChanged(false);
|
||||
return;
|
||||
}
|
||||
int i = observerWrapper.mLastVersion;
|
||||
int i2 = this.mVersion;
|
||||
if (i >= i2) {
|
||||
return;
|
||||
}
|
||||
observerWrapper.mLastVersion = i2;
|
||||
observerWrapper.mObserver.onChanged((Object) this.mData);
|
||||
}
|
||||
}
|
||||
|
||||
void dispatchingValue(LiveData<T>.ObserverWrapper observerWrapper) {
|
||||
if (this.mDispatchingValue) {
|
||||
this.mDispatchInvalidated = true;
|
||||
return;
|
||||
}
|
||||
this.mDispatchingValue = true;
|
||||
do {
|
||||
this.mDispatchInvalidated = false;
|
||||
if (observerWrapper != null) {
|
||||
considerNotify(observerWrapper);
|
||||
observerWrapper = null;
|
||||
} else {
|
||||
SafeIterableMap<Observer<? super T>, LiveData<T>.ObserverWrapper>.IteratorWithAdditions iteratorWithAdditions = this.mObservers.iteratorWithAdditions();
|
||||
while (iteratorWithAdditions.hasNext()) {
|
||||
considerNotify((ObserverWrapper) iteratorWithAdditions.next().getValue());
|
||||
if (this.mDispatchInvalidated) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} while (this.mDispatchInvalidated);
|
||||
this.mDispatchingValue = false;
|
||||
}
|
||||
|
||||
public void observe(LifecycleOwner lifecycleOwner, Observer<? super T> observer) {
|
||||
assertMainThread("observe");
|
||||
if (lifecycleOwner.getLifecycle().getCurrentState() == Lifecycle.State.DESTROYED) {
|
||||
return;
|
||||
}
|
||||
LifecycleBoundObserver lifecycleBoundObserver = new LifecycleBoundObserver(lifecycleOwner, observer);
|
||||
LiveData<T>.ObserverWrapper putIfAbsent = this.mObservers.putIfAbsent(observer, lifecycleBoundObserver);
|
||||
if (putIfAbsent != null && !putIfAbsent.isAttachedTo(lifecycleOwner)) {
|
||||
throw new IllegalArgumentException("Cannot add the same observer with different lifecycles");
|
||||
}
|
||||
if (putIfAbsent != null) {
|
||||
return;
|
||||
}
|
||||
lifecycleOwner.getLifecycle().addObserver(lifecycleBoundObserver);
|
||||
}
|
||||
|
||||
public void observeForever(Observer<? super T> observer) {
|
||||
assertMainThread("observeForever");
|
||||
AlwaysActiveObserver alwaysActiveObserver = new AlwaysActiveObserver(observer);
|
||||
LiveData<T>.ObserverWrapper putIfAbsent = this.mObservers.putIfAbsent(observer, alwaysActiveObserver);
|
||||
if (putIfAbsent instanceof LifecycleBoundObserver) {
|
||||
throw new IllegalArgumentException("Cannot add the same observer with different lifecycles");
|
||||
}
|
||||
if (putIfAbsent != null) {
|
||||
return;
|
||||
}
|
||||
alwaysActiveObserver.activeStateChanged(true);
|
||||
}
|
||||
|
||||
public void removeObserver(Observer<? super T> observer) {
|
||||
assertMainThread("removeObserver");
|
||||
LiveData<T>.ObserverWrapper remove = this.mObservers.remove(observer);
|
||||
if (remove == null) {
|
||||
return;
|
||||
}
|
||||
remove.detachObserver();
|
||||
remove.activeStateChanged(false);
|
||||
}
|
||||
|
||||
public void removeObservers(LifecycleOwner lifecycleOwner) {
|
||||
assertMainThread("removeObservers");
|
||||
Iterator<Map.Entry<Observer<? super T>, LiveData<T>.ObserverWrapper>> it = this.mObservers.iterator();
|
||||
while (it.hasNext()) {
|
||||
Map.Entry<Observer<? super T>, LiveData<T>.ObserverWrapper> next = it.next();
|
||||
if (next.getValue().isAttachedTo(lifecycleOwner)) {
|
||||
removeObserver(next.getKey());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void postValue(T t) {
|
||||
boolean z;
|
||||
synchronized (this.mDataLock) {
|
||||
z = this.mPendingData == NOT_SET;
|
||||
this.mPendingData = t;
|
||||
}
|
||||
if (z) {
|
||||
ArchTaskExecutor.getInstance().postToMainThread(this.mPostValueRunnable);
|
||||
}
|
||||
}
|
||||
|
||||
protected void setValue(T t) {
|
||||
assertMainThread("setValue");
|
||||
this.mVersion++;
|
||||
this.mData = t;
|
||||
dispatchingValue(null);
|
||||
}
|
||||
|
||||
public boolean hasObservers() {
|
||||
return this.mObservers.size() > 0;
|
||||
}
|
||||
|
||||
void changeActiveCounter(int i) {
|
||||
int i2 = this.mActiveCount;
|
||||
this.mActiveCount = i + i2;
|
||||
if (this.mChangingActiveState) {
|
||||
return;
|
||||
}
|
||||
this.mChangingActiveState = true;
|
||||
while (true) {
|
||||
try {
|
||||
int i3 = this.mActiveCount;
|
||||
if (i2 == i3) {
|
||||
return;
|
||||
}
|
||||
boolean z = i2 == 0 && i3 > 0;
|
||||
boolean z2 = i2 > 0 && i3 == 0;
|
||||
if (z) {
|
||||
onActive();
|
||||
} else if (z2) {
|
||||
onInactive();
|
||||
}
|
||||
i2 = i3;
|
||||
} finally {
|
||||
this.mChangingActiveState = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class LifecycleBoundObserver extends LiveData<T>.ObserverWrapper implements LifecycleEventObserver {
|
||||
final LifecycleOwner mOwner;
|
||||
|
||||
@Override // androidx.lifecycle.LiveData.ObserverWrapper
|
||||
boolean isAttachedTo(LifecycleOwner lifecycleOwner) {
|
||||
return this.mOwner == lifecycleOwner;
|
||||
}
|
||||
|
||||
LifecycleBoundObserver(LifecycleOwner lifecycleOwner, Observer<? super T> observer) {
|
||||
super(observer);
|
||||
this.mOwner = lifecycleOwner;
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.LiveData.ObserverWrapper
|
||||
boolean shouldBeActive() {
|
||||
return this.mOwner.getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED);
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.LifecycleEventObserver
|
||||
public void onStateChanged(LifecycleOwner lifecycleOwner, Lifecycle.Event event) {
|
||||
Lifecycle.State currentState = this.mOwner.getLifecycle().getCurrentState();
|
||||
if (currentState == Lifecycle.State.DESTROYED) {
|
||||
LiveData.this.removeObserver(this.mObserver);
|
||||
return;
|
||||
}
|
||||
Lifecycle.State state = null;
|
||||
while (state != currentState) {
|
||||
activeStateChanged(shouldBeActive());
|
||||
state = currentState;
|
||||
currentState = this.mOwner.getLifecycle().getCurrentState();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.LiveData.ObserverWrapper
|
||||
void detachObserver() {
|
||||
this.mOwner.getLifecycle().removeObserver(this);
|
||||
}
|
||||
}
|
||||
|
||||
private abstract class ObserverWrapper {
|
||||
boolean mActive;
|
||||
int mLastVersion = -1;
|
||||
final Observer<? super T> mObserver;
|
||||
|
||||
void detachObserver() {
|
||||
}
|
||||
|
||||
boolean isAttachedTo(LifecycleOwner lifecycleOwner) {
|
||||
return false;
|
||||
}
|
||||
|
||||
abstract boolean shouldBeActive();
|
||||
|
||||
ObserverWrapper(Observer<? super T> observer) {
|
||||
this.mObserver = observer;
|
||||
}
|
||||
|
||||
void activeStateChanged(boolean z) {
|
||||
if (z == this.mActive) {
|
||||
return;
|
||||
}
|
||||
this.mActive = z;
|
||||
LiveData.this.changeActiveCounter(z ? 1 : -1);
|
||||
if (this.mActive) {
|
||||
LiveData.this.dispatchingValue(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class AlwaysActiveObserver extends LiveData<T>.ObserverWrapper {
|
||||
@Override // androidx.lifecycle.LiveData.ObserverWrapper
|
||||
boolean shouldBeActive() {
|
||||
return true;
|
||||
}
|
||||
|
||||
AlwaysActiveObserver(Observer<? super T> observer) {
|
||||
super(observer);
|
||||
}
|
||||
}
|
||||
|
||||
static void assertMainThread(String str) {
|
||||
if (ArchTaskExecutor.getInstance().isMainThread()) {
|
||||
return;
|
||||
}
|
||||
throw new IllegalStateException("Cannot invoke " + str + " on a background thread");
|
||||
}
|
||||
}
|
23
02-Easy5/E5/sources/androidx/lifecycle/LiveDataKt.java
Normal file
23
02-Easy5/E5/sources/androidx/lifecycle/LiveDataKt.java
Normal file
@ -0,0 +1,23 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import kotlin.Deprecated;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.Unit;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
|
||||
/* compiled from: LiveData.kt */
|
||||
@Metadata(d1 = {"\u0000\u001e\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0000\u001a=\u0010\u0000\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0001\"\u0004\b\u0000\u0010\u0002*\b\u0012\u0004\u0012\u0002H\u00020\u00032\u0006\u0010\u0004\u001a\u00020\u00052\u0014\b\u0004\u0010\u0006\u001a\u000e\u0012\u0004\u0012\u0002H\u0002\u0012\u0004\u0012\u00020\b0\u0007H\u0087\b¨\u0006\t"}, d2 = {"observe", "Landroidx/lifecycle/Observer;", "T", "Landroidx/lifecycle/LiveData;", "owner", "Landroidx/lifecycle/LifecycleOwner;", "onChanged", "Lkotlin/Function1;", "", "lifecycle-livedata-core-ktx_release"}, k = 2, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class LiveDataKt {
|
||||
@Deprecated(message = "This extension method is not required when using Kotlin 1.4. You should remove \"import androidx.lifecycle.observe\"")
|
||||
public static final <T> Observer<T> observe(LiveData<T> liveData, LifecycleOwner lifecycleOwner, final Function1<? super T, Unit> function1) {
|
||||
Observer<T> observer = new Observer() { // from class: androidx.lifecycle.LiveDataKt$observe$wrappedObserver$1
|
||||
@Override // androidx.lifecycle.Observer
|
||||
public final void onChanged(T t) {
|
||||
function1.invoke(t);
|
||||
}
|
||||
};
|
||||
liveData.observe(lifecycleOwner, observer);
|
||||
return observer;
|
||||
}
|
||||
}
|
17
02-Easy5/E5/sources/androidx/lifecycle/LiveDataScope.java
Normal file
17
02-Easy5/E5/sources/androidx/lifecycle/LiveDataScope.java
Normal file
@ -0,0 +1,17 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import kotlin.Metadata;
|
||||
import kotlin.Unit;
|
||||
import kotlin.coroutines.Continuation;
|
||||
import kotlinx.coroutines.DisposableHandle;
|
||||
|
||||
/* compiled from: CoroutineLiveData.kt */
|
||||
@Metadata(d1 = {"\u0000$\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0000\n\u0002\b\u0004\n\u0002\u0010\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\bf\u0018\u0000*\u0004\b\u0000\u0010\u00012\u00020\u0002J\u0016\u0010\u0006\u001a\u00020\u00072\u0006\u0010\b\u001a\u00028\u0000H¦@¢\u0006\u0002\u0010\tJ\u001c\u0010\n\u001a\u00020\u000b2\f\u0010\f\u001a\b\u0012\u0004\u0012\u00028\u00000\rH¦@¢\u0006\u0002\u0010\u000eR\u0014\u0010\u0003\u001a\u0004\u0018\u00018\u0000X¦\u0004¢\u0006\u0006\u001a\u0004\b\u0004\u0010\u0005ø\u0001\u0000\u0082\u0002\u0006\n\u0004\b!0\u0001¨\u0006\u000fÀ\u0006\u0001"}, d2 = {"Landroidx/lifecycle/LiveDataScope;", "T", "", "latestValue", "getLatestValue", "()Ljava/lang/Object;", "emit", "", "value", "(Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "emitSource", "Lkotlinx/coroutines/DisposableHandle;", "source", "Landroidx/lifecycle/LiveData;", "(Landroidx/lifecycle/LiveData;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "lifecycle-livedata_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public interface LiveDataScope<T> {
|
||||
Object emit(T t, Continuation<? super Unit> continuation);
|
||||
|
||||
Object emitSource(LiveData<T> liveData, Continuation<? super DisposableHandle> continuation);
|
||||
|
||||
T getLatestValue();
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import kotlin.Metadata;
|
||||
import kotlin.ResultKt;
|
||||
import kotlin.Unit;
|
||||
import kotlin.coroutines.Continuation;
|
||||
import kotlin.coroutines.intrinsics.IntrinsicsKt;
|
||||
import kotlin.coroutines.jvm.internal.DebugMetadata;
|
||||
import kotlin.coroutines.jvm.internal.SuspendLambda;
|
||||
import kotlin.jvm.functions.Function2;
|
||||
import kotlinx.coroutines.CoroutineScope;
|
||||
|
||||
/* compiled from: CoroutineLiveData.kt */
|
||||
@Metadata(d1 = {"\u0000\f\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0000\u0010\u0003\u001a\u00020\u0002\"\u0004\b\u0000\u0010\u0000*\u00020\u0001H\u008a@"}, d2 = {"T", "Lkotlinx/coroutines/CoroutineScope;", "", "<anonymous>"}, k = 3, mv = {1, 8, 0})
|
||||
@DebugMetadata(c = "androidx.lifecycle.LiveDataScopeImpl$emit$2", f = "CoroutineLiveData.kt", i = {}, l = {99}, m = "invokeSuspend", n = {}, s = {})
|
||||
/* loaded from: classes.dex */
|
||||
final class LiveDataScopeImpl$emit$2 extends SuspendLambda implements Function2<CoroutineScope, Continuation<? super Unit>, Object> {
|
||||
final /* synthetic */ T $value;
|
||||
int label;
|
||||
final /* synthetic */ LiveDataScopeImpl<T> this$0;
|
||||
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
LiveDataScopeImpl$emit$2(LiveDataScopeImpl<T> liveDataScopeImpl, T t, Continuation<? super LiveDataScopeImpl$emit$2> continuation) {
|
||||
super(2, continuation);
|
||||
this.this$0 = liveDataScopeImpl;
|
||||
this.$value = t;
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
||||
public final Continuation<Unit> create(Object obj, Continuation<?> continuation) {
|
||||
return new LiveDataScopeImpl$emit$2(this.this$0, this.$value, continuation);
|
||||
}
|
||||
|
||||
@Override // kotlin.jvm.functions.Function2
|
||||
public final Object invoke(CoroutineScope coroutineScope, Continuation<? super Unit> continuation) {
|
||||
return ((LiveDataScopeImpl$emit$2) create(coroutineScope, continuation)).invokeSuspend(Unit.INSTANCE);
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
||||
public final Object invokeSuspend(Object obj) {
|
||||
Object coroutine_suspended = IntrinsicsKt.getCOROUTINE_SUSPENDED();
|
||||
int i = this.label;
|
||||
if (i == 0) {
|
||||
ResultKt.throwOnFailure(obj);
|
||||
this.label = 1;
|
||||
if (this.this$0.getTarget$lifecycle_livedata_release().clearSource$lifecycle_livedata_release(this) == coroutine_suspended) {
|
||||
return coroutine_suspended;
|
||||
}
|
||||
} else {
|
||||
if (i != 1) {
|
||||
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
|
||||
}
|
||||
ResultKt.throwOnFailure(obj);
|
||||
}
|
||||
this.this$0.getTarget$lifecycle_livedata_release().setValue(this.$value);
|
||||
return Unit.INSTANCE;
|
||||
}
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import kotlin.Metadata;
|
||||
import kotlin.ResultKt;
|
||||
import kotlin.Unit;
|
||||
import kotlin.coroutines.Continuation;
|
||||
import kotlin.coroutines.intrinsics.IntrinsicsKt;
|
||||
import kotlin.coroutines.jvm.internal.DebugMetadata;
|
||||
import kotlin.coroutines.jvm.internal.SuspendLambda;
|
||||
import kotlin.jvm.functions.Function2;
|
||||
import kotlinx.coroutines.CoroutineScope;
|
||||
import kotlinx.coroutines.DisposableHandle;
|
||||
|
||||
/* compiled from: CoroutineLiveData.kt */
|
||||
@Metadata(d1 = {"\u0000\f\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\u0010\u0003\u001a\u00020\u0002\"\u0004\b\u0000\u0010\u0000*\u00020\u0001H\u008a@"}, d2 = {"T", "Lkotlinx/coroutines/CoroutineScope;", "Lkotlinx/coroutines/DisposableHandle;", "<anonymous>"}, k = 3, mv = {1, 8, 0})
|
||||
@DebugMetadata(c = "androidx.lifecycle.LiveDataScopeImpl$emitSource$2", f = "CoroutineLiveData.kt", i = {}, l = {94}, m = "invokeSuspend", n = {}, s = {})
|
||||
/* loaded from: classes.dex */
|
||||
final class LiveDataScopeImpl$emitSource$2 extends SuspendLambda implements Function2<CoroutineScope, Continuation<? super DisposableHandle>, Object> {
|
||||
final /* synthetic */ LiveData<T> $source;
|
||||
int label;
|
||||
final /* synthetic */ LiveDataScopeImpl<T> this$0;
|
||||
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
LiveDataScopeImpl$emitSource$2(LiveDataScopeImpl<T> liveDataScopeImpl, LiveData<T> liveData, Continuation<? super LiveDataScopeImpl$emitSource$2> continuation) {
|
||||
super(2, continuation);
|
||||
this.this$0 = liveDataScopeImpl;
|
||||
this.$source = liveData;
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
||||
public final Continuation<Unit> create(Object obj, Continuation<?> continuation) {
|
||||
return new LiveDataScopeImpl$emitSource$2(this.this$0, this.$source, continuation);
|
||||
}
|
||||
|
||||
@Override // kotlin.jvm.functions.Function2
|
||||
public final Object invoke(CoroutineScope coroutineScope, Continuation<? super DisposableHandle> continuation) {
|
||||
return ((LiveDataScopeImpl$emitSource$2) create(coroutineScope, continuation)).invokeSuspend(Unit.INSTANCE);
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
||||
public final Object invokeSuspend(Object obj) {
|
||||
Object coroutine_suspended = IntrinsicsKt.getCOROUTINE_SUSPENDED();
|
||||
int i = this.label;
|
||||
if (i == 0) {
|
||||
ResultKt.throwOnFailure(obj);
|
||||
this.label = 1;
|
||||
obj = this.this$0.getTarget$lifecycle_livedata_release().emitSource$lifecycle_livedata_release(this.$source, 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;
|
||||
}
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import androidx.constraintlayout.core.motion.utils.TypedValues;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.Unit;
|
||||
import kotlin.coroutines.Continuation;
|
||||
import kotlin.coroutines.CoroutineContext;
|
||||
import kotlin.coroutines.intrinsics.IntrinsicsKt;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import kotlinx.coroutines.BuildersKt;
|
||||
import kotlinx.coroutines.Dispatchers;
|
||||
import kotlinx.coroutines.DisposableHandle;
|
||||
|
||||
/* compiled from: CoroutineLiveData.kt */
|
||||
@Metadata(d1 = {"\u00000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\n\n\u0002\u0010\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\b\u0000\u0018\u0000*\u0004\b\u0000\u0010\u00012\b\u0012\u0004\u0012\u0002H\u00010\u0002B\u001b\u0012\f\u0010\u0003\u001a\b\u0012\u0004\u0012\u00028\u00000\u0004\u0012\u0006\u0010\u0005\u001a\u00020\u0006¢\u0006\u0002\u0010\u0007J\u0016\u0010\u0010\u001a\u00020\u00112\u0006\u0010\u0012\u001a\u00028\u0000H\u0097@¢\u0006\u0002\u0010\u0013J\u001c\u0010\u0014\u001a\u00020\u00152\f\u0010\u0016\u001a\b\u0012\u0004\u0012\u00028\u00000\u0017H\u0096@¢\u0006\u0002\u0010\u0018R\u000e\u0010\b\u001a\u00020\u0006X\u0082\u0004¢\u0006\u0002\n\u0000R\u0016\u0010\t\u001a\u0004\u0018\u00018\u00008VX\u0096\u0004¢\u0006\u0006\u001a\u0004\b\n\u0010\u000bR \u0010\u0003\u001a\b\u0012\u0004\u0012\u00028\u00000\u0004X\u0080\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\f\u0010\r\"\u0004\b\u000e\u0010\u000f¨\u0006\u0019"}, d2 = {"Landroidx/lifecycle/LiveDataScopeImpl;", "T", "Landroidx/lifecycle/LiveDataScope;", TypedValues.AttributesType.S_TARGET, "Landroidx/lifecycle/CoroutineLiveData;", "context", "Lkotlin/coroutines/CoroutineContext;", "(Landroidx/lifecycle/CoroutineLiveData;Lkotlin/coroutines/CoroutineContext;)V", "coroutineContext", "latestValue", "getLatestValue", "()Ljava/lang/Object;", "getTarget$lifecycle_livedata_release", "()Landroidx/lifecycle/CoroutineLiveData;", "setTarget$lifecycle_livedata_release", "(Landroidx/lifecycle/CoroutineLiveData;)V", "emit", "", "value", "(Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "emitSource", "Lkotlinx/coroutines/DisposableHandle;", "source", "Landroidx/lifecycle/LiveData;", "(Landroidx/lifecycle/LiveData;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "lifecycle-livedata_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class LiveDataScopeImpl<T> implements LiveDataScope<T> {
|
||||
private final CoroutineContext coroutineContext;
|
||||
private CoroutineLiveData<T> target;
|
||||
|
||||
public final CoroutineLiveData<T> getTarget$lifecycle_livedata_release() {
|
||||
return this.target;
|
||||
}
|
||||
|
||||
public final void setTarget$lifecycle_livedata_release(CoroutineLiveData<T> coroutineLiveData) {
|
||||
Intrinsics.checkNotNullParameter(coroutineLiveData, "<set-?>");
|
||||
this.target = coroutineLiveData;
|
||||
}
|
||||
|
||||
public LiveDataScopeImpl(CoroutineLiveData<T> target, CoroutineContext context) {
|
||||
Intrinsics.checkNotNullParameter(target, "target");
|
||||
Intrinsics.checkNotNullParameter(context, "context");
|
||||
this.target = target;
|
||||
this.coroutineContext = context.plus(Dispatchers.getMain().getImmediate());
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.LiveDataScope
|
||||
public T getLatestValue() {
|
||||
return this.target.getValue();
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.LiveDataScope
|
||||
public Object emitSource(LiveData<T> liveData, Continuation<? super DisposableHandle> continuation) {
|
||||
return BuildersKt.withContext(this.coroutineContext, new LiveDataScopeImpl$emitSource$2(this, liveData, null), continuation);
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.LiveDataScope
|
||||
public Object emit(T t, Continuation<? super Unit> continuation) {
|
||||
Object withContext = BuildersKt.withContext(this.coroutineContext, new LiveDataScopeImpl$emit$2(this, t, null), continuation);
|
||||
return withContext == IntrinsicsKt.getCOROUTINE_SUSPENDED() ? withContext : Unit.INSTANCE;
|
||||
}
|
||||
}
|
83
02-Easy5/E5/sources/androidx/lifecycle/MediatorLiveData.java
Normal file
83
02-Easy5/E5/sources/androidx/lifecycle/MediatorLiveData.java
Normal file
@ -0,0 +1,83 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import androidx.arch.core.internal.SafeIterableMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class MediatorLiveData<T> extends MutableLiveData<T> {
|
||||
private SafeIterableMap<LiveData<?>, Source<?>> mSources;
|
||||
|
||||
public MediatorLiveData() {
|
||||
this.mSources = new SafeIterableMap<>();
|
||||
}
|
||||
|
||||
public MediatorLiveData(T t) {
|
||||
super(t);
|
||||
this.mSources = new SafeIterableMap<>();
|
||||
}
|
||||
|
||||
public <S> void addSource(LiveData<S> liveData, Observer<? super S> observer) {
|
||||
if (liveData == null) {
|
||||
throw new NullPointerException("source cannot be null");
|
||||
}
|
||||
Source<?> source = new Source<>(liveData, observer);
|
||||
Source<?> putIfAbsent = this.mSources.putIfAbsent(liveData, source);
|
||||
if (putIfAbsent != null && putIfAbsent.mObserver != observer) {
|
||||
throw new IllegalArgumentException("This source was already added with the different observer");
|
||||
}
|
||||
if (putIfAbsent == null && hasActiveObservers()) {
|
||||
source.plug();
|
||||
}
|
||||
}
|
||||
|
||||
public <S> void removeSource(LiveData<S> liveData) {
|
||||
Source<?> remove = this.mSources.remove(liveData);
|
||||
if (remove != null) {
|
||||
remove.unplug();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.LiveData
|
||||
protected void onActive() {
|
||||
Iterator<Map.Entry<LiveData<?>, Source<?>>> it = this.mSources.iterator();
|
||||
while (it.hasNext()) {
|
||||
it.next().getValue().plug();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.LiveData
|
||||
protected void onInactive() {
|
||||
Iterator<Map.Entry<LiveData<?>, Source<?>>> it = this.mSources.iterator();
|
||||
while (it.hasNext()) {
|
||||
it.next().getValue().unplug();
|
||||
}
|
||||
}
|
||||
|
||||
private static class Source<V> implements Observer<V> {
|
||||
final LiveData<V> mLiveData;
|
||||
final Observer<? super V> mObserver;
|
||||
int mVersion = -1;
|
||||
|
||||
Source(LiveData<V> liveData, Observer<? super V> observer) {
|
||||
this.mLiveData = liveData;
|
||||
this.mObserver = observer;
|
||||
}
|
||||
|
||||
void plug() {
|
||||
this.mLiveData.observeForever(this);
|
||||
}
|
||||
|
||||
void unplug() {
|
||||
this.mLiveData.removeObserver(this);
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.Observer
|
||||
public void onChanged(V v) {
|
||||
if (this.mVersion != this.mLiveData.getVersion()) {
|
||||
this.mVersion = this.mLiveData.getVersion();
|
||||
this.mObserver.onChanged(v);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: MethodCallsLogger.kt */
|
||||
@Metadata(d1 = {"\u0000\"\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010%\n\u0002\u0010\u000e\n\u0002\u0010\b\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0003\b\u0017\u0018\u00002\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0002J\u0018\u0010\u0007\u001a\u00020\b2\u0006\u0010\t\u001a\u00020\u00052\u0006\u0010\n\u001a\u00020\u0006H\u0017R\u001a\u0010\u0003\u001a\u000e\u0012\u0004\u0012\u00020\u0005\u0012\u0004\u0012\u00020\u00060\u0004X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u000b"}, d2 = {"Landroidx/lifecycle/MethodCallsLogger;", "", "()V", "calledMethods", "", "", "", "approveCall", "", "name", "type", "lifecycle-common"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public class MethodCallsLogger {
|
||||
private final Map<String, Integer> calledMethods = new HashMap();
|
||||
|
||||
public boolean approveCall(String name, int type) {
|
||||
Intrinsics.checkNotNullParameter(name, "name");
|
||||
Integer num = this.calledMethods.get(name);
|
||||
int intValue = num != null ? num.intValue() : 0;
|
||||
boolean z = (intValue & type) != 0;
|
||||
this.calledMethods.put(name, Integer.valueOf(type | intValue));
|
||||
return !z;
|
||||
}
|
||||
}
|
21
02-Easy5/E5/sources/androidx/lifecycle/MutableLiveData.java
Normal file
21
02-Easy5/E5/sources/androidx/lifecycle/MutableLiveData.java
Normal file
@ -0,0 +1,21 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class MutableLiveData<T> extends LiveData<T> {
|
||||
public MutableLiveData(T t) {
|
||||
super(t);
|
||||
}
|
||||
|
||||
public MutableLiveData() {
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.LiveData
|
||||
public void postValue(T t) {
|
||||
super.postValue(t);
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.LiveData
|
||||
public void setValue(T t) {
|
||||
super.setValue(t);
|
||||
}
|
||||
}
|
10
02-Easy5/E5/sources/androidx/lifecycle/Observer.java
Normal file
10
02-Easy5/E5/sources/androidx/lifecycle/Observer.java
Normal file
@ -0,0 +1,10 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import kotlin.Metadata;
|
||||
|
||||
/* compiled from: Observer.kt */
|
||||
@Metadata(d1 = {"\u0000\u0014\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0003\bæ\u0080\u0001\u0018\u0000*\u0004\b\u0000\u0010\u00012\u00020\u0002J\u0015\u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00028\u0000H&¢\u0006\u0002\u0010\u0006ø\u0001\u0000\u0082\u0002\u0006\n\u0004\b!0\u0001¨\u0006\u0007À\u0006\u0001"}, d2 = {"Landroidx/lifecycle/Observer;", "T", "", "onChanged", "", "value", "(Ljava/lang/Object;)V", "lifecycle-livedata-core_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public interface Observer<T> {
|
||||
void onChanged(T value);
|
||||
}
|
15
02-Easy5/E5/sources/androidx/lifecycle/OnLifecycleEvent.java
Normal file
15
02-Easy5/E5/sources/androidx/lifecycle/OnLifecycleEvent.java
Normal file
@ -0,0 +1,15 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ElementType.METHOD})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Deprecated
|
||||
/* loaded from: classes.dex */
|
||||
public @interface OnLifecycleEvent {
|
||||
Lifecycle.Event value();
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import kotlin.Metadata;
|
||||
import kotlin.coroutines.CoroutineContext;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import kotlinx.coroutines.CoroutineDispatcher;
|
||||
import kotlinx.coroutines.Dispatchers;
|
||||
|
||||
/* compiled from: PausingDispatcher.kt */
|
||||
@Metadata(d1 = {"\u0000.\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0000\b\u0000\u0018\u00002\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0002J\u001c\u0010\u0005\u001a\u00020\u00062\u0006\u0010\u0007\u001a\u00020\b2\n\u0010\t\u001a\u00060\nj\u0002`\u000bH\u0016J\u0010\u0010\f\u001a\u00020\r2\u0006\u0010\u0007\u001a\u00020\bH\u0016R\u0010\u0010\u0003\u001a\u00020\u00048\u0000X\u0081\u0004¢\u0006\u0002\n\u0000¨\u0006\u000e"}, d2 = {"Landroidx/lifecycle/PausingDispatcher;", "Lkotlinx/coroutines/CoroutineDispatcher;", "()V", "dispatchQueue", "Landroidx/lifecycle/DispatchQueue;", "dispatch", "", "context", "Lkotlin/coroutines/CoroutineContext;", "block", "Ljava/lang/Runnable;", "Lkotlinx/coroutines/Runnable;", "isDispatchNeeded", "", "lifecycle-common"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class PausingDispatcher extends CoroutineDispatcher {
|
||||
public final DispatchQueue dispatchQueue = new DispatchQueue();
|
||||
|
||||
@Override // kotlinx.coroutines.CoroutineDispatcher
|
||||
public boolean isDispatchNeeded(CoroutineContext context) {
|
||||
Intrinsics.checkNotNullParameter(context, "context");
|
||||
if (Dispatchers.getMain().getImmediate().isDispatchNeeded(context)) {
|
||||
return true;
|
||||
}
|
||||
return !this.dispatchQueue.canRun();
|
||||
}
|
||||
|
||||
@Override // kotlinx.coroutines.CoroutineDispatcher
|
||||
/* renamed from: dispatch */
|
||||
public void mo1907dispatch(CoroutineContext context, Runnable block) {
|
||||
Intrinsics.checkNotNullParameter(context, "context");
|
||||
Intrinsics.checkNotNullParameter(block, "block");
|
||||
this.dispatchQueue.dispatchAndEnqueue(context, block);
|
||||
}
|
||||
}
|
@ -0,0 +1,92 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.ResultKt;
|
||||
import kotlin.Unit;
|
||||
import kotlin.coroutines.Continuation;
|
||||
import kotlin.coroutines.intrinsics.IntrinsicsKt;
|
||||
import kotlin.coroutines.jvm.internal.DebugMetadata;
|
||||
import kotlin.coroutines.jvm.internal.SuspendLambda;
|
||||
import kotlin.jvm.functions.Function2;
|
||||
import kotlinx.coroutines.BuildersKt;
|
||||
import kotlinx.coroutines.CoroutineScope;
|
||||
import kotlinx.coroutines.Job;
|
||||
|
||||
/* JADX INFO: Add missing generic type declarations: [T] */
|
||||
/* compiled from: PausingDispatcher.kt */
|
||||
@Metadata(d1 = {"\u0000\b\n\u0000\n\u0002\u0018\u0002\n\u0000\u0010\u0002\u001a\u00028\u0000\"\u0004\b\u0000\u0010\u0000*\u00020\u0001H\u008a@"}, d2 = {"T", "Lkotlinx/coroutines/CoroutineScope;", "<anonymous>"}, k = 3, mv = {1, 8, 0})
|
||||
@DebugMetadata(c = "androidx.lifecycle.PausingDispatcherKt$whenStateAtLeast$2", f = "PausingDispatcher.kt", i = {0}, l = {203}, m = "invokeSuspend", n = {"controller"}, s = {"L$0"})
|
||||
/* loaded from: classes.dex */
|
||||
final class PausingDispatcherKt$whenStateAtLeast$2<T> extends SuspendLambda implements Function2<CoroutineScope, Continuation<? super T>, Object> {
|
||||
final /* synthetic */ Function2<CoroutineScope, Continuation<? super T>, Object> $block;
|
||||
final /* synthetic */ Lifecycle.State $minState;
|
||||
final /* synthetic */ Lifecycle $this_whenStateAtLeast;
|
||||
private /* synthetic */ Object L$0;
|
||||
int label;
|
||||
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
PausingDispatcherKt$whenStateAtLeast$2(Lifecycle lifecycle, Lifecycle.State state, Function2<? super CoroutineScope, ? super Continuation<? super T>, ? extends Object> function2, Continuation<? super PausingDispatcherKt$whenStateAtLeast$2> continuation) {
|
||||
super(2, continuation);
|
||||
this.$this_whenStateAtLeast = lifecycle;
|
||||
this.$minState = state;
|
||||
this.$block = function2;
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
||||
public final Continuation<Unit> create(Object obj, Continuation<?> continuation) {
|
||||
PausingDispatcherKt$whenStateAtLeast$2 pausingDispatcherKt$whenStateAtLeast$2 = new PausingDispatcherKt$whenStateAtLeast$2(this.$this_whenStateAtLeast, this.$minState, this.$block, continuation);
|
||||
pausingDispatcherKt$whenStateAtLeast$2.L$0 = obj;
|
||||
return pausingDispatcherKt$whenStateAtLeast$2;
|
||||
}
|
||||
|
||||
@Override // kotlin.jvm.functions.Function2
|
||||
public final Object invoke(CoroutineScope coroutineScope, Continuation<? super T> continuation) {
|
||||
return ((PausingDispatcherKt$whenStateAtLeast$2) create(coroutineScope, continuation)).invokeSuspend(Unit.INSTANCE);
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
||||
public final Object invokeSuspend(Object obj) {
|
||||
LifecycleController lifecycleController;
|
||||
Object coroutine_suspended = IntrinsicsKt.getCOROUTINE_SUSPENDED();
|
||||
int i = this.label;
|
||||
if (i == 0) {
|
||||
ResultKt.throwOnFailure(obj);
|
||||
Job job = (Job) ((CoroutineScope) this.L$0).getCoroutineContext().get(Job.INSTANCE);
|
||||
if (job == null) {
|
||||
throw new IllegalStateException("when[State] methods should have a parent job".toString());
|
||||
}
|
||||
PausingDispatcher pausingDispatcher = new PausingDispatcher();
|
||||
LifecycleController lifecycleController2 = new LifecycleController(this.$this_whenStateAtLeast, this.$minState, pausingDispatcher.dispatchQueue, job);
|
||||
try {
|
||||
this.L$0 = lifecycleController2;
|
||||
this.label = 1;
|
||||
obj = BuildersKt.withContext(pausingDispatcher, this.$block, this);
|
||||
if (obj == coroutine_suspended) {
|
||||
return coroutine_suspended;
|
||||
}
|
||||
lifecycleController = lifecycleController2;
|
||||
} catch (Throwable th) {
|
||||
th = th;
|
||||
lifecycleController = lifecycleController2;
|
||||
lifecycleController.finish();
|
||||
throw th;
|
||||
}
|
||||
} else {
|
||||
if (i != 1) {
|
||||
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
|
||||
}
|
||||
lifecycleController = (LifecycleController) this.L$0;
|
||||
try {
|
||||
ResultKt.throwOnFailure(obj);
|
||||
} catch (Throwable th2) {
|
||||
th = th2;
|
||||
lifecycleController.finish();
|
||||
throw th;
|
||||
}
|
||||
}
|
||||
lifecycleController.finish();
|
||||
return obj;
|
||||
}
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
import kotlin.Deprecated;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.coroutines.Continuation;
|
||||
import kotlin.jvm.functions.Function2;
|
||||
import kotlinx.coroutines.BuildersKt;
|
||||
import kotlinx.coroutines.CoroutineScope;
|
||||
import kotlinx.coroutines.Dispatchers;
|
||||
|
||||
/* compiled from: PausingDispatcher.kt */
|
||||
@Metadata(d1 = {"\u00000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0002\u001aA\u0010\u0000\u001a\u0002H\u0001\"\u0004\b\u0000\u0010\u0001*\u00020\u00022'\u0010\u0003\u001a#\b\u0001\u0012\u0004\u0012\u00020\u0005\u0012\n\u0012\b\u0012\u0004\u0012\u0002H\u00010\u0006\u0012\u0006\u0012\u0004\u0018\u00010\u00070\u0004¢\u0006\u0002\b\bH\u0087@¢\u0006\u0002\u0010\t\u001aA\u0010\u0000\u001a\u0002H\u0001\"\u0004\b\u0000\u0010\u0001*\u00020\n2'\u0010\u0003\u001a#\b\u0001\u0012\u0004\u0012\u00020\u0005\u0012\n\u0012\b\u0012\u0004\u0012\u0002H\u00010\u0006\u0012\u0006\u0012\u0004\u0018\u00010\u00070\u0004¢\u0006\u0002\b\bH\u0087@¢\u0006\u0002\u0010\u000b\u001aA\u0010\f\u001a\u0002H\u0001\"\u0004\b\u0000\u0010\u0001*\u00020\u00022'\u0010\u0003\u001a#\b\u0001\u0012\u0004\u0012\u00020\u0005\u0012\n\u0012\b\u0012\u0004\u0012\u0002H\u00010\u0006\u0012\u0006\u0012\u0004\u0018\u00010\u00070\u0004¢\u0006\u0002\b\bH\u0087@¢\u0006\u0002\u0010\t\u001aA\u0010\f\u001a\u0002H\u0001\"\u0004\b\u0000\u0010\u0001*\u00020\n2'\u0010\u0003\u001a#\b\u0001\u0012\u0004\u0012\u00020\u0005\u0012\n\u0012\b\u0012\u0004\u0012\u0002H\u00010\u0006\u0012\u0006\u0012\u0004\u0018\u00010\u00070\u0004¢\u0006\u0002\b\bH\u0087@¢\u0006\u0002\u0010\u000b\u001aA\u0010\r\u001a\u0002H\u0001\"\u0004\b\u0000\u0010\u0001*\u00020\u00022'\u0010\u0003\u001a#\b\u0001\u0012\u0004\u0012\u00020\u0005\u0012\n\u0012\b\u0012\u0004\u0012\u0002H\u00010\u0006\u0012\u0006\u0012\u0004\u0018\u00010\u00070\u0004¢\u0006\u0002\b\bH\u0087@¢\u0006\u0002\u0010\t\u001aA\u0010\r\u001a\u0002H\u0001\"\u0004\b\u0000\u0010\u0001*\u00020\n2'\u0010\u0003\u001a#\b\u0001\u0012\u0004\u0012\u00020\u0005\u0012\n\u0012\b\u0012\u0004\u0012\u0002H\u00010\u0006\u0012\u0006\u0012\u0004\u0018\u00010\u00070\u0004¢\u0006\u0002\b\bH\u0087@¢\u0006\u0002\u0010\u000b\u001aI\u0010\u000e\u001a\u0002H\u0001\"\u0004\b\u0000\u0010\u0001*\u00020\u00022\u0006\u0010\u000f\u001a\u00020\u00102'\u0010\u0003\u001a#\b\u0001\u0012\u0004\u0012\u00020\u0005\u0012\n\u0012\b\u0012\u0004\u0012\u0002H\u00010\u0006\u0012\u0006\u0012\u0004\u0018\u00010\u00070\u0004¢\u0006\u0002\b\bH\u0087@¢\u0006\u0002\u0010\u0011¨\u0006\u0012"}, d2 = {"whenCreated", "T", "Landroidx/lifecycle/Lifecycle;", "block", "Lkotlin/Function2;", "Lkotlinx/coroutines/CoroutineScope;", "Lkotlin/coroutines/Continuation;", "", "Lkotlin/ExtensionFunctionType;", "(Landroidx/lifecycle/Lifecycle;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "Landroidx/lifecycle/LifecycleOwner;", "(Landroidx/lifecycle/LifecycleOwner;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "whenResumed", "whenStarted", "whenStateAtLeast", "minState", "Landroidx/lifecycle/Lifecycle$State;", "(Landroidx/lifecycle/Lifecycle;Landroidx/lifecycle/Lifecycle$State;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "lifecycle-common"}, k = 2, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class PausingDispatcherKt {
|
||||
@Deprecated(message = "whenCreated has been deprecated because it runs the block on a pausing dispatcher that suspends, rather than cancels work when the lifecycle state goes below the given state. Use withCreated for non-suspending work that needs to run only once when the Lifecycle changes.")
|
||||
public static final <T> Object whenCreated(LifecycleOwner lifecycleOwner, Function2<? super CoroutineScope, ? super Continuation<? super T>, ? extends Object> function2, Continuation<? super T> continuation) {
|
||||
return whenCreated(lifecycleOwner.getLifecycle(), function2, continuation);
|
||||
}
|
||||
|
||||
@Deprecated(message = "whenCreated has been deprecated because it runs the block on a pausing dispatcher that suspends, rather than cancels work when the lifecycle state goes below the given state. Use withCreated for non-suspending work that needs to run only once when the Lifecycle changes.")
|
||||
public static final <T> Object whenCreated(Lifecycle lifecycle, Function2<? super CoroutineScope, ? super Continuation<? super T>, ? extends Object> function2, Continuation<? super T> continuation) {
|
||||
return whenStateAtLeast(lifecycle, Lifecycle.State.CREATED, function2, continuation);
|
||||
}
|
||||
|
||||
@Deprecated(message = "whenStarted has been deprecated because it runs the block on a pausing dispatcher that suspends, rather than cancels work when the lifecycle state goes below the given state. Use withStarted for non-suspending work that needs to run only once when the Lifecycle changes.")
|
||||
public static final <T> Object whenStarted(LifecycleOwner lifecycleOwner, Function2<? super CoroutineScope, ? super Continuation<? super T>, ? extends Object> function2, Continuation<? super T> continuation) {
|
||||
return whenStarted(lifecycleOwner.getLifecycle(), function2, continuation);
|
||||
}
|
||||
|
||||
@Deprecated(message = "whenStarted has been deprecated because it runs the block on a pausing dispatcher that suspends, rather than cancels work when the lifecycle state goes below the given state. Use withStarted for non-suspending work that needs to run only once when the Lifecycle changes.")
|
||||
public static final <T> Object whenStarted(Lifecycle lifecycle, Function2<? super CoroutineScope, ? super Continuation<? super T>, ? extends Object> function2, Continuation<? super T> continuation) {
|
||||
return whenStateAtLeast(lifecycle, Lifecycle.State.STARTED, function2, continuation);
|
||||
}
|
||||
|
||||
@Deprecated(message = "whenResumed has been deprecated because it runs the block on a pausing dispatcher that suspends, rather than cancels work when the lifecycle state goes below the given state. Use withResumed for non-suspending work that needs to run only once when the Lifecycle changes.")
|
||||
public static final <T> Object whenResumed(LifecycleOwner lifecycleOwner, Function2<? super CoroutineScope, ? super Continuation<? super T>, ? extends Object> function2, Continuation<? super T> continuation) {
|
||||
return whenResumed(lifecycleOwner.getLifecycle(), function2, continuation);
|
||||
}
|
||||
|
||||
@Deprecated(message = "whenResumed has been deprecated because it runs the block on a pausing dispatcher that suspends, rather than cancels work when the lifecycle state goes below the given state. Use withResumed for non-suspending work that needs to run only once when the Lifecycle changes.")
|
||||
public static final <T> Object whenResumed(Lifecycle lifecycle, Function2<? super CoroutineScope, ? super Continuation<? super T>, ? extends Object> function2, Continuation<? super T> continuation) {
|
||||
return whenStateAtLeast(lifecycle, Lifecycle.State.RESUMED, function2, continuation);
|
||||
}
|
||||
|
||||
@Deprecated(message = "whenStateAtLeast has been deprecated because it runs the block on a pausing dispatcher that suspends, rather than cancels work when the lifecycle state goes below the given state. Use withStateAtLeast for non-suspending work that needs to run only once when the Lifecycle changes.")
|
||||
public static final <T> Object whenStateAtLeast(Lifecycle lifecycle, Lifecycle.State state, Function2<? super CoroutineScope, ? super Continuation<? super T>, ? extends Object> function2, Continuation<? super T> continuation) {
|
||||
return BuildersKt.withContext(Dispatchers.getMain().getImmediate(), new PausingDispatcherKt$whenStateAtLeast$2(lifecycle, state, function2, null), continuation);
|
||||
}
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import android.content.Context;
|
||||
import androidx.startup.AppInitializer;
|
||||
import androidx.startup.Initializer;
|
||||
import java.util.List;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.collections.CollectionsKt;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: ProcessLifecycleInitializer.kt */
|
||||
@Metadata(d1 = {"\u0000 \n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0000\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0003J\u0010\u0010\u0004\u001a\u00020\u00022\u0006\u0010\u0005\u001a\u00020\u0006H\u0016J\u001a\u0010\u0007\u001a\u0014\u0012\u0010\u0012\u000e\u0012\n\b\u0001\u0012\u0006\u0012\u0002\b\u00030\u00010\t0\bH\u0016¨\u0006\n"}, d2 = {"Landroidx/lifecycle/ProcessLifecycleInitializer;", "Landroidx/startup/Initializer;", "Landroidx/lifecycle/LifecycleOwner;", "()V", "create", "context", "Landroid/content/Context;", "dependencies", "", "Ljava/lang/Class;", "lifecycle-process_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class ProcessLifecycleInitializer implements Initializer<LifecycleOwner> {
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // androidx.startup.Initializer
|
||||
public LifecycleOwner create(Context context) {
|
||||
Intrinsics.checkNotNullParameter(context, "context");
|
||||
AppInitializer appInitializer = AppInitializer.getInstance(context);
|
||||
Intrinsics.checkNotNullExpressionValue(appInitializer, "getInstance(context)");
|
||||
if (!appInitializer.isEagerlyInitialized(getClass())) {
|
||||
throw new IllegalStateException("ProcessLifecycleInitializer cannot be initialized lazily.\n Please ensure that you have:\n <meta-data\n android:name='androidx.lifecycle.ProcessLifecycleInitializer'\n android:value='androidx.startup' />\n under InitializationProvider in your AndroidManifest.xml".toString());
|
||||
}
|
||||
LifecycleDispatcher.init(context);
|
||||
ProcessLifecycleOwner.INSTANCE.init$lifecycle_process_release(context);
|
||||
return ProcessLifecycleOwner.INSTANCE.get();
|
||||
}
|
||||
|
||||
@Override // androidx.startup.Initializer
|
||||
public List<Class<? extends Initializer<?>>> dependencies() {
|
||||
return CollectionsKt.emptyList();
|
||||
}
|
||||
}
|
@ -0,0 +1,218 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
import androidx.lifecycle.ProcessLifecycleOwner;
|
||||
import androidx.lifecycle.ReportFragment;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.JvmStatic;
|
||||
import kotlin.jvm.internal.DefaultConstructorMarker;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: ProcessLifecycleOwner.kt */
|
||||
@Metadata(d1 = {"\u0000J\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0002\b\u0003\n\u0002\u0010\u0002\n\u0002\b\t\n\u0002\u0018\u0002\n\u0002\b\b\u0018\u0000 '2\u00020\u0001:\u0002&'B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\r\u0010\u0015\u001a\u00020\u0016H\u0000¢\u0006\u0002\b\u0017J\r\u0010\u0018\u001a\u00020\u0016H\u0000¢\u0006\u0002\b\u0019J\r\u0010\u001a\u001a\u00020\u0016H\u0000¢\u0006\u0002\b\u001bJ\r\u0010\u001c\u001a\u00020\u0016H\u0000¢\u0006\u0002\b\u001dJ\u0015\u0010\u001e\u001a\u00020\u00162\u0006\u0010\u001f\u001a\u00020 H\u0000¢\u0006\u0002\b!J\r\u0010\"\u001a\u00020\u0016H\u0000¢\u0006\u0002\b#J\r\u0010$\u001a\u00020\u0016H\u0000¢\u0006\u0002\b%R\u000e\u0010\u0003\u001a\u00020\u0004X\u0082\u0004¢\u0006\u0002\n\u0000R\u0010\u0010\u0005\u001a\u0004\u0018\u00010\u0006X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0007\u001a\u00020\bX\u0082\u0004¢\u0006\u0002\n\u0000R\u0014\u0010\t\u001a\u00020\n8VX\u0096\u0004¢\u0006\u0006\u001a\u0004\b\u000b\u0010\fR\u000e\u0010\r\u001a\u00020\u000eX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u000f\u001a\u00020\u0010X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0011\u001a\u00020\u0012X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0013\u001a\u00020\u0012X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0014\u001a\u00020\u000eX\u0082\u000e¢\u0006\u0002\n\u0000¨\u0006("}, d2 = {"Landroidx/lifecycle/ProcessLifecycleOwner;", "Landroidx/lifecycle/LifecycleOwner;", "()V", "delayedPauseRunnable", "Ljava/lang/Runnable;", "handler", "Landroid/os/Handler;", "initializationListener", "Landroidx/lifecycle/ReportFragment$ActivityInitializationListener;", "lifecycle", "Landroidx/lifecycle/Lifecycle;", "getLifecycle", "()Landroidx/lifecycle/Lifecycle;", "pauseSent", "", "registry", "Landroidx/lifecycle/LifecycleRegistry;", "resumedCounter", "", "startedCounter", "stopSent", "activityPaused", "", "activityPaused$lifecycle_process_release", "activityResumed", "activityResumed$lifecycle_process_release", "activityStarted", "activityStarted$lifecycle_process_release", "activityStopped", "activityStopped$lifecycle_process_release", "attach", "context", "Landroid/content/Context;", "attach$lifecycle_process_release", "dispatchPauseIfNeeded", "dispatchPauseIfNeeded$lifecycle_process_release", "dispatchStopIfNeeded", "dispatchStopIfNeeded$lifecycle_process_release", "Api29Impl", "Companion", "lifecycle-process_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class ProcessLifecycleOwner implements LifecycleOwner {
|
||||
public static final long TIMEOUT_MS = 700;
|
||||
private Handler handler;
|
||||
private int resumedCounter;
|
||||
private int startedCounter;
|
||||
|
||||
/* renamed from: Companion, reason: from kotlin metadata */
|
||||
public static final Companion INSTANCE = new Companion(null);
|
||||
private static final ProcessLifecycleOwner newInstance = new ProcessLifecycleOwner();
|
||||
private boolean pauseSent = true;
|
||||
private boolean stopSent = true;
|
||||
private final LifecycleRegistry registry = new LifecycleRegistry(this);
|
||||
private final Runnable delayedPauseRunnable = new Runnable() { // from class: androidx.lifecycle.ProcessLifecycleOwner$$ExternalSyntheticLambda0
|
||||
@Override // java.lang.Runnable
|
||||
public final void run() {
|
||||
ProcessLifecycleOwner.delayedPauseRunnable$lambda$0(ProcessLifecycleOwner.this);
|
||||
}
|
||||
};
|
||||
private final ReportFragment.ActivityInitializationListener initializationListener = new ReportFragment.ActivityInitializationListener() { // from class: androidx.lifecycle.ProcessLifecycleOwner$initializationListener$1
|
||||
@Override // androidx.lifecycle.ReportFragment.ActivityInitializationListener
|
||||
public void onCreate() {
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.ReportFragment.ActivityInitializationListener
|
||||
public void onStart() {
|
||||
ProcessLifecycleOwner.this.activityStarted$lifecycle_process_release();
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.ReportFragment.ActivityInitializationListener
|
||||
public void onResume() {
|
||||
ProcessLifecycleOwner.this.activityResumed$lifecycle_process_release();
|
||||
}
|
||||
};
|
||||
|
||||
@JvmStatic
|
||||
public static final LifecycleOwner get() {
|
||||
return INSTANCE.get();
|
||||
}
|
||||
|
||||
private ProcessLifecycleOwner() {
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public static final void delayedPauseRunnable$lambda$0(ProcessLifecycleOwner this$0) {
|
||||
Intrinsics.checkNotNullParameter(this$0, "this$0");
|
||||
this$0.dispatchPauseIfNeeded$lifecycle_process_release();
|
||||
this$0.dispatchStopIfNeeded$lifecycle_process_release();
|
||||
}
|
||||
|
||||
/* compiled from: ProcessLifecycleOwner.kt */
|
||||
@Metadata(d1 = {"\u0000.\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\t\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\b\u0086\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\b\u0010\b\u001a\u00020\tH\u0007J\u0015\u0010\n\u001a\u00020\u000b2\u0006\u0010\f\u001a\u00020\rH\u0001¢\u0006\u0002\b\u000eR\u0016\u0010\u0003\u001a\u00020\u00048\u0000X\u0081T¢\u0006\b\n\u0000\u0012\u0004\b\u0005\u0010\u0002R\u000e\u0010\u0006\u001a\u00020\u0007X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u000f"}, d2 = {"Landroidx/lifecycle/ProcessLifecycleOwner$Companion;", "", "()V", "TIMEOUT_MS", "", "getTIMEOUT_MS$lifecycle_process_release$annotations", "newInstance", "Landroidx/lifecycle/ProcessLifecycleOwner;", "get", "Landroidx/lifecycle/LifecycleOwner;", "init", "", "context", "Landroid/content/Context;", "init$lifecycle_process_release", "lifecycle-process_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
public static final class Companion {
|
||||
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
||||
this();
|
||||
}
|
||||
|
||||
public static /* synthetic */ void getTIMEOUT_MS$lifecycle_process_release$annotations() {
|
||||
}
|
||||
|
||||
private Companion() {
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public final LifecycleOwner get() {
|
||||
return ProcessLifecycleOwner.newInstance;
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public final void init$lifecycle_process_release(Context context) {
|
||||
Intrinsics.checkNotNullParameter(context, "context");
|
||||
ProcessLifecycleOwner.newInstance.attach$lifecycle_process_release(context);
|
||||
}
|
||||
}
|
||||
|
||||
public final void activityStarted$lifecycle_process_release() {
|
||||
int i = this.startedCounter + 1;
|
||||
this.startedCounter = i;
|
||||
if (i == 1 && this.stopSent) {
|
||||
this.registry.handleLifecycleEvent(Lifecycle.Event.ON_START);
|
||||
this.stopSent = false;
|
||||
}
|
||||
}
|
||||
|
||||
public final void activityResumed$lifecycle_process_release() {
|
||||
int i = this.resumedCounter + 1;
|
||||
this.resumedCounter = i;
|
||||
if (i == 1) {
|
||||
if (this.pauseSent) {
|
||||
this.registry.handleLifecycleEvent(Lifecycle.Event.ON_RESUME);
|
||||
this.pauseSent = false;
|
||||
} else {
|
||||
Handler handler = this.handler;
|
||||
Intrinsics.checkNotNull(handler);
|
||||
handler.removeCallbacks(this.delayedPauseRunnable);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public final void activityPaused$lifecycle_process_release() {
|
||||
int i = this.resumedCounter - 1;
|
||||
this.resumedCounter = i;
|
||||
if (i == 0) {
|
||||
Handler handler = this.handler;
|
||||
Intrinsics.checkNotNull(handler);
|
||||
handler.postDelayed(this.delayedPauseRunnable, 700L);
|
||||
}
|
||||
}
|
||||
|
||||
public final void activityStopped$lifecycle_process_release() {
|
||||
this.startedCounter--;
|
||||
dispatchStopIfNeeded$lifecycle_process_release();
|
||||
}
|
||||
|
||||
public final void dispatchPauseIfNeeded$lifecycle_process_release() {
|
||||
if (this.resumedCounter == 0) {
|
||||
this.pauseSent = true;
|
||||
this.registry.handleLifecycleEvent(Lifecycle.Event.ON_PAUSE);
|
||||
}
|
||||
}
|
||||
|
||||
public final void dispatchStopIfNeeded$lifecycle_process_release() {
|
||||
if (this.startedCounter == 0 && this.pauseSent) {
|
||||
this.registry.handleLifecycleEvent(Lifecycle.Event.ON_STOP);
|
||||
this.stopSent = true;
|
||||
}
|
||||
}
|
||||
|
||||
public final void attach$lifecycle_process_release(Context context) {
|
||||
Intrinsics.checkNotNullParameter(context, "context");
|
||||
this.handler = new Handler();
|
||||
this.registry.handleLifecycleEvent(Lifecycle.Event.ON_CREATE);
|
||||
Context applicationContext = context.getApplicationContext();
|
||||
Intrinsics.checkNotNull(applicationContext, "null cannot be cast to non-null type android.app.Application");
|
||||
((Application) applicationContext).registerActivityLifecycleCallbacks(new EmptyActivityLifecycleCallbacks() { // from class: androidx.lifecycle.ProcessLifecycleOwner$attach$1
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivityPreCreated(Activity activity, Bundle savedInstanceState) {
|
||||
Intrinsics.checkNotNullParameter(activity, "activity");
|
||||
final ProcessLifecycleOwner processLifecycleOwner = ProcessLifecycleOwner.this;
|
||||
ProcessLifecycleOwner.Api29Impl.registerActivityLifecycleCallbacks(activity, new EmptyActivityLifecycleCallbacks() { // from class: androidx.lifecycle.ProcessLifecycleOwner$attach$1$onActivityPreCreated$1
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivityPostStarted(Activity activity2) {
|
||||
Intrinsics.checkNotNullParameter(activity2, "activity");
|
||||
ProcessLifecycleOwner.this.activityStarted$lifecycle_process_release();
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivityPostResumed(Activity activity2) {
|
||||
Intrinsics.checkNotNullParameter(activity2, "activity");
|
||||
ProcessLifecycleOwner.this.activityResumed$lifecycle_process_release();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.EmptyActivityLifecycleCallbacks, android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
|
||||
ReportFragment.ActivityInitializationListener activityInitializationListener;
|
||||
Intrinsics.checkNotNullParameter(activity, "activity");
|
||||
if (Build.VERSION.SDK_INT < 29) {
|
||||
ReportFragment reportFragment = ReportFragment.INSTANCE.get(activity);
|
||||
activityInitializationListener = ProcessLifecycleOwner.this.initializationListener;
|
||||
reportFragment.setProcessListener(activityInitializationListener);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.EmptyActivityLifecycleCallbacks, android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivityPaused(Activity activity) {
|
||||
Intrinsics.checkNotNullParameter(activity, "activity");
|
||||
ProcessLifecycleOwner.this.activityPaused$lifecycle_process_release();
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.EmptyActivityLifecycleCallbacks, android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivityStopped(Activity activity) {
|
||||
Intrinsics.checkNotNullParameter(activity, "activity");
|
||||
ProcessLifecycleOwner.this.activityStopped$lifecycle_process_release();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.LifecycleOwner
|
||||
public Lifecycle getLifecycle() {
|
||||
return this.registry;
|
||||
}
|
||||
|
||||
/* compiled from: ProcessLifecycleOwner.kt */
|
||||
@Metadata(d1 = {"\u0000\u001e\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\bÁ\u0002\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\u0018\u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u00062\u0006\u0010\u0007\u001a\u00020\bH\u0007¨\u0006\t"}, d2 = {"Landroidx/lifecycle/ProcessLifecycleOwner$Api29Impl;", "", "()V", "registerActivityLifecycleCallbacks", "", "activity", "Landroid/app/Activity;", "callback", "Landroid/app/Application$ActivityLifecycleCallbacks;", "lifecycle-process_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
public static final class Api29Impl {
|
||||
public static final Api29Impl INSTANCE = new Api29Impl();
|
||||
|
||||
private Api29Impl() {
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public static final void registerActivityLifecycleCallbacks(Activity activity, Application.ActivityLifecycleCallbacks callback) {
|
||||
Intrinsics.checkNotNullParameter(activity, "activity");
|
||||
Intrinsics.checkNotNullParameter(callback, "callback");
|
||||
activity.registerActivityLifecycleCallbacks(callback);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import androidx.lifecycle.ClassesInfoCache;
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
|
||||
@Deprecated
|
||||
/* loaded from: classes.dex */
|
||||
class ReflectiveGenericLifecycleObserver implements LifecycleEventObserver {
|
||||
private final ClassesInfoCache.CallbackInfo mInfo;
|
||||
private final Object mWrapped;
|
||||
|
||||
ReflectiveGenericLifecycleObserver(Object obj) {
|
||||
this.mWrapped = obj;
|
||||
this.mInfo = ClassesInfoCache.sInstance.getInfo(obj.getClass());
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.LifecycleEventObserver
|
||||
public void onStateChanged(LifecycleOwner lifecycleOwner, Lifecycle.Event event) {
|
||||
this.mInfo.invokeCallbacks(lifecycleOwner, event, this.mWrapped);
|
||||
}
|
||||
}
|
267
02-Easy5/E5/sources/androidx/lifecycle/ReportFragment.java
Normal file
267
02-Easy5/E5/sources/androidx/lifecycle/ReportFragment.java
Normal file
@ -0,0 +1,267 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Application;
|
||||
import android.app.Fragment;
|
||||
import android.app.FragmentManager;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import androidx.core.app.NotificationCompat;
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.JvmStatic;
|
||||
import kotlin.jvm.internal.DefaultConstructorMarker;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: ReportFragment.kt */
|
||||
@Metadata(d1 = {"\u0000(\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\n\b\u0017\u0018\u0000 \u00172\u00020\u0001:\u0003\u0016\u0017\u0018B\u0005¢\u0006\u0002\u0010\u0002J\u0010\u0010\u0005\u001a\u00020\u00062\u0006\u0010\u0007\u001a\u00020\bH\u0002J\u0012\u0010\t\u001a\u00020\u00062\b\u0010\n\u001a\u0004\u0018\u00010\u0004H\u0002J\u0012\u0010\u000b\u001a\u00020\u00062\b\u0010\n\u001a\u0004\u0018\u00010\u0004H\u0002J\u0012\u0010\f\u001a\u00020\u00062\b\u0010\n\u001a\u0004\u0018\u00010\u0004H\u0002J\u0012\u0010\r\u001a\u00020\u00062\b\u0010\u000e\u001a\u0004\u0018\u00010\u000fH\u0016J\b\u0010\u0010\u001a\u00020\u0006H\u0016J\b\u0010\u0011\u001a\u00020\u0006H\u0016J\b\u0010\u0012\u001a\u00020\u0006H\u0016J\b\u0010\u0013\u001a\u00020\u0006H\u0016J\b\u0010\u0014\u001a\u00020\u0006H\u0016J\u0010\u0010\u0015\u001a\u00020\u00062\b\u0010\u0003\u001a\u0004\u0018\u00010\u0004R\u0010\u0010\u0003\u001a\u0004\u0018\u00010\u0004X\u0082\u000e¢\u0006\u0002\n\u0000¨\u0006\u0019"}, d2 = {"Landroidx/lifecycle/ReportFragment;", "Landroid/app/Fragment;", "()V", "processListener", "Landroidx/lifecycle/ReportFragment$ActivityInitializationListener;", "dispatch", "", NotificationCompat.CATEGORY_EVENT, "Landroidx/lifecycle/Lifecycle$Event;", "dispatchCreate", "listener", "dispatchResume", "dispatchStart", "onActivityCreated", "savedInstanceState", "Landroid/os/Bundle;", "onDestroy", "onPause", "onResume", "onStart", "onStop", "setProcessListener", "ActivityInitializationListener", "Companion", "LifecycleCallbacks", "lifecycle-runtime_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public class ReportFragment extends Fragment {
|
||||
|
||||
/* renamed from: Companion, reason: from kotlin metadata */
|
||||
public static final Companion INSTANCE = new Companion(null);
|
||||
private static final String REPORT_FRAGMENT_TAG = "androidx.lifecycle.LifecycleDispatcher.report_fragment_tag";
|
||||
private ActivityInitializationListener processListener;
|
||||
|
||||
/* compiled from: ReportFragment.kt */
|
||||
@Metadata(d1 = {"\u0000\u0012\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0003\bf\u0018\u00002\u00020\u0001J\b\u0010\u0002\u001a\u00020\u0003H&J\b\u0010\u0004\u001a\u00020\u0003H&J\b\u0010\u0005\u001a\u00020\u0003H&ø\u0001\u0000\u0082\u0002\u0006\n\u0004\b!0\u0001¨\u0006\u0006À\u0006\u0001"}, d2 = {"Landroidx/lifecycle/ReportFragment$ActivityInitializationListener;", "", "onCreate", "", "onResume", "onStart", "lifecycle-runtime_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
public interface ActivityInitializationListener {
|
||||
void onCreate();
|
||||
|
||||
void onResume();
|
||||
|
||||
void onStart();
|
||||
}
|
||||
|
||||
public static final ReportFragment get(Activity activity) {
|
||||
return INSTANCE.get(activity);
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public static final void injectIfNeededIn(Activity activity) {
|
||||
INSTANCE.injectIfNeededIn(activity);
|
||||
}
|
||||
|
||||
public final void setProcessListener(ActivityInitializationListener processListener) {
|
||||
this.processListener = processListener;
|
||||
}
|
||||
|
||||
private final void dispatchCreate(ActivityInitializationListener listener) {
|
||||
if (listener != null) {
|
||||
listener.onCreate();
|
||||
}
|
||||
}
|
||||
|
||||
private final void dispatchStart(ActivityInitializationListener listener) {
|
||||
if (listener != null) {
|
||||
listener.onStart();
|
||||
}
|
||||
}
|
||||
|
||||
private final void dispatchResume(ActivityInitializationListener listener) {
|
||||
if (listener != null) {
|
||||
listener.onResume();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.app.Fragment
|
||||
public void onActivityCreated(Bundle savedInstanceState) {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
dispatchCreate(this.processListener);
|
||||
dispatch(Lifecycle.Event.ON_CREATE);
|
||||
}
|
||||
|
||||
@Override // android.app.Fragment
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
dispatchStart(this.processListener);
|
||||
dispatch(Lifecycle.Event.ON_START);
|
||||
}
|
||||
|
||||
@Override // android.app.Fragment
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
dispatchResume(this.processListener);
|
||||
dispatch(Lifecycle.Event.ON_RESUME);
|
||||
}
|
||||
|
||||
@Override // android.app.Fragment
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
dispatch(Lifecycle.Event.ON_PAUSE);
|
||||
}
|
||||
|
||||
@Override // android.app.Fragment
|
||||
public void onStop() {
|
||||
super.onStop();
|
||||
dispatch(Lifecycle.Event.ON_STOP);
|
||||
}
|
||||
|
||||
@Override // android.app.Fragment
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
dispatch(Lifecycle.Event.ON_DESTROY);
|
||||
this.processListener = null;
|
||||
}
|
||||
|
||||
private final void dispatch(Lifecycle.Event event) {
|
||||
if (Build.VERSION.SDK_INT < 29) {
|
||||
Companion companion = INSTANCE;
|
||||
Activity activity = getActivity();
|
||||
Intrinsics.checkNotNullExpressionValue(activity, "activity");
|
||||
companion.dispatch$lifecycle_runtime_release(activity, event);
|
||||
}
|
||||
}
|
||||
|
||||
/* compiled from: ReportFragment.kt */
|
||||
@Metadata(d1 = {"\u0000 \n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u000f\b\u0001\u0018\u0000 \u00162\u00020\u0001:\u0001\u0016B\u0005¢\u0006\u0002\u0010\u0002J\u001a\u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u00062\b\u0010\u0007\u001a\u0004\u0018\u00010\bH\u0016J\u0010\u0010\t\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0006H\u0016J\u0010\u0010\n\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0006H\u0016J\u001a\u0010\u000b\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u00062\b\u0010\f\u001a\u0004\u0018\u00010\bH\u0016J\u0010\u0010\r\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0006H\u0016J\u0010\u0010\u000e\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0006H\u0016J\u0010\u0010\u000f\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0006H\u0016J\u0010\u0010\u0010\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0006H\u0016J\u0010\u0010\u0011\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0006H\u0016J\u0010\u0010\u0012\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0006H\u0016J\u0018\u0010\u0013\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u00062\u0006\u0010\u0007\u001a\u00020\bH\u0016J\u0010\u0010\u0014\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0006H\u0016J\u0010\u0010\u0015\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0006H\u0016¨\u0006\u0017"}, d2 = {"Landroidx/lifecycle/ReportFragment$LifecycleCallbacks;", "Landroid/app/Application$ActivityLifecycleCallbacks;", "()V", "onActivityCreated", "", "activity", "Landroid/app/Activity;", "bundle", "Landroid/os/Bundle;", "onActivityDestroyed", "onActivityPaused", "onActivityPostCreated", "savedInstanceState", "onActivityPostResumed", "onActivityPostStarted", "onActivityPreDestroyed", "onActivityPrePaused", "onActivityPreStopped", "onActivityResumed", "onActivitySaveInstanceState", "onActivityStarted", "onActivityStopped", "Companion", "lifecycle-runtime_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
public static final class LifecycleCallbacks implements Application.ActivityLifecycleCallbacks {
|
||||
|
||||
/* renamed from: Companion, reason: from kotlin metadata */
|
||||
public static final Companion INSTANCE = new Companion(null);
|
||||
|
||||
@JvmStatic
|
||||
public static final void registerIn(Activity activity) {
|
||||
INSTANCE.registerIn(activity);
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivityCreated(Activity activity, Bundle bundle) {
|
||||
Intrinsics.checkNotNullParameter(activity, "activity");
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivityDestroyed(Activity activity) {
|
||||
Intrinsics.checkNotNullParameter(activity, "activity");
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivityPaused(Activity activity) {
|
||||
Intrinsics.checkNotNullParameter(activity, "activity");
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivityResumed(Activity activity) {
|
||||
Intrinsics.checkNotNullParameter(activity, "activity");
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivitySaveInstanceState(Activity activity, Bundle bundle) {
|
||||
Intrinsics.checkNotNullParameter(activity, "activity");
|
||||
Intrinsics.checkNotNullParameter(bundle, "bundle");
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivityStarted(Activity activity) {
|
||||
Intrinsics.checkNotNullParameter(activity, "activity");
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivityStopped(Activity activity) {
|
||||
Intrinsics.checkNotNullParameter(activity, "activity");
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivityPostCreated(Activity activity, Bundle savedInstanceState) {
|
||||
Intrinsics.checkNotNullParameter(activity, "activity");
|
||||
ReportFragment.INSTANCE.dispatch$lifecycle_runtime_release(activity, Lifecycle.Event.ON_CREATE);
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivityPostStarted(Activity activity) {
|
||||
Intrinsics.checkNotNullParameter(activity, "activity");
|
||||
ReportFragment.INSTANCE.dispatch$lifecycle_runtime_release(activity, Lifecycle.Event.ON_START);
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivityPostResumed(Activity activity) {
|
||||
Intrinsics.checkNotNullParameter(activity, "activity");
|
||||
ReportFragment.INSTANCE.dispatch$lifecycle_runtime_release(activity, Lifecycle.Event.ON_RESUME);
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivityPrePaused(Activity activity) {
|
||||
Intrinsics.checkNotNullParameter(activity, "activity");
|
||||
ReportFragment.INSTANCE.dispatch$lifecycle_runtime_release(activity, Lifecycle.Event.ON_PAUSE);
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivityPreStopped(Activity activity) {
|
||||
Intrinsics.checkNotNullParameter(activity, "activity");
|
||||
ReportFragment.INSTANCE.dispatch$lifecycle_runtime_release(activity, Lifecycle.Event.ON_STOP);
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivityPreDestroyed(Activity activity) {
|
||||
Intrinsics.checkNotNullParameter(activity, "activity");
|
||||
ReportFragment.INSTANCE.dispatch$lifecycle_runtime_release(activity, Lifecycle.Event.ON_DESTROY);
|
||||
}
|
||||
|
||||
/* compiled from: ReportFragment.kt */
|
||||
@Metadata(d1 = {"\u0000\u0018\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\b\u0086\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\u0010\u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0006H\u0007¨\u0006\u0007"}, d2 = {"Landroidx/lifecycle/ReportFragment$LifecycleCallbacks$Companion;", "", "()V", "registerIn", "", "activity", "Landroid/app/Activity;", "lifecycle-runtime_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
public static final class Companion {
|
||||
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
||||
this();
|
||||
}
|
||||
|
||||
private Companion() {
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public final void registerIn(Activity activity) {
|
||||
Intrinsics.checkNotNullParameter(activity, "activity");
|
||||
activity.registerActivityLifecycleCallbacks(new LifecycleCallbacks());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* compiled from: ReportFragment.kt */
|
||||
@Metadata(d1 = {"\u0000.\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\b\u0086\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\u001d\u0010\f\u001a\u00020\r2\u0006\u0010\u000e\u001a\u00020\u00072\u0006\u0010\u000f\u001a\u00020\u0010H\u0001¢\u0006\u0002\b\u0011J\u0010\u0010\u0012\u001a\u00020\r2\u0006\u0010\u000e\u001a\u00020\u0007H\u0007R\u000e\u0010\u0003\u001a\u00020\u0004X\u0082T¢\u0006\u0002\n\u0000R\u001e\u0010\u0005\u001a\u00020\u0006*\u00020\u00078GX\u0087\u0004¢\u0006\f\u0012\u0004\b\b\u0010\t\u001a\u0004\b\n\u0010\u000b¨\u0006\u0013"}, d2 = {"Landroidx/lifecycle/ReportFragment$Companion;", "", "()V", "REPORT_FRAGMENT_TAG", "", "reportFragment", "Landroidx/lifecycle/ReportFragment;", "Landroid/app/Activity;", "get$annotations", "(Landroid/app/Activity;)V", "get", "(Landroid/app/Activity;)Landroidx/lifecycle/ReportFragment;", "dispatch", "", "activity", NotificationCompat.CATEGORY_EVENT, "Landroidx/lifecycle/Lifecycle$Event;", "dispatch$lifecycle_runtime_release", "injectIfNeededIn", "lifecycle-runtime_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
public static final class Companion {
|
||||
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
||||
this();
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public static /* synthetic */ void get$annotations(Activity activity) {
|
||||
}
|
||||
|
||||
private Companion() {
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public final void injectIfNeededIn(Activity activity) {
|
||||
Intrinsics.checkNotNullParameter(activity, "activity");
|
||||
if (Build.VERSION.SDK_INT >= 29) {
|
||||
LifecycleCallbacks.INSTANCE.registerIn(activity);
|
||||
}
|
||||
FragmentManager fragmentManager = activity.getFragmentManager();
|
||||
if (fragmentManager.findFragmentByTag(ReportFragment.REPORT_FRAGMENT_TAG) == null) {
|
||||
fragmentManager.beginTransaction().add(new ReportFragment(), ReportFragment.REPORT_FRAGMENT_TAG).commit();
|
||||
fragmentManager.executePendingTransactions();
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@JvmStatic
|
||||
public final void dispatch$lifecycle_runtime_release(Activity activity, Lifecycle.Event event) {
|
||||
Intrinsics.checkNotNullParameter(activity, "activity");
|
||||
Intrinsics.checkNotNullParameter(event, "event");
|
||||
if (activity instanceof LifecycleRegistryOwner) {
|
||||
((LifecycleRegistryOwner) activity).getLifecycle().handleLifecycleEvent(event);
|
||||
} else if (activity instanceof LifecycleOwner) {
|
||||
Lifecycle lifecycle = ((LifecycleOwner) activity).getLifecycle();
|
||||
if (lifecycle instanceof LifecycleRegistry) {
|
||||
((LifecycleRegistry) lifecycle).handleLifecycleEvent(event);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public final ReportFragment get(Activity activity) {
|
||||
Intrinsics.checkNotNullParameter(activity, "<this>");
|
||||
Fragment findFragmentByTag = activity.getFragmentManager().findFragmentByTag(ReportFragment.REPORT_FRAGMENT_TAG);
|
||||
Intrinsics.checkNotNull(findFragmentByTag, "null cannot be cast to non-null type androidx.lifecycle.ReportFragment");
|
||||
return (ReportFragment) findFragmentByTag;
|
||||
}
|
||||
}
|
||||
}
|
308
02-Easy5/E5/sources/androidx/lifecycle/SavedStateHandle.java
Normal file
308
02-Easy5/E5/sources/androidx/lifecycle/SavedStateHandle.java
Normal file
@ -0,0 +1,308 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import android.os.Binder;
|
||||
import android.os.Bundle;
|
||||
import android.os.Parcelable;
|
||||
import android.util.Size;
|
||||
import android.util.SizeF;
|
||||
import android.util.SparseArray;
|
||||
import androidx.core.os.BundleKt;
|
||||
import androidx.savedstate.SavedStateRegistry;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.TuplesKt;
|
||||
import kotlin.collections.MapsKt;
|
||||
import kotlin.collections.SetsKt;
|
||||
import kotlin.jvm.JvmStatic;
|
||||
import kotlin.jvm.internal.DefaultConstructorMarker;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import kotlinx.coroutines.flow.FlowKt;
|
||||
import kotlinx.coroutines.flow.MutableStateFlow;
|
||||
import kotlinx.coroutines.flow.StateFlow;
|
||||
import kotlinx.coroutines.flow.StateFlowKt;
|
||||
|
||||
/* compiled from: SavedStateHandle.kt */
|
||||
@Metadata(d1 = {"\u0000X\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010$\n\u0002\u0010\u000e\n\u0002\b\u0003\n\u0002\u0010%\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\"\n\u0002\b\t\u0018\u0000 *2\u00020\u0001:\u0002*+B\u001d\b\u0016\u0012\u0014\u0010\u0002\u001a\u0010\u0012\u0004\u0012\u00020\u0004\u0012\u0006\u0012\u0004\u0018\u00010\u00010\u0003¢\u0006\u0002\u0010\u0005B\u0007\b\u0016¢\u0006\u0002\u0010\u0006J\u0010\u0010\u0010\u001a\u00020\u00112\u0006\u0010\u0012\u001a\u00020\u0004H\u0007J\u0011\u0010\u0013\u001a\u00020\u00142\u0006\u0010\u0012\u001a\u00020\u0004H\u0087\u0002J\u001e\u0010\u0015\u001a\u0004\u0018\u0001H\u0016\"\u0004\b\u0000\u0010\u00162\u0006\u0010\u0012\u001a\u00020\u0004H\u0087\u0002¢\u0006\u0002\u0010\u0017J\u001c\u0010\u0018\u001a\b\u0012\u0004\u0012\u0002H\u00160\u0019\"\u0004\b\u0000\u0010\u00162\u0006\u0010\u0012\u001a\u00020\u0004H\u0007J)\u0010\u0018\u001a\b\u0012\u0004\u0012\u0002H\u00160\u0019\"\u0004\b\u0000\u0010\u00162\u0006\u0010\u0012\u001a\u00020\u00042\u0006\u0010\u001a\u001a\u0002H\u0016H\u0007¢\u0006\u0002\u0010\u001bJ1\u0010\u001c\u001a\b\u0012\u0004\u0012\u0002H\u00160\u0019\"\u0004\b\u0000\u0010\u00162\u0006\u0010\u0012\u001a\u00020\u00042\u0006\u0010\u001d\u001a\u00020\u00142\u0006\u0010\u001a\u001a\u0002H\u0016H\u0002¢\u0006\u0002\u0010\u001eJ)\u0010\u001f\u001a\b\u0012\u0004\u0012\u0002H\u00160 \"\u0004\b\u0000\u0010\u00162\u0006\u0010\u0012\u001a\u00020\u00042\u0006\u0010\u001a\u001a\u0002H\u0016H\u0007¢\u0006\u0002\u0010!J\u000e\u0010\"\u001a\b\u0012\u0004\u0012\u00020\u00040#H\u0007J\u001d\u0010$\u001a\u0004\u0018\u0001H\u0016\"\u0004\b\u0000\u0010\u00162\u0006\u0010\u0012\u001a\u00020\u0004H\u0007¢\u0006\u0002\u0010\u0017J\b\u0010\r\u001a\u00020\u000eH\u0007J&\u0010%\u001a\u00020\u0011\"\u0004\b\u0000\u0010\u00162\u0006\u0010\u0012\u001a\u00020\u00042\b\u0010&\u001a\u0004\u0018\u0001H\u0016H\u0087\u0002¢\u0006\u0002\u0010'J\u0018\u0010(\u001a\u00020\u00112\u0006\u0010\u0012\u001a\u00020\u00042\u0006\u0010)\u001a\u00020\u000eH\u0007R\"\u0010\u0007\u001a\u0016\u0012\u0004\u0012\u00020\u0004\u0012\f\u0012\n\u0012\u0006\u0012\u0004\u0018\u00010\u00010\t0\bX\u0082\u0004¢\u0006\u0002\n\u0000R\u001e\u0010\n\u001a\u0012\u0012\u0004\u0012\u00020\u0004\u0012\b\u0012\u0006\u0012\u0002\b\u00030\u000b0\bX\u0082\u0004¢\u0006\u0002\n\u0000R\u001c\u0010\f\u001a\u0010\u0012\u0004\u0012\u00020\u0004\u0012\u0006\u0012\u0004\u0018\u00010\u00010\bX\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\r\u001a\u00020\u000eX\u0082\u0004¢\u0006\u0002\n\u0000R\u001a\u0010\u000f\u001a\u000e\u0012\u0004\u0012\u00020\u0004\u0012\u0004\u0012\u00020\u000e0\bX\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006,"}, d2 = {"Landroidx/lifecycle/SavedStateHandle;", "", "initialState", "", "", "(Ljava/util/Map;)V", "()V", "flows", "", "Lkotlinx/coroutines/flow/MutableStateFlow;", "liveDatas", "Landroidx/lifecycle/SavedStateHandle$SavingStateLiveData;", "regular", "savedStateProvider", "Landroidx/savedstate/SavedStateRegistry$SavedStateProvider;", "savedStateProviders", "clearSavedStateProvider", "", "key", "contains", "", "get", "T", "(Ljava/lang/String;)Ljava/lang/Object;", "getLiveData", "Landroidx/lifecycle/MutableLiveData;", "initialValue", "(Ljava/lang/String;Ljava/lang/Object;)Landroidx/lifecycle/MutableLiveData;", "getLiveDataInternal", "hasInitialValue", "(Ljava/lang/String;ZLjava/lang/Object;)Landroidx/lifecycle/MutableLiveData;", "getStateFlow", "Lkotlinx/coroutines/flow/StateFlow;", "(Ljava/lang/String;Ljava/lang/Object;)Lkotlinx/coroutines/flow/StateFlow;", SavedStateHandle.KEYS, "", "remove", "set", "value", "(Ljava/lang/String;Ljava/lang/Object;)V", "setSavedStateProvider", "provider", "Companion", "SavingStateLiveData", "lifecycle-viewmodel-savedstate_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class SavedStateHandle {
|
||||
private static final String KEYS = "keys";
|
||||
private static final String VALUES = "values";
|
||||
private final Map<String, MutableStateFlow<Object>> flows;
|
||||
private final Map<String, SavingStateLiveData<?>> liveDatas;
|
||||
private final Map<String, Object> regular;
|
||||
private final SavedStateRegistry.SavedStateProvider savedStateProvider;
|
||||
private final Map<String, SavedStateRegistry.SavedStateProvider> savedStateProviders;
|
||||
|
||||
/* renamed from: Companion, reason: from kotlin metadata */
|
||||
public static final Companion INSTANCE = new Companion(null);
|
||||
private static final Class<? extends Object>[] ACCEPTABLE_CLASSES = {Boolean.TYPE, boolean[].class, Double.TYPE, double[].class, Integer.TYPE, int[].class, Long.TYPE, long[].class, String.class, String[].class, Binder.class, Bundle.class, Byte.TYPE, byte[].class, Character.TYPE, char[].class, CharSequence.class, CharSequence[].class, ArrayList.class, Float.TYPE, float[].class, Parcelable.class, Parcelable[].class, Serializable.class, Short.TYPE, short[].class, SparseArray.class, Size.class, SizeF.class};
|
||||
|
||||
@JvmStatic
|
||||
public static final SavedStateHandle createHandle(Bundle bundle, Bundle bundle2) {
|
||||
return INSTANCE.createHandle(bundle, bundle2);
|
||||
}
|
||||
|
||||
/* renamed from: savedStateProvider, reason: from getter */
|
||||
public final SavedStateRegistry.SavedStateProvider getSavedStateProvider() {
|
||||
return this.savedStateProvider;
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public static final Bundle savedStateProvider$lambda$0(SavedStateHandle this$0) {
|
||||
Intrinsics.checkNotNullParameter(this$0, "this$0");
|
||||
for (Map.Entry entry : MapsKt.toMap(this$0.savedStateProviders).entrySet()) {
|
||||
this$0.set((String) entry.getKey(), ((SavedStateRegistry.SavedStateProvider) entry.getValue()).saveState());
|
||||
}
|
||||
Set<String> keySet = this$0.regular.keySet();
|
||||
ArrayList arrayList = new ArrayList(keySet.size());
|
||||
ArrayList arrayList2 = new ArrayList(arrayList.size());
|
||||
for (String str : keySet) {
|
||||
arrayList.add(str);
|
||||
arrayList2.add(this$0.regular.get(str));
|
||||
}
|
||||
return BundleKt.bundleOf(TuplesKt.to(KEYS, arrayList), TuplesKt.to(VALUES, arrayList2));
|
||||
}
|
||||
|
||||
public SavedStateHandle(Map<String, ? extends Object> initialState) {
|
||||
Intrinsics.checkNotNullParameter(initialState, "initialState");
|
||||
LinkedHashMap linkedHashMap = new LinkedHashMap();
|
||||
this.regular = linkedHashMap;
|
||||
this.savedStateProviders = new LinkedHashMap();
|
||||
this.liveDatas = new LinkedHashMap();
|
||||
this.flows = new LinkedHashMap();
|
||||
this.savedStateProvider = new SavedStateRegistry.SavedStateProvider() { // from class: androidx.lifecycle.SavedStateHandle$$ExternalSyntheticLambda0
|
||||
@Override // androidx.savedstate.SavedStateRegistry.SavedStateProvider
|
||||
public final Bundle saveState() {
|
||||
Bundle savedStateProvider$lambda$0;
|
||||
savedStateProvider$lambda$0 = SavedStateHandle.savedStateProvider$lambda$0(SavedStateHandle.this);
|
||||
return savedStateProvider$lambda$0;
|
||||
}
|
||||
};
|
||||
linkedHashMap.putAll(initialState);
|
||||
}
|
||||
|
||||
public SavedStateHandle() {
|
||||
this.regular = new LinkedHashMap();
|
||||
this.savedStateProviders = new LinkedHashMap();
|
||||
this.liveDatas = new LinkedHashMap();
|
||||
this.flows = new LinkedHashMap();
|
||||
this.savedStateProvider = new SavedStateRegistry.SavedStateProvider() { // from class: androidx.lifecycle.SavedStateHandle$$ExternalSyntheticLambda0
|
||||
@Override // androidx.savedstate.SavedStateRegistry.SavedStateProvider
|
||||
public final Bundle saveState() {
|
||||
Bundle savedStateProvider$lambda$0;
|
||||
savedStateProvider$lambda$0 = SavedStateHandle.savedStateProvider$lambda$0(SavedStateHandle.this);
|
||||
return savedStateProvider$lambda$0;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public final boolean contains(String key) {
|
||||
Intrinsics.checkNotNullParameter(key, "key");
|
||||
return this.regular.containsKey(key);
|
||||
}
|
||||
|
||||
public final <T> MutableLiveData<T> getLiveData(String key) {
|
||||
Intrinsics.checkNotNullParameter(key, "key");
|
||||
MutableLiveData<T> liveDataInternal = getLiveDataInternal(key, false, null);
|
||||
Intrinsics.checkNotNull(liveDataInternal, "null cannot be cast to non-null type androidx.lifecycle.MutableLiveData<T of androidx.lifecycle.SavedStateHandle.getLiveData>");
|
||||
return liveDataInternal;
|
||||
}
|
||||
|
||||
public final <T> MutableLiveData<T> getLiveData(String key, T initialValue) {
|
||||
Intrinsics.checkNotNullParameter(key, "key");
|
||||
return getLiveDataInternal(key, true, initialValue);
|
||||
}
|
||||
|
||||
private final <T> MutableLiveData<T> getLiveDataInternal(String key, boolean hasInitialValue, T initialValue) {
|
||||
SavingStateLiveData<?> savingStateLiveData;
|
||||
SavingStateLiveData<?> savingStateLiveData2 = this.liveDatas.get(key);
|
||||
SavingStateLiveData<?> savingStateLiveData3 = savingStateLiveData2 instanceof MutableLiveData ? savingStateLiveData2 : null;
|
||||
if (savingStateLiveData3 != null) {
|
||||
return savingStateLiveData3;
|
||||
}
|
||||
if (this.regular.containsKey(key)) {
|
||||
savingStateLiveData = new SavingStateLiveData<>(this, key, this.regular.get(key));
|
||||
} else if (hasInitialValue) {
|
||||
this.regular.put(key, initialValue);
|
||||
savingStateLiveData = new SavingStateLiveData<>(this, key, initialValue);
|
||||
} else {
|
||||
savingStateLiveData = new SavingStateLiveData<>(this, key);
|
||||
}
|
||||
this.liveDatas.put(key, savingStateLiveData);
|
||||
return savingStateLiveData;
|
||||
}
|
||||
|
||||
public final Set<String> keys() {
|
||||
return SetsKt.plus(SetsKt.plus((Set) this.regular.keySet(), (Iterable) this.savedStateProviders.keySet()), (Iterable) this.liveDatas.keySet());
|
||||
}
|
||||
|
||||
public final <T> T get(String key) {
|
||||
Intrinsics.checkNotNullParameter(key, "key");
|
||||
try {
|
||||
return (T) this.regular.get(key);
|
||||
} catch (ClassCastException unused) {
|
||||
remove(key);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public final <T> void set(String key, T value) {
|
||||
Intrinsics.checkNotNullParameter(key, "key");
|
||||
if (!INSTANCE.validateValue(value)) {
|
||||
StringBuilder sb = new StringBuilder("Can't put value with type ");
|
||||
Intrinsics.checkNotNull(value);
|
||||
sb.append(value.getClass());
|
||||
sb.append(" into saved state");
|
||||
throw new IllegalArgumentException(sb.toString());
|
||||
}
|
||||
SavingStateLiveData<?> savingStateLiveData = this.liveDatas.get(key);
|
||||
SavingStateLiveData<?> savingStateLiveData2 = savingStateLiveData instanceof MutableLiveData ? savingStateLiveData : null;
|
||||
if (savingStateLiveData2 != null) {
|
||||
savingStateLiveData2.setValue(value);
|
||||
} else {
|
||||
this.regular.put(key, value);
|
||||
}
|
||||
MutableStateFlow<Object> mutableStateFlow = this.flows.get(key);
|
||||
if (mutableStateFlow == null) {
|
||||
return;
|
||||
}
|
||||
mutableStateFlow.setValue(value);
|
||||
}
|
||||
|
||||
public final <T> T remove(String key) {
|
||||
Intrinsics.checkNotNullParameter(key, "key");
|
||||
T t = (T) this.regular.remove(key);
|
||||
SavingStateLiveData<?> remove = this.liveDatas.remove(key);
|
||||
if (remove != null) {
|
||||
remove.detach();
|
||||
}
|
||||
this.flows.remove(key);
|
||||
return t;
|
||||
}
|
||||
|
||||
public final void setSavedStateProvider(String key, SavedStateRegistry.SavedStateProvider provider) {
|
||||
Intrinsics.checkNotNullParameter(key, "key");
|
||||
Intrinsics.checkNotNullParameter(provider, "provider");
|
||||
this.savedStateProviders.put(key, provider);
|
||||
}
|
||||
|
||||
public final void clearSavedStateProvider(String key) {
|
||||
Intrinsics.checkNotNullParameter(key, "key");
|
||||
this.savedStateProviders.remove(key);
|
||||
}
|
||||
|
||||
/* compiled from: SavedStateHandle.kt */
|
||||
@Metadata(d1 = {"\u0000\"\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0004\n\u0002\u0010\u0002\n\u0002\b\u0003\b\u0000\u0018\u0000*\u0004\b\u0000\u0010\u00012\b\u0012\u0004\u0012\u0002H\u00010\u0002B!\b\u0016\u0012\b\u0010\u0003\u001a\u0004\u0018\u00010\u0004\u0012\u0006\u0010\u0005\u001a\u00020\u0006\u0012\u0006\u0010\u0007\u001a\u00028\u0000¢\u0006\u0002\u0010\bB\u0019\b\u0016\u0012\b\u0010\u0003\u001a\u0004\u0018\u00010\u0004\u0012\u0006\u0010\u0005\u001a\u00020\u0006¢\u0006\u0002\u0010\tJ\u0006\u0010\n\u001a\u00020\u000bJ\u0015\u0010\f\u001a\u00020\u000b2\u0006\u0010\u0007\u001a\u00028\u0000H\u0016¢\u0006\u0002\u0010\rR\u0010\u0010\u0003\u001a\u0004\u0018\u00010\u0004X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0005\u001a\u00020\u0006X\u0082\u000e¢\u0006\u0002\n\u0000¨\u0006\u000e"}, d2 = {"Landroidx/lifecycle/SavedStateHandle$SavingStateLiveData;", "T", "Landroidx/lifecycle/MutableLiveData;", "handle", "Landroidx/lifecycle/SavedStateHandle;", "key", "", "value", "(Landroidx/lifecycle/SavedStateHandle;Ljava/lang/String;Ljava/lang/Object;)V", "(Landroidx/lifecycle/SavedStateHandle;Ljava/lang/String;)V", "detach", "", "setValue", "(Ljava/lang/Object;)V", "lifecycle-viewmodel-savedstate_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
public static final class SavingStateLiveData<T> extends MutableLiveData<T> {
|
||||
private SavedStateHandle handle;
|
||||
private String key;
|
||||
|
||||
public final void detach() {
|
||||
this.handle = null;
|
||||
}
|
||||
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
public SavingStateLiveData(SavedStateHandle savedStateHandle, String key, T t) {
|
||||
super(t);
|
||||
Intrinsics.checkNotNullParameter(key, "key");
|
||||
this.key = key;
|
||||
this.handle = savedStateHandle;
|
||||
}
|
||||
|
||||
public SavingStateLiveData(SavedStateHandle savedStateHandle, String key) {
|
||||
Intrinsics.checkNotNullParameter(key, "key");
|
||||
this.key = key;
|
||||
this.handle = savedStateHandle;
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.MutableLiveData, androidx.lifecycle.LiveData
|
||||
public void setValue(T value) {
|
||||
SavedStateHandle savedStateHandle = this.handle;
|
||||
if (savedStateHandle != null) {
|
||||
savedStateHandle.regular.put(this.key, value);
|
||||
MutableStateFlow mutableStateFlow = (MutableStateFlow) savedStateHandle.flows.get(this.key);
|
||||
if (mutableStateFlow != null) {
|
||||
mutableStateFlow.setValue(value);
|
||||
}
|
||||
}
|
||||
super.setValue(value);
|
||||
}
|
||||
}
|
||||
|
||||
/* compiled from: SavedStateHandle.kt */
|
||||
@Metadata(d1 = {"\u00006\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u0011\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0002\b\u0002\b\u0086\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\u001c\u0010\n\u001a\u00020\u000b2\b\u0010\f\u001a\u0004\u0018\u00010\r2\b\u0010\u000e\u001a\u0004\u0018\u00010\rH\u0007J\u0012\u0010\u000f\u001a\u00020\u00102\b\u0010\u0011\u001a\u0004\u0018\u00010\u0001H\u0007R \u0010\u0003\u001a\u0012\u0012\u000e\u0012\f\u0012\u0006\b\u0001\u0012\u00020\u0001\u0018\u00010\u00050\u0004X\u0082\u0004¢\u0006\u0004\n\u0002\u0010\u0006R\u000e\u0010\u0007\u001a\u00020\bX\u0082T¢\u0006\u0002\n\u0000R\u000e\u0010\t\u001a\u00020\bX\u0082T¢\u0006\u0002\n\u0000¨\u0006\u0012"}, d2 = {"Landroidx/lifecycle/SavedStateHandle$Companion;", "", "()V", "ACCEPTABLE_CLASSES", "", "Ljava/lang/Class;", "[Ljava/lang/Class;", "KEYS", "", "VALUES", "createHandle", "Landroidx/lifecycle/SavedStateHandle;", "restoredState", "Landroid/os/Bundle;", "defaultState", "validateValue", "", "value", "lifecycle-viewmodel-savedstate_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
public static final class Companion {
|
||||
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
||||
this();
|
||||
}
|
||||
|
||||
private Companion() {
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public final SavedStateHandle createHandle(Bundle restoredState, Bundle defaultState) {
|
||||
if (restoredState == null) {
|
||||
if (defaultState == null) {
|
||||
return new SavedStateHandle();
|
||||
}
|
||||
HashMap hashMap = new HashMap();
|
||||
for (String key : defaultState.keySet()) {
|
||||
Intrinsics.checkNotNullExpressionValue(key, "key");
|
||||
hashMap.put(key, defaultState.get(key));
|
||||
}
|
||||
return new SavedStateHandle(hashMap);
|
||||
}
|
||||
ClassLoader classLoader = SavedStateHandle.class.getClassLoader();
|
||||
Intrinsics.checkNotNull(classLoader);
|
||||
restoredState.setClassLoader(classLoader);
|
||||
ArrayList parcelableArrayList = restoredState.getParcelableArrayList(SavedStateHandle.KEYS);
|
||||
ArrayList parcelableArrayList2 = restoredState.getParcelableArrayList(SavedStateHandle.VALUES);
|
||||
if (parcelableArrayList == null || parcelableArrayList2 == null || parcelableArrayList.size() != parcelableArrayList2.size()) {
|
||||
throw new IllegalStateException("Invalid bundle passed as restored state".toString());
|
||||
}
|
||||
LinkedHashMap linkedHashMap = new LinkedHashMap();
|
||||
int size = parcelableArrayList.size();
|
||||
for (int i = 0; i < size; i++) {
|
||||
Object obj = parcelableArrayList.get(i);
|
||||
Intrinsics.checkNotNull(obj, "null cannot be cast to non-null type kotlin.String");
|
||||
linkedHashMap.put((String) obj, parcelableArrayList2.get(i));
|
||||
}
|
||||
return new SavedStateHandle(linkedHashMap);
|
||||
}
|
||||
|
||||
public final boolean validateValue(Object value) {
|
||||
if (value == null) {
|
||||
return true;
|
||||
}
|
||||
for (Class cls : SavedStateHandle.ACCEPTABLE_CLASSES) {
|
||||
Intrinsics.checkNotNull(cls);
|
||||
if (cls.isInstance(value)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public final <T> StateFlow<T> getStateFlow(String key, T initialValue) {
|
||||
Intrinsics.checkNotNullParameter(key, "key");
|
||||
Map<String, MutableStateFlow<Object>> map = this.flows;
|
||||
MutableStateFlow<Object> mutableStateFlow = map.get(key);
|
||||
if (mutableStateFlow == null) {
|
||||
if (!this.regular.containsKey(key)) {
|
||||
this.regular.put(key, initialValue);
|
||||
}
|
||||
mutableStateFlow = StateFlowKt.MutableStateFlow(this.regular.get(key));
|
||||
this.flows.put(key, mutableStateFlow);
|
||||
map.put(key, mutableStateFlow);
|
||||
}
|
||||
StateFlow<T> asStateFlow = FlowKt.asStateFlow(mutableStateFlow);
|
||||
Intrinsics.checkNotNull(asStateFlow, "null cannot be cast to non-null type kotlinx.coroutines.flow.StateFlow<T of androidx.lifecycle.SavedStateHandle.getStateFlow>");
|
||||
return asStateFlow;
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import androidx.core.app.NotificationCompat;
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: SavedStateHandleSupport.kt */
|
||||
@Metadata(d1 = {"\u0000$\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\b\u0000\u0018\u00002\u00020\u0001B\r\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0002\u0010\u0004J\u0018\u0010\u0005\u001a\u00020\u00062\u0006\u0010\u0007\u001a\u00020\b2\u0006\u0010\t\u001a\u00020\nH\u0016R\u000e\u0010\u0002\u001a\u00020\u0003X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u000b"}, d2 = {"Landroidx/lifecycle/SavedStateHandleAttacher;", "Landroidx/lifecycle/LifecycleEventObserver;", "provider", "Landroidx/lifecycle/SavedStateHandlesProvider;", "(Landroidx/lifecycle/SavedStateHandlesProvider;)V", "onStateChanged", "", "source", "Landroidx/lifecycle/LifecycleOwner;", NotificationCompat.CATEGORY_EVENT, "Landroidx/lifecycle/Lifecycle$Event;", "lifecycle-viewmodel-savedstate_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class SavedStateHandleAttacher implements LifecycleEventObserver {
|
||||
private final SavedStateHandlesProvider provider;
|
||||
|
||||
public SavedStateHandleAttacher(SavedStateHandlesProvider provider) {
|
||||
Intrinsics.checkNotNullParameter(provider, "provider");
|
||||
this.provider = provider;
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.LifecycleEventObserver
|
||||
public void onStateChanged(LifecycleOwner source, Lifecycle.Event event) {
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
Intrinsics.checkNotNullParameter(event, "event");
|
||||
if (event != Lifecycle.Event.ON_CREATE) {
|
||||
throw new IllegalStateException(("Next event must be ON_CREATE, it was " + event).toString());
|
||||
}
|
||||
source.getLifecycle().removeObserver(this);
|
||||
this.provider.performRestore();
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import androidx.core.app.NotificationCompat;
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
import androidx.savedstate.SavedStateRegistry;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: SavedStateHandleController.kt */
|
||||
@Metadata(d1 = {"\u0000@\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0010\u000b\n\u0002\b\u0003\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\b\u0000\u0018\u00002\u00020\u0001B\u0015\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\u0006\u0010\u0004\u001a\u00020\u0005¢\u0006\u0002\u0010\u0006J\u0016\u0010\r\u001a\u00020\u000e2\u0006\u0010\u000f\u001a\u00020\u00102\u0006\u0010\u0011\u001a\u00020\u0012J\u0018\u0010\u0013\u001a\u00020\u000e2\u0006\u0010\u0014\u001a\u00020\u00152\u0006\u0010\u0016\u001a\u00020\u0017H\u0016R\u0011\u0010\u0004\u001a\u00020\u0005¢\u0006\b\n\u0000\u001a\u0004\b\u0007\u0010\bR\u001e\u0010\u000b\u001a\u00020\n2\u0006\u0010\t\u001a\u00020\n@BX\u0086\u000e¢\u0006\b\n\u0000\u001a\u0004\b\u000b\u0010\fR\u000e\u0010\u0002\u001a\u00020\u0003X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u0018"}, d2 = {"Landroidx/lifecycle/SavedStateHandleController;", "Landroidx/lifecycle/LifecycleEventObserver;", "key", "", "handle", "Landroidx/lifecycle/SavedStateHandle;", "(Ljava/lang/String;Landroidx/lifecycle/SavedStateHandle;)V", "getHandle", "()Landroidx/lifecycle/SavedStateHandle;", "<set-?>", "", "isAttached", "()Z", "attachToLifecycle", "", "registry", "Landroidx/savedstate/SavedStateRegistry;", "lifecycle", "Landroidx/lifecycle/Lifecycle;", "onStateChanged", "source", "Landroidx/lifecycle/LifecycleOwner;", NotificationCompat.CATEGORY_EVENT, "Landroidx/lifecycle/Lifecycle$Event;", "lifecycle-viewmodel-savedstate_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class SavedStateHandleController implements LifecycleEventObserver {
|
||||
private final SavedStateHandle handle;
|
||||
private boolean isAttached;
|
||||
private final String key;
|
||||
|
||||
public final SavedStateHandle getHandle() {
|
||||
return this.handle;
|
||||
}
|
||||
|
||||
/* renamed from: isAttached, reason: from getter */
|
||||
public final boolean getIsAttached() {
|
||||
return this.isAttached;
|
||||
}
|
||||
|
||||
public SavedStateHandleController(String key, SavedStateHandle handle) {
|
||||
Intrinsics.checkNotNullParameter(key, "key");
|
||||
Intrinsics.checkNotNullParameter(handle, "handle");
|
||||
this.key = key;
|
||||
this.handle = handle;
|
||||
}
|
||||
|
||||
public final void attachToLifecycle(SavedStateRegistry registry, Lifecycle lifecycle) {
|
||||
Intrinsics.checkNotNullParameter(registry, "registry");
|
||||
Intrinsics.checkNotNullParameter(lifecycle, "lifecycle");
|
||||
if (!(!this.isAttached)) {
|
||||
throw new IllegalStateException("Already attached to lifecycleOwner".toString());
|
||||
}
|
||||
this.isAttached = true;
|
||||
lifecycle.addObserver(this);
|
||||
registry.registerSavedStateProvider(this.key, this.handle.getSavedStateProvider());
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.LifecycleEventObserver
|
||||
public void onStateChanged(LifecycleOwner source, Lifecycle.Event event) {
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
Intrinsics.checkNotNullParameter(event, "event");
|
||||
if (event == Lifecycle.Event.ON_DESTROY) {
|
||||
this.isAttached = false;
|
||||
source.getLifecycle().removeObserver(this);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,95 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import android.os.Bundle;
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.lifecycle.viewmodel.CreationExtras;
|
||||
import androidx.savedstate.SavedStateRegistry;
|
||||
import androidx.savedstate.SavedStateRegistryOwner;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: SavedStateHandleSupport.kt */
|
||||
@Metadata(d1 = {"\u0000F\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0003\u001a*\u0010\u0012\u001a\u00020\u00132\u0006\u0010\u0014\u001a\u00020\u00062\u0006\u0010\u0015\u001a\u00020\t2\u0006\u0010\u0016\u001a\u00020\u00042\b\u0010\u0017\u001a\u0004\u0018\u00010\u0002H\u0002\u001a\f\u0010\u0012\u001a\u00020\u0013*\u00020\u0018H\u0007\u001a\u001f\u0010\u0019\u001a\u00020\u001a\"\f\b\u0000\u0010\u001b*\u00020\u0006*\u00020\t*\u0002H\u001bH\u0007¢\u0006\u0002\u0010\u001c\"\u0016\u0010\u0000\u001a\b\u0012\u0004\u0012\u00020\u00020\u00018\u0006X\u0087\u0004¢\u0006\u0002\n\u0000\"\u000e\u0010\u0003\u001a\u00020\u0004X\u0082T¢\u0006\u0002\n\u0000\"\u0016\u0010\u0005\u001a\b\u0012\u0004\u0012\u00020\u00060\u00018\u0006X\u0087\u0004¢\u0006\u0002\n\u0000\"\u000e\u0010\u0007\u001a\u00020\u0004X\u0082T¢\u0006\u0002\n\u0000\"\u0016\u0010\b\u001a\b\u0012\u0004\u0012\u00020\t0\u00018\u0006X\u0087\u0004¢\u0006\u0002\n\u0000\"\u0018\u0010\n\u001a\u00020\u000b*\u00020\u00068@X\u0080\u0004¢\u0006\u0006\u001a\u0004\b\f\u0010\r\"\u0018\u0010\u000e\u001a\u00020\u000f*\u00020\t8@X\u0080\u0004¢\u0006\u0006\u001a\u0004\b\u0010\u0010\u0011¨\u0006\u001d"}, d2 = {"DEFAULT_ARGS_KEY", "Landroidx/lifecycle/viewmodel/CreationExtras$Key;", "Landroid/os/Bundle;", "SAVED_STATE_KEY", "", "SAVED_STATE_REGISTRY_OWNER_KEY", "Landroidx/savedstate/SavedStateRegistryOwner;", "VIEWMODEL_KEY", "VIEW_MODEL_STORE_OWNER_KEY", "Landroidx/lifecycle/ViewModelStoreOwner;", "savedStateHandlesProvider", "Landroidx/lifecycle/SavedStateHandlesProvider;", "getSavedStateHandlesProvider", "(Landroidx/savedstate/SavedStateRegistryOwner;)Landroidx/lifecycle/SavedStateHandlesProvider;", "savedStateHandlesVM", "Landroidx/lifecycle/SavedStateHandlesVM;", "getSavedStateHandlesVM", "(Landroidx/lifecycle/ViewModelStoreOwner;)Landroidx/lifecycle/SavedStateHandlesVM;", "createSavedStateHandle", "Landroidx/lifecycle/SavedStateHandle;", "savedStateRegistryOwner", "viewModelStoreOwner", "key", "defaultArgs", "Landroidx/lifecycle/viewmodel/CreationExtras;", "enableSavedStateHandles", "", "T", "(Landroidx/savedstate/SavedStateRegistryOwner;)V", "lifecycle-viewmodel-savedstate_release"}, k = 2, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class SavedStateHandleSupport {
|
||||
private static final String SAVED_STATE_KEY = "androidx.lifecycle.internal.SavedStateHandlesProvider";
|
||||
private static final String VIEWMODEL_KEY = "androidx.lifecycle.internal.SavedStateHandlesVM";
|
||||
public static final CreationExtras.Key<SavedStateRegistryOwner> SAVED_STATE_REGISTRY_OWNER_KEY = new CreationExtras.Key<SavedStateRegistryOwner>() { // from class: androidx.lifecycle.SavedStateHandleSupport$SAVED_STATE_REGISTRY_OWNER_KEY$1
|
||||
};
|
||||
public static final CreationExtras.Key<ViewModelStoreOwner> VIEW_MODEL_STORE_OWNER_KEY = new CreationExtras.Key<ViewModelStoreOwner>() { // from class: androidx.lifecycle.SavedStateHandleSupport$VIEW_MODEL_STORE_OWNER_KEY$1
|
||||
};
|
||||
public static final CreationExtras.Key<Bundle> DEFAULT_ARGS_KEY = new CreationExtras.Key<Bundle>() { // from class: androidx.lifecycle.SavedStateHandleSupport$DEFAULT_ARGS_KEY$1
|
||||
};
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public static final <T extends SavedStateRegistryOwner & ViewModelStoreOwner> void enableSavedStateHandles(T t) {
|
||||
Intrinsics.checkNotNullParameter(t, "<this>");
|
||||
Lifecycle.State state = t.getLifecycle().getState();
|
||||
if (state != Lifecycle.State.INITIALIZED && state != Lifecycle.State.CREATED) {
|
||||
throw new IllegalArgumentException("Failed requirement.".toString());
|
||||
}
|
||||
if (t.getSavedStateRegistry().getSavedStateProvider(SAVED_STATE_KEY) == null) {
|
||||
SavedStateHandlesProvider savedStateHandlesProvider = new SavedStateHandlesProvider(t.getSavedStateRegistry(), t);
|
||||
t.getSavedStateRegistry().registerSavedStateProvider(SAVED_STATE_KEY, savedStateHandlesProvider);
|
||||
t.getLifecycle().addObserver(new SavedStateHandleAttacher(savedStateHandlesProvider));
|
||||
}
|
||||
}
|
||||
|
||||
private static final SavedStateHandle createSavedStateHandle(SavedStateRegistryOwner savedStateRegistryOwner, ViewModelStoreOwner viewModelStoreOwner, String str, Bundle bundle) {
|
||||
SavedStateHandlesProvider savedStateHandlesProvider = getSavedStateHandlesProvider(savedStateRegistryOwner);
|
||||
SavedStateHandlesVM savedStateHandlesVM = getSavedStateHandlesVM(viewModelStoreOwner);
|
||||
SavedStateHandle savedStateHandle = savedStateHandlesVM.getHandles().get(str);
|
||||
if (savedStateHandle != null) {
|
||||
return savedStateHandle;
|
||||
}
|
||||
SavedStateHandle createHandle = SavedStateHandle.INSTANCE.createHandle(savedStateHandlesProvider.consumeRestoredStateForKey(str), bundle);
|
||||
savedStateHandlesVM.getHandles().put(str, createHandle);
|
||||
return createHandle;
|
||||
}
|
||||
|
||||
public static final SavedStateHandle createSavedStateHandle(CreationExtras creationExtras) {
|
||||
Intrinsics.checkNotNullParameter(creationExtras, "<this>");
|
||||
SavedStateRegistryOwner savedStateRegistryOwner = (SavedStateRegistryOwner) creationExtras.get(SAVED_STATE_REGISTRY_OWNER_KEY);
|
||||
if (savedStateRegistryOwner == null) {
|
||||
throw new IllegalArgumentException("CreationExtras must have a value by `SAVED_STATE_REGISTRY_OWNER_KEY`");
|
||||
}
|
||||
ViewModelStoreOwner viewModelStoreOwner = (ViewModelStoreOwner) creationExtras.get(VIEW_MODEL_STORE_OWNER_KEY);
|
||||
if (viewModelStoreOwner == null) {
|
||||
throw new IllegalArgumentException("CreationExtras must have a value by `VIEW_MODEL_STORE_OWNER_KEY`");
|
||||
}
|
||||
Bundle bundle = (Bundle) creationExtras.get(DEFAULT_ARGS_KEY);
|
||||
String str = (String) creationExtras.get(ViewModelProvider.NewInstanceFactory.VIEW_MODEL_KEY);
|
||||
if (str == null) {
|
||||
throw new IllegalArgumentException("CreationExtras must have a value by `VIEW_MODEL_KEY`");
|
||||
}
|
||||
return createSavedStateHandle(savedStateRegistryOwner, viewModelStoreOwner, str, bundle);
|
||||
}
|
||||
|
||||
public static final SavedStateHandlesVM getSavedStateHandlesVM(ViewModelStoreOwner viewModelStoreOwner) {
|
||||
Intrinsics.checkNotNullParameter(viewModelStoreOwner, "<this>");
|
||||
return (SavedStateHandlesVM) new ViewModelProvider(viewModelStoreOwner, new ViewModelProvider.Factory() { // from class: androidx.lifecycle.SavedStateHandleSupport$savedStateHandlesVM$1
|
||||
@Override // androidx.lifecycle.ViewModelProvider.Factory
|
||||
public /* synthetic */ ViewModel create(Class cls) {
|
||||
return ViewModelProvider.Factory.CC.$default$create(this, cls);
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.ViewModelProvider.Factory
|
||||
public <T extends ViewModel> T create(Class<T> modelClass, CreationExtras extras) {
|
||||
Intrinsics.checkNotNullParameter(modelClass, "modelClass");
|
||||
Intrinsics.checkNotNullParameter(extras, "extras");
|
||||
return new SavedStateHandlesVM();
|
||||
}
|
||||
}).get(VIEWMODEL_KEY, SavedStateHandlesVM.class);
|
||||
}
|
||||
|
||||
public static final SavedStateHandlesProvider getSavedStateHandlesProvider(SavedStateRegistryOwner savedStateRegistryOwner) {
|
||||
Intrinsics.checkNotNullParameter(savedStateRegistryOwner, "<this>");
|
||||
SavedStateRegistry.SavedStateProvider savedStateProvider = savedStateRegistryOwner.getSavedStateRegistry().getSavedStateProvider(SAVED_STATE_KEY);
|
||||
SavedStateHandlesProvider savedStateHandlesProvider = savedStateProvider instanceof SavedStateHandlesProvider ? (SavedStateHandlesProvider) savedStateProvider : null;
|
||||
if (savedStateHandlesProvider != null) {
|
||||
return savedStateHandlesProvider;
|
||||
}
|
||||
throw new IllegalStateException("enableSavedStateHandles() wasn't called prior to createSavedStateHandle() call");
|
||||
}
|
||||
}
|
@ -0,0 +1,95 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import android.os.Bundle;
|
||||
import androidx.savedstate.SavedStateRegistry;
|
||||
import java.util.Map;
|
||||
import kotlin.Lazy;
|
||||
import kotlin.LazyKt;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.functions.Function0;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: SavedStateHandleSupport.kt */
|
||||
@Metadata(d1 = {"\u0000:\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0010\u000e\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002\b\u0000\u0018\u00002\u00020\u0001B\u0015\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\u0006\u0010\u0004\u001a\u00020\u0005¢\u0006\u0002\u0010\u0006J\u0010\u0010\u0011\u001a\u0004\u0018\u00010\n2\u0006\u0010\u0012\u001a\u00020\u0013J\u0006\u0010\u0014\u001a\u00020\u0015J\b\u0010\u0016\u001a\u00020\nH\u0016R\u000e\u0010\u0007\u001a\u00020\bX\u0082\u000e¢\u0006\u0002\n\u0000R\u0010\u0010\t\u001a\u0004\u0018\u00010\nX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0002\u001a\u00020\u0003X\u0082\u0004¢\u0006\u0002\n\u0000R\u001b\u0010\u000b\u001a\u00020\f8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b\u000f\u0010\u0010\u001a\u0004\b\r\u0010\u000e¨\u0006\u0017"}, d2 = {"Landroidx/lifecycle/SavedStateHandlesProvider;", "Landroidx/savedstate/SavedStateRegistry$SavedStateProvider;", "savedStateRegistry", "Landroidx/savedstate/SavedStateRegistry;", "viewModelStoreOwner", "Landroidx/lifecycle/ViewModelStoreOwner;", "(Landroidx/savedstate/SavedStateRegistry;Landroidx/lifecycle/ViewModelStoreOwner;)V", "restored", "", "restoredState", "Landroid/os/Bundle;", "viewModel", "Landroidx/lifecycle/SavedStateHandlesVM;", "getViewModel", "()Landroidx/lifecycle/SavedStateHandlesVM;", "viewModel$delegate", "Lkotlin/Lazy;", "consumeRestoredStateForKey", "key", "", "performRestore", "", "saveState", "lifecycle-viewmodel-savedstate_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class SavedStateHandlesProvider implements SavedStateRegistry.SavedStateProvider {
|
||||
private boolean restored;
|
||||
private Bundle restoredState;
|
||||
private final SavedStateRegistry savedStateRegistry;
|
||||
|
||||
/* renamed from: viewModel$delegate, reason: from kotlin metadata */
|
||||
private final Lazy viewModel;
|
||||
|
||||
public SavedStateHandlesProvider(SavedStateRegistry savedStateRegistry, final ViewModelStoreOwner viewModelStoreOwner) {
|
||||
Intrinsics.checkNotNullParameter(savedStateRegistry, "savedStateRegistry");
|
||||
Intrinsics.checkNotNullParameter(viewModelStoreOwner, "viewModelStoreOwner");
|
||||
this.savedStateRegistry = savedStateRegistry;
|
||||
this.viewModel = LazyKt.lazy(new Function0<SavedStateHandlesVM>() { // from class: androidx.lifecycle.SavedStateHandlesProvider$viewModel$2
|
||||
{
|
||||
super(0);
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // kotlin.jvm.functions.Function0
|
||||
public final SavedStateHandlesVM invoke() {
|
||||
return SavedStateHandleSupport.getSavedStateHandlesVM(ViewModelStoreOwner.this);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private final SavedStateHandlesVM getViewModel() {
|
||||
return (SavedStateHandlesVM) this.viewModel.getValue();
|
||||
}
|
||||
|
||||
@Override // androidx.savedstate.SavedStateRegistry.SavedStateProvider
|
||||
public Bundle saveState() {
|
||||
Bundle bundle = new Bundle();
|
||||
Bundle bundle2 = this.restoredState;
|
||||
if (bundle2 != null) {
|
||||
bundle.putAll(bundle2);
|
||||
}
|
||||
for (Map.Entry<String, SavedStateHandle> entry : getViewModel().getHandles().entrySet()) {
|
||||
String key = entry.getKey();
|
||||
Bundle saveState = entry.getValue().getSavedStateProvider().saveState();
|
||||
if (!Intrinsics.areEqual(saveState, Bundle.EMPTY)) {
|
||||
bundle.putBundle(key, saveState);
|
||||
}
|
||||
}
|
||||
this.restored = false;
|
||||
return bundle;
|
||||
}
|
||||
|
||||
public final void performRestore() {
|
||||
if (this.restored) {
|
||||
return;
|
||||
}
|
||||
Bundle consumeRestoredStateForKey = this.savedStateRegistry.consumeRestoredStateForKey("androidx.lifecycle.internal.SavedStateHandlesProvider");
|
||||
Bundle bundle = new Bundle();
|
||||
Bundle bundle2 = this.restoredState;
|
||||
if (bundle2 != null) {
|
||||
bundle.putAll(bundle2);
|
||||
}
|
||||
if (consumeRestoredStateForKey != null) {
|
||||
bundle.putAll(consumeRestoredStateForKey);
|
||||
}
|
||||
this.restoredState = bundle;
|
||||
this.restored = true;
|
||||
getViewModel();
|
||||
}
|
||||
|
||||
public final Bundle consumeRestoredStateForKey(String key) {
|
||||
Intrinsics.checkNotNullParameter(key, "key");
|
||||
performRestore();
|
||||
Bundle bundle = this.restoredState;
|
||||
Bundle bundle2 = bundle != null ? bundle.getBundle(key) : null;
|
||||
Bundle bundle3 = this.restoredState;
|
||||
if (bundle3 != null) {
|
||||
bundle3.remove(key);
|
||||
}
|
||||
Bundle bundle4 = this.restoredState;
|
||||
if (bundle4 != null && bundle4.isEmpty()) {
|
||||
this.restoredState = null;
|
||||
}
|
||||
return bundle2;
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import kotlin.Metadata;
|
||||
|
||||
/* compiled from: SavedStateHandleSupport.kt */
|
||||
@Metadata(d1 = {"\u0000\u001c\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010%\n\u0002\u0010\u000e\n\u0002\u0018\u0002\n\u0002\b\u0003\b\u0000\u0018\u00002\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0002R\u001d\u0010\u0003\u001a\u000e\u0012\u0004\u0012\u00020\u0005\u0012\u0004\u0012\u00020\u00060\u0004¢\u0006\b\n\u0000\u001a\u0004\b\u0007\u0010\b¨\u0006\t"}, d2 = {"Landroidx/lifecycle/SavedStateHandlesVM;", "Landroidx/lifecycle/ViewModel;", "()V", "handles", "", "", "Landroidx/lifecycle/SavedStateHandle;", "getHandles", "()Ljava/util/Map;", "lifecycle-viewmodel-savedstate_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class SavedStateHandlesVM extends ViewModel {
|
||||
private final Map<String, SavedStateHandle> handles = new LinkedHashMap();
|
||||
|
||||
public final Map<String, SavedStateHandle> getHandles() {
|
||||
return this.handles;
|
||||
}
|
||||
}
|
@ -0,0 +1,141 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import android.app.Application;
|
||||
import android.os.Bundle;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.lifecycle.viewmodel.CreationExtras;
|
||||
import androidx.savedstate.SavedStateRegistry;
|
||||
import androidx.savedstate.SavedStateRegistryOwner;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.util.List;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: SavedStateViewModelFactory.kt */
|
||||
@Metadata(d1 = {"\u0000Z\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002\u0018\u00002\u00020\u00012\u00020\u0002B\u0007\b\u0016¢\u0006\u0002\u0010\u0003B\u0019\b\u0016\u0012\b\u0010\u0004\u001a\u0004\u0018\u00010\u0005\u0012\u0006\u0010\u0006\u001a\u00020\u0007¢\u0006\u0002\u0010\bB#\b\u0017\u0012\b\u0010\u0004\u001a\u0004\u0018\u00010\u0005\u0012\u0006\u0010\u0006\u001a\u00020\u0007\u0012\b\u0010\t\u001a\u0004\u0018\u00010\n¢\u0006\u0002\u0010\u000bJ%\u0010\u0011\u001a\u0002H\u0012\"\b\b\u0000\u0010\u0012*\u00020\u00132\f\u0010\u0014\u001a\b\u0012\u0004\u0012\u0002H\u00120\u0015H\u0016¢\u0006\u0002\u0010\u0016J-\u0010\u0011\u001a\u0002H\u0012\"\b\b\u0000\u0010\u0012*\u00020\u00132\f\u0010\u0014\u001a\b\u0012\u0004\u0012\u0002H\u00120\u00152\u0006\u0010\u0017\u001a\u00020\u0018H\u0016¢\u0006\u0002\u0010\u0019J+\u0010\u0011\u001a\u0002H\u0012\"\b\b\u0000\u0010\u0012*\u00020\u00132\u0006\u0010\u001a\u001a\u00020\u001b2\f\u0010\u0014\u001a\b\u0012\u0004\u0012\u0002H\u00120\u0015¢\u0006\u0002\u0010\u001cJ\u0010\u0010\u001d\u001a\u00020\u001e2\u0006\u0010\u001f\u001a\u00020\u0013H\u0017R\u0010\u0010\u0004\u001a\u0004\u0018\u00010\u0005X\u0082\u000e¢\u0006\u0002\n\u0000R\u0010\u0010\t\u001a\u0004\u0018\u00010\nX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\f\u001a\u00020\u0002X\u0082\u0004¢\u0006\u0002\n\u0000R\u0010\u0010\r\u001a\u0004\u0018\u00010\u000eX\u0082\u000e¢\u0006\u0002\n\u0000R\u0010\u0010\u000f\u001a\u0004\u0018\u00010\u0010X\u0082\u000e¢\u0006\u0002\n\u0000¨\u0006 "}, d2 = {"Landroidx/lifecycle/SavedStateViewModelFactory;", "Landroidx/lifecycle/ViewModelProvider$OnRequeryFactory;", "Landroidx/lifecycle/ViewModelProvider$Factory;", "()V", "application", "Landroid/app/Application;", "owner", "Landroidx/savedstate/SavedStateRegistryOwner;", "(Landroid/app/Application;Landroidx/savedstate/SavedStateRegistryOwner;)V", "defaultArgs", "Landroid/os/Bundle;", "(Landroid/app/Application;Landroidx/savedstate/SavedStateRegistryOwner;Landroid/os/Bundle;)V", "factory", "lifecycle", "Landroidx/lifecycle/Lifecycle;", "savedStateRegistry", "Landroidx/savedstate/SavedStateRegistry;", "create", "T", "Landroidx/lifecycle/ViewModel;", "modelClass", "Ljava/lang/Class;", "(Ljava/lang/Class;)Landroidx/lifecycle/ViewModel;", "extras", "Landroidx/lifecycle/viewmodel/CreationExtras;", "(Ljava/lang/Class;Landroidx/lifecycle/viewmodel/CreationExtras;)Landroidx/lifecycle/ViewModel;", "key", "", "(Ljava/lang/String;Ljava/lang/Class;)Landroidx/lifecycle/ViewModel;", "onRequery", "", "viewModel", "lifecycle-viewmodel-savedstate_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class SavedStateViewModelFactory extends ViewModelProvider.OnRequeryFactory implements ViewModelProvider.Factory {
|
||||
private Application application;
|
||||
private Bundle defaultArgs;
|
||||
private final ViewModelProvider.Factory factory;
|
||||
private Lifecycle lifecycle;
|
||||
private SavedStateRegistry savedStateRegistry;
|
||||
|
||||
public SavedStateViewModelFactory() {
|
||||
this.factory = new ViewModelProvider.AndroidViewModelFactory();
|
||||
}
|
||||
|
||||
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
|
||||
public SavedStateViewModelFactory(Application application, SavedStateRegistryOwner owner) {
|
||||
this(application, owner, null);
|
||||
Intrinsics.checkNotNullParameter(owner, "owner");
|
||||
}
|
||||
|
||||
public SavedStateViewModelFactory(Application application, SavedStateRegistryOwner owner, Bundle bundle) {
|
||||
ViewModelProvider.AndroidViewModelFactory androidViewModelFactory;
|
||||
Intrinsics.checkNotNullParameter(owner, "owner");
|
||||
this.savedStateRegistry = owner.getSavedStateRegistry();
|
||||
this.lifecycle = owner.getLifecycle();
|
||||
this.defaultArgs = bundle;
|
||||
this.application = application;
|
||||
if (application != null) {
|
||||
androidViewModelFactory = ViewModelProvider.AndroidViewModelFactory.INSTANCE.getInstance(application);
|
||||
} else {
|
||||
androidViewModelFactory = new ViewModelProvider.AndroidViewModelFactory();
|
||||
}
|
||||
this.factory = androidViewModelFactory;
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.ViewModelProvider.Factory
|
||||
public <T extends ViewModel> T create(Class<T> modelClass, CreationExtras extras) {
|
||||
List list;
|
||||
Constructor findMatchingConstructor;
|
||||
List list2;
|
||||
Intrinsics.checkNotNullParameter(modelClass, "modelClass");
|
||||
Intrinsics.checkNotNullParameter(extras, "extras");
|
||||
String str = (String) extras.get(ViewModelProvider.NewInstanceFactory.VIEW_MODEL_KEY);
|
||||
if (str == null) {
|
||||
throw new IllegalStateException("VIEW_MODEL_KEY must always be provided by ViewModelProvider");
|
||||
}
|
||||
if (extras.get(SavedStateHandleSupport.SAVED_STATE_REGISTRY_OWNER_KEY) == null || extras.get(SavedStateHandleSupport.VIEW_MODEL_STORE_OWNER_KEY) == null) {
|
||||
if (this.lifecycle != null) {
|
||||
return (T) create(str, modelClass);
|
||||
}
|
||||
throw new IllegalStateException("SAVED_STATE_REGISTRY_OWNER_KEY andVIEW_MODEL_STORE_OWNER_KEY must be provided in the creation extras tosuccessfully create a ViewModel.");
|
||||
}
|
||||
Application application = (Application) extras.get(ViewModelProvider.AndroidViewModelFactory.APPLICATION_KEY);
|
||||
boolean isAssignableFrom = AndroidViewModel.class.isAssignableFrom(modelClass);
|
||||
if (isAssignableFrom && application != null) {
|
||||
list2 = SavedStateViewModelFactoryKt.ANDROID_VIEWMODEL_SIGNATURE;
|
||||
findMatchingConstructor = SavedStateViewModelFactoryKt.findMatchingConstructor(modelClass, list2);
|
||||
} else {
|
||||
list = SavedStateViewModelFactoryKt.VIEWMODEL_SIGNATURE;
|
||||
findMatchingConstructor = SavedStateViewModelFactoryKt.findMatchingConstructor(modelClass, list);
|
||||
}
|
||||
if (findMatchingConstructor == null) {
|
||||
return (T) this.factory.create(modelClass, extras);
|
||||
}
|
||||
return (!isAssignableFrom || application == null) ? (T) SavedStateViewModelFactoryKt.newInstance(modelClass, findMatchingConstructor, SavedStateHandleSupport.createSavedStateHandle(extras)) : (T) SavedStateViewModelFactoryKt.newInstance(modelClass, findMatchingConstructor, application, SavedStateHandleSupport.createSavedStateHandle(extras));
|
||||
}
|
||||
|
||||
public final <T extends ViewModel> T create(String key, Class<T> modelClass) {
|
||||
List list;
|
||||
Constructor findMatchingConstructor;
|
||||
T t;
|
||||
Application application;
|
||||
List list2;
|
||||
Intrinsics.checkNotNullParameter(key, "key");
|
||||
Intrinsics.checkNotNullParameter(modelClass, "modelClass");
|
||||
Lifecycle lifecycle = this.lifecycle;
|
||||
if (lifecycle == null) {
|
||||
throw new UnsupportedOperationException("SavedStateViewModelFactory constructed with empty constructor supports only calls to create(modelClass: Class<T>, extras: CreationExtras).");
|
||||
}
|
||||
boolean isAssignableFrom = AndroidViewModel.class.isAssignableFrom(modelClass);
|
||||
if (isAssignableFrom && this.application != null) {
|
||||
list2 = SavedStateViewModelFactoryKt.ANDROID_VIEWMODEL_SIGNATURE;
|
||||
findMatchingConstructor = SavedStateViewModelFactoryKt.findMatchingConstructor(modelClass, list2);
|
||||
} else {
|
||||
list = SavedStateViewModelFactoryKt.VIEWMODEL_SIGNATURE;
|
||||
findMatchingConstructor = SavedStateViewModelFactoryKt.findMatchingConstructor(modelClass, list);
|
||||
}
|
||||
if (findMatchingConstructor == null) {
|
||||
if (this.application != null) {
|
||||
return (T) this.factory.create(modelClass);
|
||||
}
|
||||
return (T) ViewModelProvider.NewInstanceFactory.INSTANCE.getInstance().create(modelClass);
|
||||
}
|
||||
SavedStateRegistry savedStateRegistry = this.savedStateRegistry;
|
||||
Intrinsics.checkNotNull(savedStateRegistry);
|
||||
SavedStateHandleController create = LegacySavedStateHandleController.create(savedStateRegistry, lifecycle, key, this.defaultArgs);
|
||||
if (!isAssignableFrom || (application = this.application) == null) {
|
||||
t = (T) SavedStateViewModelFactoryKt.newInstance(modelClass, findMatchingConstructor, create.getHandle());
|
||||
} else {
|
||||
Intrinsics.checkNotNull(application);
|
||||
t = (T) SavedStateViewModelFactoryKt.newInstance(modelClass, findMatchingConstructor, application, create.getHandle());
|
||||
}
|
||||
t.setTagIfAbsent("androidx.lifecycle.savedstate.vm.tag", create);
|
||||
return t;
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.ViewModelProvider.Factory
|
||||
public <T extends ViewModel> T create(Class<T> modelClass) {
|
||||
Intrinsics.checkNotNullParameter(modelClass, "modelClass");
|
||||
String canonicalName = modelClass.getCanonicalName();
|
||||
if (canonicalName == null) {
|
||||
throw new IllegalArgumentException("Local and anonymous classes can not be ViewModels");
|
||||
}
|
||||
return (T) create(canonicalName, modelClass);
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.ViewModelProvider.OnRequeryFactory
|
||||
public void onRequery(ViewModel viewModel) {
|
||||
Intrinsics.checkNotNullParameter(viewModel, "viewModel");
|
||||
if (this.lifecycle != null) {
|
||||
SavedStateRegistry savedStateRegistry = this.savedStateRegistry;
|
||||
Intrinsics.checkNotNull(savedStateRegistry);
|
||||
Lifecycle lifecycle = this.lifecycle;
|
||||
Intrinsics.checkNotNull(lifecycle);
|
||||
LegacySavedStateHandleController.attachHandleIfNeeded(viewModel, savedStateRegistry, lifecycle);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import android.app.Application;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.collections.ArraysKt;
|
||||
import kotlin.collections.CollectionsKt;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: SavedStateViewModelFactory.kt */
|
||||
@Metadata(d1 = {"\u0000*\n\u0000\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0011\n\u0002\u0010\u0000\n\u0002\b\u0002\u001a6\u0010\u0004\u001a\n\u0012\u0004\u0012\u0002H\u0006\u0018\u00010\u0005\"\u0004\b\u0000\u0010\u00062\f\u0010\u0007\u001a\b\u0012\u0004\u0012\u0002H\u00060\u00022\u0010\u0010\b\u001a\f\u0012\b\u0012\u0006\u0012\u0002\b\u00030\u00020\u0001H\u0000\u001aI\u0010\t\u001a\u0002H\u0006\"\n\b\u0000\u0010\u0006*\u0004\u0018\u00010\n2\f\u0010\u0007\u001a\b\u0012\u0004\u0012\u0002H\u00060\u00022\f\u0010\u000b\u001a\b\u0012\u0004\u0012\u0002H\u00060\u00052\u0012\u0010\f\u001a\n\u0012\u0006\b\u0001\u0012\u00020\u000e0\r\"\u00020\u000eH\u0000¢\u0006\u0002\u0010\u000f\"\u0018\u0010\u0000\u001a\f\u0012\b\u0012\u0006\u0012\u0002\b\u00030\u00020\u0001X\u0082\u0004¢\u0006\u0002\n\u0000\"\u0018\u0010\u0003\u001a\f\u0012\b\u0012\u0006\u0012\u0002\b\u00030\u00020\u0001X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u0010"}, d2 = {"ANDROID_VIEWMODEL_SIGNATURE", "", "Ljava/lang/Class;", "VIEWMODEL_SIGNATURE", "findMatchingConstructor", "Ljava/lang/reflect/Constructor;", "T", "modelClass", "signature", "newInstance", "Landroidx/lifecycle/ViewModel;", "constructor", "params", "", "", "(Ljava/lang/Class;Ljava/lang/reflect/Constructor;[Ljava/lang/Object;)Landroidx/lifecycle/ViewModel;", "lifecycle-viewmodel-savedstate_release"}, k = 2, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class SavedStateViewModelFactoryKt {
|
||||
private static final List<Class<?>> ANDROID_VIEWMODEL_SIGNATURE = CollectionsKt.listOf((Object[]) new Class[]{Application.class, SavedStateHandle.class});
|
||||
private static final List<Class<?>> VIEWMODEL_SIGNATURE = CollectionsKt.listOf(SavedStateHandle.class);
|
||||
|
||||
public static final <T extends ViewModel> T newInstance(Class<T> modelClass, Constructor<T> constructor, Object... params) {
|
||||
Intrinsics.checkNotNullParameter(modelClass, "modelClass");
|
||||
Intrinsics.checkNotNullParameter(constructor, "constructor");
|
||||
Intrinsics.checkNotNullParameter(params, "params");
|
||||
try {
|
||||
return constructor.newInstance(Arrays.copyOf(params, params.length));
|
||||
} catch (IllegalAccessException e) {
|
||||
throw new RuntimeException("Failed to access " + modelClass, e);
|
||||
} catch (InstantiationException e2) {
|
||||
throw new RuntimeException("A " + modelClass + " cannot be instantiated.", e2);
|
||||
} catch (InvocationTargetException e3) {
|
||||
throw new RuntimeException("An exception happened in constructor of " + modelClass, e3.getCause());
|
||||
}
|
||||
}
|
||||
|
||||
public static final <T> Constructor<T> findMatchingConstructor(Class<T> modelClass, List<? extends Class<?>> signature) {
|
||||
Intrinsics.checkNotNullParameter(modelClass, "modelClass");
|
||||
Intrinsics.checkNotNullParameter(signature, "signature");
|
||||
Object[] constructors = modelClass.getConstructors();
|
||||
Intrinsics.checkNotNullExpressionValue(constructors, "modelClass.constructors");
|
||||
for (Object obj : constructors) {
|
||||
Constructor<T> constructor = (Constructor<T>) obj;
|
||||
Class<?>[] parameterTypes = constructor.getParameterTypes();
|
||||
Intrinsics.checkNotNullExpressionValue(parameterTypes, "constructor.parameterTypes");
|
||||
List list = ArraysKt.toList(parameterTypes);
|
||||
if (Intrinsics.areEqual(signature, list)) {
|
||||
Intrinsics.checkNotNull(constructor, "null cannot be cast to non-null type java.lang.reflect.Constructor<T of androidx.lifecycle.SavedStateViewModelFactoryKt.findMatchingConstructor>");
|
||||
return constructor;
|
||||
}
|
||||
if (signature.size() == list.size() && list.containsAll(signature)) {
|
||||
throw new UnsupportedOperationException("Class " + modelClass.getSimpleName() + " must have parameters in the proper order: " + signature);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import androidx.core.app.NotificationCompat;
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: SingleGeneratedAdapterObserver.kt */
|
||||
@Metadata(d1 = {"\u0000$\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\b\u0000\u0018\u00002\u00020\u0001B\r\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0002\u0010\u0004J\u0018\u0010\u0005\u001a\u00020\u00062\u0006\u0010\u0007\u001a\u00020\b2\u0006\u0010\t\u001a\u00020\nH\u0016R\u000e\u0010\u0002\u001a\u00020\u0003X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u000b"}, d2 = {"Landroidx/lifecycle/SingleGeneratedAdapterObserver;", "Landroidx/lifecycle/LifecycleEventObserver;", "generatedAdapter", "Landroidx/lifecycle/GeneratedAdapter;", "(Landroidx/lifecycle/GeneratedAdapter;)V", "onStateChanged", "", "source", "Landroidx/lifecycle/LifecycleOwner;", NotificationCompat.CATEGORY_EVENT, "Landroidx/lifecycle/Lifecycle$Event;", "lifecycle-common"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class SingleGeneratedAdapterObserver implements LifecycleEventObserver {
|
||||
private final GeneratedAdapter generatedAdapter;
|
||||
|
||||
public SingleGeneratedAdapterObserver(GeneratedAdapter generatedAdapter) {
|
||||
Intrinsics.checkNotNullParameter(generatedAdapter, "generatedAdapter");
|
||||
this.generatedAdapter = generatedAdapter;
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.LifecycleEventObserver
|
||||
public void onStateChanged(LifecycleOwner source, Lifecycle.Event event) {
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
Intrinsics.checkNotNullParameter(event, "event");
|
||||
this.generatedAdapter.callMethods(source, event, false, null);
|
||||
this.generatedAdapter.callMethods(source, event, true, null);
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import kotlin.Function;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.internal.FunctionAdapter;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: Transformations.kt */
|
||||
@Metadata(k = 3, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
final class Transformations$sam$androidx_lifecycle_Observer$0 implements Observer, FunctionAdapter {
|
||||
private final /* synthetic */ Function1 function;
|
||||
|
||||
Transformations$sam$androidx_lifecycle_Observer$0(Function1 function) {
|
||||
Intrinsics.checkNotNullParameter(function, "function");
|
||||
this.function = function;
|
||||
}
|
||||
|
||||
public final boolean equals(Object obj) {
|
||||
if ((obj instanceof Observer) && (obj instanceof FunctionAdapter)) {
|
||||
return Intrinsics.areEqual(getFunctionDelegate(), ((FunctionAdapter) obj).getFunctionDelegate());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // kotlin.jvm.internal.FunctionAdapter
|
||||
public final Function<?> getFunctionDelegate() {
|
||||
return this.function;
|
||||
}
|
||||
|
||||
public final int hashCode() {
|
||||
return getFunctionDelegate().hashCode();
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.Observer
|
||||
public final /* synthetic */ void onChanged(Object obj) {
|
||||
this.function.invoke(obj);
|
||||
}
|
||||
}
|
226
02-Easy5/E5/sources/androidx/lifecycle/Transformations.java
Normal file
226
02-Easy5/E5/sources/androidx/lifecycle/Transformations.java
Normal file
@ -0,0 +1,226 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import androidx.arch.core.util.Function;
|
||||
import kotlin.Deprecated;
|
||||
import kotlin.DeprecationLevel;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.Unit;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import kotlin.jvm.internal.Ref;
|
||||
|
||||
/* compiled from: Transformations.kt */
|
||||
@Metadata(d1 = {"\u0000\u001c\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\u001a\u001e\u0010\u0000\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0001\"\u0004\b\u0000\u0010\u0002*\b\u0012\u0004\u0012\u0002H\u00020\u0001H\u0007\u001aB\u0010\u0003\u001a\b\u0012\u0004\u0012\u0002H\u00040\u0001\"\u0004\b\u0000\u0010\u0002\"\u0004\b\u0001\u0010\u0004*\b\u0012\u0004\u0012\u0002H\u00020\u00012\u001c\u0010\u0005\u001a\u0018\u0012\t\u0012\u0007H\u0002¢\u0006\u0002\b\u0007\u0012\t\u0012\u0007H\u0004¢\u0006\u0002\b\u00070\u0006H\u0007\u001a8\u0010\u0003\u001a\b\u0012\u0004\u0012\u0002H\u00040\u0001\"\u0004\b\u0000\u0010\u0002\"\u0004\b\u0001\u0010\u0004*\b\u0012\u0004\u0012\u0002H\u00020\u00012\u0012\u0010\b\u001a\u000e\u0012\u0004\u0012\u0002H\u0002\u0012\u0004\u0012\u0002H\u00040\tH\u0007\u001aJ\u0010\n\u001a\b\u0012\u0004\u0012\u0002H\u00040\u0001\"\u0004\b\u0000\u0010\u0002\"\u0004\b\u0001\u0010\u0004*\b\u0012\u0004\u0012\u0002H\u00020\u00012$\u0010\u0005\u001a \u0012\t\u0012\u0007H\u0002¢\u0006\u0002\b\u0007\u0012\u0011\u0012\u000f\u0012\u0004\u0012\u0002H\u0004\u0018\u00010\u0001¢\u0006\u0002\b\u00070\u0006H\u0007\u001a>\u0010\n\u001a\b\u0012\u0004\u0012\u0002H\u00040\u0001\"\u0004\b\u0000\u0010\u0002\"\u0004\b\u0001\u0010\u0004*\b\u0012\u0004\u0012\u0002H\u00020\u00012\u0018\u0010\u000b\u001a\u0014\u0012\u0004\u0012\u0002H\u0002\u0012\n\u0012\b\u0012\u0004\u0012\u0002H\u00040\u00010\tH\u0007¨\u0006\f"}, d2 = {"distinctUntilChanged", "Landroidx/lifecycle/LiveData;", "X", "map", "Y", "transform", "Lkotlin/Function1;", "Lkotlin/jvm/JvmSuppressWildcards;", "mapFunction", "Landroidx/arch/core/util/Function;", "switchMap", "switchMapFunction", "lifecycle-livedata_release"}, k = 2, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class Transformations {
|
||||
public static final <X, Y> LiveData<Y> map(LiveData<X> liveData, final Function1<X, Y> transform) {
|
||||
Intrinsics.checkNotNullParameter(liveData, "<this>");
|
||||
Intrinsics.checkNotNullParameter(transform, "transform");
|
||||
final MediatorLiveData mediatorLiveData = new MediatorLiveData();
|
||||
if (liveData.isInitialized()) {
|
||||
mediatorLiveData.setValue(transform.invoke(liveData.getValue()));
|
||||
}
|
||||
mediatorLiveData.addSource(liveData, new Transformations$sam$androidx_lifecycle_Observer$0(new Function1<X, Unit>() { // from class: androidx.lifecycle.Transformations$map$1
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
{
|
||||
super(1);
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // kotlin.jvm.functions.Function1
|
||||
public /* bridge */ /* synthetic */ Unit invoke(Object obj) {
|
||||
invoke2((Transformations$map$1<X>) obj);
|
||||
return Unit.INSTANCE;
|
||||
}
|
||||
|
||||
/* renamed from: invoke, reason: avoid collision after fix types in other method */
|
||||
public final void invoke2(X x) {
|
||||
mediatorLiveData.setValue(transform.invoke(x));
|
||||
}
|
||||
}));
|
||||
return mediatorLiveData;
|
||||
}
|
||||
|
||||
@Deprecated(level = DeprecationLevel.HIDDEN, message = "Use kotlin functions, instead of outdated arch core Functions")
|
||||
public static final /* synthetic */ LiveData map(LiveData liveData, final Function mapFunction) {
|
||||
Intrinsics.checkNotNullParameter(liveData, "<this>");
|
||||
Intrinsics.checkNotNullParameter(mapFunction, "mapFunction");
|
||||
final MediatorLiveData mediatorLiveData = new MediatorLiveData();
|
||||
mediatorLiveData.addSource(liveData, new Transformations$sam$androidx_lifecycle_Observer$0(new Function1<X, Unit>() { // from class: androidx.lifecycle.Transformations$map$2
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
{
|
||||
super(1);
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // kotlin.jvm.functions.Function1
|
||||
public /* bridge */ /* synthetic */ Unit invoke(Object obj) {
|
||||
invoke2((Transformations$map$2<X>) obj);
|
||||
return Unit.INSTANCE;
|
||||
}
|
||||
|
||||
/* renamed from: invoke, reason: avoid collision after fix types in other method */
|
||||
public final void invoke2(X x) {
|
||||
mediatorLiveData.setValue(mapFunction.apply(x));
|
||||
}
|
||||
}));
|
||||
return mediatorLiveData;
|
||||
}
|
||||
|
||||
public static final <X, Y> LiveData<Y> switchMap(LiveData<X> liveData, final Function1<X, LiveData<Y>> transform) {
|
||||
LiveData<Y> invoke;
|
||||
Intrinsics.checkNotNullParameter(liveData, "<this>");
|
||||
Intrinsics.checkNotNullParameter(transform, "transform");
|
||||
final MediatorLiveData mediatorLiveData = new MediatorLiveData();
|
||||
final Ref.ObjectRef objectRef = new Ref.ObjectRef();
|
||||
if (liveData.isInitialized() && (invoke = transform.invoke(liveData.getValue())) != null && invoke.isInitialized()) {
|
||||
mediatorLiveData.setValue(invoke.getValue());
|
||||
}
|
||||
mediatorLiveData.addSource(liveData, new Transformations$sam$androidx_lifecycle_Observer$0(new Function1<X, Unit>() { // from class: androidx.lifecycle.Transformations$switchMap$1
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
{
|
||||
super(1);
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // kotlin.jvm.functions.Function1
|
||||
public /* bridge */ /* synthetic */ Unit invoke(Object obj) {
|
||||
invoke2((Transformations$switchMap$1<X>) obj);
|
||||
return Unit.INSTANCE;
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
/* JADX WARN: Type inference failed for: r4v2, types: [T, androidx.lifecycle.LiveData] */
|
||||
/* renamed from: invoke, reason: avoid collision after fix types in other method */
|
||||
public final void invoke2(X x) {
|
||||
?? r4 = (LiveData) transform.invoke(x);
|
||||
if (objectRef.element != r4) {
|
||||
if (objectRef.element != 0) {
|
||||
MediatorLiveData<Y> mediatorLiveData2 = mediatorLiveData;
|
||||
T t = objectRef.element;
|
||||
Intrinsics.checkNotNull(t);
|
||||
mediatorLiveData2.removeSource((LiveData) t);
|
||||
}
|
||||
objectRef.element = r4;
|
||||
if (objectRef.element != 0) {
|
||||
MediatorLiveData<Y> mediatorLiveData3 = mediatorLiveData;
|
||||
T t2 = objectRef.element;
|
||||
Intrinsics.checkNotNull(t2);
|
||||
final MediatorLiveData<Y> mediatorLiveData4 = mediatorLiveData;
|
||||
mediatorLiveData3.addSource((LiveData) t2, new Transformations$sam$androidx_lifecycle_Observer$0(new Function1<Y, Unit>() { // from class: androidx.lifecycle.Transformations$switchMap$1.1
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
{
|
||||
super(1);
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // kotlin.jvm.functions.Function1
|
||||
public /* bridge */ /* synthetic */ Unit invoke(Object obj) {
|
||||
invoke2((AnonymousClass1<Y>) obj);
|
||||
return Unit.INSTANCE;
|
||||
}
|
||||
|
||||
/* renamed from: invoke, reason: avoid collision after fix types in other method */
|
||||
public final void invoke2(Y y) {
|
||||
mediatorLiveData4.setValue(y);
|
||||
}
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
}));
|
||||
return mediatorLiveData;
|
||||
}
|
||||
|
||||
@Deprecated(level = DeprecationLevel.HIDDEN, message = "Use kotlin functions, instead of outdated arch core Functions")
|
||||
public static final /* synthetic */ LiveData switchMap(LiveData liveData, final Function switchMapFunction) {
|
||||
Intrinsics.checkNotNullParameter(liveData, "<this>");
|
||||
Intrinsics.checkNotNullParameter(switchMapFunction, "switchMapFunction");
|
||||
final MediatorLiveData mediatorLiveData = new MediatorLiveData();
|
||||
mediatorLiveData.addSource(liveData, new Observer<X>() { // from class: androidx.lifecycle.Transformations$switchMap$2
|
||||
private LiveData<Y> liveData;
|
||||
|
||||
public final LiveData<Y> getLiveData() {
|
||||
return this.liveData;
|
||||
}
|
||||
|
||||
public final void setLiveData(LiveData<Y> liveData2) {
|
||||
this.liveData = liveData2;
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // androidx.lifecycle.Observer
|
||||
public void onChanged(X value) {
|
||||
LiveData<Y> liveData2 = (LiveData) switchMapFunction.apply(value);
|
||||
Object obj = this.liveData;
|
||||
if (obj == liveData2) {
|
||||
return;
|
||||
}
|
||||
if (obj != null) {
|
||||
MediatorLiveData<Y> mediatorLiveData2 = mediatorLiveData;
|
||||
Intrinsics.checkNotNull(obj);
|
||||
mediatorLiveData2.removeSource(obj);
|
||||
}
|
||||
this.liveData = liveData2;
|
||||
if (liveData2 != 0) {
|
||||
MediatorLiveData<Y> mediatorLiveData3 = mediatorLiveData;
|
||||
Intrinsics.checkNotNull(liveData2);
|
||||
final MediatorLiveData<Y> mediatorLiveData4 = mediatorLiveData;
|
||||
mediatorLiveData3.addSource(liveData2, new Transformations$sam$androidx_lifecycle_Observer$0(new Function1<Y, Unit>() { // from class: androidx.lifecycle.Transformations$switchMap$2$onChanged$1
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
{
|
||||
super(1);
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // kotlin.jvm.functions.Function1
|
||||
public /* bridge */ /* synthetic */ Unit invoke(Object obj2) {
|
||||
invoke2((Transformations$switchMap$2$onChanged$1<Y>) obj2);
|
||||
return Unit.INSTANCE;
|
||||
}
|
||||
|
||||
/* renamed from: invoke, reason: avoid collision after fix types in other method */
|
||||
public final void invoke2(Y y) {
|
||||
mediatorLiveData4.setValue(y);
|
||||
}
|
||||
}));
|
||||
}
|
||||
}
|
||||
});
|
||||
return mediatorLiveData;
|
||||
}
|
||||
|
||||
public static final <X> LiveData<X> distinctUntilChanged(LiveData<X> liveData) {
|
||||
Intrinsics.checkNotNullParameter(liveData, "<this>");
|
||||
final MediatorLiveData mediatorLiveData = new MediatorLiveData();
|
||||
final Ref.BooleanRef booleanRef = new Ref.BooleanRef();
|
||||
booleanRef.element = true;
|
||||
if (liveData.isInitialized()) {
|
||||
mediatorLiveData.setValue(liveData.getValue());
|
||||
booleanRef.element = false;
|
||||
}
|
||||
mediatorLiveData.addSource(liveData, new Transformations$sam$androidx_lifecycle_Observer$0(new Function1<X, Unit>() { // from class: androidx.lifecycle.Transformations$distinctUntilChanged$1
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
{
|
||||
super(1);
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
@Override // kotlin.jvm.functions.Function1
|
||||
public /* bridge */ /* synthetic */ Unit invoke(Object obj) {
|
||||
invoke2((Transformations$distinctUntilChanged$1<X>) obj);
|
||||
return Unit.INSTANCE;
|
||||
}
|
||||
|
||||
/* renamed from: invoke, reason: avoid collision after fix types in other method */
|
||||
public final void invoke2(X x) {
|
||||
X value = mediatorLiveData.getValue();
|
||||
if (booleanRef.element || ((value == null && x != null) || !(value == null || Intrinsics.areEqual(value, x)))) {
|
||||
booleanRef.element = false;
|
||||
mediatorLiveData.setValue(x);
|
||||
}
|
||||
}
|
||||
}));
|
||||
return mediatorLiveData;
|
||||
}
|
||||
}
|
111
02-Easy5/E5/sources/androidx/lifecycle/ViewModel.java
Normal file
111
02-Easy5/E5/sources/androidx/lifecycle/ViewModel.java
Normal file
@ -0,0 +1,111 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class ViewModel {
|
||||
private final Map<String, Object> mBagOfTags;
|
||||
private volatile boolean mCleared;
|
||||
private final Set<Closeable> mCloseables;
|
||||
|
||||
protected void onCleared() {
|
||||
}
|
||||
|
||||
public ViewModel() {
|
||||
this.mBagOfTags = new HashMap();
|
||||
this.mCloseables = new LinkedHashSet();
|
||||
this.mCleared = false;
|
||||
}
|
||||
|
||||
public ViewModel(Closeable... closeableArr) {
|
||||
this.mBagOfTags = new HashMap();
|
||||
LinkedHashSet linkedHashSet = new LinkedHashSet();
|
||||
this.mCloseables = linkedHashSet;
|
||||
this.mCleared = false;
|
||||
linkedHashSet.addAll(Arrays.asList(closeableArr));
|
||||
}
|
||||
|
||||
public void addCloseable(Closeable closeable) {
|
||||
if (this.mCleared) {
|
||||
closeWithRuntimeException(closeable);
|
||||
return;
|
||||
}
|
||||
Set<Closeable> set = this.mCloseables;
|
||||
if (set != null) {
|
||||
synchronized (set) {
|
||||
this.mCloseables.add(closeable);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
final void clear() {
|
||||
this.mCleared = true;
|
||||
Map<String, Object> map = this.mBagOfTags;
|
||||
if (map != null) {
|
||||
synchronized (map) {
|
||||
Iterator<Object> it = this.mBagOfTags.values().iterator();
|
||||
while (it.hasNext()) {
|
||||
closeWithRuntimeException(it.next());
|
||||
}
|
||||
}
|
||||
}
|
||||
Set<Closeable> set = this.mCloseables;
|
||||
if (set != null) {
|
||||
synchronized (set) {
|
||||
Iterator<Closeable> it2 = this.mCloseables.iterator();
|
||||
while (it2.hasNext()) {
|
||||
closeWithRuntimeException(it2.next());
|
||||
}
|
||||
}
|
||||
this.mCloseables.clear();
|
||||
}
|
||||
onCleared();
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
<T> T setTagIfAbsent(String str, T t) {
|
||||
Object obj;
|
||||
synchronized (this.mBagOfTags) {
|
||||
obj = this.mBagOfTags.get(str);
|
||||
if (obj == 0) {
|
||||
this.mBagOfTags.put(str, t);
|
||||
}
|
||||
}
|
||||
if (obj != 0) {
|
||||
t = obj;
|
||||
}
|
||||
if (this.mCleared) {
|
||||
closeWithRuntimeException(t);
|
||||
}
|
||||
return t;
|
||||
}
|
||||
|
||||
<T> T getTag(String str) {
|
||||
T t;
|
||||
Map<String, Object> map = this.mBagOfTags;
|
||||
if (map == null) {
|
||||
return null;
|
||||
}
|
||||
synchronized (map) {
|
||||
t = (T) this.mBagOfTags.get(str);
|
||||
}
|
||||
return t;
|
||||
}
|
||||
|
||||
private static void closeWithRuntimeException(Object obj) {
|
||||
if (obj instanceof Closeable) {
|
||||
try {
|
||||
((Closeable) obj).close();
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
19
02-Easy5/E5/sources/androidx/lifecycle/ViewModelKt.java
Normal file
19
02-Easy5/E5/sources/androidx/lifecycle/ViewModelKt.java
Normal file
@ -0,0 +1,19 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import kotlin.Metadata;
|
||||
import kotlinx.coroutines.CoroutineScope;
|
||||
import kotlinx.coroutines.Dispatchers;
|
||||
import kotlinx.coroutines.Job;
|
||||
import kotlinx.coroutines.SupervisorKt;
|
||||
|
||||
/* compiled from: ViewModel.kt */
|
||||
@Metadata(d1 = {"\u0000\u0014\n\u0000\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\"\u000e\u0010\u0000\u001a\u00020\u0001X\u0082T¢\u0006\u0002\n\u0000\"\u0015\u0010\u0002\u001a\u00020\u0003*\u00020\u00048F¢\u0006\u0006\u001a\u0004\b\u0005\u0010\u0006¨\u0006\u0007"}, d2 = {"JOB_KEY", "", "viewModelScope", "Lkotlinx/coroutines/CoroutineScope;", "Landroidx/lifecycle/ViewModel;", "getViewModelScope", "(Landroidx/lifecycle/ViewModel;)Lkotlinx/coroutines/CoroutineScope;", "lifecycle-viewmodel-ktx_release"}, k = 2, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class ViewModelKt {
|
||||
private static final String JOB_KEY = "androidx.lifecycle.ViewModelCoroutineScope.JOB_KEY";
|
||||
|
||||
public static final CoroutineScope getViewModelScope(ViewModel viewModel) {
|
||||
CoroutineScope coroutineScope = (CoroutineScope) viewModel.getTag(JOB_KEY);
|
||||
return coroutineScope != null ? coroutineScope : (CoroutineScope) viewModel.setTagIfAbsent(JOB_KEY, new CloseableCoroutineScope(SupervisorKt.SupervisorJob$default((Job) null, 1, (Object) null).plus(Dispatchers.getMain().getImmediate())));
|
||||
}
|
||||
}
|
69
02-Easy5/E5/sources/androidx/lifecycle/ViewModelLazy.java
Normal file
69
02-Easy5/E5/sources/androidx/lifecycle/ViewModelLazy.java
Normal file
@ -0,0 +1,69 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import androidx.lifecycle.ViewModel;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.lifecycle.viewmodel.CreationExtras;
|
||||
import kotlin.Lazy;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.JvmClassMappingKt;
|
||||
import kotlin.jvm.functions.Function0;
|
||||
import kotlin.jvm.internal.DefaultConstructorMarker;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import kotlin.reflect.KClass;
|
||||
|
||||
/* compiled from: ViewModelLazy.kt */
|
||||
@Metadata(d1 = {"\u00004\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0010\u000b\n\u0000\u0018\u0000*\b\b\u0000\u0010\u0001*\u00020\u00022\b\u0012\u0004\u0012\u0002H\u00010\u0003BA\b\u0007\u0012\f\u0010\u0004\u001a\b\u0012\u0004\u0012\u00028\u00000\u0005\u0012\f\u0010\u0006\u001a\b\u0012\u0004\u0012\u00020\b0\u0007\u0012\f\u0010\t\u001a\b\u0012\u0004\u0012\u00020\n0\u0007\u0012\u000e\b\u0002\u0010\u000b\u001a\b\u0012\u0004\u0012\u00020\f0\u0007¢\u0006\u0002\u0010\rJ\b\u0010\u0013\u001a\u00020\u0014H\u0016R\u0012\u0010\u000e\u001a\u0004\u0018\u00018\u0000X\u0082\u000e¢\u0006\u0004\n\u0002\u0010\u000fR\u0014\u0010\u000b\u001a\b\u0012\u0004\u0012\u00020\f0\u0007X\u0082\u0004¢\u0006\u0002\n\u0000R\u0014\u0010\t\u001a\b\u0012\u0004\u0012\u00020\n0\u0007X\u0082\u0004¢\u0006\u0002\n\u0000R\u0014\u0010\u0006\u001a\b\u0012\u0004\u0012\u00020\b0\u0007X\u0082\u0004¢\u0006\u0002\n\u0000R\u0014\u0010\u0010\u001a\u00028\u00008VX\u0096\u0004¢\u0006\u0006\u001a\u0004\b\u0011\u0010\u0012R\u0014\u0010\u0004\u001a\b\u0012\u0004\u0012\u00028\u00000\u0005X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u0015"}, d2 = {"Landroidx/lifecycle/ViewModelLazy;", "VM", "Landroidx/lifecycle/ViewModel;", "Lkotlin/Lazy;", "viewModelClass", "Lkotlin/reflect/KClass;", "storeProducer", "Lkotlin/Function0;", "Landroidx/lifecycle/ViewModelStore;", "factoryProducer", "Landroidx/lifecycle/ViewModelProvider$Factory;", "extrasProducer", "Landroidx/lifecycle/viewmodel/CreationExtras;", "(Lkotlin/reflect/KClass;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;)V", "cached", "Landroidx/lifecycle/ViewModel;", "value", "getValue", "()Landroidx/lifecycle/ViewModel;", "isInitialized", "", "lifecycle-viewmodel_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class ViewModelLazy<VM extends ViewModel> implements Lazy<VM> {
|
||||
private VM cached;
|
||||
private final Function0<CreationExtras> extrasProducer;
|
||||
private final Function0<ViewModelProvider.Factory> factoryProducer;
|
||||
private final Function0<ViewModelStore> storeProducer;
|
||||
private final KClass<VM> viewModelClass;
|
||||
|
||||
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
|
||||
public ViewModelLazy(KClass<VM> viewModelClass, Function0<? extends ViewModelStore> storeProducer, Function0<? extends ViewModelProvider.Factory> factoryProducer) {
|
||||
this(viewModelClass, storeProducer, factoryProducer, null, 8, null);
|
||||
Intrinsics.checkNotNullParameter(viewModelClass, "viewModelClass");
|
||||
Intrinsics.checkNotNullParameter(storeProducer, "storeProducer");
|
||||
Intrinsics.checkNotNullParameter(factoryProducer, "factoryProducer");
|
||||
}
|
||||
|
||||
@Override // kotlin.Lazy
|
||||
public boolean isInitialized() {
|
||||
return this.cached != null;
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public ViewModelLazy(KClass<VM> viewModelClass, Function0<? extends ViewModelStore> storeProducer, Function0<? extends ViewModelProvider.Factory> factoryProducer, Function0<? extends CreationExtras> extrasProducer) {
|
||||
Intrinsics.checkNotNullParameter(viewModelClass, "viewModelClass");
|
||||
Intrinsics.checkNotNullParameter(storeProducer, "storeProducer");
|
||||
Intrinsics.checkNotNullParameter(factoryProducer, "factoryProducer");
|
||||
Intrinsics.checkNotNullParameter(extrasProducer, "extrasProducer");
|
||||
this.viewModelClass = viewModelClass;
|
||||
this.storeProducer = storeProducer;
|
||||
this.factoryProducer = factoryProducer;
|
||||
this.extrasProducer = extrasProducer;
|
||||
}
|
||||
|
||||
public /* synthetic */ ViewModelLazy(KClass kClass, Function0 function0, Function0 function02, AnonymousClass1 anonymousClass1, int i, DefaultConstructorMarker defaultConstructorMarker) {
|
||||
this(kClass, function0, function02, (i & 8) != 0 ? new Function0<CreationExtras.Empty>() { // from class: androidx.lifecycle.ViewModelLazy.1
|
||||
/* JADX WARN: Can't rename method to resolve collision */
|
||||
@Override // kotlin.jvm.functions.Function0
|
||||
public final CreationExtras.Empty invoke() {
|
||||
return CreationExtras.Empty.INSTANCE;
|
||||
}
|
||||
} : anonymousClass1);
|
||||
}
|
||||
|
||||
@Override // kotlin.Lazy
|
||||
public VM getValue() {
|
||||
VM vm = this.cached;
|
||||
if (vm != null) {
|
||||
return vm;
|
||||
}
|
||||
VM vm2 = (VM) new ViewModelProvider(this.storeProducer.invoke(), this.factoryProducer.invoke(), this.extrasProducer.invoke()).get(JvmClassMappingKt.getJavaClass((KClass) this.viewModelClass));
|
||||
this.cached = vm2;
|
||||
return vm2;
|
||||
}
|
||||
}
|
331
02-Easy5/E5/sources/androidx/lifecycle/ViewModelProvider.java
Normal file
331
02-Easy5/E5/sources/androidx/lifecycle/ViewModelProvider.java
Normal file
@ -0,0 +1,331 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import android.app.Application;
|
||||
import androidx.constraintlayout.core.motion.utils.TypedValues;
|
||||
import androidx.lifecycle.viewmodel.CreationExtras;
|
||||
import androidx.lifecycle.viewmodel.InitializerViewModelFactory;
|
||||
import androidx.lifecycle.viewmodel.MutableCreationExtras;
|
||||
import androidx.lifecycle.viewmodel.ViewModelInitializer;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.Arrays;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.JvmStatic;
|
||||
import kotlin.jvm.internal.DefaultConstructorMarker;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: ViewModelProvider.kt */
|
||||
@Metadata(d1 = {"\u0000>\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0002\b\u0006\b\u0016\u0018\u00002\u00020\u0001:\u0004\u0016\u0017\u0018\u0019B\u000f\b\u0016\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0002\u0010\u0004B\u0017\b\u0016\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\u0006\u0010\u0005\u001a\u00020\u0006¢\u0006\u0002\u0010\u0007B!\b\u0007\u0012\u0006\u0010\b\u001a\u00020\t\u0012\u0006\u0010\u0005\u001a\u00020\u0006\u0012\b\b\u0002\u0010\n\u001a\u00020\u000b¢\u0006\u0002\u0010\fJ&\u0010\r\u001a\u0002H\u000e\"\b\b\u0000\u0010\u000e*\u00020\u000f2\f\u0010\u0010\u001a\b\u0012\u0004\u0012\u0002H\u000e0\u0011H\u0097\u0002¢\u0006\u0002\u0010\u0012J.\u0010\r\u001a\u0002H\u000e\"\b\b\u0000\u0010\u000e*\u00020\u000f2\u0006\u0010\u0013\u001a\u00020\u00142\f\u0010\u0010\u001a\b\u0012\u0004\u0012\u0002H\u000e0\u0011H\u0097\u0002¢\u0006\u0002\u0010\u0015R\u000e\u0010\n\u001a\u00020\u000bX\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0005\u001a\u00020\u0006X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\b\u001a\u00020\tX\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u001a"}, d2 = {"Landroidx/lifecycle/ViewModelProvider;", "", "owner", "Landroidx/lifecycle/ViewModelStoreOwner;", "(Landroidx/lifecycle/ViewModelStoreOwner;)V", "factory", "Landroidx/lifecycle/ViewModelProvider$Factory;", "(Landroidx/lifecycle/ViewModelStoreOwner;Landroidx/lifecycle/ViewModelProvider$Factory;)V", "store", "Landroidx/lifecycle/ViewModelStore;", "defaultCreationExtras", "Landroidx/lifecycle/viewmodel/CreationExtras;", "(Landroidx/lifecycle/ViewModelStore;Landroidx/lifecycle/ViewModelProvider$Factory;Landroidx/lifecycle/viewmodel/CreationExtras;)V", "get", "T", "Landroidx/lifecycle/ViewModel;", "modelClass", "Ljava/lang/Class;", "(Ljava/lang/Class;)Landroidx/lifecycle/ViewModel;", "key", "", "(Ljava/lang/String;Ljava/lang/Class;)Landroidx/lifecycle/ViewModel;", "AndroidViewModelFactory", "Factory", "NewInstanceFactory", "OnRequeryFactory", "lifecycle-viewmodel_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public class ViewModelProvider {
|
||||
private final CreationExtras defaultCreationExtras;
|
||||
private final Factory factory;
|
||||
private final ViewModelStore store;
|
||||
|
||||
/* compiled from: ViewModelProvider.kt */
|
||||
@Metadata(d1 = {"\u0000\u0018\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\b\u0017\u0018\u00002\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0002J\u0010\u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0006H\u0016¨\u0006\u0007"}, d2 = {"Landroidx/lifecycle/ViewModelProvider$OnRequeryFactory;", "", "()V", "onRequery", "", "viewModel", "Landroidx/lifecycle/ViewModel;", "lifecycle-viewmodel_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
public static class OnRequeryFactory {
|
||||
public void onRequery(ViewModel viewModel) {
|
||||
Intrinsics.checkNotNullParameter(viewModel, "viewModel");
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
|
||||
public ViewModelProvider(ViewModelStore store, Factory factory) {
|
||||
this(store, factory, null, 4, null);
|
||||
Intrinsics.checkNotNullParameter(store, "store");
|
||||
Intrinsics.checkNotNullParameter(factory, "factory");
|
||||
}
|
||||
|
||||
public ViewModelProvider(ViewModelStore store, Factory factory, CreationExtras defaultCreationExtras) {
|
||||
Intrinsics.checkNotNullParameter(store, "store");
|
||||
Intrinsics.checkNotNullParameter(factory, "factory");
|
||||
Intrinsics.checkNotNullParameter(defaultCreationExtras, "defaultCreationExtras");
|
||||
this.store = store;
|
||||
this.factory = factory;
|
||||
this.defaultCreationExtras = defaultCreationExtras;
|
||||
}
|
||||
|
||||
public /* synthetic */ ViewModelProvider(ViewModelStore viewModelStore, Factory factory, CreationExtras.Empty empty, int i, DefaultConstructorMarker defaultConstructorMarker) {
|
||||
this(viewModelStore, factory, (i & 4) != 0 ? CreationExtras.Empty.INSTANCE : empty);
|
||||
}
|
||||
|
||||
/* compiled from: ViewModelProvider.kt */
|
||||
@Metadata(d1 = {"\u0000\"\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\bf\u0018\u0000 \u000b2\u00020\u0001:\u0001\u000bJ%\u0010\u0002\u001a\u0002H\u0003\"\b\b\u0000\u0010\u0003*\u00020\u00042\f\u0010\u0005\u001a\b\u0012\u0004\u0012\u0002H\u00030\u0006H\u0016¢\u0006\u0002\u0010\u0007J-\u0010\u0002\u001a\u0002H\u0003\"\b\b\u0000\u0010\u0003*\u00020\u00042\f\u0010\u0005\u001a\b\u0012\u0004\u0012\u0002H\u00030\u00062\u0006\u0010\b\u001a\u00020\tH\u0016¢\u0006\u0002\u0010\nø\u0001\u0000\u0082\u0002\u0006\n\u0004\b!0\u0001¨\u0006\fÀ\u0006\u0001"}, d2 = {"Landroidx/lifecycle/ViewModelProvider$Factory;", "", "create", "T", "Landroidx/lifecycle/ViewModel;", "modelClass", "Ljava/lang/Class;", "(Ljava/lang/Class;)Landroidx/lifecycle/ViewModel;", "extras", "Landroidx/lifecycle/viewmodel/CreationExtras;", "(Ljava/lang/Class;Landroidx/lifecycle/viewmodel/CreationExtras;)Landroidx/lifecycle/ViewModel;", "Companion", "lifecycle-viewmodel_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
public interface Factory {
|
||||
|
||||
/* renamed from: Companion, reason: from kotlin metadata */
|
||||
public static final Companion INSTANCE = Companion.$$INSTANCE;
|
||||
|
||||
<T extends ViewModel> T create(Class<T> modelClass);
|
||||
|
||||
<T extends ViewModel> T create(Class<T> modelClass, CreationExtras extras);
|
||||
|
||||
/* compiled from: ViewModelProvider.kt */
|
||||
/* renamed from: androidx.lifecycle.ViewModelProvider$Factory$-CC, reason: invalid class name */
|
||||
public final /* synthetic */ class CC {
|
||||
static {
|
||||
Companion companion = Factory.INSTANCE;
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public static Factory from(ViewModelInitializer<?>... viewModelInitializerArr) {
|
||||
return Factory.INSTANCE.from(viewModelInitializerArr);
|
||||
}
|
||||
|
||||
public static ViewModel $default$create(Factory _this, Class modelClass) {
|
||||
Intrinsics.checkNotNullParameter(modelClass, "modelClass");
|
||||
throw new UnsupportedOperationException("Factory.create(String) is unsupported. This Factory requires `CreationExtras` to be passed into `create` method.");
|
||||
}
|
||||
|
||||
public static ViewModel $default$create(Factory _this, Class modelClass, CreationExtras extras) {
|
||||
Intrinsics.checkNotNullParameter(modelClass, "modelClass");
|
||||
Intrinsics.checkNotNullParameter(extras, "extras");
|
||||
return _this.create(modelClass);
|
||||
}
|
||||
}
|
||||
|
||||
/* compiled from: ViewModelProvider.kt */
|
||||
@Metadata(d1 = {"\u0000\u001e\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0011\n\u0002\u0018\u0002\n\u0002\b\u0002\b\u0086\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J)\u0010\u0003\u001a\u00020\u00042\u001a\u0010\u0005\u001a\u000e\u0012\n\b\u0001\u0012\u0006\u0012\u0002\b\u00030\u00070\u0006\"\u0006\u0012\u0002\b\u00030\u0007H\u0007¢\u0006\u0002\u0010\b¨\u0006\t"}, d2 = {"Landroidx/lifecycle/ViewModelProvider$Factory$Companion;", "", "()V", TypedValues.TransitionType.S_FROM, "Landroidx/lifecycle/ViewModelProvider$Factory;", "initializers", "", "Landroidx/lifecycle/viewmodel/ViewModelInitializer;", "([Landroidx/lifecycle/viewmodel/ViewModelInitializer;)Landroidx/lifecycle/ViewModelProvider$Factory;", "lifecycle-viewmodel_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
public static final class Companion {
|
||||
static final /* synthetic */ Companion $$INSTANCE = new Companion();
|
||||
|
||||
private Companion() {
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public final Factory from(ViewModelInitializer<?>... initializers) {
|
||||
Intrinsics.checkNotNullParameter(initializers, "initializers");
|
||||
return new InitializerViewModelFactory((ViewModelInitializer[]) Arrays.copyOf(initializers, initializers.length));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
|
||||
public ViewModelProvider(ViewModelStoreOwner owner) {
|
||||
this(owner.getViewModelStore(), AndroidViewModelFactory.INSTANCE.defaultFactory$lifecycle_viewmodel_release(owner), ViewModelProviderGetKt.defaultCreationExtras(owner));
|
||||
Intrinsics.checkNotNullParameter(owner, "owner");
|
||||
}
|
||||
|
||||
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
|
||||
public ViewModelProvider(ViewModelStoreOwner owner, Factory factory) {
|
||||
this(owner.getViewModelStore(), factory, ViewModelProviderGetKt.defaultCreationExtras(owner));
|
||||
Intrinsics.checkNotNullParameter(owner, "owner");
|
||||
Intrinsics.checkNotNullParameter(factory, "factory");
|
||||
}
|
||||
|
||||
public <T extends ViewModel> T get(Class<T> modelClass) {
|
||||
Intrinsics.checkNotNullParameter(modelClass, "modelClass");
|
||||
String canonicalName = modelClass.getCanonicalName();
|
||||
if (canonicalName == null) {
|
||||
throw new IllegalArgumentException("Local and anonymous classes can not be ViewModels");
|
||||
}
|
||||
return (T) get("androidx.lifecycle.ViewModelProvider.DefaultKey:" + canonicalName, modelClass);
|
||||
}
|
||||
|
||||
public <T extends ViewModel> T get(String key, Class<T> modelClass) {
|
||||
T t;
|
||||
Intrinsics.checkNotNullParameter(key, "key");
|
||||
Intrinsics.checkNotNullParameter(modelClass, "modelClass");
|
||||
T t2 = (T) this.store.get(key);
|
||||
if (modelClass.isInstance(t2)) {
|
||||
Object obj = this.factory;
|
||||
OnRequeryFactory onRequeryFactory = obj instanceof OnRequeryFactory ? (OnRequeryFactory) obj : null;
|
||||
if (onRequeryFactory != null) {
|
||||
Intrinsics.checkNotNull(t2);
|
||||
onRequeryFactory.onRequery(t2);
|
||||
}
|
||||
Intrinsics.checkNotNull(t2, "null cannot be cast to non-null type T of androidx.lifecycle.ViewModelProvider.get");
|
||||
return t2;
|
||||
}
|
||||
MutableCreationExtras mutableCreationExtras = new MutableCreationExtras(this.defaultCreationExtras);
|
||||
mutableCreationExtras.set(NewInstanceFactory.VIEW_MODEL_KEY, key);
|
||||
try {
|
||||
t = (T) this.factory.create(modelClass, mutableCreationExtras);
|
||||
} catch (AbstractMethodError unused) {
|
||||
t = (T) this.factory.create(modelClass);
|
||||
}
|
||||
this.store.put(key, t);
|
||||
return t;
|
||||
}
|
||||
|
||||
/* compiled from: ViewModelProvider.kt */
|
||||
@Metadata(d1 = {"\u0000\u001a\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\b\u0016\u0018\u0000 \t2\u00020\u0001:\u0001\tB\u0005¢\u0006\u0002\u0010\u0002J%\u0010\u0003\u001a\u0002H\u0004\"\b\b\u0000\u0010\u0004*\u00020\u00052\f\u0010\u0006\u001a\b\u0012\u0004\u0012\u0002H\u00040\u0007H\u0016¢\u0006\u0002\u0010\b¨\u0006\n"}, d2 = {"Landroidx/lifecycle/ViewModelProvider$NewInstanceFactory;", "Landroidx/lifecycle/ViewModelProvider$Factory;", "()V", "create", "T", "Landroidx/lifecycle/ViewModel;", "modelClass", "Ljava/lang/Class;", "(Ljava/lang/Class;)Landroidx/lifecycle/ViewModel;", "Companion", "lifecycle-viewmodel_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
public static class NewInstanceFactory implements Factory {
|
||||
|
||||
/* renamed from: Companion, reason: from kotlin metadata */
|
||||
public static final Companion INSTANCE = new Companion(null);
|
||||
public static final CreationExtras.Key<String> VIEW_MODEL_KEY = Companion.ViewModelKeyImpl.INSTANCE;
|
||||
private static NewInstanceFactory sInstance;
|
||||
|
||||
public static final NewInstanceFactory getInstance() {
|
||||
return INSTANCE.getInstance();
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.ViewModelProvider.Factory
|
||||
public /* synthetic */ ViewModel create(Class cls, CreationExtras creationExtras) {
|
||||
return Factory.CC.$default$create(this, cls, creationExtras);
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.ViewModelProvider.Factory
|
||||
public <T extends ViewModel> T create(Class<T> modelClass) {
|
||||
Intrinsics.checkNotNullParameter(modelClass, "modelClass");
|
||||
try {
|
||||
T newInstance = modelClass.getDeclaredConstructor(new Class[0]).newInstance(new Object[0]);
|
||||
Intrinsics.checkNotNullExpressionValue(newInstance, "{\n modelC…wInstance()\n }");
|
||||
return newInstance;
|
||||
} catch (IllegalAccessException e) {
|
||||
throw new RuntimeException("Cannot create an instance of " + modelClass, e);
|
||||
} catch (InstantiationException e2) {
|
||||
throw new RuntimeException("Cannot create an instance of " + modelClass, e2);
|
||||
} catch (NoSuchMethodException e3) {
|
||||
throw new RuntimeException("Cannot create an instance of " + modelClass, e3);
|
||||
}
|
||||
}
|
||||
|
||||
/* compiled from: ViewModelProvider.kt */
|
||||
@Metadata(d1 = {"\u0000\u001e\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0006\b\u0086\u0003\u0018\u00002\u00020\u0001:\u0001\fB\u0007\b\u0002¢\u0006\u0002\u0010\u0002R\u0016\u0010\u0003\u001a\b\u0012\u0004\u0012\u00020\u00050\u00048\u0006X\u0087\u0004¢\u0006\u0002\n\u0000R\u001a\u0010\u0006\u001a\u00020\u00078GX\u0087\u0004¢\u0006\f\u0012\u0004\b\b\u0010\u0002\u001a\u0004\b\t\u0010\nR\u0010\u0010\u000b\u001a\u0004\u0018\u00010\u0007X\u0082\u000e¢\u0006\u0002\n\u0000¨\u0006\r"}, d2 = {"Landroidx/lifecycle/ViewModelProvider$NewInstanceFactory$Companion;", "", "()V", "VIEW_MODEL_KEY", "Landroidx/lifecycle/viewmodel/CreationExtras$Key;", "", "instance", "Landroidx/lifecycle/ViewModelProvider$NewInstanceFactory;", "getInstance$annotations", "getInstance", "()Landroidx/lifecycle/ViewModelProvider$NewInstanceFactory;", "sInstance", "ViewModelKeyImpl", "lifecycle-viewmodel_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
public static final class Companion {
|
||||
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
||||
this();
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public static /* synthetic */ void getInstance$annotations() {
|
||||
}
|
||||
|
||||
private Companion() {
|
||||
}
|
||||
|
||||
public final NewInstanceFactory getInstance() {
|
||||
if (NewInstanceFactory.sInstance == null) {
|
||||
NewInstanceFactory.sInstance = new NewInstanceFactory();
|
||||
}
|
||||
NewInstanceFactory newInstanceFactory = NewInstanceFactory.sInstance;
|
||||
Intrinsics.checkNotNull(newInstanceFactory);
|
||||
return newInstanceFactory;
|
||||
}
|
||||
|
||||
/* compiled from: ViewModelProvider.kt */
|
||||
@Metadata(d1 = {"\u0000\u0010\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u000e\n\u0002\b\u0002\bÂ\u0002\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0003¨\u0006\u0004"}, d2 = {"Landroidx/lifecycle/ViewModelProvider$NewInstanceFactory$Companion$ViewModelKeyImpl;", "Landroidx/lifecycle/viewmodel/CreationExtras$Key;", "", "()V", "lifecycle-viewmodel_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
private static final class ViewModelKeyImpl implements CreationExtras.Key<String> {
|
||||
public static final ViewModelKeyImpl INSTANCE = new ViewModelKeyImpl();
|
||||
|
||||
private ViewModelKeyImpl() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* compiled from: ViewModelProvider.kt */
|
||||
@Metadata(d1 = {"\u00002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0003\b\u0016\u0018\u0000 \u00142\u00020\u0001:\u0001\u0014B\u0007\b\u0016¢\u0006\u0002\u0010\u0002B\u000f\b\u0016\u0012\u0006\u0010\u0003\u001a\u00020\u0004¢\u0006\u0002\u0010\u0005B\u0019\b\u0002\u0012\b\u0010\u0003\u001a\u0004\u0018\u00010\u0004\u0012\u0006\u0010\u0006\u001a\u00020\u0007¢\u0006\u0002\u0010\bJ%\u0010\t\u001a\u0002H\n\"\b\b\u0000\u0010\n*\u00020\u000b2\f\u0010\f\u001a\b\u0012\u0004\u0012\u0002H\n0\rH\u0016¢\u0006\u0002\u0010\u000eJ-\u0010\t\u001a\u0002H\n\"\b\b\u0000\u0010\n*\u00020\u000b2\f\u0010\f\u001a\b\u0012\u0004\u0012\u0002H\n0\r2\u0006\u0010\u000f\u001a\u00020\u0004H\u0002¢\u0006\u0002\u0010\u0010J-\u0010\t\u001a\u0002H\n\"\b\b\u0000\u0010\n*\u00020\u000b2\f\u0010\f\u001a\b\u0012\u0004\u0012\u0002H\n0\r2\u0006\u0010\u0011\u001a\u00020\u0012H\u0016¢\u0006\u0002\u0010\u0013R\u0010\u0010\u0003\u001a\u0004\u0018\u00010\u0004X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u0015"}, d2 = {"Landroidx/lifecycle/ViewModelProvider$AndroidViewModelFactory;", "Landroidx/lifecycle/ViewModelProvider$NewInstanceFactory;", "()V", "application", "Landroid/app/Application;", "(Landroid/app/Application;)V", "unused", "", "(Landroid/app/Application;I)V", "create", "T", "Landroidx/lifecycle/ViewModel;", "modelClass", "Ljava/lang/Class;", "(Ljava/lang/Class;)Landroidx/lifecycle/ViewModel;", "app", "(Ljava/lang/Class;Landroid/app/Application;)Landroidx/lifecycle/ViewModel;", "extras", "Landroidx/lifecycle/viewmodel/CreationExtras;", "(Ljava/lang/Class;Landroidx/lifecycle/viewmodel/CreationExtras;)Landroidx/lifecycle/ViewModel;", "Companion", "lifecycle-viewmodel_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
public static class AndroidViewModelFactory extends NewInstanceFactory {
|
||||
public static final String DEFAULT_KEY = "androidx.lifecycle.ViewModelProvider.DefaultKey";
|
||||
private static AndroidViewModelFactory sInstance;
|
||||
private final Application application;
|
||||
|
||||
/* renamed from: Companion, reason: from kotlin metadata */
|
||||
public static final Companion INSTANCE = new Companion(null);
|
||||
public static final CreationExtras.Key<Application> APPLICATION_KEY = Companion.ApplicationKeyImpl.INSTANCE;
|
||||
|
||||
@JvmStatic
|
||||
public static final AndroidViewModelFactory getInstance(Application application) {
|
||||
return INSTANCE.getInstance(application);
|
||||
}
|
||||
|
||||
private AndroidViewModelFactory(Application application, int i) {
|
||||
this.application = application;
|
||||
}
|
||||
|
||||
public AndroidViewModelFactory() {
|
||||
this(null, 0);
|
||||
}
|
||||
|
||||
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
|
||||
public AndroidViewModelFactory(Application application) {
|
||||
this(application, 0);
|
||||
Intrinsics.checkNotNullParameter(application, "application");
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.ViewModelProvider.NewInstanceFactory, androidx.lifecycle.ViewModelProvider.Factory
|
||||
public <T extends ViewModel> T create(Class<T> modelClass, CreationExtras extras) {
|
||||
Intrinsics.checkNotNullParameter(modelClass, "modelClass");
|
||||
Intrinsics.checkNotNullParameter(extras, "extras");
|
||||
if (this.application != null) {
|
||||
return (T) create(modelClass);
|
||||
}
|
||||
Application application = (Application) extras.get(APPLICATION_KEY);
|
||||
if (application != null) {
|
||||
return (T) create(modelClass, application);
|
||||
}
|
||||
if (AndroidViewModel.class.isAssignableFrom(modelClass)) {
|
||||
throw new IllegalArgumentException("CreationExtras must have an application by `APPLICATION_KEY`");
|
||||
}
|
||||
return (T) super.create(modelClass);
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.ViewModelProvider.NewInstanceFactory, androidx.lifecycle.ViewModelProvider.Factory
|
||||
public <T extends ViewModel> T create(Class<T> modelClass) {
|
||||
Intrinsics.checkNotNullParameter(modelClass, "modelClass");
|
||||
Application application = this.application;
|
||||
if (application == null) {
|
||||
throw new UnsupportedOperationException("AndroidViewModelFactory constructed with empty constructor works only with create(modelClass: Class<T>, extras: CreationExtras).");
|
||||
}
|
||||
return (T) create(modelClass, application);
|
||||
}
|
||||
|
||||
private final <T extends ViewModel> T create(Class<T> modelClass, Application app) {
|
||||
if (AndroidViewModel.class.isAssignableFrom(modelClass)) {
|
||||
try {
|
||||
T newInstance = modelClass.getConstructor(Application.class).newInstance(app);
|
||||
Intrinsics.checkNotNullExpressionValue(newInstance, "{\n try {\n… }\n }");
|
||||
return newInstance;
|
||||
} catch (IllegalAccessException e) {
|
||||
throw new RuntimeException("Cannot create an instance of " + modelClass, e);
|
||||
} catch (InstantiationException e2) {
|
||||
throw new RuntimeException("Cannot create an instance of " + modelClass, e2);
|
||||
} catch (NoSuchMethodException e3) {
|
||||
throw new RuntimeException("Cannot create an instance of " + modelClass, e3);
|
||||
} catch (InvocationTargetException e4) {
|
||||
throw new RuntimeException("Cannot create an instance of " + modelClass, e4);
|
||||
}
|
||||
}
|
||||
return (T) super.create(modelClass);
|
||||
}
|
||||
|
||||
/* compiled from: ViewModelProvider.kt */
|
||||
@Metadata(d1 = {"\u00000\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\b\u0086\u0003\u0018\u00002\u00020\u0001:\u0001\u0011B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\u0015\u0010\n\u001a\u00020\u000b2\u0006\u0010\f\u001a\u00020\rH\u0000¢\u0006\u0002\b\u000eJ\u0010\u0010\u000f\u001a\u00020\t2\u0006\u0010\u0010\u001a\u00020\u0005H\u0007R\u0016\u0010\u0003\u001a\b\u0012\u0004\u0012\u00020\u00050\u00048\u0006X\u0087\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0006\u001a\u00020\u0007X\u0080T¢\u0006\u0002\n\u0000R\u0010\u0010\b\u001a\u0004\u0018\u00010\tX\u0082\u000e¢\u0006\u0002\n\u0000¨\u0006\u0012"}, d2 = {"Landroidx/lifecycle/ViewModelProvider$AndroidViewModelFactory$Companion;", "", "()V", "APPLICATION_KEY", "Landroidx/lifecycle/viewmodel/CreationExtras$Key;", "Landroid/app/Application;", "DEFAULT_KEY", "", "sInstance", "Landroidx/lifecycle/ViewModelProvider$AndroidViewModelFactory;", "defaultFactory", "Landroidx/lifecycle/ViewModelProvider$Factory;", "owner", "Landroidx/lifecycle/ViewModelStoreOwner;", "defaultFactory$lifecycle_viewmodel_release", "getInstance", "application", "ApplicationKeyImpl", "lifecycle-viewmodel_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
public static final class Companion {
|
||||
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
||||
this();
|
||||
}
|
||||
|
||||
private Companion() {
|
||||
}
|
||||
|
||||
public final Factory defaultFactory$lifecycle_viewmodel_release(ViewModelStoreOwner owner) {
|
||||
Intrinsics.checkNotNullParameter(owner, "owner");
|
||||
return owner instanceof HasDefaultViewModelProviderFactory ? ((HasDefaultViewModelProviderFactory) owner).getDefaultViewModelProviderFactory() : NewInstanceFactory.INSTANCE.getInstance();
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public final AndroidViewModelFactory getInstance(Application application) {
|
||||
Intrinsics.checkNotNullParameter(application, "application");
|
||||
if (AndroidViewModelFactory.sInstance == null) {
|
||||
AndroidViewModelFactory.sInstance = new AndroidViewModelFactory(application);
|
||||
}
|
||||
AndroidViewModelFactory androidViewModelFactory = AndroidViewModelFactory.sInstance;
|
||||
Intrinsics.checkNotNull(androidViewModelFactory);
|
||||
return androidViewModelFactory;
|
||||
}
|
||||
|
||||
/* compiled from: ViewModelProvider.kt */
|
||||
@Metadata(d1 = {"\u0000\u0010\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\bÂ\u0002\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0003¨\u0006\u0004"}, d2 = {"Landroidx/lifecycle/ViewModelProvider$AndroidViewModelFactory$Companion$ApplicationKeyImpl;", "Landroidx/lifecycle/viewmodel/CreationExtras$Key;", "Landroid/app/Application;", "()V", "lifecycle-viewmodel_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
private static final class ApplicationKeyImpl implements CreationExtras.Key<Application> {
|
||||
public static final ApplicationKeyImpl INSTANCE = new ApplicationKeyImpl();
|
||||
|
||||
private ApplicationKeyImpl() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import androidx.lifecycle.viewmodel.CreationExtras;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: ViewModelProvider.kt */
|
||||
@Metadata(d1 = {"\u0000\u001c\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\u001a\u0010\u0010\u0000\u001a\u00020\u00012\u0006\u0010\u0002\u001a\u00020\u0003H\u0000\u001a\u001e\u0010\u0004\u001a\u0002H\u0005\"\n\b\u0000\u0010\u0005\u0018\u0001*\u00020\u0006*\u00020\u0007H\u0087\b¢\u0006\u0002\u0010\b¨\u0006\t"}, d2 = {"defaultCreationExtras", "Landroidx/lifecycle/viewmodel/CreationExtras;", "owner", "Landroidx/lifecycle/ViewModelStoreOwner;", "get", "VM", "Landroidx/lifecycle/ViewModel;", "Landroidx/lifecycle/ViewModelProvider;", "(Landroidx/lifecycle/ViewModelProvider;)Landroidx/lifecycle/ViewModel;", "lifecycle-viewmodel_release"}, k = 2, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class ViewModelProviderGetKt {
|
||||
public static final CreationExtras defaultCreationExtras(ViewModelStoreOwner owner) {
|
||||
Intrinsics.checkNotNullParameter(owner, "owner");
|
||||
if (owner instanceof HasDefaultViewModelProviderFactory) {
|
||||
return ((HasDefaultViewModelProviderFactory) owner).getDefaultViewModelCreationExtras();
|
||||
}
|
||||
return CreationExtras.Empty.INSTANCE;
|
||||
}
|
||||
|
||||
public static final /* synthetic */ <VM extends ViewModel> VM get(ViewModelProvider viewModelProvider) {
|
||||
Intrinsics.checkNotNullParameter(viewModelProvider, "<this>");
|
||||
Intrinsics.reifiedOperationMarker(4, "VM");
|
||||
return (VM) viewModelProvider.get(ViewModel.class);
|
||||
}
|
||||
}
|
42
02-Easy5/E5/sources/androidx/lifecycle/ViewModelStore.java
Normal file
42
02-Easy5/E5/sources/androidx/lifecycle/ViewModelStore.java
Normal file
@ -0,0 +1,42 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: ViewModelStore.kt */
|
||||
@Metadata(d1 = {"\u0000*\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010%\n\u0002\u0010\u000e\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0003\n\u0002\u0010\"\n\u0002\b\u0003\b\u0016\u0018\u00002\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0002J\u0006\u0010\u0007\u001a\u00020\bJ\u0013\u0010\t\u001a\u0004\u0018\u00010\u00062\u0006\u0010\n\u001a\u00020\u0005H\u0087\u0002J\u000e\u0010\u000b\u001a\b\u0012\u0004\u0012\u00020\u00050\fH\u0007J\u0018\u0010\r\u001a\u00020\b2\u0006\u0010\n\u001a\u00020\u00052\u0006\u0010\u000e\u001a\u00020\u0006H\u0007R\u001a\u0010\u0003\u001a\u000e\u0012\u0004\u0012\u00020\u0005\u0012\u0004\u0012\u00020\u00060\u0004X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u000f"}, d2 = {"Landroidx/lifecycle/ViewModelStore;", "", "()V", "map", "", "", "Landroidx/lifecycle/ViewModel;", "clear", "", "get", "key", "keys", "", "put", "viewModel", "lifecycle-viewmodel_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public class ViewModelStore {
|
||||
private final Map<String, ViewModel> map = new LinkedHashMap();
|
||||
|
||||
public final void put(String key, ViewModel viewModel) {
|
||||
Intrinsics.checkNotNullParameter(key, "key");
|
||||
Intrinsics.checkNotNullParameter(viewModel, "viewModel");
|
||||
ViewModel put = this.map.put(key, viewModel);
|
||||
if (put != null) {
|
||||
put.onCleared();
|
||||
}
|
||||
}
|
||||
|
||||
public final ViewModel get(String key) {
|
||||
Intrinsics.checkNotNullParameter(key, "key");
|
||||
return this.map.get(key);
|
||||
}
|
||||
|
||||
public final Set<String> keys() {
|
||||
return new HashSet(this.map.keySet());
|
||||
}
|
||||
|
||||
public final void clear() {
|
||||
Iterator<ViewModel> it = this.map.values().iterator();
|
||||
while (it.hasNext()) {
|
||||
it.next().clear();
|
||||
}
|
||||
this.map.clear();
|
||||
}
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import kotlin.Metadata;
|
||||
|
||||
/* compiled from: ViewModelStoreOwner.kt */
|
||||
@Metadata(d1 = {"\u0000\u0012\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\bf\u0018\u00002\u00020\u0001R\u0012\u0010\u0002\u001a\u00020\u0003X¦\u0004¢\u0006\u0006\u001a\u0004\b\u0004\u0010\u0005ø\u0001\u0000\u0082\u0002\u0006\n\u0004\b!0\u0001¨\u0006\u0006À\u0006\u0001"}, d2 = {"Landroidx/lifecycle/ViewModelStoreOwner;", "", "viewModelStore", "Landroidx/lifecycle/ViewModelStore;", "getViewModelStore", "()Landroidx/lifecycle/ViewModelStore;", "lifecycle-viewmodel_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public interface ViewModelStoreOwner {
|
||||
ViewModelStore getViewModelStore();
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import android.view.View;
|
||||
import androidx.lifecycle.runtime.R;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import kotlin.sequences.SequencesKt;
|
||||
|
||||
/* compiled from: ViewTreeLifecycleOwner.kt */
|
||||
@Metadata(d1 = {"\u0000\u0016\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0003\u001a\u0013\u0010\u0000\u001a\u0004\u0018\u00010\u0001*\u00020\u0002H\u0007¢\u0006\u0002\b\u0003\u001a\u001b\u0010\u0004\u001a\u00020\u0005*\u00020\u00022\b\u0010\u0006\u001a\u0004\u0018\u00010\u0001H\u0007¢\u0006\u0002\b\u0007¨\u0006\b"}, d2 = {"findViewTreeLifecycleOwner", "Landroidx/lifecycle/LifecycleOwner;", "Landroid/view/View;", "get", "setViewTreeLifecycleOwner", "", "lifecycleOwner", "set", "lifecycle-runtime_release"}, k = 2, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class ViewTreeLifecycleOwner {
|
||||
public static final void set(View view, LifecycleOwner lifecycleOwner) {
|
||||
Intrinsics.checkNotNullParameter(view, "<this>");
|
||||
view.setTag(R.id.view_tree_lifecycle_owner, lifecycleOwner);
|
||||
}
|
||||
|
||||
public static final LifecycleOwner get(View view) {
|
||||
Intrinsics.checkNotNullParameter(view, "<this>");
|
||||
return (LifecycleOwner) SequencesKt.firstOrNull(SequencesKt.mapNotNull(SequencesKt.generateSequence(view, new Function1<View, View>() { // from class: androidx.lifecycle.ViewTreeLifecycleOwner$findViewTreeLifecycleOwner$1
|
||||
@Override // kotlin.jvm.functions.Function1
|
||||
public final View invoke(View currentView) {
|
||||
Intrinsics.checkNotNullParameter(currentView, "currentView");
|
||||
Object parent = currentView.getParent();
|
||||
if (parent instanceof View) {
|
||||
return (View) parent;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}), new Function1<View, LifecycleOwner>() { // from class: androidx.lifecycle.ViewTreeLifecycleOwner$findViewTreeLifecycleOwner$2
|
||||
@Override // kotlin.jvm.functions.Function1
|
||||
public final LifecycleOwner invoke(View viewParent) {
|
||||
Intrinsics.checkNotNullParameter(viewParent, "viewParent");
|
||||
Object tag = viewParent.getTag(R.id.view_tree_lifecycle_owner);
|
||||
if (tag instanceof LifecycleOwner) {
|
||||
return (LifecycleOwner) tag;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}));
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import android.view.View;
|
||||
import kotlin.Deprecated;
|
||||
import kotlin.DeprecationLevel;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.ReplaceWith;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: ViewTreeViewModel.kt */
|
||||
@Metadata(d1 = {"\u0000\u000e\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\u001a\u0012\u0010\u0000\u001a\u0004\u0018\u00010\u00012\u0006\u0010\u0002\u001a\u00020\u0003H\u0007¨\u0006\u0004"}, d2 = {"findViewTreeViewModelStoreOwner", "Landroidx/lifecycle/ViewModelStoreOwner;", "view", "Landroid/view/View;", "lifecycle-viewmodel_release"}, k = 2, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class ViewTreeViewModelKt {
|
||||
@Deprecated(level = DeprecationLevel.HIDDEN, message = "Replaced by View.findViewTreeViewModelStoreOwner in ViewTreeViewModelStoreOwner", replaceWith = @ReplaceWith(expression = "View.findViewTreeViewModelStoreOwner", imports = {"androidx.lifecycle.ViewTreeViewModelStoreOwner"}))
|
||||
public static final /* synthetic */ ViewModelStoreOwner findViewTreeViewModelStoreOwner(View view) {
|
||||
Intrinsics.checkNotNullParameter(view, "view");
|
||||
return ViewTreeViewModelStoreOwner.get(view);
|
||||
}
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package androidx.lifecycle;
|
||||
|
||||
import android.view.View;
|
||||
import androidx.lifecycle.viewmodel.R;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import kotlin.sequences.SequencesKt;
|
||||
|
||||
/* compiled from: ViewTreeViewModelStoreOwner.kt */
|
||||
@Metadata(d1 = {"\u0000\u0016\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0003\u001a\u0013\u0010\u0000\u001a\u0004\u0018\u00010\u0001*\u00020\u0002H\u0007¢\u0006\u0002\b\u0003\u001a\u001b\u0010\u0004\u001a\u00020\u0005*\u00020\u00022\b\u0010\u0006\u001a\u0004\u0018\u00010\u0001H\u0007¢\u0006\u0002\b\u0007¨\u0006\b"}, d2 = {"findViewTreeViewModelStoreOwner", "Landroidx/lifecycle/ViewModelStoreOwner;", "Landroid/view/View;", "get", "setViewTreeViewModelStoreOwner", "", "viewModelStoreOwner", "set", "lifecycle-viewmodel_release"}, k = 2, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class ViewTreeViewModelStoreOwner {
|
||||
public static final void set(View view, ViewModelStoreOwner viewModelStoreOwner) {
|
||||
Intrinsics.checkNotNullParameter(view, "<this>");
|
||||
view.setTag(R.id.view_tree_view_model_store_owner, viewModelStoreOwner);
|
||||
}
|
||||
|
||||
public static final ViewModelStoreOwner get(View view) {
|
||||
Intrinsics.checkNotNullParameter(view, "<this>");
|
||||
return (ViewModelStoreOwner) SequencesKt.firstOrNull(SequencesKt.mapNotNull(SequencesKt.generateSequence(view, new Function1<View, View>() { // from class: androidx.lifecycle.ViewTreeViewModelStoreOwner$findViewTreeViewModelStoreOwner$1
|
||||
@Override // kotlin.jvm.functions.Function1
|
||||
public final View invoke(View view2) {
|
||||
Intrinsics.checkNotNullParameter(view2, "view");
|
||||
Object parent = view2.getParent();
|
||||
if (parent instanceof View) {
|
||||
return (View) parent;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}), new Function1<View, ViewModelStoreOwner>() { // from class: androidx.lifecycle.ViewTreeViewModelStoreOwner$findViewTreeViewModelStoreOwner$2
|
||||
@Override // kotlin.jvm.functions.Function1
|
||||
public final ViewModelStoreOwner invoke(View view2) {
|
||||
Intrinsics.checkNotNullParameter(view2, "view");
|
||||
Object tag = view2.getTag(R.id.view_tree_view_model_store_owner);
|
||||
if (tag instanceof ViewModelStoreOwner) {
|
||||
return (ViewModelStoreOwner) tag;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}));
|
||||
}
|
||||
}
|
7
02-Easy5/E5/sources/androidx/lifecycle/livedata/R.java
Normal file
7
02-Easy5/E5/sources/androidx/lifecycle/livedata/R.java
Normal file
@ -0,0 +1,7 @@
|
||||
package androidx.lifecycle.livedata;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class R {
|
||||
private R() {
|
||||
}
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
package androidx.lifecycle.livedata.core;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class R {
|
||||
private R() {
|
||||
}
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
package androidx.lifecycle.livedata.core.ktx;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class R {
|
||||
private R() {
|
||||
}
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
package androidx.lifecycle.livedata.ktx;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class R {
|
||||
private R() {
|
||||
}
|
||||
}
|
7
02-Easy5/E5/sources/androidx/lifecycle/process/R.java
Normal file
7
02-Easy5/E5/sources/androidx/lifecycle/process/R.java
Normal file
@ -0,0 +1,7 @@
|
||||
package androidx.lifecycle.process;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class R {
|
||||
private R() {
|
||||
}
|
||||
}
|
15
02-Easy5/E5/sources/androidx/lifecycle/runtime/R.java
Normal file
15
02-Easy5/E5/sources/androidx/lifecycle/runtime/R.java
Normal file
@ -0,0 +1,15 @@
|
||||
package androidx.lifecycle.runtime;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class R {
|
||||
|
||||
public static final class id {
|
||||
public static final int view_tree_lifecycle_owner = 0x7f0801e3;
|
||||
|
||||
private id() {
|
||||
}
|
||||
}
|
||||
|
||||
private R() {
|
||||
}
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
package androidx.lifecycle.viewmodel;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: CreationExtras.kt */
|
||||
@Metadata(d1 = {"\u0000\u0018\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010%\n\u0002\u0018\u0002\n\u0002\b\t\b&\u0018\u00002\u00020\u0001:\u0002\f\rB\u0007\b\u0000¢\u0006\u0002\u0010\u0002J$\u0010\b\u001a\u0004\u0018\u0001H\t\"\u0004\b\u0000\u0010\t2\f\u0010\n\u001a\b\u0012\u0004\u0012\u0002H\t0\u0005H¦\u0002¢\u0006\u0002\u0010\u000bR&\u0010\u0003\u001a\u0014\u0012\b\u0012\u0006\u0012\u0002\b\u00030\u0005\u0012\u0006\u0012\u0004\u0018\u00010\u00010\u0004X\u0080\u0004¢\u0006\b\n\u0000\u001a\u0004\b\u0006\u0010\u0007¨\u0006\u000e"}, d2 = {"Landroidx/lifecycle/viewmodel/CreationExtras;", "", "()V", "map", "", "Landroidx/lifecycle/viewmodel/CreationExtras$Key;", "getMap$lifecycle_viewmodel_release", "()Ljava/util/Map;", "get", "T", "key", "(Landroidx/lifecycle/viewmodel/CreationExtras$Key;)Ljava/lang/Object;", "Empty", "Key", "lifecycle-viewmodel_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class CreationExtras {
|
||||
private final Map<Key<?>, Object> map = new LinkedHashMap();
|
||||
|
||||
/* compiled from: CreationExtras.kt */
|
||||
@Metadata(d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0000\n\u0000\bf\u0018\u0000*\u0004\b\u0000\u0010\u00012\u00020\u0002ø\u0001\u0000\u0082\u0002\u0006\n\u0004\b!0\u0001¨\u0006\u0003À\u0006\u0001"}, d2 = {"Landroidx/lifecycle/viewmodel/CreationExtras$Key;", "T", "", "lifecycle-viewmodel_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
public interface Key<T> {
|
||||
}
|
||||
|
||||
public abstract <T> T get(Key<T> key);
|
||||
|
||||
public final Map<Key<?>, Object> getMap$lifecycle_viewmodel_release() {
|
||||
return this.map;
|
||||
}
|
||||
|
||||
/* compiled from: CreationExtras.kt */
|
||||
@Metadata(d1 = {"\u0000\u0014\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0002\bÆ\u0002\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J$\u0010\u0003\u001a\u0004\u0018\u0001H\u0004\"\u0004\b\u0000\u0010\u00042\f\u0010\u0005\u001a\b\u0012\u0004\u0012\u0002H\u00040\u0006H\u0096\u0002¢\u0006\u0002\u0010\u0007¨\u0006\b"}, d2 = {"Landroidx/lifecycle/viewmodel/CreationExtras$Empty;", "Landroidx/lifecycle/viewmodel/CreationExtras;", "()V", "get", "T", "key", "Landroidx/lifecycle/viewmodel/CreationExtras$Key;", "(Landroidx/lifecycle/viewmodel/CreationExtras$Key;)Ljava/lang/Object;", "lifecycle-viewmodel_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
public static final class Empty extends CreationExtras {
|
||||
public static final Empty INSTANCE = new Empty();
|
||||
|
||||
@Override // androidx.lifecycle.viewmodel.CreationExtras
|
||||
public <T> T get(Key<T> key) {
|
||||
Intrinsics.checkNotNullParameter(key, "key");
|
||||
return null;
|
||||
}
|
||||
|
||||
private Empty() {
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package androidx.lifecycle.viewmodel;
|
||||
|
||||
import androidx.lifecycle.ViewModel;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: InitializerViewModelFactory.kt */
|
||||
@Metadata(d1 = {"\u0000*\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0011\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\b\u0000\u0018\u00002\u00020\u0001B!\u0012\u001a\u0010\u0002\u001a\u000e\u0012\n\b\u0001\u0012\u0006\u0012\u0002\b\u00030\u00040\u0003\"\u0006\u0012\u0002\b\u00030\u0004¢\u0006\u0002\u0010\u0005J-\u0010\u0007\u001a\u0002H\b\"\b\b\u0000\u0010\b*\u00020\t2\f\u0010\n\u001a\b\u0012\u0004\u0012\u0002H\b0\u000b2\u0006\u0010\f\u001a\u00020\rH\u0016¢\u0006\u0002\u0010\u000eR\u001c\u0010\u0002\u001a\u000e\u0012\n\b\u0001\u0012\u0006\u0012\u0002\b\u00030\u00040\u0003X\u0082\u0004¢\u0006\u0004\n\u0002\u0010\u0006¨\u0006\u000f"}, d2 = {"Landroidx/lifecycle/viewmodel/InitializerViewModelFactory;", "Landroidx/lifecycle/ViewModelProvider$Factory;", "initializers", "", "Landroidx/lifecycle/viewmodel/ViewModelInitializer;", "([Landroidx/lifecycle/viewmodel/ViewModelInitializer;)V", "[Landroidx/lifecycle/viewmodel/ViewModelInitializer;", "create", "T", "Landroidx/lifecycle/ViewModel;", "modelClass", "Ljava/lang/Class;", "extras", "Landroidx/lifecycle/viewmodel/CreationExtras;", "(Ljava/lang/Class;Landroidx/lifecycle/viewmodel/CreationExtras;)Landroidx/lifecycle/ViewModel;", "lifecycle-viewmodel_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class InitializerViewModelFactory implements ViewModelProvider.Factory {
|
||||
private final ViewModelInitializer<?>[] initializers;
|
||||
|
||||
@Override // androidx.lifecycle.ViewModelProvider.Factory
|
||||
public /* synthetic */ ViewModel create(Class cls) {
|
||||
return ViewModelProvider.Factory.CC.$default$create(this, cls);
|
||||
}
|
||||
|
||||
public InitializerViewModelFactory(ViewModelInitializer<?>... initializers) {
|
||||
Intrinsics.checkNotNullParameter(initializers, "initializers");
|
||||
this.initializers = initializers;
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.ViewModelProvider.Factory
|
||||
public <T extends ViewModel> T create(Class<T> modelClass, CreationExtras extras) {
|
||||
Intrinsics.checkNotNullParameter(modelClass, "modelClass");
|
||||
Intrinsics.checkNotNullParameter(extras, "extras");
|
||||
T t = null;
|
||||
for (ViewModelInitializer<?> viewModelInitializer : this.initializers) {
|
||||
if (Intrinsics.areEqual(viewModelInitializer.getClazz$lifecycle_viewmodel_release(), modelClass)) {
|
||||
Object invoke = viewModelInitializer.getInitializer$lifecycle_viewmodel_release().invoke(extras);
|
||||
t = invoke instanceof ViewModel ? (T) invoke : null;
|
||||
}
|
||||
}
|
||||
if (t != null) {
|
||||
return t;
|
||||
}
|
||||
throw new IllegalArgumentException("No initializer set for given class " + modelClass.getName());
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package androidx.lifecycle.viewmodel;
|
||||
|
||||
import androidx.lifecycle.ViewModel;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.JvmClassMappingKt;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import kotlin.reflect.KClass;
|
||||
|
||||
/* compiled from: InitializerViewModelFactory.kt */
|
||||
@Metadata(d1 = {"\u0000<\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010!\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\b\u0007\u0018\u00002\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0002J7\u0010\u0006\u001a\u00020\u0007\"\b\b\u0000\u0010\b*\u00020\t2\f\u0010\n\u001a\b\u0012\u0004\u0012\u0002H\b0\u000b2\u0017\u0010\f\u001a\u0013\u0012\u0004\u0012\u00020\u000e\u0012\u0004\u0012\u0002H\b0\r¢\u0006\u0002\b\u000fJ\u0006\u0010\u0010\u001a\u00020\u0011R\u0018\u0010\u0003\u001a\f\u0012\b\u0012\u0006\u0012\u0002\b\u00030\u00050\u0004X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u0012"}, d2 = {"Landroidx/lifecycle/viewmodel/InitializerViewModelFactoryBuilder;", "", "()V", "initializers", "", "Landroidx/lifecycle/viewmodel/ViewModelInitializer;", "addInitializer", "", "T", "Landroidx/lifecycle/ViewModel;", "clazz", "Lkotlin/reflect/KClass;", "initializer", "Lkotlin/Function1;", "Landroidx/lifecycle/viewmodel/CreationExtras;", "Lkotlin/ExtensionFunctionType;", "build", "Landroidx/lifecycle/ViewModelProvider$Factory;", "lifecycle-viewmodel_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
@ViewModelFactoryDsl
|
||||
/* loaded from: classes.dex */
|
||||
public final class InitializerViewModelFactoryBuilder {
|
||||
private final List<ViewModelInitializer<?>> initializers = new ArrayList();
|
||||
|
||||
public final <T extends ViewModel> void addInitializer(KClass<T> clazz, Function1<? super CreationExtras, ? extends T> initializer) {
|
||||
Intrinsics.checkNotNullParameter(clazz, "clazz");
|
||||
Intrinsics.checkNotNullParameter(initializer, "initializer");
|
||||
this.initializers.add(new ViewModelInitializer<>(JvmClassMappingKt.getJavaClass((KClass) clazz), initializer));
|
||||
}
|
||||
|
||||
public final ViewModelProvider.Factory build() {
|
||||
ViewModelInitializer[] viewModelInitializerArr = (ViewModelInitializer[]) this.initializers.toArray(new ViewModelInitializer[0]);
|
||||
return new InitializerViewModelFactory((ViewModelInitializer[]) Arrays.copyOf(viewModelInitializerArr, viewModelInitializerArr.length));
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package androidx.lifecycle.viewmodel;
|
||||
|
||||
import androidx.lifecycle.ViewModel;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.Unit;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import kotlin.jvm.internal.Reflection;
|
||||
|
||||
/* compiled from: InitializerViewModelFactory.kt */
|
||||
@Metadata(d1 = {"\u0000&\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\u001a%\u0010\u0000\u001a\u00020\u00012\u0017\u0010\u0002\u001a\u0013\u0012\u0004\u0012\u00020\u0004\u0012\u0004\u0012\u00020\u00050\u0003¢\u0006\u0002\b\u0006H\u0086\bø\u0001\u0000\u001a7\u0010\u0007\u001a\u00020\u0005\"\n\b\u0000\u0010\b\u0018\u0001*\u00020\t*\u00020\u00042\u0019\b\b\u0010\u0007\u001a\u0013\u0012\u0004\u0012\u00020\n\u0012\u0004\u0012\u0002H\b0\u0003¢\u0006\u0002\b\u0006H\u0086\bø\u0001\u0000\u0082\u0002\u0007\n\u0005\b\u009920\u0001¨\u0006\u000b"}, d2 = {"viewModelFactory", "Landroidx/lifecycle/ViewModelProvider$Factory;", "builder", "Lkotlin/Function1;", "Landroidx/lifecycle/viewmodel/InitializerViewModelFactoryBuilder;", "", "Lkotlin/ExtensionFunctionType;", "initializer", "VM", "Landroidx/lifecycle/ViewModel;", "Landroidx/lifecycle/viewmodel/CreationExtras;", "lifecycle-viewmodel_release"}, k = 2, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class InitializerViewModelFactoryKt {
|
||||
public static final ViewModelProvider.Factory viewModelFactory(Function1<? super InitializerViewModelFactoryBuilder, Unit> builder) {
|
||||
Intrinsics.checkNotNullParameter(builder, "builder");
|
||||
InitializerViewModelFactoryBuilder initializerViewModelFactoryBuilder = new InitializerViewModelFactoryBuilder();
|
||||
builder.invoke(initializerViewModelFactoryBuilder);
|
||||
return initializerViewModelFactoryBuilder.build();
|
||||
}
|
||||
|
||||
public static final /* synthetic */ <VM extends ViewModel> void initializer(InitializerViewModelFactoryBuilder initializerViewModelFactoryBuilder, Function1<? super CreationExtras, ? extends VM> initializer) {
|
||||
Intrinsics.checkNotNullParameter(initializerViewModelFactoryBuilder, "<this>");
|
||||
Intrinsics.checkNotNullParameter(initializer, "initializer");
|
||||
Intrinsics.reifiedOperationMarker(4, "VM");
|
||||
initializerViewModelFactoryBuilder.addInitializer(Reflection.getOrCreateKotlinClass(ViewModel.class), initializer);
|
||||
}
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package androidx.lifecycle.viewmodel;
|
||||
|
||||
import androidx.lifecycle.viewmodel.CreationExtras;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.DefaultConstructorMarker;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: CreationExtras.kt */
|
||||
@Metadata(d1 = {"\u0000\u001c\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0003\u0018\u00002\u00020\u0001B\u000f\u0012\b\b\u0002\u0010\u0002\u001a\u00020\u0001¢\u0006\u0002\u0010\u0003J$\u0010\u0004\u001a\u0004\u0018\u0001H\u0005\"\u0004\b\u0000\u0010\u00052\f\u0010\u0006\u001a\b\u0012\u0004\u0012\u0002H\u00050\u0007H\u0096\u0002¢\u0006\u0002\u0010\bJ*\u0010\t\u001a\u00020\n\"\u0004\b\u0000\u0010\u00052\f\u0010\u0006\u001a\b\u0012\u0004\u0012\u0002H\u00050\u00072\u0006\u0010\u000b\u001a\u0002H\u0005H\u0086\u0002¢\u0006\u0002\u0010\f¨\u0006\r"}, d2 = {"Landroidx/lifecycle/viewmodel/MutableCreationExtras;", "Landroidx/lifecycle/viewmodel/CreationExtras;", "initialExtras", "(Landroidx/lifecycle/viewmodel/CreationExtras;)V", "get", "T", "key", "Landroidx/lifecycle/viewmodel/CreationExtras$Key;", "(Landroidx/lifecycle/viewmodel/CreationExtras$Key;)Ljava/lang/Object;", "set", "", "t", "(Landroidx/lifecycle/viewmodel/CreationExtras$Key;Ljava/lang/Object;)V", "lifecycle-viewmodel_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class MutableCreationExtras extends CreationExtras {
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public MutableCreationExtras() {
|
||||
this(null, 1, 0 == true ? 1 : 0);
|
||||
}
|
||||
|
||||
public MutableCreationExtras(CreationExtras initialExtras) {
|
||||
Intrinsics.checkNotNullParameter(initialExtras, "initialExtras");
|
||||
getMap$lifecycle_viewmodel_release().putAll(initialExtras.getMap$lifecycle_viewmodel_release());
|
||||
}
|
||||
|
||||
public /* synthetic */ MutableCreationExtras(CreationExtras.Empty empty, int i, DefaultConstructorMarker defaultConstructorMarker) {
|
||||
this((i & 1) != 0 ? CreationExtras.Empty.INSTANCE : empty);
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public final <T> void set(CreationExtras.Key<T> key, T t) {
|
||||
Intrinsics.checkNotNullParameter(key, "key");
|
||||
getMap$lifecycle_viewmodel_release().put(key, t);
|
||||
}
|
||||
|
||||
@Override // androidx.lifecycle.viewmodel.CreationExtras
|
||||
public <T> T get(CreationExtras.Key<T> key) {
|
||||
Intrinsics.checkNotNullParameter(key, "key");
|
||||
return (T) getMap$lifecycle_viewmodel_release().get(key);
|
||||
}
|
||||
}
|
15
02-Easy5/E5/sources/androidx/lifecycle/viewmodel/R.java
Normal file
15
02-Easy5/E5/sources/androidx/lifecycle/viewmodel/R.java
Normal file
@ -0,0 +1,15 @@
|
||||
package androidx.lifecycle.viewmodel;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class R {
|
||||
|
||||
public static final class id {
|
||||
public static final int view_tree_view_model_store_owner = 0x7f0801e6;
|
||||
|
||||
private id() {
|
||||
}
|
||||
}
|
||||
|
||||
private R() {
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user