128 lines
3.2 KiB
Smali
128 lines
3.2 KiB
Smali
.class public Landroidx/work/impl/constraints/controllers/NetworkConnectedController;
|
|
.super Landroidx/work/impl/constraints/controllers/ConstraintController;
|
|
.source "NetworkConnectedController.java"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Landroidx/work/impl/constraints/controllers/ConstraintController<",
|
|
"Landroidx/work/impl/constraints/NetworkState;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# direct methods
|
|
.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;->CONNECTED: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 4
|
|
.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, 0x1a
|
|
|
|
if-lt v0, v3, :cond_2
|
|
|
|
invoke-virtual {p1}, Landroidx/work/impl/constraints/NetworkState;->isConnected()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
invoke-virtual {p1}, Landroidx/work/impl/constraints/NetworkState;->isValidated()Z
|
|
|
|
move-result p1
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
return v2
|
|
|
|
:cond_1
|
|
:goto_0
|
|
return v1
|
|
|
|
:cond_2
|
|
invoke-virtual {p1}, Landroidx/work/impl/constraints/NetworkState;->isConnected()Z
|
|
|
|
move-result p1
|
|
|
|
if-nez p1, :cond_3
|
|
|
|
return v1
|
|
|
|
:cond_3
|
|
return v2
|
|
.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/NetworkConnectedController;->isConstrained(Landroidx/work/impl/constraints/NetworkState;)Z
|
|
|
|
move-result p1
|
|
|
|
return p1
|
|
.end method
|