116 lines
4.3 KiB
Smali
116 lines
4.3 KiB
Smali
.class Landroidx/activity/OnBackPressedDispatcher$LifecycleOnBackPressedCancellable;
|
|
.super Ljava/lang/Object;
|
|
.source "OnBackPressedDispatcher.java"
|
|
|
|
# interfaces
|
|
.implements Landroidx/activity/Cancellable;
|
|
.implements Landroidx/lifecycle/LifecycleEventObserver;
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/EnclosingClass;
|
|
value = Landroidx/activity/OnBackPressedDispatcher;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/InnerClass;
|
|
accessFlags = 0x0
|
|
name = "LifecycleOnBackPressedCancellable"
|
|
.end annotation
|
|
|
|
|
|
# instance fields
|
|
.field private mCurrentCancellable:Landroidx/activity/Cancellable;
|
|
|
|
.field private final mLifecycle:Landroidx/lifecycle/Lifecycle;
|
|
|
|
.field private final mOnBackPressedCallback:Landroidx/activity/OnBackPressedCallback;
|
|
|
|
.field final synthetic this$0:Landroidx/activity/OnBackPressedDispatcher;
|
|
|
|
|
|
# direct methods
|
|
.method constructor <init>(Landroidx/activity/OnBackPressedDispatcher;Landroidx/lifecycle/Lifecycle;Landroidx/activity/OnBackPressedCallback;)V
|
|
.locals 0
|
|
|
|
iput-object p1, p0, Landroidx/activity/OnBackPressedDispatcher$LifecycleOnBackPressedCancellable;->this$0:Landroidx/activity/OnBackPressedDispatcher;
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
iput-object p2, p0, Landroidx/activity/OnBackPressedDispatcher$LifecycleOnBackPressedCancellable;->mLifecycle:Landroidx/lifecycle/Lifecycle;
|
|
|
|
iput-object p3, p0, Landroidx/activity/OnBackPressedDispatcher$LifecycleOnBackPressedCancellable;->mOnBackPressedCallback:Landroidx/activity/OnBackPressedCallback;
|
|
|
|
invoke-virtual {p2, p0}, Landroidx/lifecycle/Lifecycle;->addObserver(Landroidx/lifecycle/LifecycleObserver;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public cancel()V
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Landroidx/activity/OnBackPressedDispatcher$LifecycleOnBackPressedCancellable;->mLifecycle:Landroidx/lifecycle/Lifecycle;
|
|
|
|
invoke-virtual {v0, p0}, Landroidx/lifecycle/Lifecycle;->removeObserver(Landroidx/lifecycle/LifecycleObserver;)V
|
|
|
|
iget-object v0, p0, Landroidx/activity/OnBackPressedDispatcher$LifecycleOnBackPressedCancellable;->mOnBackPressedCallback:Landroidx/activity/OnBackPressedCallback;
|
|
|
|
invoke-virtual {v0, p0}, Landroidx/activity/OnBackPressedCallback;->removeCancellable(Landroidx/activity/Cancellable;)V
|
|
|
|
iget-object v0, p0, Landroidx/activity/OnBackPressedDispatcher$LifecycleOnBackPressedCancellable;->mCurrentCancellable:Landroidx/activity/Cancellable;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-interface {v0}, Landroidx/activity/Cancellable;->cancel()V
|
|
|
|
const/4 v0, 0x0
|
|
|
|
iput-object v0, p0, Landroidx/activity/OnBackPressedDispatcher$LifecycleOnBackPressedCancellable;->mCurrentCancellable:Landroidx/activity/Cancellable;
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public onStateChanged(Landroidx/lifecycle/LifecycleOwner;Landroidx/lifecycle/Lifecycle$Event;)V
|
|
.locals 0
|
|
|
|
sget-object p1, Landroidx/lifecycle/Lifecycle$Event;->ON_START:Landroidx/lifecycle/Lifecycle$Event;
|
|
|
|
if-ne p2, p1, :cond_0
|
|
|
|
iget-object p1, p0, Landroidx/activity/OnBackPressedDispatcher$LifecycleOnBackPressedCancellable;->this$0:Landroidx/activity/OnBackPressedDispatcher;
|
|
|
|
iget-object p2, p0, Landroidx/activity/OnBackPressedDispatcher$LifecycleOnBackPressedCancellable;->mOnBackPressedCallback:Landroidx/activity/OnBackPressedCallback;
|
|
|
|
invoke-virtual {p1, p2}, Landroidx/activity/OnBackPressedDispatcher;->addCancellableCallback(Landroidx/activity/OnBackPressedCallback;)Landroidx/activity/Cancellable;
|
|
|
|
move-result-object p1
|
|
|
|
iput-object p1, p0, Landroidx/activity/OnBackPressedDispatcher$LifecycleOnBackPressedCancellable;->mCurrentCancellable:Landroidx/activity/Cancellable;
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
sget-object p1, Landroidx/lifecycle/Lifecycle$Event;->ON_STOP:Landroidx/lifecycle/Lifecycle$Event;
|
|
|
|
if-ne p2, p1, :cond_1
|
|
|
|
iget-object p1, p0, Landroidx/activity/OnBackPressedDispatcher$LifecycleOnBackPressedCancellable;->mCurrentCancellable:Landroidx/activity/Cancellable;
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
invoke-interface {p1}, Landroidx/activity/Cancellable;->cancel()V
|
|
|
|
return-void
|
|
|
|
:cond_1
|
|
sget-object p1, Landroidx/lifecycle/Lifecycle$Event;->ON_DESTROY:Landroidx/lifecycle/Lifecycle$Event;
|
|
|
|
if-ne p2, p1, :cond_2
|
|
|
|
invoke-virtual {p0}, Landroidx/activity/OnBackPressedDispatcher$LifecycleOnBackPressedCancellable;->cancel()V
|
|
|
|
:cond_2
|
|
return-void
|
|
.end method
|