TrafficStatsCompat.java
4.87 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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
package android.support.v4.net;
import android.net.TrafficStats;
import android.os.Build.VERSION;
import android.os.ParcelFileDescriptor;
import dq;
import java.net.DatagramSocket;
import java.net.Socket;
import java.net.SocketException;
public final class TrafficStatsCompat
{
private static final d a = new b();
static
{
if ("N".equals(Build.VERSION.CODENAME))
{
a = new a();
return;
}
if (Build.VERSION.SDK_INT >= 14)
{
a = new c();
return;
}
}
public static void clearThreadStatsTag()
{
a.a();
}
public static int getThreadStatsTag()
{
return a.b();
}
public static void incrementOperationCount(int paramInt)
{
a.a(paramInt);
}
public static void incrementOperationCount(int paramInt1, int paramInt2)
{
a.a(paramInt1, paramInt2);
}
public static void setThreadStatsTag(int paramInt)
{
a.b(paramInt);
}
public static void tagDatagramSocket(DatagramSocket paramDatagramSocket)
throws SocketException
{
a.a(paramDatagramSocket);
}
public static void tagSocket(Socket paramSocket)
throws SocketException
{
a.a(paramSocket);
}
public static void untagDatagramSocket(DatagramSocket paramDatagramSocket)
throws SocketException
{
a.b(paramDatagramSocket);
}
public static void untagSocket(Socket paramSocket)
throws SocketException
{
a.b(paramSocket);
}
static final class a
extends TrafficStatsCompat.c
{
public final void a(DatagramSocket paramDatagramSocket)
throws SocketException
{
TrafficStatsCompatApi24.tagDatagramSocket(paramDatagramSocket);
}
public final void b(DatagramSocket paramDatagramSocket)
throws SocketException
{
TrafficStatsCompatApi24.untagDatagramSocket(paramDatagramSocket);
}
}
static final class b
implements TrafficStatsCompat.d
{
private ThreadLocal<a> a = new ThreadLocal() {};
public final void a()
{
((a)this.a.get()).a = -1;
}
public final void a(int paramInt) {}
public final void a(int paramInt1, int paramInt2) {}
public final void a(DatagramSocket paramDatagramSocket) {}
public final void a(Socket paramSocket) {}
public final int b()
{
return ((a)this.a.get()).a;
}
public final void b(int paramInt)
{
((a)this.a.get()).a = paramInt;
}
public final void b(DatagramSocket paramDatagramSocket) {}
public final void b(Socket paramSocket) {}
static final class a
{
public int a = -1;
}
}
static class c
implements TrafficStatsCompat.d
{
public final void a() {}
public final void a(int paramInt)
{
TrafficStats.incrementOperationCount(paramInt);
}
public final void a(int paramInt1, int paramInt2)
{
TrafficStats.incrementOperationCount(paramInt1, paramInt2);
}
public void a(DatagramSocket paramDatagramSocket)
throws SocketException
{
ParcelFileDescriptor localParcelFileDescriptor = ParcelFileDescriptor.fromDatagramSocket(paramDatagramSocket);
TrafficStats.tagSocket(new dq(paramDatagramSocket, localParcelFileDescriptor.getFileDescriptor()));
localParcelFileDescriptor.detachFd();
}
public final void a(Socket paramSocket)
throws SocketException
{
TrafficStats.tagSocket(paramSocket);
}
public final int b()
{
return TrafficStats.getThreadStatsTag();
}
public final void b(int paramInt)
{
TrafficStats.setThreadStatsTag(paramInt);
}
public void b(DatagramSocket paramDatagramSocket)
throws SocketException
{
ParcelFileDescriptor localParcelFileDescriptor = ParcelFileDescriptor.fromDatagramSocket(paramDatagramSocket);
TrafficStats.untagSocket(new dq(paramDatagramSocket, localParcelFileDescriptor.getFileDescriptor()));
localParcelFileDescriptor.detachFd();
}
public final void b(Socket paramSocket)
throws SocketException
{
TrafficStats.untagSocket(paramSocket);
}
}
static abstract interface d
{
public abstract void a();
public abstract void a(int paramInt);
public abstract void a(int paramInt1, int paramInt2);
public abstract void a(DatagramSocket paramDatagramSocket)
throws SocketException;
public abstract void a(Socket paramSocket)
throws SocketException;
public abstract int b();
public abstract void b(int paramInt);
public abstract void b(DatagramSocket paramDatagramSocket)
throws SocketException;
public abstract void b(Socket paramSocket)
throws SocketException;
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/android/support/v4/net/TrafficStatsCompat.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/