2020-05-17 12:40:10 +00:00
|
|
|
.class public final Lcom/discord/utilities/voice/VoiceEngineForegroundService$WakeLock;
|
|
|
|
.super Ljava/lang/Object;
|
|
|
|
.source "VoiceEngineForegroundService.kt"
|
|
|
|
|
|
|
|
|
|
|
|
# annotations
|
|
|
|
.annotation system Ldalvik/annotation/EnclosingClass;
|
|
|
|
value = Lcom/discord/utilities/voice/VoiceEngineForegroundService;
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
.annotation system Ldalvik/annotation/InnerClass;
|
|
|
|
accessFlags = 0x19
|
|
|
|
name = "WakeLock"
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
|
|
value = {
|
|
|
|
Lcom/discord/utilities/voice/VoiceEngineForegroundService$WakeLock$Companion;
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
|
|
|
|
# static fields
|
|
|
|
.field public static final Companion:Lcom/discord/utilities/voice/VoiceEngineForegroundService$WakeLock$Companion;
|
|
|
|
|
|
|
|
.field public static final TAG_POWER:Ljava/lang/String; = "discord:TAG_POWER"
|
|
|
|
|
|
|
|
.field public static final TAG_PROXIMITY:Ljava/lang/String; = "discord:TAG_PROXIMITY"
|
|
|
|
|
|
|
|
.field public static final TAG_WIFI:Ljava/lang/String; = "discord:TAG_WIFI"
|
|
|
|
|
|
|
|
|
|
|
|
# instance fields
|
|
|
|
.field public final proximityWakeLock$delegate:Lkotlin/Lazy;
|
|
|
|
|
|
|
|
.field public final wakeLock:Landroid/os/PowerManager$WakeLock;
|
|
|
|
|
|
|
|
.field public final wakeLockWifi:Landroid/net/wifi/WifiManager$WifiLock;
|
|
|
|
|
|
|
|
|
|
|
|
# direct methods
|
|
|
|
.method public static constructor <clinit>()V
|
2020-07-08 16:44:49 +00:00
|
|
|
.locals 2
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
new-instance v0, Lcom/discord/utilities/voice/VoiceEngineForegroundService$WakeLock$Companion;
|
|
|
|
|
|
|
|
const/4 v1, 0x0
|
|
|
|
|
|
|
|
invoke-direct {v0, v1}, Lcom/discord/utilities/voice/VoiceEngineForegroundService$WakeLock$Companion;-><init>(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
|
|
|
|
|
|
|
|
sput-object v0, Lcom/discord/utilities/voice/VoiceEngineForegroundService$WakeLock;->Companion:Lcom/discord/utilities/voice/VoiceEngineForegroundService$WakeLock$Companion;
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public constructor <init>(Landroid/app/Application;)V
|
|
|
|
.locals 3
|
|
|
|
|
|
|
|
if-eqz p1, :cond_3
|
|
|
|
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
|
2020-07-23 01:06:17 +00:00
|
|
|
const-string/jumbo v0, "wifi"
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
invoke-virtual {p1, v0}, Landroid/app/Application;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
|
|
|
|
check-cast v0, Landroid/net/wifi/WifiManager;
|
|
|
|
|
|
|
|
const/4 v1, 0x3
|
|
|
|
|
|
|
|
const-string v2, "discord:TAG_WIFI"
|
|
|
|
|
|
|
|
invoke-virtual {v0, v1, v2}, Landroid/net/wifi/WifiManager;->createWifiLock(ILjava/lang/String;)Landroid/net/wifi/WifiManager$WifiLock;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
const-string v1, "(context.getSystemServic\u2026 TAG_WIFI\n )"
|
|
|
|
|
2020-07-25 00:57:58 +00:00
|
|
|
invoke-static {v0, v1}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
iput-object v0, p0, Lcom/discord/utilities/voice/VoiceEngineForegroundService$WakeLock;->wakeLockWifi:Landroid/net/wifi/WifiManager$WifiLock;
|
|
|
|
|
|
|
|
const-string v0, "power"
|
|
|
|
|
|
|
|
invoke-virtual {p1, v0}, Landroid/app/Application;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
|
|
|
|
check-cast v0, Landroid/os/PowerManager;
|
|
|
|
|
|
|
|
const/4 v1, 0x1
|
|
|
|
|
|
|
|
const-string v2, "discord:TAG_POWER"
|
|
|
|
|
|
|
|
invoke-virtual {v0, v1, v2}, Landroid/os/PowerManager;->newWakeLock(ILjava/lang/String;)Landroid/os/PowerManager$WakeLock;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
const-string v1, "(context.getSystemServic\u2026 TAG_POWER\n )"
|
|
|
|
|
2020-07-25 00:57:58 +00:00
|
|
|
invoke-static {v0, v1}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
iput-object v0, p0, Lcom/discord/utilities/voice/VoiceEngineForegroundService$WakeLock;->wakeLock:Landroid/os/PowerManager$WakeLock;
|
|
|
|
|
|
|
|
new-instance v0, Lcom/discord/utilities/voice/VoiceEngineForegroundService$WakeLock$proximityWakeLock$2;
|
|
|
|
|
|
|
|
invoke-direct {v0, p1}, Lcom/discord/utilities/voice/VoiceEngineForegroundService$WakeLock$proximityWakeLock$2;-><init>(Landroid/app/Application;)V
|
|
|
|
|
2020-07-25 02:57:47 +00:00
|
|
|
invoke-static {v0}, Lf/n/a/k/a;->lazy(Lkotlin/jvm/functions/Function0;)Lkotlin/Lazy;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
iput-object p1, p0, Lcom/discord/utilities/voice/VoiceEngineForegroundService$WakeLock;->proximityWakeLock$delegate:Lkotlin/Lazy;
|
|
|
|
|
|
|
|
invoke-virtual {p0}, Lcom/discord/utilities/voice/VoiceEngineForegroundService$WakeLock;->getProximityWakeLock()Landroid/os/PowerManager$WakeLock;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
|
|
|
|
const/4 v0, 0x0
|
|
|
|
|
|
|
|
invoke-virtual {p1, v0}, Landroid/os/PowerManager$WakeLock;->setReferenceCounted(Z)V
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
return-void
|
|
|
|
|
|
|
|
:cond_1
|
2020-07-08 16:44:49 +00:00
|
|
|
new-instance p1, Lkotlin/TypeCastException;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
const-string v0, "null cannot be cast to non-null type android.os.PowerManager"
|
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
invoke-direct {p1, v0}, Lkotlin/TypeCastException;-><init>(Ljava/lang/String;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
throw p1
|
|
|
|
|
|
|
|
:cond_2
|
2020-07-08 16:44:49 +00:00
|
|
|
new-instance p1, Lkotlin/TypeCastException;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
const-string v0, "null cannot be cast to non-null type android.net.wifi.WifiManager"
|
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
invoke-direct {p1, v0}, Lkotlin/TypeCastException;-><init>(Ljava/lang/String;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
throw p1
|
|
|
|
|
|
|
|
:cond_3
|
|
|
|
const-string p1, "context"
|
|
|
|
|
2020-07-25 00:57:58 +00:00
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
const/4 p1, 0x0
|
|
|
|
|
|
|
|
throw p1
|
|
|
|
.end method
|
|
|
|
|
|
|
|
|
|
|
|
# virtual methods
|
|
|
|
.method public final acquire()V
|
|
|
|
.locals 3
|
|
|
|
|
|
|
|
iget-object v0, p0, Lcom/discord/utilities/voice/VoiceEngineForegroundService$WakeLock;->wakeLock:Landroid/os/PowerManager$WakeLock;
|
|
|
|
|
|
|
|
const-wide/32 v1, 0x6ddd00
|
|
|
|
|
|
|
|
invoke-virtual {v0, v1, v2}, Landroid/os/PowerManager$WakeLock;->acquire(J)V
|
|
|
|
|
|
|
|
iget-object v0, p0, Lcom/discord/utilities/voice/VoiceEngineForegroundService$WakeLock;->wakeLockWifi:Landroid/net/wifi/WifiManager$WifiLock;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Landroid/net/wifi/WifiManager$WifiLock;->acquire()V
|
|
|
|
|
|
|
|
invoke-virtual {p0}, Lcom/discord/utilities/voice/VoiceEngineForegroundService$WakeLock;->acquireProximityLock()V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public final acquireProximityLock()V
|
|
|
|
.locals 3
|
|
|
|
|
|
|
|
invoke-virtual {p0}, Lcom/discord/utilities/voice/VoiceEngineForegroundService$WakeLock;->getProximityWakeLock()Landroid/os/PowerManager$WakeLock;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
|
|
|
|
const-wide/32 v1, 0x6ddd00
|
|
|
|
|
|
|
|
invoke-virtual {v0, v1, v2}, Landroid/os/PowerManager$WakeLock;->acquire(J)V
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public final getProximityWakeLock()Landroid/os/PowerManager$WakeLock;
|
2020-07-08 16:44:49 +00:00
|
|
|
.locals 1
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
iget-object v0, p0, Lcom/discord/utilities/voice/VoiceEngineForegroundService$WakeLock;->proximityWakeLock$delegate:Lkotlin/Lazy;
|
|
|
|
|
|
|
|
invoke-interface {v0}, Lkotlin/Lazy;->getValue()Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
check-cast v0, Landroid/os/PowerManager$WakeLock;
|
|
|
|
|
|
|
|
return-object v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public final getWakeLock()Landroid/os/PowerManager$WakeLock;
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
iget-object v0, p0, Lcom/discord/utilities/voice/VoiceEngineForegroundService$WakeLock;->wakeLock:Landroid/os/PowerManager$WakeLock;
|
|
|
|
|
|
|
|
return-object v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public final getWakeLockWifi()Landroid/net/wifi/WifiManager$WifiLock;
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
iget-object v0, p0, Lcom/discord/utilities/voice/VoiceEngineForegroundService$WakeLock;->wakeLockWifi:Landroid/net/wifi/WifiManager$WifiLock;
|
|
|
|
|
|
|
|
return-object v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public final release()V
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
iget-object v0, p0, Lcom/discord/utilities/voice/VoiceEngineForegroundService$WakeLock;->wakeLock:Landroid/os/PowerManager$WakeLock;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Landroid/os/PowerManager$WakeLock;->isHeld()Z
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
|
|
|
|
iget-object v0, p0, Lcom/discord/utilities/voice/VoiceEngineForegroundService$WakeLock;->wakeLock:Landroid/os/PowerManager$WakeLock;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Landroid/os/PowerManager$WakeLock;->release()V
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
iget-object v0, p0, Lcom/discord/utilities/voice/VoiceEngineForegroundService$WakeLock;->wakeLockWifi:Landroid/net/wifi/WifiManager$WifiLock;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Landroid/net/wifi/WifiManager$WifiLock;->isHeld()Z
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
|
|
|
|
iget-object v0, p0, Lcom/discord/utilities/voice/VoiceEngineForegroundService$WakeLock;->wakeLockWifi:Landroid/net/wifi/WifiManager$WifiLock;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Landroid/net/wifi/WifiManager$WifiLock;->release()V
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
invoke-virtual {p0}, Lcom/discord/utilities/voice/VoiceEngineForegroundService$WakeLock;->releaseProximityLock()V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public final releaseProximityLock()V
|
|
|
|
.locals 2
|
|
|
|
|
|
|
|
invoke-virtual {p0}, Lcom/discord/utilities/voice/VoiceEngineForegroundService$WakeLock;->getProximityWakeLock()Landroid/os/PowerManager$WakeLock;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Landroid/os/PowerManager$WakeLock;->isHeld()Z
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
const/4 v1, 0x1
|
|
|
|
|
|
|
|
if-ne v0, v1, :cond_0
|
|
|
|
|
|
|
|
invoke-virtual {p0}, Lcom/discord/utilities/voice/VoiceEngineForegroundService$WakeLock;->getProximityWakeLock()Landroid/os/PowerManager$WakeLock;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Landroid/os/PowerManager$WakeLock;->release()V
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
return-void
|
|
|
|
.end method
|