158 lines
4.1 KiB
Smali
158 lines
4.1 KiB
Smali
.class public Landroidx/work/impl/constraints/controllers/NetworkNotRoamingController;
|
|
.super Landroidx/work/impl/constraints/controllers/ConstraintController;
|
|
.source "NetworkNotRoamingController.java"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Landroidx/work/impl/constraints/controllers/ConstraintController<",
|
|
"Landroidx/work/impl/constraints/NetworkState;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field private static final TAG:Ljava/lang/String;
|
|
|
|
|
|
# direct methods
|
|
.method static constructor <clinit>()V
|
|
.locals 1
|
|
|
|
const-string v0, "NetworkNotRoamingCtrlr"
|
|
|
|
invoke-static {v0}, Landroidx/work/Logger;->tagWithPrefix(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
sput-object v0, Landroidx/work/impl/constraints/controllers/NetworkNotRoamingController;->TAG:Ljava/lang/String;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(Landroid/content/Context;)V
|
|
.locals 0
|
|
|
|
invoke-static {p1}, Landroidx/work/impl/constraints/trackers/Trackers;->getInstance(Landroid/content/Context;)Landroidx/work/impl/constraints/trackers/Trackers;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1}, Landroidx/work/impl/constraints/trackers/Trackers;->getNetworkStateTracker()Landroidx/work/impl/constraints/trackers/NetworkStateTracker;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {p0, p1}, Landroidx/work/impl/constraints/controllers/ConstraintController;-><init>(Landroidx/work/impl/constraints/trackers/ConstraintTracker;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method hasConstraint(Landroidx/work/impl/model/WorkSpec;)Z
|
|
.locals 1
|
|
.param p1 # Landroidx/work/impl/model/WorkSpec;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
|
|
iget-object p1, p1, Landroidx/work/impl/model/WorkSpec;->constraints:Landroidx/work/Constraints;
|
|
|
|
invoke-virtual {p1}, Landroidx/work/Constraints;->getRequiredNetworkType()Landroidx/work/NetworkType;
|
|
|
|
move-result-object p1
|
|
|
|
sget-object v0, Landroidx/work/NetworkType;->NOT_ROAMING:Landroidx/work/NetworkType;
|
|
|
|
if-ne p1, v0, :cond_0
|
|
|
|
const/4 p1, 0x1
|
|
|
|
return p1
|
|
|
|
:cond_0
|
|
const/4 p1, 0x0
|
|
|
|
return p1
|
|
.end method
|
|
|
|
.method isConstrained(Landroidx/work/impl/constraints/NetworkState;)Z
|
|
.locals 6
|
|
.param p1 # Landroidx/work/impl/constraints/NetworkState;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
|
|
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
const/4 v1, 0x1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
const/16 v3, 0x18
|
|
|
|
if-ge v0, v3, :cond_1
|
|
|
|
invoke-static {}, Landroidx/work/Logger;->get()Landroidx/work/Logger;
|
|
|
|
move-result-object v0
|
|
|
|
sget-object v3, Landroidx/work/impl/constraints/controllers/NetworkNotRoamingController;->TAG:Ljava/lang/String;
|
|
|
|
new-array v4, v2, [Ljava/lang/Throwable;
|
|
|
|
const-string v5, "Not-roaming network constraint is not supported before API 24, only checking for connected state."
|
|
|
|
invoke-virtual {v0, v3, v5, v4}, Landroidx/work/Logger;->debug(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Throwable;)V
|
|
|
|
invoke-virtual {p1}, Landroidx/work/impl/constraints/NetworkState;->isConnected()Z
|
|
|
|
move-result p1
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
return v1
|
|
|
|
:cond_0
|
|
return v2
|
|
|
|
:cond_1
|
|
invoke-virtual {p1}, Landroidx/work/impl/constraints/NetworkState;->isConnected()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_3
|
|
|
|
invoke-virtual {p1}, Landroidx/work/impl/constraints/NetworkState;->isNotRoaming()Z
|
|
|
|
move-result p1
|
|
|
|
if-nez p1, :cond_2
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
return v2
|
|
|
|
:cond_3
|
|
:goto_0
|
|
return v1
|
|
.end method
|
|
|
|
.method bridge synthetic isConstrained(Ljava/lang/Object;)Z
|
|
.locals 0
|
|
.param p1 # Ljava/lang/Object;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
|
|
check-cast p1, Landroidx/work/impl/constraints/NetworkState;
|
|
|
|
invoke-virtual {p0, p1}, Landroidx/work/impl/constraints/controllers/NetworkNotRoamingController;->isConstrained(Landroidx/work/impl/constraints/NetworkState;)Z
|
|
|
|
move-result p1
|
|
|
|
return p1
|
|
.end method
|