apkfuckery/com.discord/smali/androidx/lifecycle/ProcessLifecycleOwner.smali

309 lines
9.3 KiB
Smali
Raw Normal View History

2019-07-24 11:27:29 +00:00
.class public Landroidx/lifecycle/ProcessLifecycleOwner;
.super Ljava/lang/Object;
.source "ProcessLifecycleOwner.java"
# interfaces
.implements Landroidx/lifecycle/LifecycleOwner;
# static fields
2019-12-06 03:29:40 +00:00
.field public static final TIMEOUT_MS:J = 0x2bcL
.annotation build Landroidx/annotation/VisibleForTesting;
.end annotation
.end field
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public static final sInstance:Landroidx/lifecycle/ProcessLifecycleOwner;
2019-07-24 11:27:29 +00:00
# instance fields
2019-12-06 03:29:40 +00:00
.field public mDelayedPauseRunnable:Ljava/lang/Runnable;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public mHandler:Landroid/os/Handler;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public mInitializationListener:Landroidx/lifecycle/ReportFragment$ActivityInitializationListener;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public mPauseSent:Z
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public final mRegistry:Landroidx/lifecycle/LifecycleRegistry;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public mResumedCounter:I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public mStartedCounter:I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public mStopSent:Z
2019-07-24 11:27:29 +00:00
# direct methods
2019-12-06 03:29:40 +00:00
.method public static constructor <clinit>()V
2019-07-24 11:27:29 +00:00
.locals 1
new-instance v0, Landroidx/lifecycle/ProcessLifecycleOwner;
invoke-direct {v0}, Landroidx/lifecycle/ProcessLifecycleOwner;-><init>()V
sput-object v0, Landroidx/lifecycle/ProcessLifecycleOwner;->sInstance:Landroidx/lifecycle/ProcessLifecycleOwner;
return-void
.end method
2019-12-06 03:29:40 +00:00
.method public constructor <init>()V
2019-07-24 11:27:29 +00:00
.locals 1
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
const/4 v0, 0x0
iput v0, p0, Landroidx/lifecycle/ProcessLifecycleOwner;->mStartedCounter:I
iput v0, p0, Landroidx/lifecycle/ProcessLifecycleOwner;->mResumedCounter:I
const/4 v0, 0x1
iput-boolean v0, p0, Landroidx/lifecycle/ProcessLifecycleOwner;->mPauseSent:Z
iput-boolean v0, p0, Landroidx/lifecycle/ProcessLifecycleOwner;->mStopSent:Z
new-instance v0, Landroidx/lifecycle/LifecycleRegistry;
invoke-direct {v0, p0}, Landroidx/lifecycle/LifecycleRegistry;-><init>(Landroidx/lifecycle/LifecycleOwner;)V
iput-object v0, p0, Landroidx/lifecycle/ProcessLifecycleOwner;->mRegistry:Landroidx/lifecycle/LifecycleRegistry;
new-instance v0, Landroidx/lifecycle/ProcessLifecycleOwner$1;
invoke-direct {v0, p0}, Landroidx/lifecycle/ProcessLifecycleOwner$1;-><init>(Landroidx/lifecycle/ProcessLifecycleOwner;)V
iput-object v0, p0, Landroidx/lifecycle/ProcessLifecycleOwner;->mDelayedPauseRunnable:Ljava/lang/Runnable;
new-instance v0, Landroidx/lifecycle/ProcessLifecycleOwner$2;
invoke-direct {v0, p0}, Landroidx/lifecycle/ProcessLifecycleOwner$2;-><init>(Landroidx/lifecycle/ProcessLifecycleOwner;)V
iput-object v0, p0, Landroidx/lifecycle/ProcessLifecycleOwner;->mInitializationListener:Landroidx/lifecycle/ReportFragment$ActivityInitializationListener;
return-void
.end method
.method public static get()Landroidx/lifecycle/LifecycleOwner;
.locals 1
2019-12-06 03:29:40 +00:00
.annotation build Landroidx/annotation/NonNull;
.end annotation
2019-07-24 11:27:29 +00:00
sget-object v0, Landroidx/lifecycle/ProcessLifecycleOwner;->sInstance:Landroidx/lifecycle/ProcessLifecycleOwner;
return-object v0
.end method
2019-12-06 03:29:40 +00:00
.method public static init(Landroid/content/Context;)V
2019-07-24 11:27:29 +00:00
.locals 1
sget-object v0, Landroidx/lifecycle/ProcessLifecycleOwner;->sInstance:Landroidx/lifecycle/ProcessLifecycleOwner;
invoke-virtual {v0, p0}, Landroidx/lifecycle/ProcessLifecycleOwner;->attach(Landroid/content/Context;)V
return-void
.end method
# virtual methods
2019-12-06 03:29:40 +00:00
.method public activityPaused()V
2019-07-24 11:27:29 +00:00
.locals 4
iget v0, p0, Landroidx/lifecycle/ProcessLifecycleOwner;->mResumedCounter:I
add-int/lit8 v0, v0, -0x1
iput v0, p0, Landroidx/lifecycle/ProcessLifecycleOwner;->mResumedCounter:I
iget v0, p0, Landroidx/lifecycle/ProcessLifecycleOwner;->mResumedCounter:I
if-nez v0, :cond_0
iget-object v0, p0, Landroidx/lifecycle/ProcessLifecycleOwner;->mHandler:Landroid/os/Handler;
iget-object v1, p0, Landroidx/lifecycle/ProcessLifecycleOwner;->mDelayedPauseRunnable:Ljava/lang/Runnable;
const-wide/16 v2, 0x2bc
invoke-virtual {v0, v1, v2, v3}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z
:cond_0
return-void
.end method
2019-12-06 03:29:40 +00:00
.method public activityResumed()V
2019-07-24 11:27:29 +00:00
.locals 2
iget v0, p0, Landroidx/lifecycle/ProcessLifecycleOwner;->mResumedCounter:I
const/4 v1, 0x1
add-int/2addr v0, v1
iput v0, p0, Landroidx/lifecycle/ProcessLifecycleOwner;->mResumedCounter:I
iget v0, p0, Landroidx/lifecycle/ProcessLifecycleOwner;->mResumedCounter:I
if-ne v0, v1, :cond_1
iget-boolean v0, p0, Landroidx/lifecycle/ProcessLifecycleOwner;->mPauseSent:Z
if-eqz v0, :cond_0
iget-object v0, p0, Landroidx/lifecycle/ProcessLifecycleOwner;->mRegistry:Landroidx/lifecycle/LifecycleRegistry;
sget-object v1, Landroidx/lifecycle/Lifecycle$Event;->ON_RESUME:Landroidx/lifecycle/Lifecycle$Event;
invoke-virtual {v0, v1}, Landroidx/lifecycle/LifecycleRegistry;->handleLifecycleEvent(Landroidx/lifecycle/Lifecycle$Event;)V
const/4 v0, 0x0
iput-boolean v0, p0, Landroidx/lifecycle/ProcessLifecycleOwner;->mPauseSent:Z
2019-12-06 03:29:40 +00:00
goto :goto_0
2019-07-24 11:27:29 +00:00
:cond_0
iget-object v0, p0, Landroidx/lifecycle/ProcessLifecycleOwner;->mHandler:Landroid/os/Handler;
iget-object v1, p0, Landroidx/lifecycle/ProcessLifecycleOwner;->mDelayedPauseRunnable:Ljava/lang/Runnable;
invoke-virtual {v0, v1}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V
:cond_1
2019-12-06 03:29:40 +00:00
:goto_0
2019-07-24 11:27:29 +00:00
return-void
.end method
2019-12-06 03:29:40 +00:00
.method public activityStarted()V
2019-07-24 11:27:29 +00:00
.locals 2
iget v0, p0, Landroidx/lifecycle/ProcessLifecycleOwner;->mStartedCounter:I
const/4 v1, 0x1
add-int/2addr v0, v1
iput v0, p0, Landroidx/lifecycle/ProcessLifecycleOwner;->mStartedCounter:I
iget v0, p0, Landroidx/lifecycle/ProcessLifecycleOwner;->mStartedCounter:I
if-ne v0, v1, :cond_0
iget-boolean v0, p0, Landroidx/lifecycle/ProcessLifecycleOwner;->mStopSent:Z
if-eqz v0, :cond_0
iget-object v0, p0, Landroidx/lifecycle/ProcessLifecycleOwner;->mRegistry:Landroidx/lifecycle/LifecycleRegistry;
sget-object v1, Landroidx/lifecycle/Lifecycle$Event;->ON_START:Landroidx/lifecycle/Lifecycle$Event;
invoke-virtual {v0, v1}, Landroidx/lifecycle/LifecycleRegistry;->handleLifecycleEvent(Landroidx/lifecycle/Lifecycle$Event;)V
const/4 v0, 0x0
iput-boolean v0, p0, Landroidx/lifecycle/ProcessLifecycleOwner;->mStopSent:Z
:cond_0
return-void
.end method
2019-12-06 03:29:40 +00:00
.method public activityStopped()V
2019-07-24 11:27:29 +00:00
.locals 1
iget v0, p0, Landroidx/lifecycle/ProcessLifecycleOwner;->mStartedCounter:I
add-int/lit8 v0, v0, -0x1
iput v0, p0, Landroidx/lifecycle/ProcessLifecycleOwner;->mStartedCounter:I
invoke-virtual {p0}, Landroidx/lifecycle/ProcessLifecycleOwner;->dispatchStopIfNeeded()V
return-void
.end method
2019-12-06 03:29:40 +00:00
.method public attach(Landroid/content/Context;)V
2019-07-24 11:27:29 +00:00
.locals 2
new-instance v0, Landroid/os/Handler;
invoke-direct {v0}, Landroid/os/Handler;-><init>()V
iput-object v0, p0, Landroidx/lifecycle/ProcessLifecycleOwner;->mHandler:Landroid/os/Handler;
iget-object v0, p0, Landroidx/lifecycle/ProcessLifecycleOwner;->mRegistry:Landroidx/lifecycle/LifecycleRegistry;
sget-object v1, Landroidx/lifecycle/Lifecycle$Event;->ON_CREATE:Landroidx/lifecycle/Lifecycle$Event;
invoke-virtual {v0, v1}, Landroidx/lifecycle/LifecycleRegistry;->handleLifecycleEvent(Landroidx/lifecycle/Lifecycle$Event;)V
invoke-virtual {p1}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;
move-result-object p1
check-cast p1, Landroid/app/Application;
new-instance v0, Landroidx/lifecycle/ProcessLifecycleOwner$3;
invoke-direct {v0, p0}, Landroidx/lifecycle/ProcessLifecycleOwner$3;-><init>(Landroidx/lifecycle/ProcessLifecycleOwner;)V
invoke-virtual {p1, v0}, Landroid/app/Application;->registerActivityLifecycleCallbacks(Landroid/app/Application$ActivityLifecycleCallbacks;)V
return-void
.end method
2019-12-06 03:29:40 +00:00
.method public dispatchPauseIfNeeded()V
2019-07-24 11:27:29 +00:00
.locals 2
iget v0, p0, Landroidx/lifecycle/ProcessLifecycleOwner;->mResumedCounter:I
if-nez v0, :cond_0
const/4 v0, 0x1
iput-boolean v0, p0, Landroidx/lifecycle/ProcessLifecycleOwner;->mPauseSent:Z
iget-object v0, p0, Landroidx/lifecycle/ProcessLifecycleOwner;->mRegistry:Landroidx/lifecycle/LifecycleRegistry;
sget-object v1, Landroidx/lifecycle/Lifecycle$Event;->ON_PAUSE:Landroidx/lifecycle/Lifecycle$Event;
invoke-virtual {v0, v1}, Landroidx/lifecycle/LifecycleRegistry;->handleLifecycleEvent(Landroidx/lifecycle/Lifecycle$Event;)V
:cond_0
return-void
.end method
2019-12-06 03:29:40 +00:00
.method public dispatchStopIfNeeded()V
2019-07-24 11:27:29 +00:00
.locals 2
iget v0, p0, Landroidx/lifecycle/ProcessLifecycleOwner;->mStartedCounter:I
if-nez v0, :cond_0
iget-boolean v0, p0, Landroidx/lifecycle/ProcessLifecycleOwner;->mPauseSent:Z
if-eqz v0, :cond_0
iget-object v0, p0, Landroidx/lifecycle/ProcessLifecycleOwner;->mRegistry:Landroidx/lifecycle/LifecycleRegistry;
sget-object v1, Landroidx/lifecycle/Lifecycle$Event;->ON_STOP:Landroidx/lifecycle/Lifecycle$Event;
invoke-virtual {v0, v1}, Landroidx/lifecycle/LifecycleRegistry;->handleLifecycleEvent(Landroidx/lifecycle/Lifecycle$Event;)V
const/4 v0, 0x1
iput-boolean v0, p0, Landroidx/lifecycle/ProcessLifecycleOwner;->mStopSent:Z
:cond_0
return-void
.end method
.method public getLifecycle()Landroidx/lifecycle/Lifecycle;
.locals 1
2019-12-06 03:29:40 +00:00
.annotation build Landroidx/annotation/NonNull;
.end annotation
2019-07-24 11:27:29 +00:00
iget-object v0, p0, Landroidx/lifecycle/ProcessLifecycleOwner;->mRegistry:Landroidx/lifecycle/LifecycleRegistry;
return-object v0
.end method