apkfuckery/com.discord/smali/androidx/activity/OnBackPressedDispatcher$LifecycleOnBackPressedCancellable.smali

137 lines
5 KiB
Smali
Raw Normal View History

2019-12-06 03:29:40 +00:00
.class public Landroidx/activity/OnBackPressedDispatcher$LifecycleOnBackPressedCancellable;
2019-10-07 23:23:22 +00:00
.super Ljava/lang/Object;
.source "OnBackPressedDispatcher.java"
# interfaces
.implements Landroidx/lifecycle/LifecycleEventObserver;
2019-12-06 03:29:40 +00:00
.implements Landroidx/activity/Cancellable;
2019-10-07 23:23:22 +00:00
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Landroidx/activity/OnBackPressedDispatcher;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
2019-12-06 03:29:40 +00:00
accessFlags = 0x1
2019-10-07 23:23:22 +00:00
name = "LifecycleOnBackPressedCancellable"
.end annotation
# instance fields
2019-12-06 03:29:40 +00:00
.field public mCurrentCancellable:Landroidx/activity/Cancellable;
.annotation build Landroidx/annotation/Nullable;
.end annotation
.end field
2019-10-07 23:23:22 +00:00
2019-12-06 03:29:40 +00:00
.field public final mLifecycle:Landroidx/lifecycle/Lifecycle;
2019-10-07 23:23:22 +00:00
2019-12-06 03:29:40 +00:00
.field public final mOnBackPressedCallback:Landroidx/activity/OnBackPressedCallback;
2019-10-07 23:23:22 +00:00
2019-12-06 03:29:40 +00:00
.field public final synthetic this$0:Landroidx/activity/OnBackPressedDispatcher;
2019-10-07 23:23:22 +00:00
# direct methods
2019-12-06 03:29:40 +00:00
.method public constructor <init>(Landroidx/activity/OnBackPressedDispatcher;Landroidx/lifecycle/Lifecycle;Landroidx/activity/OnBackPressedCallback;)V
2019-10-07 23:23:22 +00:00
.locals 0
2019-12-06 03:29:40 +00:00
.param p1 # Landroidx/activity/OnBackPressedDispatcher;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.param p2 # Landroidx/lifecycle/Lifecycle;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
2019-10-07 23:23:22 +00:00
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
2019-12-06 03:29:40 +00:00
.param p1 # Landroidx/lifecycle/LifecycleOwner;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.param p2 # Landroidx/lifecycle/Lifecycle$Event;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
2019-10-07 23:23:22 +00:00
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;
2019-12-06 03:29:40 +00:00
goto :goto_0
2019-10-07 23:23:22 +00:00
: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
2019-12-06 03:29:40 +00:00
goto :goto_0
2019-10-07 23:23:22 +00:00
: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
2019-12-06 03:29:40 +00:00
:goto_0
2019-10-07 23:23:22 +00:00
return-void
.end method