113 lines
3.2 KiB
Smali
113 lines
3.2 KiB
Smali
|
.class Lcom/miguelgaeta/backgrounded/Backgrounded$Lifecycle;
|
||
|
.super Lcom/miguelgaeta/backgrounded/BackgroundedActivityLifecycleCallbacks;
|
||
|
.source "Backgrounded.java"
|
||
|
|
||
|
|
||
|
# annotations
|
||
|
.annotation system Ldalvik/annotation/EnclosingClass;
|
||
|
value = Lcom/miguelgaeta/backgrounded/Backgrounded;
|
||
|
.end annotation
|
||
|
|
||
|
.annotation system Ldalvik/annotation/InnerClass;
|
||
|
accessFlags = 0xa
|
||
|
name = "Lifecycle"
|
||
|
.end annotation
|
||
|
|
||
|
.annotation system Ldalvik/annotation/MemberClasses;
|
||
|
value = {
|
||
|
Lcom/miguelgaeta/backgrounded/Backgrounded$Lifecycle$Constants;
|
||
|
}
|
||
|
.end annotation
|
||
|
|
||
|
|
||
|
# instance fields
|
||
|
.field private subscription:Lrx/Subscription;
|
||
|
|
||
|
|
||
|
# direct methods
|
||
|
.method public constructor <init>()V
|
||
|
.locals 1
|
||
|
|
||
|
.prologue
|
||
|
invoke-direct {p0}, Lcom/miguelgaeta/backgrounded/BackgroundedActivityLifecycleCallbacks;-><init>()V
|
||
|
|
||
|
const/16 v0, 0x1f4
|
||
|
|
||
|
invoke-direct {p0, v0}, Lcom/miguelgaeta/backgrounded/Backgrounded$Lifecycle;->checkBackgrounded(I)V
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method private checkBackgrounded(I)V
|
||
|
.locals 3
|
||
|
.param p1, "delay" # I
|
||
|
|
||
|
.prologue
|
||
|
int-to-long v0, p1
|
||
|
|
||
|
sget-object v2, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit;
|
||
|
|
||
|
invoke-static {v0, v1, v2}, Lrx/Observable;->timer(JLjava/util/concurrent/TimeUnit;)Lrx/Observable;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
new-instance v1, Lcom/miguelgaeta/backgrounded/Backgrounded$Lifecycle$1;
|
||
|
|
||
|
invoke-direct {v1, p0}, Lcom/miguelgaeta/backgrounded/Backgrounded$Lifecycle$1;-><init>(Lcom/miguelgaeta/backgrounded/Backgrounded$Lifecycle;)V
|
||
|
|
||
|
new-instance v2, Lcom/miguelgaeta/backgrounded/Backgrounded$Lifecycle$2;
|
||
|
|
||
|
invoke-direct {v2, p0}, Lcom/miguelgaeta/backgrounded/Backgrounded$Lifecycle$2;-><init>(Lcom/miguelgaeta/backgrounded/Backgrounded$Lifecycle;)V
|
||
|
|
||
|
invoke-virtual {v0, v1, v2}, Lrx/Observable;->subscribe(Lrx/functions/Action1;Lrx/functions/Action1;)Lrx/Subscription;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
iput-object v0, p0, Lcom/miguelgaeta/backgrounded/Backgrounded$Lifecycle;->subscription:Lrx/Subscription;
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
|
||
|
# virtual methods
|
||
|
.method public onActivityPaused(Landroid/app/Activity;)V
|
||
|
.locals 1
|
||
|
.param p1, "activity" # Landroid/app/Activity;
|
||
|
|
||
|
.prologue
|
||
|
const/16 v0, 0x7d0
|
||
|
|
||
|
invoke-direct {p0, v0}, Lcom/miguelgaeta/backgrounded/Backgrounded$Lifecycle;->checkBackgrounded(I)V
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method public onActivityResumed(Landroid/app/Activity;)V
|
||
|
.locals 2
|
||
|
.param p1, "activity" # Landroid/app/Activity;
|
||
|
|
||
|
.prologue
|
||
|
iget-object v0, p0, Lcom/miguelgaeta/backgrounded/Backgrounded$Lifecycle;->subscription:Lrx/Subscription;
|
||
|
|
||
|
if-eqz v0, :cond_0
|
||
|
|
||
|
iget-object v0, p0, Lcom/miguelgaeta/backgrounded/Backgrounded$Lifecycle;->subscription:Lrx/Subscription;
|
||
|
|
||
|
invoke-interface {v0}, Lrx/Subscription;->unsubscribe()V
|
||
|
|
||
|
:cond_0
|
||
|
invoke-static {}, Lcom/miguelgaeta/backgrounded/Backgrounded;->access$000()Lrx/subjects/SerializedSubject;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
const/4 v1, 0x0
|
||
|
|
||
|
invoke-static {v1}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
invoke-virtual {v0, v1}, Lrx/subjects/SerializedSubject;->onNext(Ljava/lang/Object;)V
|
||
|
|
||
|
return-void
|
||
|
.end method
|