Rabbit-R1/original r1/smali/smali_classes2/androidx/lifecycle/SavedStateHandlesProvider.smali

307 lines
9.6 KiB
Smali
Raw Normal View History

2024-05-21 16:08:36 -05:00
.class public final Landroidx/lifecycle/SavedStateHandlesProvider;
.super Ljava/lang/Object;
.source "SavedStateHandleSupport.kt"
# interfaces
.implements Landroidx/savedstate/SavedStateRegistry$SavedStateProvider;
# annotations
.annotation system Ldalvik/annotation/SourceDebugExtension;
value = "SMAP\nSavedStateHandleSupport.kt\nKotlin\n*S Kotlin\n*F\n+ 1 SavedStateHandleSupport.kt\nandroidx/lifecycle/SavedStateHandlesProvider\n+ 2 _Maps.kt\nkotlin/collections/MapsKt___MapsKt\n+ 3 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,225:1\n215#2,2:226\n1#3:228\n*S KotlinDebug\n*F\n+ 1 SavedStateHandleSupport.kt\nandroidx/lifecycle/SavedStateHandlesProvider\n*L\n146#1:226,2\n*E\n"
.end annotation
.annotation runtime Lkotlin/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\u0008\u0002\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0008\u0006\n\u0002\u0010\u000e\n\u0000\n\u0002\u0010\u0002\n\u0002\u0008\u0002\u0008\u0000\u0018\u00002\u00020\u0001B\u0015\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\u0006\u0010\u0004\u001a\u00020\u0005\u00a2\u0006\u0002\u0010\u0006J\u0010\u0010\u0011\u001a\u0004\u0018\u00010\n2\u0006\u0010\u0012\u001a\u00020\u0013J\u0006\u0010\u0014\u001a\u00020\u0015J\u0008\u0010\u0016\u001a\u00020\nH\u0016R\u000e\u0010\u0007\u001a\u00020\u0008X\u0082\u000e\u00a2\u0006\u0002\n\u0000R\u0010\u0010\t\u001a\u0004\u0018\u00010\nX\u0082\u000e\u00a2\u0006\u0002\n\u0000R\u000e\u0010\u0002\u001a\u00020\u0003X\u0082\u0004\u00a2\u0006\u0002\n\u0000R\u001b\u0010\u000b\u001a\u00020\u000c8BX\u0082\u0084\u0002\u00a2\u0006\u000c\n\u0004\u0008\u000f\u0010\u0010\u001a\u0004\u0008\r\u0010\u000e\u00a8\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 = 0x1
mv = {
0x1,
0x8,
0x0
}
xi = 0x30
.end annotation
# instance fields
.field private restored:Z
.field private restoredState:Landroid/os/Bundle;
.field private final savedStateRegistry:Landroidx/savedstate/SavedStateRegistry;
.field private final viewModel$delegate:Lkotlin/Lazy;
# direct methods
.method public constructor <init>(Landroidx/savedstate/SavedStateRegistry;Landroidx/lifecycle/ViewModelStoreOwner;)V
.locals 1
const-string v0, "savedStateRegistry"
invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
const-string v0, "viewModelStoreOwner"
invoke-static {p2, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
.line 126
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
iput-object p1, p0, Landroidx/lifecycle/SavedStateHandlesProvider;->savedStateRegistry:Landroidx/savedstate/SavedStateRegistry;
.line 133
new-instance p1, Landroidx/lifecycle/SavedStateHandlesProvider$viewModel$2;
invoke-direct {p1, p2}, Landroidx/lifecycle/SavedStateHandlesProvider$viewModel$2;-><init>(Landroidx/lifecycle/ViewModelStoreOwner;)V
check-cast p1, Lkotlin/jvm/functions/Function0;
invoke-static {p1}, Lkotlin/LazyKt;->lazy(Lkotlin/jvm/functions/Function0;)Lkotlin/Lazy;
move-result-object p1
iput-object p1, p0, Landroidx/lifecycle/SavedStateHandlesProvider;->viewModel$delegate:Lkotlin/Lazy;
return-void
.end method
.method private final getViewModel()Landroidx/lifecycle/SavedStateHandlesVM;
.locals 0
iget-object p0, p0, Landroidx/lifecycle/SavedStateHandlesProvider;->viewModel$delegate:Lkotlin/Lazy;
.line 133
invoke-interface {p0}, Lkotlin/Lazy;->getValue()Ljava/lang/Object;
move-result-object p0
check-cast p0, Landroidx/lifecycle/SavedStateHandlesVM;
return-object p0
.end method
# virtual methods
.method public final consumeRestoredStateForKey(Ljava/lang/String;)Landroid/os/Bundle;
.locals 3
const-string v0, "key"
invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
.line 180
invoke-virtual {p0}, Landroidx/lifecycle/SavedStateHandlesProvider;->performRestore()V
iget-object v0, p0, Landroidx/lifecycle/SavedStateHandlesProvider;->restoredState:Landroid/os/Bundle;
const/4 v1, 0x0
if-eqz v0, :cond_0
.line 181
invoke-virtual {v0, p1}, Landroid/os/Bundle;->getBundle(Ljava/lang/String;)Landroid/os/Bundle;
move-result-object v0
goto :goto_0
:cond_0
move-object v0, v1
:goto_0
iget-object v2, p0, Landroidx/lifecycle/SavedStateHandlesProvider;->restoredState:Landroid/os/Bundle;
if-eqz v2, :cond_1
.line 182
invoke-virtual {v2, p1}, Landroid/os/Bundle;->remove(Ljava/lang/String;)V
:cond_1
iget-object p1, p0, Landroidx/lifecycle/SavedStateHandlesProvider;->restoredState:Landroid/os/Bundle;
if-eqz p1, :cond_2
.line 183
invoke-virtual {p1}, Landroid/os/Bundle;->isEmpty()Z
move-result p1
const/4 v2, 0x1
if-ne p1, v2, :cond_2
iput-object v1, p0, Landroidx/lifecycle/SavedStateHandlesProvider;->restoredState:Landroid/os/Bundle;
:cond_2
return-object v0
.end method
.method public final performRestore()V
.locals 3
iget-boolean v0, p0, Landroidx/lifecycle/SavedStateHandlesProvider;->restored:Z
if-nez v0, :cond_2
iget-object v0, p0, Landroidx/lifecycle/SavedStateHandlesProvider;->savedStateRegistry:Landroidx/savedstate/SavedStateRegistry;
const-string v1, "androidx.lifecycle.internal.SavedStateHandlesProvider"
.line 163
invoke-virtual {v0, v1}, Landroidx/savedstate/SavedStateRegistry;->consumeRestoredStateForKey(Ljava/lang/String;)Landroid/os/Bundle;
move-result-object v0
.line 164
new-instance v1, Landroid/os/Bundle;
invoke-direct {v1}, Landroid/os/Bundle;-><init>()V
iget-object v2, p0, Landroidx/lifecycle/SavedStateHandlesProvider;->restoredState:Landroid/os/Bundle;
if-eqz v2, :cond_0
.line 165
invoke-virtual {v1, v2}, Landroid/os/Bundle;->putAll(Landroid/os/Bundle;)V
:cond_0
if-eqz v0, :cond_1
.line 166
invoke-virtual {v1, v0}, Landroid/os/Bundle;->putAll(Landroid/os/Bundle;)V
:cond_1
iput-object v1, p0, Landroidx/lifecycle/SavedStateHandlesProvider;->restoredState:Landroid/os/Bundle;
const/4 v0, 0x1
iput-boolean v0, p0, Landroidx/lifecycle/SavedStateHandlesProvider;->restored:Z
.line 172
invoke-direct {p0}, Landroidx/lifecycle/SavedStateHandlesProvider;->getViewModel()Landroidx/lifecycle/SavedStateHandlesVM;
:cond_2
return-void
.end method
.method public saveState()Landroid/os/Bundle;
.locals 5
.line 138
new-instance v0, Landroid/os/Bundle;
invoke-direct {v0}, Landroid/os/Bundle;-><init>()V
iget-object v1, p0, Landroidx/lifecycle/SavedStateHandlesProvider;->restoredState:Landroid/os/Bundle;
if-eqz v1, :cond_0
.line 142
invoke-virtual {v0, v1}, Landroid/os/Bundle;->putAll(Landroid/os/Bundle;)V
.line 146
:cond_0
invoke-direct {p0}, Landroidx/lifecycle/SavedStateHandlesProvider;->getViewModel()Landroidx/lifecycle/SavedStateHandlesVM;
move-result-object v1
invoke-virtual {v1}, Landroidx/lifecycle/SavedStateHandlesVM;->getHandles()Ljava/util/Map;
move-result-object v1
.line 226
invoke-interface {v1}, Ljava/util/Map;->entrySet()Ljava/util/Set;
move-result-object v1
invoke-interface {v1}, Ljava/util/Set;->iterator()Ljava/util/Iterator;
move-result-object v1
:cond_1
:goto_0
invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z
move-result v2
if-eqz v2, :cond_2
invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v2
check-cast v2, Ljava/util/Map$Entry;
.line 146
invoke-interface {v2}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;
move-result-object v3
check-cast v3, Ljava/lang/String;
invoke-interface {v2}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;
move-result-object v2
check-cast v2, Landroidx/lifecycle/SavedStateHandle;
.line 147
invoke-virtual {v2}, Landroidx/lifecycle/SavedStateHandle;->savedStateProvider()Landroidx/savedstate/SavedStateRegistry$SavedStateProvider;
move-result-object v2
invoke-interface {v2}, Landroidx/savedstate/SavedStateRegistry$SavedStateProvider;->saveState()Landroid/os/Bundle;
move-result-object v2
.line 148
sget-object v4, Landroid/os/Bundle;->EMPTY:Landroid/os/Bundle;
invoke-static {v2, v4}, Lkotlin/jvm/internal/Intrinsics;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z
move-result v4
if-nez v4, :cond_1
.line 149
invoke-virtual {v0, v3, v2}, Landroid/os/Bundle;->putBundle(Ljava/lang/String;Landroid/os/Bundle;)V
goto :goto_0
:cond_2
const/4 v1, 0x0
iput-boolean v1, p0, Landroidx/lifecycle/SavedStateHandlesProvider;->restored:Z
return-object v0
.end method