zzm.java
8.53 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
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
package com.google.android.gms.common.internal;
import android.os.Bundle;
import android.os.Handler;
import android.os.Handler.Callback;
import android.os.Looper;
import android.os.Message;
import android.util.Log;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks;
import com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.concurrent.atomic.AtomicInteger;
public final class zzm
implements Handler.Callback
{
final ArrayList<GoogleApiClient.ConnectionCallbacks> a = new ArrayList();
private final zza b;
private final ArrayList<GoogleApiClient.ConnectionCallbacks> c = new ArrayList();
private final ArrayList<GoogleApiClient.OnConnectionFailedListener> d = new ArrayList();
private volatile boolean e = false;
private final AtomicInteger f = new AtomicInteger(0);
private boolean g = false;
private final Handler h;
private final Object i = new Object();
public zzm(Looper paramLooper, zza paramzza)
{
this.b = paramzza;
this.h = new Handler(paramLooper, this);
}
public final boolean handleMessage(Message arg1)
{
if (???.what == 1)
{
GoogleApiClient.ConnectionCallbacks localConnectionCallbacks = (GoogleApiClient.ConnectionCallbacks)???.obj;
synchronized (this.i)
{
if ((this.e) && (this.b.isConnected()) && (this.c.contains(localConnectionCallbacks))) {
localConnectionCallbacks.onConnected(this.b.zzuC());
}
return true;
}
}
int j = ???.what;
Log.wtf("GmsClientEvents", 45 + "Don't know how to handle message: " + j, new Exception());
return false;
}
public final boolean isConnectionCallbacksRegistered(GoogleApiClient.ConnectionCallbacks paramConnectionCallbacks)
{
zzac.zzw(paramConnectionCallbacks);
synchronized (this.i)
{
boolean bool = this.c.contains(paramConnectionCallbacks);
return bool;
}
}
public final boolean isConnectionFailedListenerRegistered(GoogleApiClient.OnConnectionFailedListener paramOnConnectionFailedListener)
{
zzac.zzw(paramOnConnectionFailedListener);
synchronized (this.i)
{
boolean bool = this.d.contains(paramOnConnectionFailedListener);
return bool;
}
}
public final void registerConnectionCallbacks(GoogleApiClient.ConnectionCallbacks paramConnectionCallbacks)
{
zzac.zzw(paramConnectionCallbacks);
synchronized (this.i)
{
if (this.c.contains(paramConnectionCallbacks))
{
String str = String.valueOf(paramConnectionCallbacks);
Log.w("GmsClientEvents", String.valueOf(str).length() + 62 + "registerConnectionCallbacks(): listener " + str + " is already registered");
if (this.b.isConnected()) {
this.h.sendMessage(this.h.obtainMessage(1, paramConnectionCallbacks));
}
return;
}
this.c.add(paramConnectionCallbacks);
}
}
public final void registerConnectionFailedListener(GoogleApiClient.OnConnectionFailedListener paramOnConnectionFailedListener)
{
zzac.zzw(paramOnConnectionFailedListener);
synchronized (this.i)
{
if (this.d.contains(paramOnConnectionFailedListener))
{
paramOnConnectionFailedListener = String.valueOf(paramOnConnectionFailedListener);
Log.w("GmsClientEvents", String.valueOf(paramOnConnectionFailedListener).length() + 67 + "registerConnectionFailedListener(): listener " + paramOnConnectionFailedListener + " is already registered");
return;
}
this.d.add(paramOnConnectionFailedListener);
}
}
public final void unregisterConnectionCallbacks(GoogleApiClient.ConnectionCallbacks paramConnectionCallbacks)
{
zzac.zzw(paramConnectionCallbacks);
synchronized (this.i)
{
if (!this.c.remove(paramConnectionCallbacks))
{
paramConnectionCallbacks = String.valueOf(paramConnectionCallbacks);
Log.w("GmsClientEvents", String.valueOf(paramConnectionCallbacks).length() + 52 + "unregisterConnectionCallbacks(): listener " + paramConnectionCallbacks + " not found");
}
while (!this.g) {
return;
}
this.a.add(paramConnectionCallbacks);
}
}
public final void unregisterConnectionFailedListener(GoogleApiClient.OnConnectionFailedListener paramOnConnectionFailedListener)
{
zzac.zzw(paramOnConnectionFailedListener);
synchronized (this.i)
{
if (!this.d.remove(paramOnConnectionFailedListener))
{
paramOnConnectionFailedListener = String.valueOf(paramOnConnectionFailedListener);
Log.w("GmsClientEvents", String.valueOf(paramOnConnectionFailedListener).length() + 57 + "unregisterConnectionFailedListener(): listener " + paramOnConnectionFailedListener + " not found");
}
return;
}
}
public final void zzcV(int paramInt)
{
boolean bool = false;
if (Looper.myLooper() == this.h.getLooper()) {
bool = true;
}
zzac.zza(bool, "onUnintentionalDisconnection must only be called on the Handler thread");
this.h.removeMessages(1);
synchronized (this.i)
{
this.g = true;
Object localObject2 = new ArrayList(this.c);
int j = this.f.get();
localObject2 = ((ArrayList)localObject2).iterator();
while (((Iterator)localObject2).hasNext())
{
GoogleApiClient.ConnectionCallbacks localConnectionCallbacks = (GoogleApiClient.ConnectionCallbacks)((Iterator)localObject2).next();
if ((this.e) && (this.f.get() == j)) {
if (this.c.contains(localConnectionCallbacks)) {
localConnectionCallbacks.onConnectionSuspended(paramInt);
}
}
}
}
this.a.clear();
this.g = false;
}
public final void zzn(ConnectionResult paramConnectionResult)
{
if (Looper.myLooper() == this.h.getLooper()) {}
for (boolean bool = true;; bool = false)
{
zzac.zza(bool, "onConnectionFailure must only be called on the Handler thread");
this.h.removeMessages(1);
synchronized (this.i)
{
Object localObject2 = new ArrayList(this.d);
int j = this.f.get();
localObject2 = ((ArrayList)localObject2).iterator();
while (((Iterator)localObject2).hasNext())
{
GoogleApiClient.OnConnectionFailedListener localOnConnectionFailedListener = (GoogleApiClient.OnConnectionFailedListener)((Iterator)localObject2).next();
if ((!this.e) || (this.f.get() != j)) {
return;
}
if (this.d.contains(localOnConnectionFailedListener)) {
localOnConnectionFailedListener.onConnectionFailed(paramConnectionResult);
}
}
}
return;
}
}
public final void zzq(Bundle paramBundle)
{
boolean bool2 = true;
boolean bool1;
if (Looper.myLooper() == this.h.getLooper())
{
bool1 = true;
zzac.zza(bool1, "onConnectionSuccess must only be called on the Handler thread");
}
for (;;)
{
synchronized (this.i)
{
if (this.g) {
break label190;
}
bool1 = true;
zzac.zzaw(bool1);
this.h.removeMessages(1);
this.g = true;
if (this.a.size() != 0) {
break label195;
}
bool1 = bool2;
zzac.zzaw(bool1);
Object localObject2 = new ArrayList(this.c);
int j = this.f.get();
localObject2 = ((ArrayList)localObject2).iterator();
if (!((Iterator)localObject2).hasNext()) {
break label200;
}
GoogleApiClient.ConnectionCallbacks localConnectionCallbacks = (GoogleApiClient.ConnectionCallbacks)((Iterator)localObject2).next();
if ((!this.e) || (!this.b.isConnected()) || (this.f.get() != j)) {
break label200;
}
if (this.a.contains(localConnectionCallbacks)) {
continue;
}
localConnectionCallbacks.onConnected(paramBundle);
}
bool1 = false;
break;
label190:
bool1 = false;
continue;
label195:
bool1 = false;
}
label200:
this.a.clear();
this.g = false;
}
public final void zzxX()
{
this.e = false;
this.f.incrementAndGet();
}
public final void zzxY()
{
this.e = true;
}
public static abstract interface zza
{
public abstract boolean isConnected();
public abstract Bundle zzuC();
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/com/google/android/gms/common/internal/zzm.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/