171 lines
5.4 KiB
Smali
171 lines
5.4 KiB
Smali
.class public Landroidx/work/impl/background/systemalarm/SystemAlarmService;
|
|
.super Landroidx/lifecycle/LifecycleService;
|
|
.source "SystemAlarmService.java"
|
|
|
|
# interfaces
|
|
.implements Landroidx/work/impl/background/systemalarm/SystemAlarmDispatcher$CommandsCompletedListener;
|
|
|
|
|
|
# annotations
|
|
.annotation build Landroidx/annotation/RestrictTo;
|
|
value = {
|
|
.enum Landroidx/annotation/RestrictTo$Scope;->LIBRARY_GROUP:Landroidx/annotation/RestrictTo$Scope;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field private static final TAG:Ljava/lang/String;
|
|
|
|
|
|
# instance fields
|
|
.field private mDispatcher:Landroidx/work/impl/background/systemalarm/SystemAlarmDispatcher;
|
|
|
|
.field private mIsShutdown:Z
|
|
|
|
|
|
# direct methods
|
|
.method public static constructor <clinit>()V
|
|
.locals 1
|
|
|
|
const-string v0, "SystemAlarmService"
|
|
|
|
invoke-static {v0}, Landroidx/work/Logger;->tagWithPrefix(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
sput-object v0, Landroidx/work/impl/background/systemalarm/SystemAlarmService;->TAG:Ljava/lang/String;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Landroidx/lifecycle/LifecycleService;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private initializeDispatcher()V
|
|
.locals 1
|
|
.annotation build Landroidx/annotation/MainThread;
|
|
.end annotation
|
|
|
|
new-instance v0, Landroidx/work/impl/background/systemalarm/SystemAlarmDispatcher;
|
|
|
|
invoke-direct {v0, p0}, Landroidx/work/impl/background/systemalarm/SystemAlarmDispatcher;-><init>(Landroid/content/Context;)V
|
|
|
|
iput-object v0, p0, Landroidx/work/impl/background/systemalarm/SystemAlarmService;->mDispatcher:Landroidx/work/impl/background/systemalarm/SystemAlarmDispatcher;
|
|
|
|
invoke-virtual {v0, p0}, Landroidx/work/impl/background/systemalarm/SystemAlarmDispatcher;->setCompletedListener(Landroidx/work/impl/background/systemalarm/SystemAlarmDispatcher$CommandsCompletedListener;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public onAllCommandsCompleted()V
|
|
.locals 4
|
|
.annotation build Landroidx/annotation/MainThread;
|
|
.end annotation
|
|
|
|
const/4 v0, 0x1
|
|
|
|
iput-boolean v0, p0, Landroidx/work/impl/background/systemalarm/SystemAlarmService;->mIsShutdown:Z
|
|
|
|
invoke-static {}, Landroidx/work/Logger;->get()Landroidx/work/Logger;
|
|
|
|
move-result-object v0
|
|
|
|
sget-object v1, Landroidx/work/impl/background/systemalarm/SystemAlarmService;->TAG:Ljava/lang/String;
|
|
|
|
const/4 v2, 0x0
|
|
|
|
new-array v2, v2, [Ljava/lang/Throwable;
|
|
|
|
const-string v3, "All commands completed in dispatcher"
|
|
|
|
invoke-virtual {v0, v1, v3, v2}, Landroidx/work/Logger;->debug(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Throwable;)V
|
|
|
|
invoke-static {}, Landroidx/work/impl/utils/WakeLocks;->checkWakeLocks()V
|
|
|
|
invoke-virtual {p0}, Landroid/app/Service;->stopSelf()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public onCreate()V
|
|
.locals 1
|
|
|
|
invoke-super {p0}, Landroidx/lifecycle/LifecycleService;->onCreate()V
|
|
|
|
invoke-direct {p0}, Landroidx/work/impl/background/systemalarm/SystemAlarmService;->initializeDispatcher()V
|
|
|
|
const/4 v0, 0x0
|
|
|
|
iput-boolean v0, p0, Landroidx/work/impl/background/systemalarm/SystemAlarmService;->mIsShutdown:Z
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public onDestroy()V
|
|
.locals 1
|
|
|
|
invoke-super {p0}, Landroidx/lifecycle/LifecycleService;->onDestroy()V
|
|
|
|
const/4 v0, 0x1
|
|
|
|
iput-boolean v0, p0, Landroidx/work/impl/background/systemalarm/SystemAlarmService;->mIsShutdown:Z
|
|
|
|
iget-object v0, p0, Landroidx/work/impl/background/systemalarm/SystemAlarmService;->mDispatcher:Landroidx/work/impl/background/systemalarm/SystemAlarmDispatcher;
|
|
|
|
invoke-virtual {v0}, Landroidx/work/impl/background/systemalarm/SystemAlarmDispatcher;->onDestroy()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public onStartCommand(Landroid/content/Intent;II)I
|
|
.locals 4
|
|
|
|
invoke-super {p0, p1, p2, p3}, Landroidx/lifecycle/LifecycleService;->onStartCommand(Landroid/content/Intent;II)I
|
|
|
|
iget-boolean p2, p0, Landroidx/work/impl/background/systemalarm/SystemAlarmService;->mIsShutdown:Z
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
invoke-static {}, Landroidx/work/Logger;->get()Landroidx/work/Logger;
|
|
|
|
move-result-object p2
|
|
|
|
sget-object v0, Landroidx/work/impl/background/systemalarm/SystemAlarmService;->TAG:Ljava/lang/String;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
new-array v2, v1, [Ljava/lang/Throwable;
|
|
|
|
const-string v3, "Re-initializing SystemAlarmDispatcher after a request to shut-down."
|
|
|
|
invoke-virtual {p2, v0, v3, v2}, Landroidx/work/Logger;->info(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Throwable;)V
|
|
|
|
iget-object p2, p0, Landroidx/work/impl/background/systemalarm/SystemAlarmService;->mDispatcher:Landroidx/work/impl/background/systemalarm/SystemAlarmDispatcher;
|
|
|
|
invoke-virtual {p2}, Landroidx/work/impl/background/systemalarm/SystemAlarmDispatcher;->onDestroy()V
|
|
|
|
invoke-direct {p0}, Landroidx/work/impl/background/systemalarm/SystemAlarmService;->initializeDispatcher()V
|
|
|
|
iput-boolean v1, p0, Landroidx/work/impl/background/systemalarm/SystemAlarmService;->mIsShutdown:Z
|
|
|
|
:cond_0
|
|
if-eqz p1, :cond_1
|
|
|
|
iget-object p2, p0, Landroidx/work/impl/background/systemalarm/SystemAlarmService;->mDispatcher:Landroidx/work/impl/background/systemalarm/SystemAlarmDispatcher;
|
|
|
|
invoke-virtual {p2, p1, p3}, Landroidx/work/impl/background/systemalarm/SystemAlarmDispatcher;->add(Landroid/content/Intent;I)Z
|
|
|
|
:cond_1
|
|
const/4 p1, 0x3
|
|
|
|
return p1
|
|
.end method
|