apkfuckery/com.discord/smali/androidx/legacy/content/WakefulBroadcastReceiver.smali

225 lines
5.9 KiB
Smali
Raw Normal View History

2019-07-24 11:27:29 +00:00
.class public abstract Landroidx/legacy/content/WakefulBroadcastReceiver;
.super Landroid/content/BroadcastReceiver;
.source "WakefulBroadcastReceiver.java"
# annotations
.annotation runtime Ljava/lang/Deprecated;
.end annotation
# static fields
2019-12-06 03:29:40 +00:00
.field public static final EXTRA_WAKE_LOCK_ID:Ljava/lang/String; = "androidx.contentpager.content.wakelockid"
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public static mNextId:I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public static final sActiveWakeLocks:Landroid/util/SparseArray;
2019-07-24 11:27:29 +00:00
.annotation system Ldalvik/annotation/Signature;
value = {
"Landroid/util/SparseArray<",
"Landroid/os/PowerManager$WakeLock;",
">;"
}
.end annotation
.end field
# 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, Landroid/util/SparseArray;
invoke-direct {v0}, Landroid/util/SparseArray;-><init>()V
sput-object v0, Landroidx/legacy/content/WakefulBroadcastReceiver;->sActiveWakeLocks:Landroid/util/SparseArray;
const/4 v0, 0x1
sput v0, Landroidx/legacy/content/WakefulBroadcastReceiver;->mNextId:I
return-void
.end method
.method public constructor <init>()V
.locals 0
invoke-direct {p0}, Landroid/content/BroadcastReceiver;-><init>()V
return-void
.end method
.method public static completeWakefulIntent(Landroid/content/Intent;)Z
2019-12-06 03:29:40 +00:00
.locals 5
2019-07-24 11:27:29 +00:00
const/4 v0, 0x0
const-string v1, "androidx.contentpager.content.wakelockid"
invoke-virtual {p0, v1, v0}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I
move-result p0
if-nez p0, :cond_0
return v0
:cond_0
sget-object v0, Landroidx/legacy/content/WakefulBroadcastReceiver;->sActiveWakeLocks:Landroid/util/SparseArray;
monitor-enter v0
:try_start_0
sget-object v1, Landroidx/legacy/content/WakefulBroadcastReceiver;->sActiveWakeLocks:Landroid/util/SparseArray;
invoke-virtual {v1, p0}, Landroid/util/SparseArray;->get(I)Ljava/lang/Object;
move-result-object v1
check-cast v1, Landroid/os/PowerManager$WakeLock;
const/4 v2, 0x1
if-eqz v1, :cond_1
invoke-virtual {v1}, Landroid/os/PowerManager$WakeLock;->release()V
sget-object v1, Landroidx/legacy/content/WakefulBroadcastReceiver;->sActiveWakeLocks:Landroid/util/SparseArray;
invoke-virtual {v1, p0}, Landroid/util/SparseArray;->remove(I)V
monitor-exit v0
return v2
:cond_1
const-string v1, "WakefulBroadcastReceiv."
2019-12-06 03:29:40 +00:00
new-instance v3, Ljava/lang/StringBuilder;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
const-string v4, "No active wake lock id #"
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v3, p0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
2019-07-24 11:27:29 +00:00
move-result-object p0
invoke-static {v1, p0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
monitor-exit v0
return v2
:catchall_0
move-exception p0
monitor-exit v0
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
throw p0
.end method
.method public static startWakefulService(Landroid/content/Context;Landroid/content/Intent;)Landroid/content/ComponentName;
.locals 5
sget-object v0, Landroidx/legacy/content/WakefulBroadcastReceiver;->sActiveWakeLocks:Landroid/util/SparseArray;
monitor-enter v0
:try_start_0
sget v1, Landroidx/legacy/content/WakefulBroadcastReceiver;->mNextId:I
sget v2, Landroidx/legacy/content/WakefulBroadcastReceiver;->mNextId:I
const/4 v3, 0x1
add-int/2addr v2, v3
sput v2, Landroidx/legacy/content/WakefulBroadcastReceiver;->mNextId:I
2019-12-06 03:29:40 +00:00
sget v2, Landroidx/legacy/content/WakefulBroadcastReceiver;->mNextId:I
2019-07-24 11:27:29 +00:00
if-gtz v2, :cond_0
sput v3, Landroidx/legacy/content/WakefulBroadcastReceiver;->mNextId:I
:cond_0
const-string v2, "androidx.contentpager.content.wakelockid"
invoke-virtual {p1, v2, v1}, Landroid/content/Intent;->putExtra(Ljava/lang/String;I)Landroid/content/Intent;
invoke-virtual {p0, p1}, Landroid/content/Context;->startService(Landroid/content/Intent;)Landroid/content/ComponentName;
move-result-object p1
if-nez p1, :cond_1
const/4 p0, 0x0
monitor-exit v0
return-object p0
:cond_1
const-string v2, "power"
invoke-virtual {p0, v2}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object p0
check-cast p0, Landroid/os/PowerManager;
new-instance v2, Ljava/lang/StringBuilder;
2019-12-06 03:29:40 +00:00
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
2019-07-24 11:27:29 +00:00
const-string v4, "androidx.core:wake:"
2019-12-06 03:29:40 +00:00
invoke-virtual {v2, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
2019-07-24 11:27:29 +00:00
invoke-virtual {p1}, Landroid/content/ComponentName;->flattenToShortString()Ljava/lang/String;
move-result-object v4
invoke-virtual {v2, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v2
invoke-virtual {p0, v3, v2}, Landroid/os/PowerManager;->newWakeLock(ILjava/lang/String;)Landroid/os/PowerManager$WakeLock;
move-result-object p0
const/4 v2, 0x0
invoke-virtual {p0, v2}, Landroid/os/PowerManager$WakeLock;->setReferenceCounted(Z)V
const-wide/32 v2, 0xea60
invoke-virtual {p0, v2, v3}, Landroid/os/PowerManager$WakeLock;->acquire(J)V
sget-object v2, Landroidx/legacy/content/WakefulBroadcastReceiver;->sActiveWakeLocks:Landroid/util/SparseArray;
invoke-virtual {v2, v1, p0}, Landroid/util/SparseArray;->put(ILjava/lang/Object;)V
monitor-exit v0
return-object p1
:catchall_0
move-exception p0
monitor-exit v0
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
throw p0
.end method