99 lines
3.4 KiB
Smali
99 lines
3.4 KiB
Smali
|
.class public final Landroidx/savedstate/SavedStateRegistryController;
|
||
|
.super Ljava/lang/Object;
|
||
|
.source "SavedStateRegistryController.java"
|
||
|
|
||
|
|
||
|
# instance fields
|
||
|
.field private final mOwner:Landroidx/savedstate/SavedStateRegistryOwner;
|
||
|
|
||
|
.field private final mRegistry:Landroidx/savedstate/SavedStateRegistry;
|
||
|
|
||
|
|
||
|
# direct methods
|
||
|
.method private constructor <init>(Landroidx/savedstate/SavedStateRegistryOwner;)V
|
||
|
.locals 0
|
||
|
|
||
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
||
|
|
||
|
iput-object p1, p0, Landroidx/savedstate/SavedStateRegistryController;->mOwner:Landroidx/savedstate/SavedStateRegistryOwner;
|
||
|
|
||
|
new-instance p1, Landroidx/savedstate/SavedStateRegistry;
|
||
|
|
||
|
invoke-direct {p1}, Landroidx/savedstate/SavedStateRegistry;-><init>()V
|
||
|
|
||
|
iput-object p1, p0, Landroidx/savedstate/SavedStateRegistryController;->mRegistry:Landroidx/savedstate/SavedStateRegistry;
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method public static create(Landroidx/savedstate/SavedStateRegistryOwner;)Landroidx/savedstate/SavedStateRegistryController;
|
||
|
.locals 1
|
||
|
|
||
|
new-instance v0, Landroidx/savedstate/SavedStateRegistryController;
|
||
|
|
||
|
invoke-direct {v0, p0}, Landroidx/savedstate/SavedStateRegistryController;-><init>(Landroidx/savedstate/SavedStateRegistryOwner;)V
|
||
|
|
||
|
return-object v0
|
||
|
.end method
|
||
|
|
||
|
|
||
|
# virtual methods
|
||
|
.method public final getSavedStateRegistry()Landroidx/savedstate/SavedStateRegistry;
|
||
|
.locals 1
|
||
|
|
||
|
iget-object v0, p0, Landroidx/savedstate/SavedStateRegistryController;->mRegistry:Landroidx/savedstate/SavedStateRegistry;
|
||
|
|
||
|
return-object v0
|
||
|
.end method
|
||
|
|
||
|
.method public final performRestore(Landroid/os/Bundle;)V
|
||
|
.locals 3
|
||
|
|
||
|
iget-object v0, p0, Landroidx/savedstate/SavedStateRegistryController;->mOwner:Landroidx/savedstate/SavedStateRegistryOwner;
|
||
|
|
||
|
invoke-interface {v0}, Landroidx/savedstate/SavedStateRegistryOwner;->getLifecycle()Landroidx/lifecycle/Lifecycle;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
invoke-virtual {v0}, Landroidx/lifecycle/Lifecycle;->getCurrentState()Landroidx/lifecycle/Lifecycle$State;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
sget-object v2, Landroidx/lifecycle/Lifecycle$State;->INITIALIZED:Landroidx/lifecycle/Lifecycle$State;
|
||
|
|
||
|
if-ne v1, v2, :cond_0
|
||
|
|
||
|
new-instance v1, Landroidx/savedstate/Recreator;
|
||
|
|
||
|
iget-object v2, p0, Landroidx/savedstate/SavedStateRegistryController;->mOwner:Landroidx/savedstate/SavedStateRegistryOwner;
|
||
|
|
||
|
invoke-direct {v1, v2}, Landroidx/savedstate/Recreator;-><init>(Landroidx/savedstate/SavedStateRegistryOwner;)V
|
||
|
|
||
|
invoke-virtual {v0, v1}, Landroidx/lifecycle/Lifecycle;->addObserver(Landroidx/lifecycle/LifecycleObserver;)V
|
||
|
|
||
|
iget-object v1, p0, Landroidx/savedstate/SavedStateRegistryController;->mRegistry:Landroidx/savedstate/SavedStateRegistry;
|
||
|
|
||
|
invoke-virtual {v1, v0, p1}, Landroidx/savedstate/SavedStateRegistry;->performRestore(Landroidx/lifecycle/Lifecycle;Landroid/os/Bundle;)V
|
||
|
|
||
|
return-void
|
||
|
|
||
|
:cond_0
|
||
|
new-instance p1, Ljava/lang/IllegalStateException;
|
||
|
|
||
|
const-string v0, "Restarter must be created only during owner\'s initialization stage"
|
||
|
|
||
|
invoke-direct {p1, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
|
||
|
|
||
|
throw p1
|
||
|
.end method
|
||
|
|
||
|
.method public final performSave(Landroid/os/Bundle;)V
|
||
|
.locals 1
|
||
|
|
||
|
iget-object v0, p0, Landroidx/savedstate/SavedStateRegistryController;->mRegistry:Landroidx/savedstate/SavedStateRegistry;
|
||
|
|
||
|
invoke-virtual {v0, p1}, Landroidx/savedstate/SavedStateRegistry;->performSave(Landroid/os/Bundle;)V
|
||
|
|
||
|
return-void
|
||
|
.end method
|