ConnectivityManagerCompat.java
3.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
package android.support.v4.net;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Build.VERSION;
import android.support.annotation.RestrictTo;
import java.lang.annotation.Annotation;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
public final class ConnectivityManagerCompat
{
public static final int RESTRICT_BACKGROUND_STATUS_DISABLED = 1;
public static final int RESTRICT_BACKGROUND_STATUS_ENABLED = 3;
public static final int RESTRICT_BACKGROUND_STATUS_WHITELISTED = 2;
private static final c a = new b();
static
{
if (Build.VERSION.SDK_INT >= 24)
{
a = new a();
return;
}
if (Build.VERSION.SDK_INT >= 16)
{
a = new e();
return;
}
if (Build.VERSION.SDK_INT >= 13)
{
a = new d();
return;
}
}
public static NetworkInfo getNetworkInfoFromBroadcast(ConnectivityManager paramConnectivityManager, Intent paramIntent)
{
paramIntent = (NetworkInfo)paramIntent.getParcelableExtra("networkInfo");
if (paramIntent != null) {
return paramConnectivityManager.getNetworkInfo(paramIntent.getType());
}
return null;
}
public static int getRestrictBackgroundStatus(ConnectivityManager paramConnectivityManager)
{
return a.a(paramConnectivityManager);
}
public static boolean isActiveNetworkMetered(ConnectivityManager paramConnectivityManager)
{
return a.b(paramConnectivityManager);
}
@Retention(RetentionPolicy.SOURCE)
@RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP})
public static @interface RestrictBackgroundStatus {}
static final class a
extends ConnectivityManagerCompat.e
{
public final int a(ConnectivityManager paramConnectivityManager)
{
return paramConnectivityManager.getRestrictBackgroundStatus();
}
}
static class b
implements ConnectivityManagerCompat.c
{
public int a(ConnectivityManager paramConnectivityManager)
{
return 3;
}
public boolean b(ConnectivityManager paramConnectivityManager)
{
paramConnectivityManager = paramConnectivityManager.getActiveNetworkInfo();
if (paramConnectivityManager == null) {
return true;
}
switch (paramConnectivityManager.getType())
{
case 0:
case 2:
case 3:
case 4:
case 5:
case 6:
default:
return true;
}
return false;
}
}
static abstract interface c
{
public abstract int a(ConnectivityManager paramConnectivityManager);
public abstract boolean b(ConnectivityManager paramConnectivityManager);
}
static class d
extends ConnectivityManagerCompat.b
{
public boolean b(ConnectivityManager paramConnectivityManager)
{
paramConnectivityManager = paramConnectivityManager.getActiveNetworkInfo();
if (paramConnectivityManager != null) {}
switch (paramConnectivityManager.getType())
{
case 0:
case 2:
case 3:
case 4:
case 5:
case 6:
case 8:
default:
return true;
}
return false;
}
}
static class e
extends ConnectivityManagerCompat.d
{
public final boolean b(ConnectivityManager paramConnectivityManager)
{
return paramConnectivityManager.isActiveNetworkMetered();
}
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/android/support/v4/net/ConnectivityManagerCompat.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/