204 lines
6.3 KiB
Smali
204 lines
6.3 KiB
Smali
.class public Landroidx/work/impl/background/systemalarm/ConstraintProxyUpdateReceiver;
|
|
.super Landroid/content/BroadcastReceiver;
|
|
|
|
|
|
# static fields
|
|
.field static final ACTION:Ljava/lang/String; = "androidx.work.impl.background.systemalarm.UpdateProxies"
|
|
|
|
.field static final KEY_BATTERY_CHARGING_PROXY_ENABLED:Ljava/lang/String; = "KEY_BATTERY_CHARGING_PROXY_ENABLED"
|
|
|
|
.field static final KEY_BATTERY_NOT_LOW_PROXY_ENABLED:Ljava/lang/String; = "KEY_BATTERY_NOT_LOW_PROXY_ENABLED"
|
|
|
|
.field static final KEY_NETWORK_STATE_PROXY_ENABLED:Ljava/lang/String; = "KEY_NETWORK_STATE_PROXY_ENABLED"
|
|
|
|
.field static final KEY_STORAGE_NOT_LOW_PROXY_ENABLED:Ljava/lang/String; = "KEY_STORAGE_NOT_LOW_PROXY_ENABLED"
|
|
|
|
.field private static final TAG:Ljava/lang/String; = "ConstrntProxyUpdtRecvr"
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Landroid/content/BroadcastReceiver;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static newConstraintProxyUpdateIntent(Landroid/content/Context;ZZZZ)Landroid/content/Intent;
|
|
.locals 3
|
|
|
|
new-instance v0, Landroid/content/Intent;
|
|
|
|
const-string v1, "androidx.work.impl.background.systemalarm.UpdateProxies"
|
|
|
|
invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
|
|
|
|
new-instance v1, Landroid/content/ComponentName;
|
|
|
|
const-class v2, Landroidx/work/impl/background/systemalarm/ConstraintProxyUpdateReceiver;
|
|
|
|
invoke-direct {v1, p0, v2}, Landroid/content/ComponentName;-><init>(Landroid/content/Context;Ljava/lang/Class;)V
|
|
|
|
invoke-virtual {v0, v1}, Landroid/content/Intent;->setComponent(Landroid/content/ComponentName;)Landroid/content/Intent;
|
|
|
|
const-string p0, "KEY_BATTERY_NOT_LOW_PROXY_ENABLED"
|
|
|
|
invoke-virtual {v0, p0, p1}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Z)Landroid/content/Intent;
|
|
|
|
move-result-object p0
|
|
|
|
const-string p1, "KEY_BATTERY_CHARGING_PROXY_ENABLED"
|
|
|
|
invoke-virtual {p0, p1, p2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Z)Landroid/content/Intent;
|
|
|
|
move-result-object p0
|
|
|
|
const-string p1, "KEY_STORAGE_NOT_LOW_PROXY_ENABLED"
|
|
|
|
invoke-virtual {p0, p1, p3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Z)Landroid/content/Intent;
|
|
|
|
move-result-object p0
|
|
|
|
const-string p1, "KEY_NETWORK_STATE_PROXY_ENABLED"
|
|
|
|
invoke-virtual {p0, p1, p4}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Z)Landroid/content/Intent;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public onReceive(Landroid/content/Context;Landroid/content/Intent;)V
|
|
.locals 9
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
invoke-virtual {p2}, Landroid/content/Intent;->getAction()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
const-string v1, "androidx.work.impl.background.systemalarm.UpdateProxies"
|
|
|
|
invoke-virtual {v1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v1
|
|
|
|
const/4 v2, 0x1
|
|
|
|
const/4 v3, 0x0
|
|
|
|
if-nez v1, :cond_1
|
|
|
|
const-string p1, "ConstrntProxyUpdtRecvr"
|
|
|
|
const-string p2, "Ignoring unknown action %s"
|
|
|
|
new-array v1, v2, [Ljava/lang/Object;
|
|
|
|
aput-object v0, v1, v3
|
|
|
|
invoke-static {p2, v1}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
new-array v0, v3, [Ljava/lang/Throwable;
|
|
|
|
invoke-static {p1, p2, v0}, Landroidx/work/Logger;->debug(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Throwable;)V
|
|
|
|
return-void
|
|
|
|
:cond_1
|
|
const-string v0, "KEY_BATTERY_NOT_LOW_PROXY_ENABLED"
|
|
|
|
invoke-virtual {p2, v0, v3}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z
|
|
|
|
move-result v0
|
|
|
|
const-string v1, "KEY_BATTERY_CHARGING_PROXY_ENABLED"
|
|
|
|
invoke-virtual {p2, v1, v3}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z
|
|
|
|
move-result v1
|
|
|
|
const-string v4, "KEY_STORAGE_NOT_LOW_PROXY_ENABLED"
|
|
|
|
invoke-virtual {p2, v4, v3}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z
|
|
|
|
move-result v4
|
|
|
|
const-string v5, "KEY_NETWORK_STATE_PROXY_ENABLED"
|
|
|
|
invoke-virtual {p2, v5, v3}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z
|
|
|
|
move-result p2
|
|
|
|
const-string v5, "ConstrntProxyUpdtRecvr"
|
|
|
|
const-string v6, "Updating proxies: BatteryNotLowProxy enabled (%s), BatteryChargingProxy enabled (%s), StorageNotLowProxy (%s), NetworkStateProxy enabled (%s)"
|
|
|
|
const/4 v7, 0x4
|
|
|
|
new-array v7, v7, [Ljava/lang/Object;
|
|
|
|
invoke-static {v0}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;
|
|
|
|
move-result-object v8
|
|
|
|
aput-object v8, v7, v3
|
|
|
|
invoke-static {v1}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;
|
|
|
|
move-result-object v8
|
|
|
|
aput-object v8, v7, v2
|
|
|
|
const/4 v2, 0x2
|
|
|
|
invoke-static {v4}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;
|
|
|
|
move-result-object v8
|
|
|
|
aput-object v8, v7, v2
|
|
|
|
const/4 v2, 0x3
|
|
|
|
invoke-static {p2}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;
|
|
|
|
move-result-object v8
|
|
|
|
aput-object v8, v7, v2
|
|
|
|
invoke-static {v6, v7}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
new-array v3, v3, [Ljava/lang/Throwable;
|
|
|
|
invoke-static {v5, v2, v3}, Landroidx/work/Logger;->debug(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Throwable;)V
|
|
|
|
const-class v2, Landroidx/work/impl/background/systemalarm/ConstraintProxy$BatteryNotLowProxy;
|
|
|
|
invoke-static {p1, v2, v0}, Landroidx/work/impl/utils/PackageManagerHelper;->setComponentEnabled(Landroid/content/Context;Ljava/lang/Class;Z)V
|
|
|
|
const-class v0, Landroidx/work/impl/background/systemalarm/ConstraintProxy$BatteryChargingProxy;
|
|
|
|
invoke-static {p1, v0, v1}, Landroidx/work/impl/utils/PackageManagerHelper;->setComponentEnabled(Landroid/content/Context;Ljava/lang/Class;Z)V
|
|
|
|
const-class v0, Landroidx/work/impl/background/systemalarm/ConstraintProxy$StorageNotLowProxy;
|
|
|
|
invoke-static {p1, v0, v4}, Landroidx/work/impl/utils/PackageManagerHelper;->setComponentEnabled(Landroid/content/Context;Ljava/lang/Class;Z)V
|
|
|
|
const-class v0, Landroidx/work/impl/background/systemalarm/ConstraintProxy$NetworkStateProxy;
|
|
|
|
invoke-static {p1, v0, p2}, Landroidx/work/impl/utils/PackageManagerHelper;->setComponentEnabled(Landroid/content/Context;Ljava/lang/Class;Z)V
|
|
|
|
return-void
|
|
.end method
|