163 lines
3.7 KiB
Smali
163 lines
3.7 KiB
Smali
.class public final Landroidx/core/net/ConnectivityManagerCompat;
|
|
.super Ljava/lang/Object;
|
|
.source "ConnectivityManagerCompat.java"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Landroidx/core/net/ConnectivityManagerCompat$RestrictBackgroundStatus;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field public static final RESTRICT_BACKGROUND_STATUS_DISABLED:I = 0x1
|
|
|
|
.field public static final RESTRICT_BACKGROUND_STATUS_ENABLED:I = 0x3
|
|
|
|
.field public static final RESTRICT_BACKGROUND_STATUS_WHITELISTED:I = 0x2
|
|
|
|
|
|
# direct methods
|
|
.method private constructor <init>()V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static getNetworkInfoFromBroadcast(Landroid/net/ConnectivityManager;Landroid/content/Intent;)Landroid/net/NetworkInfo;
|
|
.locals 1
|
|
.param p0 # Landroid/net/ConnectivityManager;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p1 # Landroid/content/Intent;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.annotation build Landroidx/annotation/Nullable;
|
|
.end annotation
|
|
|
|
.annotation build Landroidx/annotation/RequiresPermission;
|
|
value = "android.permission.ACCESS_NETWORK_STATE"
|
|
.end annotation
|
|
|
|
const-string v0, "networkInfo"
|
|
|
|
invoke-virtual {p1, v0}, Landroid/content/Intent;->getParcelableExtra(Ljava/lang/String;)Landroid/os/Parcelable;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Landroid/net/NetworkInfo;
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
invoke-virtual {p1}, Landroid/net/NetworkInfo;->getType()I
|
|
|
|
move-result p1
|
|
|
|
invoke-virtual {p0, p1}, Landroid/net/ConnectivityManager;->getNetworkInfo(I)Landroid/net/NetworkInfo;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
|
|
:cond_0
|
|
const/4 p0, 0x0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static getRestrictBackgroundStatus(Landroid/net/ConnectivityManager;)I
|
|
.locals 2
|
|
.param p0 # Landroid/net/ConnectivityManager;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
|
|
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
const/16 v1, 0x18
|
|
|
|
if-lt v0, v1, :cond_0
|
|
|
|
invoke-virtual {p0}, Landroid/net/ConnectivityManager;->getRestrictBackgroundStatus()I
|
|
|
|
move-result p0
|
|
|
|
return p0
|
|
|
|
:cond_0
|
|
const/4 p0, 0x3
|
|
|
|
return p0
|
|
.end method
|
|
|
|
.method public static isActiveNetworkMetered(Landroid/net/ConnectivityManager;)Z
|
|
.locals 2
|
|
.param p0 # Landroid/net/ConnectivityManager;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.annotation build Landroidx/annotation/RequiresPermission;
|
|
value = "android.permission.ACCESS_NETWORK_STATE"
|
|
.end annotation
|
|
|
|
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
const/16 v1, 0x10
|
|
|
|
if-lt v0, v1, :cond_0
|
|
|
|
invoke-virtual {p0}, Landroid/net/ConnectivityManager;->isActiveNetworkMetered()Z
|
|
|
|
move-result p0
|
|
|
|
return p0
|
|
|
|
:cond_0
|
|
invoke-virtual {p0}, Landroid/net/ConnectivityManager;->getActiveNetworkInfo()Landroid/net/NetworkInfo;
|
|
|
|
move-result-object p0
|
|
|
|
const/4 v0, 0x1
|
|
|
|
if-nez p0, :cond_1
|
|
|
|
return v0
|
|
|
|
:cond_1
|
|
invoke-virtual {p0}, Landroid/net/NetworkInfo;->getType()I
|
|
|
|
move-result p0
|
|
|
|
packed-switch p0, :pswitch_data_0
|
|
|
|
:pswitch_0
|
|
return v0
|
|
|
|
:pswitch_1
|
|
const/4 p0, 0x0
|
|
|
|
return p0
|
|
|
|
:pswitch_2
|
|
return v0
|
|
|
|
:pswitch_data_0
|
|
.packed-switch 0x0
|
|
:pswitch_2
|
|
:pswitch_1
|
|
:pswitch_2
|
|
:pswitch_2
|
|
:pswitch_2
|
|
:pswitch_2
|
|
:pswitch_2
|
|
:pswitch_1
|
|
:pswitch_0
|
|
:pswitch_1
|
|
.end packed-switch
|
|
.end method
|