mirror of
https://github.com/VibedByKaKi/alexandroid.git
synced 2026-11-14 01:47:17 +01:00
97 lines
5.5 KiB
Java
97 lines
5.5 KiB
Java
package androidx.lifecycle;
|
|
|
|
import androidx.annotation.MainThread;
|
|
import androidx.exifinterface.media.ExifInterface;
|
|
import androidx.lifecycle.viewmodel.internal.ViewModelImpl;
|
|
import com.dee.app.metrics.MetricsConstants;
|
|
import java.io.Closeable;
|
|
import java.util.Arrays;
|
|
import kotlin.Deprecated;
|
|
import kotlin.DeprecationLevel;
|
|
import kotlin.Metadata;
|
|
import kotlinx.coroutines.CoroutineScope;
|
|
import org.jetbrains.annotations.NotNull;
|
|
import org.jetbrains.annotations.Nullable;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
@Metadata(d1 = {"\u0000B\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0011\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0004\n\u0002\u0010\u000e\n\u0002\b\u0005\b&\u0018\u00002\u00020\u0001B\t\b\u0016¢\u0006\u0004\b\u0002\u0010\u0003B\u0011\b\u0016\u0012\u0006\u0010\u0004\u001a\u00020\u0005¢\u0006\u0004\b\u0002\u0010\u0006B%\b\u0016\u0012\u001a\u0010\u0007\u001a\u000e\u0012\n\b\u0001\u0012\u00060\tj\u0002`\n0\b\"\u00060\tj\u0002`\n¢\u0006\u0004\b\u0002\u0010\u000bB-\b\u0016\u0012\u0006\u0010\u0004\u001a\u00020\u0005\u0012\u001a\u0010\u0007\u001a\u000e\u0012\n\b\u0001\u0012\u00060\tj\u0002`\n0\b\"\u00060\tj\u0002`\n¢\u0006\u0004\b\u0002\u0010\fB\u001d\b\u0017\u0012\u0012\u0010\u0007\u001a\n\u0012\u0006\b\u0001\u0012\u00020\r0\b\"\u00020\r¢\u0006\u0004\b\u0002\u0010\u000eJ\b\u0010\u0011\u001a\u00020\u0012H\u0014J\r\u0010\u0013\u001a\u00020\u0012H\u0001¢\u0006\u0002\b\u0014J\u001a\u0010\u0015\u001a\u00020\u00122\u0006\u0010\u0016\u001a\u00020\u00172\n\u0010\u0018\u001a\u00060\tj\u0002`\nJ\u0014\u0010\u0015\u001a\u00020\u00122\n\u0010\u0018\u001a\u00060\tj\u0002`\nH\u0016J\u0010\u0010\u0015\u001a\u00020\u00122\u0006\u0010\u0018\u001a\u00020\rH\u0017J#\u0010\u0019\u001a\u0004\u0018\u0001H\u001a\"\f\b\u0000\u0010\u001a*\u00060\tj\u0002`\n2\u0006\u0010\u0016\u001a\u00020\u0017¢\u0006\u0002\u0010\u001bR\u0010\u0010\u000f\u001a\u0004\u0018\u00010\u0010X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u001c"}, d2 = {"Landroidx/lifecycle/ViewModel;", "", "<init>", "()V", "viewModelScope", "Lkotlinx/coroutines/CoroutineScope;", "(Lkotlinx/coroutines/CoroutineScope;)V", "closeables", "", "Ljava/lang/AutoCloseable;", "Lkotlin/AutoCloseable;", "([Ljava/lang/AutoCloseable;)V", "(Lkotlinx/coroutines/CoroutineScope;[Ljava/lang/AutoCloseable;)V", "Ljava/io/Closeable;", "([Ljava/io/Closeable;)V", "impl", "Landroidx/lifecycle/viewmodel/internal/ViewModelImpl;", "onCleared", "", MetricsConstants.Method.CACHE_CLEAR, "clear$lifecycle_viewmodel", "addCloseable", "key", "", "closeable", "getCloseable", ExifInterface.GPS_DIRECTION_TRUE, "(Ljava/lang/String;)Ljava/lang/AutoCloseable;", "lifecycle-viewmodel"}, k = 1, mv = {2, 0, 0}, xi = 48)
|
|
/* loaded from: classes14.dex */
|
|
public abstract class ViewModel {
|
|
|
|
@Nullable
|
|
private final ViewModelImpl impl;
|
|
|
|
public ViewModel(@NotNull CoroutineScope coroutineScope, @NotNull AutoCloseable... autoCloseableArr) {
|
|
coroutineScope.getClass();
|
|
autoCloseableArr.getClass();
|
|
this.impl = new ViewModelImpl(coroutineScope, (AutoCloseable[]) Arrays.copyOf(autoCloseableArr, autoCloseableArr.length));
|
|
}
|
|
|
|
public final void addCloseable(@NotNull String key, @NotNull AutoCloseable closeable) {
|
|
key.getClass();
|
|
closeable.getClass();
|
|
ViewModelImpl viewModelImpl = this.impl;
|
|
if (viewModelImpl != null) {
|
|
viewModelImpl.addCloseable(key, closeable);
|
|
}
|
|
}
|
|
|
|
@MainThread
|
|
public final void clear$lifecycle_viewmodel() {
|
|
ViewModelImpl viewModelImpl = this.impl;
|
|
if (viewModelImpl != null) {
|
|
viewModelImpl.clear();
|
|
}
|
|
onCleared();
|
|
}
|
|
|
|
@Nullable
|
|
public final <T extends AutoCloseable> T getCloseable(@NotNull String key) {
|
|
key.getClass();
|
|
ViewModelImpl viewModelImpl = this.impl;
|
|
if (viewModelImpl != null) {
|
|
return (T) viewModelImpl.getCloseable(key);
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public void addCloseable(@NotNull AutoCloseable closeable) {
|
|
closeable.getClass();
|
|
ViewModelImpl viewModelImpl = this.impl;
|
|
if (viewModelImpl != null) {
|
|
viewModelImpl.addCloseable(closeable);
|
|
}
|
|
}
|
|
|
|
@Deprecated(level = DeprecationLevel.HIDDEN, message = "Replaced by `AutoCloseable` overload.")
|
|
public /* synthetic */ void addCloseable(Closeable closeable) {
|
|
closeable.getClass();
|
|
ViewModelImpl viewModelImpl = this.impl;
|
|
if (viewModelImpl != null) {
|
|
viewModelImpl.addCloseable(closeable);
|
|
}
|
|
}
|
|
|
|
public void onCleared() {
|
|
}
|
|
|
|
public ViewModel(@NotNull CoroutineScope coroutineScope) {
|
|
coroutineScope.getClass();
|
|
this.impl = new ViewModelImpl(coroutineScope);
|
|
}
|
|
|
|
public ViewModel(@NotNull AutoCloseable... autoCloseableArr) {
|
|
autoCloseableArr.getClass();
|
|
this.impl = new ViewModelImpl((AutoCloseable[]) Arrays.copyOf(autoCloseableArr, autoCloseableArr.length));
|
|
}
|
|
|
|
public ViewModel() {
|
|
this.impl = new ViewModelImpl();
|
|
}
|
|
|
|
@Deprecated(level = DeprecationLevel.HIDDEN, message = "Replaced by `AutoCloseable` overload.")
|
|
public /* synthetic */ ViewModel(Closeable... closeableArr) {
|
|
closeableArr.getClass();
|
|
this.impl = new ViewModelImpl((AutoCloseable[]) Arrays.copyOf(closeableArr, closeableArr.length));
|
|
}
|
|
}
|