327 lines
9.8 KiB
Smali
327 lines
9.8 KiB
Smali
.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 synthetic $$delegatedProperties:[Lkotlin/reflect/KProperty;
|
|
|
|
.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
|
|
.locals 5
|
|
|
|
const/4 v0, 0x1
|
|
|
|
new-array v0, v0, [Lkotlin/reflect/KProperty;
|
|
|
|
new-instance v1, Ly/u/b/u;
|
|
|
|
const-class v2, Lcom/discord/utilities/voice/VoiceEngineForegroundService$WakeLock;
|
|
|
|
invoke-static {v2}, Ly/u/b/x;->getOrCreateKotlinClass(Ljava/lang/Class;)Ly/y/b;
|
|
|
|
move-result-object v2
|
|
|
|
const-string v3, "proximityWakeLock"
|
|
|
|
const-string v4, "getProximityWakeLock()Landroid/os/PowerManager$WakeLock;"
|
|
|
|
invoke-direct {v1, v2, v3, v4}, Ly/u/b/u;-><init>(Lkotlin/reflect/KDeclarationContainer;Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
sget-object v2, Ly/u/b/x;->a:Ly/u/b/y;
|
|
|
|
invoke-virtual {v2, v1}, Ly/u/b/y;->property1(Ly/u/b/t;)Ly/y/d;
|
|
|
|
const/4 v2, 0x0
|
|
|
|
aput-object v1, v0, v2
|
|
|
|
sput-object v0, Lcom/discord/utilities/voice/VoiceEngineForegroundService$WakeLock;->$$delegatedProperties:[Lkotlin/reflect/KProperty;
|
|
|
|
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
|
|
|
|
const-string v0, "wifi"
|
|
|
|
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 )"
|
|
|
|
invoke-static {v0, v1}, Ly/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
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 )"
|
|
|
|
invoke-static {v0, v1}, Ly/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
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
|
|
|
|
invoke-static {v0}, Lf/n/a/j/a;->lazy(Lkotlin/jvm/functions/Function0;)Lkotlin/Lazy;
|
|
|
|
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
|
|
new-instance p1, Ly/l;
|
|
|
|
const-string v0, "null cannot be cast to non-null type android.os.PowerManager"
|
|
|
|
invoke-direct {p1, v0}, Ly/l;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
|
|
:cond_2
|
|
new-instance p1, Ly/l;
|
|
|
|
const-string v0, "null cannot be cast to non-null type android.net.wifi.WifiManager"
|
|
|
|
invoke-direct {p1, v0}, Ly/l;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
|
|
:cond_3
|
|
const-string p1, "context"
|
|
|
|
invoke-static {p1}, Ly/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
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;
|
|
.locals 3
|
|
|
|
iget-object v0, p0, Lcom/discord/utilities/voice/VoiceEngineForegroundService$WakeLock;->proximityWakeLock$delegate:Lkotlin/Lazy;
|
|
|
|
sget-object v1, Lcom/discord/utilities/voice/VoiceEngineForegroundService$WakeLock;->$$delegatedProperties:[Lkotlin/reflect/KProperty;
|
|
|
|
const/4 v2, 0x0
|
|
|
|
aget-object v1, v1, v2
|
|
|
|
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
|